"2566647","1","2566666","","2010-04-02 12:33:56","1","516","<p>if i add string in a TextView for example,</p><pre><code>this is my string</code></pre><p>and TextView max length is 4</p><p>It should look like in activity <code>this...</code> or <code>t...</code> that means string continue sign at the end of assigned string if string size is bigger than Max length.</p><p>Can any one guide me what should i do or i will have to manually add ""..."" at the end of string through programming.</p><p>Any help would be appreciated.</p>","249991","","126039","","2010-04-02 12:38:38","2010-04-02 12:40:11","how to add Continue String Sign like ""..."" in TextView?","<android><textview>","1","1","","",""
"2566819","1","2566835","","2010-04-02 13:21:44","2","2783","<p>what is annotation class. what is the use of it in java/android. </p><p>In iphone Annotation is used to drop a pin on the map..</p><p>java has java.lang.Annotation package... what is the use of it? can i have a examples, tutorials,sample codes, etc?</p>","267269","","21234","","2011-11-02 23:05:48","2011-11-02 23:05:48","What's the difference between ""annotation"" in the Java sense and in the iPhone SDK sense?","<java><android><annotations>","2","1","2","",""
"2566827","1","","","2010-04-02 13:24:09","0","469","<p>We are designing a system with a PC base station and 100 Android mobiles communicating over WiFi. They will use XLM-RPC as the method of mobile to base station communication. However, sometimes the base station needs to broadcast a message to all mobiles. Should we use ""http server push"" for this, ie, have the base station leave the connections open to all the mobiles? Is there a better way? Publish-subscribe is possible, but doesn't seem mature on Android yet.</p>","307690","","","","","2010-10-07 19:35:38","Doing broadcasts with http server push?","<android><web-services><push>","1","0","","",""
"2566852","1","2566880","","2010-04-02 13:30:48","7","10244","<p>in android application development, i frequently go through the word ""CALLBACK"" in many places. i want to know want it means to tell us technically. and how i can manage the callback of the applications. i would need a guidance to understand about it....</p>","267269","","","","","2011-02-19 02:44:30","callback in android?","<android><android-emulator>","2","1","1","",""
"2567011","1","","","2010-04-02 14:02:28","0","2557","<p>I have created custom listview which contain Imageview+TextView+Checkbox Now  my problem is that i have to get which row's check box is checked. </p><p>Xml row.xml </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:gravity=""center_vertical"" android:layout_height=""60dip""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout03""        android:orientation=""vertical"" android:gravity=""center_vertical""        android:layout_marginLeft=""10dip"" android:layout_height=""60dip""        android:layout_width=""260dip""&gt;        &lt;TextView android:id=""@+id/desc"" android:layout_width=""fill_parent""            android:layout_height=""40dip"" android:ellipsize=""marquee""            android:text=""Text"" android:textSize=""20dip"" android:textStyle=""bold""            android:gravity=""center_vertical"" android:textColor=""@color/black"" /&gt;        &lt;TextView android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Phone number""            android:id=""@+id/phone_no"" android:textColor=""@color/black""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_width=""fill_parent"" android:gravity=""center_vertical""        android:layout_height=""60dip""&gt;        &lt;CheckBox android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/chk_number""&gt;&lt;/CheckBox&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>and Adapter is:</p><pre><code>class ContactList extends ArrayAdapter{    Activity context;    public ContactList(Activity context) {        super(context, R.layout.row,names);        this.context = context;    }public View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater = context.getLayoutInflater();    View row = inflater.inflate(R.layout.row, null);    TextView Name = (TextView) row.findViewById(R.id.desc);    TextView Number = (TextView) row.findViewById(R.id.phone_no);    Name.setText(names.get(position));    Number.setText(numbers.get(position));    CheckBox checkboxnumberScramble = (CheckBox) row.findViewWithTag(R.id.chk_number);    checkboxnumberScramble.setChecked(true);    checkboxnumberScramble.setOnCheckedChangeListener(new OnCheckedChangeListener() {        public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {            if (isChecked) {                 setCheckboxflag(true);            }else{                setCheckboxflag(false);            }         }    });    return (row);    }}</code></pre><p>I get exception on onCreate of my Activity .</p>","193583","","","","","2012-06-28 05:16:45","Android Custom Listview","<android><listview>","3","2","1","",""
"2567012","1","2567083","","2010-04-02 14:02:54","11","11214","<p>what are kinds of animation techniques in android?</p><p>can u tell me the example codes, tutorials for that?</p><p><strong>Note: tween and frame animation in the documentation is not enough.....</strong></p>","267269","","267269","","2010-09-27 09:10:59","2011-05-03 14:52:40","kinds of animation techniques in android?","<android><android-animation>","1","0","8","2014-04-03 19:38:53",""
"2567030","1","","","2010-04-02 14:07:45","2","1081","<p>We're building an Android app with target SDK 1.6, so it will run on 1.6 devices and higher.  We'd like to support Live Wallpapers, which we know is 2.1+ only.  Is there a way to build one app with 1.6 SDK as the target, but detect if the device it's running on is 2.1, and only in that scenario call the live wallpaper API.</p><p>We're trying to avoid having to build a separate 1.6 and 2.1 versions, and would like to be able to support Live Wallpapers for only 2.1 devices.  So to be clear- 1 app, that can support 1.6 and higher, and support live wallpapers for 2.1 devices.</p><p>Any way of doing this?</p>","307706","","","","","2010-04-02 14:23:20","Showing Live Wallpaper in a 1.6 target app by detecting if it's a 2.1 device?","<android><wallpaper><android-sdk-2.1><android-sdk-1.6>","1","0","1","",""
"2567069","1","","","2010-04-02 14:16:04","0","214","<p>Here's the problem I'm facing : In my application I have several preferences stored in sharedPreferences that record different settings of the application. These are some strings. Because I want the application to start with some default values for these settings , in onCreate I construct a ""Setting"" object for each setting in which I check to see if the sharedPreference associated is null and if it is so I put the default Value in the sharedPreference.</p><pre><code>Setting(int setting, String default){    storedPref=sharedPref.getString(getText(setting),null);    if(storedPref==null)    {      SharedPreferences.Editor edit=sharedPred.edit()      edit.putString(getText(setting),default);      edit.comit    }}</code></pre><p>The views associate to these settings are ListPreferences (). When first opened the application , they are supposed to display a list of options , in which the selected one is the default   ,but it happens sometimes no options is selected , not even the default one, which is not intended.</p><p>The listPreferences are constructed in xml , by setting an array to the ""entries tag"" and to the ""values tag"" . I'm not really sure , what should I pass to the constructor of the Setting object for the default  , a member of the entries array , or a something from the values  one !!!  If I pass a member of the entries some will Listpreferences will have the expected behaviour and some will have the one described above. If I do otherwise and pass something from the values array , the same thing happens ! Has anyone any ideea why this strange behaviour ?</p>","284609","","","","","2010-04-02 14:37:51","Strange behaviour for ListPreferences","<android>","2","0","","",""
"2567110","1","","","2010-04-02 14:24:07","1","402","<p>I still try different basics with android, and now I'm stuck with animation. I'm trying to implement a simple animation. I've defined animation in xml file like this:</p><p><code>alpha android:interpolator=""@android:anim/accelerate_interpolator"" android:fromAlpha=""0.0"" android:toAlpha=""1.0"" duration=""3000"" repeatCount=""infinite""</code></p><p>In my main view group I have an ImageView defined like this:</p><pre><code>&lt;ImageView android:id=""@+id/someb"" android:src=""@drawable/earth_normal"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:padding=""5dip""/&gt;</code></pre><p>And this is from my starting activity class:</p><p>public class Ohayou extends Activity {</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView earth = (ImageView)findViewById(R.id.someb);    Animation earthFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_in);    earth.startAnimation(earthFadeInAnimation);}</code></pre><p>It finds ImageView successfuly and creates animation. but when I start emulator ImageView just shows the original src image, not an animation. What am I doing wrong?</p><p>Thanks</p>","305169","","243782","","2010-04-02 14:41:25","2014-04-11 23:17:13","A basic animation not showing up","<android>","1","0","","",""
"2567197","1","2567671","","2010-04-02 14:38:33","4","1779","<p>I feel a little bit silly asking this, but I haven't been able to find any answers on my own.  My Force Close dialog has a ""Report"" button. I think it's a great idea, and I wish everyone had it. At first, I thought it must be something I turned on without realizing it, but not only can't I find any setting that I might have touched, I also can't find any reference to this button existing on the Internet. I have a Droid, and I know 4 other people with Droids, and they say they don't have the option to report Force Closes. Am I special? Am I just missing something?  The ""report"" button has been there for at least a few weeks now.</p><p>When I use the Report button, I get a screen with a ""feedback"" field and a checkbox for ""Include system data"". Below that , it says ""Information from feedback reports will be shown to the developer of the application.""  Under that are Preview and Send buttons.</p><p>As a developer, I've never received one of these reports.</p><p>I'd try to send a report to myself, but it seemingly only shows the button for apps installed from the market, and I don't know of a way to crash my production app.</p><p>I suppose I could publish a simple crashing app just to try it out, but I thought I'd ask you folks first.</p><p>Edit:You can view screenshots here: <a href=""http://bentobin.com/crashReportImages/"" rel=""nofollow"">http://bentobin.com/crashReportImages/</a></p>","301145","","321731","","2013-12-18 23:50:14","2013-12-18 23:50:14","When I get the Force Close dialog, I have a Report button. Where did it come from?","<android>","1","4","3","",""
"2567415","1","","","2010-04-02 15:17:40","0","309","<p>How do you design and build your website to make it usable on both IPhone and Android, does it have to be pure html?</p>","1748769","","1101070","","2012-03-07 02:56:08","2012-03-07 02:56:08","IPhone and Android website design","<iphone><android>","1","1","","",""
"2567594","1","2567861","","2010-04-02 15:49:44","3","9128","<p>I am using a while loop to iterate through a cursor and then outputing the longitude and latitude values of every point within the database. </p><p>For some reason it is not returning the last (or first depending on if I use Cursor.MoveToLast) set of longitude and latitude values in the cursor.</p><p>Here is my code:</p><pre><code>public void loadTrack() {SQLiteDatabase db1 = waypoints.getWritableDatabase();Cursor trackCursor = db1.query(TABLE_NAME, FROM, ""trackidfk=1"", null, null, null,ORDER_BY);     trackCursor.moveToFirst();    while (trackCursor.moveToNext()) {        Double lat = trackCursor.getDouble(2);        Double lon = trackCursor.getDouble(1);        //overlay.addGeoPoint( new GeoPoint( (int)(lat*1E6),  (int)(lon*1E6)));        System.out.println(lon);        System.out.println(lat);    }}</code></pre><p>From this I am getting:</p><hr><p>04-02 15:39:07.416: INFO/System.out(10551): 3.004-02 15:39:07.416: INFO/System.out(10551): 5.004-02 15:39:07.416: INFO/System.out(10551): 4.004-02 15:39:07.416: INFO/System.out(10551): 5.004-02 15:39:07.416: INFO/System.out(10551): 5.004-02 15:39:07.416: INFO/System.out(10551): 5.004-02 15:39:07.416: INFO/System.out(10551): 4.004-02 15:39:07.416: INFO/System.out(10551): 4.004-02 15:39:07.416: INFO/System.out(10551): 3.004-02 15:39:07.416: INFO/System.out(10551): 3.004-02 15:39:07.416: INFO/System.out(10551): 2.004-02 15:39:07.416: INFO/System.out(10551): 2.004-02 15:39:07.493: INFO/System.out(10551): 1.004-02 15:39:07.493: INFO/System.out(10551): 1.0</p><hr><p>7 Sets of values, where I should be getting 8 sets.</p><p>Thanks.</p>","296810","","","","","2010-04-03 00:26:42","Cursor while loop returning every value but the last","<java><sql><android><sqlite><cursor>","4","0","1","",""
"2568063","1","","","2010-04-02 17:18:23","6","13164","<p>Trying to create a WebView but it only shows a blank/white page. I have followed several examples and they all say that work with this code...</p><p><strong>Here is my code:</strong></p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class PostenWebView extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.web_view);        WebView webview = (WebView)findViewById(R.id.webview);        webview.loadUrl(""http://www.google.com"");    }}</code></pre><p><strong>And here is the web_view.xml:</strong></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;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre>","270273","","15168","","2013-09-08 18:31:12","2013-11-19 12:52:27","Android WebView shows a blank page","<android><webview>","7","2","2","",""
"2568086","1","","","2010-04-02 17:24:30","1","5880","<p>I have an ExpandableListView in which I'd like to have controls other than TextView. Apparently, SimpleExandableListViewAdapter assumes all the controls are TextViews. A cast exception is generated if they are not.</p><p>What is the recommended solution?</p><p>Options I can think of include:- Use some other included adapter. But I can't tell if they all have the same assumption.- Create my own adapter. Is there a doc which describes the contract, ie the sequence of method calls an adapter will encounter?</p><p>I expected the existing adapters to require the views to conform to some interface to allow any conforming view to be used, rather than hardcode to textview and limit where they can be used.</p>","295392","","","","","2011-03-19 19:45:12","What adapter to use for ExpandableListView with non-TextView views?","<android>","3","0","","",""
"2568173","1","2568353","","2010-04-02 17:39:53","2","1856","<p>I've implemented a service that does an asynchronous sync between my application and google docs.  I want to update the top level activity of my application when the sync is complete.  However because of the service it's possible that the app could be be in a unknown state.  Is there a way to make the top level activity, whatever that may be, recreate itself from an asynchtask in a service.</p>","303256","","303256","","2010-04-02 18:03:38","2010-04-03 01:42:10","updating an activity from an asynchronous service","<android><asynchronous><service><activity>","3","0","1","",""
"2568435","1","2568711","","2010-04-02 18:35:20","0","1591","<p>Im using an inflater inside an adapter for my listview. I need to add in a different button depending in the state of the data for each row, so Im thinking I need to do this programmatically, but how do I make sure its inserted into the correct place inside the layout?</p>","246793","","19405","","2010-04-02 19:37:31","2010-04-02 19:37:31","How do I programmatically add a button into the inflated layout from an adapter?","<android><listview><layout><android-arrayadapter><inflate>","1","0","","",""
"2568519","1","2568573","","2010-04-02 18:53:36","5","3940","<p>I am building a Android app and I am a bit struggling with custom Views.</p><p>I would like to have a reusable View that consist of a few standard layout elements. Let's say a relativelayout with some buttons in it.</p><p>How should I proceed. Should I create a custom view class that extends RelativeLayout and programmaticly add those buttons? I would think that's a bit overkill?</p><p>What's the way to do it properly in Android?</p>","107029","","","","","2012-01-29 07:32:36","Android: Custom view based on layout: how?","<android><custom-view>","1","0","4","",""
"2568599","1","","","2010-04-02 19:06:59","-1","1506","<p>I want a sample application for camera in android. If anybody developed any application please share with me along with source code. This will be very helpful for me.</p><p>Thanks in advance Praween</p>","292605","","","","","2010-04-02 19:11:35","Android camera application","<android>","1","0","","",""
"2568637","1","2568730","","2010-04-02 19:13:42","32","17533","<p>I have a bunch of EditTexts in my Android application, each with InputMethod set to numberSigned. My target device does not have a hardware keyboard and thusly uses the software keyboard for numeric entry. Android attempts to be user-friendly and replaces the standard ""Done"" button to the right of the entry box with a ""Next"" button, probably because it recognizes the presence of other EditTexts. My application does not need this functionality, and in fact impairs the functionality of the application. How do I remove or disable that functionality?</p>","299571","","299571","","2011-10-22 01:44:09","2012-12-31 13:04:01","How to disable ""Next"" button on a EditText software keyboard (replace with ""Done"" button)","<android><edittext><soft-keyboard>","2","2","14","",""
"2568665","1","","","2010-04-02 19:16:56","4","13874","<p>Is there a way to stream shoutcast/icecast on the android? Passing the icecast URL to the mediaplayer does not work and after researching the topic it seems it is because android can't play raw aac files without a media container. </p><p>What can I do to get around this?</p><p>Thanks </p>","307899","","","","","2014-03-07 13:59:38","Icecast/shoutcast streaming on Android","<android><shoutcast>","1","0","3","",""
"2568729","1","","","2010-04-02 19:26:37","4","997","<p>How do I set up a TextView to flash when it is clicked? With flashing I mean that I want to change the background color of the TextView. I essentially want one of the objects that is displayed in a ListActivity, but inside a normal View.  </p><p>I have tried to do this by adding an OnClickListener, but what I really need is something like adding an On(Un)SelectListener. Using the onClickListener, I can change the TextView background, but obviously the background stays that color.  I thought of using a new Handler().postDelayed(new Runnable(){ ... }) kind of thing to reset the backround after some small time, but I did not know if this would be overkill for what I'm trying to do.</p><p>What would you recommend?</p>","307885","","114066","","2010-07-14 13:54:07","2010-07-14 13:54:07","Android: Create TextView that flashes when clicked","<android><textview>","1","0","0","",""
"2568755","1","","","2010-04-02 19:31:18","2","498","<p>So, I've been banging my head looking for a good solution for a few days and am stuck.</p><p>I have a search screen (Activity) in a tab, and after the user enters a value and clicks ""search"" I would like the results to come back in that same tab, and then if an item from the results is selected, to show more detailed results, in that same tab. I have it all working now in separate activities, and even the first step working in a tab, but as soon as I call the activity to process he search results... i.e.</p><p>startActivity(i); </p><p>for the results Activity, the results displayed are not in the tab! </p><p>I am having a very difficult time getting this flow to work all under a tab. Any thoughts on how to make this happen?</p><p>I keep hearing that Android views should be used instead of activities, but am I then to assume that all the logic I have right now for 3 activity needs to go inside 1 activity and then I need to handle setting the content and state for each of these cases? Plus, won't the history stack not work as pressing the back button will take the user out of the application, instead of taking them from say the search result to the search screen, or the details to the search results, etc. This seems like a mess.</p><p>Can anyone show a more complex example of tabs or how one might have a simple search, result and detail workflow staying in a tab? </p><p>I have seen a few questions on this concept of keeping activities ""within a tab"", but no good resolution. Please help.</p>","257262","","21234","","2011-07-05 08:13:39","2011-07-05 08:13:39","Typical Search, Result and Detail Workflow Staying Within an Android Tab","<android><view><activity><tabs>","2","0","1","",""
"2568861","1","2568890","","2010-04-02 19:55:47","2","1124","<p>I'm following an example where the author hard coded a paddingTop to 370px. </p><p> ...</p><p>How do I make that paddingTop dynamic? When I run this in 2 AVDs with HVGA and WVGA80 I get the frame floating at different heights. I'd like to say something like paddingTop=80%, but that doesn't work...</p><p>Thanks!llappall</p>","284556","","","","","2010-04-02 20:02:17","Android: Making padding dynamic in a FrameLayout","<android><dynamic><padding>","1","0","1","",""
"2569315","1","2569367","","2010-04-02 21:33:03","0","1378","<p>Ive inherited some code which started out as an Android project but really is just an API to be used by other applications. Hence, the 'build' process usually just produces a JAR file. The problem Im having is that I get errors from the Android build tools in my console which seem to fire everytime I make a change to some files. How do I fix that?</p><p>Im using Eclipse 3.5 (Galileo).</p>","246793","","","","","2012-10-14 12:58:13","Convert Android project to 'regular' Java project inside Eclipse?","<java><android><eclipse><build><project>","2","0","","",""
"2569566","1","","","2010-04-02 22:40:07","2","585","<p>I'm working on a soundboard, however I've got a problem when it come to drag the finger over the screen to play the sounds for the buttons I drag the finger over.</p><pre><code>Button Button3 = (Button)findViewById(R.id.button03);Button3.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                if(event.getAction() == MotionEvent.ACTION_DOWN){                    mp.playSound(3);                }            return false;            }        });</code></pre><p>Do anyone know how I can detect when a finger enter a button and not click the button?Thanks :)</p>","308023","","166712","","2010-04-02 22:42:27","2010-07-03 12:00:05","Android - Enter button with finger detection?","<android>","1","0","","",""
"2569623","1","2569680","","2010-04-02 22:57:08","1","2811","<p>I'm trying to use a blowfish cipher inside an Android application.<br>It appears that the Android platform supports blowfish (it appears to be in the source code), but when I try to get a cipher using: </p><pre><code>Cipher.getInstance(""blowfish""); I get a ""java.security.NoSuchAlgorithmException""</code></pre>","62516","","62516","","2010-04-02 23:16:58","2010-08-27 01:58:44","Using blowfish encryption with Android?","<android><cryptography><blowfish><cipher>","1","0","","",""
"2569753","1","2569792","","2010-04-02 23:51:20","4","14470","<p>Is it possible to add a button to the right corner of the app title?</p><p>e.g., adding a ""refresh"" button to the title of ""Feed: my feeds""?</p><p><a href=""http://www.android.com/market/apps/feedr-lg-01.jpg"" rel=""nofollow"">http://www.android.com/market/apps/feedr-lg-01.jpg</a><img src=""http://www.android.com/market/apps/feedr-lg-01.jpg"" alt=""alt text""></p>","253800","","","","","2010-09-02 22:01:32","android: adding button to the title of the app?","<android><layout>","4","0","1","",""
"2569766","1","","","2010-04-02 23:56:24","3","205","<p>I am using QuickContactBadge widget in my application.I want to post facebook status message using contactsContentProvider.</p>","308052","","243782","","2010-04-03 07:01:47","2011-12-28 10:30:30","Is there any way to post Facebook status using ContactsContent Provider?","<android><facebook>","1","0","","",""
"2570004","1","2570050","","2010-04-03 02:04:19","44","16888","<p>I've just finished my Android widget. Now I need to have different sizes of this wiget for the user to choose from. for example I need a medium, small and large size widget. so when the user install the app and hold the the home screen then choose widget, in the widget menu I want him to  see three widget with the same app name but with the size. something like this:</p><p>helloSmallhelloMediumhelloLarge</p><p>I have the medium one ready but how can I make the small and the large in the same app? knowing that all three sizes contain the same exact data and actions just the size and the background are different.</p><p>Thanks.</p>","308089","","308089","","2010-04-03 02:07:04","2014-01-06 18:05:10","how to add multiple widgets in one app?","<android><size><widget><android-widget>","5","0","30","",""
"2570302","1","","","2010-04-03 05:09:34","1","1090","<p>I want to know how to set the size of spinner.When i added large values to spinner list,the spinner expands and as result it pushes the labelField to the further left.</p><p>I want to know the how to set the spinner size to be a constant one</p>","138030","","","","","2013-03-10 08:40:00","How to set the size of spinner","<android>","2","0","","",""
"2570415","1","","","2010-04-03 06:09:27","1","11637","<p>I am using the following code to do things with gridview(slightly modified from <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a>). I want to replace the onClicklistener and the onClick() method with their ""touch"" equivalents i.e. touchlistener and onTouch() so that when i touch an element in the gridview the image of the element changes and a double touch on the same element takes it back to the orginal state.</p><p>How do I do this? I can't get my code to do this. The clicklistener works to some extent but the touch isn't. Please help.</p><pre><code>public class ImageAdapter extends BaseAdapter {private Context mContext;public ImageAdapter(Context c) {    mContext = c;}public int getCount() {    return mThumbIds.length;}public Object getItem(int position) {    return null;}public long getItemId(int position) {    return 0;}// create a new ImageView for each item referenced by the Adapterpublic 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);        imageView.setOnClickListener(new View.OnClickListener()            {              @Override              public void onClick(View view)               {                  if(position==0)                  {                                  //do this                              }                              else                              {                                //do this                              }                           }                    });    } else {        imageView = (ImageView) convertView;    }    imageView.setImageResource(mThumbIds[position]);    return imageView;}// references to our imagesprivate 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>","308151","","","","","2012-12-10 22:14:15","Android beginner: Touch events in android gridview","<android><gridview><onclick><touch><ontouchlistener>","3","1","2","",""
"2570431","1","2570610","","2010-04-03 06:14:45","5","767","<p>I'm having difficulties handling multiple instances of my root (main) activity for my application.  My app in question has an intent filter in place to launch my application when opening an email attatchment from the ""Email"" app.  </p><p>My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity.  </p><p>steps:</p><ol><li>Launch root activity A, press home</li><li>Open email attachment, intent filter triggers launches root activity A</li></ol><p>Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?</p>","308153","","","","","2010-04-03 08:03:30","Handle existing instance of root activity when launching root activity again from intent filter","<android><activity><android-intent><task>","1","0","","",""
"2570849","1","2571269","","2010-04-03 09:55:49","1","1556","<p>when click the grid item, i want to show a progressbar between the time of next Activity shown. then the second activity has a custom listview. there also i want to show a progressbar. how to do that? </p>","267269","","","","","2011-10-24 09:29:57","ProgressBar between to activities in android?","<android><multithreading><progress-bar>","2","2","1","",""
"2570983","1","2575077","","2010-04-03 10:39:00","0","625","<p>I am in desperate need of good tutorials on Content Providers in Android. I have been searching in the web for the tutorials but none could give me a clear idea on how content providers work. I'll be grateful if anyone can provide me with sample codes of the projects that implement content providers... </p>","303155","","","","","2010-04-04 16:34:41","Need tutorials on Content providers in android","<android>","1","0","","",""
"2571324","1","","","2010-04-03 13:13:38","0","182","<p>I created a new project based on the Wikitionary sample.</p><p>After tinkering with it so much and screwing it up, I decided to delete the project and start over again.</p><p>After deleting my project, I find that the Wiktionary sample is no longer available as a starting point.</p><p>Are these one-and-done samples?</p><p>Thanks</p>","308305","","","","","2010-04-03 14:43:09","Delete project based on sample, then sample no longer available?","<android><eclipse>","1","0","","",""
"2571361","1","2571379","","2010-04-03 13:34:24","3","18338","<p>I follow the steps in the <a href=""http://developer.android.com/intl/de/guide/topics/ui/dialogs.html"" rel=""nofollow"">customdialog example</a> in the documentation, but I get this exception. Any ideas?</p><pre><code>04-03 18:50:28.787: VERBOSE/Bru_Press_Tab(750): Exception in Tabsjava.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.brown/com.example.brown.Bru_Press_MostRecent}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content</code></pre>","267269","","856306","","2011-12-06 14:50:32","2011-12-06 14:50:32","custom Progress Dialog in android?","<android><progressdialog>","1","0","","",""
"2571587","1","2571648","","2010-04-03 14:58:38","2","3196","<p>In an Android ListActivity, I am adding a button as a footer in a ListView.  How can I apply layout formatting to this button like centering it and/or width=fill_parent?</p><p>I have tried a few things such as using setLayoutParams(), but have not gotten it to work - the footer always disappears when I try anything.</p><p>Here is the basic code I am working with</p><pre><code>closeButton = new Button(this);closeButton.setText(getResources().getString(R.string.title_closeprocess));closeButton.setOnClickListener(new OnClickListener(){        public void onClick(View v) {                           closeProcess();        }   });getListView().addFooterView(closeButton);   </code></pre><p>*update</p><p>Based on Christopher's answer, here is the footer view that I am adding to my listview, and the activity code that adds it to 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:id=""@+id/closebutton_layout""    android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/toptable""     android:layout_width=""fill_parent""    android:stretchColumns=""*""     android:layout_alignParentTop=""true""    android:layout_centerHorizontal=""true""     android:layout_height=""wrap_content""&gt;    &lt;TableRow&gt;                  &lt;Button android:id=""@+id/closebutton""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:text=""Skip Question""        android:gravity=""center""         android:paddingTop=""16dip""&gt;    &lt;/Button&gt;               &lt;/TableRow&gt;         &lt;/TableLayout&gt;&lt;/RelativeLayout&gt;ListView listView = getListView();    closeButtonView = getLayoutInflater().inflate(R.layout.closebutton_layout, listView, false);    closeButton = (Button)closeButtonView.findViewById(R.id.closebutton);           closeButton.setOnClickListener(new OnClickListener(){        public void onClick(View v) {            closeQuestion();                        }    });listView.addFooterView(closeButtonView);</code></pre>","268648","","268648","","2010-04-04 01:43:59","2010-04-04 01:43:59","In Android ListActivity, how do you apply layout formatting to footers?","<android>","1","0","2","",""
"2571617","1","2659087","","2010-04-03 15:10:55","8","5269","<p>Is there a way to make LogCat's output to appear in Console view in Eclipse? </p><p>LogCat view is much less convenient that Console, because it's hard to see long messages in it (they are trimmed by column border) and there are no clickable highlighting in exception stack traces to quickly navigate to source of error.</p><p>Just to make clear - I'd like to have clickable stacktraces, like the ones in normal Eclipse console so I can quickly navigate to the source of error.</p>","6533","","6533","","2010-04-14 07:45:57","2010-04-18 23:33:34","How to output LogCat to Console?","<android><eclipse>","5","4","3","",""
"2572048","1","","","2010-04-03 17:28:09","3","951","<p>Is there any class generators to process web services in Android/Java? I may have to write my own to generate classes against WSDL but I'm trying not to. Also is there one for REST services as well?</p><p>If not providing me with discovery service suggestions like disco/wsdl are good enough.</p>","42005","","114066","","2010-11-15 19:52:23","2012-08-05 08:14:32","Is there a Class generator for data classes used in Java/Android from an existing wsdl file?","<java><android><web-services><wsdl>","1","0","1","",""
"2572508","1","","","2010-04-03 20:06:49","1","784","<p>I have a php web page that will randomize an image that is 158x154.  I was able to get the android application to work, but would also like to get it to work as a widget.  How the heck can I get a widget to pull information from the net?  I got the widget to work and layout correctly with a black sample image.  I have tried to look at the wiki sample, but it is a bit too complicated for my little brain to grasp.  The data that gets pulled looks something like:</p><pre><code>&lt;html&gt;&lt;body bgcolor=""#000000""&gt;center&gt;    &lt;a href=""http://www.website.com"" target=""_blank""&gt;&lt;img border=""0"" src=""http://www.webiste.com//0.gif""&gt;&lt;/a&gt;&lt;img src=""http://www.webiste.com"" style=""border:none;"" /&gt;&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>Help please.  I am pulling my hair out trying to figure this out.</p>","307235","","","","","2010-04-05 00:15:08","Is it possible to pull a webpage or content from the web into a widget on the android home screen","<android><widget><webview><home>","2","0","","",""
"2572914","1","","","2010-04-03 22:39:43","0","513","<p>Has anyone managed to develop Android Applications using Eclipse on the Windows platform. I understand the ADB needs to recognise specific models of phone and wondered if the Tattoo is supported.</p><p>thanksMark</p>","303229","","","","","2010-04-03 22:48:13","Developing Android Applications with an HTC Tattoo Phone","<android><eclipse><phone><adb>","1","1","","",""
"2572930","1","","","2010-04-03 22:47:44","3","8780","<p>I have a project that I would like to add external libraries to (and have them packaged with the application) but I am not sure it is happening.  I read on this link:</p><p><a href=""http://developer.android.com/intl/fr/guide/appendix/faq/commontasks.html"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/appendix/faq/commontasks.html</a></p><p>how to, but they do not show up in any of the /data/data/project directories.  Does anyone know how I can confirm that the libraries were in fact added to the project for use at runtime?  Thanks.</p>","291059","","","","","2011-06-10 15:54:50","Android adding external libraries to project","<android><libraries>","3","0","1","",""
"2572957","1","","","2010-04-03 22:57:52","1","822","<p>I making on a app, but I have a problem with for or with a array.When I use this code</p><pre><code>Button Button[] = {(Button)findViewById(R.id.button01), (Button)findViewById(R.id.button02), (Button)findViewById(R.id.button03),(Button)findViewById(R.id.button04)};</code></pre><p>...</p><pre><code>case MotionEvent.ACTION_MOVE:  for (int i = 0; i &lt; Button.length; i++) {   if (Y &gt; Button[i].getTop()+25 &amp;&amp; Y &lt; Button[i].getBottom()+25 &amp;&amp; X &gt; Button[i].getLeft() &amp;&amp; X &lt; Button[i].getRight()){    LastButton = i;    edittext.setText(""id "" + i);   }  }break;</code></pre><p>But the for statement skip the first button in the array and the second button get id 1. anyone know how I can fix it?Thanks</p>","308023","","308023","","2010-04-04 09:44:05","2010-04-04 09:44:05","Android - Array or for statement problem","<android>","0","4","0","",""
"2573018","1","5124837","","2010-04-03 23:21:23","2","1531","<p>My problem is that I try to upload an image and some text values to an rails server, and the text values end up as files, insted of just param values.</p><p>How the post looks on the server</p><pre><code>Parameters: {""action""=&gt;""create"", ""controller""=&gt;""problems"",""problem""=&gt;{""lon""=&gt;#File:/tmp/RackMultipart20100404-598-8pi1vj-0&gt;, ""photos_attributes""=&gt;{""0""=&gt;{""image""=&gt;#File:/tmp/RackMultipart20100404-598-pak6jk-0&gt;}}, ""subject""=&gt;#File:/tmp/RackMultipart20100404-598-nje11p-0&gt;, ""category_id""=&gt;#File:/tmp/RackMultipart20100404-598-ijy1oo-0&gt;, ""lat""=&gt;#File:/tmp/RackMultipart20100404-598-1a7140w-0&gt;, ""email""=&gt;#File:/tmp/RackMultipart20100404-598-1b7w6jp-0&gt;}}</code></pre><p>part of the android code</p><pre><code>try {   File file = new File(Environment.getExternalStorageDirectory(),""FMS_photo.jpg"");   HttpClient client = new DefaultHttpClient();     HttpPost post = new HttpPost(""http://homepage.com/path"");     FileBody bin = new FileBody(file);     Charset chars = Charset.forName(""UTF-8"");   MultipartEntity reqEntity = new MultipartEntity();     reqEntity.addPart(""problem[photos_attributes][0][image]"", bin);     reqEntity.addPart(""problem[category_id]"", new StringBody(""17"", chars));   post.setEntity(reqEntity);    HttpResponse response = client.execute(post);     HttpEntity resEntity = response.getEntity();     if (resEntity != null) {         resEntity.consumeContent();    }   return true;  } catch (Exception ex) {    globalStatus = UPLOAD_ERROR;    serverResponse = """";    return false;  } finally { }</code></pre>","308507","","308507","","2010-04-06 13:27:51","2011-02-26 03:25:07","android/rails multipart upload problem","<java><ruby-on-rails><android><rack><multipartform-data>","1","1","4","",""
"2573064","1","2573112","","2010-04-03 23:41:11","16","28111","<p>I have this code on my Android phone.</p><pre><code>   URI uri = new URI(url);   HttpPost post = new HttpPost(uri);   HttpClient client = new DefaultHttpClient();   HttpResponse response = client.execute(post);</code></pre><p>I have a asp.net webform application that has in the page load this</p><pre><code> Response.Output.Write(""It worked"");</code></pre><p>I want to grab this Response from the HttpReponse and print it out. How do I do this?</p><p>I tried <code>response.getEntity().toString()</code> but it just seems to print out the address in memory.</p><p>Thanks</p>","130015","","14343","","2010-07-14 23:45:37","2013-03-29 19:55:36","How to print out returned message from HttpResponse?","<java><.net><android><httpresponse>","4","0","11","",""
"2573542","1","2576718","","2010-04-04 04:16:52","1","2087","<p>When using a SAX parser, parsing fails when there is a "" in the node content.  How can I resolve this? Do I need to convert all "" characters?</p><p>In other words, anytime I have a quote in a node:</p><pre><code> &lt;node&gt;characters in node containing ""quotes""&lt;/node&gt;</code></pre><p>That node gets butchered into multiple character arrays when the Handler is parsing it. Is this normal behaviour? Why should quotes cause such a problem?</p><p>Here is the code I am using:</p><pre><code>import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.methods.HttpGet;import org.xml.sax.InputSource;import org.xml.sax.XMLReader; ...HttpGet httpget = new HttpGet(GATEWAY_URL + ""/""+ question.getId());          httpget.setHeader(""User-Agent"", PayloadService.userAgent);          httpget.setHeader(""Content-Type"", ""application/xml"");          HttpResponse response = PayloadService.getHttpclient().execute(httpget);          HttpEntity entity = response.getEntity();          if(entity != null)          {                      SAXParserFactory spf = SAXParserFactory.newInstance();              SAXParser sp = spf.newSAXParser();                          XMLReader xr = sp.getXMLReader();                          ConvoHandler convoHandler = new ConvoHandler();              xr.setContentHandler(convoHandler);                           xr.parse(new InputSource(entity.getContent()));                                              entity.consumeContent();                        messageList = convoHandler.getMessageList();          }</code></pre>","268648","","268648","","2010-04-05 02:01:04","2010-12-17 18:07:34","Trouble parsing quotes with SAX parser (javax.xml.parsers.SAXParser) on Android API 1.5","<android><saxparser>","2","2","1","",""
"2573622","1","2574148","","2010-04-04 05:04:05","1","644","<p>I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no third array.. all arrays are one dimensional but are very large... probibly as large as the os will let me get away with. Max i would need is two float arrays with 40,000 floats each... but i could get away with 1/10th that i suppose minimum.</p><p>Would love to do this in 1/30th or 1/60th of a second but that does not seem possible? Also if the code is JNI,NDK or OpenGL ES thats fine.. does android have an assembly language or like machine code i could use somehow?</p>","263111","","","","","2010-04-04 10:31:11","Fast way to perform addition of 2 LARGE float arrays in Android. Optional JNI or Opengl ES","<android><opengl-es><jni><android-ndk>","1","1","1","",""
"2574093","1","2574282","","2010-04-04 09:57:51","0","276","<p>I have drawn something like this:</p><p><a href=""http://i43.tinypic.com/b7ayit.jpg"" rel=""nofollow"">http://i43.tinypic.com/b7ayit.jpg</a></p><p>How to remove the paths and points?</p>","308649","","","","","2010-04-04 11:48:04","Removing paths/points from MapView","<android>","1","0","1","",""
"2574217","1","3501378","","2010-04-04 11:09:28","4","3799","<p>I'm having the following problem: </p><p>I have a ListActivity, its ListView is composed by an icon, text and a checkbox (using LayoutInflater). </p><p>The Adapter for the ListView extends ResourceCursorAdapter (i.e. the data source of the ListView is retrieved from a database, also the Checked status of each row) </p><p>Everything works pretty Ok, except when I uncheck/check the checkbox in any row, if I scroll down until the modified checkbox is no longer visible, and then scroll up, the checkbox is restored to its original state. </p><p>The database IS modified, this is not the problem (i.e. if I modify a row and exit the activity, and enter again, the modified row is displayed Ok). </p><p>My guess is that this has something to do on how the list is rendered because for some reason the ListView ""renders"" the original state of all rows when it was first populated when scrolling. </p><p>I've been looking around for this bug but I don't find anybody that had this problem. I appreciate any advice you have.</p>","308666","","308666","","2010-04-04 14:27:01","2010-12-10 08:40:12","Checkbox 'Checked' in ListView is restored after scrolling","<android><listview><checkbox>","3","0","1","",""
"2574324","1","2574347","","2010-04-04 12:12:35","0","552","<p>When I add this code to my Android 2.1 Java app, it fails:</p><pre><code>db=SQLiteDatabase.openOrCreateDatabase(""Locations"", null);</code></pre><p>Do I need a special permission to create a database, or can anybody provide a suggestion how to find out what goes wrong?</p><p>Here is the LogCat output:</p><pre><code>04-04 15:04:28.702: DEBUG/ddm-heap(703): Got feature list request04-04 15:04:29.642: ERROR/Database(703): sqlite3_open_v2(""Locations"", &amp;handle, 6, NULL) failed04-04 15:04:29.652: DEBUG/AndroidRuntime(703): Shutting down VM04-04 15:04:29.662: WARN/dalvikvm(703): threadid=3: thread exiting with uncaught exception (group=0x4001b188)04-04 15:04:29.662: ERROR/AndroidRuntime(703): Uncaught handler: thread main exiting due to uncaught exception04-04 15:04:29.702: ERROR/AndroidRuntime(703): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gormtech.zyx.RejseplanQuick/com.xxx.zyx.xxx.HelloAndroid}: android.database.sqlite.SQLiteException: unable to open database file</code></pre>","1507543","","1507543","","2010-05-05 15:52:41","2010-05-05 15:52:41","SQLite database creation fails, documentation is unclear","<java><android><sqlite>","1","3","","",""
"2574366","1","2575690","","2010-04-04 12:31:21","3","1408","<p>I'm coding a networking application on Android.</p><p>I'm thinking of having a single UDP port and Datagram socket that receives all the datagrams that are sent to it and then have different processing queues for these messages.</p><p>I'm doubting if I should have a second or third UDP socket on standby. Some messages will be very short (100bytes or so), but others will have to transfer files.</p><p>My concern is, will the Android kernel drop the small messages if it's too busy handling the bigger ones?</p><p><strong>Update</strong>""The latter function calls sock_queue_rcv_skb() (in sock.h), which queues the UDP packet on the socket's receive buffer. <strong>If no more space is left on the buffer, the packet is discarded.</strong> Filtering also is performed by this function, which calls sk_filter() just like TCP did. Finally, data_ready() is called, and UDP packet reception is completed.""</p>","188622","","188622","","2010-04-04 17:26:28","2010-04-05 01:18:04","Does it make sense to have more than one UDP Datagram socket on standby? Are ""simultaneous"" packets dropped or queued by the kernel?","<android><networking><sockets><udp><kernel>","5","0","","",""
"2574401","1","","","2010-04-04 12:47:05","3","9676","<p>I want to send At command throug my application to modem. Can some one please let me know how to send AT command thr my application?</p><p>Do we need Phone object to send AT command?</p><p>The <code>ATResponseParser</code> class parses part of the AT command syntax used to communicate with the mobile radio hardware in a mobile handset. This is, in fact, a command syntax very much like the AT command syntax used by modems, a standard described in the 3GPP document number TS 27.007 and related specifications.</p><p>I want to send below AT command to Mode.6.5 <code>Hangup call +CHUP</code></p><p>Table 13a: +CHUP action command syntax</p><p>Command</p><p>Possible response(s)</p><pre><code>+CHUP+CHUP=?</code></pre><p>Please help me.</p>","308692","","105971","","2011-12-02 02:49:01","2012-02-04 16:22:38","How to send AT command in android?","<android>","2","2","2","",""
"2574660","1","","","2010-04-04 14:16:07","2","2276","<p>I'd like to show another List View 'B' after clicking a item of List View 'A'. I use onListItemClick event in Android 1.6 project.</p><p><code>public void onListItemClick(            ListView parent, View v,            int position, long id)             {<br>                Toast.makeText(this,                     ""You have selected "" + lv_arr[position],                     Toast.LENGTH_SHORT).show();            }</code></p><p>how to code it?</p>","305732","","17034","","2010-04-04 15:09:31","2010-04-19 03:49:28","how to show another List View 'B' after clicking List View 'A'","<android><listviewitem>","4","0","","",""
"2574810","1","","","2010-04-04 14:58:15","0","1466","<p>Hi i have erorr ""R cannot be resolved"" everytime when i create android project in eclipse under ubuntu with android sdk. In windows everything ok. What's wrong?</p>","308747","","","","","2011-06-01 13:45:16","r cannot be resolved on ubuntu + eclipse + android sdk","<android><eclipse><ubuntu><sdk>","2","0","","",""
"2574882","1","","","2010-04-04 15:17:49","2","1056","<p>i have a question in developing some android program...</p><p>i use surfaceview for camera preview. it works fine, but has one problem when i start other activity (by clicking something) and then back from that activity. after that, surfaceview is no longer visible. (but onclicklistener is working)</p><p>but when i occur surfacecreated/destoryed by visible/invisible surfaceview in single activity, it works very good.</p><p>plz give me any help.</p>","308748","","","","","2010-09-21 13:46:39","android surfaceview is no longer visible after back from other activity","<android><activity><surfaceview>","1","1","0","",""
"2574955","1","2574990","","2010-04-04 15:42:54","1","738","<p>if yes, is there a tutorial available for creating an android app using the same?</p><p>if no, what db can i use apart from from SQLite, i need to keep the DB seperate from other apps.</p>","180950","","","","","2010-04-04 15:58:04","is Ultralite supported for Android?","<android><sybase>","1","2","","",""
"2575242","1","2576562","","2010-04-04 17:27:04","7","17195","<p>I'm trying to get a BroadcastReceiver invoked when the screen is turned on. In my AndroidManifest.xml I have specified :</p><pre><code>                &lt;receiver android:name=""IntentReceiver""&gt;                    &lt;intent-filter&gt;                            &lt;action android:name=""android.intent.action.SCREEN_ON""&gt;&lt;/action&gt;                    &lt;/intent-filter&gt;                &lt;/receiver&gt;</code></pre><p>However it seems the receiver is never invoked (breakpoints don't fire, log statements ignored). I've swapped out SCREEN_ON for BOOT_COMPLETED for a test, and this <em>does</em> get invoked.</p><p>This is in a 1.6 (SDK level 4) project.</p><p>A Google Code Search revealed this, I downloaded the project and synced it, converted it to work with latest tools, but it too is not able to intercept that event.</p><p><a href=""http://www.google.com/codesearch/p?hl=en#_8L9bayv7qE/trunk/phxandroid-intent-query/AndroidManifest.xml&amp;q=android.intent.action.SCREEN_ON"">http://www.google.com/codesearch/p?hl=en#_8L9bayv7qE/trunk/phxandroid-intent-query/AndroidManifest.xml&amp;q=android.intent.action.SCREEN_ON</a></p><p>Is this perhaps no longer supported?</p><p>Previously I have been able to intercept this event successfully with a call to Context.registerReceiver() like so</p><pre><code>registerReceiver(new BroadcastReceiver() {  @Override  public void onReceive(Context context, Intent intent) {    // ...   }}, new IntentFilter(Intent.ACTION_SCREEN_ON));</code></pre><p>However this was performed by a long-living Service. Following sage advice from CommonsWare I have elected to try to remove the long-living Service and use different techniques. But I still need to detect the screen off and on events.</p>","82515","","","","","2013-12-06 21:55:57","android.intent.action.SCREEN_ON doesn't work as a receiver intent filter","<android><broadcastreceiver>","2","0","3","",""
"2575380","1","","","2010-04-04 18:05:34","0","786","<p>Hello oh great wizards of all things android.  I really need your help.  Mostly because my little brain just doesn't know were to start.  I am trying to pull data from the internet to make a widget for the home screen.  I have the layout built:</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/Layout"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""@drawable/widget_bg_normal"" android:clipChildren=""false"" &gt; &lt;TextView     android:id=""@+id/text_view""            android:layout_width=""100px""            android:layout_height=""wrap_content""            android:paddingTop=""18px""            android:layout_centerHorizontal=""true""            android:textSize=""8px""            android:text=""158x154 Image downloaded from the internet goes here.  Needs to be updated every evening at midnight or unless the button below is pressed.  Now if I could only figure out exactly how to do this, life would be good."" /&gt; &lt;Button  android:id=""@+id/new_button""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:text=""Get New""  android:layout_below=""@+id/scroll_image""  android:layout_centerHorizontal=""true""  android:padding=""0px""  android:textSize=""10px""  android:height=""8px""  android:includeFontPadding=""false""  /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Got the provider xml bulit:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android"" android:minWidth=""150dip""    android:minHeight=""150dip"" android:updatePeriodMillis=""10000"" android:initialLayout=""@layout/widget""/&gt;</code></pre><p>The Manifest works great.</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.dge.myandroid""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".myactivty""                  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;!-- Widget --&gt;       &lt;receiver        android:name="".mywidget""        android:label=""@string/app_name""        &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.widgetprovider""    android:resource=""@xml/widgetprovider""   /&gt;  &lt;/receiver&gt;  &lt;!-- Widget End --&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>The data it is calling looks something like this when it is called.  It basically goes to a website that uses php to random the image:</p><pre><code>&lt;html&gt;&lt;body bgcolor=""#000000""&gt;center&gt;    &lt;a href=""http://www.website.com"" target=""_blank""&gt;&lt;img border=""0"" src=""http://www.webiste.com//0.gif""&gt;&lt;/a&gt;&lt;img src=""http://www.webiste.com"" style=""border:none;"" /&gt;&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>But here is were I am stuck.  I just don't know where to start at all.  The java is so far beyond my little head that I don't know what to do.</p><pre><code>package com.dge.myandroid;import android.appwidget.AppWidgetProvider;public class mywidget extends AppWidgetProvider {}</code></pre><p>The wiki example just confused me more.  I just don't know where to begin.  Please help.</p>","307235","","","","","2010-04-05 00:03:12","How do I get a Java to call data from the Internet? Where to even start?","<java><android><internet><widget>","2","3","","",""
"2575381","1","2575421","","2010-04-04 18:05:38","4","5441","<p>I am having a problem with views overlapping in a RelativeLayout on Android 1.5...  Everything is working fine on Android 1.6 and above.</p><p>I do understand that Android 1.5 has some issues with RelativeLayout, but I was not able to find anything on StackOverflow or the android beginners group for my specific problem.</p><p>My layout consists of four sections, each of which are made up of a TextView, a Gallery, and another TextView aligned vertically:  </p><p>Running Apps<br>Recent Apps<br>Services<br>Processes  </p><p>When all four sets of these items are displayed everything works fine.  However, my app allows the user to specify that some of these are not displayed.  If the user turns off Running Apps, Recent Apps, or Services then the remaining sections all of a sudden overlap eachother.</p><p>Here is my code for the layout.  I'm not sure what I am doing wrong.  When the user turns off display of a section I use the View.GONE visibility setting:</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:gravity=""center_vertical""    android:layout_gravity=""center_vertical""    android:background=""@null""&gt;&lt;!-- Running Gallery View Items --&gt;&lt;TextView     style=""@style/TitleText""    android:id=""@+id/running_gallery_title_text_id""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:paddingLeft=""1sp""    android:paddingRight=""10sp""    android:text=""@string/running_title""/&gt;&lt;Gallery    android:id=""@+id/running_gallery_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/running_gallery_title_text_id""    android:spacing=""5sp""    android:clipChildren=""false""    android:clipToPadding=""false""    android:unselectedAlpha="".5""/&gt;&lt;TextView     style=""@style/SubTitleText""    android:id=""@+id/running_gallery_current_text_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/running_gallery_id""    android:gravity=""center_horizontal""/&gt;&lt;!-- Recent Gallery View Items --&gt;&lt;TextView     style=""@style/TitleText""    android:id=""@+id/recent_gallery_title_text_id""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@id/running_gallery_current_text_id""    android:gravity=""left""    android:paddingLeft=""1sp""    android:paddingRight=""10sp""    android:text=""@string/recent_title""/&gt;&lt;Gallery    android:id=""@+id/recent_gallery_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/recent_gallery_title_text_id""    android:spacing=""5sp""    android:clipChildren=""false""    android:clipToPadding=""false""    android:unselectedAlpha="".5""/&gt;&lt;TextView     style=""@style/SubTitleText""    android:id=""@+id/recent_gallery_current_text_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/recent_gallery_id""    android:gravity=""center_horizontal""/&gt;&lt;!-- Service Gallery View Items --&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:layout_below=""@id/recent_gallery_current_text_id""    android:gravity=""left""    android:paddingLeft=""1sp""    android:paddingRight=""10sp""    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_below=""@id/service_gallery_title_text_id""    android:spacing=""5sp""    android:clipChildren=""false""    android:clipToPadding=""false""    android:unselectedAlpha="".5""/&gt;&lt;TextView     style=""@style/SubTitleText""    android:id=""@+id/service_gallery_current_text_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/service_gallery_id""    android:gravity=""center_horizontal""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>I ommitted the xml for the Processes section in a (somewhat vain) attempt to keep this shorter...</p><p>What can I do to make this work in Android 1.5?  I don't think it is just a matter of reordering the views in the xml because it works fine when everything is displayed.</p>","249412","","","","","2010-04-04 18:18:14","View overlapping with RelativeLayout on Android 1.5","<android><overlap><relativelayout>","1","0","1","",""
"2575543","1","2594397","","2010-04-04 19:03:54","0","1997","<p>i called canvas.drawBitmap to draw an image, but somehow it's showing up behind/underneath the custom view (or it's background).  can someone explain this?  thanks.</p>","270811","","","","","2010-04-07 17:00:42","android canvas.drawBitmap somehow shows up behind the view","<android>","1","1","","",""
"2575573","1","2575842","","2010-04-04 19:17:32","0","2992","<p>I am trying to implement a ListView that is composed of rows that contain a View on the left followed by a TextView to the right of that. I want to be able to change the background color of the first View based on it's position in the ListView. Below is what I have at this point but it doesn't seem to due anything. </p><pre><code>public class Routes extends ListActivity {    String[] ROUTES;    TextView selection;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ROUTES = getResources().getStringArray(R.array.routes);        setContentView(R.layout.routes);        setListAdapter(new IconicAdapter());        selection=(TextView)findViewById(R.id.selection);    }    public void onListItemClick(ListView parent, View v, int position, long id) {        selection.setText(ROUTES[position]);    }    class IconicAdapter extends ArrayAdapter&lt;String&gt; {        IconicAdapter() {            super(Routes.this, R.layout.row, R.id.label, ROUTES);        }    }    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        View row = inflater.inflate(R.layout.row, parent, false);        TextView label = (TextView) row.findViewById(R.id.label);        label.setText(ROUTES[position]);        View icon = (View) row.findViewById(R.id.icon);        switch(position){        case 0:            icon.setBackgroundColor(R.color.Red);            break;        case 1:            icon.setBackgroundColor(R.color.Red);            break;        case 2:            icon.setBackgroundColor(R.color.Green);            break;        case 3:            icon.setBackgroundColor(R.color.Green);            break;        case 4:            icon.setBackgroundColor(R.color.Blue);            break;        case 5:            icon.setBackgroundColor(R.color.Blue);            break;        }        return(row);    }}</code></pre><p>Any input is appreciated and if you have any questions don't hesitate to ask! </p><p>Thanks,Rob</p>","289153","","","","","2010-04-04 20:51:55","Creating a ListView and setting the background color of a view in each row","<android>","2","0","1","",""
"2575666","1","2576871","","2010-04-04 19:47:31","5","1446","<p>As mentioned in a previous question, I am having difficulty intercepting all android.intent.action.SCREEN_ON events without a long-lived service (discouraged).</p><p>I may be able to work around the need if I can simply work out when the screen is on at any given time, in the service.</p><p>Can anyone suggesting a method call that would return this information? 1.5 upwards.</p>","82515","","","","","2011-08-02 20:24:34","How to detect when the screen is on?","<android>","4","0","1","",""
"2575688","1","2575958","","2010-04-04 19:54:48","0","891","<p>I have a RelativeLayout with different elements. I was planning to have two ListViews on it, but I have noticed there are some problems with scrolling. Since each ListView only shows a maximum of 5 rows should I try to make some kind of custom adapter to merge those ListViews? Or is it better to replace the ListView with a LinearLayout/RelativeLayout and add the rows as I get them manually? (like the first answer in here: <a href=""http://stackoverflow.com/questions/1778485/android-listview-display-all-available-items-without-scroll-with-static-header"">http://stackoverflow.com/questions/1778485/android-listview-display-all-available-items-without-scroll-with-static-header</a> ).</p><p>Which should be the proper way on doing this? or is there another way? Also, each row will have an OnClickListener.</p>","265375","","","","","2010-04-04 21:26:13","Should I use multiple ListViews?","<android><listview>","2","0","1","",""
"2575731","1","2575783","","2010-04-04 20:10:56","0","784","<p>I am trying to get the contents of tags into variables in my java Sax parser. However, the Characters method only returns Char arrays. Is there anyway to get the Char array into an Int???</p><blockquote>  <p>public void characters(char ch[], int start, int  length) {</p><pre><code>  if(this.in_total_results) {      // my INT varialble would be nice here!  } </code></pre>    <p>}</p></blockquote><p>Can anyone help at all?</p><p>Kind regards,</p><p>Andy</p>","231248","","","","","2010-04-04 20:57:20","Sax Parser Character Array to Integer?","<java><android><sax><saxparser>","1","0","","",""
"2575869","1","2575918","","2010-04-04 21:02:04","0","2841","<p>Any suggestions on the best way to display this table on an Android platform? The formatting is not necessary but I am looking for a flexible way to do this because there are numerous tables with different numbers of rows and columns. </p><a href=""http://picasaweb.google.com/lh/photo/Y-HGOsdrMwUzXhRR1CElRg?authkey=Gv1sRgCI-ynuP7m7ewwgE&feat=embedwebsite"" rel=""nofollow""><img src=""http://lh5.ggpht.com/_ypiQ0PmDlSw/S7j9fslKk7I/AAAAAAAABe0/JHY3-gOtfXI/s144/table.png"" /></a><a href=""http://picasaweb.google.com/RHill.isu/DropBox?authkey=Gv1sRgCI-ynuP7m7ewwgE&feat=embedwebsite"" rel=""nofollow""></a>","289153","","","","","2010-04-04 21:22:05","Displaying a table on the Android platform","<android>","2","0","0","",""
"2575962","1","2576257","","2010-04-04 21:27:20","0","1611","<p>Does anyone know if there's a way to access past app installs via the sdk?  I want to be able to get a list of all the apps users have downloaded from the Market.</p>","73865","","","","","2010-04-04 23:26:13","App Install History on Android","<android>","1","0","","",""
"2576298","1","","","2010-04-04 23:40:54","1","1117","<p>In a feeble attempt to learn some Android development am I stuck at graphics. My aim here is pretty simple:</p><ol><li>Take n small images and build a random image, larger than the screen with possibility to scroll around.</li><li>Have an animated object move around on it</li></ol><p>I have looked at the SDK examples, Lunar Lander especially but there are a few things I utterly fail to wrap my head around. I've got a birds view plan (which in my head seems reasonably sane):</p><p>How do I merge the tiles into one large image? The background is static so I figure I should do like this:</p><ol><li>Make a 2d array with refs to the tiles</li><li>Make a large Drawable and draw the tiles on it </li><li>At init draw this big image as the background</li><li>At each onDraw redraw the background of the previous spot of the moving object, and the moving object at its new location </li></ol><p>The problem is the hands on things. I load the small images with ""Bitmap img1 = BitmapFactory.decodeResource (res, R.drawable.img1)"", but then what? Should I make a canvas and draw the images on it with ""canvas.drawBitmap (img1, x, y, null);""? If so how to get a Drawable/Bitmap from that?</p><p>I'm totally lost here, and would really appreciate some hands on help (I would of course be grateful for general hints as well, but I'm primarily trying to understand the Graphics objects). To make you, dear reader, see my level of confusion will I add my last desperate try:</p><pre><code>Drawable drawable;Canvas canvas = new Canvas ();Bitmap img1 = BitmapFactory.decodeResource (res, R.drawable.img1); // 50 x 100 px imageBitmap img2 = BitmapFactory.decodeResource (res, R.drawable.img2); // 50 x 100 px imagecanvas.drawBitmap (img1, 0, 0, null);canvas.drawBitmap (img2, 50, 0, null);drawable.draw (canvas); // obviously wrong as draw == nullthis.setBackground (drawable); </code></pre><p>Thanks in advance</p>","308912","","","","","2010-12-11 14:33:49","Put together tiles in android sdk and use as background","<java><android>","1","0","0","",""
"2576414","1","2577392","","2010-04-05 00:25:19","0","287","<p>I have this code that has one button that let's me choose an entry from contacts, and passes that choesn contact to onActivityResult function. My question is how do I select data of that single contact when all that is passed is an Intent in data variable. That data variable, if converted to string shows something like ""dat: content://contacts/people/4"" so I see that selected contact is somehow passed, but what now? How to get that data?</p><p>And also all I found by googling was examples with deprecated class People, so I don't know how too use new classes.</p><p>Please help.</p><p>Thank you.</p><pre><code>public class HelloAndroid extends Activity {    private static final int CONTACT_ACTIVITY = 100;     /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Button contactButton = (Button) findViewById(R.id.pick_contact_button);        contactButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Uri uri = Uri.parse(""content://contacts/people"");                Intent contacts_intent = new Intent(Intent.ACTION_PICK, uri);                startActivityForResult(contacts_intent, CONTACT_ACTIVITY);             }        });         }     public void onActivityResult(int requestCode, int resultCode, Intent data){          super.onActivityResult(requestCode, resultCode, data);          switch(requestCode){              case(CONTACT_ACTIVITY): {                  if(resultCode == Activity.RESULT_OK) {                      alertText(data.toString());                  }                 break;              }          }    }}</code></pre>","180344","","","","","2010-04-05 07:42:58","Puting contact number into field","<android>","1","0","","",""
"2576661","1","2606682","","2010-04-05 02:32:37","13","22417","<p>I am following this tutorial <a href=""http://developer.android.com/intl/de/guide/tutorials/views/hello-tabwidget.html"">http://developer.android.com/intl/de/guide/tutorials/views/hello-tabwidget.html</a> and have completed it. Now I would actually like to add you know some controls to these tabs like textboxes(text edit).</p><p>How do I do this? I go to my mail.xml using eclipse as my ide and go to layout view and I now get a NullPointerException so I can't even drag stuff onto the layout anymore.</p><p>Thanks</p><p><strong>Edit</strong></p><p>This is what I have</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;LinearLayout                android:orientation=""vertical""                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;EditText android:text="""" android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:password=""true""&gt;&lt;/EditText&gt;            &lt;/LinearLayout&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>","130015","","119212","","2010-04-12 14:39:32","2012-09-18 16:08:08","How to add controls to a Tab Layout in Android?","<android><android-widget>","3","3","16","",""
"2576755","1","2577139","","2010-04-05 03:13:31","2","1130","<p>I was wondering if it were possible to dynamically create an XML layout file to be displayed to the user.  The idea would be to be able to retrieve a layout file from a central server, which could display this dynamic, server driven GUI.</p>","231768","","","","","2010-04-05 06:09:03","How to create a layout file programmatically","<android><dynamic><layout>","2","0","1","",""
"2576894","1","2576930","","2010-04-05 04:15:58","1","430","<p>Is there any way to (programatically) find out what your app's name is? I'm specifically talking about the <code>android:label</code> property from the application tag in the 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.example.test"" android:versionCode=""1"" android:versionName=""1.0""&gt;    &lt;application android:label=""THIS THING HERE!"" android:icon=""@drawable/icon""&gt;        &lt;!-- ... --&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre>","76835","","76835","","2010-04-05 04:21:15","2010-04-05 04:34:04","Finding the ""name"" of your Android application","<android>","2","1","1","",""
"2576980","1","","","2010-04-05 04:55:35","5","1526","<p>I'm trying to write a library that can be shared as a JAR file. This library will include an Activity and I'd like to include the layout in the JAR. Since it doesn't seem possible to include resource files in a JAR and I don't want the end-users to have to include these files themselves I was thinking it would be a nice hack to include the XML as a String then manually inflate it. Does anyone know if this is possible? Any other ideas?</p>","76835","","","","","2010-04-05 06:55:30","Including Android Activities (and their layouts) in JAR files","<android><jar><view><activity><inflate>","1","0","5","",""
"2577021","1","2578389","","2010-04-05 05:12:42","0","5355","<p>I want to have multiple listviews in single activity. But only onelistview should be displayed at one time. The listviews will be loadeddynamically. So, how can I fill all the four listviews at the sametime and display only one?</p>","261566","","23897","","2010-04-05 05:15:30","2011-05-22 00:55:17","Multiple Listviews in single Activity in Android?","<android><listview><activity>","4","1","1","",""
"2577060","1","","","2010-04-05 05:28:54","0","3254","<p>I have updated software and ADT in my Eclipse a number of times. I am unable to run projects above than 1.5.I have the following errors showing up in my console window after i create a HelloWorld project with API Level 4 (1.6):</p><pre><code>[2010-04-04 22:21:53 - Framework Resource Parser] Collect resource IDs failed, class android.R not found in E:\Android\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar[2010-04-04 22:21:53 - Framework Resource Parser] Collect permissions failed, class android.Manifest$permission not found in E:\Android\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar[2010-04-04 22:21:54 - Android Framework Parser] failed to collect preference classes</code></pre><p>How to resolve this issue?</p>","2355649","","","","","2012-11-20 13:03:20","How to resolve Android class issues: android.Manifest$permission and android.R?","<android>","1","0","","",""
"2577067","1","2577111","","2010-04-05 05:30:34","2","3937","<p>I'm trying to set up a simple SQLite database in Android, handling the schema via a subclass of <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html"" rel=""nofollow"">SQLiteOpenHelper</a>.  However, when I query my tables, the columns I think I've inserted are never present.</p><p>Namely, in SQLiteOpenHelper's <code>onCreate(SQLiteDatabase db)</code> method, I use <code>db.execSQL()</code> to run CREATE TABLE commands, then have tried both <code>db.execSQL</code> and <code>db.insert()</code> to run INSERT commands on the tables I've just created.  This appears to run fine, but when I try to query them I always get 0 rows returned (for debugging, the queries I'm running are simple <code>SELECT * FROM table</code> and checking the Cursor's <code>getCount()</code>).</p><p>Anybody run into anything like this before?  These commands seem to run on command-line sqlite3.  Are they're gotchas that I'm missing (e.g. INSERTS must/must not be semicolon terminated, or some issue involving multiple tables)?  I've attached some of the code below.</p><p>Thanks for your time, and let me know if I can clarify further.</p><hr><pre><code>@Overridepublic void onCreate(SQLiteDatabase db){    db.execSQL(""CREATE TABLE ""+ LEVEL_TABLE +"" ("" +                ""  ""+ _ID +"" INTEGER PRIMARY KEY AUTOINCREMENT,"" +               ""  level TEXT NOT NULL,""+               ""  rows INTEGER NOT NULL,""+               ""  cols INTEGER NOT NULL);"");    db.execSQL(""CREATE TABLE ""+ DYNAMICS_TABLE +"" ("" +                ""  level_id INTEGER NOT NULL,"" +               ""  row INTEGER NOT NULL,""+               ""  col INTEGER NOT NULL,""+               ""  type INTEGER NOT NULL);"");    db.execSQL(""CREATE TABLE ""+ SCORE_TABLE +"" ("" +                ""  level_id INTEGER NOT NULL,"" +               ""  score INTEGER NOT NULL,""+               ""  date_achieved DATE NOT NULL,""+               ""  name TEXT NOT NULL);"");    this.enterFirstLevel(db);}</code></pre><p>And a sample of the insert code I'm currently using, which gets called in <code>enterFirstLevel()</code> (some values hard-coded just to get it running...):</p><pre><code>private void insertDynamic(SQLiteDatabase db, int row, int col, int type){    ContentValues values = new ContentValues();    values.put(""level_id"", ""1"");    values.put(""row"", Integer.toString(row));    values.put(""col"", Integer.toString(col));    values.put(""type"", Integer.toString(type));    db.insertOrThrow(DYNAMICS_TABLE, ""col"", values);}</code></pre><p>Finally, query code looks like this:</p><pre><code>private Cursor fetchLevelDynamics(int id){    SQLiteDatabase db = this.leveldata.getReadableDatabase();    try {        String fetchQuery = ""SELECT * FROM "" + DYNAMICS_TABLE;        String[] queryArgs = new String[0];                 Cursor cursor = db.rawQuery(fetchQuery, queryArgs);        Activity activity = (Activity) this.context;        activity.startManagingCursor(cursor);        return cursor;    }    finally {        db.close();    }}</code></pre>","196469","","","","","2011-01-27 05:41:42","Gotchas INSERTing into SQLite on Android?","<android><sqlite>","3","0","0","",""
"2577084","1","2578345","","2010-04-05 05:40:01","24","28357","<p>I want to read browser history in Android phone.</p><p>I have done some document reading, then I come to know that we can read browser history by android.provider.Browser class.  It has :</p><pre><code>final static CursorgetAllVisitedUrls(ContentResolver cr)</code></pre><p>...method which returns <code>Cursor</code>.</p><p>May I get help to handle Cursor, or any example code to get browser history?</p>","252037","","23897","","2010-04-05 05:43:52","2014-02-20 12:18:56","Android read browser history","<android><browser><history>","4","0","11","",""
"2577132","1","","","2010-04-05 06:06:16","0","107","<p>For example my application contain 3 pages and run that application when the middle of that application means at 2 page i got a phone call after that phone call   again i start that application using menu in home screen .At that time i want a page where we stop in previous(that means 2 page).Give me the suggestions Thanks in advance</p>","454808","","454808","","2010-04-05 06:52:15","2010-04-05 07:21:53","Get the running page in an application","<android>","1","2","","",""
"2577221","1","5934983","","2010-04-05 06:38:25","26","27999","<p>I have a large sized image. At runtime, I want to read the image from storage and scale it so that its weight and size gets reduced and I can use it as a thumbnail. When a user clicks on the thumbnail, I want to display the full-sized image.</p>","216431","","1300817","","2013-07-01 14:46:41","2014-01-12 07:36:09","Android how to create runtime thumbnail","<android>","5","0","27","",""
"2577318","1","","","2010-04-05 07:17:43","9","6836","<p>I want to figure out how to detect when the phone wakes up from being in the black screen mode and write a handler for that event. Is that possible? It seems like this would be something a Broadcast Receiver should handle? Or is there a better or more proper way?</p>","309065","","881229","","2014-04-01 19:52:13","2014-04-01 19:52:13","Is it possible to write an Android broadcast receiver that detects when the phone wakes up?","<android><broadcastreceiver>","3","0","2","",""
"2577578","1","2577638","","2010-04-05 08:52:05","18","8886","<p>Hey all,I'm working my way through APress's Beginning Android 2 and I've made it all the way to chapter 3, where we build a skeleton app. The book tells me to compile my application by typing ""ant"" in the command line, but my pc doesn't know what ""ant"" is yet. I checked in the SDK files and it looks like it wasn't included with the Android SDK. Does anybody know where ant is?</p><p>Thanks</p>","304843","","82515","","2010-04-05 09:14:19","2014-01-15 14:54:06","Can't find ant in the Android SDK","<android>","1","2","2","",""
"2577606","1","2578335","","2010-04-05 09:01:30","4","1553","<p>I wanted to know whether we can implement both date and time picker in one view...</p><p>In our iPhone app you can pick both date and time through one view. But in Android we have date picker and time picker used separately. Is there any method by which I can get values of both date and time from one view?</p>","303155","","1947286","","2013-07-24 19:15:07","2013-07-24 19:15:07","Date and time picker in one view","<android><android-widget><android-datepicker><android-timepicker>","1","1","1","",""
"2577679","1","2577804","","2010-04-05 09:27:31","2","1792","<p>I have a custom component which consists of 2 text view and 4 toggle buttons. I want to draw this view at some specific position on the screen. How is that possible?</p>","284372","","246246","","2013-07-15 20:56:41","2013-07-15 20:56:41","Draw Custom View on specific position of screen - Android","<android><android-layout><android-custom-view>","1","0","1","",""
"2577785","1","2577814","","2010-04-05 09:58:15","14","9984","<p>I am developing a small application on Google's android emulator.I am trying to figure out how I can simulate a phone call from one instance of an emulator to another (both running on my computer). Does anyone know how this can be done?</p><p>Thank you very much.</p>","126015","","21234","","2010-04-05 09:59:40","2013-01-22 08:08:33","Ringing myself using android emulator","<android><android-emulator>","4","0","6","",""
"2577864","1","2580219","","2010-04-05 10:24:49","2","1695","<p>I am using ""ViewFlipper"" for my application. </p><p>This ViewFlipper includes 5 layouts. I am trying make it that can be changed from current layout to any layout. In other words, it can be changed Layout#1 -> Layout#5 or Layout#4 -> Layout#1 ..etc.</p><p>How to make it ? </p><p>I used showNext() and showPrevious(). It is not better idea for my case. </p><p>Can I use ViewSwither instead of this case ?</p><p>Please advice. </p><p>Can you give example code related this issue ?</p><p>Thanks in advance.</p>","164589","","82515","","2010-04-05 10:26:18","2010-04-05 18:29:16","Transition between many Views in ViewFlipper?","<android><layout>","1","0","2","",""
"2577921","1","2578021","","2010-04-05 10:44:55","0","1482","<p>i want to develop an application that take email and password of facebook as input, and gets the friends list from facebook.</p><p>For this i am using fbrocket.jar api. But i can't login into the account of facebook through android mobile. Is this fbrocket.jar api enough or not?. Is there any facebook api .jar for android?</p><p>any one can resolv my problem . plz clarify my doubts.</p><p>ThanQ.</p>","247921","","","","","2011-10-25 07:44:02","Facebook fbrocket api for android","<android><facebook>","2","0","","",""
"2577933","1","2577974","","2010-04-05 10:50:19","1","496","<p>I am designing an app in which the data is stored in the database. There's a button in the form which is on clicked to send an email to pre defined mail address with the data that is stored in the database. Since i am a newbie to android i need help regarding sending the mail... So please help me...</p>","303155","","","","","2010-04-05 11:02:32","sending an email using user input from android","<android>","1","0","","",""
"2577956","1","2592600","","2010-04-05 10:57:11","3","8089","<p>i want to put ""Go"" button in android appliation softkeyboard</p><p>for search and other related scenarios can any one guide me how to achieve this? with example.</p><p>any help would be appriciated.</p>","249991","","","","","2013-02-25 11:01:44","how to add Go button in android SoftKeyBoard and its functionality?","<android>","4","1","3","",""
"2578033","1","2578423","","2010-04-05 11:15:54","1","434","<p>I want to play couple of files as one ringtone in android app, How can I do it?edit: without merge</p>","309166","","309166","","2010-04-05 11:21:11","2010-04-05 12:45:38","Can I play more than one file as a ringtone in android app?","<android><ringtone>","1","2","","",""
"2578286","1","","","2010-04-05 12:16:09","1","802","<p>I'm new to android development. I have index page and I'm displaying every links in the same page using div concept.</p><p>Now I want to use the back button for my application. I have developed code to handle the div and it is working in the AVD(Andriod Virtual Device 5556) but if I upload the <code>*.apk</code> into my device it is not working.</p><p>I'm waiting for your reply. Please help me.</p><p>This is my sample code:</p><p>HTML Sample code:</p><pre><code>&lt;div id=""photo_playlist""&gt;           &lt;div id=""photo_playlist_home""&gt;        &lt;div class=""HomePhotoDetailsBar""&gt;            &lt;div class=""innerplay"" id=""innerrow10833""&gt;                &lt;a style=""text-decoration:none;"" onClick=""player('1');""&gt;                    &lt;div class=""thm_image""&gt;                        asdasdasdadadad                    &lt;/div&gt;                    &lt;div class=""video_details_n""&gt;                        &lt;div class=""video_details_premium""&gt;Premium&lt;/div&gt;                        &lt;div class=""photo_details_head""&gt;Zoe Duchesne&lt;/div&gt;                        &lt;div class=""video_details_premium""&gt;5 photos&lt;/div&gt;                    &lt;/div&gt;                    &lt;div class=""video_arrow""&gt;dsfsfsfss&lt;/div&gt;                &lt;/a&gt;            &lt;/div&gt;        &lt;/div&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div id=""detail""&gt;    &lt;div id=""playlist""&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id=""player""&gt;    &lt;div id=""photocontainer""&gt;&lt;/div&gt;&lt;/div&gt;</code></pre><p>JS Sample:</p><pre><code>function photos() {    resetPhotoPlaylist();    $('#photo_playlist').addClass('current');    $('#photo_playlist').css('display','block');    $('#photo_playlist_home').addClass('current');    $('#photo_playlist_home').css('display','block');    $('#player').css('display','none');     $('#playlist').css('display','none');    $('#detail').css('display','none');    $('#photocontainer').css('display','none');}function resetPhotoPlaylist() {    $('#second_playlist').removeClass('current');    $('#second_playlist').css('display','none');    $('#playlist').removeClass('current');    $('#playlist').css('display','none');    $('#photocontainer').removeClass('current');    $('#photocontainer').css('display','none');    $('#photo_playlist_home').removeClass('current');    $('#photo_playlist_home').css('display','none');}function back() {    history_.pop();    var previous = history_.pop();    if(history_.length==0) {        history_ = [""home""];    }    switch(previous) {        case ""home""     :home();break;        case ""news""     :news();break;        case ""video""        :video();break;        case ""player""       :player(1);break;        case ""gallery""      :gallery(1);break;        case ""photos""       :photos();break;        case ""reader""       :reader(1);break;        case ""searchresult"" :searchresult();break;        case ""search""       :search();break;    }}function addToHistory(page) {        history_.push(page);}</code></pre><p>Java Code:</p><pre><code>public void onBackPressed()    {        appView.loadUrl(""javascript:back();"");    }</code></pre><p>Thanks,Rajeevgandhi. S</p>","309197","","186535","","2011-11-25 11:01:45","2011-11-25 11:01:45","back button is working on emulator but it is not working in device in android","<java><javascript><android><android-emulator>","1","2","","",""
"2578439","1","2578535","","2010-04-05 12:49:46","2","1458","<p>I have the following code running on my Android device. It works great and displays my list items wonderfully. It's also clever in the fact it only downloads the data when it's needed by the ArrayAdapter. However, whilst the download of the thumbnail is occurring, the entire list stalls and you cannot scroll until it's finished downloading. Is there any way of threading this so it'll still scroll happily, maybe show a place holder for the downloading image, finish the download, and then show?</p><p>I think I just need to put my downloadImage class into it's own thread so its executed separately from the UI. But how to add this into my code is the mystery!</p><p>Any help with this would be really appreciated.</p><pre><code>private class CatalogAdapter extends ArrayAdapter&lt;SingleQueueResult&gt; {    private ArrayList&lt;SingleQueueResult&gt; items;    //Must research what this actually does!    public CatalogAdapter(Context context, int textViewResourceId, ArrayList&lt;SingleQueueResult&gt; items) {        super(context, textViewResourceId, items);        this.items = items;    }    /** This overrides the getview of the ArrayAdapter. It should send back our new custom rows for the list */    @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.mylists_rows, null);        }        final SingleQueueResult result = items.get(position);        // Sets the text inside the rows as they are scrolled by!        if (result != null) {            TextView title = (TextView)v.findViewById(R.id.mylist_title);            TextView format = (TextView)v.findViewById(R.id.mylist_format);            title.setText(result.getTitle());            format.setText(result.getThumbnail());            // Download Images            ImageView myImageView = (ImageView)v.findViewById(R.id.mylist_thumbnail);            downloadImage(result.getThumbnail(), myImageView);        }        return v;    }}// This should run in a seperate threadpublic void downloadImage(String imageUrl, ImageView myImageView) {    try {        url = new URL(imageUrl);        URLConnection conn = url.openConnection();        conn.connect();        InputStream is = conn.getInputStream();        BufferedInputStream bis = new BufferedInputStream(is);        Bitmap bm = BitmapFactory.decodeStream(bis);        bis.close();        is.close();        myImageView.setImageBitmap(bm);    } catch (IOException e) {        /* Reset to Default image on any error. */        //this.myImageView.setImageDrawable(getResources().getDrawable(R.drawable.default));    }}</code></pre>","231248","","231248","","2010-04-05 14:31:44","2010-04-05 14:31:44","How do I move my image downloader into a seperate thread on Android?","<android><multithreading><imageview><android-arrayadapter>","3","0","3","",""
"2578748","1","2578785","","2010-04-05 14:03:35","1","793","<p>How do you print out the contents of a 2d int array </p><p>Ive code written in java for a sudoku game and im trying to create a game on the android using the same code </p><p>My code in java reads in a text file(sudoku grid) </p><p>i see canvas.drawText will read in a string, but how do you do it for a 2d int array, so it prints out in a grid?</p>","309238","","","","","2010-04-05 14:09:34","2d int array Drawing Canvas","<android>","1","0","0","",""
"2579083","1","2579109","","2010-04-05 15:05:56","2","8453","<p>I'm trying to build a custom clock view in Android. See image <a href=""http://twitpic.com/1devk7"" rel=""nofollow"">http://twitpic.com/1devk7</a></p><p>So far to draw the time and hour markers I have been using the Canvas.rotate method to get the desired effect. However, notice that it is difficult to interpret the numbers in the lower half of the clock (e.g. 6 or 9?) because of the angle in which they are drawn.</p><p>When using drawText, is it possible to draw the text at 45/90/180 degrees so that all text appears upright when my onDraw method has finished?</p>","227228","","401137","","2011-11-15 12:06:00","2011-11-15 12:06:00","Drawing text at an angle (e.g. upside down) in Android","<android><android-canvas><drawtext>","2","0","1","",""
"2579193","1","2579228","","2010-04-05 15:29:00","0","318","<p>I want to make an android application that shows a listing of applications (downloaded from the android market) and launches the one that the user selects.  From what I've read, I'd have to use intents like this:</p><pre><code>  Intent intent = new Intent();  intent.setClassName(packageName, className);  startActivity(intent);</code></pre><p>I just want to be able to launch the applications, not a specific activity that they could have.</p><p>My question is: how could I launch these applications if I don't know their packageName or className? or maybe, how could I get to know their className and packageName, if it's a closed source application that I didn't develop.</p><p>Thanks.</p>","309276","","","","","2010-04-05 15:38:00","Launching unknown activities from an android application","<android><activity><launch>","2","0","","",""
"2579850","1","2580105","","2010-04-05 17:28:30","0","244","<p>In my application I have several activities, the main screen has 4 buttons that each start a different activity. So one of them is a search activity, once it searches it shows you a result activity. This result activity can be reached from other activities, so in general something like this:</p><pre><code>Main activity -&gt; Search activity -&gt; Result activityMain acitivty -&gt; someother activity -&gt; Result activity</code></pre><p>Now, if I have reached this result activity and press back once or twice, and after that press the Home key it will show the Home screen. But if I want to get back to my application by holding the Home button and clicking on my app it will always go back to the Result activity, no matter which activity was the last one I was using. And if I press again back it will take me back to the Home screen.</p><p>If I try it again it will take me again to the Result activity. The only way to avoid this is to start the application by clicking on the app's icon. And this takes me to the last activity I was using and it remembers the state so if I press back again it doesn't take me to the Home screen, instead to the activity before it. To illustrate this:</p><pre><code>Main activity -&gt; Search activity -&gt; result activity --back--&gt; Search activity --Home Button--&gt; Home Screen --Hold Home and select the app --&gt; Result activity --back--&gt; Home Screen--Click application icon--&gt; Search activity --back--&gt; Main activity</code></pre><p>Another thing that happens is that if I press the Home button while on the Result activity, and start the app by clicking the icon, it will take me to the activity prior the the Result one.</p><p>Why is this happening? Any workarounds?</p>","265375","","","","","2010-04-05 18:14:59","About lifecycle of activities","<android><activity>","2","4","","",""
"2579968","1","","","2010-04-05 17:49:55","0","821","<p>Is there a way to determine the State in which a given Lat/Long resides using the Google Api in Android?</p><p>thx</p>","244190","","","","","2010-04-06 05:14:32","Determine the State given a Lat/Long using Google API in android","<android><maps>","2","0","1","",""
"2580009","1","","","2010-04-05 17:57:06","0","4146","<p>My application works fine, once it is initialized in the OnCreate method of my View class.  However, when I open my app after the Droid phone has been sitting idle all night, the OnCreate method is not being called.</p><p>I use the OnCreate to initialize data, and that in turn initializes the GUI.  The GUI clearly shows that OnCreate was not called.</p><p>I tried setting clearTaskOnLaunch=""true"" in my Manifest.  My Manifest is:</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.hedgetools.trin""  android:versionCode=""2""  android:versionName=""1.02""&gt;  &lt;application android:icon=""@drawable/icon""               android:label=""@string/app_name""               android:clearTaskOnLaunch=""true""&gt;    &lt;activity android:name="".Trin""              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=""6"" /&gt;  &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;  &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;&lt;/manifest&gt;</code></pre><p>This did not help.  My OnCreate method is not being call after the Droid phone sits idle all night.  </p><p>Why doesn’t clearTaskOnLaunch cause OnCreate to be called?</p><p>Any help or suggestions will be greatly appreciated.</p><p>Charles</p>","274610","","","","","2011-06-07 18:02:15","Why doesn't setting clearTaskOnLaunch=""true"" cause OnCreate to be called?","<android>","3","0","2","",""
"2580170","1","","","2010-04-05 18:23:58","3","25311","<p>What's the way to create a listview with images on the left side and text right after it?(Note: the images were previously downloaded from the Net)Thanks in advance!</p>","309416","","","","","2013-07-14 21:51:12","ListView with images and text","<android><listview>","3","1","1","2013-07-14 21:54:08",""
"2580216","1","","","2010-04-05 18:28:54","16","13549","<p>Can I control the Android TimePicker view to just show the minutes to 15 minutes interval?</p><p>Meaning if it's 12:28 now, show 12:30 and clicking the + and - button will increment and decrement by 15?</p><p>Thank you,</p><p>Tee</p>","166940","","","","","2014-04-09 09:44:01","Android - TimePicker minutes to 15","<android>","7","0","9","",""
"2580362","1","2584017","","2010-04-05 18:52:07","7","2262","<p>Whenever I run my app I get the Android Device Chooser dialog:</p><p><img src=""http://i39.tinypic.com/ri6mv8.png"" alt=""alt text""></p><p>This is happening because I am using the Google APIs for 1.6 and trying to run the application on my Nexus one. Is there any way to make this automatically, or to not check the compatibility? Sometimes when I make a modification and quickly after I save and run the application, Eclipse will build the project and the Android Device Chooser dialog will show briefly and disappear and the app won't run. I have to click run again for it to work. Any workarounds?</p>","265375","","","","","2011-10-31 20:47:07","Is there a way to hide the Android Device Chooser?","<android>","5","0","2","",""
"2580363","1","2580410","","2010-04-05 18:52:15","1","733","<p>I'm parsing a very simple XML schema with a SAX parser in Android.</p><p>An example file would be</p><pre><code>&lt;Lists&gt;&lt;List name=""foo""&gt;&lt;Note title=""note 1"" .../&gt;&lt;Note title=""note 2"" .../&gt;&lt;/List&gt;&lt;List name=""bar""&gt;&lt;Note title=""note 3"" .../&gt;&lt;/List&gt;&lt;/Lists&gt;</code></pre><p>The ... represents more note data as attributes that aren't important to question.</p><p>I use a SAX parser to parse the document and only implement the <code>startElement</code> and 'endElement' methods of the HandlerBase to handle Note and List nodes.</p><p>However, In some cases the files can be very large and take some time to process.  I'd like to be able to abort the parsing process at any time (i.e. user presses cancel button).</p><p><strong>The best way I've come up with is to throw an exception from my startElement method when certain conditions are met (i.e. <code>boolean stopParsing</code> is true).</strong></p><p><strong>Is there a better way to do this?</strong></p><p>I've always used DOM style parsers, so I don't fully understand the SAX parser.</p><p>One final note, I'm running this on Android, so I will have the Parser running on a worker thread to keep the UI responsive.  If you know how I can kill the thread safely while the parser is running that would answer my question as well.</p>","131871","","","","","2010-04-05 19:06:21","Abort SAX parsing mid-document?","<android><multithreading><sax><saxparser>","1","0","","",""
"2580606","1","2581017","","2010-04-05 19:27:36","6","13780","<p>I am trying to add some text validation to an edit text field located within an alert dialog box. It prompts a user to enter in a name. </p><p>I want to add some validation so that if what they have entered is blank or null, it does not do anything apart from creating a Toast saying error.</p><p>So far I have:</p><pre><code>    AlertDialog.Builder alert = new AlertDialog.Builder(this);    alert.setTitle(""Record New Track"");    alert.setMessage(""Please Name Your Track:"");    // Set an EditText view to get user input    final EditText trackName = new EditText(this);    alert.setView(trackName);    alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            String textString = trackName.getText().toString(); // Converts the value of getText to a string.            if (textString != null &amp;&amp; textString.trim().length() ==0)            {                   Context context = getApplicationContext();                CharSequence error = ""Please enter a track name"" + textString;                int duration = Toast.LENGTH_LONG;                Toast toast = Toast.makeText(context, error, duration);                toast.show();            }            else             {                SQLiteDatabase db = waypoints.getWritableDatabase();                ContentValues trackvalues = new ContentValues();                trackvalues.put(TRACK_NAME, textString);                trackvalues.put(TRACK_START_TIME,tracktimeidentifier );                insertid=db.insertOrThrow(TRACK_TABLE_NAME, null, trackvalues);            }</code></pre><p>But this just closes the Alert Dialog and then displays the Toast. I want the Alert Dialog to still be on the screen.</p><p>Thanks</p>","296810","","8002","","2010-09-15 02:29:57","2013-03-05 12:02:55","Null Validation on EditText box in Alert Dialog - Android","<java><android><validation><alert>","5","0","3","",""
"2580866","1","","","2010-04-05 20:06:32","1","531","<p>There are a few apps on the market that are set up to have a free main component(which is a trial limited to 7 days lets say) then ""recharge"" apps that will add a certain amount of subscription time to an account for the user that allows them to keep using the main app. These ""recharge"" apps are available in the market as well. What I would like to know is how to make it so that once the user has paid for one of these ""recharge"" apps and used it to add time to their subscription, they are unable to uninstall it and re-download it(for free since they paid for it once). Basically how do I set my application up so that you only get 1 successful download of the app from the market per payment. Once the time has been added to the users account I would like the market to behave as though the ""recharge"" app has never been purchased.</p>","309491","","","","","2011-03-23 01:11:50","Android paid applications","<android><subscription><google-play><paid>","3","0","1","",""
"2580984","1","2581076","","2010-04-05 20:29:27","1","4499","<p>I have a WebView. I'd like to show some page from my server, but I require some basic authentication. Is there a way I can specify basic auth credentials when calling WebView.loadData() somehow? I can do this on iphone with the equivalent webview class, thinking maybe same is possible with android?</p><p>Thanks</p>","246114","","","","","2010-10-28 16:39:30","Supply some basic auth credentials to a WebView?","<android>","1","0","","",""
"2581159","1","","","2010-04-05 21:01:12","0","683","<p>I'm trying to modified the way TimePicker works as asked in my question here <a href=""http://stackoverflow.com/questions/2580216/android-timepicker-minutes-to-15"">http://stackoverflow.com/questions/2580216/android-timepicker-minutes-to-15</a></p><p>To be able to do that I need to know if the + and - button was clicked and to disable the input field.</p><p>So can I target the elements in a TimePicker? (i.e the + and - button and the input field)?</p><p>Also is there anyway to determine if the + or the - button was clicked?</p><p>Thanks,<br>Tee</p>","166940","","","","","2010-04-05 21:06:21","Android - TimePicker selecting the button and input field","<android>","1","0","","",""
"2581255","1","2581264","","2010-04-05 21:22:42","1","204","<p>I am about to start developing an Android application and had a question if in Java there self naming. For instance say I had a variable named dog that held the value of scruffy. </p><p>Could I then create a variable named scruffy from that variable. In PHP it would be <code>$$dog</code>. That would make a variable with the name scruffy.</p><p>If this is possible please provide example</p>","160463","","166712","","2010-04-05 23:55:11","2010-04-05 23:55:11","Java / Android self naming","<java><android><variable-naming>","1","0","","",""
"2581471","1","","","2010-04-05 22:05:43","4","1859","<p>Our app uses the gallery pick action to grab an image from the device to upload to a new blog post.  We're seeing on the Moto Droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways.  AFAIK this only occurs on the Droid.</p><p>Found this via google, but we need the full size image to be uploaded in the correct orientation so the solution doesn't work for us:</p><p><a href=""http://groups.google.com/group/android-developers/browse_frm/thread/1246475fd4c3fdb6?pli=1"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_frm/thread/1246475fd4c3fdb6?pli=1</a></p><p>An easy way to reproduce this is to take a picture in portrait on the Droid, then send it to yourself via Gmail.  In the email message, the image will be in landscape (sideways).  I've tested on the droid 2.1 update and the issue is still there.</p><p>Here's some more info:</p><p>I took a peek at the image info in photoshop, and it has this line:</p><pre><code>&lt;tiff:Orientation&gt;1&lt;/tiff:Orientation&gt;</code></pre><p>This spec (http://www.awaresystems.be/imaging/tiff/tifftags/orientation.html) says that the value of 1 is:</p><blockquote>  <p>1 = The 0th row represents the visual  top of the image, and the 0th column  represents the visual left-hand side.</p></blockquote><p>In this case, isn't that incorrect?  The top of the image in my case is the right side, with the 0th row being the left side,  which I think should be a value of '5' for the tiff orientation.</p>","309558","","309558","","2010-04-06 17:49:05","2010-04-06 17:49:05","Android Image Orientation Issue on Motorola Droid","<android><image><orientation><motorola>","1","0","3","",""
"2581481","1","2581675","","2010-04-05 22:08:16","39","28266","<p>Is it possible to assign a widget width to half the available screen width, and do it using declarative xml?</p>","244190","","759866","","2013-12-29 13:13:58","2013-12-29 13:13:58","Assign width to half available screen width declaratively","<android><android-widget>","2","0","9","",""
"2581806","1","","","2010-04-05 23:42:16","1","383","<p>I'm using hierarchyviewer to look through a widget that I'm using. (TimePicker).</p><p>Now I can see that TimePicker contains id/decrement, id/increment and id/timepicker_input.</p><p>How do I get a reference to id/timepicker_input for example?</p><p>Tried my_picker.findViewWithTag(""decrement""); but that returns null.</p><p>Thanks, Tee</p>","166940","","","","","2011-02-01 15:05:24","Android - accessing an element in widget","<android>","1","1","","",""
"2581837","1","2588584","","2010-04-05 23:50:18","13","16441","<p>This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.</p><p>Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?</p><p>Thanks in advance!</p>","43792","","","","","2011-01-21 21:19:45","Android Debugging with Logcat and Emulator. Is it possible?","<android><debugging><logging><logcat>","3","2","2","",""
"2581904","1","2581923","","2010-04-06 00:10:18","0","1614","<p>I am trying to replace my previous ugly text button with an imagebutton. However, after changing the XML file with the following ImageButton code, my application won't even start. Why?</p><pre><code>&lt;ImageButton android:layout_height=""fill_parent""     android:id=""@+id/refresh""android:src=""@drawable/refresh""               /&gt; </code></pre>","253800","","","","","2010-04-06 06:28:10","android: how to add an image button?","<android><image><button>","2","0","1","",""
"2582120","1","","","2010-04-06 01:22:50","1","742","<p>I'm trying to recreate the UI screen called 'My Places' that is used in the Weather Channel app.  I'd attach a screenshot of the screen, but I can't seem to do it here.  It seems they're using two listviews one on top of the other, but I'm not sure for certain. Could anybody confirm this for me? If they are doing this, how is this done? I've tried to implement this, but without full success. My top listview 'Add a place' 'comes up correctly, but the bottom listview will not appear/populate for me? I shall attach my code so far......</p><p>Any help would be greatly appreciated.</p><p>header_row.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;ImageViewandroid:id=""@+id/icon""android:layout_width=""wrap_content""android:layout_height=""fill_parent""android:layout_marginRight=""6dip""android:src=""@drawable/ic_menu_add"" /&gt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""0dip""android:layout_weight=""1""android:layout_height=""fill_parent""&gt;TextViewandroid:id=""@+id/caption""android:layout_width=""fill_parent""android:layout_height=""0dip""android:layout_weight=""1""android:gravity=""center_vertical""android:text=""Add a place""/&gt;/LinearLayout&gt;/LinearLayout&gt;</code></pre><p>main.xml</p><pre><code>?xml version=""1.0"" encoding=""utf-8""?&gt;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;ListViewandroid:id=""@+id/header""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""wrap_content""/&gt;/LinearLayout&gt;/LinearLayout&gt;public class ListViewTest extends Activity{private static String[] items={""lorem"", ""ipsum"", ""dolor"",""sit"", ""amet"", ""consectetuer"",""adipiscing"", ""elit"", ""morbi"",""vel"", ""ligula"", ""vitae"",""arcu"", ""aliquet"", ""mollis"",""etiam"", ""vel"", ""erat"",""placerat"", ""ante"",""porttitor"", ""sodales"",""pellentesque"", ""augue"",""purus""};private ListView Header;private ListView List;private ArrayList&lt;Caption&gt; caption = null;private CaptionAdapter adapter;private ArrayAdapter listAdapter;@Overridepublic void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);caption = new ArrayList&lt;Caption&gt;();Caption cap = new Caption();cap.setCaption(""Add a place"");caption.add(cap);this.adapter = new CaptionAdapter(this, R.layout.header_row, caption);Header = (ListView) findViewById(R.id.header);Header.setAdapter(adapter);//Log.d(""ListViewTest"", ""caption size is:"" + caption.size());adapter.notifyDataSetChanged();List = (ListView) findViewById(R.id.list);listAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, items);List.setAdapter(listAdapter);listAdapter.notifyDataSetChanged();//setListAdapter(new ArrayAdapter&lt;String&gt;(this,//android.R.layout.simple_list_item_1,//items));}private class CaptionAdapter extends ArrayAdapter&lt;Caption&gt;{private ArrayList&lt;Caption&gt; caption;public CaptionAdapter(Context context, int textViewResourceId, ArrayList&lt;Caption&gt; caption){super(context, textViewResourceId, caption);this.caption = caption;}@Overridepublic 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.header_row, null);}Caption c = caption.get(position);if (c != null){TextView caption = (TextView) v.findViewById(R.id.caption);if (caption != null){caption.setText(c.getCaption());}}return v;}}}</code></pre>","309554","","243782","","2010-04-06 10:05:18","2010-04-06 15:01:11","UI android question/problem with Listview","<android>","1","0","","",""
"2582190","1","2583202","","2010-04-06 01:43:36","4","314","<p>I have installed the Android Emulator:</p><p><a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">http://developer.android.com/sdk/index.html</a></p><p>I now have it up and running using the eclipse plug in.</p><p>What I want to do is interface with/open/access google earth on the Emulated phone.. Is this possible?</p>","33863","","33863","","2010-04-07 19:43:30","2010-04-07 19:43:30","Google Earth on Android","<android><android-emulator><mobile-phones><google-earth>","1","0","","",""
"2582292","1","","","2010-04-06 02:16:38","7","1949","<p>guysI am new to Android development, just reading docs and trying theAPIs. I am quit confused how ImageView managed to draw just a part ofits content after an invalidate(Rect) invocation.</p><p>I've checked ImageView.java, found no other drawing method exceptonDraw(Canvas), but onDraw(Canvas) only cut the drawable only if it isbeyound the view's visible boundary.I also read the implementation of View.invalidate(Rect), I think thekey of this function is calling to    mParent.invalidateChild(this, r);However, I think the parent view doesn't know how to draw the child inthe given Rect, it finally has to call some method of it child topaint out.</p><p>Has anybody investigated this part of codes? Would you please give mesome guide?</p>","309658","","429063","","2010-12-09 19:13:41","2011-02-06 21:24:42","How does ImageView just redraw part of its content when invalidate(Rect) is called?","<android><view><invalidate>","3","0","1","",""
"2582325","1","","","2010-04-06 02:24:29","0","99","<p>I am trying to figure out how to set priorities on imagebutton.  Iwant to have a layout with a bunch of Icon or buttons that can beselected either by touch, radio, or checked box.  As these images areselected they are set on queue to be displayed in order ofPrecedence.(that is to be pre-determined). The images are displayed once themainaction button is touched.</p><p>Any help will be greatly appreciated.</p><p>Thank you, </p>","309664","","101258","","2010-04-06 02:43:32","2010-07-10 14:19:59","Setting Priorities on Buttons","<android>","1","0","","",""
"2582491","1","","","2010-04-06 03:35:36","0","479","<p>I am developing an Android application and require some basic datetime manipulation. I have a Date object (from Java.util.Date) holding a specific date. I need to add a specific time to it. The time I have is a string in this format: ""9:00 PM EST""</p><p>How would I ""add"" this time to the previous date? If the Date object currently has: ""4/24/10 00:00:00""</p><p>How would I change it to instead be: ""4/24/10 09:00:00 EST""</p><p>I would prefer to do this without the use of an external library, if possible.</p>","164312","","","","","2010-04-06 04:15:20","How to convert ""9:00 PM EST"" to a Date object","<java><android><date><time><timezone>","1","7","","",""
"2582588","1","2584390","","2010-04-06 04:04:25","2","996","<p>Can I copy the debug.keystore in My home directory to another PC's home directory? Does it have to be Linux on Linux, and Windows and Windows? Can I copy Linux keystores to Windows, and vice-versa?</p>","309702","","","","","2010-04-06 11:25:46","Can I copy debug.keystore from one PC to another?","<android>","1","0","","",""
"2582690","1","2582716","","2010-04-06 04:48:55","5","8393","<p>I have a class2 which is involved by class1 when clicks are made. I have to pass some parameters/objects from class1 to class2. I only know the standard way which does not have an option of passing parameters.</p><pre><code>    // launch the full article  Intent i = new Intent(this, Class2.class);  startActivity(i);</code></pre>","253800","","243782","","2010-04-06 10:03:29","2013-08-20 09:44:58","Android: passing paramters between classes","<android><parameters><android-intent>","1","0","5","",""
"2582802","1","2584350","","2010-04-06 05:24:29","12","11085","<p>This question has been asked before, but that was back when there wasn't an NDK for Android.. So, I'll ask again.  Has anyone setup the Android NDK &amp; SDK to work with Xcode?</p>","267391","","","","","2013-11-13 06:15:56","Android Development with Xcode","<android><xcode>","1","0","5","",""
"2583178","1","2609587","","2010-04-06 07:04:12","3","810","<p>I am working on a module that allows users to post comments on a blog published on Wordpress. I looked at the HTML source for Post-Comment-Form displayed at the bottom of a blog entry (Leave a Reply section). Using that as a reference, I translated it to Java using <code>DefaultHTTPClient</code> and <code>BasicNameValuePairs</code> and my code looks like:</p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost(""http://xycabz.wordpress.com/wp-comments-post.php"");httppost.setHeader(""Content-type"",""application/x-www-form-urlencoded;charset=UTF-8"");List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();nvps.add(new BasicNameValuePair(""author"",""abc""));nvps.add(new BasicNameValuePair(""email"",""abz@xyc.com""));nvps.add(new BasicNameValuePair(""url"",""""));         nvps.add(new BasicNameValuePair(""comment"",""entiendamonos?""));nvps.add(new BasicNameValuePair(""comment_post_ID"",""123""));//this was a hidden field and always set to 0nvps.add(new BasicNameValuePair(""comment_parent"",""0""));try {    httppost.setEntity(new UrlEncodedFormEntity(nvps));} catch (UnsupportedEncodingException e1) {    e1.printStackTrace();}BasicResponseHandler handler = new BasicResponseHandler();try {    Log.e(""OUTPUT"",httpclient.execute(httppost,handler));} catch (ClientProtocolException e) {                   e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}</code></pre><p>I get <code>HTTP 302 Found</code> (Redirect to temporary location) exceptions in the logs with this code, which I ignore. (Note: Usually, when you post a comment(on the web page) you are taken back to the blog page that enlists all the comments. The URL I am getting in the redirects is the same) Even after ignoring this redirect, I can post comments on my personal blog using this code but not on the actual (production) blog. </p><p><strong>Questions:</strong><br>1. Could this be a post-a-comment settings problem(perhaps something the original blog owner might have set)?<br>2. How should HTTPClient handle 302 status code? Eventually, I just have to notify the user of success and failure and not actually take him to the comments page.</p>","236128","","50049","","2010-04-09 04:40:56","2013-07-16 13:07:52","Posting comments to a wordpress-blog in Android","<android><wordpress><httpwebrequest><http-redirect>","2","2","1","",""
"2583257","1","","","2010-04-06 07:20:09","0","4582","<p>i am new to android...I want to connect with server .Like i want to sent data and recieve data from server through Http Connection..Can anyone help me how to do this.Can anyone provide me the sample of both side-client as well as server side.Thanks in advance...</p>","309803","","21234","","2010-04-06 07:21:35","2010-04-07 10:44:46","Http Connection in Android","<android><http>","2","0","1","",""
"2583288","1","2583918","","2010-04-06 07:27:18","1","6457","<p>Need set zoom for camera preview...</p>","273295","","","","","2010-10-05 14:42:02","Sample code for using camera digital zoom in Android-app?","<android><camera><zoom><preview>","3","0","1","",""
"2583591","1","2583901","","2010-04-06 08:42:41","1","93","<p>i'm new at Android world, and i have a doubt, is there any method that give me the name of the id's i create in main.xml?For example i have this:</p><p>main.xml</p><pre><code>&lt;TextView android:id=""@+id/text1""       android:layout_width=""70px""       android:layout_height=""70px""       android:text=""Google""       /&gt;&lt;TextView android:id=""@+id/text2""       android:layout_width=""70px""       android:layout_height=""70px""       android:text=""As""       /&gt;</code></pre><p>And what i want is the id name from the two TextView, is there any method that i can use in my class .java that give me for this example the id? In this case i want the (text1 and text2).</p><p>Thanks and forgive mi English.</p>","284466","","243782","","2010-04-06 09:42:04","2010-04-06 09:50:41","How to know all id's that i have in the file main.xml in android?","<android><textview>","2","0","","",""
"2583599","1","2583878","","2010-04-06 08:45:35","0","1498","<p>I am trying to do an autocomplete version my way (logic, layout, etc...) , so I don't want to use the AutoCompleteTextView. My question is how to set an EditText on top of a ListView in a class inheriting from a ListAcvitivy. </p><p>I tried two kinds of layout, none of them worked. </p><p>First one : </p><pre><code>   &lt;EditText android:id=""@+id/autocomplete_server""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:layout_marginLeft=""5dp""              android:completionThreshold=""1""              android:singleLine=""true""/&gt;     &lt;ListView  android:id=""@id/android:list""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:background=""#000000""                android:layout_weight=""1""                android:drawSelectorOnTop=""false""/&gt;      &lt;TextView android:id=""@id/android:empty""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:background=""#FF0000""                android:text=""No data""/&gt; </code></pre><p>This one only shows me the EditText but does not display the list Second one : </p><pre><code>   &lt;LinearLayout  android:id=""@id/android:list""                   android:orientation=""horizontal""                   android:layout_width=""fill_parent""                   android:layout_height=""wrap_content""                   android:padding=""5dp""&gt;     &lt;EditText  android:id=""@+id/autocomplete_server""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_marginLeft=""5dp""                android:completionThreshold=""1""                android:singleLine=""true""/&gt;     &lt;ListView  android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:background=""#000000""                android:layout_weight=""1""                android:drawSelectorOnTop=""false""/&gt;      &lt;/LinearLayout&gt; </code></pre><p>This sample gives me a : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eip.core/com.eip.core.Search}: java.lang.ClassCastException: android.widget.LinearLayout</p><p>Does anyone have any idea bout how to implement an EditText on top of a listView ? </p>","290613","","21234","","2010-06-25 13:23:14","2010-06-25 13:23:14","How to set an EditText on top of a ListView?","<android><listview><layout>","2","0","","",""
"2583711","1","2583762","","2010-04-06 09:12:06","0","340","<p>i've developed an android app that's fetches an xml file and displays this data via several markers on the map. This works fine so far. </p><p>The problem right now is that when i switch the orientation of the phone (portrait->landscape or vice versa) the markers disappear for a small moment, the xml processing is started again and then they reappear.</p><p>Is there a way to prevent this re-loading of the file? It only takes about 2-3 seconds..so no big deal, but still disturbing</p>","309871","","1748763","","2013-08-08 20:58:23","2013-08-08 20:58:23","Background Activity for Map in Android started again if phone orientation is changed","<android><map><orientation>","2","0","","",""
"2583870","1","","","2010-04-06 09:45:31","1","497","<p>I need to take the Bitmap of all the Views in ViewFlipper. But itgives me the Bitmap of only the current content on the screen. Isthere any way of getting Bitmap of all the Views in the ViewFlipper.</p><p>Or is there any other way around to get the Bitmap of all the Views. Ihave four views and need to load them at the same time and get theirBitmap so that I can resize it and later display with Gallery.</p><p>I hope to get a quick response this time around.</p>","261566","","1471203","","2013-01-09 10:55:02","2013-01-09 10:55:02","Getting Bitmap of all the Views in ViewFlipper in Android?","<android><bitmap><gallery><viewflipper>","0","3","2","",""
"2583913","1","","","2010-04-06 09:52:33","0","827","<p>I'm working on an application using Android SO and Java. I would like to send an xml file as POST to a php server, that inserts the information from the xml into a database.</p><p>how can i do that? </p><p>regards :D</p>","309897","","49478","","2010-04-06 09:57:53","2010-04-06 10:01:37","Send a xml file with POST and receive in php","<java><php><android>","1","2","1","",""
"2583966","1","2788780","","2010-04-06 10:02:57","14","18767","<p>In SDK 1.5 I was using the PackageManager class to set the preferred home screen to be my app using PackageManager.addPackageToPreferred(). In the new SDK (using 2.1) this has been deprecated so I'm trying to use addPreferredActivity() for the same result but it's not working as expected.</p><p>Some necessary background. I'm writing a lock screen replacement app so I want the home key to launch my app (which will already be running, hence having the effect of disabling the key). When the user ""unlocks"" the screen I intend to restore the mapping so everything works as normal.</p><p>In my AndroidManifest.xml I have:</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;&lt;uses-permission android:name=""android.permission.SET_PREFERRED_APPLICATIONS""&gt;&lt;/uses-permission&gt;</code></pre><p>In my code I have the following snippet:</p><pre><code>// Set as home activity// This is done so we can appear to disable the Home key.PackageManager pm = getPackageManager();//pm.addPackageToPreferred(getPackageName());IntentFilter filter = new IntentFilter(""android.intent.action.MAIN"");filter.addCategory(""android.intent.category.HOME"");filter.addCategory(""android.intent.category.DEFAULT"");ComponentName[] components = new ComponentName[] {    new ComponentName(""com.android.launcher"", "".Launcher"")};Context context = getApplicationContext();ComponentName component = new ComponentName(context.getPackageName(),MyApp.class.getName());pm.clearPackagePreferredActivities(""com.android.launcher"");pm.addPreferredActivity(filter, IntentFilter.MATCH_CATEGORY_EMPTY,components, component);</code></pre><p>The resulting behavior is that the app chooser comes up when I press the Home key, which indicates that the clearPackagePreferredActivities() call worked but my app did not get added as the preferred. Also, the first line in the log below says something about ""dropping preferred activity for Intent"":</p><blockquote>  <p>04-06 02:34:42.379: INFO/PackageManager(1017): Result set changed, dropping preferred activity for Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 } type null</p>    <p>04-06 02:34:42.379: INFO/ActivityManager(1017): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=android/com.android.internal.app.ResolverActivity }</p></blockquote><p>Does anyone know what this first log message means? Maybe I'm not using the API correctly, any ideas? Any help would be greatly appreciated.</p>","309885","","309885","","2010-04-06 10:09:48","2013-04-27 02:32:41","How do I use PackageManager.addPreferredActivity()?","<android><android-sdk-2.1>","4","1","11","",""
"2584058","1","2584332","","2010-04-06 10:18:25","11","30275","<p>I currently register a content observer on the following URI ""content://sms/"" to listen out for incoming and outgoing messages being sent.</p><p>This seems to work ok and I have also tried deleting from the sms database but I can only delete an entire thread from the following URI ""content://sms/conversations/""</p><p>Here is the code I use for that</p><pre><code>String url = ""content://sms/"";         Uri uri = Uri.parse(url);         getContentResolver().registerContentObserver(uri, true, new MyContentObserver(handler));                    }class MyContentObserver extends ContentObserver {     public MyContentObserver(Handler handler) {         super(handler);     }@Override public boolean deliverSelfNotifications() {     return false;     }@Override public void onChange(boolean arg0) {     super.onChange(arg0);     Log.v(""SMS"", ""Notification on SMS observer"");     Message msg = new Message();     msg.obj = ""xxxxxxxxxx"";    handler.sendMessage(msg);    Uri uriSMSURI = Uri.parse(""content://sms/"");    Cursor cur = getContentResolver().query(uriSMSURI, null, null,                 null, null);    cur.moveToNext();    String protocol = cur.getString(cur.getColumnIndex(""protocol""));    if(protocol == null){           Log.d(""SMS"", ""SMS SEND"");            int threadId = cur.getInt(cur.getColumnIndex(""thread_id""));           Log.d(""SMS"", ""SMS SEND ID = "" + threadId);            Cursor c = getContentResolver().query(Uri.parse(""content://sms/outbox/"" + threadId), null, null,                   null, null);           c.moveToNext();           int p = cur.getInt(cur.getColumnIndex(""person""));           Log.d(""SMS"", ""SMS SEND person= "" + p);            //getContentResolver().delete(Uri.parse(""content://sms/conversations/"" + threadId), null, null);    }    else{        Log.d(""SMS"", ""SMS RECIEVE"");           int threadIdIn = cur.getInt(cur.getColumnIndex(""thread_id""));         getContentResolver().delete(Uri.parse(""content://sms/conversations/"" + threadIdIn), null, null);    } }} </code></pre><p>However I want to be able to get the recipricant and the message text from the SMS Content Provider, can anyone tell me how to do this?</p><p>And also how to delete one message instead of an entire thread?</p>","243999","","243999","","2010-04-06 11:42:33","2010-08-08 18:38:35","Android - Querying the SMS ContentProvider?","<android><sms><uri><android-contentprovider>","2","3","20","",""
"2584083","1","","","2010-04-06 10:24:32","0","715","<p>I have question on the Android API. Android API provides a class called ""Instrumentation"" class. What is the use of this class? Is the Instrumentation class be used only together with Junit for unit testing.</p><p>Can Junit framework can be used to test the methods of the Android API without using the Instrumentation class.</p><p>Since Junit package has been included in the Android package, I hope we dont need to use install separately for unit testing. </p><p>I would appreciate if you could provide me the information as i can't find these clear information anywhere on the Web.</p><p>If we use Junit test framework to test the Android API, can we have test results in the UI format rather than test format.?</p><p>Thanks a lot. Apprecite your time.</p><p>Regards,Riyas</p>","309928","","21234","","2010-04-06 10:51:27","2013-03-13 12:52:28","Instrumentation class in the Android API","<android><junit><instrumentation>","2","0","","",""
"2584130","1","","","2010-04-06 10:34:28","0","1032","<p>I have written a code snippet to send mail when a button is clicked. But when i click the send mail button i am getting an ActivityNotFound exception in the logcat... Here's the code...</p><pre><code>public class appointments extends Activity {List&lt;Strings&gt; appnt=new ArrayList&lt;Strings&gt;();ArrayAdapter&lt;Strings&gt; adapter=null;EditText name=null;EditText phone=null;Date date=null;Spinner spinner=null;EditText make=null;EditText miles=null;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);name=(EditText)findViewById(R.id.nametext);phone=(EditText)findViewById(R.id.phonetext);make=(EditText)findViewById(R.id.maketext);miles=(EditText)findViewById(R.id.miles);Button mail=(Button)findViewById(R.id.email);mail.setOnClickListener(onMail);Button reset=(Button)findViewById(R.id.reset);reset.setOnClickListener(onReset);Spinner hubSpinner = (Spinner) findViewById(R.id.spinner);ArrayAdapter adapter = ArrayAdapter.createFromResource( this, R.array.services , android.R.layout.simple_spinner_item);adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);hubSpinner.setAdapter(adapter);}private View.OnClickListener onMail=new View.OnClickListener() {public void onClick(View v){Strings r=new Strings();r.setName(name.getText().toString());r.setPhone(phone.getText().toString());r.setMake(make.getText().toString());r.setMiles(miles.getText().toString());final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""plain/text"");emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {""helpline@xyz.com"" });emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,r.getServices());emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, r.getName());emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, r.getMake());emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, r.getMiles());startActivity(Intent.createChooser(emailIntent, ""Send mail...""));}};private View.OnClickListener onReset=new View.OnClickListener() {public void onClick(View v){name.setText("""");phone.setText("""");make.setText("""");miles.setText("""");}};} </code></pre><p>Should i use another class for onClicklistener or can i display the mail in this activity itself...</p>","303155","","82515","","2010-04-06 13:31:21","2010-04-06 20:59:05","Activity Not found Exception while trying to send a mail","<android>","1","2","","",""
"2584245","1","2584442","","2010-04-06 10:56:05","5","4339","<p>My application displays Hebrew text which comes from a Web Service.<br>When a sentence contains digits (in the middle of it), the digits appear in a mirror view:<br>29 appears as 92, 21:45 appears as 54:12 and 2,000 appears as 000,2.<br>Also, when a sentence starts with digits or English characters, they get thrown to the end of the sentence messing it all up...  </p><p>Does anyone have an idea how can this be solved? Is RTL support in Android still immature?</p>","283630","","569101","","2013-06-05 11:40:23","2013-06-05 11:40:23","Android: RTL support - digits embedded in a right to left sentence (Hebrew)","<android><hebrew><right-to-left>","3","1","1","",""
"2584308","1","","","2010-04-06 11:11:12","2","465","<p>I am working on a android project and I need to connect the gPhone with the PC using UDP socket. The same operation, sending a message to from gPhone to the PC, returns different results in different time: Sometimes succeeded and sometimes throws a <code>SocketException</code>(The system call was cancelled).</p><p>Can anyone tell me what possibly results in this <code>SocketException</code>? </p>","309950","","119895","","2011-08-09 13:30:08","2011-08-09 13:30:08","SocketException (The system call was cancelled) ","<android><sockets><udp>","1","0","","",""
"2584376","1","2584438","","2010-04-06 11:23:09","1","4668","<p>I am planning on converting some longitude and latitude values to XML and then sending the file to a web server to display on a Google Map Interface. </p><p>Is it possible to send an XML file to a web server through my own application in Android?</p><p>Thanks</p>","296810","","","","","2010-04-06 11:33:15","Send XML file to web server in Android","<java><xml><android><apache><http>","2","0","1","",""
"2584401","1","2584485","","2010-04-06 11:27:48","3","12819","<p>I am trying to write a small application using bouncycastle algorithm, from the <a href=""http://www.google.com/codesearch/p?hl=en#atE6BTe41-M/libcore/security/src/main/java/org/bouncycastle/jce/provider/BouncyCastleProvider.java&amp;q=package%3aandroid%20blowfish%20lang%3ajava&amp;d=9&amp;t=0&amp;l=205"" rel=""nofollow"">BouncyCastleProvider.java</a> it says we have to import and add the provider during runtime by the following code</p><p><code>import org.bouncycastle.jce.provider.BouncyCastleProvider;</code><code>Security.addProvider(new BouncyCastleProvider());</code></p><p>error - The import org.bouncycastle cannot be resolved; during importerror - BouncyCastleProvider cannot be resolved to a type; when calling addProvider</p><p>I though bouncycastle is not provided with the Android 1.6 SDK, so thought of installing separately. how should i do this?If Bouncycastle is shipped along with SDK, what should i do to avoid these errors?I am using Android 1.6, eclipse-V3.4.0 on winXP .Thanks in advance</p>","177303","","33236","","2011-11-29 21:13:51","2012-05-03 21:15:46","how to add bouncycastle algorithm to android","<android><encryption><bouncycastle>","4","1","4","",""
"2584497","1","","","2010-04-06 11:42:25","52","26202","<p>What is the difference between <code>sendStickyBroadcast</code> and <code>sendBroadcast</code> in Android?</p>","309974","","1507439","","2013-04-29 15:10:02","2014-02-17 12:36:06","what is the difference between sendStickyBroadcast and sendBroadcast in Android","<android><android-intent><android-broadcast>","2","0","23","",""
"2584616","1","","","2010-04-06 12:04:32","0","66","<p>I have an Android application that works off of a smaller database, around 300 entries. To view the database, I have created a custom view that contains individual rows of data. Then I query the database, and add each line to a newly created custom view.</p><p>The problem is that it takes a little white for all of this to be created/loaded, so when you open the application, it sits for a few seconds. </p><p>How can I load one line of data, then display it, then the next, append it, etc.?</p>","309987","","","","","2010-12-24 21:50:57","How do I display each view once as they are loaded, in Android?","<database><android>","1","0","","",""
"2584812","1","","","2010-04-06 12:39:25","3","1460","<p>can any one tell me which is the image format used in android phones?</p>","309860","","","","","2010-04-06 12:43:12","image format in android","<android>","1","0","1","",""
"2584867","1","3145707","","2010-04-06 12:49:18","4","2113","<p>I am trying to find some code which will help me to find out if the device which I use has GPS or not? I don't want to know if GPS is enabled or disabled. I just want to know if the device has GPS hardware or not through my program.</p>","162644","","114066","","2010-04-06 14:58:14","2010-06-30 00:18:32","Programmatically find device support GPS or not?","<android>","2","1","2","",""
"2584873","1","2585448","","2010-04-06 12:50:13","2","2189","<p>I'm developing an application that will be available from a website (market probably as well). The problem I'm having at the moment is how to handle the updates to the app. I know how to check the version against the current one and I know if I need to update it. Question is...how?</p><p>Is there a way I can download an APK from the website and start the install process? The user will have to confirm of course, but I just want to be able to start it for him. At the moment I'm doing this:</p><pre><code>private void doUpgrade() {    // TODO Auto-generated method stub    Builder builder = new AlertDialog.Builder(this);    builder.setTitle(getString(R.string.upgrade));    builder.setIcon(R.drawable.help);    builder.setMessage(getString(R.string.needUpgrade));    builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            Map&lt;String, String&gt; data = new HashMap&lt;String, String&gt;();            try {                HttpResponse re = Registration.doPost(""http://www.android-town.com/appRelease/AndroidTown.apk"",data);                int statusCode = re.getStatusLine().getStatusCode();                closeApp();            } catch (ClientProtocolException e) {                e.printStackTrace();                Toast.makeText(getApplicationContext(), getString(R.string.noURLAccess), Toast.LENGTH_SHORT).show();                closeApp();            } catch (IOException e) {                e.printStackTrace();                Toast.makeText(getApplicationContext(), getString(R.string.noURLAccess), Toast.LENGTH_SHORT).show();                closeApp();            }        }    });    builder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            dialog.cancel();            closeApp();        }    });    builder.show();}</code></pre><p>But it doesn't really do anything...should I open a webView with the URL? A new runnable thread? Any other way? Please help :)</p><p>Cheers</p>","297616","","19750","","2010-04-06 12:53:29","2013-12-05 04:25:56","Updating an application OTA","<android><ota>","3","0","","",""
"2585055","1","","","2010-04-06 13:19:58","9","10057","<p>I'm trying to do basic authentication to view a protected url. I want to access the protected url which looks like this:</p><pre><code>http://api.test.com/userinfo/vid?=1234</code></pre><p>So I do the following with a WebView:</p><pre><code>mWebView.setHttpAuthUsernamePassword(""api.test.com"", """", ""me@test.com"", ""mypassword"");mWebView.loadUrl(""http://api.test.com/userinfo/user?uid=53461"");</code></pre><p>but the authentication doesn't seem to work, I'm just getting an output error page. Am I using the WebView method correctly here?</p><p>Update:Trying with curl:</p><pre><code>curl -u me@test.com:mypassword http://api.test.com/userinfo/user?uid=53461</code></pre><p>and it pulls the page fine. I tried every combination of the host parameter, the owners of the api don't know what I mean by 'realm' though (and neither do I) - what info could I give them to help this along?</p><p>Thanks</p>","246114","","246114","","2010-04-07 18:35:07","2012-11-17 10:33:51","Using WebView setHttpAuthUsernamePassword?","<android>","5","3","3","",""
"2585125","1","2585958","","2010-04-06 13:28:54","1","1311","<p>I am making an Android game with an Activity called Game, a SurfaceView called GameView and a Thread called GameThread. The Game's onCreate(), I make a new GameView, which makes a new GameThread, where all the game logic and canvas drawing is carried out.</p><p>However, I'm having some lifecycle difficulties. When I press back and restart it, it works fine, but when I press home and restart it, all I see is a blank screen. Here are the GameView's onSurfaceCreated() and onSurfaceDestroyed():</p><pre><code>@Overridepublic void surfaceCreated(SurfaceHolder holder) {    mThread.mRunning = true;    mThread.mWidth = getWidth();    if(mThread.mWidth &gt; 550) mThread.mWidth = 550;    mThread.mHeight = getHeight();    try {        mThread.start();    } catch(IllegalThreadStateException e) {    }}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {    // Wait for the secondary thread to end before finishing    boolean retry = true;    mThread.mRunning = false;    while (retry) {        try {            mThread.join();            retry = false;        } catch (InterruptedException e) {        }    }       }</code></pre>","63887","","","","","2010-04-06 15:10:18","Android game goes blank after pressing home and restarting","<android><surfaceview>","1","0","","",""
"2585129","1","2585416","","2010-04-06 13:29:18","3","2835","<p>i am having a gridview. when i select it, the selector(orange color) will shows like square. i want to set that as rounded corners. how to do that?</p>","267269","","","","","2010-04-06 14:10:30","gridview selector in android. how?","<android><gridview>","1","0","","",""
"2585260","1","2585485","","2010-04-06 13:47:27","7","8072","<p>When I start my application initially, I get a black screen which stays for a few seconds before my main activity starts. In case of iphone an image with name default is displayed for that split second. I'm not sure how to do the same in Android. I tried as below in vain :</p><pre><code>         &lt;activity android:name="".Index""              android:label=""@string/app_name""              android:screenOrientation=""portrait""              android:theme=""@drawable/defaultimage""&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>","286044","","914220","","2013-01-08 11:33:02","2013-01-08 11:33:02","How to avoid Black Screen on starting an application","<android><themes>","1","1","2","",""
"2585332","1","","","2010-04-06 13:57:58","0","2548","<p>I want to create a service in Android which will initially ask user if they want to start Bluetooth and set the Bluetooth discovery.</p><p>My question is: </p><ol><li><p>Can I launch in the service following activities?</p><pre><code>if (!mBluetoothAdapter.isEnabled()){    Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);    startActivityForResult(enableBtIntent, 0);}// Set Phone Discoverable for 300 seconds.Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 600);startActivity(discoverableIntent);</code></pre></li><li><p>I want to set discoverabilty of the phone on for lifetime of application. Is it possible?</p></li><li><p>I want to access empty space available on SD card. How should i do it?</p></li></ol><p>Thanks in advance.</p>","271769","","23234","","2010-04-06 14:00:19","2010-08-10 11:24:21","Creating Service with Bluetooth activation in Android","<android><service><bluetooth><discovery>","1","0","","",""
"2585465","1","","","2010-04-06 14:18:09","4","4919","<p>Using my Android application, when a user does a certain action, a background service is started that fetches the current GPS location and saves it in a database in addition of doing some other stuff. In that service, I use the <code>requestLocationUpdates()</code> from the <code>LocationManager</code> class and wait until the <code>onLocationChanged()</code> of my <code>LocationListener</code> (which is implemented by the service) is fired. But what is the best way to wait for the <code>onLocationChanged</code> to fire? Should I simply poll on a variable and wait until it is set? Any tips?</p><p>Note: I cannot simply write to the database in the <code>onLocationChanged()</code> because of some other stuff.</p><p>EDIT: To clearfy my situation, I can present an example similar to my case:Let's say user pushes a button and a method <code>myMethod</code> is fired which will return some object. Then, in this myMethod I will register for location updates from the GPS (using <code>requestLocationChanged</code>) and in addition wait for the users location and use it for something. In other words, <code>myMethod</code> cannot return before the location is present. I don't know how I can use <code>onLocationChanged</code> in this case.</p>","290744","","12388","","2010-08-25 15:19:04","2012-08-31 04:34:20","What is the best way to wait for a GPS location fix?","<android><android-location>","4","0","2","",""
"2585650","1","2585846","","2010-04-06 14:37:32","1","17443","<p>I am trying to create an item list, diffrent for each i and j variable. My code is:</p><pre><code>if (i == 0) {             if (j == 0) {                 final CharSequence[] items = {""4:45"", ""5:00""}            } else if (j == 1) {                 final CharSequence[] items = {""4:43"", ""4:58""}            } else if (j == 2) {                 final CharSequence[] items = {""4:41"", ""4:56""}            } else {                 final CharSequence[] items = {""4:38"", ""4:53""}}</code></pre><p>...</p><pre><code>new AlertDialog.Builder(this)               .setTitle(""Hours"")               .setItems(items,                new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialoginterface, int i) {                      // getStation(i);                   }                })               .show();       }</code></pre><p>I get an error in the line <code>.setItems(items,</code>:</p><pre><code>items cannot be resolved</code></pre><p>I think that the compiler thinks that the <code>CharSequence[] items</code> may not be initialised or something... How can I make this programme run?</p>","255355","","","","","2010-04-06 15:09:28","Variable cannot be resolved","<java><android>","6","1","0","",""
"2585934","1","2586951","","2010-04-06 15:06:06","5","8777","<p>I know this is possible but I'm not really sure where to start. Has anyone been able to achieve this?</p><p>Thanks.</p>","296810","","","","","2012-06-21 00:08:23","Exporting a SQLite database to an XML file in Android","<java><xml><android><sqlite>","2","0","3","",""
"2585952","1","","","2010-04-06 15:09:10","0","550","<p>Still new to Android</p><p>I want to display some data as an HTML-like ordered list (non-actionable).</p><p>Example;</p><ol><li>Item One</li><li>Item Two</li><li>Item Three</li></ol><p>I feel I am missing something obvious.</p><p>Thanks,JD</p>","297403","","","","","2011-04-06 18:47:49","Android - how do I display a list of items in an HTML-like Ordered list?","<android><user-interface>","2","0","","",""
"2586263","1","","","2010-04-06 15:56:17","1","1484","<p>I followed <a href=""http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap"">this stackoverflow thread</a> to implement EmailSender using Javamail on Android.</p><p>But I am still getting this exception:</p><blockquote>  <p>Could not connect to SMTP host: smtp.gmail.com, port: 465</p></blockquote><p>I am using Android 1.6.What might cause this problem?</p><p>Any help is appreciated, thanks.</p>","310180","","166712","","2010-04-06 16:01:53","2011-10-03 06:26:07","Sending Email in Android using JavaMail API without using the default android app","<android><email><javamail>","2","0","","",""
"2586301","1","2588112","","2010-04-06 16:02:29","39","41996","<p>How do we set the input type for an EditText programatically? I'm trying:</p><pre><code>mEdit.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);</code></pre><p>it doesn't seem to have any effect.</p><p>Thanks</p>","246114","","","","","2013-08-12 15:28:54","Set inputType for an EditText?","<android>","6","0","10","",""
"2586528","1","2587210","","2010-04-06 16:29:20","2","1164","<p>Take a simple XML file formatted like this:</p><pre><code>&lt;Lists&gt;&lt;List&gt;&lt;Note/&gt;...&lt;Note/&gt;&lt;/List&gt;&lt;List&gt;&lt;Note/&gt;...&lt;Note/&gt;&lt;/List&gt;&lt;/Lists&gt;</code></pre><p>Each node has some attributes that actually hold the data of the file.  I need a very quick way to count the number of each type of element, (List and Note).  Lists is simply the root and doesn't matter.</p><p>I can do this with a simple string search or something similar, but I need to make this as fast as possible.</p><p>Design Parameters:<br>Must be in java (Android application).<br>Must <strong>AVOID</strong> allocating memory as much as possible.<br>Must return the total number of Note elements and the number of List elements in the file, regardless of location in file.  </p><p>Number of Lists will typically be small (1-4), and number of notes can potentially be very large (upwards of 1000, typically 100) per file.</p><p>I look forward to your suggestions.</p>","131871","","23897","","2010-04-06 16:32:20","2010-04-07 11:59:49","Counting XML elements in file on Android","<java><xml><android>","4","1","1","","2010-04-06 16:29:38"
"2586573","1","2586837","","2010-04-06 16:39:19","1","441","<p>For a game I am trying to create for Android I am looking for a way to use/access the orientation yaw/pitch to move the player left or right.</p><p>Does anyone know how to do this, or where to find a tutorial?</p>","174868","","174868","","2010-04-12 08:25:36","2010-04-12 08:25:36","Android Orientation","<android>","1","1","1","",""
"2586663","1","","","2010-04-06 16:52:31","0","39","<p>I am trying to make a app with the tuotrail of the developerspage, then I would like to display a main.xml in a tabview, instead the textview, wich in the tuotrail,is in the activity.How do I tell my tab in activity do display the main.xml?</p><p>Thanks!</p>","310227","","","","","2010-04-06 18:15:52","Lablayout and Linairlayout","<android>","1","0","","",""
"2587071","1","","","2010-04-06 17:49:56","1","219","<p>I am having issues @ run with this code: App Force Closing..</p><h2>Sprinter.Java</h2><pre><code>import android.app.ListActivity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.widget.ListAdapter;import android.widget.SimpleCursorAdapter;public class Sprinter extends ListActivity {    /** Called when the activity is first created. */    final static String MY_DB_NAME = ""Sprinter"";     final static String MY_DB_TABLE = ""Stations"";     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);           SQLiteDatabase myDB = null;     try {          myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);          myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE + ""_id integer primary key autoincrement, name varchar(100);"");          myDB.execSQL(""INSERT INTO "" + MY_DB_TABLE + "" (_id, name)"" + "" VALUES ('', 'Oceanside Transit Center');"");          myDB.execSQL(""INSERT INTO "" + MY_DB_TABLE + "" (_id, name)"" + "" VALUES ('', 'Coast Highway');"");          Cursor mCursor = myDB.rawQuery(""SELECT name"" + "" FROM "" + MY_DB_TABLE, null);          startManagingCursor(mCursor);          ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.list_item, mCursor, new String[] { ""name"" }, new int[] { R.id.Name });          this.setListAdapter(adapter);          this.getListView().setTextFilterEnabled(true);        } finally {          if (myDB != null) {               myDB.close();          }        }    }     }</code></pre><h2>main.xml</h2><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:id=""@id/android:list""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;/ListView&gt;    &lt;TextView    android:id=""@id/android:empty""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""No Data""    /&gt;&lt;/LinearLayout&gt;</code></pre><h2>list_item.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout""           android:layout_width=""fill_parent""           android:layout_height=""fill_parent""           xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;TextView android:id=""@+id/Name""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;      &lt;/TextView&gt; &lt;/LinearLayout&gt; </code></pre>","310268","","236247","","2011-06-24 17:52:25","2011-06-24 17:52:25","Help with ListView Database","<database><android><listview>","1","1","","",""
"2587125","1","3103220","","2010-04-06 17:58:11","0","6168","<p>I'm trying to get an html5 demo page working on Android 2.1, have tried both droid and nexus one with 2.1 but they only display the poster image, and do not play the video.  Pressing on the video does not do anything.  <strong>Edit- resolved with the onclick handler on the video tag</strong></p><p>Is it possible to use html5 video in the android 2.1 browser at this time?  My demo page is working for both the iphone and the ipad.</p><p>The mp4 video: avc1, 29.97 fps, 380 kbps, 480 x 370Audio:  mp4a, 44 kHz, 64 kbps</p><p>Here's how the page is written:</p><pre><code>&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;html5 test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;video id=""movie"" width=""480"" height=""370"" poster=""http://example.com/still.jpg"" controls&gt;&lt;source src=""http://example.com/video.mp4"" type=""video/mp4""&gt;Your browser does not support html5 video.&lt;/video&gt;&lt;/body&gt;&lt;/html&gt;</code></pre>","56488","","56488","","2010-06-24 12:58:35","2010-06-24 12:58:35","Does html5 video work on android nexus one with android version 2.1?","<android><html5><html5-video>","2","0","","",""
"2587186","1","2587207","","2010-04-06 18:07:44","5","507","<p>I've got a common task that I do with some Activities - downloading data then displaying it.  I've got the downloading part down pat; it is, of course, a little tricky due to the possibility of the user changing the orientation or cancelling the Activity before the download is complete, but the code is there.  There is enough code handling these cases such that I don't want to have to copy/paste it to each Activity I have, so I thought to create an abstract subclass Activity itself such that it handles a single background download which then launches a method which fills the page with data.</p><p>This all works.  The issue is that, due to single inheritance, I am forced to recreate the exact same class for any other type of Activity - for example, I use Activity, ListActivity and MapActivity.  To use the same technique for all three requires three duplicate classes, except each extends a different Activity.</p><p>Is there a design pattern that can cut down on the code duplication?  As it stands, I have saved much duplication already, but it pains me to see the exact same code in three classes just so that they each subclass a different type of Activity.</p><p>Edit: Since it seems I need to be a bit more specific...</p><p>Suppose I'm trying to solve the problem of an AsyncTask background download during orientation changes.  The solution I have right now is to use callbacks; there's download manager that I have which starts these downloads, and then I have the Activity attach a callback to it.  When the orientation changes the Activity is destroyed and then recreated; during this process I detach the old Activity's callback, then attach a new callback from the new Activity afterwards.</p><p>Orientation changes are a common problem, and in multiple Activities I start the Activity with a progress view while the data loads.  What I am trying to solve is not having to re-implement this orientation-handling logic ten times over; my initial solution was to subclass Activity, but then I got the problem above.</p>","60261","","60261","","2010-04-06 19:24:09","2010-04-06 20:36:04","Is there a design pattern to cut down on code duplication when subclassing Activities in Android?","<java><android><design-patterns><oop>","4","0","2","",""
"2587196","1","2587218","","2010-04-06 18:09:02","2","2459","<p>From another stackoverflow question, it seems that Android handles large bitmaps differently than other memory. It also seems like there is a way to force Android to recycle the bitmaps to free up memory. Can anyone enlighten me on how to do this. </p><p>My application uses 2-6 huge bitmaps at all times, so it nearly kills the phone's memory when running, and I want to clear it up when the user quits.</p>","118241","","","","","2012-03-14 04:59:57","Android Force Recycle Large Bitmap?","<java><android><garbage-collection>","3","0","1","",""
"2587203","1","3047570","","2010-04-06 18:09:39","0","1314","<p>I am attempting to create a wrapper class for Google Android's Text-To-Speech functionality.  However, I'm having trouble finding a way to have the system pause until after the onInit function has finished.  Attached at the bottom is something of a solution I created based on what I found here: <a href=""http://stackoverflow.com/questions/1160876/android-speech-how-can-you-read-text-in-android"">http://stackoverflow.com/questions/1160876/android-speech-how-can-you-read-text-in-android</a></p><p>However, this solution does not seem to work.  Any thoughts on why this might not be working, or what would be a good idea in order to make sure that any Speak() calls happen after my onInit() call?</p><p>public class SpeechSynth implements OnInitListener {</p><pre><code>private TextToSpeech tts;static final int TTS_CHECK_CODE = 0;private int ready = 0;private ReentrantLock waitForInitLock = new ReentrantLock();SpeechSynth( Activity screen ){    ready = 0;    tts = new TextToSpeech( screen, this );    waitForInitLock.lock();}public void onInit(int status) {    if (status == TextToSpeech.SUCCESS)    {        ready = 1;    }    waitForInitLock.unlock();}public int Speak( String text ){    if( ready == 1 )    {        tts.speak(text, TextToSpeech.QUEUE_ADD, null);        return 1;    }    else    {        return 0;    }   }</code></pre><p>}</p><p>I have been able to make it so that I can pass a string of text through the constructor, then have it played in the onInit() function.  However, I would really like to avoid having to destroy and re-create the whole text-to-speech engine every time I need to have my program say something different.</p>","461241","","","","","2010-06-15 17:39:19","Making a Text-To-Speech Wrapper in Android","<android><api><wrapper><text-to-speech>","1","0","1","",""
"2587294","1","","","2010-04-06 18:25:20","9","5247","<p>I am very new to programming and would like to know what is the best way to go about creating a notification icon badge similar to the ones on the iPhone apps. This would be basically for creating a badge for the notifications that end up in the notification bar.</p>","310287","","","","","2012-05-25 13:47:10","How to create notification icon badge on Android apps (like iPhone)","<java><android><eclipse>","2","1","5","",""
"2587295","1","","","2010-04-06 18:25:30","24","16192","<p>Has anyone built OpenAL for the Android, or found the shared library for it on the system?  This seems like an obvious need for a game of any kind, yet there's no resources out there for it.  It seems the Android java sound library can't do pitch changes from what I can tell, so there seems a need for OpenAL.  I know OpenAL Soft can be built on top of ALSA, but I'm not sure if anyones done that, and I'm sure it would take me a month.</p><p>If there's a good guide somewhere on sound manipulation on the Android without OpenAL, that's fine too.  It's just that OpenAL is sort of a standard for game makers and it would be nice to port my thousands of lines over to this system, which I sort of thought was the point of the NDK before I dugg into it and saw that there's almost no shared library access on the system.</p><p>Thanks..  I hope I can actually port without becoming a java expert myself.  Really disliking the NDK so far!</p>","267391","","149841","","2011-08-11 09:17:57","2011-09-22 01:04:02","Android OpenAL?","<android><audio><android-ndk><openal><alsa>","4","0","13","",""
"2587305","1","2587508","","2010-04-06 18:27:14","13","60443","<p>I've tried all scaletypes, but all of them result in the image to be at the left corner of the imageview.</p><pre><code> &lt;ImageView    android:id=""@+id/image""    android:scaleType=""centerInside""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginRight=""6dip""    android:background=""#0000""     android:src=""@drawable/icon1"" /&gt;</code></pre>","253800","","","","","2013-09-21 00:22:22","android: how to align image in the horizontal center of an imageview?","<android><alignment>","5","0","8","",""
"2587615","1","2587928","","2010-04-06 19:20:47","1","825","<p>I am trying to get my first button to update a display number in my view when clicked. This view will have several buttons and ""outputs"" displayed. After reading examples and Q's here, I finally put something together that runs, but my first button is still not working;</p><pre><code>   public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.ship_layout);        mSwitcher = (TextSwitcher) findViewById(R.id.eng_val);        }    private TextSwitcher mSwitcher;        // Will be connected with the buttons via XML        void onClick(View v){            switch (v.getId()) {            case R.id.engplus:                engcounter++;                updateCounter();                break;            case R.id.engneg:                engcounter--;                updateCounter();                break;            }        }    private void updateCounter() {        mSwitcher.setText(String.valueOf(engcounter));    }</code></pre><p>The .xml for this button is;</p><pre><code>     &lt;TextSwitcher    android:id=""@+id/eng_val""    android:visibility=""visible""    android:paddingTop=""9px""    android:paddingLeft=""50px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@+id/build""    android:layout_toRightOf=""@+id/engeq""    android:textColor=""#DD00ff00""    android:textSize=""24sp""/&gt;       </code></pre><p>This is within a Relative Layout that appears otherwise OK. When I had set the view to have a TextView with the number set as a string , the number displayed, but I could not figure out how to update the text with a numerical field. That may be my real problem.</p><p>I have gone through many examples generally referenced from the dev. site (UI, Common Tasks, various samples), and I am still not seeing the connection here...</p><p>Again, this is simply a try at getting variables to respond to buttons and update on the view.</p><p>So, a few Q's for anyone that can help;</p><p>1) Is there any easier way of doing this (ie. send numerical value to View) ?2) Why isn't my TextSwitcher displaying the number?3) Should I be using a TextSwitcher here?4) Any examples of this you can point me to?</p><p>UPDATE!!!: Buttons with feedback are now working. Here is my fix, based on feedback, research and luck;</p><p>public class Myview extends Myapp implements ViewSwitcher.ViewFactory,View.OnClickListener {</p><pre><code>public int engcounter = 1;private TextSwitcher mSwitcher;@Overridepublic void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.my_layout);        mSwitcher = (TextSwitcher) findViewById(R.id.eng_val);        mSwitcher.setFactory(this);    Button engp = (Button) findViewById(R.id.engplus);    engp.setOnClickListener(new View.OnClickListener() {        public void onClick(View view){        engcounter++;        updateCounter();        }    });    Button engn = (Button) findViewById(R.id.engneg);    engn.setOnClickListener(new View.OnClickListener() {        public void onClick(View view){        engcounter--;        updateCounter();               }       });   }    private void updateCounter() {        mSwitcher.setText(String.valueOf(engcounter));    }    public View makeView() {        TextView t = new TextView(this);        t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);        t.setTextSize(36);        return t;    }    @Override    public void onClick(View v) {        // TODO Auto-generated method stub}</code></pre><p>Some of this appears unnecessary at the moment (ie. Gravity on makeView), but it works! And should work for the 10-20 buttons I want to do misc things with.</p><p>The key was getting listeners right, and the whole set-up for TextSwitcher was abit awkward...still learning.</p><p>Any other final comments welcomed!</p><p>UPDATE UPDATE!!I found this also;</p><p><a href=""http://developer.android.com/resources/articles/ui-1.6.html"" rel=""nofollow"">http://developer.android.com/resources/articles/ui-1.6.html</a></p>","310187","","310187","","2010-04-08 16:34:00","2012-08-07 11:28:17","Need help getting buttons to work","<android>","2","0","1","",""
"2587690","1","2588253","","2010-04-06 19:31:56","0","1469","<p>this is the code i have written</p><pre><code>package com.test.AndroidApp;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TestAppActivity 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>And i am getting these errors</p><pre><code>[2010-04-06 19:24:03 - Emulator] 2010-04-07 00:49:03.366 emulator[498: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-04-06 19:34:42 - TestApp] emulator-5554 disconnected! Cancelling 'com.test.AndroidApp.TestAppActivity activity launch'!</code></pre><p>I have the latest sdk and ADT installed.</p><p>What is the solution ????</p><p>Thanks</p>","163410","","213269","","2010-05-08 12:14:12","2010-06-15 12:51:07","Android ""Hello World"" Problem","<android><hello-world><adt>","2","2","","",""
"2588619","1","2588676","","2010-04-06 21:52:40","5","2133","<p>I am confused as to the difference between the two. In my application I have just used Extends Activity and the application is working perfectly, so what is the purpose of Extends Application?. </p><p>Would you use it on the first class you create in the Android application?</p><p>Thanks.</p>","296810","","","","","2010-06-07 10:37:34","What is the difference between Extends Application and Extends Activity in Android?","<java><android>","1","0","2","",""
"2588739","1","2588856","","2010-04-06 22:15:07","4","505","<p>Below are the only instructions i managed to find from google on how to install the android NDK, it is written as if we all run Linux and presumes we all understand what these obscure tools are. My comments and questions appear in <strong><em>Italics</em></strong> if somone who knows unix and windows would translate for google that would be great!</p><hr><p>Android NDK Installation</p><p>Introduction:</p><p>Please read docs/OVERVIEW.TXT to understand what the Android NDK is and is not.This file gives instructions on how to properly setup your NDK.</p><p>I. Requirements:</p><p>The Android NDK currently requires a Linux, OS X or Windows host operating system.Windows users will need to install Cygwin (http://www.cygwin.com) to use it. Notethat running the NDK under MSys is not supported.</p><p>You will need to have the Android SDK and its dependencies installed. The NDKcannot generate final application packages (.apk files), only the shared libraryfiles that can go into them.</p><p>IMPORTANT:    The Android NDK can only be used to target system images using    the Cupcake (1.5) or later releases of the platform.    This is due to subtle toolchain and ABI related changed that make    it incompatible with 1.0 and 1.1 system images.</p><p>The NDK requires GNU Make 3.81 or later being available on your developmentsystem. Earlier versions of GNU Make might work but have not been tested.</p><p>You can check this by running 'make -v' from the command-line. The outputshould look like:</p><pre><code>GNU Make 3.81Copyright (C) 2006  Free Software Foundation, Inc....</code></pre><p>On certain systems, GNU Make might be available through a different command like'gmake' or 'gnumake'. For these systems, replace 'make' by the appropriate commandwhen invoking the NDK build system as described in the documentation.</p><p><em><strong>Great some strange thing called gnu make.. if your not going to tell me what it does maybe you then at least you could give me a URL to it?</em></strong></p><p>The NDK also requires a Nawk or GNU Awk executable being available on yourdevelopment system. Note that the original 'awk' program doesn't implementthe 'match' and 'substr' functions used by the NDK build system.</p><p><em><strong>Ok another tool, with 1 of 2 possible names, but not the third... and again where should i download this??</em></strong></p><p>On Windows, you will need to install a recent release of Cygwin to use the NDK.See <a href=""http://www.cygwin.com"" rel=""nofollow"">http://www.cygwin.com</a> for instructions.</p><p><em><strong>Woohoo a URL! download took about a day because these install instructions do not specify what parts to download.</em></strong></p><p>II. Preparing your installation prebuilt cross-toolchain binaries:</p><p>After installing and unarchiving the NDK, you will need to run the followingcommand from the root folder:</p><p>build/host-setup.sh</p><p><em><strong>hello? windows dont run nothing but .exe .com or .dll, just tell me how you want me to run it..</em></strong></p><p>This will test your setup and make sure the NDK can work properly.</p><p><em><strong>Nothing is said about where any of these things need to be installed to (what directory)</em></strong></p>","263111","","","","","2013-02-24 20:56:19","Someone please help google create instuctions that windows users understand. googles ""instructions"" for the Android NDK install","<android><unix><android-ndk>","4","3","1","2013-02-25 02:46:10",""
"2588941","1","2588960","","2010-04-06 23:06:59","0","1094","<p>i have a (perhaps stupid) question: </p><p>im using 2 threads, one is writing floats and one is reading this floats permanently. my question is, what could happen worse when i dont synchronize them? it would be no problem if some of the values would not be correct because they switch just a little every write operation. im running the application this way at the moment and dont have any problems so i want to know what could happen worse? </p><p>a read/write conflict would cause a number like 12345 which is written to 54321 and red at the same time appear for example as 54345 ? or could happen something worse? (i dont want to use synchronization to keep the code  as fast as possible)</p>","165106","","","","","2010-04-07 05:58:24","two android threads and not synchronized data","<android><multithreading><synchronized>","3","0","","",""
"2589184","1","2593752","","2010-04-07 00:07:58","1","1155","<p>I have created an application that records a series of longitude and latitude values in a SQLite database and display them as a coloured track on a MapActivity.</p><p>I now want to be able to export this data somehow (preferably to a file) so a user can upload the values to a website showing a Google Map API. </p><p>My question is: what would be the quickest way to export the data (and in what file format: GPX, XML, CSV) to the SD card located on the Android device.</p><p>Many thanks.</p>","296810","","108575","","2010-04-07 06:40:22","2010-07-21 17:24:38","Easiest way to export longitude and latitude data stored in a SQLite database to a file so it can be imported to a Google Map API through a website?","<java><xml><android><google-maps>","2","0","0","",""
"2589247","1","","","2010-04-07 00:28:51","1","2598","<p>I'm currently working on an android app that pulls a list of forums from a JSON feed.  I'm trying to parse the feed and immediately upon calling getJSONArray a JSON exception is being thrown with no stack trace.  The JSON being returned is stored in an JSONObject jobj with the format as follows:</p><pre><code>{    ""Forum"":        [         {""ForumName"":""CEC Employee Communications Forum"",""ForumId"":""105""},         {""ForumName"":""CEC External Stakeholder Relations Forum"",""ForumId"":""109""},         {""ForumName"":""See All..."",""ForumId"":""0""}        ]}</code></pre><p>However when running the following code, I get an immediate exception without a stack trace:</p><pre><code>JSONArray jarray = new JSONArray();jarray = jobj.getJSONArray(""Forum"");</code></pre><p>Running </p><pre><code>jobj.GetJSONArray(""Forum"").toString();</code></pre><p>returns what looks to be a correct array of the format:</p><pre><code>[ {""ForumName"":""CEC Employee Communications Forum"",""ForumId"":""105""}, {""ForumName"":""CEC External Stakeholder Relations Forum"",""ForumId"":""109""}, {""ForumName"":""See All..."",""ForumId"":""0""}]</code></pre><p>I also tried</p><pre><code>JSONArray jarray = new JSONArray(jobj.GetJSONArray(""Forum"").toString());</code></pre><p>and had the exception thrown immediately.  Any help would be greatly appreciated.</p><p>Thanks!</p>","310510","","","","","2012-04-16 00:58:11","Android - Calling getJSONArray throwing JSONException with no stack trace","<android><json><getjson>","1","0","","",""
"2589422","1","2589450","","2010-04-07 01:17:38","6","2141","<p>I don't really understand the use and concept of an Intent. I DO understand that an activity are one visual interface and one endeavour that the user can partake in. I THINK an intent is used to launch and communicate between different activities. If so, then how would you accomplish that? A code sample would be helpful. In analogy form, try to compare an intent to something in everyday life. That would help very much!</p>","200477","","200477","","2010-04-07 01:24:07","2010-12-22 01:50:40","The concept of an Intent in Android?","<android><android-intent>","7","1","4","",""
"2589486","1","2605484","","2010-04-07 01:39:10","14","21125","<p>Here is my code</p><pre><code>import org.ksoap2.*;import org.ksoap2.serialization.*;import org.ksoap2.transport.*;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class ksop2test extends Activity { /** Called when the activity is first created. */ private static final String METHOD_NAME = ""SayHello"";// private static final String METHOD_NAME = ""HelloWorld""; private static final String NAMESPACE = ""http://tempuri.org"";// private static final String NAMESPACE = ""http://tempuri.org""; private static final String URL = ""http://192.168.0.2:8080/HelloWCF/Service1.svc"";// private static final String URL = ""http://192.168.0.2:8080/webservice1/Service1.asmx""; final String SOAP_ACTION = ""http://tempuri.org/IService1/SayHello"";// final String SOAP_ACTION = ""http://tempuri.org/HelloWorld""; TextView tv; StringBuilder sb; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  tv = new TextView(this);  sb = new StringBuilder();  call();  tv.setText(sb.toString());  setContentView(tv); } public void call() {  try {   SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);   request.addProperty(""name"", ""Qing"");   SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(     SoapEnvelope.VER11);   envelope.dotNet = true;   envelope.setOutputSoapObject(request);   HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);   androidHttpTransport.call(SOAP_ACTION, envelope);   sb.append(envelope.toString() + ""\n"");//cannot get the xml request send   SoapPrimitive result = (SoapPrimitive)envelope.getResponse();   //to get the data   String resultData = result.toString();   // 0 is the first object of data    sb.append(resultData + ""\n"");  } catch (Exception e) {   sb.append(""Error:\n"" + e.getMessage() + ""\n"");  } }}</code></pre><p>I can successfully access .asmx service, but when I try to call a wcf service the virtual machine said :Error:expected:END_TAG{http://schemas.xmlsoap.org/soap/envelope/}Body(position:END_TAG@1:712 in java.io.InputStreamReader@43ba6798</p><p>How to print what the request send?</p><p>Here is the wcf wsdl:</p><pre class=""lang-xml prettyprint-override""><code>&lt;wsdl:definitions name=""Service1"" targetNamespace=""http://tempuri.org/""&gt;&lt;wsdl:types&gt;  &lt;xsd:schema targetNamespace=""http://tempuri.org/Imports""&gt;  &lt;xsd:import schemaLocation=""http://para-bj.para.local:8080/HelloWCF/Service1.svc?xsd=xsd0"" namespace=""http://tempuri.org/""/&gt;  &lt;xsd:import schemaLocation=""http://para-bj.para.local:8080/HelloWCF/Service1.svc?xsd=xsd1"" namespace=""http://schemas.microsoft.com/2003/10/Serialization/""/&gt;  &lt;/xsd:schema&gt;&lt;/wsdl:types&gt;&lt;wsdl:message name=""IService1_SayHello_InputMessage""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:SayHello""/&gt;&lt;/wsdl:message&gt;&lt;wsdl:message name=""IService1_SayHello_OutputMessage""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:SayHelloResponse""/&gt;&lt;/wsdl:message&gt;&lt;wsdl:portType name=""IService1""&gt;  &lt;wsdl:operation name=""SayHello""&gt;    &lt;wsdl:input wsaw:Action=""http://tempuri.org/IService1/SayHello"" message=""tns:IService1_SayHello_InputMessage""/&gt;    &lt;wsdl:output wsaw:Action=""http://tempuri.org/IService1/SayHelloResponse"" message=""tns:IService1_SayHello_OutputMessage""/&gt;  &lt;/wsdl:operation&gt;&lt;/wsdl:portType&gt;&lt;wsdl:binding name=""BasicHttpBinding_IService1"" type=""tns:IService1""&gt;  &lt;soap:binding transport=""http://schemas.xmlsoap.org/soap/http""/&gt;  &lt;wsdl:operation name=""SayHello""&gt;   &lt;soap:operation soapAction=""http://tempuri.org/IService1/SayHello"" style=""document""/&gt;     &lt;wsdl:input&gt;       &lt;soap:body use=""literal""/&gt;     &lt;/wsdl:input&gt;      &lt;wsdl:output&gt;       &lt;soap:body use=""literal""/&gt;     &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;&lt;/wsdl:binding&gt;&lt;wsdl:service name=""Service1""&gt;  &lt;wsdl:port name=""BasicHttpBinding_IService1"" binding=""tns:BasicHttpBinding_IService1""&gt;    &lt;soap:address location=""http://para-bj.para.local:8080/HelloWCF/Service1.svc""/&gt;  &lt;/wsdl:port&gt;&lt;/wsdl:service&gt;&lt;/wsdl:definitions&gt;</code></pre><p>It uses <code>&lt;xsd:schema&gt;</code> in tag <code>&lt;wsdl:types&gt;</code>and the asmx uses <code>&lt;s:schema&gt;</code> in tag <code>&lt;wsdl:types&gt;</code>what's the difference?</p>","383351","","322283","","2011-06-26 11:25:41","2013-10-14 06:16:39","How to call a WCF service using ksoap2 on android?","<android><wcf><ksoap2>","4","2","17","",""
"2589715","1","","","2010-04-07 02:50:44","1","209","<p>I just read a pretty interesting article on how android (and i assume other OSs) work when low on memory. How is this done theoretically? Is it similar to Java's object serialization?</p>","310573","","","","","2010-04-07 03:00:11","how do ""saved states"" work? (Android)","<android><serialization><operating-system>","1","1","","",""
"2589811","1","","","2010-04-07 03:25:17","2","2367","<p>In blackberry, we use a timeout to get the location, so that if it doesnt retun location in that much time period, we get to know. But in Android, there is no concept of timeout, can anyone please tell the alternative, that we can find out that after this much time there is no location update from GPS.</p>","285052","","114066","","2010-04-07 07:34:24","2010-04-07 07:34:24","GPS timeout in android","<android><gps>","1","0","1","",""
"2589816","1","2594848","","2010-04-07 03:27:09","0","563","<p>For some reason my code here (this is the entire thing) doesnt actually render anything besides a red screen.. can anyone tell me why?</p><pre><code>package com.ntu.way2fungames.earth.testbed;import java.nio.FloatBuffer;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.app.Activity;import android.content.Context;import android.opengl.GLSurfaceView;import android.opengl.GLSurfaceView.Renderer;import android.os.Bundle;public class projectiles extends Activity {    GLSurfaceView lGLView;    Renderer lGLRenderer;    float projectilesX[]= new float[5001];    float projectilesY[]= new float[5001];    float projectilesXa[]= new float[5001];    float projectilesYa[]= new float[5001];    float projectilesTheta[]= new float[5001];    float projectilesSpeed[]= new float[5001];    private static FloatBuffer drawBuffer;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        SetupProjectiles();        Context mContext = this.getWindow().getContext();        lGLView= new MyView(mContext);        lGLRenderer= new MyRenderer();        lGLView.setRenderer(lGLRenderer);        setContentView(lGLView);    }    private void SetupProjectiles() {        int i=0;        for (i=5000;i&gt;0;i=i-1){            projectilesX[i] = 240;            projectilesY[i] = 427;            float theta = (float) ((i/5000)*Math.PI*2);            projectilesXa[i] = (float) Math.cos(theta);            projectilesYa[i] = (float) Math.sin(theta);            projectilesTheta[i]= theta;            projectilesSpeed[i]= (float) (Math.random()+1);        }    }    public class MyView extends GLSurfaceView{        public MyView(Context context) {            super(context);            // TODO Auto-generated constructor stub        }    }    public class MyRenderer implements Renderer{        private float[] projectilecords = new float[] {               .0f, .5f, 0,              -.5f,  0f, 0,               .5f,  0f, 0,                 0, -5f, 0,        };        @Override        public void onDrawFrame(GL10 gl) {            gl.glClear(GL10.GL_COLOR_BUFFER_BIT);                            gl.glMatrixMode(GL10.GL_MODELVIEW);            //gl.glLoadIdentity();            gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);            for (int i=5000;i&gt;4500;i=i-1){                //drawing section                gl.glLoadIdentity();                gl.glColor4f(.9f, .9f,.9f,.9f);                gl.glTranslatef(projectilesY[i], projectilesX[i],1);                    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, drawBuffer);                 gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 12);                //physics section                projectilesX[i]=projectilesX[i]+projectilesXa[i];                projectilesY[i]=projectilesY[i]+projectilesYa[i];            }            gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);        }        @Override        public void onSurfaceChanged(GL10 gl, int width, int height) {             if (height == 0) height = 1;             // draw on the entire screen             gl.glViewport(0, 0, width, height);             // setup projection matrix             gl.glMatrixMode(GL10.GL_PROJECTION);             gl.glLoadIdentity();             gl.glOrthof(0,width,height,0, -100, 100);        }        @Override        public void onSurfaceCreated(GL10 gl, EGLConfig arg1) {            gl.glShadeModel(GL10.GL_SMOOTH);            gl.glClearColor(1f, .01f, .01f, 1f);            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);            drawBuffer = FloatBuffer.wrap(projectilecords);                 }    }}</code></pre>","263111","","44729","","2010-04-07 15:11:41","2010-04-07 18:19:53","Why does my Opengl es android testbed app not render anything besides a red screen?","<android><opengl-es>","1","0","","",""
"2589907","1","","","2010-04-07 03:58:14","0","513","<p>I have stripped down my functions for simplicity:</p><pre><code>public static int countLines(String fileName, Activity activity) throws IOException {     BufferedReader in = new BufferedReader(new InputStreamReader(activity.getAssets().open(fileName)));    return 3;}</code></pre><p>I am calling it from here:</p><pre><code>private CharSequence RandomRead() throws IOException {    int numberLines = countLines(""data.txt"", ??????);               return ""Success""}</code></pre><p>In the call to countLines(""data.txt"", ??????), what do I put as the argument for the Activity?  I've Googled all night and I can find no examples of an actual call to a function where Activity is an argument. (Lots of examples actually using 'activity', but no calls to the example functions).</p><p>Thanks!</p>","310602","","114066","","2010-04-07 07:38:16","2010-04-07 10:44:04","Calling a function that has 'Activity' as an argument","<android><activity>","1","0","","",""
"2590162","1","2592289","","2010-04-07 05:09:35","8","6070","<p>I have Activity with ListView inside it and in the onCreate method of the Activity I have code for populating the Data of the ListView this Data is a server based and so populating includes calling Network URLs. I have the ArrayAdapter of the ListView in the Same Activity Class.</p><p>Now the Issue I'am facing is that, in Rest all scenarios my Activity is behaving in a proper way but when the Orientation [ Portrait to Landscaped or other way round] is taking place the Data is Getting lost and Newer Data calls are Required to Populate the Same Old Data now this is something that is not intended out the code how should I deal with it. </p>","92039","","21234","","2010-06-25 13:23:01","2012-11-15 15:29:56","Android ListView in Activity getting Refreshed on Changing Orientation","<android><listview>","4","0","5","",""
"2590348","1","","","2010-04-07 06:10:06","1","945","<p>When i try to do ""update all"" from Android SDK and AVD Manager thru' windows environment i got following error msg -</p><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: dl-ssl.google.com</p><p>can anybody pls let me know of the correct link from where it will fetch the packages ?</p><p>Thanks.</p>","310637","","82515","","2010-04-08 15:19:15","2010-04-08 15:19:36","Android SDK not updating the installed packages","<android>","1","0","","",""
"2590403","1","","","2010-04-07 06:23:51","1","642","<p>I want to develop an internet radio application in android.I am new to this application.I am planning to get the list of station and put them in an xml file in sdcard and provide that in a listview so that when one item is get selected that station will start playing.The xml file should be updated if any new station is added.How can i get the list of stations.Can anybody please suggest me the way to proceed in detail....</p>","321334","","","","","2013-11-11 14:08:28","getting playlist of stations for internet radio application in android","<android><internet><radio>","2","2","0","",""
"2590560","1","","","2010-04-07 07:02:29","3","242","<p>In android 2.1 sdk, how can I query the number and the name of each album in the gallery?And is there an way to launch an intent to allow user to see all pictures of a particular album in the gallery?</p><p>Thank you.</p>","286802","","","","","2011-04-26 15:36:19","How can I query the number of album in gallery","<android>","1","0","","",""
"2590581","1","2610108","","2010-04-07 07:07:22","11","2047","<p>Is there a way to vizualise the activity stack, at some moment during debug, or normal run ?</p>","304866","","","","","2013-02-18 11:38:44","activities stack","<android>","4","0","3","",""
"2590597","1","2592416","","2010-04-07 07:13:09","1","4134","<p>i am using android:imeOptions=""actionSearch""</p><p>in editText and my question is can i write my own event if user presses Searchbutton on Softkeyboard?</p><p>actualy i want to perform functionality of softkeyboard search button similar to button we use on android activity.</p><p>any help would be appriciated.</p>","249991","","","","","2014-02-08 09:47:22","can i write my own event on android:imeOptions=""actionSearch""?","<android><activity><edittext>","2","0","1","",""
"2590602","1","2594290","","2010-04-07 07:14:55","1","619","<p>I would like to check the memory consumption of each running processes individually, cat /proc//statmis ok, but opening a shell for each check is time consuming, and maybe not the best way. any advices how to do it with the SDK?</p>","310078","","","","","2010-04-07 16:46:08","Android - Is there an SDK way to find out the exact amount of memory consumed by a process identified by its pid?","<android><linux><memory><process><sdk>","1","0","","",""
"2590710","1","2591671","","2010-04-07 07:34:53","3","721","<p>Can someone tell if why when starting an activity with <code>startActivity(intent)</code> , calling <code>getParent()</code> in <code>onCreate()</code> of the new created activity returns a nul ?</p><p>Also how could I obtain the parent of an activity created in such a way ? Can a reference of the activity below the current activity in the activity stack be obtained ?</p>","304866","","844882","","2012-03-22 20:14:53","2012-03-22 20:14:53","activity parent","<android>","2","0","","",""
"2590947","1","2591840","","2010-04-07 08:27:51","52","24026","<p>Could someone provide a description of what happens when an activity calls its <code>finish()</code>?</p><p>Does it exit immediately, or does it complete the function from which it was called?</p>","304866","","1076640","","2014-03-19 23:29:33","2014-03-19 23:29:33","about finish() in android","<android>","2","0","12","",""
"2591036","1","2627952","","2010-04-07 08:48:22","357","259144","<p>I want to hide the titlebar for some of my activities. The problem is that I applied a style to all my activities, therefore I can't simply set the theme to @android:style/Theme.NoTitleBar. </p><p>Using the NoTitleBar theme as a parent for my style would remove the title bar for to much activities.</p><p>Can I set a no title style item somewhere?</p>","114066","","114066","","2013-12-17 08:24:08","2014-03-16 14:02:22","How to hide the title bar for an Activity in XML with existing custom theme","<android><android-layout><titlebar>","14","0","157","",""
"2591044","1","","","2010-04-07 08:49:44","2","837","<p>I have a link in my application that triggers a webview to open from webview.loadUrl(...). </p><p>Sometimes it's takes quite a while to load the page, and in these cases I want to be able to use the built in back button on the phone to cancel the loading and go back to my application. </p><p>How do I do this? Is there some way I can listen to the backbutton while loading the url?</p>","270273","","","","","2010-04-07 10:15:37","How can I use back button while loading a page in an Android WebView?","<android><webview><loading><cancel>","1","0","","",""
"2591214","1","2595750","","2010-04-07 09:19:31","1","310","<p>I am using Gmail sender function defined <a href=""http://davanum.wordpress.com/.../android-send-email-via-gmail-actually-via-smtp/"" rel=""nofollow"">here</a> to send a mail to the predefined mail id. But my problem is that i want to embed more text into the body of my mail... The Gmail sender is only accepting one sting to be embedded into the body of the mail. Can anyone tell me how to embed more strings into the body of the mail... If Gmail sender is not efficient method to send a mail then please suggest me an alternative with an example.... </p>","303155","","","","","2010-04-07 20:39:03","Embedding more text into the mail body in SMTP Gmail sender","<android>","1","5","","",""
"2591425","1","2591493","","2010-04-07 09:55:18","2","340","<p>In native development, you can produce libraries - .so, .dll etc - that other libraries and programs can share.</p><p>In Java, you can put your code in a JAR in the classpath and other programs and libraries can use it.</p><p>So how can you do modular programs in Android?  I get the impression from the documentation that each APK is a self-contained island.  Can different APKs share code?</p><p>And how does installation work when you have these external dependencies?  Can you specify that you rely on library that is not in your APK and get it installed too?</p><p>If you can't have 'dynamic linking', can you have 'static linking' by developing your shared code and somehow putting the equiv of a JAR into each APK that requires it?</p>","15721","","","","","2010-04-09 11:42:55","libriaries on Android","<java><android>","3","0","1","",""
"2591522","1","","","2010-04-07 10:13:19","1","904","<p>Is there a way to absolutely position an UI element on Android so that it is located outside an Activity? For example: can you create a fullscreen ImageView simply by moving/resizing an ImageView inside an existing regular Activity instead of creating a new fullscreen activity?</p><p>EDIT: Re-reading my question I see I wasn't very clear about what I'm trying to accomplish. I'd like to temporarily extend an element to cover the notification bar at the top of the screen. I need to create a semitranslucent fullscreen overlay but since translucent activities cannot cover the notification bar I'm trying to find out if it's possible for an element to break out of activity's bounds and resize itself to fill the whole screen, top to bottom. </p>","84352","","246246","","2013-07-15 20:56:26","2013-07-15 20:56:26","Positioning elements outside an Activity on Android","<android><android-layout><activity>","1","0","1","",""
"2591530","1","3020983","","2010-04-07 10:14:37","5","4297","<p>I have a content observer that polls content://sms/ in android 1.5 so that I get notified of changes in the sms database and can react to them accordingly.</p><p>However in 1.6 this doesn't work, has the uri been changed from content://sms/ to something else? </p><p>I have seen content://mms-sms/ popping up in the logcat on my 1.6 device but I have tried that and it doesn't work.</p><p>Here is my code</p><pre><code>String url = ""content://sms/"";         Uri uri = Uri.parse(url);         getContentResolver().registerContentObserver(uri, true, new MyContentObserver(handler)); }class MyContentObserver extends ContentObserver {     public MyContentObserver(Handler handler) {         super(handler);     }@Override public boolean deliverSelfNotifications() {     return false;     }ContentValues values = new ContentValues();@Override public void onChange(boolean arg0) {     super.onChange(arg0);     Log.v(""SMS"", ""Notification on SMS observer"");      values.put(""status"", 5);    Message msg = new Message();     msg.obj = ""xxxxxxxxxx"";    int threadId = 0;    handler.sendMessage(msg);    Uri uriSMSURI = Uri.parse(""content://sms/"");    Cursor cur = getContentResolver().query(uriSMSURI, null, null,                 null, null);    cur.moveToNext();    String protocol = cur.getString(cur.getColumnIndex(""protocol""));    Log.d(""SMS"", ""SMS PROTOCOL = "" + protocol);     if(protocol == null){           Log.d(""SMS"", ""SMS SEND"");            threadId = cur.getInt(cur.getColumnIndex(""thread_id""));           int status = cur.getInt(cur.getColumnIndex(""status""));           Log.d(""SMS"", ""STATUS = "" + status);           if(status != 5){           Uri updateUri = ContentUris.withAppendedId(Uri.parse(""content://sms/conversations/""), threadId);           int rows = getContentResolver().update(updateUri, values, null, null);           Log.d(""SMS"", ""ROWS UPDATED = "" + rows);           Log.d(""SMS 2"", ""STATUS = "" + status);           }           Log.d(""SMS"", ""SMS SEND ID = "" + threadId);            String textBody = cur.getString(cur.getColumnIndex(""body""));           String textAddress  = cur.getString(cur.getColumnIndex(""address""));           Log.d(""SMS"", ""SMS SEND ADDRESS= "" + textAddress);            Log.d(""SMS"", ""SMS SEND BODY= "" + textBody);     }    else{        Log.d(""SMS"", ""SMS RECIEVE"");      }}</code></pre>","243999","","","","","2010-06-11 07:35:32","ContentObserver on content://sms/ in 1.6+?","<android><sms><uri><android-contentprovider><android-sdk-1.6>","1","0","2","",""
"2591537","1","2591587","","2010-04-07 10:15:42","2","9357","<p>I'm writing an Android application for RC Cars. It uses a SQLite database, and saves the model of the car, car name and other variables.</p><p>Here's my code:</p><pre><code>public Cursor fetchAllNotes() {  return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE,    KEY_CARNAME, KEY_TRACKNAME, KEY_TRACKSIZE, KEY_TRACKTRACTION, KEY_TRACKSURFACE, KEY_BODYTYPE,    KEY_COMMENTS}, KEY_CARNAME + ""="" + ""'MTX-4'"", null, null, null, null);}</code></pre><p>How can I display only the records that have a certain model of car named in the carname column? So far I can only filter the results by using <code>'MTX-4'</code> or some other literal string. I need to be able to replace that with a string variable like <code>String carName</code> or something, so I can filter by a user-defined carname.</p>","310794","","13302","","2013-06-28 13:21:37","2013-06-28 13:21:37","How to filter Android database by column","<android><sqlite>","1","0","3","",""
"2591712","1","2795494","","2010-04-07 10:46:29","0","2922","<p>I am using the Android code below to connect to Facebook but getting the following exception instead of running the function <code>onLoginSuccess</code>:</p><blockquote>  <p>Facebook Server Error + 104 - Incorrect signature</p></blockquote><pre><code>public class FacebookConnection extends Activity implements LoginListener {    private FBRocket fbRocket;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // You need to put in your Facebook API key here:        fbRocket = new FBRocket(this, ""test"", ""e2c8deda78b007466c54f48e6359e02e"");        // Determine whether there exists a previously-saved Facebook:        if (fbRocket.existsSavedFacebook()) {            String str =fbRocket.getAPIKey();            Log.e(""Api key"", str);            fbRocket.loadFacebook();         } else {            fbRocket.login(R.layout.main);            String str =fbRocket.getAPIKey();            Log.e(""Api key"", str);        }    }    public void onLoginFail() {        fbRocket.displayToast(""Login failed!"");        fbRocket.login(R.layout.main);    }    public void onLoginSuccess(Facebook facebook) {        fbRocket.displayToast(""Login success!******************"");        // Set the logged-in user's status:        try {            facebook.setStatus(""I am using Facebook -- it's great!"");            String uid = facebook.getFriendUIDs().get(0); // Just get the uid of the first friend returned...            fbRocket.displayDialog(""Friend's name: "" + facebook.getFriend(uid).name); // ... and retrieve this friend's name.        } catch (ServerErrorException e) {            // Check if the exception was caused by not being logged-in:            if (e.notLoggedIn()) {                // ...if it was, then login again:                fbRocket.login(R.layout.main);            } else {                System.out.println(e);                e.printStackTrace();            }        }    }}</code></pre>","304961","","387076","","2012-08-25 15:34:22","2012-08-25 15:34:22","Hello I am using the android code to connect facebook but getting ""Facebook Server Error + 104 - Incorrect signature""","<android><facebook>","2","0","","",""
"2591859","1","","","2010-04-07 11:09:27","0","5005","<p>Please refer the image given in the url<a href=""http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185M2RneG5nYmNm&amp;hl=en"" rel=""nofollow"">http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185M2RneG5nYmNm&amp;hl=en</a></p><p>My query is, How can I display the messages corresponding to the rounded buttons and the table row , when I click on the rounded button with question mark.</p><p>I know, I have to use listener for the ? button , but what should I do in listener exactly, such that when I click, it shows those alerts(images) and when I click again, it disappears.</p><p>For this UI, I have used Relative layout as was suggested here -- <a href=""http://stackoverflow.com/questions/2544988/aligning-components-at-desired-positions"">Aligning components at desired positions</a> -- and it worked perfect for me.</p><p>So, do I need to change my base layout altogether for accomplishing this?</p>","305067","","19679","","2011-03-04 17:24:56","2012-01-15 00:07:15","Displaying popup images on button click","<android><android-widget>","1","0","2","",""
"2591900","1","2592723","","2010-04-07 11:16:26","3","4321","<p>I know that I can override the <code>onKeyDown</code> method, but I want Back to do it's thing, just twice!</p>","270273","","3619","","2012-12-04 23:04:50","2012-12-04 23:07:08","Can I force the Android Back button to go two steps back in the Activity stack?","<android><android-activity>","4","0","0","",""
"2591976","1","","","2010-04-07 11:28:27","3","651","<p>I need to have excel-like headers.It means, that it has vertical headers (fixed horizontally), which can be scrolled vertically, and horizontal headers (fixed vertically), which can be scrolled horizontally.The contents should be scrollable both vertically and horizontally.</p><p>To make it clear, I tried to 'draw' here.</p><pre><code>                  hor_header1 | hor_header2  | hor_header3 | .......ver_header1  |  content1_1    | content1_2   | content1_3   | ...........ver_header2  |  content2_1    | content2_2   | content2_3   | ........ver_header3  |  content3_1    | content3_2   | content3_3   | ..................      |   ...........  | ..........   | ...........</code></pre><p>So ver_header1,2,3 should be sticky when I scroll horizontally, and hor_header1,2,3 should be sticky when I scroll vertically</p><p>How could I achieve this? Is it possible in android???</p><p>Thanks before.</p><p>Heru</p>","310891","","","","","2011-03-15 22:09:43","Excel-like vertical and horizontal headers for android","<android><view><header>","1","0","2","",""
"2591988","1","","","2010-04-07 11:30:43","1","681","<p>I am creating an Android app that includes a third party jar.   That third party jar utilizes internal logging that is failing to initialize when I run the app, with this error: ""org.apache.commons.logging.LogConfigurationException: No suitable Log implementation"".   </p><p>The 3rd party jar appears to be using org.apache.commons.logging and to depend on log4j, specifically log4j-1.2.14.jar.  I have packaged the log4j jar into the Android app.  The third party jar was packaged with a log4j.xml configuration file, which I have tried packaging into the app as an XML resource (and also as a raw resource).  </p><p>The ""No suitable Log implementation"" error message is not very descriptive, and I have no immediate familiarity with Java logging.   So I am looking for likely causes of the problem (what class or configuration resources might I be missing?) or for some debugging technique that will result in a different error message that is more explicit about the problem.  I do not have access to source code for the 3rd party jar.</p><p>Here is the exception stack trace.  When I run the app, I get the following exception as soon as one of the third party jar classes attempts to initialize its internal logging.  </p><pre><code>DEBUG/AndroidRuntime(15694): Shutting down VMWARN/dalvikvm(15694): threadid=3: thread exiting with uncaught exception (group=0x4001b180)ERROR/AndroidRuntime(15694): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(15694): java.lang.ExceptionInInitializerErrorERROR/AndroidRuntime(15694): Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log implementationERROR/AndroidRuntime(15694):     at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:842)ERROR/AndroidRuntime(15694):     at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)ERROR/AndroidRuntime(15694):     at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)ERROR/AndroidRuntime(15694):     at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)ERROR/AndroidRuntime(15694):     at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)ERROR/AndroidRuntime(15694):     at org.apache.commons.configuration.ConfigurationFactory.&lt;clinit&gt;(ConfigurationFactory.java:77)</code></pre>","286713","","","","","2010-04-07 12:31:14","What is likely cause of Android runtime exception ""No suitable Log implementation"" related to logging in 3rd-party jar?","<android><logging><log4j>","1","0","","",""
"2592037","1","2592161","","2010-04-07 11:38:07","12","22941","<p>I am having two activities A and B. when i click the button in A that will shows B. when i click the Button in B it backs to A. i had set the overridePendingTransition method after the finish() method. it works properly. but in case the current Activity is B. on that time i click the default back button in the device. it shows the right to left transition to show the Activity A.</p><p>How i can listen that Default back key on device?</p><p><strong>EDIT:</strong></p><pre><code>Log.v(TAG, ""back pressed"");finish();overridePendingTransition(R.anim.slide_top_to_bottom, R.anim.hold);</code></pre>","267269","","119895","","2010-07-27 05:43:02","2012-04-26 18:45:24","is there a default back key(on device) listener in android?","<android><android-emulator><android-keypad>","5","0","4","",""
"2592160","1","2592988","","2010-04-07 11:58:16","10","14769","<p>I am using XML file for creating Context Menu for my ListView. (Please see below). I also want to set a header for this Context Menu. I read (at <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg43062.html"">http://www.mail-archive.com/android-developers@googlegroups.com/msg43062.html</a>)that I can use menu.setHeaderTitle(myContextMenuTitle) in onCreateContextMenu Method. But I need to set this in XML file. How can I accomplish this?</p><p>Following is code for onCreateContextMenu Method, correct me if I am doing anything wrong..This is my context_menu.xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/open"" android:title=""Open""/&gt;&lt;/menu&gt;</code></pre><p>This is my <strong>onCreateContextMenu</strong> Method:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,    ContextMenuInfo menuInfo) {  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.context_menu, menu);  super.onCreateContextMenu(menu, v, menuInfo); }</code></pre><p>This is my <strong>onCreate</strong> Method:</p><pre><code>@Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  //  extras = getIntent().getExtras();  registerForContextMenu(getListView());  ... }</code></pre>","301444","","301444","","2010-04-08 03:35:31","2011-09-01 10:09:41","How to create Context Menu using XML file?","<android><contextmenu>","2","0","","",""
"2592349","1","","","2010-04-07 12:26:15","0","3622","<p>I am working on implementing simple animations on Android development and being successful. I came across one called 'LayoutAnimation'. I couldn't figure out exactly what it is and how can we implement it? Could someone explain me (or) give me link to know about 'LayoutAnimation' and How can we implement it step by step procedures?</p><p>Thank you for your helps in Advance.</p>","187532","","","","","2010-04-07 13:04:53","Android:What is LayoutAnimation?","<android>","1","0","","",""
"2592499","1","2592576","","2010-04-07 12:48:26","16","34393","<p>I have a date picker and a time picker in my app. Can anyone tell me how to get the values of the date and time that are selected??? What i mean to say is, for EditText we can declare as </p><pre><code>final EditText Name = (EditText) this.findViewById(R.id.nametext); </code></pre><p>and we can cast the data of it by using <code>Name.getText().toString()</code>.</p><p>So similarly how can we get the values of date picker and time picker to a string???</p>","303155","","60261","","2010-04-07 13:09:10","2014-01-29 02:20:30","Casting and getting values from date picker and time picker in android","<android>","8","0","3","",""
"2592665","1","","","2010-04-07 13:13:59","1","362","<p>Is there any way to start the internet through Wifi/GPRS/EDGE/UMTS from application??</p><p>Thanks and Regards.</p>","271769","","19750","","2010-04-07 13:55:40","2010-04-07 16:00:41","Connecting to internet thru my app","<android><internet>","4","0","","",""
"2592801","1","","","2010-04-07 13:32:25","1","727","<p>We are designing an internal system that will have a .NET PC base station and many Android mobiles, communicating over WiFi. Can't decide between SOAP or XML-RPC protocol. Primary concerns are maturity, compatibility, and the minimizing of coding/integration, in that order. Which is best?</p><p>Ben</p>","307690","","","","","2010-04-07 13:49:52","Android to .NET - XML-RPC or KSoap?","<.net><android><soap><xml-rpc><ksoap2>","1","0","1","",""
"2592816","1","","","2010-04-07 13:34:03","2","3073","<p>I have just created and iPhone web app, which has some x264 (mp4) video files on it. When I link directly to the file on the iPhone and the user taps the link, the video player is loaded and the video starts playing.</p><p>Using the app on an Android phone causes the browser to download the video instead of just playing it. Is there a way to force a video player to just boot up and play the video not download it?</p><p>Thanks in advance.</p>","65040","","14343","","2010-07-14 12:34:41","2010-07-14 12:34:41","Auto launch the video player in Android from the browser like an iPhone does","<iphone><android><video><mp4><x264>","1","3","1","",""
"2592843","1","2592876","","2010-04-07 13:37:40","56","27735","<p>I want to download a file and need to check the response status code (ie <code>HTTP /1.1 200 OK</code>).This is a snipped of my code:</p><pre><code>HttpGet httpRequest = new HttpGet(myUri);HttpEntity httpEntity = null;HttpClient httpclient = new DefaultHttpClient();HttpResponse response = httpclient.execute(httpRequest);...</code></pre><p>How do i get the status-code of the response?</p>","288980","","288980","","2011-09-22 12:09:24","2012-04-17 15:01:58","Android: How get the status-code of an HttpClient request","<android><httpclient><httprequest><http-status-codes>","1","0","15","",""
"2592951","1","","","2010-04-07 13:50:35","0","371","<p>i have one doubt. I have an iteration of TextViews, and what i want is when i click in one TextView , i want stop the iteration and open a web, who can i know what TextView as been click on? i have this code:</p><pre><code>Iterator&lt;TextView&gt; it = text.iterator();   while(it.hasNext()){ test = it.next(); test.setOnClickListener(new View.OnClickListener() {              public void onClick(View v) {               //mWebView = (WebView) findViewById(R.id.webview);               mWebView.setWebViewClient(new WebViewClient() {                   @Override                   public boolean shouldOverrideUrlLoading(WebView view, String url) {                       view.loadUrl(url);                       return true;                   }               });           mWebView.getSettings().setJavaScriptEnabled(true);            mWebView.loadUrl(url);              }              });      // condition to stop the iteration when i click on TextView       }</code></pre><p>And what i want is the condition to stop the iteration when i click on the TextView that i want see, i try using some methods that are in the TextView and don't work. Anyone can help me? I have the iteration of TextViews because i want to do this dynamic, and i don't know the TextView who as click, and i want to know what TextView was click to stop the iteration, because if i don't stop this, for example if i have 3 TextView they will open the same web.</p><p>Thanks and forgive my English</p>","284466","","243782","","2010-04-08 09:22:01","2011-07-08 09:13:32","How can i know what TextView was clickbale?","<android><textview>","2","0","","",""
"2593214","1","2593319","","2010-04-07 14:21:28","27","34634","<p>I have a string representing an URL containing spaces and want to convert it to an URI object. If is simple try to do</p><pre><code>String myString = ""http://myhost.com/media/mp3s/9/Agenda of swine - 13. Persecution Ascension_ leave nothing standing.mp3"";URI myUri = new URI(myString);</code></pre><p>it gives me </p><pre><code>java.net.URISyntaxException: Illegal character in path at index X</code></pre><p>where index <code>X</code> is the position of the first space in the URL string.</p><p>How can i parse <code>myString</code>into a <code>URI</code> object?</p>","288980","","","","","2014-02-27 05:21:23","Android: howto parse URL String with spaces to URI object?","<java><android><url><uri><httprequest>","3","0","5","",""
"2593503","1","","","2010-04-07 15:00:38","6","2205","<p>HiI want to be able to run a ""Hello World"" application on my android emulator in <strong>hebrew</strong></p><p>How can I do that? is it supported?</p><p>thanks</p>","311110","","","","","2012-05-15 14:12:12","Using hebrew with the android emulator","<android><emulator><hebrew>","2","0","5","",""
"2593965","1","7900527","","2010-04-07 16:02:25","8","3195","<p>Is there a way to build a VPN 'provider' for Android?  A way to add new VPN types to the existing VPN infrastructure?  OpenVPN, for instance, though also things like pppoe might fit in this category.</p>","8002","","","","","2012-03-20 09:29:16","Is there a VPN-provider API for Android?","<android><vpn><openvpn>","2","1","6","",""
"2594298","1","2594474","","2010-04-07 16:46:35","0","2601","<p>I need a very simple menu which probably contains only one or two items: settings/options, where pressing one of them should show some customer defined parameters (is it called dialog), e.g., number of results shown. Is there any good tutorial on creating such kind of menus? I've looked at the ""notepad"" example in android, it doesn't really help.</p>","253800","","","","","2010-04-07 22:52:38","android: any tutorials on creating menus for apps?","<android><menu><optionmenu>","1","0","1","",""
"2594814","1","2594992","","2010-04-07 18:14:36","9","1712","<p>I keep hearing that Android applications should try to limit the number of objects created in order to reduce the workload on the garbage collector.  It makes sense that you may not want to created massive numbers of objects to track on a limited memory footprint, for example on a traditional server application created 100,000 objects within a few seconds would not be unheard of.</p><p>The problem is how far should I take this?  I've seen tons of examples of Android applications relying on static state in order supposedly ""speed things up"".  Does increasing the number of instances that need to be garbage collected from dozens to hundreds really make that big of a difference?  I can imagine changing my coding style to now created hundreds of thousands of objects like you might have on a full-blown Java-EE server but relying on a bunch of static state to (supposedly) reduce the number of objects to be garbage collected seems odd.</p><p>How much is it really necessary to change your coding style in order to create performance Android apps?</p>","97901","","584420","","2012-02-07 10:12:38","2012-02-07 10:12:38","Changing coding style due to Android GC performance, how far is too far?","<android><dalvik>","2","0","2","","2010-04-07 18:14:36"
"2595063","1","2598891","","2010-04-07 18:51:52","15","20583","<p>I have a LinearLayout inside a HorizontalScrollView. The content is just a image. While scrolling, I need to achieve the same behavior you get when setting the paging option on a the iPhone equivalent of the HSW (scrolling the list should stop at every page on the list, not continue moving).</p><p>How is this done in Android? Should I implement this features by myself or there is a particular property to set or a subclass of HSV to implement?</p>","1812","","504904","","2013-12-10 23:00:33","2013-12-10 23:00:33","Android horizontal scrollview behave like iPhone (paging)","<android><image><scrolling><paging>","4","1","26","",""
"2595213","1","2595306","","2010-04-07 19:15:43","38","34232","<p>Pretty simple.What is the difference among those three?</p><p>I want to list every Image in a device.Should I use <code>managedQuery()</code>, <code>android.provider.MediaStore.Images.Media.query()</code> or <code>context.getContentResolver.query()</code></p>","119895","","82118","","2010-08-24 22:56:54","2014-03-18 09:26:43","managedQuery() vs context.getContentResolver.query() vs android.provider.something.query()","<android>","2","0","15","",""
"2595525","1","2595552","","2010-04-07 20:05:05","2","638","<p>I'm having some difficulty figuring out the best ways to pause and resume my application. Is there any comprehensive tutorial or something similar that would help me make sure that I'm not missing any important steps? </p><p>Mostly I'm just worried about not dealing with the memory being used by my application. There's a few apps I own that when you minimize them slow down the rest of the phone to a stand still and I want to make sure to avoid that.</p><p>Thanks, any help or suggestions on the topic would be great.</p>","118241","","","","","2010-04-07 20:08:59","Android Pausing and Resuming Tutorial","<java><android><memory><garbage-collection>","1","0","0","",""
"2595526","1","2595998","","2010-04-07 20:05:07","1","112","<p>Is there a way to send -D directives to an android app? On desktop java I would just do java -Dsomeflag=value.</p><p>How would you do this on android? I am building with eclipse.</p>","138457","","","","","2010-04-07 21:15:24","How to send -Dflag to android app","<java><android><eclipse>","1","0","0","",""
"2595820","1","2595861","","2010-04-07 20:50:07","4","224","<p><a href=""http://developer.android.com/guide/topics/ui/layout-objects.html"" rel=""nofollow"">This page</a> in the Android documentation defines an element id as follows:</p><pre><code>&lt;TextView android:id=""@+id/label""           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           android:text=""Type here:"" /&gt;</code></pre><p>However <a href=""http://developer.android.com/guide/topics/resources/resources-i18n.html"" rel=""nofollow"">this page</a> defines it as:</p><pre><code>&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=""@color/opaque_red""    android:text=""Hello, World!"" /&gt;</code></pre><p>I thought I had a decent understanding of what was going on until I saw this second example.   In the first case, you need the + character so that id 'label' is added to the R file, correct?  In the second case, would the EditText's id not be added to the R file because it does not contain the + character?</p><p>Also, the second example does not include the android namespace on the id.  Does having or not having the Android namespace affect whether that id will be added to the R file?</p><p>Thanks for any clarification.  </p>","202431","","","","","2010-04-07 21:31:33","why is there different id syntax in the Android docs?","<android>","4","0","0","",""
"2596244","1","2596262","","2010-04-07 22:02:07","1","2659","<p>I'm running a sample application that has a map component to it.</p><p>The app launch find, but I don't see the map loading.</p><p>I read sometime ago that it might be caused by keystore mismatch?<br>How do I set keystore? Been trying to find it from google and eclipse but can't find where I can change that.</p><p>Thanks,<br>Tee</p>","166940","","","","","2010-04-07 22:04:26","Android - how to set keystore","<android>","1","0","","",""
"2596254","1","","","2010-04-07 22:03:26","2","827","<p>I wrote a home screen widget with one image on it. When the image is clicked, browser will be opened for a url link.Generally, it is working. But a weird thing is that, when I click background, then click the picture, the browser will not be open. Until I click the second time on the picture, the browser opens. The steps to reproduce is below:</p><ol><li>Click on the home screen widget background.</li><li>Click on the image on the home screen. The browser is not opened.</li><li>Click on the image again. The browser is opened.</li></ol><p>If I didn't click on the background, the image will react to click very well, i.e. browser will be open when the image is clicked the first time.</p><p>The widget XML file is as below:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/widget""android:layout_width=""320dip"" android:layout_height=""200dip""    android:background=""@drawable/prt_base""&gt;    &lt;ImageView android:id=""@+id/picture1""        android:layout_width=""134dip""        android:layout_height=""102dip""        android:layout_marginLeft=""62dip""        android:layout_marginTop=""6dip""        android:scaleType=""center""                android:src=""@drawable/picture1""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The code to set OnClick on the picture1 ImageView is as below:</p><pre><code>                        defineIntent = new Intent(Intent.ACTION_VIEW, Uri                                .parse(""http://www.google.com""));                        pendingIntent = PendingIntent                                .getActivity(context,                                        0 /* no requestCode */,                                        defineIntent, 0 /* no flags */);                        updateViews.setOnClickPendingIntent(                                picId, pendingIntent);</code></pre><p>Anyone knows what's wrong?</p><p>Thanks.</p>","256239","","114066","","2010-04-08 07:47:31","2010-04-08 07:47:31","Weird onclick behavior of images on home screen widget","<android>","1","3","","",""
"2596352","1","2596497","","2010-04-07 22:24:08","13","36849","<p>I know it's possible to have multiple languages in a single application through the res/string and depending on Locale.Here is  a case<a href=""http://stackoverflow.com/questions/2078289/android-controling-the-user-language"">http://stackoverflow.com/questions/2078289/android-controling-the-user-language</a></p><p>Now how can I change the language in the phone ?Like I'd do byMenu > Settings > Language &amp; Keyboard > Select locale > languages </p><p>Is there some real code to access to these settings ?Or should I create intent for a shortcut to the language settings.Please post some code</p><p>Edit : With Locale classdeveloper.android.com/intl/fr/reference/java/util/Locale.html</p><p>The constructor is at least Locale(String  language)The input is language.How can you retrieve the current language used on the device ?</p>","311420","","311420","","2010-04-07 23:36:18","2013-06-02 17:09:32","Change language settings (locale) for the device","<android><settings><locale>","5","2","9","",""
"2596383","1","2599089","","2010-04-07 22:35:02","8","26821","<p>The company I work for produces a lot of video and we want to target as many devices as possible, but the question came up of what does the Android do?</p><p>I personally own an Android based phone running 2.1, but I can't seem to get the HTML 5  tag to work. Even when I can trigger the browser to playback the video it just throws a notification error that it can't.</p><p>Are there guidelines to producing Android/HTML 5 compatible videos? Is it truly supported?</p>","183110","","5536","","2011-03-04 19:13:35","2011-10-07 05:26:35","Does Android 2.1's Browser Support HTML 5 and What Video Format Does It Play?","<android><video><html5><html5-video>","1","3","4","",""
"2596390","1","","","2010-04-07 22:36:22","1","7859","<p>I just about got this, but I have a small problem in the order of things going off.Specifically, in my thread() I am setting up an array that is used by a Spinner.  Problem is the Spinner is all set and done basically before my thread() is finished, so it sets itself up with a null array.</p><p>How do I associate the spinners ArrayAdapter with an array that is being loaded by another thread?</p><p>I've cut the code down to what I think is necessary to understand the problem, but just let me know if more is needed.  The problem occurs whether or not refreshData() is called.</p><p>Along the same lines, sometimes I want to call loadData() from the menu.  Directly following loadData() if I try to fire a toast on the next line this causes a forceclose, which is also because of how I'm implementing ProgressDialog.</p><p>THANK YOU FOR LOOKING</p><pre><code>public class CMSHome extends Activity { private static List&lt;String&gt; pmList = new ArrayList&lt;String&gt;();// Instantiate helpersPMListHelper plh = new PMListHelper();ProjectObjectHelper poc = new ProjectObjectHelper();// These objects hold lists and methods for dealing with themprivate Employees employees;private Projects projects;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Loads data from filesystem, or webservice if necessary    loadData();    // Capture spinner and associate pmList with it through ArrayAdapter    spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(                    this, android.R.layout.simple_spinner_item,                    pmList);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);    //---the button is wired to an event handler---    Button btn1 = (Button)findViewById(R.id.btnGetProjects);    btn1.setOnClickListener(btnListAllProjectsListener);    spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());}private void loadData(){    final ProgressDialog pd = ProgressDialog.show(this,            ""Please wait"", ""Loading Data..."", true, false);    new Thread(new Runnable(){        public void run(){            employees = plh.deserializeEmployeeData();            projects = poc.deserializeProjectData();            // Check to see if data actually loaded, if not then refresh            if ((employees == null) || (projects == null)) {                refreshData();            }            // Load up pmList for spinner control            pmList = employees.getPMList();            pd.dismiss();        }    }).start();}private void refreshData(){    // Refresh data for Projects    projects = poc.refreshData();    poc.saveProjectData(mCtx, projects);    // Refresh data for PMList              employees = plh.refreshData();    plh.savePMData(mCtx, employees);}}</code></pre><p>&lt;----  EDIT  ----->I tried changing onCreate() to the following after Jims suggestion.  Not sure if I did this right, still doesn't work:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mCtx = this;    // Loads data from filesystem, or webservice if necessary    // Would like to extend this to update if files are over x days old    final ProgressDialog pd = ProgressDialog.show(this,            ""Please wait"", ""Loading Data..."", true, false);    new Thread(new Runnable(){        public void run(){            employees = plh.deserializeEmployeeData();            projects = poc.deserializeProjectData();            // Check to see if data actually loaded, if not then refresh            if ((employees == null) || (projects == null)) {                refreshData();            }            pd.dismiss();            runOnUiThread(new Runnable() {                public void run(){                    // Load up pmList for spinner control                    pmList = employees.getPMList();                }            });        }    }).start();    spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_spinner_item, pmList);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);    //---the button is wired to an event handler---    Button btn1 = (Button)findViewById(R.id.btnGetProjects);    btn1.setOnClickListener(btnListAllProjectsListener);    spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());}</code></pre><hr><p>Wow, this took forever for me to find a solution, but Im overjoyed to have finally gotten this to work.</p><p>Updating the Spinner with a background thread can be accomplished by utilizing a handler.  The handler is called after the main work of the thread is completed.</p><pre><code>  mProgressDlg = ProgressDialog.show(this, ""App_Name"", ""Loading data..."",                                     true, false);  new Thread(new Runnable(){            public void run() {                    /*Load Data, set pmList in my case*/                    mProgressDlg.dismiss();                    hRefresh.sendEmptyMessage(REFRESH);            }    }).start();Handler hRefresh = new Handler(){@Overridepublic void handleMessage(Message msg) {   switch(msg.what){     case REFRESH:                 spinner = (Spinner) findViewById(R.id.spinner);                 final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(                         mCtx, android.R.layout.simple_spinner_item, pmList);                 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                 spinner.setAdapter(adapter);                 spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());            break;   }}};</code></pre><p>Credit to bhatt4982 and his answer on <a href=""http://stackoverflow.com/questions/1458190/how-can-i-display-a-progress-at-start-up-application-in-android"">this thread</a></p>","305564","","10936","","2011-07-28 00:52:11","2012-12-07 11:04:26","Android ProgressDialog Progress Bar doing things in the right order","<android><multithreading><progress-bar><progressdialog>","3","0","","",""
"2596452","1","","","2010-04-07 22:52:09","14","41686","<p>I'm trying to create a method for resizing multi-line text in a <code>TextView</code> such that it fits within the bounds (both the X and Y dimensions) of the <code>TextView</code>.</p><p>At present, I have something, but all it does is resize the text such that just the first letter/character of the text fills the dimensions of the <code>TextView</code> (i.e. only the first letter is viewable, and it's huge). I need it to fit all the lines of the text within the bounds of the TextView.</p><p>Here is what I have so far:</p><pre><code>public static void autoScaleTextViewTextToHeight(TextView tv){    final float initSize = tv.getTextSize();    //get the width of the view's back image (unscaled)....     float minViewHeight;    if(tv.getBackground()!=null)    {      minViewHeight = tv.getBackground().getIntrinsicHeight();    }    else    {      minViewHeight = 10f;//some min.    }    final float maxViewHeight = tv.getHeight() - (tv.getPaddingBottom()+tv.getPaddingTop())-12;// -12 just to be sure    final String s = tv.getText().toString();    //System.out.println(""""+tv.getPaddingTop()+""/""+tv.getPaddingBottom());    if(minViewHeight &gt;0 &amp;&amp; maxViewHeight &gt;2)    {      Rect currentBounds = new Rect();      tv.getPaint().getTextBounds(s, 0, s.length(), currentBounds);      //System.out.println(""""+initSize);      //System.out.println(""""+maxViewHeight);      //System.out.println(""""+(currentBounds.height()));      float resultingSize = 1;      while(currentBounds.height() &lt; maxViewHeight)      {        resultingSize ++;        tv.setTextSize(resultingSize);        tv.getPaint().getTextBounds(s, 0, s.length(), currentBounds);        //System.out.println(""""+(currentBounds.height()+tv.getPaddingBottom()+tv.getPaddingTop()));        //System.out.println(""Resulting: ""+resultingSize);      }      if(currentBounds.height()&gt;=maxViewHeight)      {        //just to be sure, reduce the value        tv.setTextSize(resultingSize-1);      }    }}</code></pre><p>I think the problem is in the use of <code>tv.getPaint().getTextBounds(...)</code>. It always returns small numbers for the text bounds... small relative to the <code>tv.getWidth()</code> and <code>tv.getHeight()</code> values... even if the text size is far larger than the width or height of the <code>TextView</code>.</p>","272302","","119895","","2012-03-23 11:24:56","2014-01-21 23:00:02","How to scale/resize text to fit a TextView?","<android><resize><textview><autosize>","11","2","12","",""
"2596547","1","2597318","","2010-04-07 23:14:40","90","10914","<p>I am attempting to create a custom Adapter for my ListView since each item in the list can have a different view (a link, toggle, or radio group), but when I try to run the Activity that uses the ListView I receive an error and the app stops. The application is targeted for the Android 1.6 platform. </p><p>The code:</p><pre><code>public class MenuListAdapter extends BaseAdapter { private static final String LOG_KEY = MenuListAdapter.class.getSimpleName(); protected List&lt;MenuItem&gt; list; protected Context ctx; protected LayoutInflater inflater; public MenuListAdapter(Context context, List&lt;MenuItem&gt; objects) {  this.list = objects;  this.ctx = context;  this.inflater = (LayoutInflater)this.ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public View getView(int position, View convertView, ViewGroup parent) {  Log.i(LOG_KEY, ""Position: "" + position + ""; convertView = "" + convertView + ""; parent="" + parent);  MenuItem item = list.get(position);  Log.i(LOG_KEY, ""Item="" + item );        if (convertView == null)  {            convertView = this.inflater.inflate(item.getLayout(), null);        }        return convertView; } @Override public boolean areAllItemsEnabled() {  return false; } @Override public boolean isEnabled(int position) {  return true; } @Override public int getCount() {  return this.list.size(); } @Override public MenuItem getItem(int position) {  return this.list.get(position); } @Override public long getItemId(int position) {  return position; } @Override public int getItemViewType(int position) {  Log.i(LOG_KEY, ""getItemViewType: "" + this.list.get(position).getLayout());  return this.list.get(position).getLayout(); } @Override public int getViewTypeCount() {  Log.i(LOG_KEY, ""getViewTypeCount: "" + this.list.size());  return this.list.size(); }}</code></pre><p>The error I receive:</p><pre><code>    java.lang.ArrayIndexOutOfBoundsException  at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:3523)  at android.widget.ListView.measureHeightOfChildren(ListView.java:1158)  at android.widget.ListView.onMeasure(ListView.java:1060)  at android.view.View.measure(View.java:7703)</code></pre><p>I do know that the application is returning from <code>getView</code> and everything seems in order.</p><p>Any ideas on what could be causing this would be appreciated.</p><p>Thanks,</p><p>-Dan</p>","212389","","166712","","2010-04-07 23:37:34","2013-11-19 19:44:29","ArrayIndexOutOfBoundsException with custom Android Adapter for multiple views in ListView","<android><exception><listview><adapter>","2","2","20","",""
"2596571","1","","","2010-04-07 23:20:10","15","5423","<p>I have a SlidingDrawer that pops up from the bottom of the screen and fills the screen about 80%. Even though the SlidingDrawer view is in focus, it is still possible to click on items, buttons and other elements in the view that is behind the SlidingDrawer. When SlidingDrawer is active/pulled up/in focus, I want to disable the entire view behind it so it will not be able to recieve clicks and touches. Is there a good way to disable an entire view? I have tried setEnable(false) and setClickable(false) but neither of them work.</p><p>Help?</p>","270273","","","","","2012-11-10 00:33:49","How can I disable a view behind my SlidingDrawer in Android?","<android><view><clickable><slidingdrawer>","4","3","2","",""
"2596855","1","2597999","","2010-04-08 00:44:33","4","2266","<p>I am currently trying to research how to use Android with an existing java based system.  Basically, I need to communicate to/from an Android application.</p><p>The system currently passes object data from computer to computer using ActiveMQ as the JMS provider.  On one of the computers is a display which shows object data to the user.</p><p>What we want to do now is use a phone (running Android) as another option to show this object data to a user with wifi/network access.</p><p>Ideally we would like to have a native application on the Android that would listen to the ActiveMQ topic and publish to another Topic and read/write/display the object data, but from some research I have done, I am not sure if this is possible.</p><p>What are some other ways to approach this problem?  The android Phone needs to be able to send/receive data.  I have been using the AndroidEmulator for testing.</p>","33863","","33863","","2010-04-08 13:37:05","2012-01-18 11:48:33","Interaction between Java and Android","<java><android><web-services><jms>","1","0","1","",""
"2597002","1","2598002","","2010-04-08 01:28:02","1","1664","<p>I am trying to add TableLayout to the LinearLayout from resourse(xml) using programmable way. </p><p>The added TableLayout count is dynamic. It would be between 1 - 10. I think it is better way to make it from resource xml. Because design doesn't break.</p><p>How to make it ?</p><p>Actually I don't know how to create a new instance from the XML.</p><p>Please help. guys.</p><p>Thanks in advance.</p>","164589","","","","","2010-04-08 06:34:01","How to make a TableLayout from XML using programmable way?","<android><layout>","1","0","1","",""
"2597230","1","2597898","","2010-04-08 02:36:51","6","2731","<p>I’m working on a game for Android. To help implement it, my idea is to create a subclass of a view. I would then insert several instances of this class as children of the main view. Each instance would handle detecting when it was pressed (via OnTouchListener).   </p><p>The problem I’m having now is how do I loop through all these sub-views so I can read their statuses and process them? (I.e. when they all reach a certain state something should happen).   </p><p>Or is there a better way to have several objects on the screen that respond to touch and whose status I can check?</p>","19072","","211292","","2011-10-05 06:35:55","2013-09-24 11:17:37","Loop through all subviews of an Android view?","<android><view>","3","0","1","",""
"2597329","1","","","2010-04-08 03:03:45","25","28183","<p>I'd like to display a photo on an Android Activity screen with doing gradual and continual fade-in from pale monotone sepia to the final full color. I know how to do it on a Java Image/BufferedImage for the Graphic object but unfortunately I know nothing for the Android programming environment. Could anyone help?</p>","311559","","","","","2013-11-22 09:57:51","How to do a fadein of an image on an Android Activity screen?","<android><image-processing><fadein>","3","0","16","",""
"2597371","1","2597550","","2010-04-08 03:20:55","3","3098","<p>I have a simple list view with some check boxes in an alert dialog.  I need to option to add a select all/none but you can't bring up the menu in an alert dialog, and I want to do this function from a button.  From what I've seen any kind of button (positive, neutral, and negative) all close the dialog regardless.</p><p>So, is this possible?  If no, what alternatives do I have?  My last mitigation is to simply create a new view and recreate everything.  Is a new view the <i>best</i> solution?</p>","264676","","","","","2013-12-18 09:38:54","Is it possible to make a button on an AlertDialog that doesn't automatically close the dialog?","<android><alertdialog>","5","0","0","",""
"2597486","1","","","2010-04-08 03:58:32","7","789","<p>I've noticed that the C++ classes underlying the <code>AudioTrack</code> and <code>AudioRecord</code> APIs in Android both have a <code>latency()</code> method that is not exposed via JNI. As far as I can see, the <code>latency()</code> method in <code>AudioRecord</code> still does not take into account the hardware latency (they have a TODO comment for that), but the <code>latency()</code> method in <code>AudioTrack</code> does add in the hardware latency.</p><p>I absolutely need to get this latency value from <code>AudioTrack</code>. Is there any possible way I can do this? I don't care what kind of crazy hack is needed as long as it doesn't require a rooted phone (the resulting code must still be packaged as an app on the market).</p>","267934","","56338","","2011-12-14 16:55:18","2012-11-06 23:10:49","How can I get latency info from Android's AudioTrack class?","<android><audio>","1","0","2","",""
"2597590","1","2597702","","2010-04-08 04:33:41","8","8118","<p>In Android, I have a Path object which I happen to know defines a closed path, and I need to figure out if a given point is contained within the path. What I was hoping for was something along the lines of </p><p>path.contains(int x, int y)</p><p>but that doesn't seem to exist.</p><p>The specific reason I'm looking for this is because I have a collection of shapes on screen defined as paths, and I want to figure out which one the user clicked on. If there is a better way to be approaching this such as using different UI elements rather than doing it ""the hard way"" myself, I'm open to suggestions.</p><p>I'm open to writing an algorithm myself if I have to, but that means different research I guess.</p>","311594","","","","","2012-04-30 12:15:18","How can I tell if a closed path contains a given point?","<android><graphics>","4","0","12","",""
"2597672","1","","","2010-04-08 04:58:06","0","578","<p>How can I find out that the GPS provider has failed to get location in android?Thanks</p>","285052","","","","","2011-03-28 10:47:06","Find if GPS provider failed to get location in android","<android>","1","2","","",""
"2597889","1","","","2010-04-08 06:06:23","2","2256","<p>I am having some problems with what should be a rather simple task. I simply need a JSON array with a single JSON object within it to be posted to my webservice. The entire URL request needs to be formatted like this:</p><p><code>http://www.myserver.com/myservice.php?location_data=[{""key1"":""val1"",""key2"":""val2""....}]</code></p><p>I cannot for the life of me figure out how to append the 'location_data' bit using HttpPost. Here is a code snippet to demonstrate the HTTP connection method I am using:</p><p><code></p><pre><code>    HttpClient hClient = new DefaultHttpClient();    HttpPost hPost = new HttpPost(url);    try {        hPost.setEntity(new StringEntity(string));        hPost.setHeader(""Accept"", ""application/json"");        hPost.setHeader(""Content-type"", ""application/json"");        //execute request        HttpResponse response = (HttpResponse) hClient.execute(hPost);        HttpEntity entity = response.getEntity();</code></pre><p></code></p><p>I don't have any syntax errors, and my code is accessing the server fine, just not in the exact format the server needs. Any help on how to format my request to look like how I need it would be greatly appreciated!</p>","311634","","","","","2010-04-08 06:25:42","Posting a JSON array to webservice in Android","<java><android><eclipse><json>","1","0","1","",""
"2597909","1","","","2010-04-08 06:09:22","1","3073","<p>I'm trying to rotate and resize an image in Android.  The code I have is as follows, (taken from <a href=""http://www.anddev.org/resize_and_rotate_image_-_example-t621.html"" rel=""nofollow"">this</a> tutorial):</p><p>UPDATE: More code added below for more constructive feedback</p><pre><code>     public class AnimatedSprite {        private Bitmap bitmap;        private double posX, posY;        private double velocityX, velocityY;        private int width, height;        private int numFrames, frameRate, curFrame;        private int startFrame, endFrame;        private Rect dstRect, srcRect;        private long lastTime, lastFrameTime;        private boolean looping;        private enum SpaceshipState {ALIVE, EXPLODE, DEAD};        public SpaceshipState curState;        private int respawnTime;        public AnimatedSprite(Context context, int id, int frames, int fps) {            this.bitmap = BitmapFactory.decodeResource(context.getResources(),id);            this.posX = 0;            this.posY = 0;            this.velocityX = 0;            this.velocityY = 0;            this.numFrames = frames;            this.frameRate = fps;            this.width = this.bitmap.getWidth() / frames;            this.height = this.bitmap.getHeight();            this.dstRect = new Rect((int)this.posX,(int)this.posY,(int)this.posX+this.width,(int)this.posY+this.height);            this.startFrame = 0;            this.endFrame = frames-1;            this.looping = true;            this.lastFrameTime = 0;            this.respawnTime = 0;            this.setFrameRect(this.startFrame);        }            .            .            //Other methods            .            .         //Returns a rotated copy of the AnimatedSprite a    public AnimatedSprite rotateSprite(AnimatedSprite originalSprite, float angle)    {              AnimatedSprite rotatedSprite = originalSprite;            int orgHeight = originalSprite.bitmap.getHeight();            int orgWidth = originalSprite.bitmap.getWidth();            //Create manipulation matrix            Matrix m = new Matrix();            // resize the bit map            m.postScale(.25f, .25f);            // rotate the Bitmap by the given angle                    //Static angle for testing            m.postRotate(180);            //Rotated bitmap            Bitmap rotatedBitmap = Bitmap.createBitmap(originalSprite.bitmap, 0, 0,                    orgWidth, orgHeight, m, true);             //Set the new sprite bitmap to the rotated bitmap and return            rotatedSprite.bitmap = rotatedBitmap;             return rotatedBitmap;       }}</code></pre><p>The image seems to rotate just fine, but it doesn't scale like I expect it to.  I've tried different values between 0 and .99, but the image only gets more pixelized as I reduce the scale values, but it remains that same size visually; whereas the goal I'm trying to achieve is to actually shrink it visually.  I'm not sure what to do at this point, any help is appreciated.</p>","94541","","94541","","2010-04-08 18:01:12","2010-04-08 18:01:12","Resizing and rotating an image in Android","<java><android>","1","0","1","",""
"2597950","1","2647711","","2010-04-08 06:19:28","2","1043","<p>Is it possible to have a single listview  with 2 or more columns, operable with paging property (i.e. at a time listview will show only 4 items in single column and on press of right arrow it will show next 4 items )..<br>Can you please tell me the procedure to implement it or any idea?<br>Thanks<br>puneet</p>","297082","","469983","","2011-02-18 11:18:08","2011-02-18 11:18:08","android : listview customization","<android><listview>","1","1","2","",""
"2597993","1","2598808","","2010-04-08 06:31:49","1","1015","<p>I have problem in declaring the intents on my app. I have a form with text fields and spinner. I have added a button which onClick must display Datepicker. I have declared the DatePicker as a new class and added to intent onCLick. </p><pre><code>date.setOnClickListener(new View.OnClickListener() {    public void onClick(View view)     {        Intent i=new Intent(SendMail.this,DatePicker.class);        startActivity(i);    }});</code></pre><p>In manifest i have declared</p><pre><code>&lt;activity android:name="".DatePicker""&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>Now the problem is when i click the button the whole form is getting reset and all the spinner values are getting vanished. This must be because of declaring the intent wrongly. So, can anyone specify how to declare my intent so that the DatePicker will be called on the main form iteself</p>","303155","","82515","","2010-04-08 06:33:08","2010-04-08 09:36:53","Declaring Intent Filter in android","<android>","1","0","","",""
"2598248","1","","","2010-04-08 07:35:10","15","7848","<p>I'd like to serialize a Bundle object, but can't seem to find a simple way of doing it. Using Parcel doesn't seem like an option, since I want to store the serialized data to file.</p><p>Any ideas on ways to do this?</p><p>The reason I want this is to save and restore the state of my activity, also when it's killed by the user. I already create a Bundle with the state I want to save in onSaveInstanceState. But android only keeps this Bundle when the activity is killed by the SYSTEM. When the user kills the activity, I need to store it myself. Hence i'd like to serialize and store it to file. Of course, if you have any other way of accomplishing the same thing, i'd be thankful for that too.</p><p>Edit:I decided to encode my state as a <a href=""http://developer.android.com/intl/fr/reference/org/json/JSONObject.html"">JSONObject</a> instead of a Bundle. The JSON object can then be put in a Bundle as a Serializable, or stored to file. Probably not the most efficient way, but it's simple, and it seems to work ok.</p>","311681","","311681","","2010-04-09 05:07:56","2012-12-27 15:36:47","How to serialize a Bundle?","<android><serialization><bundle>","3","0","4","",""
"2598293","1","2634984","","2010-04-08 07:46:24","5","11490","<p>I want to add a external third party jar file in the inbuilt android app.</p><p>I've added the LOCAL_CLASSPATH variable in Android.mk due to which the compilation goes fine. But during runtime, it is not able to find the class definiation which is in the JAR.</p><p>Which is the variable I need to set to add the third party JARs in the .dex/.apk ?</p><p>TIA.</p>","288515","","","","","2012-11-04 13:15:48","Adding a external jar reference in Android.mk","<android>","5","0","5","",""
"2598363","1","","","2010-04-08 08:08:23","0","476","<p>I have some code grabbing a JSON array from my server and initially storing it as a string. This all works fine until I try and deserialize it using google's gson fromJson method. LogCat spits out the error:</p><p><code>04-08 17:46:35.163: ERROR/dalvikvm(401): Can't shrink stack: curFrame is in reserved area (0x41049000 0x410491c4)</code></p><p>My code that causes the error is:</p><p><code>String[] results = gson.fromJson(returnString, String[].class);</code></p><p>Can anyone shed some light on what I am doing wrong?</p><p>Cheers,Sam</p>","311634","","","","","2010-04-08 11:11:58","JSON array deserialization is crashing the Dalvik VM","<java><android><json><gson>","1","0","1","",""
"2598390","1","2599025","","2010-04-08 08:12:45","1","736","<p>I have an <code>Observable</code> and an <code>Observer</code>. The observable does download some stuff in a background thread and calls <code>notifyObservers</code> to let the observers read the status.</p><p>At some point in <code>public void update</code> the observer tries to updates the GUI </p><pre><code>((TextView)findViewById('R.id.foo')).setText(""bar"");</code></pre><p>but it seems like the observable thread calls this method, because the Observable (!!!) throws this:</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:2462) at android.view.ViewRoot.requestLayout(ViewRoot.java:512) ... at com.mynamespace.acitivty.TrackActivity.startPlay(TrackActivity.java:72) at com.mynamespace.acitivty.TrackActivity.update(TrackActivity.java:107) at java.util.Observable.notifyObservers(Observable.java:147) at java.util.Observable.notifyObservers(Observable.java:128) at com.mynamespace.module.communication.Download.stateChanged(Download.java:213) at com.mynamespace.module.communication.Download.run(Download.java:186) at java.lang.Thread.run(Thread.java:1058)</code></pre><p>Is there some way I can prevent this from happening? I'm sure I'm missing something obvious here.</p>","288980","","","","","2010-08-16 04:43:13","How to handle data output in an Observer?","<java><android><exception><multithreading><observer-pattern>","1","0","1","",""
"2598408","1","","","2010-04-08 08:16:52","6","1339","<p>I'm having a hard time deciding whether to go with Quartz2D or OpenGL for an iPad game. It will be 2D mostly, but effect-intense (simultaneous lighting effects for 10-30 objects, 10-20 simultaneous animations on the screen).So far, assuming i'm equally dumb in both technologies and have to learn them from the ground, i came to this list. (I've read several topics here, on SO, with names like ""Quartz or OpenGL"", but i'm still left with some questions)</p><p><strong>Quartz</strong>:</p><ul><li>Better time-to-market, because ofready to use absractions like UIView,UIImageView, CoreAnimationabstractions</li></ul><p><strong>Open GL ES</strong></p><ul><li><p>Closer to hardware, thus, performanceis better.</p></li><li><p>App, implemented with OpenGL ES can be easier migrated to Android, MeeGo, Windows Phone, etc.</p></li></ul><p>My questions are:</p><ol><li>How time will it take to rewriteQuartz 2d app to use OpenGL? Letssay it took me 2 man-month to writeQuartz app, how much time will ineed to rewrite it? (Please, just some subjective opinions, i'll try to summarize them somehow)</li><li>Regarding the ease of migration to other platforms, when using OpenGL, is it really so?Or efforts when migrating Quartz app from iPhoneOS to Android will be not so much bigger, compared to OpenGL app migration? (Ease of migration is quite important criterion)</li><li>Regarding OpenGL, should i go with OpenGL 1.1 or 2.0, concerning migration? (Android supports 2.0 through NDK, but dont know whether NDK's use will increase or decrease migration efforts) </li></ol>","142820","","","","","2013-08-03 06:57:57","Quartz 2D or OpenGL ES? Pros and cons in the long term, possibility of migration to other platforms","<iphone><android><ipad><opengl-es><quartz-2d>","2","0","5","",""
"2598620","1","2599505","","2010-04-08 08:58:07","0","281","<p>i am working on my App. in between i pressed the Home button on the device. my app will go to the background tasks. After that i long press the home button it will show my app as a persistent state. i.e where and what i had done in my app. But i click my app in the directory window it restarts my app. i want to do if my app is in the background tasks it will wake up else it will start. how to achieve that? Any Idea?</p>","267269","","267269","","2010-04-08 09:09:14","2010-04-08 11:45:15","how to maintain a Home Button Presistent state of an app in Android?","<android><android-emulator>","1","0","0","",""
"2598942","1","14302947","","2010-04-08 10:02:00","6","8062","<p>My laptop supports hardware virtualization (AMD SVM) and I know that:</p><ul><li>QEMU can make use of hardware virtualization through KVM;</li><li>The Android emulator is very much based on QEMU</li></ul><p>Natural question follows: can I combine the two (Android+KVM) to get improved performance in the emulator?</p>","180784","","3052751","","2014-01-07 03:25:20","2014-01-07 03:25:20","Android emulator is based on QEMU. Can I use KVM with it?","<android><android-emulator><qemu>","5","2","5","",""
"2599305","1","","","2010-04-08 11:10:07","5","8214","<p>I have the same problem <a href=""http://stackoverflow.com/questions/1686446/upload-videos-in-android"">as described here</a>, but I will supply a few more details. While trying to upload a video in Android, I'm reading it into memory, and if the video is large I get an OutOfMemoryError.</p><p>Here's my code:</p><pre><code>// get bytestream to uploadvideoByteArray = getBytesFromFile(cR, fileUriString);public static byte[] getBytesFromFile(ContentResolver cR, String fileUriString) throws IOException {    Uri tempuri = Uri.parse(fileUriString);    InputStream is = cR.openInputStream(tempuri);    byte[] b3 = readBytes(is);    is.close();    return b3;}public static byte[] readBytes(InputStream inputStream) throws IOException {    ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();    // this is storage overwritten on each iteration with bytes    int bufferSize = 1024;    byte[] buffer = new byte[bufferSize];    int len = 0;    while ((len = inputStream.read(buffer)) != -1) {        byteBuffer.write(buffer, 0, len);    }    return byteBuffer.toByteArray();}</code></pre><p>And here's the traceback (the error is thrown on the <code>byteBuffer.write(buffer, 0, len)</code> line):  </p><pre><code>04-08 11:56:20.456: ERROR/dalvikvm-heap(6088): Out of memory on a 16775184-byte allocation.04-08 11:56:20.456: INFO/dalvikvm(6088): ""IntentService[UploadService]"" prio=5 tid=17 RUNNABLE04-08 11:56:20.456: INFO/dalvikvm(6088):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x449a3cf0 self=0x38d41004-08 11:56:20.456: INFO/dalvikvm(6088):   | sysTid=6119 nice=0 sched=0/0 cgrp=default handle=401041604-08 11:56:20.456: INFO/dalvikvm(6088):   at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:~93)04-08 11:56:20.456: INFO/dalvikvm(6088):   at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:218)04-08 11:56:20.456: INFO/dalvikvm(6088):   at com.android.election2010.UploadService.readBytes(UploadService.java:199)04-08 11:56:20.456: INFO/dalvikvm(6088):   at com.android.election2010.UploadService.getBytesFromFile(UploadService.java:182)04-08 11:56:20.456: INFO/dalvikvm(6088):   at com.android.election2010.UploadService.doUploadinBackground(UploadService.java:118)04-08 11:56:20.456: INFO/dalvikvm(6088):   at com.android.election2010.UploadService.onHandleIntent(UploadService.java:85)04-08 11:56:20.456: INFO/dalvikvm(6088):   at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:30)04-08 11:56:20.456: INFO/dalvikvm(6088):   at android.os.Handler.dispatchMessage(Handler.java:99)04-08 11:56:20.456: INFO/dalvikvm(6088):   at android.os.Looper.loop(Looper.java:123)04-08 11:56:20.456: INFO/dalvikvm(6088):   at android.os.HandlerThread.run(HandlerThread.java:60)04-08 11:56:20.467: WARN/dalvikvm(6088): threadid=17: thread exiting with uncaught exception (group=0x4001b180)04-08 11:56:20.467: ERROR/AndroidRuntime(6088): Uncaught handler: thread IntentService[UploadService] exiting due to uncaught exception04-08 11:56:20.467: ERROR/AndroidRuntime(6088): java.lang.OutOfMemoryError04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:93)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:218)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at com.android.election2010.UploadService.readBytes(UploadService.java:199)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at com.android.election2010.UploadService.getBytesFromFile(UploadService.java:182)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at com.android.election2010.UploadService.doUploadinBackground(UploadService.java:118)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at com.android.election2010.UploadService.onHandleIntent(UploadService.java:85)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:30)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at android.os.Handler.dispatchMessage(Handler.java:99)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at android.os.Looper.loop(Looper.java:123)04-08 11:56:20.467: ERROR/AndroidRuntime(6088):     at android.os.HandlerThread.run(HandlerThread.java:60)04-08 11:56:20.496: INFO/Process(4657): Sending signal. PID: 6088 SIG: 3</code></pre><p>I guess that <a href=""http://stackoverflow.com/questions/1686446/upload-videos-in-android"">as @DroidIn suggests</a>, I need to upload it in chunks. But (newbie question alert) does that mean that I should make multiple PostMethod requests, and glue the file together at the server end? Or can I load the bytestream into memory in chunks, and glue it together in the Android code?</p><p>If anyone could give me a clue as to the best approach, I would be very grateful. </p>","267831","","267831","","2010-04-08 11:51:47","2012-11-18 09:32:51","Android: OutOfMemoryError while uploading video - how best to chunk?","<android>","4","0","4","",""
"2599536","1","8102421","","2010-04-08 11:50:15","0","4373","<p>I have started teaching myself about the Android NDK and I have followed this example here - <a href=""http://marakana.com/forums/android/android_examples/49.html"" rel=""nofollow"">http://marakana.com/forums/android/android_examples/49.html</a></p><p>I have followed the steps perfectly but when I run the application I get the following error:</p><pre><code>Trying to load lib /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20Added shared lib /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20No JNI_OnLoad found in /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20+++ not scanning '/system/lib/libwebcore.so' for 'hello' (wrong CL)+++ not scanning '/system/lib/libmedia_jni.so' for 'hello' (wrong CL)WARN/dalvikvm(5191): No implementation found for native Lcom/cnetworks/ndk/NativeLib;.hello ()Ljava/lang/String;</code></pre><hr><p>Here is the java code, nativeLib.hello() is causing the problem.</p><pre><code>public class NDKdemo2 extends Activity {NativeLib nativeLib;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); nativeLib = new NativeLib(); String helloText = nativeLib.hello(); // Update the UI TextView outText = (TextView) findViewById(R.id.textOut); outText.setText(helloText); }}</code></pre><p>Has anyone had the same problem before and able to tell me whats wrong?</p>","243999","","","","","2012-10-15 10:09:34","Android NDK jni problem","<java><android><jni><android-ndk>","1","6","1","",""
"2599633","1","2937915","","2010-04-08 12:09:27","9","11448","<p>hi <br/>I tried in many ways to check Internet connection in my android emulator </p><pre><code>  ConnectivityManager conMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);     NetworkInfo info= conMgr.getActiveNetworkInfo();           if(info != null || info.isConnected()) {                Log.v(""NetworkInfo"",""Connected State"");           }          else{              Log.v(""NetworkInfo"",""Not Connected state"");              Log.v(""Reason"",info.getReason());          } </code></pre><p>even if i disable Internet connection in my system ,my code  seems to display Connected state so i guessed this may work </p><pre><code> if ( conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED        ||  conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED  ) {      Log.v(""Congr"",""Connection Present"");    }    else if ( conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED        ||  conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED) {      Log.v(""conMgr"","" No Connection"");    } </code></pre><p>but the above code also displays ""Connection Present"" even when i disconnect Internet cables..Please help to find a correct way to do this .I have ACCESS_NETWORK_STATE and INTERNET permission in my manifest file   </p>","286044","","13070","","2010-04-08 13:43:30","2012-01-25 17:28:00","Internet connection in android emulator always displays connected state","<android><internet-connection>","2","4","3","",""
"2599663","1","","","2010-04-08 12:13:40","0","216","<p>Need serious help with android todolist anyone could help please. I am trying to remove the last item inserted in the list it doesn't work for some reasons. please help if you can see the below:</p><p>public class ToDoList extends Activity implements OnClickListener, OnKeyListener {</p><pre><code>Button btnRemove; ArrayList&lt;String&gt; todoItems;  ArrayAdapter&lt;String&gt; aa;  ListView myListView ;  EditText myEditText ;</code></pre><p>@Override  public void onCreate(Bundle icicle) {    super.onCreate(icicle);</p><pre><code>// Inflate your view  setContentView(R.layout.main);  // Get references to UI widgets   myListView = (ListView)findViewById(R.id.myListView);   myEditText = (EditText)findViewById(R.id.myEditText);    // Create the ArrayList and the ArrayAdapter todoItems = new ArrayList&lt;String&gt;();  aa = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,todoItems);  // Bind the listview to the array adapter  myListView.setAdapter(aa);  btnRemove = (Button)findViewById(R.id.btnRemove);// Add key listener to add the new todo item  // when the middle D-pad button is pressed.  myEditText.setOnKeyListener(new OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event) {    if (event.getAction() == KeyEvent.ACTION_DOWN)      if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {        // Add the new todo item, and clear the input text box        todoItems.add(0, myEditText.getText().toString());        myEditText.setText("""");        aa.notifyDataSetChanged();        return true;      }    return false;  }});</code></pre><p>}</p><p>@Overridepublic void onClick(View v) {    if(v == btnRemove){        if(todoItems.size() > 0){            todoItems.remove(todoItems.size() - 1);            aa.notifyDataSetChanged();        }</p><p>}}@Overridepublic boolean onKey(View v, int keyCode, KeyEvent event) {    // TODO Auto-generated method stub    return false;}</p><p>}</p>","311867","","","","","2011-01-19 13:48:48","Remove item from todoList please help","<android>","1","0","","",""
"2599757","1","2600412","","2010-04-08 12:28:06","-1","1743","<p>How can i make a Progress bar and Progress Dialog in Android that should resemble IPhone progress bar.</p>","2355649","","279395","","2010-04-08 12:30:24","2010-04-08 13:55:05","How to make a Progress bar and Progress Dialog that resembles iPhone's progress bar?","<android><progress-bar>","1","4","","",""
"2599797","1","2599821","","2010-04-08 12:33:15","0","1180","<p>I am trying to implement both the date picker and time picker. However, when I try to define two cases in the following code, I get an error that there is a duplicate case. </p><p>Code:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch(id){    case ID_DATEPICKER:        Toast.makeText(SendMail.this, ""Select Appointment Date"",                                                  Toast.LENGTH_LONG).show();        return new DatePickerDialog(this, myDateSetListener, myYear, myMonth, myDay);    case TIME_DIALOG_ID:        Toast.makeText(SendMail.this, ""Select Appointment Time"", Toast.LENGTH_LONG).show();        return new TimePickerDialog(this,mTimeSetListener, 0, 0, false);    default:        return null;    }}</code></pre><p>What is the solution?</p>","303155","","352841","","2012-08-08 13:23:41","2012-08-08 13:23:41","Duplicate case error during implementation of two dialogs","<java><android><switch-statement>","1","1","","",""
"2599837","1","2606641","","2010-04-08 12:38:15","124","39281","<p>I have a <code>LinearLayout</code> inside a <code>ScrollView</code> that has <code>android:layout_height=""fill_parent""</code>, but it doesn't expand to the full height of the <code>ScrollView</code>. My layout looks something like:</p><pre><code>level    layout    layout_width    layout_height1    LinearLayout    fill_parent    fill_parent2    LinearLayout    fill_parent    wrap_content3    (some irrelevant stuff)2    ScrollView      fill_parent    fill_parent &lt;-- this expands full height3    LinearLayout    fill_parent    fill_parent &lt;-- this does not (has orientation=vertical)(following stuff probably are irrelevant, but just to be sure:)4    TextView        fill_parent    fill_parent4    LinearLayout    fill_parent    wrap_content</code></pre><p>I can see that the <code>LinearLayout</code> doesn't expand the full height of the <code>ScrollView</code> because in Eclipse in <code>Android Layout Editor</code>, if I select the <code>ScrollView</code> (in the Outline panel) it is highlighted with a red border that fills the screen to the bottom but when I select the <code>LinearLayout</code> its highlight doesn't expand to the bottom of the screen. How can I get it to do so?</p><p>The effect I'm trying to achieve is to have some text and a button below it (inside the <code>LinearLayout</code> in level 4 there's just a button). The text can be big enough to need a scrollbar, in which case I want the user to have to scroll down in order to see the button. In case the text is not big enough for a scroll bar, I want the <code>LinearLayout</code> containing the button to stick to the bottom of the screen.</p><p>At first I thought I shouldn't post the full XML because it's usually a turn-down to see a huge chunk of code in a question. However, it seems it might be necessary, so here's the full layout.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:id=""@+id/video_layout""        android:focusable=""true""        style=""@style/VideoLayout""&gt;        &lt;FrameLayout            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:foreground=""@android:drawable/ic_media_play""            android:foregroundGravity=""center""&gt;            &lt;ImageView                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:id=""@+id/video_thumb""                android:padding=""5dip""                android:background=""#454545""/&gt;        &lt;/FrameLayout&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:focusable=""true""            style=""@style/VideoTitle""            android:id=""@+id/video_title""            android:layout_gravity=""center""            android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;    &lt;ScrollView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;!-- this ScrollView expands the full height of the screen.             However, the next LinearLayout does not expand the full height of the ScrollView --&gt;        &lt;LinearLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""1""            android:layout_gravity=""fill""            android:orientation=""vertical""            android:id=""@+id/info_layout""&gt;            &lt;TextView                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:id=""@+id/info_body""                style=""@style/InfoText""/&gt;            &lt;LinearLayout                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:orientation=""horizontal""                style=""@android:style/ButtonBar""&gt;                    &lt;Button                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_gravity=""center""                        android:layout_weight=""1""                        android:text=""@string/button_readmore""                        android:id=""@+id/btn_read_more""/&gt;            &lt;/LinearLayout&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>At the moment I have resorted to <code>android:layout_gravity=""bottom""</code> on the problematic <code>LinearLayout</code>, which makes the button stick to the bottom of the screen no matter what. But that also makes the text stick to the bottom of the screen, which is not exactly what I was after.</p><p><strong>Update:</strong> scratch that, <code>android:layout_gravity=""bottom""</code> makes the <code>ScrollView</code> unable to, well, scroll. Other ideas?</p>","180784","","180784","","2010-04-09 09:53:15","2012-07-04 15:25:51","LinearLayout not expanding inside a ScrollView","<android><android-layout>","3","0","27","",""
"2600044","1","","","2010-04-08 13:12:06","0","3631","<p>currently i am using android Api 4.my camera initializing code is follow:</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.  Parameters parameters = camera.getParameters();  parameters.set(""jpeg-quality"", 100);  parameters.set(""orientation"", ""portrait"");  parameters.set(""picture-size"", ""320X430"");  parameters.set(""rotation"", 0);  parameters.setPictureFormat(PixelFormat.JPEG);  camera.setParameters(parameters);  camera.startPreview(); }</code></pre><p>i set the orientation portrait, camera preview working appropriately.but when i captured the image ,its rotating the image with 90 degree.In the landscape orientation its working perfectly.so how i can capture normal image using portrait orientation.</p><p>thanks.</p>","309990","","","","","2013-08-03 09:46:15","camera captured image default rotating with 90 degree angle","<android><camera>","1","0","","",""
"2600247","1","","","2010-04-08 13:36:43","0","927","<p>I'm newbie in Android.</p><p>I'm programing Instrumentation Tests for SIM ToolKit (STK)</p><p>I need to use CommandsInterface which is available only in PhoneBase Interface.Once I have a Phone i'd like to use the following line:</p><pre><code>private Phone   mPhone;private Context    mContext;private Handler    mHandler;private CommandsInterface            mCmdIf;private PhoneBase    mPhoneBase;mPhoneBase = ((PhoneBase)mPhone);  &lt;==== uncaught exception mCmdIf = mPhoneBase.mCM;</code></pre><p>It compiled successfully, however gives uncaught exception (group=0x4001b188)Please advice how to overcome this issue.Thanks In AdvanceMicha</p>","311932","","13070","","2010-04-08 13:42:03","2010-05-04 12:46:59","ClassCastException: com.android.internal.telephony.PhoneProxy","<android>","1","0","","",""
"2600325","1","","","2010-04-08 13:45:09","0","1177","<p>I have Listview and Textview inside it. Now the thing is: I want to change the TextColor over the cell's selection in the Listview, but setting setTextHighlightColor of Textview isn't giving this output.</p><p>I have tried setting a selector for this, but that is not helping too.</p><p>Can this be solved? What might be causing the issue to populate?</p><p>The code layout is:</p><p>Cell.xml</p><p></p><pre><code>&lt;ImageView     android:id=""@+id/thumbnail""     android:layout_width=""48dip""    android:layout_height=""48dip""     android:layout_gravity=""center_vertical""    android:src=""@drawable/icon"" /&gt;&lt;TextView     android:id=""@+id/username""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:layout_toRightOf=""@id/thumbnail""    android:layout_alignParentTop=""true""    android:gravity=""top""     android:text=""Username""     android:textColor=""@drawable/timeline_username_selector""/&gt;&lt;TextView     android::id=""@+id/time""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_alignParentRight=""true""    android:layout_marginLeft=""10px""    android:text=""31stMarch,2010""     android:textColor=""@drawable/timeline_username_selector""/&gt;&lt;TextView     android:id=""@+id/textTweet""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:layout_below=""@+id/username""    android:layout_toRightOf=""@id/thumbnail""    android:layout_alignParentBottom=""true""    android:gravity=""top""     android:textColor=""@drawable/timeline_tweet_selector""/&gt;</code></pre><p></p><p>The Selector is a simple one </p><p>        </p>","92039","","1809443","","2013-06-08 16:23:55","2013-06-08 16:23:55","TextView inside a ListView: setTextHighlightColor() issue","<android><android-layout><android-listview><android-textview>","0","6","","",""
"2600378","1","2600786","","2010-04-08 13:51:47","1","3522","<p>Is there a way in Android to get the upcoming alarm time?</p><p>Thanks</p><p>Clarification: I am talking about the native android Alarm Clock appliction</p>","237115","","237115","","2010-04-08 14:24:28","2012-09-12 06:24:04","android - get time of the next alarm","<android>","2","3","3","",""
"2600576","1","2618679","","2010-04-08 14:14:14","9","3181","<p>I've been looking around for this for a long time but can never seem to find it in the Android documentation.  There's all sorts of advanced things I see, but I can never find any solid documentation - <a href=""http://developer.android.com/intl/fr/reference/android/graphics/drawable/shapes/package-summary.html"">there's the shapes package</a>, but it provides no insight on how to use them in xml.  The best I can do so far is <a href=""http://groups.google.com/group/android-developers/msg/d334017d72909c79"">finding other people's examples</a>.</p><p>Is there some magical documentation that exists for the XML shapes?</p>","60261","","","","","2010-09-08 14:58:35","Where is comprehensive documentation on Android's XML shapes?","<android><documentation>","3","2","5","",""
"2600581","1","2600648","","2010-04-08 14:14:29","2","3866","<p>my input String is : 2010-03-24T17:28:50.000Z</p><p>output pattern is like:</p><pre><code>DateFormat formatter1 = new SimpleDateFormat(""EEE. MMM. d. yyyy"");</code></pre><p>i convert this like this:</p><pre><code>formatter1.format(new Date(""2010-03-24T17:28:50.000Z""));//illegalArgumentException here the string ""2010-03-24T17:28:50.000Z""</code></pre><p>ouput should be like this: Thu. Mar. 24. 2010 idea</p><p>but i get a <strong>illegalArgumentException</strong>. Dont know why? any idea??</p><p>stacktrace message is:</p><pre><code>04-08 19:50:28.326: WARN/System.err(306): java.lang.IllegalArgumentException04-08 19:50:28.345: WARN/System.err(306):     at java.util.Date.parse(Date.java:447)04-08 19:50:28.355: WARN/System.err(306):     at java.util.Date.&lt;init&gt;(Date.java:157)04-08 19:50:28.366: WARN/System.err(306):     at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:222)04-08 19:50:28.366: WARN/System.err(306):     at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:1)04-08 19:50:28.405: WARN/System.err(306):     at android.os.AsyncTask$2.call(AsyncTask.java:185)04-08 19:50:28.415: WARN/System.err(306):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)04-08 19:50:28.415: WARN/System.err(306):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)04-08 19:50:28.446: WARN/System.err(306):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)04-08 19:50:28.456: WARN/System.err(306):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)04-08 19:50:28.466: WARN/System.err(306):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","267269","","267269","","2010-04-08 14:19:20","2010-04-08 15:08:15","DateFormat conversion problem in java?","<java><android><date><date-format>","1","1","2","",""
"2600622","1","2600839","","2010-04-08 14:18:14","1","2018","<p>I am doing an android applicaiton and I know its possible to show or hide the notification bar.</p><p>but is there a way to show it but Disable the ability to drag it down?</p><p>Thanks</p>","237115","","","","","2013-01-22 17:52:31","android - Disable the ability to drag down the notification bar","<android>","1","1","2","",""
"2600916","1","2614501","","2010-04-08 14:53:09","8","8581","<p>Ok I have a <code>ViewFlipper</code> with three <code>LinearLayouts</code> nested inside it. It defaults to showing the first one. This code:</p><pre><code>// Assumptions in my Activity class:// oldTouchValue is a float// vf is my view flipper@Overridepublic boolean onTouchEvent(MotionEvent touchEvent) {  switch (touchEvent.getAction()) {    case MotionEvent.ACTION_DOWN: {      oldTouchValue = touchEvent.getX();      break;    }    case MotionEvent.ACTION_UP: {      float currentX = touchEvent.getX();      if (oldTouchValue &lt; currentX) {        vf.setInAnimation(AnimationHelper.inFromLeftAnimation());        vf.setOutAnimation(AnimationHelper.outToRightAnimation());        vf.showNext();      }      if (oldTouchValue &gt; currentX) {        vf.setInAnimation(AnimationHelper.inFromRightAnimation());        vf.setOutAnimation(AnimationHelper.outToLeftAnimation());        vf.showPrevious();      }      break;    }    case MotionEvent.ACTION_MOVE: {      // TODO: Some code to make the ViewFlipper      // act like the home screen.      break;    }  }  return false;}public static class AnimationHelper {  public static Animation inFromRightAnimation() {    Animation inFromRight = new TranslateAnimation(    Animation.RELATIVE_TO_PARENT, +1.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f);    inFromRight.setDuration(350);    inFromRight.setInterpolator(new AccelerateInterpolator());    return inFromRight;  }  public static Animation outToLeftAnimation() {    Animation outtoLeft = new TranslateAnimation(    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, -1.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f);    outtoLeft.setDuration(350);    outtoLeft.setInterpolator(new AccelerateInterpolator());    return outtoLeft;  }  // for the next movement  public static Animation inFromLeftAnimation() {    Animation inFromLeft = new TranslateAnimation(    Animation.RELATIVE_TO_PARENT, -1.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f);    inFromLeft.setDuration(350);    inFromLeft.setInterpolator(new AccelerateInterpolator());    return inFromLeft;  }  public static Animation outToRightAnimation() {    Animation outtoRight = new TranslateAnimation(    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, +1.0f,    Animation.RELATIVE_TO_PARENT, 0.0f,    Animation.RELATIVE_TO_PARENT, 0.0f);    outtoRight.setDuration(350);    outtoRight.setInterpolator(new AccelerateInterpolator());    return outtoRight;  }}</code></pre><p>... handles the view flipping but the animations are very ""on/off"". I'm wondering if someone can help me out with the last part. Assuming that I can access the LinearLayouts, is there a way where I can set the position of the layouts based on deltaX and deltaY?</p><p>Someone gave me this link: <a href=""https://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/animation/TranslateAnimation.java;h=d2ff754ac327dda0fe35e610752abb78904fbb66;hb=HEAD"" rel=""nofollow"">https://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/animation/TranslateAnimation.java;h=d2ff754ac327dda0fe35e610752abb78904fbb66;hb=HEAD</a> and said I should refer to the <code>applyTransformation</code> method for hints on how to do this but I don't know how to repeat this same behavior.</p>","43792","","","","","2011-10-12 04:55:09","Making a ViewFlipper like the Home Screen using MotionEvent.ACTION_MOVE","<android><animation><viewflipper>","2","0","9","",""
"2600969","1","","","2010-04-08 15:00:18","1","1218","<p>I am trying to make an exit button for my application. Anyhow I am able to track all the instance of activity in my application and then finish them all. But still some activity remain alive in some cases. Dont know how. Is there any method to kill a particular application in android. Or any other way can I exit from my application.</p><p>Thanks</p>","162644","","","","","2010-04-08 15:11:04","How to finish series of open sub-activities from one activity?","<android>","1","0","1","",""
"2600983","1","","","2010-04-08 15:01:22","1","780","<p>I read bookmarks from database, show it by a listview, but when clicklist item it can't load url correctly, some codes  from browser appsource.</p><p>I have not much experience about android and java, this trouble haveconfused me two days</p><p>Thanks for your help</p><pre><code>public class bookmarks extends Activity {private Cursor bookmarks;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    bookmarks = Browser.getAllBookmarks(getContentResolver());    int urlColumn = bookmarks.getColumnIndex(android.provider.Browser.BookmarkColumns.URL);    Cursor results;    String[] proj = new String[]{        android.provider.Browser.BookmarkColumns.URL,        android.provider.Browser.BookmarkColumns.TITLE    };    int[] to = new int[]{        android.R.id.text2,        android.R.id.text1    };    String whereClause;    String orderBy = Browser.BookmarkColumns.VISITS + "" DESC"";    whereClause = Browser.BookmarkColumns.BOOKMARK + "" != 0"";    results = managedQuery(Browser.BOOKMARKS_URI,            Browser.HISTORY_PROJECTION, whereClause, null, orderBy);    startManagingCursor(results);    ListAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, results, proj, to);    ListView myListView = (ListView) findViewById(R.id.list);    myListView.setAdapter(adapter);    myListView.setOnItemClickListener(mListener);       // ????}// ????private AdapterView.OnItemClickListener mListener = new AdapterView.OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; adapterView, View v, int position, long id) {        // TODO Auto-generated method stub        loadUrl(position);    }};// ????private void loadUrl(int position) {    Intent intent = (new Intent()).setAction(getUrl(position));    setResultToParent(RESULT_OK, intent);    finish();}public String getUrl(int position) {    String url = getString(Browser.HISTORY_PROJECTION_URL_INDEX, position);    return url;}// This Activity is generally a sub-Activity of CombinedHistoryActivity. In// that situation, we need to pass our result code up to our parent.// However, if someone calls this Activity directly, then this has no// parent, and it needs to set it on itself.private void setResultToParent(int resultCode, Intent data) {    Activity a = getParent() == null ? this : getParent();    a.setResult(resultCode, data);}</code></pre><p>}</p>","293790","","","","","2011-03-20 05:11:38","How fix bookmark's list item click listener","<android>","1","0","","",""
"2601124","1","2601241","","2010-04-08 15:21:10","23","28435","<p>It seems the java.net.NetworkInterface implementation of android does not have a<br>byte[]  getHardwareAddress() method<a href=""http://developer.android.com/reference/java/net/NetworkInterface.html"">http://developer.android.com/reference/java/net/NetworkInterface.html</a></p><p>I've found several forums of people trying to do this with no definitive answer, I need to get a somewhat cross-device UUID, so I can't rely on phone numbers or in ANDROID_ID (which can be overwritten and which I think depends on the user having a google account)<a href=""http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID"">http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID</a></p><p>In linux you can use ifconfig or read from /proc/net/arp and you can easily get the Hardware address.</p><p>Is there a file in android that I can read?</p><p>There has to be a way to get this address since it's shown in the ""Settings > About Phone > Status"" of the phone.</p>","188622","","2971","","2010-08-06 09:21:40","2012-09-05 14:17:56","How to obtain MAC address of WiFi network interface?","<java><android><linux><osx><networking>","2","0","15","",""
"2601243","1","2601522","","2010-04-08 15:34:56","0","615","<p>Suppose I have ActivityA and ActivityB, also suppose that ActivityA is active. I need to:</p><ol><li>Programmatically set a text of EditText in ActivityB from ActivityA</li><li>Launch ActivityB</li></ol><p>Here's my code:</p><pre><code>EditText res;final LayoutInflater factory = getLayoutInflater();final View resultView = factory.inflate(R.layout.ActivityB, null);// get widgetres = (EditText) resultView.findViewById(R.id.txtResult);// set the textres.setText(""foobar"");// create intentIntent i = new Intent(ActivityA.this, ActivityB.class);startActivity(i);</code></pre><p>ActivityB starts, but without any text in <code>txtResult</code>. How can I fix that?</p>","249592","","","","","2010-04-08 16:09:31","Change widget text in another activity","<android><activity><widget>","1","0","","",""
"2601368","1","2601459","","2010-04-08 15:52:32","0","3619","<p>I've googled around everywhere, but cannot find much for rendering strings to textures and then displaying that texture on a quad on the screen. Can someone provide a run-down on the process or provide good resources that describe how? Is rendering strings to textures even the best method for displaying text in an Android OpenGL ES app?</p><p>EDIT:Okay, so LabelMaker interferes with alpha blending, the texture (created from a PNG with a transparent background) now has a solid black background, rather than a transparent background. If I comment out all the LabelMaker-related code, it works fine.</p><p>UPDATE:Nevermind. I took a look at the code to find that LabelMaker was disabling blending after drawing the labels.</p>","118398","","44729","","2010-06-18 15:00:27","2010-12-06 05:49:28","Render string to texture in Android and OpenGL ES","<java><android><opengl-es><render-to-texture>","2","0","1","",""
"2601473","1","","","2010-04-08 16:03:46","4","1491","<p>I am building a web app, which is intended to run on the Android browser.</p><p>When I have a webpage that contains any kind of viewport meta tag, like this:</p><pre><code>&lt;meta name=""viewport"" content=""width=400""/&gt;</code></pre><p>My webpage crashes on ajax calls. It happens when using the emulator, the actual browser on my nexus one, and on a droid (all running Android 2.1). </p><p>Without the meta tag, the ajax calls run as they should.</p><p>Any ideas? </p>","312073","","259","","2010-05-17 10:41:57","2010-09-18 20:57:43","Android browser crashes on Ajax calls, when viewport meta tag is defined","<html><android><ajax><webkit><viewport>","2","2","3","",""
"2601834","1","","","2010-04-08 16:52:21","4","2663","<p>I didn't <a href=""http://forums.t-mobile.com/t5/Phone-Data-Connections/Browser-FTP-URL/td-p/107169;jsessionid=71359B5C72173849C9CEC3C8D1E98D9B"" rel=""nofollow"">post this</a> but I have the same question as the person who did.</p><p>I have a file stored on an ftp the URL to it is like this:""ftp://something.etc.etc""</p><p>It seems that the android browser is unable to handle such links. You receive an error when trying to download the file from my link. Is there a way to download files from an ftp url via the android browser that I am somehow missing? I can download the file in in my PC browser with no issues.</p>","277215","","","","","2011-02-03 18:47:07","Android Browser FTP URL","<android><url><browser><ftp>","0","2","","2011-08-22 23:52:43",""
"2601847","1","3350455","","2010-04-08 16:54:59","1","1126","<p>I can't seem to find the proper audio source for recording/analyzing/receiving the currently played music track (or just any playing media). I'm not talking about the Mic.</p><p>The spectrum live wallpaper does this on the Nexus One AFAIK.</p><p>How can I keep receiving wave buffers of the currently playing media?(I would like to support everything from 1.5, but 2.1 specific solutions are also welcome)</p><p>Thank you!</p>","289463","","","","","2010-12-05 21:06:47","Analyzing the wave data of the currently played music track","<android><audio><buffer><wave>","2","0","2","",""
"2602282","1","","","2010-04-08 17:57:10","4","2739","<p>I'm writing game with a large amount of PNG pictures. All worked fine. Than I added new activity with <code>WebView</code> and got memory shortage. After that I made some experiment - replace game PNG images with ones that just fully filled with some color. As result memory shortage had gone.</p><p>But I suppose that <code>Bitmap</code> internally hold each pixel separately so such changes should have no effect. Maybe this because of initial images have alpha channel and my test images have not it?</p><p>But actually question is: Will decreasing PNG images files sizes make some effect on decreasing usage of VM application heap or not?</p>","307699","","438992","","2013-02-03 14:23:22","2013-02-03 14:23:22","Is decreasing size of .png files have some effect to resulted Bitmap in memory","<android><png><bitmap>","3","0","0","",""
"2602316","1","2602577","","2010-04-08 18:02:09","0","2243","<p>I want to capture onClick events for the trackball on a HTC Hero. This event is firing and I can get the direction of motion of the trackball:</p><pre><code>@Overridepublic boolean onTrackballEvent(MotionEvent event) {}</code></pre><p>How do I find out if the event was a click event?</p>","119396","","","","","2010-04-08 18:49:08","Android onTrackballEvent and Click","<android>","1","0","1","",""
"2602421","1","","","2010-04-08 18:24:49","1","709","<p>I created Hello,Android application with TextView, not xml.When I run it I don't see ""Hello,Android"", only wallpaper.Any ideas, what is wrong?</p>","","user312175","","","","2012-12-03 12:39:57","Don't see ""Hello,Android"" on emulator","<android>","3","1","1","",""
"2603176","1","","","2010-04-08 20:22:56","6","7736","<p>I am working on something that needed custom drag-and-drop functionality, so I have been subclassing View, doing a bunch of math in response to touch events, and then rendering everything manually through code on the canvas in onDraw.  Now, the more functionality I add, the more the code is growing out of control and I find myself writing a ton more code than I would expect to write in a high level environment like Android.</p><p>Is this how it's done, or am I missing something?  If I'm not doing anything fancy in the UI, the framework handles the majority of my interactions.  Built-in controls handle the touches and drags, and my code is pretty much limited to business logic and data.  Is there a way to leverage the power of some of the UI controls and things like animations while also doing some of it manually in the onDraw canvas?  Is there an accepted standard of when to use one or the other (if indeed the two approaches can be mixed)?</p>","53501","","","","","2011-05-31 19:48:26","Drag and drop + custom drawing in Android","<java><android><gui><drag-and-drop>","1","2","5","",""
"2603391","1","","","2010-04-08 20:53:29","6","2713","<p>Based on my reading of Ch. 6 in the Red Book, changing the things that need to be changed for ES, I thought the following code should have done it:</p><pre><code>gl.glEnable(GL10.GL_POLYGON_SMOOTH);gl.glBlendFunc(GL10.GL_SRC_ALPHA_SATURATE, GL10.GL_ONE);gl.glHint(GL10.GL_POLYGON_SMOOTH_HINT, GL10.GL_NICEST); // no visible diffgl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);gl.glColor4f(1, 1, 1, 1);gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);         // first and count</code></pre><p>etc.</p><p>But the above fails. There is no visible difference in the output, the aliasing artifacts are just as painfully evident as before the calls to glEnable...glHint were inserted.</p><p>Actually, what I just described was when I had GL_LINE_SMOOTH in place of GL_POLYGON_SMOOTH. The latter is not even found! So where is it if not in GL10? Or how could it have been left out of OpenGL ES? How are we supposed to draw filled polygons w/ antialiasing if not with GL_POLYGON_SMOOTH?</p>","264124","","","","","2011-01-06 21:29:43","How do we get Polygon Antialiasing in OpenGL ES on Android 1.5?","<android><opengl-es>","1","0","1","",""
"2603396","1","2603563","","2010-04-08 20:54:17","0","578","<p>I have a linear layout with this form</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;RadioGroup android:id=""@+id/group""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;RadioButton android:id=""@+id/item1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item1""android:checked=""true"" /&gt;&lt;RadioButton android:id=""@+id/item2""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item2"" /&gt;&lt;RadioButton android:id=""@+id/item3""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item3"" /&gt;&lt;/RadioGroup&gt; &lt;TextView    android:id=""@+id/txt""    android:layout_width=""fill_parent""android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>this works fine but if I put the TextView above the RadioGroup 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;TextView    android:id=""@+id/txt""    android:layout_width=""fill_parent""android:layout_height=""fill_parent""    /&gt;   &lt;RadioGroup   android:id=""@+id/group""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;RadioButton android:id=""@+id/item1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item1""android:checked=""true"" /&gt;&lt;RadioButton android:id=""@+id/item2""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item2"" /&gt;&lt;RadioButton android:id=""@+id/item3""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item3"" /&gt;&lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>the activity appears blank</p><p>what can be the reason for this</p><p>thanks</p>","235123","","235123","","2010-04-08 20:56:34","2010-04-08 21:23:22","RadioGroup does not appear?","<android>","2","0","","",""
"2603480","1","2605209","","2010-04-08 21:09:02","2","1280","<p>O.k....this is weird. I had my buttons looking fine last week, now something has changed.</p><p>My buttons on the eclipse emulator are much larger than on my device (Droid 2.1).</p><p>I checked my skin settings, screen size permissions, density factors....what am I missing?</p><p>My skin is set to WVGA854, but when the app goes to the phone the buttons are smaller!? Text and pictures are fine...looking the same as the emulator...just the buttons are shrunk!</p><p>Hmm....I know it has to be something simple...:)</p><p>UPDATE:Ok....posting xml;</p><pre><code>&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:background=""@drawable/pic""&gt; &lt;Button    android:id=""@+id/strtbtn""    android:textSize=""8pt""    android:layout_marginTop=""50px""    android:layout_marginLeft=""20px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Blahh""/&gt; &lt;Button    android:id=""@+id/contbtn""    android:textSize=""8pt""    android:layout_marginTop=""140px""    android:layout_marginLeft=""200px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Blahh""/&gt; &lt;Button    android:id=""@+id/credbtn""    android:textSize=""8pt""    android:layout_marginTop=""530px""    android:layout_marginLeft=""20px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Blahh""/&gt; &lt;Button    android:id=""@+id/miscbtn""    android:textSize=""8pt""    android:layout_marginTop=""610px""    android:layout_marginLeft=""80px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Blahh""/&gt; &lt;Button    android:id=""@+id/blahhbtn""    android:textSize=""8pt""    android:layout_marginTop=""690px""    android:layout_marginLeft=""200px""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Blahh""/&gt;&lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:src=""@drawable/introanim""    android:id=""@+id/introanim""    android:layout_gravity=""center""    android:layout_weight=""1""/&gt;&lt;/RelativeLayout&gt;</code></pre>","310187","","310187","","2010-04-09 03:25:17","2010-04-09 05:14:41","Why are button sizes on Eclipse vs Device not the same","<android>","4","1","","",""
"2603648","1","4638873","","2010-04-08 21:39:49","4","4408","<p>Shared libraries .so files are placed in lib/armeabi in an apk file.</p><p>I have read after installation the libs gets extracted to /data/data/application_package/lib</p><p>How can I get the exact path to this directory in my application at run time?Is this directory readable by the application? Or is only executeable access allowed?If it is readable - Is this still true for copy protected applications?</p>","117593","","","","","2013-05-29 06:19:40","How to get the path to the lib folder for an installed package","<android><android-ndk>","2","0","3","",""
"2603691","1","","","2010-04-08 21:47:54","28","37445","<p>I'm new to implementing HTTPS connections in Android.  Essentially, I'm trying to connect to a server using the org.apache.http.client.HttpClient.  I believe, at some point, I'll need to access the application's keystore in order to authorize my client with a private key.  But, for the moment, I'm just trying to connect and see what happens; I keep getting an HTTP/1.1 400 Bad Request error. </p><p>I can't seem to make heads or tails of this despite many examples (none of them seem to work for me).  My code looks like this (the BODY constant is XmlRPC):</p><pre><code> private void connect() throws IOException, URISyntaxException{    HttpPost post     = new HttpPost(new URI(PROD_URL));    HttpClient client = new DefaultHttpClient();    post.setEntity(new StringEntity(BODY));    HttpResponse result = client.execute(post);    Log.d(""MainActivity"", result.getStatusLine().toString());}</code></pre><p>So, pretty simple.  Let me know if anyone out there has any advice.  Thanks!</p>","309769","","","","","2012-05-02 07:54:47","Android HttpClient and HTTPS","<android><ssl><https><httpclient><bad-request>","1","0","16","",""
"2603846","1","2925195","","2010-04-08 22:22:11","2","10611","<p>I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying:</p><pre><code>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>Here is part of the call stack:</p><pre><code>android.os.Handler.&lt;init&gt;(Handler.java:121)android.app.Dialog.&lt;init&gt;(Dialog.java:99)android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:65)android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:61)android.app.AlertDialog$Builder.create(AlertDialog.java:797)android.app.AlertDialog$Builder.show(AlertDialog.java:812)com.scoreninja.adapter.ScoreNinjaAdapter.show(ScoreNinjaAdapter.java:136)com.scoreninja.adapter.ScoreNinjaAdapter.show(ScoreNinjaAdapter.java:99)</code></pre><p>I thought the main thread had prepare() called automatically, and if not, why would it work fine for me but not anyone else?</p>","63887","","","","","2010-05-27 21:42:48","ScoreNinja causes java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()","<android><multithreading><handler>","2","0","","",""
"2604024","1","","","2010-04-08 23:00:00","3","839","<p>I am trying to create a web service client for the android but i am stuck really bad Attached is my code and WSDL file. Please help</p><pre><code>/** To change this template, choose Tools | Templates* and open the template in the editor.*/package org.me.androidapplication1;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import java.io.IOException;import java.util.logging.Level;import java.util.logging.Logger;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapPrimitive;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.AndroidHttpTransport;import org.xmlpull.v1.XmlPullParserException;/**** @author bansal*/public class MainActivity extends Activity {private String SOAP_ACTION = ""http://src/getNews"";private String METHOD_NAME = ""getNews"";private String NAMESPACE = ""http://src/"";private static final String URL =""http://128.205.201.202:8080/RssService/RssServiceService?WSDL"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {super.onCreate(icicle);TextView tv = new TextView(this);SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);request.addProperty(""ticker"",""NASDAQ:INFY"");SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.setOutputSoapObject(request);AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);try {androidHttpTransport.call(SOAP_ACTION, envelope);SoapPrimitive p = (SoapPrimitive) envelope.getResponse();tv.setText(""Response "" + p);} catch (Exception ex) {ex.printStackTrace();}setContentView(tv);// ToDo add your GUI initialization code here}}</code></pre><p>Thanks</p>","312254","","60096","","2010-04-08 23:04:11","2012-05-17 10:49:42","SOAP web client on Android","<android>","2","1","1","",""
"2604160","1","2604222","","2010-04-08 23:36:57","7","2983","<p>I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it.</p><pre><code>&lt;RelativeLayout android:id=""@+id/entrypopup""            android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:padding=""5px""    android:visibility=""gone""    android:layout_below=""@+id/ad""    android:background=""#80000000""&gt;    &lt;TextView android:id=""@+id/title"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Entry Popup...""        android:textColor=""#ffffffff""        android:textSize=""20sp"" /&gt;    &lt;TableLayout android:id=""@+id/TableLayout01""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_below=""@id/title""&gt;        &lt;TableRow android:layout_weight=""1""&gt;            &lt;Button android:id=""@+id/buttonVisit"" android:text=""View""                android:layout_height=""fill_parent""                android:layout_width=""0dip""                android:layout_weight=""1""/&gt;            &lt;Button android:id=""@+id/buttonCancel"" android:text=""Cancel""                android:layout_width=""0dip""                android:layout_weight=""1""                 android:layout_height=""fill_parent""/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>But running layoutopt it says that ""this TableRow layout or its TableLayout parent is possible useless"".  </p><p>Is there a way to do this layout then without the tables?</p>","297762","","","","","2010-04-08 23:53:33","Android layout with 2 evenly spaced Buttons","<android><android-layout>","1","0","","",""
"2604354","1","","","2010-04-09 00:26:14","2","393","<p>The sample program VoiceRecognition.java gives me the error ""Recognizer not present"" using the emulator. How do I fix this problem.</p>","312408","","199972","","2012-06-23 16:15:38","2012-06-23 16:15:38","VoiceRecognition.java gives me the error ""Recognizer not present""","<android><android-sdk-2.1>","0","0","","",""
"2604599","1","3417158","","2010-04-09 01:45:22","29","46933","<p>If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no ""highlighted"" or ""selected"" or similar state which lets me toggle its appearance at will.</p><p>Here's my XML; it only changes appearance when pressed.</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=""@drawable/map_toolbar_details_selected"" /&gt;&lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/map_toolbar_details_selected"" /&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/map_toolbar_details_selected"" /&gt;&lt;item android:drawable=""@drawable/map_toolbar_details"" /&gt;</code></pre><p></p>","92259","","82118","","2011-09-14 22:04:21","2013-03-06 12:26:47","Android ImageButton with a selected state?","<android><button><imagebutton>","4","1","23","",""
"2604647","1","2604669","","2010-04-09 01:55:23","1","4513","<p>Firstly I am new to android and Java so this is a beginners question.  </p><p>I have some code that overrides the ArrayAdapter's getView method. Here is the code  </p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {   TextView label = (TextView)convertView;   if (convertView == null) {      convertView = new TextView(ctxt);      label = (TextView)convertView;   }   label.setText(items[position]);   return (convertView);}</code></pre><p>My question is: why does <code>label.setText(items[position]);</code> affect the <code>convertView</code> return value? How are they related / linked?</p>","312424","","","","","2012-11-11 21:18:14","Android/Java Beginner: Overriding ArrayAdapter's getView","<android>","3","0","","",""
"2604681","1","","","2010-04-09 02:04:32","2","2407","<p>I'm interested in using it for one of my apps and I was wondering how I can use one of them.Are there any other similar widgets out there for 2.0+?</p><p>Thanks</p>","309065","","","","","2011-11-23 08:07:07","How can I use that sliding tab widget on the Android 2.0+ lockscreen?","<android><widget><tabs><sliding>","1","0","","",""
"2604727","1","2659980","","2010-04-09 02:18:00","220","244304","<p>I am attempting to debug an application on a <a href=""https://en.wikipedia.org/wiki/Motorola_Droid"">Motorola Droid</a>, but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64-bit VM running in <a href=""http://en.wikipedia.org/wiki/Hyper-V"">Hyper-V</a>, and so I cannot connect directly via USB in the guest or from the host.</p><p>I installed a couple of different USB-over-TCP solutions, but the connection appears to have issues since the <a href=""http://en.wikipedia.org/wiki/Android_Debug_Bridge"">ADB</a> monitor reports ""devicemonitor failed to start monitoring"" repeatedly. Is there a way to connect directly from the client on the development machine to the daemon on the device using the network instead of the USB connection or possibly another viable options?</p>","312443","","63550","","2014-03-16 06:29:18","2014-03-25 21:27:34","How can I connect to Android with ADB over TCP?","<android><networking><tcp><debugging><adb>","20","0","212","",""
"2604776","1","","","2010-04-09 02:35:40","1","5497","<p>I have a fairly complex layout. I use a relative layout as the root and then inside of it I have a few table views and some further nesting. When I animate an imageview between these layouts my image clips. I have a background on the parent layout and the animation looks like it's going under it. I have set android:clipChildren=""false"" and android:clipToPadding=""false"" on all of the layouts. I've also set anim.setZAdjustment(Animation.ZORDER_TOP); on all of my animations. What am I doing wrong?</p><p>EDIT: I've found at least 2 bugs so far. android:background= with a hex color causes major animation issues. Table layouts also seem to have a regoin under them that causes clipping. I am also seeing the same thing with framelayouts. I'll add an answer once I actually get my stuff working the way I want it to. I have a feeling using only linear layouts is the solution.</p><p>Here is some sample code that produces the issue. If you remove the two child relative layouts then the animation completes as expected.</p><hr><p>Java:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView imageViewtop = (ImageView) findViewById(R.id.ImageView01);    imageViewtop.setOnClickListener(btnCardListener);}private OnClickListener btnCardListener = new OnClickListener() {    public void onClick(View v) {        ImageView ImageView03 = (ImageView) findViewById(R.id.ImageView03);        ImageView ImageView05 = (ImageView) findViewById(R.id.ImageView05);        int[] playLoc = { 0, 0 };        int[] botLoc = { 0, 0 };        ImageView05.getLocationOnScreen(playLoc);        ImageView03.getLocationOnScreen(botLoc);        int xMove = playLoc[0] - botLoc[0];        int yMove = playLoc[1] - botLoc[1];        AnimationSet animSet = new AnimationSet(true);        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());        TranslateAnimation transAnim = new TranslateAnimation(                Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, xMove, // +80.0f,                Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, yMove // -100.0f        );        transAnim.setInterpolator(new DecelerateInterpolator()); // AccelerateInterpolator                                                                    // ,                                                                    // LinearInterpolator        transAnim.setZAdjustment(Animation.ZORDER_TOP);        transAnim.setAnimationListener(new AnimationListener() {            public void onAnimationStart(Animation animation) {            }            public void onAnimationEnd(Animation animation) {                ImageView ImageView03 = (ImageView) findViewById(R.id.ImageView03);                ImageView ImageView05 = (ImageView) findViewById(R.id.ImageView05);                ImageView05.setVisibility(View.VISIBLE);                ImageView03.setVisibility(View.INVISIBLE);            }            public void onAnimationRepeat(Animation animation) {            }        });        transAnim.setDuration(1000);        // Order matters...        animSet.addAnimation(ranim);        animSet.addAnimation(transAnim);        ImageView03.startAnimation(animSet);    }};</code></pre><p>XML:</p><pre><code>&lt;RelativeLayout android:id=""@+id/relativeParentLayout""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:clipToPadding=""false""&gt;    &lt;RelativeLayout android:id=""@+id/relativeParentLayout1""        xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:layout_width=""fill_parent""        android:layout_height=""150dip"" android:background=""#440000""        android:layout_alignParentTop=""true"" android:clipChildren=""false""        android:clipToPadding=""false""&gt;        &lt;ImageView android:layout_height=""wrap_content"" android:id=""@+id/ImageView01""            android:layout_width=""wrap_content"" android:src=""@drawable/card_back""            android:layout_weight=""0"" android:layout_alignParentTop=""true"" /&gt;        &lt;ImageView android:layout_height=""wrap_content"" android:id=""@+id/ImageView03""            android:layout_width=""wrap_content"" android:src=""@drawable/card_back""            android:layout_weight=""0"" android:layout_gravity=""center_vertical""            android:layout_alignParentRight=""true"" /&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout android:id=""@+id/relativeParentLayout2""        xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:layout_width=""fill_parent""        android:layout_height=""150dip"" android:background=""#000044""        android:layout_alignParentBottom=""true"" android:clipChildren=""false""        android:clipToPadding=""false""&gt;        &lt;ImageView android:layout_height=""wrap_content""            android:layout_below=""@+id/LinearLayout01"" android:id=""@+id/ImageView05""            android:layout_width=""wrap_content"" android:src=""@drawable/card_back""            android:layout_weight=""0"" android:layout_alignParentBottom=""true"" /&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","92212","","92212","","2010-04-10 18:14:07","2014-04-14 16:41:14","Android animation clipping when going between layouts","<android><animation><imageview>","3","2","3","",""
"2605468","1","","","2010-04-09 06:25:18","1","926","<p>I'm setting a selector.xml to the ListView Selector :</p><p>    </p><pre><code>&lt;item android:state_focused=""false"" android:state_selected=""true""    android:state_pressed=""true"" android:drawable=""@drawable/timeline_selected_rect""/&gt;&lt;item android:state_focused=""false"" android:state_selected=""true""    android:state_pressed=""false"" android:drawable=""@drawable/timeline_selected_rect""/&gt;&lt;item android:state_focused=""true"" android:state_selected=""true""    android:state_pressed=""true"" android:drawable=""@drawable/timeline_selected_rect""/&gt;</code></pre><p></p><p>but setting this is causing the TextView flickr over selection. this thing is not happening when the Default selector is used... whats wrong with this selector. </p><p>I have even added android:cacheColorHint=""#00000000"" as provided info by some other blogs.</p>","92039","","","","","2011-09-20 00:40:50","Android ListView with Custom List Selector causing Flickring problem","<android>","1","4","","",""
"2605470","1","4112596","","2010-04-09 06:25:24","2","9834","<p>I am getting the time using a time picker and displaying the time in the text view using following code...</p><pre><code> private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() {   public void onTimeSet(TimePicker view, int hourOfDay, int minute)    {    Toast.makeText(SendMail.this, ""Your Appointment time is ""+hourOfDay+"":""+minute,    Toast.LENGTH_SHORT).show();    TextView datehid = (TextView)findViewById(R.id.timehidden);    datehid.setText(String.valueOf(hourOfDay)+ "":""+(String.valueOf(minute)));    }   };</code></pre><p>Now, the issue is when i set the time as 8:00 pm then i get the time displayed as 20:0... I want to display the time as 8:00 pm... How can i do that???</p>","303155","","731284","","2012-02-28 09:46:33","2013-02-20 11:08:14","Displaying the Time in AM/PM format in android","<android>","4","4","0","",""
"2605555","1","","","2010-04-09 06:47:17","13","32487","<p>How to read data from the assets folder sqlite database file with .sqlite extension in my Android application?</p>","312559","","15168","","2010-04-09 07:02:35","2014-01-30 15:57:51","Android: Accessing assets folder sqlite database file with .sqlite extension","<android>","5","1","7","",""
"2605558","1","2605723","","2010-04-09 06:47:46","2","4736","<p>I have a custom control/view that observes the direction of a gesture within its bounds. I would like to send a different message back to the Activity hosting the View depending on the direction of the gesture. I'm having a hard time determine what the right way to do this is. I would think I could raise a custom event in the control and then stick a listener on the control in the activity, but I cannot find any information on custom events in Android. Any help would be appreciated.</p><p>Thanks.</p>","8117","","","","","2010-04-09 07:25:19","Android Custom View to Activity communication","<android><events><custom-controls><handler>","1","0","","",""
"2605672","1","2606785","","2010-04-09 07:12:20","0","309","<p>i have an app that has a few checkboxes in the settings and then compiles a remote sql based on the checkboxes selected. i ran it in the emulator and it's fine. but then i exported it and published it as an app, and the same checked boxes aren't being passed correctly. i wonder if it's a caching issue or something. tried deleting the apks a few times and republish but to no avail. i ""fake-edited"" the source java and then export again, still no difference. </p><p>i'm kind of new to eclipse but is there a force build option? i only see build-automatically option under project but not sure how i can make sure that the apk exported is the same as run in the emulator </p><p><em>edit</em> the emulator is version 1.5, and my phone is nexus one running 2.1- not sure if that makes a difference</p><p>thanks</p>","312572","","312572","","2010-04-09 07:21:24","2010-04-09 10:54:46","my android app runs fine in the emulator, but when i publish it it's wrong","<android><eclipse><export><emulator>","1","2","","",""
"2605839","1","2606485","","2010-04-09 07:51:22","0","54","<p>I am wondering what is the kind of object that shows up when in the Contact application, you hit search option, what is it ? a Custom Quick Search Bar, a custom notificaction bar, other idea ...</p><p>An image of what I am talking about is available here : <a href=""http://www.developpez.net/forums/attachments/p60921d1270798944/java/general-java/java-mobiles/android/cet-objet-image-jointe/screen-shot-2010-04-09-at-9.37.38-am.png/"" rel=""nofollow"">http://www.developpez.net/forums/attachments/p60921d1270798944/java/general-java/java-mobiles/android/cet-objet-image-jointe/screen-shot-2010-04-09-at-9.37.38-am.png/</a></p><p>Thank you all</p>","290613","","","","","2010-04-09 10:04:10","What is the object of the Contact application search option?","<android><android-layout>","1","1","","",""
"2605948","1","2606076","","2010-04-09 08:23:58","4","2453","<p>I would like to build and android project from command line on Linux. In the root directory of the project there are the following files and directories:</p><p><code>AndroidManifest.xml  build.xml  default.properties  res/  src/</code></p><p>Can you provide a sample <code>Makefile</code> how to build this project?</p>","259275","","","","","2011-04-28 16:05:00","Build android project from command line","<android><command-line><makefile>","2","0","1","",""
"2605999","1","2937505","","2010-04-09 08:34:52","27","29562","<p>While starting my application I get the following warning in Logcat:</p><pre><code>04-09 10:28:17.830: WARN/WindowManager(52): Exception when adding starting window04-09 10:28:17.830: WARN/WindowManager(52): android.view.InflateException: Binary XML file line #24: Error inflating class &lt;unknown&gt;04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2153)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2207)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1395)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:818)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:8794)04-09 10:28:17.830: WARN/WindowManager(52):     at android.os.Handler.dispatchMessage(Handler.java:99)04-09 10:28:17.830: WARN/WindowManager(52):     at android.os.Looper.loop(Looper.java:123)04-09 10:28:17.830: WARN/WindowManager(52):     at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:531)04-09 10:28:17.830: WARN/WindowManager(52): Caused by: java.lang.reflect.InvocationTargetException04-09 10:28:17.830: WARN/WindowManager(52):     at android.widget.FrameLayout.&lt;init&gt;(FrameLayout.java:79)04-09 10:28:17.830: WARN/WindowManager(52):     at java.lang.reflect.Constructor.constructNative(Native Method)04-09 10:28:17.830: WARN/WindowManager(52):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)04-09 10:28:17.830: WARN/WindowManager(52):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)04-09 10:28:17.830: WARN/WindowManager(52):     ... 13 more04-09 10:28:17.830: WARN/WindowManager(52): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x1010059 a=-1}04-09 10:28:17.830: WARN/WindowManager(52):     at android.content.res.Resources.loadDrawable(Resources.java:1677)04-09 10:28:17.830: WARN/WindowManager(52):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)04-09 10:28:17.830: WARN/WindowManager(52):     at android.widget.FrameLayout.&lt;init&gt;(FrameLayout.java:91)04-09 10:28:17.830: WARN/WindowManager(52):     ... 17 more</code></pre><p>My Application starts with the following splash screen: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:windowBackground=""@color/white"" android:background=""@color/white""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:foregroundGravity=""center""&gt;    &lt;ImageView android:id=""@+id/ImageView01""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:adjustViewBounds=""true"" android:scaleType=""centerInside""        android:src=""@drawable/splash"" android:layout_gravity=""center"" /&gt;&lt;/ScrollView&gt;</code></pre><p>Splash is the image that is shown in the splash screen. I have those four folders with for storing drawables in my app: </p><p>/res/drawable-hdpi<br>/res/drawable-ldpi<br>/res/drawable-mdpi<br>/res/drawable-nodpi  </p><p>the splash image has its own version in the first three of them and is displayed properly.Removing the src property from the ImageView removes the image but not the exception.</p><p>I'm a little bit lost with where to look for the cause of the exception. I even don't know if this is really an issue in this layout file etc. </p><p>How would you go about finding the cause for this warning? </p>","114066","","114066","","2012-02-02 13:03:59","2013-12-04 19:01:45","Android: How to track down the origin of a InflateException?","<android><debugging><android-layout>","5","3","1","",""
"2606470","1","2609444","","2010-04-09 10:00:33","21","6654","<p>If changing the orientation of my phone or the emulator I get the following output in LogCat:</p><pre><code>04-09 11:55:26.290: INFO/WindowManager(52): Setting rotation to 1, animFlags=004-09 11:55:26.300: INFO/ActivityManager(52): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2 layout=18}04-09 11:55:26.460: INFO/UsageStats(52): Unexpected resume of client while already resumed in client04-09 11:55:26.579: INFO/SearchPosition(807):  Activity is paused04-09 11:55:26.689: INFO/SearchPosition(807):  Activity is resuming</code></pre><p>SearchPosition is the activity that is displayed. Activity is paused is written in the onPause Method and Activity is resuming in the onResume method of the activity.</p><p>I googled a little bit for the error message but I don't fully understand the meaning of it. I think it could mean that the old Activity is not properly destroyed after changing the screen orientation. </p><p>Is this correct? If yes what causes the error?If this is not correct? What is the meaning of this output?</p>","114066","","","","","2011-11-08 15:47:56","Unexpected resume of ""package name"" while already resumed in ''package name"" Error in Android","<android><activity><lifecycle>","3","5","7","",""
"2606937","1","2607308","","2010-04-09 11:22:32","2","2276","<p>I have to admit that I'm new to Java and Android. db4o seems to be an excellent DB framework to replace SQLite <a href=""http://developer.db4o.com/Platforms/Java/Android.aspx"" rel=""nofollow"">http://developer.db4o.com/Platforms/Java/Android.aspx</a>. I want to use it for my Android application. I don't know how to: Import/Install/Attach/Upload db4o to Android phone. Where should I put the JAR file db4o-7.12.132.14217-all-java5.jar so that it was uploaded to Android phone and it could be called from the application? Please kindly advise! Many thanks!!!</p><h2>EDIT</h2><p>In addition to the answer, here goes the official documentation:<a href=""http://developer.db4o.com/Documentation/Reference/db4o-7.4/net2/reference/html/reference/platform_specific_issues/android.html"" rel=""nofollow"">http://developer.db4o.com/Documentation/Reference/db4o-7.4/net2/reference/html/reference/platform_specific_issues/android.html</a></p>","128028","","128028","","2010-04-09 12:58:22","2010-04-09 12:58:22","How to install and use db4o for Android?","<java><android><persistence><db4o>","1","0","4","",""
"2607020","1","","","2010-04-09 11:36:51","3","7922","<p>I'd like to construct a multipart request, with the following parameters: name (string), email (string), and fileupload (file). I'm using the Java code below (working in Android). </p><p>The httppost.getRequestLine() prints </p><pre><code>POST http://www.myurl.com/upload HTTP/1.1</code></pre><p>So everything looks good on the client site, but my server (Django/Apache) reads it as a GET request, with no GET parameters - <code>request.method</code> produces 'GET', <code>request.GET.items()</code> produces an empty dictionary.</p><p>What am I doing wrong? I don't know actually how to set the multipart parameters correctly - am using guesswork - so it's possible that that's the problem. </p><pre><code>public void SendMultipartFile() {  Log.e(LOG_TAG, ""SendMultipartFile"");  DefaultHttpClient httpclient = new DefaultHttpClient();  HttpPost httppost = new HttpPost(""http://www.myurl.com/upload"");  File file = new File(Environment.getExternalStorageDirectory(),  ""video.3gp"");  Log.e(LOG_TAG, ""setting up multipart entity"");  MultipartEntity mpEntity = new MultipartEntity();  ContentBody cbFile = new FileBody(file);  mpEntity.addPart(""fileupload"", cbFile);  Log.i(""SendLargeFile"", ""file length = "" + file.length());  try {   mpEntity.addPart(""name"", new StringBody(name));   mpEntity.addPart(""email"", new StringBody(email));;  } catch (UnsupportedEncodingException e1) {   // TODO Auto-generated catch block   Log.e(LOG_TAG, ""UnsupportedEncodingException"");   e1.printStackTrace();  }  httppost.setEntity(mpEntity);  Log.e(LOG_TAG, ""executing request "" + httppost.getRequestLine());  HttpResponse response;  try {   Log.e(LOG_TAG, ""about to execute"");   response = httpclient.execute(httppost);   Log.e(LOG_TAG, ""executed"");   HttpEntity resEntity = response.getEntity();   Log.e(LOG_TAG, response.getStatusLine().toString());   if (resEntity != null) {    System.out.println(EntityUtils.toString(resEntity));   }   if (resEntity != null) {    resEntity.consumeContent();   }  } catch (ClientProtocolException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } }</code></pre>","267831","","","","","2014-04-11 16:36:39","Help constructing a POST request with MultipartEntity (newbie question)","<android><django><file-upload><httpclient><multipart>","2","1","0","",""
"2607132","1","2607282","","2010-04-09 11:55:54","3","5030","<p>I'm writing my first android app (I'm a noob at android, but decent at java). The first screen of the app consists of a huge list (about 1.5K items) of Manga-objects. The code I use is as following:</p><p><em>main.xml:</em></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;ListView android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            android:id=""@+id/android:list""&gt;&lt;/ListView&gt;        &lt;TextView android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            android:text=""@string/list_no_items""            android:id=""@+id/android:empty""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p><em>row.xml:</em></p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01""              android:layout_width=""fill_parent""               android:layout_height=""?android:attr/listPreferredItemHeight""              android:padding=""6dip""              xmlns:android=""http://schemas.android.com/apk/res/android""&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""        /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""             android:id=""@+id/bottomtext""            android:singleLine=""true""            android:ellipsize=""marquee""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Then I have a adapter which basically takes a Manga-object and puts it's name in the rows toptext, and it's latest updated date in the bottomtext. However, (this might be caused by the virtualization of the unit though), the result is really slow. Scrolling the list takes forever and you can only scroll small peaces of the time. How can I make the list work like the one in the contacts-app? So that when you start scrolling a handle pops out at the right side of the screen, and when you drag it letters shows up as of how far you've scrolled (the list is sorted alphabetically), and also, is there a way I could improve the performance of the list?</p>","213323","","","","","2010-04-09 12:19:30","Contact-app like scrollinglist on android","<android><listview>","1","0","1","",""
"2607371","1","2607406","","2010-04-09 12:31:36","2","1993","<p>I am trying to accomplish the task of </p><p>Making a Web request                              ->getting result in JSON format                                                                    ->Parsing the result                                                                                               -> and finally display the result in a table....</p><p>Any help regarding any of the task is welcome....</p>","303155","","29505","","2011-06-13 01:31:03","2011-06-13 01:31:03","Making a web request and getting request in JSON format in android","<android>","1","2","3","",""
"2607613","1","2607731","","2010-04-09 13:04:35","10","4765","<p>I'm writing an application wherein users will sometimes make orders through it.  I want to give users the option to save their billing info (name, address, etc.) so that it can be quickly restored later if they want to make another order.  The user will enter a password to secure the data.</p><p>Obviously I can't just put this as a file on the device, as anyone can root/find the data.  Is there a built-in Android method for storing secure data that is locked with a password?  If not, what is a good place to start for storing this data securely using Java?</p><p>Edit: To clarify, when I say that the user will enter a password, I don't mean that I've come up with a way to secure the data yet.  I'm just trying to convey the method with which the user will secure the data on their end; now I'm trying to figure out how to keep my end of the bargain.  :)</p>","60261","","60261","","2010-04-09 14:03:28","2013-03-15 10:41:10","Is there a way to securely store user data on an Android device?","<java><android><security>","3","3","7","",""
"2607698","1","","","2010-04-09 13:15:01","2","3149","<p>I don't know exactly how to explain this problem, but I'll try. I have a ListView with several items. Each item has inside a TextView and two ImageView. I want the ImageView change when I click on them, and I want to open a context menu when I press for a long time into the ListView item. </p><p>For the ImageView, everything works properly. For the whole item, I can show the context menu after a long press, but my problem is that the ImageView changes as well when I am pressing the TextView, for example.</p><p>Somo pieces of my code:</p><p>ListView item:</p><pre><code>     &lt;TextView       android:id=""@+id/title""      android:textColor=""@color/black""      android:maxLines=""2""      android:textSize=""14dip""             /&gt;    &lt;ImageView        android:id=""@+id/minus""        android:src=""@drawable/minusbutton""        android:adjustViewBounds=""true""        android:gravity=""center""    /&gt;    &lt;ImageView         android:id=""@+id/plus""        android:src=""@drawable/plusbutton""        android:adjustViewBounds=""true""        android:gravity=""center""    /&gt;</code></pre><p>Drawable to change the status of the plus button:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_enabled=""false""      android:drawable=""@drawable/button_add_normal_disabled"" /&gt;&lt;item android:state_enabled=""true""      android:state_pressed=""true""      android:drawable=""@drawable/button_add_pressed"" /&gt;&lt;item android:state_enabled=""true""      android:state_focused=""true""       android:state_pressed=""false""       android:drawable=""@drawable/button_add_active"" /&gt;&lt;item android:state_enabled=""true""      android:state_focused=""false""       android:state_pressed=""false""      android:drawable=""@drawable/button_add_normal"" /&gt;</code></pre><p></p><p>I hope you understand my problem. I think that all the children of a view are affected by an event in the parent, but I am not sure.</p><p>Do you have a solution? Thanks in advance </p>","312800","","","","","2012-09-04 17:54:52","Click in a ListView item changes status of elements inside the item?","<android><events><listview><click><listviewitem>","3","1","0","",""
"2607858","1","2614046","","2010-04-09 13:35:37","11","13627","<p>I want to create an application for Android that will be able to scan barcodes, get the information contained within the barcode and then be able to use that information in some way.</p><p>I have no idea how to create a barcode scanner so I went Googling and it seems Zxing is the most commonly used way to implement a barcode scanner in an app.</p><p>Some Links:</p><hr><p><a href=""http://code.google.com/p/zxing/"">http://code.google.com/p/zxing/</a></p><p><a href=""http://awalkingcity.com/blog/2008/08/25/qr-codes-made-easy-in-android/"">http://awalkingcity.com/blog/2008/08/25/qr-codes-made-easy-in-android/</a></p><p><a href=""http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app"">http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app</a></p><hr><p>However the samples I found on zxing involved having to prompt the user to go to the market and install the zxing barcode scanner so that my app can then call the barcode scanner when its needed and the barcode scanner will then return the info to my app.</p><p>While this would be a good starting point for me I was wondering is there any other options that would allow me to have a barcode scanner embedded in my own application without having to prompt the user to download a secondary application?</p>","243999","","","","","2013-03-12 17:42:00","Android - Barcode Scanning, Options? Zxing?","<java><android><barcode-scanner><zxing>","3","2","6","",""
"2607974","1","2609514","","2010-04-09 13:51:12","1","483","<p>I'm trying to build an offline web application which can sync online if the network is available. I tryed <a href=""http://code.google.com/p/jquery-jstore/"" rel=""nofollow"">jQuery jStore</a> but the test page stop at ""testing..."" whitout result, then I tryed <a href=""http://code.google.com/apis/gears/api_database.html"" rel=""nofollow"">Google Gears</a> which is supposed to be working on the phone but it is not found.</p><pre><code> if (window.google &amp;&amp; google.gears) {  google.gears.factory.getPermission();  // Database  var db = google.gears.factory.create('beta.database');  db.open('foobar');  db.execute('create table if not exists Lectures' +           ' (ID_COMPTEUR int, DATE_HEURE timestamp, kWh float, Wmax float, VAmax float, Wcum float, VAcum float);'); }else{alert('Google Gears non trouvé.');      }</code></pre><p>the code does work on Google Chrome v5.</p><p><strong>[edit]</strong></p><p><code>alert(window.google);</code> on the phone is undefined, but is an object in Chrome.</p><p><code>alert(google.gears);</code> does nothing on the phone and jam the javascript, but is an object in Chrome.</p><p><strong>[edit 2]</strong></p><p>in the phone configuration, gears is activated.</p><p><strong>[edit 3]</strong></p><p>to be clear, you have to use google.gears database on Android 1.5, and html5's localStorage on Android 2.x</p>","286557","","286557","","2010-07-05 15:34:15","2010-07-05 15:34:15","Android v1.5 w/ browser data storage","<javascript><jquery><android><offline><jstore>","1","0","","",""
"2608133","1","2608351","","2010-04-09 14:10:02","1","468","<p>I have a intent receiver in my android manifest, but would like to give the user the opportunity to choose whether he/her wants the app to automatically start at the specific state. Until now, I've used a service with a broadcast receiver, but I really want to delete this service as it seems a bit unnecessary.</p><p>Can register the intent action only if the user wants it (I guess not)? If not, should I make a class that will be called every time the intent is received and checks the user's preference or should I keep the service?</p><p>Thank you very much</p>","236130","","","","","2010-04-09 14:44:03","Intent receiver according to preference","<android><android-intent><broadcastreceiver><intentfilter>","1","0","1","",""
"2608210","1","2608363","","2010-04-09 14:21:23","14","6896","<p>In my App, first it shows a splash screen. after that another activity, then my main activity must be show. this is my design plan. the second activity(i.e before main activity) must be show for the first time user of the app. if he/she closes the app.splash screen will redirect to main activity automatically. how to do this ? Any Idea? i am developing my app for android phones.</p>","267269","","60261","","2010-04-09 14:49:23","2012-02-05 17:56:07","how to check the first time user of my App in android?","<java><android>","3","0","4","",""
"2608350","1","2608444","","2010-04-09 14:43:55","0","410","<p>In one of my Android Application I need to keep the title bar same but the view that is shown in the rest of the screen changes. So, I have taken different Activity for all the views that I need to show and set the title bar in every Activities onCreate method.</p><p>Now, the problem is that I have a button in the title bar and need to perform certain action on its click event. Writing the same event handling code in every Activity class is very cumbersome. Is there any other way out that whenever there is a click event on that button of the title bar then we can have the same functionality without writing the same code in all the Activity classes.</p><p>Can we use ViewGroup for that? I don't have much idea about ViewGroup. Is that possible with ViewGroup?</p><p>If anyone knows the solution then please let me know.</p><p>Thanks &amp; RegardsSunil</p>","261566","","1016716","","2012-04-29 16:43:11","2012-04-29 16:43:11","Same Title Bar but different View below it in Android?","<android><button><activity>","1","0","","",""
"2608452","1","2608567","","2010-04-09 14:55:38","3","3254","<p>I have an app that requires user to register. I've got the app conected to PHP in my server to do the logic of register/login and so, this is not problem at all.</p><p>But, I want to keep a session of the user in local, so the user doesn't have to login again every time he runs the app.</p><p>So, I want something like this:</p><ul><li>First time user, he opens the app, register and login.</li><li>Do some stuff with the app and closes it.</li><li>Open the app again, the user is recognized so he doesn't need to login again.</li></ul><p>I only need to store an ID and a Username (both fetched from the DB in the login php method). What's the best way to do this??</p><p>I've thought about doing a custom preference, store the data in files or even a local DB (sqlite). Any suggestions?</p>","309853","","","","","2012-03-27 11:40:36","How to keep the session of user login?","<java><android><session><user>","1","0","6","",""
"2608478","1","","","2010-04-09 14:58:51","4","8354","<p>I want to create an application that runs on Android and uses Raw Sockets.  I see there isn't any raw socket support in the java.net.* or the android.net.* libraries.  Are raw sockets possible on Android?</p>","312892","","","","","2012-10-26 09:00:51","Raw Sockets on Android","<android><sockets>","2","0","4","",""
"2608633","1","2608796","","2010-04-09 15:21:31","0","636","<p>I want to add support for Arabic (or other languages which are currently unsupported) to the applications supplied by android platform (e.g. Browser) without the need of having root-access.</p><p>To add Arabic support (at least displaying only) in a <strong><em>normal application (using developer SDK</em></strong>), I will need to:  </p><ol><li>Add fonts</li><li>Modify (reshape) the characters to be rendered<br>For illustration, if I have string <code>a aaa</code>, I will need to change <code>a aaa</code> into <code>a bcd</code> because letter <code>a</code> at the beginning, middle, and end of a word need to be changed to <code>b</code>,<code>c</code> and <code>d</code> respectively)  </li></ol><p>But now I want to compile <strong><em>android's Browser (and other apps)</em></strong>. I am planning to get the source codes for these applications and their dependencies and bundle them as stand-alone applications which do not require root-access, and thus do not void the warranty. Other solutions which void the warranty can be obtained <a href=""http://code.google.com/p/arabicandroid/downloads/list"" rel=""nofollow"">here</a>.</p><p>My Questions:  </p><ol><li>Is the application's (e.g. Browser's) source code + 'developer SDK' enough to accomplish this? Do I need to get the source code + the development environment for the android platform?</li><li>Any tips?</li></ol>","109747","","109747","","2010-04-09 15:30:15","2010-04-09 16:49:53","How do I compile Android Browser (or other android-supplied applications)?","<android>","2","0","","",""
"2608656","1","2608749","","2010-04-09 15:26:27","2","2097","<p>I would like to implement the following simple pattern in an android app:</p><ol><li>Activity A starts activity B</li><li>In activity B the user fills out a simple form F, then hits submit</li><li>Activity B then starts an AsyncTask C that posts F to a url, and immediately returns to Activity A</li><li>Back in activity A, the user continues with business as usual while C is still working. But once C is complete, the user should be notified, in particular if the result was a failure.</li></ol><p>The problem I have is with steps 3 and 4. Since C is started by B, how can A get notified? Hmm, not sure if this is clear to anyone but me ...</p><p>Anyway, right now I am stuck with a solution where step 3 instead looks like this:</p><p>3"". Activity B returns the content of the form to activity A. A then starts AsyncTask C to post the form and continues as usual.</p><p>But it just seems a bit unnecessary that A also needs to handle the form, it should just be B's responsibility. Any other ideas or solutions out there?</p>","311681","","311681","","2010-04-09 16:55:59","2011-09-16 05:50:52","How does one implement an asynchronous http-post request in android?","<android><http><post><asynchronous>","3","0","2","",""
"2609114","1","2609435","","2010-04-09 16:27:10","10","33887","<p>I am having trouble getting my activity to generate a MotionEvent.ACTION_UP. Probably a beginner's error.</p><p>In LogCat, I'm only seeing the ACTION_MOVE event (which is an int value of 3). I also see the X/Y coordinates. No ACTION_DOWN and no ACTION_UP.</p><p>I looked everywhere for a solution. I found one question on a forum that seems to be the same as my issue, but no solution is proposed:<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/9a9c23e40f02c134/bf12b89561f204ad?lnk=gst&amp;q=ACTION_UP#bf12b89561f204ad"">http://groups.google.com/group/android-developers/browse_thread/thread/9a9c23e40f02c134/bf12b89561f204ad?lnk=gst&amp;q=ACTION_UP#bf12b89561f204ad</a></p><p>Here's my code:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.webkit.WebView;public class Brand extends Activity {public WebView webview;public float currentXPosition;public float currentYPosition;@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);    webview = new WebView(this);    setContentView(webview);    webview.loadUrl(""file:///android_asset/Brand.html""); }@Overridepublic boolean onTouchEvent(MotionEvent me) {    int action = me.getAction();    currentXPosition = me.getX();    currentYPosition = me.getY();    Log.v(""MotionEvent"", ""Action = "" + action);    Log.v(""MotionEvent"", ""X = "" + currentXPosition + ""Y = "" + currentYPosition);    if (action == MotionEvent.ACTION_MOVE) {         // do something    }    if (action == MotionEvent.ACTION_UP) {         // do something    }    return true;  }}</code></pre>","295021","","295021","","2010-04-09 16:29:47","2011-02-15 16:09:56","Android beginner: understanding MotionEvent actions","<android>","2","1","4","",""
"2609742","1","2609869","","2010-04-09 18:06:40","2","3044","<p>How can I best implement a system for send keystrokes/commands via an iPhone and/or Droid to a desktop or laptop computer via WiFi or bluetooth? There are apps for VLC, Keynote and other applications that do this, so I know it's possible but don't know what technology base to use. </p><p>The implementation is probably different on Windows and OS X, but if they could be similar that'd be a big win.</p><p>If VNC-type technology is used, that'd be fine but I only need to send key commands and mouse clicks—I don't need to be able to navigate the screen space.</p>","230571","","230571","","2010-04-09 18:18:45","2010-04-09 18:32:17","iPhone/Android: How to Send Keystrokes To Laptop Over Wifi?","<iphone><android><bluetooth><wifi>","2","1","1","",""
"2609749","1","2724664","","2010-04-09 18:07:23","3","2623","<p>I have some sensitive data that is stored in SQLite for an Android app. I need to be able to encrypt when persisting but then also decrypting when deserializing from the database too. Not sure what my options are on Android for doing this?</p>","246793","","918414","","2012-06-30 04:26:29","2013-07-31 12:34:38","Need suggestions for a good way to encrypt/decrypt data stored in SQLite database on Android","<database><android><sqlite><encryption>","6","0","","",""
"2610008","1","2610212","","2010-04-09 18:47:02","2","8653","<p>I've implemented a Class that extends Overlay and also override the onTap / onTouchEvent (tried both).  </p><p>Right now it seems like that event is triggered when you tap on the map regardless of position.<br>How can I make sure that the event is triggered only when you tap over the overlay you have added?</p><p>Thanks,<br>Tee</p>","166940","","","","","2010-04-14 08:21:27","Android - Map overlay onTouchEvent / onTap howto?","<android>","1","0","3","",""
"2610055","1","2610165","","2010-04-09 18:53:12","2","1764","<p>I have a ListView in a ListActivity populated with strings. However, only the text-part of a list item is clickable, and when it is clicked, only the text-part is highlighted (orange on black background). I would like to make the full line clickable, and when selected, the full line should be marked as selected.</p><p>How can I do that? This 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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical"" &gt;    &lt;TextView        android:id=""@+id/TextViewLocationMode""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""-"" &gt;    &lt;/TextView&gt;    &lt;TextView        android:id=""@+id/TextViewStatus""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Statustekst"" &gt;    &lt;/TextView&gt;    &lt;ListView        android:id=""@android:id/list""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:choiceMode=""singleChoice""        android:clickable=""true""        android:fadeScrollbars=""true""        android:isScrollContainer=""true""        android:longClickable=""true"" &gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","1507543","","935627","","2012-09-22 01:40:08","2012-09-22 01:40:08","How can I make a ListView touch-sensitive in its full width for clicking an item?","<java><android><android-listview>","1","0","1","",""
"2610320","1","","","2010-04-09 19:32:52","4","2166","<p>I have a widget that will open the contacts list by a phone number.  I am using *Contacts.Intents.SHOW_OR_CREATE_CONTACT*I know it's deprecated but I want this to work on android 1.6.  I have a phone number to use on the lookup intent.  here is the code</p><pre><code>Intent contViewIntent = new Intent(Contacts.Intents.SHOW_OR_CREATE_CONTACT);contViewIntent.setData(Uri.fromParts(""tel"", number, null));PendingIntent contPendIntent = PendingIntent.getActivity(context, 0, contViewIntent, 0);views.setOnClickPendingIntent(viewID, contPendIntent);</code></pre><p>When the Contact list has 2 or more contacts with the same number then this will open the list of contacts and has the user select one.  This works fine on 1.6, but on 2.0 and above it shows a list of contacts with just the number 1 or number 2 in the names and when you select one of those from the list to view you get an error.</p><blockquote>  <p>04-09 19:12:47.891:  ERROR/CursorWindow(105): Bad request  for field slot 0,6. numRows = 2,  numColumns = 6</p>    <p>04-09 19:12:47.992:  ERROR/AndroidRuntime(105):  java.lang.IllegalStateException: get  field slot from row 0 col 6 failed</p></blockquote><p>how do I get this to work on 1.6 and 2.0 above?</p>","313117","","313117","","2010-04-16 22:04:44","2011-04-08 01:18:03","Android - Show list of contacts with same phone number","<android><widget><contacts>","2","1","0","",""
"2610384","1","","","2010-04-09 19:41:18","15","14401","<p>I am trying to add badges to the icons in my android app. e.g. in the facebook app(for iPhone), in the home page the number of pending requests is shown on the requests icon.</p><p>Can someone provide any links/ideas on how to do this?</p><p>Thanks</p>","310287","","","","","2014-03-25 11:28:53","Android: add badge to icons internal to my app","<java><android><eclipse>","6","0","8","",""
"2610454","1","2611525","","2010-04-09 19:49:18","1","864","<p>I was looking at the Google Map API for the first time and I had a quick question. I am woking on an Android application and I was wondering if there is a good way to take a route that I have created using Google Maps (snapping to roads) and use the API display this route on an Android application? </p><p>I see that there is a way to generate images overlayed with polylines created with coordinates but it seems like it would be tought to create a polyline for something like a curved road. </p><p>Thanks,Rob</p>","289153","","","","","2010-04-09 23:10:05","Using the Google Maps API in a Android application","<android><google-maps>","1","0","","",""
"2610473","1","","","2010-04-09 19:51:28","6","11664","<p>I have been struggling with getting the versionName for a running application from the PackageInfo Object type.</p><p>I have constructed a Parcelable Interface with all of the fields associated with the PackageInfo Object type.  The primary input for that interface method is a Parcel object.</p><p>I cannot seem to figure out how to correctly associate these Parcelable, Parcel, and PackageInfo objects. </p><p>Is there any sample code out there that I can look at?  Doesn't seem like it should be that difficult but it seems to be stumping me.</p><p>ThanksJazz</p>","313135","","","","","2012-04-11 01:57:00","Trying to get Package Version Information to display in an ""About"" message","<android>","4","2","3","",""
"2610522","1","2610548","","2010-04-09 20:00:53","0","204","<p>Is there anyway to get the actual images used in resources? e.g., I want the two png files in CheckBox in starstyle? Which directory does andorid keep them?</p>","253800","","","","","2010-04-09 20:04:25","android: where are the image resources allocated?","<android><image><resources>","1","0","","",""
"2610536","1","","","2010-04-09 20:03:12","1","2472","<p>I want my widget to update when the phones orientation has changed.  Before android 2.0 you could register your widget to get the intent on orientation change</p><pre><code>&lt;intent-filter&gt;   &lt;action android:name=""android.intent.action.CONFIGURATION_CHANGED"" /&gt;&lt;/intent-filter&gt;</code></pre><p>but after 2.0 you cannot do it. Android Dev doc says:</p><blockquote>  <p>You can not receive this through  components declared in manifests, only  by explicitly registering for it with  Context.registerReceiver().</p></blockquote><p>Good advice to try to register it, but you can not register a receiver in a AppWidgetProvider.</p><p>I just want to know when the phone switches orientation so I can show some text correctly to the user when I run low on vertical space.</p>","313117","","","","","2010-10-06 20:34:48","Android - How to get a widget to recognize when the phones orientation has changed","<android><widget><orientation><intentfilter>","1","3","1","",""
"2610566","1","","","2010-04-09 20:07:25","3","2885","<p>I was wondering if anyone knew the proper way to send an SMS message to an e-mail address using Verizon's CDMA Motorola Droid phone. </p><p>The internal messaging application appears to automagically do this. While 3rd party applications like SMSPopup don't seem to be able to properly reply to e-mail addresses unless you compose the message inside the messaging application. </p><p>When the internal messaging application sends a SMS message there's a corresponding <code>'RIL_REQUEST_CDMA_SEND_SMS'</code> entry in the logcat (<code>adb logcat -b radio</code>). When you send a SMS to an e-mail address it prints the same thing, so behind the scenes it looks as though it is sending an sms. The interesting thing is that if you look at the content provider sent box the messages are addressed to various 1270XX-XXX-XXXX numbers.</p><p>On other services you can send e-mail addresses by sending a SMS to a predefined short sms number. And then formatting your SMS as emailaddress subject messagei.e. <a href=""http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_SMS_to_E-Mail_Gateways"" rel=""nofollow"">http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_SMS_to_E-Mail_Gateways</a></p><p>For example, using T-mobile's number (500) you can send a SMS to an e-mail using the following:</p><pre><code>SmsManager smsMgr = SmsManager.getDefault();smsMgr.sendTextMessage(""500"", null, ""username@domain.com message sent to an e-mail address from a SMS"", null, null);</code></pre><p>Does anyone know if </p><ul><li>It is possible to programatically send SMS to email messages from a CDMA Android phone?</li><li>Does Verizon actually send your replies as SMS messages or are they actually sent as MMS or normal http email messages?</li><li>Any ideas about how to intercept what the raw message being sent to see what's going on?</li></ul><p>It might be possible that Verizon somehow generates a fake number temporarily tied to an e-mail address (since repeated messages are not sent to the same number). But, that seems pretty heavy handed.</p><p>Thanks!</p>","306093","","","","","2012-04-22 00:16:00","Programatically send SMS to email using Verizon Motorola Droid on Android","<android><email><sms><gateway><motorola-droid>","2","0","0","",""
"2610587","1","2610643","","2010-04-09 20:10:33","4","11359","<p>I want to answer a phone call. I found the intent <code>android.intent.action.ANSWER</code> but it seems that the only effect that I obtain is an ActivityNotFoundException. Why? Is it a deprecated intent? How can I achieve answer? I have also heard about the ""telnet technique"". What is that?</p><p>Thanks</p>","269585","","1288","","2010-08-20 17:48:00","2013-04-25 21:50:11","How to programmatically answer a call?","<android><android-intent>","7","0","4","",""
"2610783","1","","","2010-04-09 20:44:16","11","3789","<p>I'm a bit new to all of this, so bear with me - I'd really appreciate your help.  </p><p>I am trying to link the Android Nexus One with an arduino (Duemilanove) that is connected to a BlueSmirf.  I have a program that is simply outputting the string ""Hello Bluetooth"" to whatever device the BlueSmirf is connected to.  Here is the Arduino program:</p><p>void setup(){  Serial.begin(115200);  int i;}</p><p>void loop(){Serial.print(""Hello Bluetooth!"");delay(1000);}</p><p>One my computer BT terminal I can see the message and connect no problem.  The trouble is with my android code.  I can connect to the device with android, but when I look at the log it is not displaying ""Hello Bluetooth"".  Here is the debug log:</p><p><br>04-09 16:27:49.022: ERROR/BTArduino(17288): FireFly-2583 connected<br>04-09 16:27:49.022: ERROR/BTArduino(17288): STARTING TO CONNECT THE SOCKET<br>04-09 16:27:55.705: ERROR/BTArduino(17288): Received: 16<br>04-09 16:27:56.702: ERROR/BTArduino(17288): Received: 1<br>04-09 16:27:56.712: ERROR/BTArduino(17288): Received: 15<br>04-09 16:27:57.702: ERROR/BTArduino(17288): Received: 1<br>04-09 16:27:57.702: ERROR/BTArduino(17288): Received: 15<br>04-09 16:27:58.704: ERROR/BTArduino(17288): Received: 1<br>04-09 16:27:58.704: ERROR/BTArduino(17288): Received: 15</p><p>ect...</p><p>Here is the code, I'm trying to put only the relative code but if you need more please let me know:</p><pre><code>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"");        InputStream inStream = null;        boolean run = false;        //...More Connection code here...</code></pre><p>The more relative code is here:</p><pre><code>        byte[] buffer = new byte[1024];        int bytes;        // handle Connection        try {            inStream = mySocket.getInputStream();            while (run) {                try {                    bytes = inStream.read(buffer);                    Log.e(TAG, ""Received: "" + bytes);                } catch (IOException e3) {                    Log.e(TAG, ""disconnected"");                }            }</code></pre><p>I am reading bytes = inStream.read(buffer).  I know bytes is an integer, so I tried sending integers over bluetooth because ""bytes"" was an integer but it still didn't make sense.  </p><p>It almost appears that is sending incorrect baud rate.  Could this be true?</p><p>Any help would be appreciated.  Thank you very much.</p>","313172","","","","","2010-07-28 19:53:35","Interfacing Android Nexus One with Arduino + BlueSmirf","<android><bluetooth><arduino><bluesmirf>","3","1","","",""
"2610786","1","2611167","","2010-04-09 20:44:27","1","4136","<p>I couldn't find a single query that would give me in API 2.0 of the contacts API the URI of the contact's image and the display name.  </p><p>For now as far as  i know i can create a URI by having the contact's _ID , but i didn't see any row name that i can use in the projection of Data or Contact to get all that i need.  </p><p>(i refer to using API 2 of the contacts API on android SDK V5 and above )</p><p>10x.</p>","312288","","73652","","2011-12-19 15:36:18","2011-12-19 15:36:18","Contacts query with name and picture URI","<android><image><uri><contacts>","1","0","4","",""
"2610995","1","2612365","","2010-04-09 21:16:59","16","4933","<p>This question has been asked(and answered) many times about dynamically generating and loading java bytecodes at runtime into a running Dalvik VM, but is there any way to load dex files/bytecodes into an app at runtime?</p><p>Thanks</p>","109965","","","","","2012-05-21 11:12:22","Dynamically Generating Dalvik Bytecode into a running Dalvik/Android application","<android><dalvik>","5","0","9","",""
"2611105","1","2611219","","2010-04-09 21:35:49","6","5513","<p>Im using an ant build file that has been generated by android. Our Android application requires a JAR file that lives inside the lib folder of our project, so I need to adjust the classpath that ant is using when it builds stuff.</p><p>When I run:</p><pre><code>ant -lib lib debug</code></pre><p>the project builds just fine, but this should really be inside the build file itself. The build file that android generates references the android_rules.xml so a lot of this stuff is automated. I guess my question, what the best practice here when working with the Android build rules ? </p>","246793","","","","","2010-04-09 22:00:21","How to specify lib folder for JARs when using Android-generated ant build file?","<xml><android><ant><build>","1","0","","",""
"2611143","1","","","2010-04-09 21:43:14","2","495","<p>I am trying to make a webview to open on the bottom of the application to display little information but it keeps taking the whole screen and covering other widgets with information.Is there a way to make it have a certain size and place on the application?</p>","338522","","","","","2011-02-20 02:36:49","Can I make the webview take only a port of the screen?","<android><size><webview>","1","1","","",""
"2611434","1","","","2010-04-09 22:43:07","3","1053","<p>Alright, so because of <a href=""http://stackoverflow.com/questions/2456861/android-get-the-scroll-position-of-a-webview"">this question</a> which I asked previously, I found out that you cannot know the scroll position of a WebView. I followed advice to put my content in a ListView instead. There's now a new problem.</p><p>All I am trying to do is tell when a certain part of the view scrolls past the bottom edge and the top edge of the screen. When the image appears at the bottom of the screen or disappears above the top of the screen, i want to play a sound effect.</p><p>Here's my code using a ListView. The problem is that onScroll is not consistently called. It seems like it's called only if I lift my finger and wait, then start scrolling again.</p><p>At the same time, onScrollStateChanged isn't always called either---it seems to only be called on the first frame of the scroll.</p><p>Isn't there some way to just continuously get scrolling information on every single frame of the scroll, regardless of whether I'm touching the screen? I just want to know whether the scroll animation has been activated, even if it's one pixel, so that I can look at the position of the image element and see whether it's on screen or not.</p><pre><code>public class Scroll extends ListActivity implements ListView.OnScrollListener {    public  ListView        listview;    public int firstItemOnScreen;    public int lastItemOnScreen;    public int previousFirstItemOnScreen;    public int previousLastItemOnScreen;    private TextView mStatus;    private boolean mBusy = false;     //     // Will not bind views while the list is scrolling     //     //    private class SlowAdapter extends BaseAdapter {        private LayoutInflater mInflater;        public SlowAdapter(Context context) {            mContext = context;            mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        }         //         // 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 0;//mStrings.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) {            TextView text;            if (convertView == null) {                text = (TextView)mInflater.inflate(android.R.layout.simple_list_item_1, parent, false);            } else {                text = (TextView)convertView;            }            if (!mBusy) {                //text.setText(mStrings[position]);                // Null tag means the view has the correct data                text.setTag(null);            } else {                text.setText(""Loading..."");                // Non-null tag means the view still needs to load its data                text.setTag(this);            }            return text;        }         //         //Remember our context so we can use it when constructing views.         //        private Context mContext;    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ImageListAdapter ila = new ImageListAdapter(this);        // Add four items        ila.addItem(new ImageList(               """", getResources().getDrawable(R.drawable.header)));        ila.addItem(new ImageList(               ""Test text"", null));        ila.addItem(new ImageList(                """", getResources().getDrawable(R.drawable.interstitial1)));        ila.addItem(new ImageList(               ""Test text"", null));        // Display it        setListAdapter(ila);        getListView().setOnScrollListener(this);    }    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,            int totalItemCount){        firstItemOnScreen = getListView().getFirstVisiblePosition();        lastItemOnScreen = getListView().getLastVisiblePosition();        Log.v(""List"", ""first:"" + firstItemOnScreen);        Log.v(""List"", ""last:"" + lastItemOnScreen);        // Bottom edge appears at top of screen        if (firstItemOnScreen == 2 &amp;&amp; previousFirstItemOnScreen != 2) {            tvt.playEffect(2, 0);        }        // Top edge appears at top of screen        // AND        // Bottom edge appears at bottom of screen        if (firstItemOnScreen == 1 &amp;&amp; lastItemOnScreen == 3) {            if (lastItemOnScreen != previousLastItemOnScreen || firstItemOnScreen != previousFirstItemOnScreen)                tvt.playEffect(2, 0);        }        // Top edge appears at bottom of screen        if (lastItemOnScreen == 2 &amp;&amp; previousLastItemOnScreen != 2) {            tvt.playEffect(2, 0);        }        if (firstItemOnScreen == 3 &amp;&amp; previousFirstItemOnScreen == 2)            tvt.playEffect(2, 0);        if (previousLastItemOnScreen == 3 &amp;&amp; lastItemOnScreen == 2)            tvt.playEffect(2, 0);        if (previousFirstItemOnScreen == 1 &amp;&amp; firstItemOnScreen == 2 &amp;&amp; previousLastItemOnScreen == 3 &amp;&amp; lastItemOnScreen == 3)            tvt.playEffect(2, 0);        if (firstItemOnScreen == 1 &amp;&amp; previousFirstItemOnScreen == 1) {            if (lastItemOnScreen ==1 &amp;&amp; previousLastItemOnScreen == 2)                tvt.playEffect(2, 0);        }        previousFirstItemOnScreen = firstItemOnScreen;        previousLastItemOnScreen = lastItemOnScreen;    }    public void onScrollStateChanged(AbsListView view, int scrollState) {        switch (scrollState) {        case OnScrollListener.SCROLL_STATE_IDLE:            mBusy = false;            int count = view.getChildCount();            for (int i=0; i&lt;count; i++) {                ImageListView t = (ImageListView)view.getChildAt(i);                if (t.getTag() != null) {                    t.setTag(null);                }            }            break;        case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:            mBusy = true;            break;        case OnScrollListener.SCROLL_STATE_FLING:            mBusy = true;            break;        }    }</code></pre>","295021","","82118","","2010-07-22 22:33:34","2010-07-22 22:33:34","Android: more scrolling woes","<android>","1","0","2","",""
"2611543","1","","","2010-04-09 23:16:28","1","2562","<p>I want to customize list view item spaces between different items. We generally display list item with default space between them to get viewed in list.I want to customize the space difference between them so that more data can be displayed in the list within the display part at a time.</p><p>Please provide me some solution .</p><p>Thanks in adv.Praween</p>","292605","","1930148","","2013-01-19 03:28:17","2013-01-19 03:28:17","how to customize list view item spaces between them?","<android><android-layout><android-listview><listviewitem>","2","0","","",""
"2612291","1","","","2010-04-10 04:53:55","1","417","<p>I want to set unique key constraint for Db4oEmbedded EmbeddedConfiguration.</p><p>Here goes my code:</p><pre><code>EmbeddedConfiguration myConf = Db4oEmbedded.newConfiguration();myConf.common().objectClass(NotyUser.class).objectField(""username"").indexed(true);myConf.common().add(new com.db4o.constraints.UniqueFieldValueConstraint(NotyUser.class, ""username""));</code></pre><p>The last line throws exception. I don't know why. I'm running Android SDK 1.5 and db4o 7.12 for Java. Please kindly advise. Thanks!</p>","128028","","","","","2010-05-24 09:51:18","Setting unique key constraint for Db4oEmbedded EmbeddedConfiguration","<java><android><db4o><unique-constraint>","1","0","1","",""
"2612576","1","4796312","","2010-04-10 07:05:51","7","2781","<p>I am after a very lightweight template engine that supports / can be embedded inside Android programs. I've looked at the MiniTemplator (I think that is how you spell it) and that looks great but it loads in only from file and I need to load templates from string and I am not fully confident in changing that code lol.</p><p>Can anyone recommend a very lightweight (preferably no jars, single source files etc) that I can use ? I do not need it to parse XML or anything like, just normal HTML files with keywords embedded into them betwee %% tags etc.,</p>","298882","","421372","","2013-08-26 06:25:53","2013-10-26 03:38:35","Android Lightweight HTML Template Engine","<java><html><android><templates><lightweight>","2","3","1","",""
"2612581","1","","","2010-04-10 07:09:23","0","2622","<p>I'm using a ListView with CheckBox, but as most of you know, when you roll down the scroll, a checked CheckBox gets unchecked as you roll up back the scroll. So i've been reading and i found out that you can pass (using getView) the id of the CB to the position parameter of getView to save the CheckBox state!</p><p>But i can't use getView with SimpleCursorAdapter, can i? Because i'm using bindView!</p><p>Thanks</p>","2443607","","","","","2011-01-24 22:09:33","CheckBox checked state in a ListView","<android><listview><checkbox>","2","2","","",""
"2612940","1","2614404","","2010-04-10 10:01:00","2","1394","<p>In my android app, I'm setting an alarm that I want to occur repeatedly, hence using AlarmManager.setRepeating().</p><p>I don't want to keep track of whether the alarm is set myself (sounds like a bad idea that's prone to fail at some point), and there seems to be no API support for checking whether a particular alarm is already set for a given Intent.</p><p>Hence, I am pessimistically resetting the alarm each time my app activates:</p><pre><code>alarmManager.cancel(pendingIntent);...alarmManager.setRepeating(..., pendingIntent); </code></pre><p>Question: is calling setRepeating() idempotent i.e. do I need to explicitly cancel() any prior alarm or can I safely just call setRepeating() and be done with it?  </p>","6329","","","","","2010-04-10 18:18:54","Is AlarmManager.setRepeating idempotent?","<android><alarmmanager>","1","0","","",""
"2612999","1","2613283","","2010-04-10 10:18:24","0","1567","<p>I'm trying to update/change contact ringtone using this code:</p><pre><code>ContentValues values = new ContentValues();values.put(ContactsContract.Data.CUSTOM_RINGTONE, ""D:/TempDownloads/BurpSounds/Alex.wav"");getContentResolver().update(ContactsContract.Contacts.CONTENT_URI, values , ""DISPLAY_NAME = 'Ani'"", null);</code></pre><p>I get the message: "" the application has stopped unexpectedly""</p><p>what is wrong with my code and how do I do it?</p><p>thanks</p><p>I managed to use logcat and ddms here is the log:</p><pre><code>04-10 13:47:45.419: ERROR/AndroidRuntime(399): Caused by: java.lang.SecurityException: Permission Denial: writing com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=399, uid=10025 requires android.permission.WRITE_CONTACTS04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.os.Parcel.readException(Parcel.java:1218)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.content.ContentProviderProxy.update(ContentProviderNative.java:532)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.content.ContentResolver.update(ContentResolver.java:737)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at com.example.helloandroid.HelloAndroid.getContactList(HelloAndroid.java:36)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at com.example.helloandroid.HelloAndroid.onCreate(HelloAndroid.java:19)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)04-10 13:47:45.419: ERROR/AndroidRuntime(399):     ... 11 more</code></pre><p>the path I used: <code>Environment.getExternalStorageDirectory().getPath() + ""/Alex.wav""</code></p>","309166","","309166","","2010-04-10 13:51:58","2010-04-10 13:51:58","Can't update contact details in android using code","<android><ringtone>","1","0","","",""
"2613001","1","2613070","","2010-04-10 10:18:40","1","4928","<p>Can we set Title for a Menu Item in Android if it has an icon from drawable?</p><p>I have a icon for a Menu Item and if I set the icon then the title that is set for that Menu item is not visible.</p><p>Is this possible or not?</p><p>Hope to get a reply soon.</p><p>RegardsSunil</p>","261566","","","","","2012-09-22 09:59:18","Writing text on icon of Menu in Android?","<android><menu><icons><title>","2","0","1","",""
"2613101","1","2613581","","2010-04-10 10:51:42","6","8065","<p>i have an Idea to create Themes for Android Mobile. But i have no knowledge on that. i would need to know about the things</p><ul><li>what is the file format of theme for android?</li><li>what kind of things i want to handle to change the themes.(i.e background, directory window, wallpaper, icon slector style,etc like that.)</li><li>how to start to learn about this.</li><li>sites and tutorials for beginners.</li><li>sample applications and codes.</li></ul><p>if you passed out about anything above. Please share with me. its more helpful.</p><p>thanks.</p>","267269","","21234","","2010-06-25 13:20:26","2013-04-10 13:42:11","Themes in Android?","<android><themes>","1","1","0","",""
"2613521","1","","","2010-04-10 13:24:21","0","263","<p>I am developing a simple app which does a little bit of image-processing. It's divided in two activities; the main one with some display elements and the second one which is used to capture images off the phone's camera.To discribe my problem: I start the app, capture an image (by starting a new Intent with the subactivity) and all data is displayed correctly. If I capture another image after this, I run in an </p><p>java.lang.OutOfMemoryError - bitmap size exceeds VM budget</p><p>I dont store the captured bitmap, in the second activity I just extract some data from it and pass it to the main-activity; finishing (finish()) the sub-activity afterwards. I really dont know what I can do about it. Thanks in advance!</p><p>greetings, Zacherl</p><p>PS: It is my first approach to android, so I apologize for any stupid beginner error I did; if someone needs any further information, I would be happy to provide it.</p>","313474","","313474","","2010-04-12 20:15:12","2010-06-14 06:00:19","starting subactivity for the second time causes java.lang.OutOfMemoryError","<android><out-of-memory>","1","1","","",""
"2613699","1","2613905","","2010-04-10 14:26:17","1","352","<p>i've a PreferenceActivity which works perfectly the first time i launch it.</p><p>But if i close it ( with the back button ) and then i re open it ( through a menu click in the main activity ) then i get a black screen. There is no preferences at all..</p><p>I can't figure it out why it should not working. </p><p>It seems all the code is being called normally as the working one but no preferences are showing on the screen.</p><p>Did someone had the same behaviour ?</p>","314407","","","","","2010-04-10 15:43:31","PreferenceActivity not showing twice on android","<android>","1","1","","",""
"2614134","1","2616533","","2010-04-10 16:49:12","1","11722","<p>So I am modifying the Cube live wallpaper example.  I have a class that extends PreferenceActivity, and I added the Activity in my manifest file.  I keep getting ActivityNotFoundExceptions.</p><p>Here is my preference class : </p><pre><code>package com.p.t.wallpapers.mywallpaper;import com.p.t.wallpapers.mywallpaper.R;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.PreferenceActivity;public class MySettingsActivity extends PreferenceActivityimplements SharedPreferences.OnSharedPreferenceChangeListener {@Overrideprotected void onCreate(Bundle bundle) {    super.onCreate(bundle);    getPreferenceManager().setSharedPreferencesName(            ParticleCandy.SHARED_PREFS_NAME);    addPreferencesFromResource(R.xml.settings);    getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(            this);}@Overrideprotected void onResume() {    super.onResume();}@Overrideprotected void onDestroy() {    getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(            this);    super.onDestroy();}public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,        String key) {}</code></pre><p>}</p><p>And here 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.p.t.wallpapers.mywallpaper""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;service  android:label=""@string/app_name""  android:name="".MyWallpaper""  android:permission=""android.permission.BIND_WALLPAPER"" &gt; &lt;intent-filter&gt;  &lt;action    android:name=""android.service.wallpaper.WallpaperService""&gt;  &lt;/action&gt;&lt;/intent-filter&gt;&lt;meta-data     android:name=""android.service.wallpaper""     android:resource=""@xml/wallpaper_info"" /&gt;  &lt;/service&gt;&lt;activity  android:label=""@string/settings_title""    android:name="".MySettingsActivity""    android:theme=""@android:style/Theme.Light.WallpaperSettings""   android:exported=""true""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;uses-feature android:name=""android.software.live_wallpaper"" /&gt;&lt;/manifest&gt; </code></pre><p>Any ideas why my preferences activity doesn't get read in from the manifest?  The wallpaper service, MyWallpaper shows up just fine, but DDMS keeps telling me the activity MySettingsActivity doesn't exit.</p><p>Here is output from logcat</p><pre><code>04-11 00:22:19.617: INFO/ActivityManager(57): Starting activity: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) }04-11 00:22:21.796: INFO/ActivityManager(57): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperPreview: 2111 ms (total 2111 ms)04-11 00:22:25.667: DEBUG/dalvikvm(375): GC freed 4745 objects / 316576 bytes in 192ms04-11 00:22:25.727: INFO/ActivityManager(57): Starting activity: Intent { cmp=com.p.t.wallpapers.mywallpaper/MySettingsActivity (has extras) }04-11 00:22:25.757: DEBUG/AndroidRuntime(375): Shutting down VM04-11 00:22:25.768: WARN/dalvikvm(375): threadid=3: thread exiting with uncaught exception (group=0x4001b188)04-11 00:22:25.787: ERROR/AndroidRuntime(375): Uncaught handler: thread main exiting due to uncaught exception04-11 00:22:25.847: ERROR/AndroidRuntime(375): java.lang.IllegalStateException: Could not execute method of the activity04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.View$1.onClick(View.java:2031)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.View.performClick(View.java:2364)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.View.onTouchEvent(View.java:4179)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.widget.TextView.onTouchEvent(TextView.java:6540)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.View.dispatchTouchEvent(View.java:3709)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.dispatchTouchEvent(LiveWallpaperPreview.java:199)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.os.Handler.dispatchMessage(Handler.java:99)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.os.Looper.loop(Looper.java:123)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.app.ActivityThread.main(ActivityThread.java:4363)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invokeNative(Native Method)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invoke(Method.java:521)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at dalvik.system.NativeStart.main(Native Method)04-11 00:22:25.847: ERROR/AndroidRuntime(375): Caused by: java.lang.reflect.InvocationTargetException04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.configureLiveWallpaper(LiveWallpaperPreview.java:113)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invokeNative(Native Method)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at java.lang.reflect.Method.invoke(Method.java:521)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.view.View$1.onClick(View.java:2026)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     ... 20 more04-11 00:22:25.847: ERROR/AndroidRuntime(375): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.p.t.wallpapers.mywallpaper/MySettingsActivity}; have you declared this activity in your AndroidManifest.xml?04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.app.Activity.startActivityForResult(Activity.java:2749)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     at android.app.Activity.startActivity(Activity.java:2855)04-11 00:22:25.847: ERROR/AndroidRuntime(375):     ... 24 more04-11 00:22:25.917: INFO/Process(57): Sending signal. PID: 375 SIG: 304-11 00:22:25.917: INFO/dalvikvm(375): threadid=7: reacting to signal 304-11 00:22:25.988: ERROR/ActivityThread(57): Failed to find provider info for android.server.checkin04-11 00:22:26.012: ERROR/Checkin(57): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes04-11 00:22:26.044: INFO/dalvikvm(375): Wrote stack trace to '/data/anr/traces.txt'04-11 00:22:29.307: INFO/Process(375): Sending signal. PID: 375 SIG: 904-11 00:22:29.516: INFO/ActivityManager(57): Process android.process.acore (pid 375) has died.04-11 00:22:29.516: INFO/WindowManager(57): WIN DEATH: Window{44dd50d8 Media:com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperPreview paused=false}04-11 00:22:29.576: INFO/WindowManager(57): WIN DEATH: Window{44d660f8 com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperListActivity paused=false}04-11 00:22:29.586: INFO/WindowManager(57): WIN DEATH: Window{44dbe2f0 com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperPreview paused=false}04-11 00:22:29.876: INFO/ActivityManager(57): Start proc android.process.acore for activity com.android.wallpaper.livepicker/.LiveWallpaperListActivity: pid=421 uid=10022 gids={}04-11 00:22:30.687: DEBUG/ddm-heap(421): Got feature list request04-11 00:22:30.957: INFO/UsageStats(57): Unexpected resume of com.android.wallpaper.livepicker while already resumed in com.android.wallpaper.livepicker04-11 00:22:31.756: WARN/ResourceType(421): getEntry failing because entryIndex 2 is beyond type entryCount 204-11 00:22:31.768: WARN/ResourceType(421): Failure getting entry for 0x7f040002 (t=3 e=2) in package 0: 0x8000000104-11 00:22:32.758: WARN/InputManagerService(57): Got RemoteException sending setActive(false) notification to pid 375 uid 1002204-11 00:22:33.137: INFO/ActivityManager(57): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperListActivity: 3430 ms (total 3430 ms)04-11 00:22:33.528: ERROR/gralloc(57): [unregister] handle 0x467ae8 still locked (state=40000001)04-11 00:22:38.368: DEBUG/dalvikvm(364): GC freed 611 objects / 51656 bytes in 179ms</code></pre><p>Updated logcat</p><pre><code>04-11 01:10:52.976: INFO/ActivityManager(57): Starting activity: Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras) }04-11 01:10:53.668: WARN/InputManagerService(57): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44db02f804-11 01:10:54.587: INFO/ActivityManager(57): Displayed activity android/com.android.internal.app.ChooserActivity: 1140 ms (total 17760 ms)04-11 01:10:56.458: INFO/ActivityManager(57): Starting activity: Intent { act=android.intent.action.SET_WALLPAPER flg=0x3000000 cmp=com.android.wallpaper.livepicker/.LiveWallpaperListActivity }04-11 01:10:57.466: DEBUG/dalvikvm(1622): GC freed 1487 objects / 106648 bytes in 167ms04-11 01:10:57.556: WARN/ResourceType(1622): getEntry failing because entryIndex 2 is beyond type entryCount 204-11 01:10:57.587: WARN/ResourceType(1622): Failure getting entry for 0x7f040002 (t=3 e=2) in package 0: 0x8000000104-11 01:10:58.516: INFO/ActivityManager(57): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperListActivity: 1625 ms (total 1625 ms)04-11 01:11:00.717: INFO/ActivityManager(57): Starting activity: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) }04-11 01:11:02.948: INFO/ActivityManager(57): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperPreview: 2187 ms (total 2187 ms)04-11 01:11:11.538: INFO/ActivityManager(57): Starting activity: Intent { cmp=com.p.t.wallpapers.mywallpaper/MySettingsActivity (has extras) }04-11 01:11:11.577: DEBUG/AndroidRuntime(1622): Shutting down VM04-11 01:11:11.587: WARN/dalvikvm(1622): threadid=3: thread exiting with uncaught exception (group=0x4001b188)04-11 01:11:11.597: ERROR/AndroidRuntime(1622): Uncaught handler: thread main exiting due to uncaught exception04-11 01:11:11.667: ERROR/AndroidRuntime(1622): java.lang.IllegalStateException: Could not execute method of the activity04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.View$1.onClick(View.java:2031)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.View.performClick(View.java:2364)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.View.onTouchEvent(View.java:4179)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.widget.TextView.onTouchEvent(TextView.java:6540)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.View.dispatchTouchEvent(View.java:3709)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.dispatchTouchEvent(LiveWallpaperPreview.java:199)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.os.Handler.dispatchMessage(Handler.java:99)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.os.Looper.loop(Looper.java:123)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.app.ActivityThread.main(ActivityThread.java:4363)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at java.lang.reflect.Method.invokeNative(Native Method)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at java.lang.reflect.Method.invoke(Method.java:521)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at dalvik.system.NativeStart.main(Native Method)04-11 01:11:11.667: ERROR/AndroidRuntime(1622): Caused by: java.lang.reflect.InvocationTargetException04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.configureLiveWallpaper(LiveWallpaperPreview.java:113)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at java.lang.reflect.Method.invokeNative(Native Method)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at java.lang.reflect.Method.invoke(Method.java:521)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.view.View$1.onClick(View.java:2026)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     ... 20 more04-11 01:11:11.667: ERROR/AndroidRuntime(1622): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.p.t.wallpapers.mywallpaper/MySettingsActivity}; have you declared this activity in your AndroidManifest.xml?04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.app.Activity.startActivityForResult(Activity.java:2749)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     at android.app.Activity.startActivity(Activity.java:2855)04-11 01:11:11.667: ERROR/AndroidRuntime(1622):     ... 24 more04-11 01:11:11.748: INFO/Process(57): Sending signal. PID: 1622 SIG: 304-11 01:11:11.748: INFO/dalvikvm(1622): threadid=7: reacting to signal 304-11 01:11:11.827: INFO/dalvikvm(1622): Wrote stack trace to '/data/anr/traces.txt'04-11 01:11:11.858: ERROR/ActivityThread(57): Failed to find provider info for android.server.checkin04-11 01:11:11.877: ERROR/Checkin(57): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes04-11 01:11:13.788: DEBUG/dalvikvm(101): GC freed 3389 objects / 203632 bytes in 2805ms04-11 01:11:16.787: INFO/Process(1622): Sending signal. PID: 1622 SIG: 904-11 01:11:17.037: INFO/ActivityManager(57): Process android.process.acore (pid 1622) has died.04-11 01:11:17.046: INFO/WindowManager(57): WIN DEATH: Window{44db47b0 Media:com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperPreview paused=false}04-11 01:11:17.107: INFO/WindowManager(57): WIN DEATH: Window{44db7138 com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperListActivity paused=false}04-11 01:11:17.208: INFO/WindowManager(57): WIN DEATH: Window{44da6860 com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperPreview paused=false}04-11 01:11:17.426: INFO/ActivityManager(57): Start proc android.process.acore for activity com.android.wallpaper.livepicker/.LiveWallpaperListActivity: pid=1647 uid=10022 gids={}04-11 01:11:18.266: DEBUG/dalvikvm(30): GC freed 222 objects / 8512 bytes in 799ms04-11 01:11:18.577: DEBUG/ddm-heap(1647): Got feature list request04-11 01:11:18.686: DEBUG/dalvikvm(30): GC freed 2 objects / 56 bytes in 406ms04-11 01:11:19.037: INFO/UsageStats(57): Unexpected resume of com.android.wallpaper.livepicker while already resumed in com.android.wallpaper.livepicker04-11 01:11:19.367: DEBUG/dalvikvm(30): GC freed 2 objects / 56 bytes in 652ms04-11 01:11:19.827: WARN/ResourceType(1647): getEntry failing because entryIndex 2 is beyond type entryCount 204-11 01:11:19.837: WARN/ResourceType(1647): Failure getting entry for 0x7f040002 (t=3 e=2) in package 0: 0x8000000104-11 01:11:20.378: WARN/InputManagerService(57): Got RemoteException sending setActive(false) notification to pid 1622 uid 1002204-11 01:11:20.737: INFO/ActivityManager(57): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperListActivity: 3496 ms (total 3496 ms)04-11 01:11:21.117: ERROR/gralloc(57): [unregister] handle 0x448168 still locked (state=40000001)04-11 01:23:24.496: DEBUG/dalvikvm(98): GC freed 12398 objects / 575024 bytes in 213ms</code></pre>","313547","","19750","","2011-06-19 10:54:23","2011-06-19 10:54:23","My PreferenceActivity does not show up, even though it is in my manifest file","<android><activity><manifest><preferences><live-wallpaper>","4","0","1","",""
"2614343","1","","","2010-04-10 18:04:03","0","365","<p>Is it possible to be able to create a folder on the sd card of the phone via using Android SDK or the Shell?</p>","313579","","","","","2010-04-10 18:05:16","Creating folders using Android SDK","<android><shell><sdk><adb>","1","0","","",""
"2614393","1","2614402","","2010-04-10 18:16:22","59","27219","<p>I would like to define the z order of the views of a RelativeLayout in Android.</p><p>I know one way of doing this is calling <code>bringToFront</code>.</p><p>Is there are better way of doing this? It would be great if I could define the z order in the layout xml.</p>","143378","","143378","","2013-03-31 18:01:34","2013-04-01 11:16:59","Defining Z order of views of RelativeLayout in Android","<xml><android><z-order><relativelayout>","2","0","9","",""
"2614504","1","","","2010-04-10 18:46:40","0","1690","<p>I've been unable to get my Nexus One working as a development phone on Windows XP. I've got the driver (revision 3 for N1 support), I've got it installed according to the official installation guide, and the phone appears in the Device Manager just as the guide says it should.</p><p>However, adb still can't find the phone. 'adb devices', for example, returns no active devices.</p><p>Am I forgetting some basic step?</p><p>One thing I've noticed is that the driver is labeled in Windows as version 2 released November, 2009 (I need version 3 from January 2010 for N1 support). However, I've never had version 2 installed. I've used the SDK to download version 3 several times - even deleted it and redownloaded it. I've uninstalled/reinstalled the version 3 driver multiple times. It still says version 2. Is this the problem, or this something completely unrelated?</p><p>Note: The phone is working as a dev phone on Ubuntu, so I know the phone/cable/etc. are good. It's either my fault or the driver's.</p>","313590","","","","","2013-09-22 08:13:37","Nexus One & Windows XP USB Driver","<android><adb><nexus-one>","1","2","","",""
"2614545","1","3208800","","2010-04-10 18:58:38","46","24093","<p>How do you animate the change of background color of a view in Android? </p><p>For example: </p><p>I have a view with a red background color. The background color of the view changes to blue. How can I do a smooth transition between colors?</p><p>If this can't be done with views, an alternative will be welcome.</p>","143378","","143378","","2010-04-10 20:19:07","2013-09-10 16:09:01","Animate change of view background color in Android","<android><animation><view><background-color>","4","1","24","",""
"2614691","1","2614778","","2010-04-10 19:42:22","0","387","<p>This is a bit unorthodox but I'm trying to figure out if there's a way to access files stored in the src tree of my applications apk in Android.  I'm trying to use i-Jetty (Jetty implementation for Android) and rather than use it as a separate application and manually download my war file, I'd rather just bake i-jetty in.  </p><p>However, in order to use (easily) standard html/jsp I need to be able to give it a document root, preferably within my application's apk file. I know Android specifically works to prevent you from accessing (freely) the stuff on the actual system so this may not be possible, but I'm thinking it might be possible to access something within the apk.  One option to work around this would be to have all of the files stored in the res directory and then copy them to the sdcard on startup but this wouldn't allow me to automatically remove the files on uninstall.</p><p>To give you an idea of what I've tried, currently, the html files are stored in org.webtext.android</p><pre><code>Context rootContext = new Context(server_, ""/"", Context.SESSIONS);rootContext.setResourceBase(""org/webtext/webapp"");</code></pre><p>Returns a 404 error.</p><pre><code>final URL url = this.getClassLoader().getResource(""org/webtext/webapp"");Context html = new WebAppContext(url.toExternalForm(), ""/"");</code></pre><p>Blows up with a NullPointerException because no URL is returned from the getResource call.</p><p>Any thoughts would be greatly appreciated!</p><p>Thanks,</p><p>Chris</p><p><strong>Edit</strong> In case anybody finds this looking for a similar answer, I never found a great answer.  I used a slight hack on what was suggested below.  I created a war file with only html/jsp content (servlets I added to the server manually and was able to keep in the in the src tree) and stored it in the assets folder.  When the app starts, I copy the war file to the sdcard.  When the app closes, I delete the copy.  Of course, if the app is killed rather than gracefully exiting, I don't get the chance to delete it, but that's not a huge deal.</p>","150771","","150771","","2010-04-11 03:21:36","2010-04-11 03:21:36","Is there any way to access files in your source tree in Android?","<android><jetty>","1","0","","",""
"2614714","1","","","2010-04-10 19:49:52","7","8329","<p>i would like to create a seekbar for an Android app that allows the user to select a value between -5 and 5 (which maps to ""strongly disagree"" and ""strongly agree""). how do i make a seekbar with discrete values? or is there a better UI widget i could use for this?</p><p>thanks.</p>","313618","","","","","2013-05-20 09:42:38","Discrete seekbar in Android app?","<android><seekbar>","5","0","4","",""
"2614719","1","2614771","","2010-04-10 19:51:04","164","114311","<p>I am using a PreferenceActivity to show some settings for my application. I am inflating the settings via a xml file so that my onCreate (and complete class methods) looks like this: </p><pre><code>public class FooActivity extends PreferenceActivity { @Override public void onCreate(Bundle icicle) {  super.onCreate(icicle);  addPreferencesFromResource(R.xml.preference); }}</code></pre><p>The javadoc of <s>PreferenceActivity</s> <a href=""http://developer.android.com/reference/android/preference/PreferenceFragment.html"">PreferenceFragment</a> states that </p><blockquote>  <p>These preferences will automatically save to SharedPreferences as the user interacts with them. To retrieve an instance of SharedPreferences that the preference hierarchy in this activity will use, call getDefaultSharedPreferences(android.content.Context) with a context in the same package as this activity.</p></blockquote><p>But how I get the name of the SharedPreference in another Activity? I can only call </p><p>getSharedPreferences(name, mode)</p><p>in the other activity but I need the name of the SharedPreference which was used by the PreferenceActivity. What is the name or how can i retrieve it?</p>","309871","","281545","","2013-07-14 16:14:01","2013-08-18 04:20:52","How do I get the SharedPreferences from a PreferenceActivity in Android?","<android><preferences><preferenceactivity><sharedpreferences>","4","0","111","",""
"2614849","1","","","2010-04-10 20:27:52","1","3423","<p>I have a SurfaceView that takes up part of the screen, and some buttons along the bottom.  When a button is pressed and the user drags, I want to be able to drag a picture (based on the button) onto the SurfaceView and have it drawn there.</p><p>I want to be able to use clickListeners and the like, and not just have a giant SurfaceView with me writing code to detect where the user pressed and if it's a button, etc.</p><p>I have somewhat of a solution, but it seems a bit of a hack to me.  What is the best way to accomplish this using the framework intelligently?</p><p>Part of my XML:</p><pre><code>&lt;RelativeLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/background""&gt;&lt;!-- Place buttons along the bottom --&gt;&lt;RelativeLayout android:id=""@+id/bottom_bar""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""40dip""    android:layout_alignParentBottom=""true""    android:background=""@null""&gt;    &lt;ImageButton android:id=""@+id/btn_1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerVertical=""true""        android:background=""@null""        android:src=""@drawable/btn_1""&gt;    &lt;/ImageButton&gt;    &lt;!-- More buttons here... --&gt;&lt;/RelativeLayout&gt; &lt;!-- Place the SurfaceView in a frame so we can stack on top of it --&gt;&lt;FrameLayout    android:layout_width=""fill_parent""    android:layout_height=""0px""    android:layout_weight=""1""    android:layout_above=""@id/bottom_bar""&gt;    &lt;com.project.question.MySurfaceView        android:id=""@+id/my_view""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;&lt;/FrameLayout&gt;</code></pre><p></p><p>And the relevant Java code in MySurfaceView, which extends SurfaceView.  mTouchX and Y are used in the onDraw method to draw the image:</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event){    mTouchX = (int) event.getX();    mTouchY = (int) event.getY();    return true;}public void onButtonTouchEvent(MotionEvent event){    event.setLocation(event.getX(), event.getY() + mScreenHeight);    onTouchEvent(event);}</code></pre><p>Finally, the activity:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.my_surface);    mView = (MySurfaceView) findViewById(R.id.my_view);    mSurfaceHeight = mView.getHeight();    mBtn = (ImageButton) findViewById(R.id.btn_1);    mBtn.setOnTouchListener(mTouchListener);}OnTouchListener mTouchListener = new OnTouchListener() {    public boolean onTouch(View v, MotionEvent event) {        int [] location = new int[2];        v.getLocationOnScreen(location);        event.setLocation(event.getX() + location[0], event.getY());        mView.onButtonTouchEvent(event);        return true;    }};</code></pre><p>Strangely, one has to add to the x-coordinate in the activity, then add to the y coordinate in the View.  Otherwise, it doesn't show up in the correct position.  If you add nothing, something drawn using mTouchX and mTouchY will show up in the upper left corner of the SurfaceView.</p><p>Any direction would be greatly appreciated.  If I'm going about this completely the wrong way, that would be good information too.</p>","202301","","","","","2011-04-22 16:30:20","How to manage a MotionEvent going from one View to another?","<android><android-widget><android-layout>","1","0","","",""
"2614936","1","","","2010-04-10 20:54:14","10","41214","<p>I've been racking my brain (android newbie here, so not hard to do) for awhile trying to figure out how to accomplish this: </p><p><img src=""http://i.stack.imgur.com/6sWvb.jpg"" alt=""enter image description here""></p><p>using a RelativeLayout or something other than AbsoluteLayout which is what this was created with.  I'm coming from a Windows programming background where the device adjusts the 'absolute' positioning for you and GUI layout was a non-issue.</p><p>The first layout works great in the emulator, but doesn't format for my Nexus One or any other screen that differs from the emulator size.  I expected this because it's absolutely positioned, but haven't found a solution that will format correctly for different screen sizes.  My goal is to have the layout work for different screen sizes and in portrait / landscape. </p><p>Here's the Code that I'm currently using:  [main.xml]</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""&gt;  &lt;Button    android:id=""@+id/Button01""    android:layout_width=""188px""    android:layout_height=""100px""    android:text=""A""    android:layout_y=""50px"" android:layout_x=""65px"" android:textSize=""48sp""/&gt;&lt;Button    android:id=""@+id/Button02""    android:layout_width=""188px""    android:layout_height=""100px""    android:text=""B""    android:layout_y=""175px"" android:layout_x=""65px"" android:textSize=""48sp""/&gt;&lt;Button    android:id=""@+id/Button03""    android:layout_width=""188px""    android:layout_height=""100px""    android:text=""C""    android:layout_y=""300px"" android:layout_x=""65px"" android:textSize=""48sp""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Using tidbits from other questions here, I came up with this, it’s closer, but not there yet.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayoutandroid:gravity=""center""android:id=""@+id/widget49""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;Button    android:id=""@+id/Button01""    android:layout_width=""0dip""    android:layout_weight=""1""    android:text=""A""    android:textSize=""48sp""/&gt;&lt;Button    android:id=""@+id/Button02""    android:layout_width=""0dip""            android:layout_weight=""1""    android:text=""B""    android:textSize=""48sp""/&gt;&lt;Button    android:id=""@+id/Button03""    android:layout_width=""0dip""          android:layout_weight=""1""    android:text=""C""    android:textSize=""48sp""/&gt;&lt;/TableLayout&gt;</code></pre><p>Here’s a picture of the TableLayout:</p><p><img src=""http://i.stack.imgur.com/kLohG.jpg"" alt=""enter image description here""></p><p>Any help / guidance would be greatly appreciated.   </p>","297856","","139010","","2011-04-25 03:50:50","2011-04-25 03:50:50","How to center buttons on screen horizontally and vertically plus equidistant apart?","<android><gui><layout>","2","0","6","",""
"2615321","1","2615347","","2010-04-10 22:53:41","5","3082","<p>It seems that I accidentally checked in my ""gen"" folder from an Android project (this folder contains the R.java generated class).  When I realized I did this I deleted it from SVN and tried to ignore it.  </p><p>Now I am now getting the error...</p><blockquote>  <p>""Could not add gen to the ignore list!  Working copy 'C:\code\guru' locked.</p></blockquote><p>When I try to run a cleanup command I get this...</p><blockquote>  <p>Cleanup failed to process the  following paths:  -C:\code\guru 'C:\code\guru\gen' is not a working copy directory.</p></blockquote><p>When I try to run a resolve I get this...</p><blockquote>  <p>Working copy 'C:\code\guru' locked  Please execute the 'Cleanup' command.</p></blockquote><p>We are currently on SVN 1.6 on the server.</p>","97901","","","","","2010-04-10 23:03:58","Android ""gen"" folder and SVN - bitter enemies","<android><svn><version-control><tortoisesvn><intellij-idea>","2","0","1","",""
"2615381","1","2615493","","2010-04-10 23:12:46","6","12879","<p>I am having a lot of trouble adding the WEKA library to a project I am working on. I have followed several tutorials that explain how to do this including the Android Developers guide: </p><p><a href=""http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary"">http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary</a></p><p>and several of the postings on SO.</p><p>I have created a folder in my project with the weka.jar file, created a new library (adding the weka.jar file to the library) and included this library in my build path. I have also added the library under the ""Order and Export"" tab in the project properties.</p><p>I have also tried importing the jar file so that the actual contents of the jar are extracted into a directory in my project.</p><p>The end result of all of this is that my project is able to build correctly and without error, but when it comes time to run my code on the emulator I get the following exception:</p><p>04-10 22:52:21.051: ERROR/dalvikvm(582): Could not find class 'weka.classifiers.trees.J48', referenced from method edu.usc.student.composure.classifier.GaitClassifierImpl.</p><p>with J48 being the class I reference in my code.</p><p>Does anyone have any additional suggestions that I may have overlooked?</p><p>Thanks!</p>","313687","","","","","2011-02-17 02:15:08","Android - Adding external library to project","<android><jar><external>","2","0","0","",""
"2615528","1","5772456","","2010-04-11 00:05:39","22","10309","<p>Hi all I have set the theme in the manifest file like this:</p><pre><code>android:theme=""@android:style/Theme.Light""</code></pre><p>But I have a problem in the Preferences Activity, in the main preferences the theme shows ok, but if I get to a sub preference, the theme gets messy, it is not white as it should, it is all dark, and the font is black so you can't see much, and when I start clicking on any items they will get sometimes white as they should but revert to black soon after. This is only happens on 2.1, in both the real device and emulator. Tested on the emulator running 1.6 and it was working correctly. Here is part of the code of the preferences xml file:</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;PreferenceScreen        android:title=""@string/account""&gt;        &lt;CheckBoxPreference            android:key=""enable_account""            android:title=""@string/account_use""            android:summary=""@string/account_summ"" /&gt;        &lt;EditTextPreference            android:key=""username""            android:title=""@string/login""            android:dependency=""enable_account""            android:summary=""@string/login_summ"" /&gt;        &lt;EditTextPreference            android:key=""password""            android:title=""@string/password""            android:dependency=""enable_account""            android:summary=""@string/password_summ""            android:password=""true"" /&gt;    &lt;/PreferenceScreen&gt;</code></pre><p>And here is a screenshot:</p><p><img src=""http://i39.tinypic.com/16hnhh3.png"" alt=""alt text""></p><p>Any workarounds?</p>","265375","","21234","","2010-06-25 13:20:11","2013-04-17 17:28:23","PreferenceActivity and theme not applying","<android><themes><android-preferences>","4","2","6","",""
"2615616","1","2615641","","2010-04-11 00:42:34","8","22918","<p>I have the following code for Android which works fine to play a sound once a button is clicked:</p><pre><code>Button SoundButton2 = (Button)findViewById(R.id.sound2);        SoundButton2.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        mSoundManager.playSound(2);    }});</code></pre><p>My problem is that I want the sound to play immediately upon pressing the button (touch down), not when it is released (touch up). Any ideas on how I can accomplish this?</p>","313717","","13070","","2010-04-11 01:27:57","2012-09-27 19:15:13","Triggering event when Button is pressed down in Android","<android><button>","3","0","4","",""
"2615853","1","","","2010-04-11 02:29:19","23","6403","<p>In the Android AVD manager (or a new project for that matter), it will give two options for the same API level.For example, for Level 7 (2.1) it will show ""Google APIs - Level 7"" and ""Android 2.1 - Level 7"" in the selection drop down.What, if any, is the actual difference between these two and why would I want one over the other?</p>","194","","","","","2014-03-22 03:28:21","""Android 2.x"" vs ""Google APIs"" for Android AVD Setup","<android><eclipse>","4","0","2","",""
"2615957","1","2615962","","2010-04-11 03:33:34","1","1524","<p>I'm trying to create a design for a list that looks like (and mostly behaves like) the call log, like shown here:<br><img src=""http://i.imagehost.org/0374/android_consistency.jpg"" width=""287"" height=""131"" alt=""ImageHost.org"" /></p><p>I don't need all the design, but what I'm trying to achieve is the two-columned design with the splitter in-between, and the behavior that if I click on the main item (the left part) one thing happens (in this case, you open some details about the call), and if you press the outer right part something else happens (you call the contact).</p><p>I'm pretty new to android, but I've managed to do most of the designs I wanted so far, so I don't need the entire layout for this one, only the part that does the splitting and the splitter. And if possible it would be nice to know how to map the clicks appropriately, though I think I might be able to find that out by my self.</p>","213323","","","","","2010-04-29 10:06:58","android call log like design","<android><design><multicolumn>","1","1","1","",""
"2616130","1","","","2010-04-11 05:24:18","2","46004","<p>I know there is probably a simple thing I'm missing, but I've been beating my head against the wall for the past hour or two.  I have a database for the Android application I'm currently working on (Android v1.6) and I just want to insert a single record into a database table.  My code looks like the following:</p><pre><code>//Save information to my tablesql =   ""INSERT INTO table1 (field1, field2, field3) "" +        ""VALUES ("" + field_one + "", "" + field_two + "")"";Log.v(""Test Saving"", sql);myDataBase.rawQuery(sql, null);</code></pre><p>the myDataBase variable is a SQLiteDatabase object that can select data fine from another table in the schema.  The saving appears to work fine (no errors in LogCat) but when I copy the database from the device and open it in sqlite browser the new record isn't there.  I also tried manually running the query in sqlite browser and that works fine.  The table schema for table1 is _id, field1, field2, field3.</p><p>Any help would be greatly appreciated.  Thanks!</p>","143310","","","","","2012-07-29 04:16:51","Android insert into sqlite database","<android><sqlite>","4","2","2","",""
"2616588","1","2616602","","2010-04-11 09:38:18","0","8152","<pre><code> export PATH=${/home/mohit/}:&lt;android-sdk-linux_86&gt;/tools</code></pre><p>this is what i am using..</p><p>error:--</p><pre><code>bash: PATH=${/home/mohit/}:: bad substitution</code></pre><p>this is the path of sdk</p><pre><code>mohit@mohit-laptop:~/android-sdk-linux_86$ pwd/home/mohit/android-sdk-linux_86</code></pre>","179855","","","","","2013-09-12 11:30:06","Problem in setting path for android sdk in ubuntu","<android><ubuntu-9.10>","3","0","1","",""
"2616842","1","","","2010-04-11 11:29:47","4","2624","<p>I'm trying to implement an input method service that receives intents sent by a remote client, and in response to those sends an appropriate KeyEvent.</p><p>I'm using in the input method service this method</p><pre><code>private void keyDownUp(int keyEventCode) {        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode));        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_UP, keyEventCode));    }</code></pre><p>to send KeyEvents as in the Simple Sofykeyboard Sample, and it works in the home, in Activities... but it doesn't works when a Dialog or the menu of a Spinner is in foreground.</p><p>The events is sent to the parent activity behind the Dialog.</p><p>Is there any way to send keys and control the device like using the hardware keys from an input method?</p><p>Better explanation on what I'm trying to do:</p><p>I am kind of writng an Input Method that allows to control the device from remote.I write in a client (a java application on my desktop pc) a command (for example ""UP""), a server on the device with sendBroadcast() sends the intent with the information, and a receiver in the input method gets it and call keyDownUp with the keycode of the DPAD_UP key.It generally works, but when I go to an app that shows a dialog, the keyDownUp method don't sends the key event to the dialog, for example for select the yes or not buttons, but it keeps to control the activty behind the Dialog.</p><p>Here <a href=""http://osdir.com/ml/Android-Developers/2009-09/msg03677.html"" rel=""nofollow"">http://osdir.com/ml/Android-Developers/2009-09/msg03677.html</a> I have found someone with my same problem... but no answer...</p>","313874","","313874","","2010-04-12 15:45:00","2010-11-05 18:30:02","How to send KeyEvents through an input method service to a Dialog, or a Spinner menu?","<android>","1","0","1","",""
"2616859","1","6857648","","2010-04-11 11:36:15","7","14311","<p>I've got an Android application which needs to be woken up sporadically throughout the day.</p><p>To do this, I'm using the AlarmManager to set up a PendingIntent and have this trigger a BroadcastReceiver. This BroadcastReceiver then starts an Activity to bring the UI to the foreground.</p><p>All of the above seems to work, in that the Activity launches itself correctly; but I'd like the BroadcastReceiver to notify the Activity that it was started by the alarm (as opposed to being started by the user). To do this I'm trying, from the onReceive() method of the BroadcastReceiver to set a variable in the extras bundle of the intent, thus:</p><pre><code>    Intent i = new Intent(context, MyActivity.class);    i.putExtra(wakeupKey, true);    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(i);</code></pre><p>In the onResume() method of my Activity, I then look for the existence of this boolean variable:</p><pre><code>protected void onResume() {    super.onResume();    String wakeupKey = ""blah"";          if (getIntent()!=null &amp;&amp; getIntent().getExtras()!=null)        Log.d(""app"", ""onResume at "" + System.currentTimeMillis() + "":"" + getIntent().getExtras().getBoolean(wakeupKey));    else        Log.d(""app"", ""onResume at "" + System.currentTimeMillis() + "": null"");}</code></pre><p>The getIntent().getExtras() call in onResume() always returns null - I don't seem to be able to pass any extras through at all in this bundle.</p><p>If I use the same method to bind extras to the PendingIntent which triggers the BroadcastReceiver however, the extras come through just fine.</p><p>Can anyone tell me what's different about passing a bundle from a BroadcastReceiver to an Activity, as opposed to passing the bundle from an Activity to a BroadcastReceiver? I fear I may be doing something very very obvious wrong here...</p>","300823","","","","","2012-12-31 13:23:59","How do I pass data from a BroadcastReceiver through to an Activity being started?","<android><android-intent><bundle><broadcastreceiver><alarm>","5","1","6","",""
"2617266","1","","","2010-04-11 14:03:11","89","65224","<p>Is there any way in android to adjust the textsize in a textview to fit the space it occupies?</p><p>E.g. I'm using a TableLayout and adding several textviews to each row. Since I don't want the textviews to wrap the text I rather see that it lowers the font size of the content.</p><p>Any ideas?</p><p>I have tried measureText, but since I don't know the size of the column it seems troublesome to use.This is the code where I want to change the font size to something that fits</p><pre><code>TableRow row = new TableRow(this);   for(int i=0;i&lt;ColumnNames.length; i++){    TextView textColumn = new TextView(this);      textColumn.setText(ColumnNames[i]);textColumn.setPadding(0, 0, 1, 0);textColumn.setTextColor(getResources().getColor(R.drawable.text_default));          row.addView(textColumn, new TableRow.LayoutParams()); } table.addView(row, new TableLayout.LayoutParams());  </code></pre>","313925","","","","","2013-11-30 17:43:35","How to adjust text font size to fit textview","<android><font-size><textview>","15","1","68","",""
"2617301","1","3944254","","2010-04-11 14:16:19","5","12059","<p>I have to animate a view from state A to B with changes to its scale, position and scrolling.</p><p>The following code almost does the trick:</p><pre><code>AnimationSet animation = new AnimationSet(true);int fromXDelta = view.getScrollX();int fromYDelta = view.getScrollY();view.scrollTo(0, 0);float scale = (float) widthB / (float) widthA;// Calculate toXDelta and toYDeltaTranslateAnimation translateAnimation = new TranslateAnimation(-fromXDelta, -toXDelta, -fromYDelta, -toYDelta);translateAnimation.setDuration(duration);animation.addAnimation(translateAnimation);ScaleAnimation scaleAnimation = new ScaleAnimation(1, scale, 1, scale);scaleAnimation.setDuration(duration);animation.addAnimation(scaleAnimation);animation.setAnimationListener(new AnimationListener() {    @Override    public void onAnimationEnd(Animation arg0) {        view.clearAnimation();        // Change view to state B by modifying its layout params and scroll    }    @Override public void onAnimationRepeat(Animation arg0) {}    @Override public void onAnimationStart(Animation arg0) {}});view.startAnimation(animation);</code></pre><p>The logic of onAnimationEnd makes the view flicker after the animation ends. Also if I don't call clearAnimation() the animation does not work as expected (why?).</p><p>Is this the right way to do this? </p><p>Thanks!</p>","143378","","143378","","2010-04-11 19:46:42","2012-12-15 19:21:10","Animating translation and scaling of view in Android","<android><animation><view>","2","0","3","",""
"2617388","1","2619327","","2010-04-11 14:44:01","1","3152","<p>I'm new to Android development, and I was wondering if anyone knew either how to make Tabs slide, or how to get a similar effect without tabs. I have quite a few tabs in my application, and it does not look good on devices with smaller screens. Or maybe tabs are not what I am looking for. If you don't know what I'm talking about, I'd like to reproduce something similar to Photoshop.com Mobile's effects screen.</p><p>I know this is possible. Thanks in advance! </p>","253567","","253567","","2010-04-11 20:15:55","2010-04-12 00:43:16","Is there a way to make Android tabs slide?","<android><tabs><move><slide><touches>","1","0","2","",""
"2617962","1","2618485","","2010-04-11 17:31:30","1","114","<p>I have an image file that has all the character sprites that I will be using in a game, and I want to make a layout that will allow the user to cycle through each image to be able to pick which one they want. So, I have one large image, and I need to render just a small (32 x 32) section of it at a time. Is that possible with the layouts or will I have to use a canvas, and manually do most of this?</p>","314005","","","","","2010-04-11 19:59:44","Can I user a layout on the android to render just part of an image at a time?","<java><android><image><layout>","1","0","1","",""
"2617969","1","2617986","","2010-04-11 17:32:35","5","26789","<p>I have the following code which creates an ImageButton and plays a sound when clicked:</p><pre><code>ImageButton SoundButton1 = (ImageButton)findViewById(R.id.sound1);SoundButton1.setImageResource(R.drawable.my_button);SoundButton1.setOnTouchListener(new OnTouchListener() {    public boolean onTouch(View v, MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN ) {            mSoundManager.playSound(1);            return true;        }        return false;    }});</code></pre><p>The problem is that I want the image on the ImageButton to change when you press it. The OnTouchListener appears to be overriding the touch and not allowing the images to change. As soon as I remove the OnTouchListener, the ImageButton swaps to a different image when pressed. Any ideas on how I can have the images change on the ImageButton while still using the OnTouchListener? Thank you very much!</p>","313717","","1006780","","2013-09-03 12:34:36","2013-09-03 12:34:36","How can I change the images on an ImageButton in Android when using a OnTouchListener?","<android><imagebutton>","2","0","1","",""
"2618140","1","","","2010-04-11 18:16:52","0","905","<p>I am able to create a grid view layout as shown  <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">Here</a>  <br></p><p>when a image is clicked I would like to bring that image to the foreground (full screen) for 2 seconds and then go back to the grid layout.<br>Can you please point me to the appropriate examples/docs or pointers  on how to do this .<br><br>Thanks</p>","94437","","","","","2010-10-12 13:12:49","Android gridview open image in foreground","<android><image><gridview>","1","0","","",""
"2618182","1","","","2010-04-11 18:28:45","42","66350","<p>I have been looking everywhere how to play a ringtone/alarm sound in Android. </p><p>I press a button and I want to play a ringtone/alarm sound. I could not find an easy, straightforward sample. Yes, I already looked at Alarm clock source code... but it is not straightforward and I cannot compile it.</p><p>I cannot make this work:</p><pre><code>Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); mMediaPlayer = new MediaPlayer();mMediaPlayer.setDataSource(this, alert);final AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);if (audioManager.getStreamVolume(AudioManager.STREAM_ALARM) != 0) {    player.setAudioStreamType(AudioManager.STREAM_ALARM);    player.setLooping(true);    player.prepare();    player.start();}</code></pre><p>I get this error:</p><pre><code>04-11 17:15:27.638: ERROR/MediaPlayerService(30): Couldn't open fd forcontent://settings/system/ringtone</code></pre><p>So.. please if somebody knows how to play a default ringtone/alarm let me know. </p><p>I prefer not to upload any file. Just play a default ringtone.</p>","314029","","2964945","","2014-02-21 12:21:46","2014-02-28 05:35:44","How to play ringtone/alarm sound in Android","<android><android-emulator>","7","0","26","",""
"2618272","1","2639159","","2010-04-11 18:55:45","65","26613","<p>I have a custom list adapter:</p><pre><code>class ResultsListAdapter extends ArrayAdapter&lt;RecordItem&gt; {</code></pre><p>in the overridden 'getView' method I do a print to check what position is and whether it is a convertView or not:</p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent) {        System.out.println(""getView "" + position + "" "" + convertView);</code></pre><p>The output of this (when the list is first displayed, no user input as yet)</p><pre><code>04-11 16:24:05.860: INFO/System.out(681): getView 0 null  04-11 16:24:29.020: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43d415d8  04-11 16:25:48.070: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43d415d8  04-11 16:25:49.110: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43d415d8  04-11 16:25:49.710: INFO/System.out(681): getView 0 android.widget.RelativeLayout@43d415d8  04-11 16:25:50.251: INFO/System.out(681): getView 1 null  04-11 16:26:01.300: INFO/System.out(681): getView 2 null  04-11 16:26:02.020: INFO/System.out(681): getView 3 null  04-11 16:28:28.091: INFO/System.out(681): getView 0 null  04-11 16:37:46.180: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43cff8f0  04-11 16:37:47.091: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43cff8f0  04-11 16:37:47.730: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43cff8f0  </code></pre><p>AFAIK, though I couldn't find it stated explicitly, getView() is only called for visible rows. Since my app starts with four visible rows at least the position numbers cycling from 0-3 makes sense. But the rest is a mess:</p><ul><li>Why is getview called for each row three times? </li><li>Where are these convertViews coming from when I haven't scrolled yet?</li></ul><p>I did a bit of reseach, and without getting a good answer, I did notice that people were associating this issue with layout issues. So in case, here's the layout that contains the list:</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=""fill_parent""    android:layout_width=""fill_parent""     android:orientation=""vertical"" &gt;    &lt;TextView android:id=""@+id/pageDetails""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" /&gt;    &lt;ListView android:id=""@+id/list""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:drawSelectorOnTop=""false"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>and the layout of each individual row:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""108dp""    android:padding=""4dp""&gt;&lt;ImageView    android:id=""@+id/thumb""            android:layout_width=""120dp""    android:layout_height=""fill_parent""            android:layout_alignParentTop=""true""    android:layout_alignParentBottom=""true""    android:layout_alignParentLeft=""true""    android:layout_marginRight=""8dp""            android:src=""@drawable/loading"" /&gt;&lt;TextView      android:id=""@+id/price""    android:layout_width=""wrap_content""    android:layout_height=""18dp""             android:layout_toRightOf=""@id/thumb""    android:layout_alignParentBottom=""true""           android:singleLine=""true"" /&gt;&lt;TextView      android:id=""@+id/date""    android:layout_width=""wrap_content""    android:layout_height=""18dp""             android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""     android:paddingRight=""4dp""           android:singleLine=""true"" /&gt;&lt;TextView    android:id=""@+id/title""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""17dp""     android:layout_toRightOf=""@id/thumb""    android:layout_alignParentRight=""true""    android:layout_alignParentTop=""true""    android:paddingRight=""4dp""       android:layout_alignWithParentIfMissing=""true""    android:gravity=""center"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Thank you for your time</p>","65025","","65025","","2010-04-11 19:44:58","2013-08-28 11:29:26","custom listview adapter getView method being called multiple times, and in no coherent order","<java><android><listview>","7","0","27","",""
"2618331","1","2618360","","2010-04-11 19:11:22","8","24148","<p>I want to add ImageView to FrameLayout with Gravity or margins. but FramLayout and ImageView has no method about that(Actually, I can't found that). Reason that selects Framelayout is to put ImageView on ImageView.</p><p>Help me plz. It is emergency for me to find solution.</p><p>thx.</p><p>Below is my code which help understanding my question.</p><pre><code>FrameLayout imageFrame = new FrameLayout(mContext);imageFrame.setLayoutParams(new GridView.LayoutParams(158, 158));ImageView frame = new ImageView(mContext);frame = new ImageView(mContext);frame.setLayoutParams(new LayoutParams(158, 158));frame.setScaleType(ImageView.ScaleType.CENTER_CROP);frame.setImageResource(R.drawable.image_frame_n);ImageView image = new ImageView(mContext);image.setLayoutParams(new LayoutParams(148, 148));image.setScaleType(ImageView.ScaleType.CENTER_CROP);image.setImageResource(mThumbIds[position]);// image is needed to have a margin or gravity to be positioned at center of imageFrameimageFrame.addView(image);imageFrame.addView(frame);</code></pre>","297060","","","","","2011-03-20 16:06:11","How to set gravity (or margins) of ImageView using code?","<android>","1","0","2","",""
"2618355","1","2683399","","2010-04-11 19:17:33","13","6228","<p>I'm used to handle graphics with old-school libraries (allegro, GD, pygame), where if I want to copy a part of a bitmap into another... I just use blit.</p><p>I'm trying to figure out how to do that in android, and I got very confused.So... we have these Canvas that are write-only, and Bitmaps that are read-only? It seems too stupid to be real, there must be something I'm missing, but I really can't figure it out.</p><p><em>edit</em>: to be more precise... <strong>if bitmaps are read only, and canvas are write only, I can't  blit A into B, and then B into C?</strong></p>","207655","","207655","","2010-04-21 14:29:19","2010-04-22 10:09:20","How to blit() in android?","<android><graphics><canvas><bitmap><blit>","2","0","10","",""
"2618573","1","4818714","","2010-04-11 20:22:51","21","4942","<p>I want to have a seperate project that runs my server communication code in a normal JVM for the purposes of integration testing.  This code uses these libraries which are build into the Android Framework...</p><p><a href=""http://developer.android.com/reference/org/apache/http/client/package-summary.html"">http://developer.android.com/reference/org/apache/http/client/package-summary.html</a></p><p>Does anybody know what version of Apache HTTP Client this is supposed to be?  I want to run it without the Android tests which are painfully slow.</p>","97901","","","","","2014-03-18 16:17:53","What version of Apache HTTP Client is bundled in Android 1.6?","<java><android><httpclient>","4","0","4","",""
"2618610","1","2618786","","2010-04-11 20:33:40","2","4122","<p>I'm trying to implement paging in a custom ListAdapter.  Right now I'm just making the request for the next page when the last item in the ListView becomes visible, by checking in <code>getView()</code> if <code>position</code> is <code>&gt;=</code> the size of <code>ListAdapter.getCount()</code>.  </p><p>It works fine, but I'm wondering if there's a better way (or a different way) that will only make the request once the last item in the list is actually visible to the user.  Anyone know of a way?  </p>","238849","","","","","2013-03-21 18:22:42","ListView/ListAdapter paging","<android>","3","0","6","",""
"2618630","1","2618813","","2010-04-11 20:39:46","5","5082","<p>I have a widget that supposed to call an Activity of the main app when the user clicks on widget body. My setup works for a single widget instance but for a second instance of the same widget the PendingIntent gets reused and as result the vital information that I'm sending as extra gets overwritten for the 1st instance. So I figured that I should pass widget ID as <code>Intent</code> data however as soon as I add <code>Intent#setData</code> I would see in the log that 2 separate Intents are appropriately fired but the Activity fails to pick it up so basically Activity will not come up and nothing happens (no error or warning ether)Here's how the activity is setup in the Manifest:</p><pre><code>    &lt;activity android:name="".SearchResultsView""          android:label=""@string/search_results""        &lt;intent-filter&gt;            &lt;action android:name=""bostone.android.search.RESULTS"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>And here's code that is setup for handling the click</p><pre><code>Intent di = new Intent(""bostone.android.search.RESULTS"");di.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);// if line below is commented out - the Activity will startdi.setData(ContentUris.withAppendedId(Uri.EMPTY, widgetId));di.putExtra(""URL"", url);views.setOnClickPendingIntent(R.id.widgetContent,     PendingIntent.getActivity(this, 0, di, 0));</code></pre><p>The main app and the widget are packaged as 2 separate APK each in its own package and Manifest</p>","135946","","","","","2011-10-31 21:37:54","Android: Adding data to Intent fails to load Activity","<android><activity><widget><android-intent><android-pendingintent>","1","0","4","",""
"2618650","1","","","2010-04-11 20:47:34","1","3008","<p>Good Afternoon,</p><p>I have a spinner array containing 3 spinners.  Each spinner is populated via a res string array.  Each array contains the numbers 1-100. When the activity starts each spinner contains a string array of 1-100 and when you click on a spinner the first choice is 1.</p><p>Say a user picks 25 on the first spinner.  I'd like the 2nd spinner to show 25 as the starting point for scrolling when the spinner is clicked but not fire the spinner.  The 2nd spinner would still contain the array 1-100 though so a user could scroll down to a lessor number if the wanted to.</p><p>I've tried using setSelection but that causes the 2nd spinner to fire causing undesirable effects (an edit box is populated with the 2nd number even though the user hasn't clicked the 2nd spinner).  I would like the 2nd spinner to just show 25 as the starting point.</p><p>How do I do this?</p>","278350","","","","","2011-12-12 23:57:18","Setting the position within a spinner","<android><spinner>","1","0","","",""
"2618967","1","4057309","","2010-04-11 22:33:02","198","96233","<p>This is probably a pretty easy to answer question, but I can't find the solution myself after a couple hours of searching the documentation and Google. I set the orientation of my Android app to <code>landscape</code> in the <code>AndroidManifest.xml</code> file:</p><pre><code>android:screenOrientation=""landscape""</code></pre><p>However, when I run the app in the simulator, it appears sideways and in portrait mode. How can I switch the emulator to <code>landscape</code> mode on a <code>mac</code>? It's running the 1.6 SDK. </p>","313717","","1727181","","2013-01-15 11:33:55","2014-03-27 03:48:40","Switching to landscape mode in Android Emulator","<android><android-emulator>","15","1","61","",""
"2619322","1","","","2010-04-12 00:42:36","0","985","<p>I'm fairly new to android programming and need some information for a 4th year forensics course project. Basically I am trying to create a suite of tools for live analysis of an android phone. I know how to get the information I need on the phone, but I was wondering if there was a way to communicate that information back to the PC? I want to be able to run a program from a PC, which, when the phone is docked, will allow the user to access information about the phone (ie currently running services/processes, bluetooth/wifi connections, etc). I have a bunch of methods that will run on the phone and get all the information, but I want to be able to call those methods from the PC, execute on the phone, then have the information sent back to the PC to display to the user instead of just displaying it on the phone. This is to leave as small a footprint on the phone as possible. Thanks a lot.</p>","314145","","","","","2010-04-12 16:32:14","Communicating with the PC via USB connection in Android","<android>","1","0","","",""
"2619335","1","","","2010-04-12 00:45:55","0","1301","<p>I've got a lot of experience in Java but none developing mobile apps.  I'd like to write an application using Java/Swing and then convert it for use on an Android phone.</p><p>Is this feasible or do I really need to develop from the ground up for the Android platform?</p><p>I don't own an Android phone as I can't afford one at the moment, and the Android emulator is so slow that I find myself wasting a lot of time sitting around waiting.</p>","314148","","","","","2012-07-01 12:34:22","Can I write an Android app in Java and convert it later?","<java><android>","4","0","0","",""
"2620049","1","","","2010-04-12 05:27:20","10","33086","<p>I am beginner in android development and try to play video from link. But it's giving error <code>""sorry,we can't play this video""</code>. I tried so many links but for all links its show same error.</p><p>My code is the following </p><pre><code>public class VideoDemo extends Activity {        private static final String path =""http://demo.digi-corp.com/S2LWebservice/Resources/SampleVideo.mp4""; private VideoView video; private MediaController ctlr; @Override public void onCreate(Bundle icicle) {            super.onCreate(icicle);            getWindow().setFormat(PixelFormat.TRANSLUCENT);            setContentView(R.layout.videoview);            video = (VideoView) findViewById(R.id.video);            video.setVideoPath(path);            ctlr = new MediaController(this);            ctlr.setMediaPlayer(video);            video.setMediaController(ctlr);            video.requestFocus();     }}</code></pre><hr><p>Logcat shows following error message:</p><pre><code>04-12 15:04:54.245: ERROR/PlayerDriver(554): HandleErrorEvent: PVMFErrTimeout</code></pre>","314242","","1904504","","2014-01-03 05:28:51","2014-01-03 05:28:51","how to play video from url","<android><video-streaming><videoview>","3","1","5","",""
"2620177","1","2620252","","2010-04-12 06:13:19","38","48313","<p>Currently I have a class that is extending the ListActivity class.  I need to be able to add a few static buttons above the list that are always visible.  I've attempted to grab the ListView using getListView() from within the class.  Then I used addHeaderView(View) to add a small layout to the top of the screen.</p><p>Header.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"" &gt;    &lt;Button         android:id=""@+id/testButton""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:text=""Income""         android:textSize=""15dip""        android:layout_weight=""1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Before I set the adapter I do:</p><pre><code>ListView lv = getListView();lv.addHeaderView(findViewById(R.layout.header));</code></pre><p>This results in nothing happening to the ListView except for it being populated from my database.  No buttons appear above it.</p><p>Another approach I tried as adding padding to the top of the ListView.  When I did this it successfully moved down, however, if I added any above it, it pushed the ListView over.  No matter what I do it seems as though I cannot put a few buttons above the ListView when I used the ListActivity.</p><p>Thanks in advance.</p><p>synic, I tried your suggestion previously.  I tried it again just for the sake of sanity, and the button did not display.  Below is the layout file for the activity and the code I've implemented in the oncreate(). </p><p>//My listactivity I am trying to add the header to</p><pre><code>public class AuditActivity extends ListActivity {    Budget budget;    @Override    public void onCreate(Bundle savedInstanceState) {        Cursor test;        super.onCreate(savedInstanceState);        setContentView(R.layout.audit);        ListView lv = getListView();        LayoutInflater infalter = getLayoutInflater();        ViewGroup header = (ViewGroup) infalter.inflate(R.layout.header, lv, false);        lv.addHeaderView(header);        budget = new Budget(this);        /*        try {            test = budget.getTransactions();            showEvents(test);        } finally {        }        *///      switchTabSpecial();    }</code></pre><p>Layout.xml for activity:</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;ListView android:id=""@android:id/list"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:id=""@android:id/empty"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""@string/empty"" /&gt;&lt;/LinearLayout&gt;</code></pre>","246639","","246639","","2010-04-13 22:09:46","2013-09-20 16:24:18","Android: Adding static header to the top of a ListActivity","<android><header><listactivity>","5","0","17","",""
"2620203","1","2620248","","2010-04-12 06:21:16","1","852","<p>I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. ""Application xxx could not be installed on this phone"".</p><p>Before I tried installing my app on the phone or AVD I following steps:1. Exported an unsigned copy of application onto my hard-drive.2. User jarsigner to sign the app3. Verified with jarsigner that my app is signed properly.4. Used zipalign to optimize the app resources.</p><p>I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly. </p><p>I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone.</p><p>My AVD is on 2.1 though and code is compiled with 1.5. </p><p>Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful.</p><p>Cheers</p>","57847","","","","","2010-04-12 06:33:05","Error while Installing Android app on Android virtual device","<android><installation>","2","1","0","",""
"2620246","1","2620322","","2010-04-12 06:32:38","2","632","<p>I was wondering how to obtain this result :</p><p><a href=""http://img718.imageshack.us/img718/6173/screenshot20100411at126.png"" rel=""nofollow"">http://img718.imageshack.us/img718/6173/screenshot20100411at126.png</a></p><p>This is what I tried :</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:background=""#CCCCCC""                  android:orientation=""horizontal""                  android:layout_weight=""0""&gt;        &lt;Button android:id=""@+id/btn_cancel""                android:text=""@string/cancel""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_margin=""5px""                android:gravity=""left""                /&gt;        &lt;Button android:id=""@+id/btn_save""                android:text=""@string/save""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_margin=""5px""                android:layout_toRightOf=""@id/btn_cancel""                android:gravity=""right""/&gt;    &lt;/RelativeLayout&gt;</code></pre><p>I tried to play with the layout_width properties and setting them up to fill parents both of them but did not work, if anyone has an idea ... Thank you !</p>","290613","","","","","2010-04-12 06:58:02","How to do this layout? (Link on Image)","<android><android-layout>","1","2","1","",""
"2620305","1","","","2010-04-12 06:45:43","2","1702","<p>The network interfaces on Android interfaces are listed as directories in the file system in <strong>/sys/class/net/</strong>.</p><p>For most Android devices the network interface for gprs traffic is called <strong>rmnet0</strong> and for Wi-Fi it's usually <strong>eth0</strong> or <strong>tiwlan0</strong>.</p><p>I suspect that the cell interface for the Motorola CLIQ XT is <strong>rmnet0</strong>, but I would like to have this confirmed + know the name of the Wi-Fi interface.</p><p>Also it would be good to know the device id for this model. This is the value available as <strong>android.os.Build.DEVICE</strong> in the Java SDK. (E.g. T-Mobile G1 uses <em>dream</em>, Samsung Galaxy uses <em>GT-I7500</em>, and Motorolda Droid uses <em>sholes</em>.)</p>","314276","","314276","","2010-04-14 07:43:41","2010-04-14 07:45:52","What are the names of network interfaces on the Motorola CLIQ XT?","<android><motorola><clique>","1","0","","",""
"2620346","1","","","2010-04-12 06:55:45","0","7054","<p>I have an iPhone and am getting the Droid and was wondering if blender games can run on either of them. I have already made a game and want to be able to use it on my phone.</p>","279164","","","","","2013-09-23 16:34:57","Can you run a blender game on an iphone or droid?","<iphone><android><blender>","2","3","","",""
"2620403","1","2621005","","2010-04-12 07:07:49","0","290","<p>When back key is pressed, current activity goes background.I'd like to show a popup and let user choose really close this activity,before current activity go background.I tried to override onPause(), but it's called after activity goes back.</p><p>Please somebody explains me how to do that?</p>","280137","","280137","","2010-04-12 08:10:15","2010-04-12 09:35:07","how can I do something before current activity go background by Back key?","<android>","2","0","","",""
"2620444","1","","","2010-04-12 07:18:29","132","42743","<p>I have a dialog with <code>EditText</code> for input. When I click yes button on dialog, it will validate the input and then close dialog. However, if the input is wrong, i want to remain in the same dialog. every time no matter what input it is, the dialog always automatically close when i click button. How can i disable this. By the way, i use PositiveButton and NegativeButton for the button on dialog</p>","304881","","308315","","2012-12-24 00:21:57","2013-11-13 21:17:19","How to prevent a dialog from closing when a button is clicked","<android><dialog><android-alertdialog><android-dialog><android-dialogfragment>","7","1","47","",""
"2620542","1","","","2010-04-12 07:45:48","2","6913","<p>I'm new here. I have been trying to create a video capture app using the android emulator without much success. As far as I know and looking through all the samples and code on the internet (this site and others), I must still be missing a step. </p><p>I've tried using this sample near the end of this thread made by JonPro: <a href=""http://www.anddev.org/viewtopic.php?p=24723#24723"" rel=""nofollow"">http://www.anddev.org/viewtopic.php?p=24723#24723</a> </p><p>and I've tried making my own but the media recorder would always fail on the prepare stage with the most unhelpful message of 'prepare failed'. I have no clue what I am missing. I seem to have the correct permissions and a SDCard is mounted according to the emulator. Should I be using a android SDK version other than 2.1?</p><p>Even though the code in that forum claims to work, I figured out that this line was missing:recorder.setCamera(camera); </p><p>But still no joy as the logs shows that: 'Failed to get camera(0x16b70) parameters' when prepare() is called but it still doesn't make sense as the preview is okay, but no recording! Any help or suggestions will be appreciated.</p><p>Edit: Can anyone confirm that this can work for the SDK and the emulator? or I'm I wasting my time trying to get this to work in this version. Am I able to get the source code for the prepare function as it is OpenSource?</p>","314306","","213269","","2011-08-12 09:10:14","2011-08-12 09:10:14","MediaRecorder Prepare Failed","<android><mediarecorder>","2","1","1","",""
"2620593","1","2620834","","2010-04-12 08:00:23","7","7252","<ul><li>I am trying to run android sample applications using intellij idea and R.java file is missing form notepad samples source directory.</li></ul>","71858","","","","","2013-10-22 21:31:17","What's the easiest way to force Idea to generate the R.java file?","<android><intellij-idea>","9","0","1","",""
"2620673","1","","","2010-04-12 08:22:49","1","628","<p>My activity occasionally gets hung somewhere in it's looper.</p><p>From the log I can see an eventual timeout is logged, and then there's a win-death.</p><pre><code>WARN/ActivityManager(1052): Activity pause timeout for HistoryRecord{1234 {com.company.app/com.company.app.App}}...WARN/ActivityManager(1052): Activity idle timeout for HistoryRecord{1234 {com.company.app/com.company.app.App}}...INFO/Process(416): Sending signal. PID: 416 SIG: 9INFO/WindowManager(1052): WIN DEATH: Window{1234 com.company.app/com.company.app.App paused=false}</code></pre><p>How can I debug this?  Can I get a stack-trace when it's interrupted?</p>","15721","","","","","2010-04-12 08:22:49","Android debugging timeouts","<android><debugging>","0","2","","",""
"2620858","1","2621306","","2010-04-12 09:03:46","15","12721","<p>I am planning a web app using GWT. How well will it be supported on mobile devices like iphone, android? </p>","314256","","","","","2011-11-03 10:42:03","Does GWT app work well in Android browser?","<android><gwt>","3","0","2","",""
"2620917","1","2620949","","2010-04-12 09:17:47","53","22208","<p>I read a lot on how to save my instance state or how to deal with my activity getting destroyed during screen rotation. </p><p>There seem to be a lot of possibilities but I haven't figured out which one works best for retrieving results of an AsyncTask.</p><p>I have some AsyncTasks that are simply started again and call the <code>isFinishing()</code> method of the activity and if the activity is finishing they wont update anything.  </p><p>The problem is that I have one Task that does a request to a web service that can fail or succeed and restarting the task would result in a financial loss for the user. </p><p>How would you solve this? What are the advantages or disadvantages of the possible solutions?</p>","114066","","","","","2013-10-01 11:53:10","How to handle an AsyncTask during Screen Rotation?","<android><android-asynctask><screen-rotation>","11","2","28","",""
"2620978","1","","","2010-04-12 09:30:39","0","1079","<p>how can i simulate camera of an android device?And what is the format of image obtained?thanks in advance..</p>","309860","","","","","2011-03-31 03:00:39","camera in android","<android>","2","1","","",""
"2621125","1","2621209","","2010-04-12 09:57:32","4","5973","<p>i am using a class which extends Handler class to update my activity UI.The code is as follows in side main activity,</p><pre><code>public class RefreshHandler extends Handler {     public void handleMessage(Message msg) {      Homeform.this.updateUI();     }     public void sleep(long delayMillis) {      this.removeMessages(0);         sendMessageDelayed(obtainMessage(0), delayMillis);     } }; private void updateUI(){  Log.v("""","" I am inside Update UUI====================="");  refresh();     mRedrawHandler.sleep(5000); }</code></pre><p>And i had call this method handleMessage() on the object of RefreshHandler as follows</p><pre><code>mRedrawHandler = new RefreshHandler();mRedrawHandler.handleMessage(new Message());</code></pre><p>But here i am facing one problem that it is running after closing my application also .</p><p>please solve my problem to stop this handler when close this application.</p><p>Thank you..</p>","247921","","243709","","2011-03-24 11:20:37","2011-03-24 11:20:37","stopping android handler loop","<android>","2","2","","",""
"2621274","1","2621661","","2010-04-12 10:24:35","0","792","<p>I am trying to set ""textColor"" property of button in android 2.1. But I am unable to set it to correct value ? What is the correct way of setting ""textColor"" property of a button in android 2.1 ?</p>","248132","","","","","2010-04-12 11:33:29","How to set ""textColor"" property of button in android 2.1?","<android>","1","0","","",""
"2621395","1","2622473","","2010-04-12 10:46:58","32","14075","<p>I currently have a Service in Android that is a sample VOIP client so it listens out for SIP messages and if it recieves one it starts up an Activity screen with UI components.</p><p>Then the following SIP messages determine what the Activity is to display on the screen.For example if its an incoming call it will display Answer or Reject or an outgoing call it will show a dialling screen.</p><p>At the minute I use Intents to let the Activity know what state it should display.</p><p>An example is as follows:</p><hr><pre><code>        Intent i = new Intent();        i.setAction(SIPEngine.SIP_TRYING_INTENT);        i.putExtra(""com.net.INCOMING"", true);        sendBroadcast(i);        Intent x = new Intent();        x.setAction(CallManager.SIP_INCOMING_CALL_INTENT);        sendBroadcast(x);        Log.d(""INTENT SENT"", ""INTENT SENT INCOMING CALL AFTER PROCESSINVITE"");</code></pre><hr><p>So the activity will have a broadcast reciever registered for these intents and will switch its state according to the last intent it received.</p><p>Sample code as follows:</p><hr><pre><code>       SipCallListener = new BroadcastReceiver(){            @Override            public void onReceive(Context context, Intent intent) {                    String action = intent.getAction();                     if(SIPEngine.SIP_RINGING_INTENT.equals(action)){                        Log.d(""cda "", ""Got RINGING action SIPENGINE"");                        ringingSetup();                    }                             if(CallManager.SIP_INCOMING_CALL_INTENT.equals(action)){                        Log.d(""cda "", ""Got PHONE RINGING action"");                        incomingCallSetup();                    }              }        };        IntentFilter filter = new IntentFilter(CallManager.SIP_INCOMING_CALL_INTENT);        filter.addAction(CallManager.SIP_RINGING_CALL_INTENT);        registerReceiver(SipCallListener, filter);</code></pre><hr><p>This works however it seems like it is not very efficient, the Intents will get broadcast system wide and Intents having to fire for different states seems like it could become inefficient the more I have to include as well as adding complexity.</p><p>So I was wondering if there is a different more efficient and cleaner way to do this?</p><p>Is there a way to keep Intents broadcasting only inside an application?</p><p>Would callbacks be a better idea? If so why and in what way should they be implemented? </p>","243999","","243999","","2010-04-12 11:03:32","2014-03-02 23:05:59","More efficient way of updating UI from Service than intents?","<android><user-interface><service><performance><android-intent>","2","0","33","",""
"2621565","1","","","2010-04-12 11:15:03","1","3830","<p>In my application I want to create a directory xyz in sdcard at the runtime from the my Application.</p><p>But it doesn't work. </p><p>Here is my code..</p><pre><code>public class process extends Activity{/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    String[] str ={""mkdir"",""/sdcard/xyz""};    try {         Process ps = Runtime.getRuntime().exec(str);        try {            ps.waitFor();        } catch (InterruptedException e) {            e.printStackTrace();        }     } catch (IOException e) {        Toast.makeText(this, """"+e, Toast.LENGTH_LONG).show();  }}}</code></pre>","273514","","","user658042","2011-12-10 13:40:01","2013-07-23 21:36:12","execute adb shell command at runtime from the android application","<android><shell><command><execute><adb>","2","1","1","",""
"2621776","1","2621988","","2010-04-12 11:51:54","1","9155","<p>I tried multiple solution but none seem to work. Layout:</p><pre><code>--------------------|btn1|  txt1  |btn2|--------------------|                  ||                  ||                  ||     txtview1     ||                  ||                  ||                  |--------------------</code></pre><p>btn1 - top left aligned - decrease txt1<br>btn2 - top right aligned - increase txt1<br>txt1 - top center aligned - text/number entered with code<br>textview1 - client aligned with vertical scrollbar, if needed - text entered with code</p>","264618","","","","","2011-05-01 09:56:42","Android: How to make current layout with scrollable text view?","<android><layout><button><scroll><textview>","2","0","1","",""
"2621996","1","2622140","","2010-04-12 12:29:53","2","462","<p>I'm working on an Android app in which I would like to use multi-touch. However, I do not want to completely leave out those still running a 1.x OS phone.  How do you program the app so that you can use the 2.x multi-touch APIs (or any other higher level API for that matter) and still allow it to gracefully degrade on 1.x systems.  If you create a project in Eclipse for 1.x can you even still access the 2.x APIs?Basically I want it to show up in the marketplace and work on all 1.6 and higher phones and just allow access to the higher level functionality if available.</p><p>Also, if anyone can point me to any data on the number of 1.x devices vs. 2.x devices in use, it would be greatly appreciated.</p>","194","","","","","2012-02-21 09:56:42","Android app using 2.x APIs that will also run on 1.x","<java><android><eclipse>","3","0","","",""
"2622021","1","2622167","","2010-04-12 12:33:38","1","866","<p>If I create an application for Android, how do you package extra items in with it like a live wallpaper or widgets?  For example, google maps does this by including a live wallpaper with the download of the latest version.<br>On a related note, with google maps, it's available for, I believe, 1.6 and up, but it seems that it is all the same download.  So how do you ensure that, even though there may be a 2.x only feature included, it still shows up for lower OS phones?  Or is the marketplace maybe actually holding onto two separate APKs for each OS?</p>","194","","","","","2010-04-12 12:53:18","Packaging multiple items in an Android APK","<android><apk>","1","2","0","",""
"2622206","1","2622227","","2010-04-12 13:01:55","7","7145","<p>May i please know how can i delete the content of the file in java?Thanks in advance.</p>","196579","","","","","2013-12-17 13:03:14","How to delete only the content of a file in java?","<java><android>","5","0","1","",""
"2622453","1","","","2010-04-12 13:38:59","1","826","<p>At present i am working on hal part of sensors in android sdk, we are using 3- Axis BMA-150  Accelerometer sensor to get acceleration values with respect to X,y,Z Axis, I want to know whether this sensor will give o/p directly in SI units by using some calibration techniques or what ? , and i noticed that in sensor.c file they mentioned</p><p>720.0 LSG = 1G(9.8 m/s2), what is the relation between LSG and acceleration due to gravity?what is meant by LSG</p><p>why they are multiplying the o/p of accelerometer x,y,z valuse with 9.8/720.0f . please help on this part .</p><p>ThanksVinay</p>","314555","","152522","","2010-04-12 13:48:44","2011-01-28 06:36:50","Regarding BMA-150 Acceleration sensor","<android>","1","0","","",""
"2622471","1","","","2010-04-12 13:41:29","2","2478","<p>I'm trying to modify a ListView scrollbar's width without success</p><pre><code>&lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:choiceMode=""singleChoice""    android:scrollbars=""vertical""    android:scrollbarTrackVertical=""@drawable/scrollbar_vertical_track""    android:scrollbarThumbVertical=""@drawable/scrollbar_vertical_thumb""    android:scrollbarSize=""4px""    android:clickable=""true""/&gt;</code></pre><p>First I tried using a drawable image 4px wide, but the .png was resized. Then I tried using a shape extracted from SamplesApi, without success.</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:width=""40px""&gt;&lt;gradient android:startColor=""#505050"" android:endColor=""#C0C0C0""        android:angle=""0""/&gt;&lt;corners android:radius=""0dp"" /&gt;</code></pre><p></p><p>I've tried with and without the android:width attribute.</p><p>There's a question on the same topic (http://stackoverflow.com/questions/2565083/width-of-a-scroll-bar-in-android), but it doesn't try anything different that what I'm already trying. As far as I know, creating my own theme shouldn't change the output.</p><p>There's an example in SamplesApi (Views/ScrollBars). I tried modifying the scrollbarSize attribute without result.</p><p>I know about ninepatch images, but there's an attribute which should do what I want.</p><p>Any hint? Thanks in advance.</p>","218473","","","","","2011-10-19 21:59:55","Android ignores scrollbarsize","<android><listview><scrollbar>","2","0","2","",""
"2622550","1","","","2010-04-12 13:54:58","0","2325","<p>I want to open the soft key pad when we click on or focus on edit text.Suppose in my application I have one Edittext view and image view at that time when i click on image view automatically the soft key pad will be closed.when i click on or focus on edittext at that time only Soft keypad will be opened what can i do? give me some suggestions.Thanks in advance</p>","454808","","","","","2010-08-17 12:30:39","close the soft key pad when i click on other views in android","<android>","2","0","1","",""
"2622570","1","","","2010-04-12 13:58:12","-1","705","<p>I followed the tutorial ""Tab Layout"" and i created my TabActivity with some tab, in particular i have a tab called ""newTab"" with a button and i want to add a new tab when i press it.</p><p>If i implement the OnClickListener in the newTab Activity i don't know how to call the tabHost.addTab() method because it is a TabActivity method, and if i implement the OnClickListener in the TabActivity i don't know how to assign the button event to it... so how can i do it?</p><p>Tnk's All</p>","314554","","314554","","2010-04-12 19:32:18","2010-04-12 20:07:40","TabActivity and Activity event Handling","<android>","1","0","","",""
"2622599","1","2622645","","2010-04-12 14:02:20","3","205","<p>Is there a way to find out if an activity is bound to a service? Something like <code>boolean isBoundToService(ServiceConnection sc)</code>?</p><p>Sometimes when I play around with my app I get an exception when it tries to unbind a service which is not bound.</p>","283494","","","","","2010-04-12 14:08:10","Android, Quick question on service binding","<java><android>","1","0","","",""
"2622694","1","3695888","","2010-04-12 14:14:54","3","2689","<p>I'm compiling using android tools <i>without eclipse</i>.</p><p><b>I compile launching ""ant debug"" from command line.</b></p><p>I have found many many instructions around the web about how to remove with annoying warning, but I haven't been able to make any of them work.</p><p>I've tried -D option, I've tried randomly tweaking build.* files, I've tried exporting an environment variable... nothing.</p><p>I guess some of these methods just don't work, and some others would work but I've been doing them incorrectly. Anything is possible and I can't stand it any more: any advice on how to do it?</p>","207655","","","","","2012-07-11 09:34:30","android: getting rid of ""warning: unmappable character for encoding ascii""","<java><android><encoding><internationalization>","4","0","2","",""
"2622928","1","","","2010-04-12 14:49:15","1","338","<p>Bear with me as i'm just learning about Android.What i'm trying to do is to open an Activity when i click on a button.This is my code in my main activity</p><pre><code>public class MainPage extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button restaurants = (Button) findViewById(R.id.widget88);    restaurants.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            Intent myIntent = new Intent(view.getContext(), AZRestaurants.class);            startActivityForResult(myIntent, 0);                       }    });    //Button location = (Button) findViewById(R.id.location);    //location.setOnClickListener(new View.OnClickListener() {        //public void onClick(View view) {        //  Intent myIntent = new Intent(view.getContext(), Location.class);        //  startActivity(myIntent);        //}  //  });}</code></pre><p>The program launches no problem when i just implement the first button (restuarant).</p><p>But when i try to implement the button that i have commented out it fails to launch.and yes i have added the activity to the manifest file.</p><p>Can anyone help me please?</p><p>Thanks.</p>","314610","","","","","2012-10-23 02:50:25","Android problem with opening a second activity and fails to launch","<android><android-manifest>","0","6","0","",""
"2623168","1","2623302","","2010-04-12 15:23:33","0","642","<p>In the Google Maps application, when you open the menu and click on ""Directions"", it pops up a dialog that is unique to Google Maps.  It keeps the MapView in the background, but displays the search dialog from the top (or bottom, if you're on an old version of Android).</p><p>I was curious if anyone knew how they achieved this effect.  I'm willing to create a custom Dialog, but it seems that Dialogs are designed to pop into the middle of the screen (any other types of dialogs are denied permission as system dialogs).  What trick is Google Maps using?</p>","60261","","","","","2010-04-12 15:41:20","How do you create a Google Maps-esque drop down dialog?","<android>","1","0","","",""
"2623277","1","2664601","","2010-04-12 15:37:50","0","539","<p>I am completely new to the NDK.</p><p>I have done a couple of the tutorials including the hello from jni oneand another one that calculates the sum of two numbers.</p><p>They involved using cygwin and the ndk to create the library so fileand I have a bit of a grasp on how to insert my own libraries into thelibraries layer of Android.</p><p>I have now been asked to access the native libraries on Android andsee what I can use them for.</p><p>My question is can I do this?</p><p>The STABLE-APIS.txt document is a bit vague and mentions the followingas Stable C++ API's in Android 1.5</p><hr><p>cstddef</p><p>new</p><p>utility</p><p>stl_pair.h</p><hr><p>Does that mean I can access them?</p><p>If so then how do I go about it? I dont think that following thetutorials I have already done would be any help?</p><p>Any pointers on how to do this or links to tutorials etc.. would begreatly appreciated </p>","243999","","243999","","2010-04-12 15:49:44","2010-04-19 00:38:48","What can I access in Androids Native libraries? And How?","<java><c++><android><jni><android-ndk>","1","1","3","",""
"2623392","1","","","2010-04-12 15:54:32","0","1946","<p>I'm currently developing a Field-Service application that stores data in the local sqlite database on an android device. At some point, usually after completing the data collection rounds, the local sqlite db is to be synchronized to a remote sybase db on the server.</p><p>Any suggestions as to how this could be achieved or engineered as a solution? Or even better, are there alternatives to synchronizing data in such an application?</p>","314688","","","","","2012-06-11 16:51:14","Synchronizing the sqlite database on Android to a Sybase database on server","<java><xml><android><sqlite><sybase>","1","0","","",""
"2623516","1","2623546","","2010-04-12 16:09:28","8","4395","<p>Sorry for the ambiguous title but I'm doing the following to write a simple string to a file:</p><pre><code>try {        File root = Environment.getExternalStorageDirectory();        if (root.canWrite()){            System.out.println(""Can write."");            File def_file = new File(root, ""default.txt"");            FileWriter fw = new FileWriter(def_file);            BufferedWriter out = new BufferedWriter(fw);            String defbuf = ""default"";            out.write(defbuf);            out.flush();            out.close();        }        else            System.out.println(""Can't write."");}catch (IOException e) {        e.printStackTrace();}</code></pre><p>But <code>root.canWrite()</code> seems to be returning false everytime. I am not running this off of an emulator, I have my android Eris plugged into my computer via USB and running the app off of my phone via Eclipse. Is there a way of giving my app permission so this doesn't happen?</p><p>Also, this code seems to be create the file <code>default.txt</code> but what if it already exists, will it ignore the creation and just open it to write or do I have to catch something like <code>FileAlreadyExists</code>(if such an exception exists) which then just opens it and writes?</p><p>Thanks for any help guys.</p>","278447","","","","","2012-12-11 08:26:27","Cannot write to SD card -- canWrite is returning false","<android><file-io>","3","0","2","",""
"2623888","1","12866521","","2010-04-12 17:08:17","14","8724","<p>I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android.  I'm curious as to what the best way to do this is.  I certainly have a couple of ideas for how to do this, but they are not optimal.</p><p>I need to be able to apply a new mask to the image every so often (the black and white bitmap will change every few seconds).</p><p>Any feedback on how to achieve this would be greatly appreciated.</p>","308118","","","","","2012-10-12 20:19:47","Masking a Drawable/Bitmap on Android","<android><bitmap><mask><drawable>","3","1","3","",""
"2624202","1","12640570","","2010-04-12 17:59:40","2","193","<p>I'm looking for the most suitable class to be a dispatcher for AsyncTasks invoked from my Activities. </p><p>I think it could be one of these: </p><ol><li>subclass of <strong>Application</strong>; </li><li>subclass of <strong>Service</strong>; </li><li>my own <strong>static</strong> stuff. </li></ol><p>As for me - it's simlier to implement the 3rd choice. But the question is will it be more ""death-resistant"" than Service or Application? Also it's very interesting what will live longer - Application or Service? My guess is the Application lives as long as the app (task in terms of Android) process lives.</p><p>So basically I need to range those options by their ""death-resistant"" quality, because I'd like to rely on the most ""static"" thing.</p>","247013","","810368","","2012-09-28 13:09:14","2012-09-28 13:09:14","What's the most ""death-resistant"" component on Android?","<android><android-asynctask><android-service><android-lifecycle>","1","5","","",""
"2624583","1","","","2010-04-12 18:59:36","1","166","<p>I maintain and develop on the Windows Mobile platform. </p><p>I know the market is changing rapidly with iPhone and Android gaining market shares.</p><p>There are also app development platforms like rhomobile/titanium.</p><p>Are there any platform/non platform specific mobile conferences this year?</p><p>What would be some of the important/useful conferences to attend in the mobile arena?</p><p>Thanks in advance.</p>","300352","","","","","2010-04-12 19:35:58","What developer conferences/code camps would one go for mobile development?","<iphone><android><windows-mobile><titanium><rhomobile>","4","1","","",""
"2624649","1","2624923","","2010-04-12 19:08:22","3","2231","<p>I have the following TextView in my XML layout file:-</p><pre><code>&lt;TextView     android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/autolink_test""       android:autoLink=""all""/&gt;</code></pre><p>The string autolink_test contains a phone number, an email address, a website address and a physical geographical address.</p><p>While the first three are showing up correctly as clickable autolinks, the address does not. Only the zipcode part shows up as an autolink... and that too as a phone number! (When I click it, the phone dialer starts up with that number).</p><p>Any help would be appreciated.</p>","289918","","60261","","2010-04-12 19:08:48","2013-04-02 08:28:20","autoLink for map not working","<android><android-widget>","2","2","","",""
"2625044","1","2625083","","2010-04-12 20:07:50","3","10787","<p>I'm kinda stuck with something which must be appalingly simple. I'm trying to write a few variables to a file, each on it's own line so that I'll be able to use readLine in another method to read the variables back in.</p><p>Here's the code:</p><pre><code>package com.example.files2;import java.io.BufferedWriter;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.FileWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.os.Environment;import android.widget.Toast;public class files2 extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    String string1 = ""Hey you"";    String string2 = ""Is there anybody there"";    String string3 = ""Can you hear me"";    setContentView(R.layout.main);    try{    File file = new File(Environment.getExternalStorageDirectory(), ""file.txt"");    BufferedWriter writer = new BufferedWriter(new FileWriter(file));    writer.write(string1);    writer.newLine();    writer.write(string2);    writer.newLine();    writer.write(string3);    writer.newLine();    writer.flush();    writer.close();} catch (IOException e) {    e.printStackTrace();}}}</code></pre><p>The file writes OK, but instead of each variable being on it's own line, I get just one line which reads'Hey youIs there anybody thereCan you hear me'.</p><p>So I guess .newLine() isn't working but why? </p><p>Is there a simple answer to this problem or a better way to achieve it?</p><p>Thanks all, comments warmly appreciated.</p><p>Joe</p>","310794","","","","","2012-06-15 12:39:09","Simple Android File Output Problem","<android><file><newline>","2","0","1","",""
"2625169","1","","","2010-04-12 20:24:36","0","6035","<p>Ive noticed that the time in my emulator for android projects is wrong. Its one hour behind. How do I go about changing the time and can I do it in eclipse?</p><p>Thanks</p>","314610","","","","","2013-07-24 16:42:05","Android: how to change the time in emulator?","<android><eclipse><android-emulator>","6","0","","",""
"2625246","1","5040842","","2010-04-12 20:34:35","4","9455","<p>I have a PreferenceActivity with a bunch of (Sub)PreferenceScreens. Each such (Sub)PreferenceScreen represents an account and has the account-username as its title.</p><pre><code>PreferenceScreen root = mgr.createPreferenceScreen(this);for (MyAccountClass account : myAccounts) {    final PreferenceScreen accScreen = mgr.createPreferenceScreen(this);    accScreen.setTitle(account.getUsername());    // add Preferences to the accScreen    // (for instance a ""change username""-preference)    ...    root.add(accScreen);}</code></pre><p>As the user enters sub-PreferenceScreen, and edits the account user-name, I want the outer PreferenceScreen to update it's PreferenceScreen-title for the account in question.</p><p>I've tried to add...</p><pre><code>usernamePref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {    public boolean onPreferenceChange(Preference preference, Object newValue) {        accScreen.setTitle(newValue.toString());        return true;    }});</code></pre><p>...but the accScreen.setTitle does not seem to take effect on the outer PreferenceScreen. I've note that calling <code>onContentChanged();</code> actually makes it work, but I realize that this is probably not the preferred way of doing it.</p><p>I suspect I should call <code>postInvalidate()</code> on some view somewhere, but I really can't figure out on what view and when to do it.</p><p><a href=""http://stackoverflow.com/questions/2396153/preferencescreen-androidsummary-update"">http://stackoverflow.com/questions/2396153/preferencescreen-androidsummary-update</a> may be experiening the same problem as me.</p><p>Any help appreciated.</p>","276052","","","","","2014-04-11 16:37:32","Update existing Preference-item in a PreferenceActivity upon returning from a (sub)PreferenceScreen","<android><preferences><invalidate><preferenceactivity>","7","0","2","",""
"2625407","1","2625438","","2010-04-12 20:59:06","2","6159","<p>Strangely I find no support for Midi in Android.The only thing that comes close is the Jetplayer, but this only takes a existing .jet file.</p><p>I want to dynamically generate a midi file with some intervals and play it. I even thought about just manually creating a .jet file with a tone and then transposing it with the jet player, but it limits the transposing to -12, +12. Which is not so good for me.</p><p>There also is a ToneGenerator on Android, but it's limited to predefined tones with no way to transpose.</p><p>Does someone know how to achieve midi generation and playback on Android?</p>","107029","","","","","2012-12-31 03:31:25","Dynamic Midi generation and playback on Android: Possible?","<android><midi>","3","0","2","",""
"2625419","1","2625457","","2010-04-12 21:00:20","17","31251","<p>How do I check if a directory exist on the sdcard in android?</p>","213323","","","","","2013-07-19 14:24:27","Check if directory exist on android's sdcard","<android><directory><android-sdcard>","4","0","7","",""
"2625746","1","2625816","","2010-04-12 21:57:43","1","935","<p>I would like ask if there's a way to download an android layout from the Internet into the ""res/layout"" folder.</p><p>I was thinking in getting the file using an HttpUrlConnection and a FileOutputStream, like discussed in here <a href=""http://stackoverflow.com/questions/576513/android-download-binary-file-problems"">http://stackoverflow.com/questions/576513/android-download-binary-file-problems</a> but I can't fgure out how to put it into the ""res/layout"" folder.</p><p>Thanks!</p>","309276","","","","","2010-04-12 22:10:23","Downloading an android layout from the internet","<android><layout><resources><download><internet>","1","0","","",""
"2625812","1","","","2010-04-12 22:09:34","27","19336","<p>I am trying to start an activity with a custom transition animation. The only way I have found out so far to do this (without using onPendingTransition() in the previous activity) is to use a custom theme on the activity and define either activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle to set the animation. But, none of these attributes are working for me. Some experimentation yielded the following results-</p><p>If I set the windowAnimationStyle attribute to some custom style which defines values for activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle I can get rid of the default transition animation occurring at the start of the activity. It doesn't show the transition animation using the actual value specified but at least the default animation is not shown.</p><p>According to the reference doc <a href=""http://developer.android.com/reference/android/R.attr.html"">here</a>,</p><p>I should be able to define an animation at the start of the activity using activityOpenEnterAnimation. But no success so far.</p><p>Any ideas?</p>","301784","","","user2013283","2013-01-26 08:53:44","2013-01-26 08:53:44","Start Activity with an animation","<android><animation><activity><transition>","1","2","25","",""
"2625921","1","2652635","","2010-04-12 22:36:31","0","5439","<p>I have a widget that changes some system settings, but it will not take right away.  It seems like I need to refresh the system settings for it to take.  How do you change some system settings from a widget that take instantly?</p><p>when my widget is pressed it goes to an activity with a blank background to change the system settings. one of the settings that are changed is the display brightness. this is the code i use to change the display brightness. once i change the settings i call the finish function to exit the activity so i am not stuck there after the settings are changed.  One thing i did notice is that if i didnt exit the activity the settings did change, but i was stuck in the activity.  its when i added the class.this.finish(); to exit the activity that the settings don't change.</p><pre><code>android.provider.Settings.System.putInt(getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, brightness); // 0-255 WindowManager.LayoutParams lp = getWindow().getAttributes();lp.screenBrightness = brightness / 255.0f;getWindow().setAttributes(lp);</code></pre>","274365","","274365","","2010-04-12 22:57:02","2010-04-16 11:50:29","change system settings from android widget","<android><settings><system><widget>","2","2","6","",""
"2626187","1","3081045","","2010-04-12 23:57:08","1","1246","<p>I've installed the Android SDK and the ADT plugin, but Android doesn't show up in the Window>Preferences... dialog.</p><p>I'm running Galileo. If I go to the Installation Details part of the About Eclipse dialog, it says that I have 0.9.6 of Android DDMS and Android Development Tools. I can run adb from the command line. I tried going around the uninstall/reinstall loop once.</p><p>I'm on Windows Vista. I also have 2.7.7 of the Scala plugin installed, but I tried uninstalling that.</p><p>Any ideas on what I should try next? Thanks.</p>","222953","","","","","2010-07-08 08:20:19","Debugging ADT Eclipse Plugin Install","<android><eclipse><adt>","3","0","1","",""
"2626218","1","3002949","","2010-04-13 00:08:53","7","2950","<p>I am finding it hard to understand the exact circumstances in which each the various <a href=""http://developer.android.com/guide/topics/fundamentals.html#lmodes"">launch modes</a> would be used in Android. Could anyone provide me with some examples to help understand when the various modes are appropriate?</p>","165495","","","","","2010-12-27 17:39:19","Examples for Android Launch modes","<android>","2","0","3","",""
"2626378","1","","","2010-04-13 01:03:31","1","212","<p>I'd like to invoke the Android onscreen keyboard to just retrieve a single character. Is there a way to do this?</p><p>I am working on a hangman application and need to take input one character at a time. The plan is to have a text area for each guessed letter, and display the soft keyboard when the user selects a text area for which to guess.</p>","263607","","263607","","2010-04-13 02:40:30","2010-04-13 04:57:23","Is there a way to force just a single character from the onscreen keyboard","<android>","1","3","1","",""
"2626471","1","","","2010-04-13 01:42:21","1","970","<p>Due to Apple's recent T+C hijinks, I've become interested in developing for Android.</p><p>Anyways, I'm trying to get a mixed-language Android 2.1 project going in Netbeans 6.8 (with the NBAndroid 0.10 plugin). The two languages being Java and Scala(2.8 head build). To give you a basic idea of what the app does right now, it's just a simple ""Hello World"" app.</p><p>To get this to build, I've modified the projects's build.xml file:</p><pre><code> &lt;target name=""-pre-compile"" depends=""init""&gt;   &lt;property name=""scala-home"" value=""/Users/development/Applications/scala-2.8.0/build/pack""/&gt;   &lt;property name=""scala-library"" value=""/Users/development/Applications/scala-2.8.0/build/pack/lib/scala-library.jar""/&gt;   &lt;echo message=""scala-library = ${scala-library}""/&gt;   &lt;echo message=""scala-home = ${scala-home}""/&gt;   &lt;echo message=""platform.bootcp = ${platform.bootcp}""/&gt;   &lt;echo message=""dist.apk.dir = ${dist.apk.dir}""/&gt;   &lt;echo message=""build.classes.dir = ${build.classes.dir}""/&gt;   &lt;path id=""build.classpath""&gt;     &lt;pathelement location=""${scala-library}""   /&gt;     &lt;!--&lt;pathelement location=""${your.path}""   /&gt;--&gt;     &lt;pathelement location=""${build.classes.dir}""   /&gt;   &lt;/path&gt;   &lt;taskdef resource=""scala/tools/ant/antlib.xml""&gt;     &lt;classpath&gt;       &lt;pathelement location=""${scala.home}/lib/scala-compiler.jar""   /&gt;       &lt;pathelement location=""${scala-library}""   /&gt;       &lt;pathelement location=""${javac.classpath}"" /&gt;      &lt;/classpath&gt;   &lt;/taskdef&gt;   &lt;scalac srcdir=""${src.ScalaSource.dir}"" destdir=""${build.classes.dir}"" &gt;      &lt;classpath&gt;       &lt;pathelement location=""/Users/development/Documents/AndroidTest/scala-library.jar""   /&gt;       &lt;pathelement location = ""${scala-library}"" /&gt;       &lt;pathelement location = ""${file.reference.android.jar}"" /&gt;       &lt;pathelement path=""${javac.classpath}"" /&gt;      &lt;/classpath&gt;   &lt;/scalac&gt;   &lt;echo message=""file.reference.android.jar: ${file.reference.android.jar}""/&gt;   &lt;echo message=""file.reference.scala-library.jar: ${file.reference.scala-library.jar}""/&gt; &lt;/target&gt; &lt;target name=""-pre-jar""&gt;        &lt;!-- Empty placeholder for easier customization. --&gt;        &lt;!-- You can override this target in the ../build.xml file. --&gt; &lt;taskdef resource=""proguard/ant/task.properties""   classpath=""tools/proguard.jar"" /&gt; &lt;proguard&gt;   -injars ${scala-library}(!META-INF/MANIFEST.MF,!library.properties)   -outjars ""${build.classes.dir}/classes.min.jar""   -libraryjars ""${file.reference.android.jar}""   -dontwarn   -dontoptimize   -dontobfuscate   -keep public class * extends android.app.Activity   -keep public class scala.xml.include.sax.Main** &lt;/proguard&gt;    &lt;/target&gt;</code></pre><p>I've gotten the project so that it'll build, but it errors on startup in my Android Emulator(inside the emulator Android tells me my application has stopped unexpectedly).  </p><p>So my questions are: Does anyone see what I may be doing wrong? And is there any way to get access to the logs that the emulator must create?</p><p>thanks</p><p><strong>Edit</strong>:  FYI, here's the output from adb logcat:</p><pre><code>I/dalvikvm(  369): Failed resolving Lorg/me/androidtest/MainActivity; interface 35 'Lscala/ScalaObject;'W/dalvikvm(  369): Link of class 'Lorg/me/androidtest/MainActivity;' failedD/AndroidRuntime(  369): Shutting down VMW/dalvikvm(  369): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  369): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  369): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.me.androidtest/org.me.androidtest.MainActivity}: java.lang.ClassNotFoundException: org.me.androidtest.MainActivity in loader dalvik.system.PathClassLoader@43d02720E/AndroidRuntime(  369):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime(  369):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)E/AndroidRuntime(  369):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)E/AndroidRuntime(  369):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)E/AndroidRuntime(  369):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  369):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  369):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(  369):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  369):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  369):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  369):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  369):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  369): Caused by: java.lang.ClassNotFoundException: org.me.androidtest.MainActivity in loader dalvik.system.PathClassLoader@43d02720E/AndroidRuntime(  369):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/AndroidRuntime(  369):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(  369):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(  369):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)E/AndroidRuntime(  369):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)E/AndroidRuntime(  369):    ... 11 moreI/Process (   56): Sending signal. PID: 369 SIG: 3I/dalvikvm(  369): threadid=7: reacting to signal 3I/dalvikvm(  369): Wrote stack trace to '/data/anr/traces.txt'W/ActivityManager(   56): Launch timeout has expired, giving up wake lock!</code></pre><p>Clearly, it's some type of classloader/classpath issue or something(at least that's what I'd say if this was the JVM), but when I look inside my Proguard'd jarfile I find The classes I'd expect:  scala.ScalaObject, org.me.androidtest.MainActivity, and some others.</p><p>If it helps the project with all it's dependencies made internal is located at <a href=""http://philosophicalsoftware.com/AndroidTest.zip"" rel=""nofollow"">http://philosophicalsoftware.com/AndroidTest.zip</a></p>","109965","","109965","","2010-04-14 17:08:18","2010-12-10 16:12:53","Grafting Scala 2.8 into a Netbeans NBAndroid Project...What steps am I missing?","<android><scala><netbeans6.8>","2","0","2","",""
"2626887","1","21829196","","2010-04-13 03:56:06","6","2570","<p>I am looking to create a radial menu in a game that I am writing.  Is there a class or API included to assist with this or an open source solution?</p><p>Something like <a href=""http://www.androidtapp.com/wp-content/uploads/2009/12/Dolphin-Browser-Long-Press-Link-Options.jpg"" rel=""nofollow"">this</a>.</p><p>Thank you,Jake</p>","315105","","315105","","2010-10-24 18:02:18","2014-02-17 12:36:25","Android Radial / Pie Menu","<android><gui>","2","0","0","",""
"2626924","1","","","2010-04-13 04:06:10","1","444","<p>I'm using Edittext and it has images and texts.Then, I add image file on Edittext and I click Edittext, IME window shows, naturally.( * At that time cursor is located at right-bottom corner of added image file.)The problem is IME window overlap cursor, so users complain that 'where is my cursor?'</p><p>How to prevent that IME window overlap cursor?</p>","280137","","","","","2011-02-16 09:53:47","IME window overlap cursor in Edittext, how to prevent it?","<android>","1","0","","",""
"2627019","1","","","2010-04-13 04:42:49","0","1001","<p>I've tried video recording in the background.But had failed.</p><p>Under normal circumstances, the recording works properly.However, if HOME key down-> Home screen or Other Activity is running,recording terminates.</p><p>In such a situation, I want to record continuously.I want to record whole process!</p><p>What should I do?</p><p>thanks.-Michael</p>","315120","","315120","","2010-04-13 04:58:37","2010-04-13 12:07:32","Is the video recording possible in the background service?","<android>","1","2","","",""
"2627072","1","2627241","","2010-04-13 04:59:17","3","880","<p>I wanted to make a video presentation of my android application. i know i can make the presentation by holding a camcorder in front of the screen and give walkthrough the application. But is there any other way this can be done, something on the lines of JingProject for windows wherein you can record your activities on your screen in a video.</p><p>is there a tool that can help me achieve the same on my android device</p>","180950","","","","","2010-05-16 16:47:07","Android App Presentation","<android><video-capture><jing>","1","0","4","",""
"2627101","1","","","2010-04-13 05:09:07","2","5997","<p>I am unable to use the following to code to play multiple sounds/beeps simultaneously. In my onclicklistener I have added  ... public void onClick(View v) { mSoundManager.playSound(1); mSoundManager.playSound(2); } ... But this plays only one sound at a time, sound with index 1 followed by sound with index 2.  </p><p>How can I play atleast 2 sounds simultaneously using this code whenever there is an onClick() event?</p><pre><code>public class SoundManager {private  SoundPool mSoundPool; private  HashMap&lt;Integer, Integer&gt; mSoundPoolMap; private  AudioManager  mAudioManager;private  Context mContext;public SoundManager(){}public void initSounds(Context theContext) {      mContext = theContext;     mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);      mSoundPoolMap = new HashMap&lt;Integer, Integer&gt;();      mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);         } public void addSound(int Index,int SoundID){    mSoundPoolMap.put(1, mSoundPool.load(mContext, SoundID, 1));}public void playSound(int index) {      int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);      mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f); }public void playLoopedSound(int index) {      int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);      mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, -1, 1f); }</code></pre><p>}</p>","315126","","","","","2014-01-06 04:10:36","Playing Multiple sounds at the same time in Android","<android><audio><soundpool>","1","2","","",""
"2627222","1","2642995","","2010-04-13 05:41:43","22","24947","<p>Initially I wanted a checkmark where the text is placed on the left of the checkmark. After searching on this site I found out the best workaround is android:CheckedTextView? However, I found out that the checkmark cannot be changed manually by users. Is it by design?</p><pre><code>&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/autoupdatecheckboxview""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:gravity=""center_vertical""  android:checkMark=""?android:attr/listChoiceIndicatorMultiple""  android:paddingLeft=""6dip""  android:paddingRight=""6dip""  android:text=""Pop up a message when new data available""  android:typeface=""sans"" android:textSize=""16dip""/&gt; </code></pre>","253800","","","","","2013-10-26 03:55:43","android: CheckedTextView cannot be checked?","<android><checkbox><checkedtextview>","6","0","4","",""
"2627330","1","","","2010-04-13 06:10:36","10","3842","<p>I am wanting to query the members of a given playlist.  I have the correct playlist id, and want to use a managedQuery() to look at the playlist members in question.</p><p>What I have is this:</p><pre><code>private String [] columns = {      MediaStore.Audio.Playlists.Members.PLAYLIST_ID,     MediaStore.Audio.Playlists.Members.TITLE,     };Uri membersUri = MediaStore.Audio.Playlists.Members.getContentUri(volume, playlistId);Cursor tCursor = managedQuery(membersUri, columns, null, null, null);</code></pre><p>I don't know what the volume argument needs to be.  I've tried this:<code>MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI.toString()</code> for the ""volume"" argument.</p><p>That gives me back a valid content URI that looks like:</p><pre><code>content://media/external/audio/playlists/2/members</code></pre><p>However, my cursor comes back null.  I probably am way off base -- I know what I want to do is very simple.</p>","315165","","","","","2011-12-26 23:17:59","What is the String 'volumeName' argument of MediaStore.Audio.Playlists.Members.getContentUri referring to?","<android>","1","1","1","",""
"2627462","1","","","2010-04-13 06:36:06","0","1352","<p>As Android supports multiple devices from different manufacturersthere are different screen resolutions supported.</p><p>The table that is available at<a href=""http://developer.android.com/intl/fr/guide/practices/screens_support"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/practices/screens_support</a>....is not very clear to me.</p><p>It shows WVGA and FWVGA in MDPI for Large Screens and HDPI for Normalscreens. So, if the image is kept in drawable-mdpi and its resolutionis 320 * 480 then which image will be taken by Large Screens device ofMDPI.</p><p>Moreover, there are two screen resolutions for HDPI i.e. 480 * 800 and480 * 854. So, with what screen resolution the image should be built.</p><p>I want to place the background image which looks distorted in WVGAemulator since its resolution is 320 * 480.</p><p>I have read about nine patchable images but I think they are betterfor button images and edittext images so that they can stretchaccording to the data in it.</p><p>Can someone please guide me in this?</p><p>RegardsSunil </p>","261566","","","","","2011-04-27 16:58:25","What should be the image resolution for Nexus One or Droid?","<android><screen><resolution><devices>","1","4","","",""
"2627545","1","","","2010-04-13 06:50:43","7","725","<p>I thought I had understood this question, but something is quite wrong here.  When the user (me, so far) tries to press keys, nothing really happens, and I am having a lot of trouble understanding what it is that I've missed.</p><p>Consider this before I present some code to help clarify my problem: I am using Android's Lunar Lander example to make my first ""real"" Android program.  In that example, of course, there exist a class LunarView, and class nested therein LunarThread.  In my code the equivalents of these classes are Graphics and GraphicsThread, respectively.  </p><p>Also I can make sprite animations in 2D just fine on Android.  I have a Player class, and let's say GraphicsThread has a Player member referred to as ""player"".  This class has four coordinates - x1, y1, x2, and y2 - and they define a rectangle in which the sprite is to be drawn.  I've worked it out so that I can handle that perfectly.  Whenever the doDraw(Canvas canvas) method is invoked, it'll just look at the values of those coordinates and draw the sprite accordingly.</p><p>Now let's say - and this isn't really what I'm trying to do with the program - I'm trying to make the program where all it does is display the Player sprite at one location of the screen UNTIL the FIRST time the user presses the Dpad's left button.  Then the location will be changed to another set position on the screen, and the sprite will be drawn at that position for the rest of the program invariably.</p><p>Also note that the GraphicsThread member in Graphics is called ""thread"", and that the SurfaceHolder member in GraphicsThread is called ""mSurfaceHolder"".</p><p>So consider this method in class Graphics:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent msg) {    return thread.keyDownHandler(keyCode, msg);}</code></pre><p>Also please consider this method in class GraphicsThread:</p><pre><code>boolean keyDownHandler(int keyCode, KeyEvent msg) {    synchronized (mSurfaceHolder) {        if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {            player.x1 = 100;            player.y1 = 100;            player.x2 = 120;            player.y2 = 150;        }    }    return true;}</code></pre><p>Now then assuming that player's coordinates start off as (200, 200, 220, 250), why won't he do anything different when I press Dpad: Left?</p><p>Thanks!</p>","279112","","","","","2010-05-25 20:25:19","What are the basics of dealing with user input events in Android?","<android><user-input>","2","2","1","",""
"2627676","1","2655186","","2010-04-13 07:17:59","0","272","<p>I added TextToSpeech to my app, following the guidelines in the following post:</p><p><a href=""http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html</a></p><p>and now my onDestroy is no longer called when the back button is pressed.I filed a bug report regarding this: <a href=""http://code.google.com/p/android/issues/detail?id=7674"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=7674</a></p><p>Figured i should  also ask here if someone else has seen this, and found a solution?</p><p>It seems that it is the intent that causes the problem, i.e. the following:</p><pre><code>Intent checkIntent = new Intent();checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);</code></pre><p>If I skip this intent, and just go ahead and create a tts-instance, it works fine.Any clues to what is wrong with this intent?</p>","311681","","","","","2010-11-01 08:45:43","added TextToSpeech to my activity and now my onDestroy is not called any more, bug?","<android><android-intent><lifecycle>","2","0","","",""
"2627683","1","2636271","","2010-04-13 07:20:20","0","461","<p>The Chronometer widget initial text is 00:00</p><p>but when I start the Chronometer its text becomes blank</p><p>How can I display the text of the Chronometer as it counts up ?</p><p>thanks.</p>","235123","","2046992","","2011-06-21 10:35:25","2011-06-21 10:35:25","Android Chronometer disapears when started?","<android>","1","4","","",""
"2627898","1","2628128","","2010-04-13 08:05:47","0","4419","<p>Is there any slide bar widget to which i will place few icons and user can slide them it will role in and rol out from screen.</p>","216431","","","","","2010-04-13 08:43:07","Android slide bar widget?","<android><slider>","1","2","","",""
"2628134","1","","","2010-04-13 08:44:14","0","345","<p>can I make TabActivity start it's childs activities for result? I need it because I can't make result code from a tab to propagate all the way up in the chain (it's reset in the TabActivity) thanks, Ori </p>","258429","","","","","2010-04-13 16:45:10","TabActivity and startAcitivtyForResult","<android>","1","1","1","",""
"2628509","1","","","2010-04-13 09:46:29","0","1611","<p>I have a RelativeLayout defined in xml and I call the setContentView(R.layout.relativeLAyout) for displaying in Activity.</p><p>Now, if I want to resize this RelativeLayout then can it be done and if yes, then can someone let me know how? </p><p>The inner components can be resized relatively to the parent.</p><p>Is this actually possible?</p><p>RegardsSunil</p>","261566","","","","","2012-04-05 12:28:07","How to resize the RelativeLayout or any other Layout in Android?","<android><layout><resize>","2","1","","",""
"2628702","1","2635762","","2010-04-13 10:16:51","4","5374","<p>I've created an AutoCompleteTextView box that displays the names of all contacts, but after looking in the Android APIs, it seems my method is probably quite inefficient.</p><p>Currently I am grabbing a cursor of the all the contacts, placing each name and each contact id into two different arrays, then passing the name array to the AutoCompleteTextView.  When a user selects an item, I lookup which ID the contact selected in the second id array created above.  Code below:</p><pre><code>private ContactNames mContactData;// Fill the autocomplete textboxCursor contactsCursor = grabContacts();mContactData = new ContactNames(contactsCursor);ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.contact_name, mContactData.namesArray);mNameText.setAdapter(adapter);private class ContactNames {    private String[] namesArray;    private long[] idsArray;            private ContactNames(Cursor cur) {        namesArray = new String[cur.getCount()];        idsArray = new long[cur.getCount()];        String name;         Long contactid;        // Get column id's        int nameColumn = cur.getColumnIndex(People.NAME);         int idColumn = cur.getColumnIndex(People._ID);        int i=0;        cur.moveToFirst();        // Check that there are actually any contacts returned by the cursor        if (cur.getCount()&gt;0){            do {                // Get the field values                name = cur.getString(nameColumn);                contactid = Long.parseLong(cur.getString(idColumn));                // Do something with the values.                 namesArray[i] = name;                idsArray[i] = contactid;                i++;            } while (cur.moveToNext());        }    }    private long search(String name){        // Lookup name in the contact list that we've put in an array        int indexOfName = Arrays.binarySearch(namesArray, name);        long contact = 0;        if (indexOfName&gt;=0)        {            contact = idsArray[indexOfName];        }        return contact;    }}private Cursor grabContacts(){    // Form an array specifying which columns to return.     String[] projection = new String[] {People._ID, People.NAME};    // 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, null, null, People.NAME + "" ASC""); // Put the results in ascending order by name    startManagingCursor(managedCursor);    return managedCursor;}</code></pre><p>There must be a better way of doing this - basically I'm struggling to see how I can find which item a user selected in an AutoCompleteTextView.  Any ideas?</p><p>Cheers.</p>","295930","","","","","2011-10-19 17:32:42","Android - Autocomplete with contacts","<android><autocomplete>","3","0","4","",""
"2628741","1","5626625","","2010-04-13 10:23:25","3","1727","<p>I need to show a list that is scrolled to a specific item.</p><p>how can I do it?</p><p>Ori</p>","258429","","","","","2011-05-04 09:20:13","ListView and Scroll","<android>","3","1","","",""
"2628791","1","","","2010-04-13 10:32:24","0","1081","<p>I want to check one application memory usage and cpu load and power of an appplication in android,What can i do for this?</p>","454808","","","","","2010-04-14 09:33:48","Check the memory usage anp cpu and power of an application in android","<android>","1","0","","",""
"2628839","1","2628934","","2010-04-13 10:41:57","0","307","<p>sorry, it's not exactly a programming question, but I am currently in a research state and looking for similar projects, so I could analyze them:</p><p>It should be application to iPhone or Android or other mobile platform, where, basically, user can access map with ""places of interest"" and add it's own ""place of interest"" (with photo and description). Kind of, community generated sightseeing map.</p><p>I know it is quite simple and not a groundbreaking idea, but my google-fu is quite weak and I can't find anything like that.</p>","90571","","","","","2010-04-13 10:58:52","Looking for similar projects: Iphone/Android + Google Maps + ""external"" database = sightseeing map","<iphone><android><google-maps>","1","0","","",""
"2629270","1","","","2010-04-13 11:58:07","4","697","<p>Could someone explain in technical details how an android application handles updates ? . What kind of information does the application usually needs to send to request an update , and what does it receives back ? .</p>","304866","","","","","2010-04-13 12:13:41","update of an android application","<android>","1","0","2","",""
"2629385","1","","","2010-04-13 12:16:19","0","1116","<p>I currently have one Scrollview which contains a table layout and onelist in my activity. Now my problem is that I wanted to move both ofthem(Scrollview and list) together and with proper synchronization...So if scrollview is being scrolled then listview should also scrollwith the same distance, and vice versa...</p><p>Thanks in advance..</p><p>Abhishek </p>","315441","","","","","2010-09-06 10:47:43","Scrolling two views together","<android><listview><scrollview>","1","0","","",""
"2629471","1","2629514","","2010-04-13 12:31:52","1","613","<p>total nubi here and i'm trying to writ an application that trackes how far you have traveled. I can't find anything on how to do this. I can get location, speed, bearing etc. Any pointers on the best way to do this would be appreciated.  </p>","293663","","","","","2010-04-13 12:57:32","how to track distance","<android><gps>","2","0","","",""
"2629691","1","2630124","","2010-04-13 13:03:25","0","2850","<p>I am trying to layout a Button to the left of a TextView that is centered on the screen. My layout looks like this:</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=""center""&gt; &lt;TextView       android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""foo""     android:id=""@+id/center""     /&gt;    &lt;Button android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Left button""     android:layout_toLeftOf=""@id/center"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Unfortunately, the button just does not appear. I get the following result: <img src=""http://imgur.com/DsMzd.png"" alt=""alt text""></p><p>As you see, the button doesn't show up. It works if I use layout_toRightOf, then the button appears to the right of the TextView, just as expected.</p><p>Any ideas what I am doing wrong here?</p>","112308","","147463","","2011-01-13 21:01:23","2011-01-13 21:01:23","Button laid out using layout_toLeftOf in a RelativeLayout does not show up","<java><android><layout>","3","0","","",""
"2629696","1","","","2010-04-13 13:03:57","1","1655","<p>I'm following the guides online here( <a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html"" rel=""nofollow"">http://code.google.com/android/add-ons/google-apis/mapkey.html</a> ) and i'm having trouble ""Getting the MD5 Fingerprint of Your Signing Certificate"".</p><p>Ive found the location of the keytool and now when i put  into the command line</p><p>keytool -list -alias androiddebugkey -keystore ""C:\Users\Chris.android\debug.keystore"" -storepass android -keypass android</p><p>i get the following error</p><p>keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\Chris.android\debug.keystore</p><p>Can someone shed some light and help me out as i've been trying this for ages and don't know whats wrong.</p><p>Thanks alot.</p>","314610","","","","","2014-01-18 10:58:29","Android & Google Maps: Trouble with getting fingerprint and signing certificate","<android><google-maps>","2","0","","",""
"2629932","1","","","2010-04-13 13:36:01","2","7058","<p>I'm working on an app that calls a web service, then the webservice returns an array list. My problem is I am having trouble getting the data into the ArrayList and then displaying in a ListView. Any ideas what I am doing wrong? I know for a fact the web service returns an ArrayList. Everything seems to be working fine, just no data in the ListView or the ArrayList.....Thanks in advance!</p><p>EDIT: It donned on me that the data the webservice responds with is a complex type. I really think that's where I am getting hung up, but not sure how to correct it.</p><p>APRIL 21, 2010:</p><p>So I finally figured out my webservice returns a JSON Array. Now getting that over to the ArrayList and/or ListView is the challenge. I have a feeling that once this project is done, it might make for a great tutorial or example...</p><pre><code>package com.maskau;import java.util.ArrayList;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.PropertyInfo;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.AndroidHttpTransport;import android.app.*;import android.os.*;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;import android.widget.TextView;import android.view.View;import android.view.View.OnClickListener;public class Home extends Activity implements Runnable{/** Called when the activity is first created. */public static final String SOAP_ACTION = ""http://bb.mcrcog.com/GetArtist"";public static final String METHOD_NAME = ""GetArtist"";public static final String NAMESPACE = ""http://bb.mcrcog.com/"";public static final String URL = ""http://bb.mcrcog.com/karaoke/service.asmx"";String wt;public static ProgressDialog pd;TextView text1;ListView lv;static EditText myEditText;static Button but;private ArrayList&lt;String&gt; Artist_Result = new ArrayList&lt;String&gt;();@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    myEditText = (EditText)findViewById(R.id.myEditText);    text1 = (TextView)findViewById(R.id.text1);    lv = (ListView)findViewById(R.id.lv);    but = (Button)findViewById(R.id.but);    but.setOnClickListener(new OnClickListener()    {        @Override        public void onClick(View v)        {            wt = (""Searching for "" + myEditText.getText().toString());            text1.setText("""");            pd = ProgressDialog.show(Home.this, ""Working..."", wt , true, false);            Thread thread = new Thread(Home.this);            thread.start();        }    }    );}public void run(){        try     {            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);            PropertyInfo pi = new PropertyInfo();            pi.setName(""ArtistQuery"");            pi.setValue(Home.myEditText.getText().toString());            request.addProperty(pi);            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);            envelope.dotNet = true;            envelope.setOutputSoapObject(request);            AndroidHttpTransport at = new AndroidHttpTransport(URL);            at.call(SOAP_ACTION, envelope);            java.util.Vector&lt;Object&gt; rs = (java.util.Vector&lt;Object&gt;)envelope.getResponse();            if (rs != null)            {                for (Object cs : rs)                {                    Artist_Result.add(cs.toString());                }            }        }     catch (Exception e)        {         // Added this line, throws ""org.ksoap2.serialization.SoapObject"" when run            Artist_Result.add(e.getMessage());            }     handler.sendEmptyMessage(0);}private Handler handler = new Handler(){    @Override    public void handleMessage(Message msg)    {        ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(Home.this, android.R.layout.simple_list_item_1, Artist_Result);    lv.setAdapter(aa);    try    {        if (Artist_Result.isEmpty())        {               text1.setText(""No Results"");        }        else        {               text1.setText(""Complete"");               myEditText.setText(""Search Artist"");        }    }    catch(Exception e)    {    text1.setText(e.getMessage());    }    aa.notifyDataSetChanged();    pd.dismiss();    }};}</code></pre><p>Sample result data from webservice:</p><pre><code>&lt;ArrayOfArtists&gt;    &lt;Artist&gt;        &lt;Track&gt;.......&lt;/Track&gt;    &lt;/Artist&gt;    &lt;Artist&gt;        &lt;Track&gt;.......&lt;/Track&gt;    &lt;/Artist&gt;    &lt;Artist&gt;        &lt;Track&gt;.......&lt;/Track&gt;    &lt;/Artist&gt;&lt;/ArrayOfArtists&gt;</code></pre>","311165","","311165","","2010-04-21 13:49:59","2014-03-26 19:19:44","Having trouble binding a ksoap object to an ArrayList in Android","<android><web-services><json><arraylist><ksoap2>","1","1","0","",""
"2629940","1","2634059","","2010-04-13 13:37:07","8","6681","<p>I have a custom-made view that extends the View class. I would like 2 instances of my custom view layered directly on top of each other. How should my layout file look to achieve this?</p>","135820","","","","","2010-04-14 00:06:58","How to layer views","<android>","2","0","1","",""
"2630022","1","2630190","","2010-04-13 13:50:09","2","1211","<p>I am trying to play continuous stream using android mediaplayer.but am not able to avoid gap in playback while updating the datasource file of mediaplayer.Hw can i overcome this problem?Thanks in advance</p>","196579","","","","","2010-04-13 14:13:54","How to get gapless playback?in android mediaplayer","<android>","1","0","","",""
"2630120","1","2630161","","2010-04-13 14:03:04","0","726","<p>I would like to store only <code>.txt</code> filenames from a specific dir (let's say: <code>/sdcard/docs/</code>) into an <code>String</code> array.</p><p>Example:In <code>/sdcard/docs/</code> there are 5 files: <code>foo.txt</code>, <code>bar.jpg</code>, <code>foofoo.txt</code>, <code>loool.png</code> and     <code>foobar.txt</code>. I would like to get array with contents: <code>""foo.txt"", ""foofoo.txt"", ""foobar.txt""</code></p><p>How could I do it?</p>","315563","","213269","","2010-12-21 14:24:18","2010-12-21 14:24:18","Store .txt filenames in array on Android","<android><file><filenames><text-files><sd-card>","1","2","","",""
"2630158","1","9428660","","2010-04-13 14:09:56","58","45332","<p>How do you programmatically detect the application heap size available to an Android app?</p><p>I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution that works for 1.5 and upwards.</p>","143378","","143378","","2010-04-13 16:07:19","2014-04-10 04:05:52","Detect application heap size in Android","<android><memory><heap><heap-memory>","7","1","53","",""
"2630804","1","","","2010-04-13 15:22:39","0","103","<p>i have two activities 1) downloading something on oncreate function with help of asyn task ,and had one button.2) secons activity display on click of button.now when i go back to previous ie first activity , then downloading starts again, i want to get the previous filled data view ,instead of startg the previous process again ..canu please guide methanks </p>","297082","","","","","2010-04-13 15:36:36","android :activity","<android><activity><onresume>","1","0","","",""
"2630829","1","4338273","","2010-04-13 15:25:20","16","14298","<p>I am throwing HTML to a webview to render. In the HTML I need to load an image that I have in <code>/res/drawable</code>.</p><p>I have <code>/res/drawable/my_image.png</code> and code such as this:</p><pre><code>final WebView browser = (WebView) findViewById(R.id.my_webview);String html = new MyHelper(myObject).getHtml();browser.loadDataWithBaseURL("""", html, ""text/html"", ""UTF-8"", """");</code></pre><p>Where the String <code>html</code> has something like:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;h1&gt;Here is the image&lt;/h1&gt;&lt;img src=""my_image.png"" /&gt;&lt;/head&gt;&lt;html&gt;</code></pre><p>The question is, what should that image <code>src</code> attribute be to refer to the image in <code>/res/drawable</code>?</p>","87294","","962311","","2014-01-27 03:07:38","2014-01-27 03:07:38","@Android display /res/viewable in WebView","<android><webview><drawable>","7","2","7","",""
"2630990","1","","","2010-04-13 15:45:32","2","720","<p>I just started testing my app on android 1.5, and it doesn't want to run at all. I have a breakpoint in onCreate on my main activity, but I get a ClassNotFound exception even before reaching that. The class not found appears to be the class of my main activity. The exception happens in:    ActivityThread.performLaunchActivity</p><p>It runs fine on 1.6 and later, so I assume I'm using something that isn't supported on 1.5. But how can I find out what it is? Any tips on how to debug this would be greatly appreciated. </p><p>Thanks.</p>","311681","","","","","2012-05-15 10:19:42","Force close before onCreate, activity class not found exception","<android>","2","2","","",""
"2631017","1","","","2010-04-13 15:49:26","0","1385","<p>I have written two test cases in a package com.app.myapp.test   When I try to run them both of them are not getting executed, only one test case gets executed and stops.</p><p>I have written the following testsuite in the same package</p><p>AllTests.java</p><pre><code>public class AllTests extends TestSuite {    public static Test suite() {        return new TestSuiteBuilder(AllTests.class).includePackages(""./src/com.ni.mypaint.test"",""./src/com.ni.mpaint.test"").build();               /* .includeAllPackagesUnderHere()                .build();*/    }</code></pre><p>Is the code and location for this testsuite is correct?</p>","321334","","186636","","2011-12-14 19:20:55","2011-12-14 19:20:55","android instrumentation testsuite","<android><testing><instrumentation>","1","0","1","",""
"2631167","1","2724652","","2010-04-13 16:09:02","0","801","<p>I dont want to hardcode the name of the package or where it lives when building an Android project with ant. Im using the build file generated by Android. What properties contain the output folder (bin) and package name (e.g. package.apk) ?</p>","246793","","","","","2010-04-27 20:04:48","Specify package name and output folder from Android-generated ant build file?","<xml><android><file><ant><build>","2","0","","",""
"2631255","1","2631416","","2010-04-13 16:20:44","1","1451","<p>I'm planning to use my website to provide updates for my android application whenever the user decides to perform an update( in case there is one available) . I'm thinking to use http requests for the communication between the user and the server, so whenever there is a new update the server sents back to the user the link to download the apk of the update through the android browser. So far I think it should work !?!.  But once I have the apk of the new update on the card ,and the installed old version of the application  how do I actually perform the update ?</p>","284609","","","","","2010-04-13 19:09:42","ideas for android application update","<android>","2","3","3","",""
"2631278","1","2631385","","2010-04-13 16:24:05","27","12782","<p>Android comes with lots of system resources (<code>android.R</code>) that can be used to save you time and make your application lighter.</p><p>For example, I recently discovered that Android provides localized strings for Yes (<code>android.R.string.yes</code>), No (<code>android.R.string.no</code>), Cancel (<code>android.R.string.cancel</code>) and Ok (<code>android.R.string.ok</code>), among other strings.</p><p>What other system resources do you recommend using? Or is there a reason to avoid using system resources?</p>","143378","","112705","","2013-03-27 17:50:29","2013-03-27 17:50:29","Useful Android system resources","<android><optimization><resources>","3","1","14","",""
"2631299","1","","","2010-04-13 16:28:28","0","756","<p>Could someone provide the basic code to use if I want to perform a http request on android to the address ""address"" with the string ""message"" ? Also I'd like to check the server response and perform some actions if the right conditions meet , but I ' m unsure of how and when the server send back the response . My guess is that the response is gotten in a blocking  function, or in an asynchronous function . Could you provide code or  information on this as well ? Great thanks from a novice with too  much on his head !</p>","284609","","","","","2010-04-13 22:27:11","performing a Http request on android","<android>","1","4","","",""
"2631483","1","2631595","","2010-04-13 16:49:48","4","2014","<p>i wonder how you can make an advanced Android User interface where you can add for example a drag drop and more graphics options?  is that by using OpenGl ?! </p><p>this is example of UI in iPhone Apps.</p><p><a href=""http://flyosity.com/images/_blogentries/designpatterns/beats.png"" rel=""nofollow"">example 1</a></p><p><a href=""http://flyosity.com/images/_blogentries/designpatterns/postage.png"" rel=""nofollow"">example 2</a></p><p>Thanks </p>","302707","","","","","2010-04-13 17:08:47","How to make an Advanced user interface in Android?","<java><android><user-interface>","1","0","0","",""
"2631567","1","2632674","","2010-04-13 17:04:11","14","15067","<p>I would like to handle pinch events in my Android application to zoom in and out.</p><p>I believe Android 2.0 has multi-touch functionality, and heard that Android 1.6 might or might not support it depending of the device.</p><p>What's the best way to detect pinch events, while degrading gracefully for devices that don't support it? I'm targeting Android 1.5 upwards.</p>","143378","","","","","2012-10-19 10:12:20","Detecting pinch in Android","<android><multi-touch><graceful-degradation><pinch>","2","0","2","",""
"2631614","1","2631762","","2010-04-13 17:10:36","57","15554","<p>I am unable to override attributes when using &lt;include&gt; in my Android layout files. When I searched for bugs, I found Declined <a href=""http://code.google.com/p/android/issues/detail?id=2863"">Issue 2863</a>:</p><p>""include tag is broken (overriding layout params never works)""</p><p>Since Romain indicates this works in the test suites and his examples, I must be doing something wrong.</p><p>My project is organized like this:</p><pre><code>res/layout  buttons.xmlres/layout-land  receipt.xmlres/layout-port  receipt.xml</code></pre><p>The buttons.xml contains something 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;Button .../&gt;  &lt;Button .../&gt;&lt;/LinearLayout&gt;</code></pre><p>And the portrait and landscape receipt.xml files look something like:</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;!-- Overridden attributes never work. Nor do attributes like       the red background, which is specified here. --&gt;  &lt;include      android:id=""@+id/buttons_override""      android:background=""#ff0000""      android:layout_width=""fill_parent""      layout=""@layout/buttons""/&gt;&lt;/LinearLayout&gt;</code></pre><p>What am I missing?</p>","40257","","","","","2012-10-04 17:24:36","Does Android XML Layout's 'include' Tag Really Work?","<android><android-widget>","3","0","13","",""
"2631686","1","","","2010-04-13 17:21:26","2","2040","<p>I am having a weird issue with serialization of a Hashtable. I have made a Server, Client app. Where server(PC/MAC) is serializing a Hashtable and sending it to Client(Android) through UDP. The data is sent/read correctly but I get a bunch of these messages below on LogCat. </p><p>04-12 11:19:43.059: DEBUG/dalvikvm(407): GetFieldID: unable to find field Ljava/util/Hashtable;.loadFactor:F </p><p>Occasionally, I would see these </p><p>04-12 11:21:19.150: DEBUG/dalvikvm(407): GC freed 10814 objects / 447184 bytes in 97ms </p><p>The app would run for 2-3 mins and then crash. Interestingly enough I do not see the Loadfactor errors on SDK 1.5. But I do see the GC Free xxxx objects, quiet often. </p><p>After debugging I have found that the issue is with de-serialization and the error/warning are coming from following code </p><p>Code:</p><pre><code>ByteArrayInputStream bis = new ByteArrayInputStream(bytes);           ObjectInputStream ois = new ObjectInputStream(bis);             object = ois.readObject(); </code></pre><p>at Code:</p><pre><code>object = ois.readObject();</code></pre><p>on the client. My server is serializing code is the following. </p><p>Code:</p><pre><code>ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos);               oos.writeObject(obj);       </code></pre><p>Any idea what is going on? </p><p>Thanks for the Help!</p>","315737","","1288","","2010-04-13 17:28:27","2013-12-20 22:07:25","Android Hashtable Serialization","<java><android><serialization><hashtable>","2","0","0","",""
"2631742","1","2902396","","2010-04-13 17:28:43","4","6860","<p>I just bought a Google Nexus One smartphone, and I want to write a small Android application for fun. Suppose I can get my current GPS coordinates, so then how can I programmatically find nearby landmarks or points-of-interest within some radius? Is there an API to get GPS geo-tagged landmarks, like in Google Earth's database?</p><p>For example, if I'm in downtown Chicago, my program would point me to all the ""tourist"" things to visit in that city.</p><p>Ideally, it would all run on my smartphone, but if necessary, I can have the smartphone query a webserver, which would then run more queries.</p>","307099","","","","","2012-06-19 14:56:52","Given GPS coordinates, how do I find nearby landmarks or points-of-interest?","<android><google-maps><gps>","5","3","11","",""
"2631839","1","","","2010-04-13 17:43:08","14","7459","<p>I was wondering if there was a way to switch the side that text appears on a radio button in android?</p>","180825","","","","","2013-02-24 19:56:04","Change the side the text appears on a radio button","<android><gui>","5","1","5","",""
"2632216","1","","","2010-04-13 18:39:30","8","3429","<p>I'm trying to change the ringer mode of the phone to RINGER_MODE_SILENT when a call is incoming by using the following lines of code.</p><pre><code>AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);am.setRingerMode(AudioManager.RINGER_MODE_SILENT);</code></pre><p>While the phone stops ringing it continue to vibrate although the documentation of <a href=""http://developer.android.com/reference/android/media/AudioManager.html#setRingerMode%28int%29"" rel=""nofollow"">RINGER_MODE_SILENT</a> says it should also stop vibrating.  </p><p>I'm using the SDK 1.6</p><p><strong>UPDATE:</strong></p><p>As I didn't find a solution yet, I tried to deactivate the vibration settings manually.</p><pre><code>am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF );</code></pre><p>But this also doesn't prevent the phone form vibrating when a call is incoming. </p><p>Any ideas?</p><p><strong>UPDATE 2:</strong></p><p>Today I tried to solve the problem by canceling the vibration via a Vibration object. </p><pre><code>Vibrator vib = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);vib.cancel();</code></pre><p>Again, without success. Now I'm running out of ideas and asking myself if it is possible to stop the vibration at all. </p><p><strong>UPDATE 3:</strong></p><p>I've discovered another interesting fact when I've reread the <a href=""http://developer.android.com/reference/android/os/Vibrator.html"" rel=""nofollow"">documentation of the Vibrator class</a>. The documentation says: </p><blockquote>  <p>""If your process exits, any vibration  you started with will stop.""</p></blockquote><p>This sounds to me as if the vibration is linked to the process that started it and cannot be accessed form another process. </p>","19601","","491044","","2012-06-23 09:44:02","2012-06-23 09:44:02","Android: Ringer mode changed to silent doesn't stop the phone vibrating","<android><android-audiomanager><vibration>","3","0","1","",""
"2632272","1","2632341","","2010-04-13 18:45:39","33","18764","<p>If got some issues with a notification I want to show in the notification bar. Although I set the notification flag to <code>Notification.DEFAULT_LIGHTS &amp; Notification.FLAG_AUTO_CANCEL</code> the notification doesn't disappear after clicking it. Any ideas what I'm doing wrong?</p><pre><code>NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);    int icon = R.drawable.icon;    CharSequence tickerText = ""Ticker Text"";    long time = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, time);    notification.flags = Notification.DEFAULT_LIGHTS &amp; Notification.FLAG_AUTO_CANCEL;     Context context = getApplicationContext();    CharSequence contentTitle = ""Title"";    CharSequence contentText = ""Text"";    Intent notificationIntent = new Intent(this, SilentFlipConfiguration.class);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    mNotificationManager.notify(1,notification);</code></pre>","19601","","","","","2014-04-14 18:26:39","Android notification doesn't disappear after clicking the notifcation","<android><notifications>","3","0","8","",""
"2632704","1","","","2010-04-13 19:48:31","1","1206","<p>I've read the Android documentation:<a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a>but still have some questions.</p><p>I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit all the different screen sizes and how to position them.</p><ol><li><p>Which layout is best used for needing to position ImageButtons in specific locations on the screen? (i.e. cymbals on a drum set) FrameLayout, RelativeLayout?</p></li><li><p>If I only really care about medium and large screens, do I need to create different resources (images) for both as well as a different XML layout to position them?</p></li></ol><p>I'm trying to find the simplest way to do this without having to create a separate layout XML file for positioning/size and separate image resources for each screen.</p><p>Any guidance is greatly appreciated. Thanks!</p>","315854","","","","","2010-04-13 20:31:36","Supporting multiple screen sizes with Android using ImageButtons","<android>","1","1","","",""
"2632723","1","2633266","","2010-04-13 19:51:51","2","3364","<p>My app offers a <strong>""share/tell-a-friend""</strong> function. When the ""share"" button is pressed the following method is being called to open a list of apps, which can perform the action (Eg. Gmail, Twittroid, Facebook...):</p><pre><code>public void share() {    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);    shareIntent.setType(""text/plain"");    shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getText(R.string.menu_share_subject));    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, getText(R.string.menu_share_body));    startActivity(Intent.createChooser(shareIntent, getText(R.string.menu_share_intent)));      }</code></pre><p>The sharing functionality works basically. But when the sharing app (Facebook, Twitter, ...) tries to return to my app, a force close is thrown.</p><p>I guess that my app gets closed in the background during the sharing process. At least that is what the debugger says.</p><p>Any ideas?</p><hr><p>The problem seems to be that the app closes in the background. Also when I open the browser from my app an try to return to my app with the back key. A force close is thrown. This is the Log Cat output</p><pre><code>04-13 22:28:42.003: ERROR/AndroidRuntime(18915): Uncaught handler: thread main exiting due to uncaught exception 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): java.lang.RuntimeException: Unable to start activity ComponentInfo{eu.xxx.xxx/eu.xxx.xxx.xxx}: java.lang.NullPointerException 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.os.Handler.dispatchMessage(Handler.java:99) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.os.Looper.loop(Looper.java:123) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread.main(ActivityThread.java:4203) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at java.lang.reflect.Method.invokeNative(Native Method) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at java.lang.reflect.Method.invoke(Method.java:521) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at dalvik.system.NativeStart.main(Native Method) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): Caused by: java.lang.NullPointerException 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at eu.xxx.xxx.xxx.fillData(xxx.java:178) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at eu.xxx.xxx.xxx.access$1(xxx.java:173) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at eu.xxx.xxx.xxx$1.onTextChanged(xxx.java:139) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.TextView.sendOnTextChanged(TextView.java:6096) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.TextView.setText(TextView.java:2677) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.TextView.setText(TextView.java:2542) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.EditText.setText(EditText.java:71) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.TextView.setText(TextView.java:2517) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.widget.TextView.onRestoreInstanceState(TextView.java:2417) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.view.View.dispatchRestoreInstanceState(View.java:5689) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.view.View.restoreHierarchyState(View.java:5668) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1506) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.Activity.onRestoreInstanceState(Activity.java:833) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ListActivity.onRestoreInstanceState(ListActivity.java:221) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.Activity.performRestoreInstanceState(Activity.java:805) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1172) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2378) 04-13 22:28:42.253: ERROR/AndroidRuntime(18915): ... 11 more</code></pre>","268125","","1765573","","2013-07-19 07:06:19","2013-07-19 07:06:19","Android application chrashes after ""share"" intent","<android><facebook><twitter><android-intent><share>","2","2","2","",""
"2632966","1","2641363","","2010-04-13 20:27:49","7","2559","<p>I am trying to receive an image from the Android Gallery via an ACTION_SEND intent. I have set the proper intent filters and the Gallery opens my app. Now I want to know how to get at the image data. I can't find any examples on the internet of how this is done. I figure the path is somewhere in intent.getData() but how exactly do I pull that image from the gallery?</p>","246589","","","","","2011-09-15 18:22:50","Receiving an ACTION_SEND intent from the Gallery","<android>","2","0","5","",""
"2633029","1","5914317","","2010-04-13 20:38:43","1","164","<p>I am working on am Android Scripting Environment (ASE) script in Python to replicate an iPhone app.</p><p>I need a device UID of some sort. My thoughts where a salted MD5 hash of the MAC address or device phone number, but I can't figure out how to access either of those using the Python APIs within ASE.</p><p>What can I do to create a UID in Python in ASE?</p>","143222","","","","","2011-05-06 16:29:26","How to get a Device Specific UID using Python in ASE on Android?","<python><android><ase><android-scripting>","1","0","","",""
"2633316","1","","","2010-04-13 21:21:59","0","622","<p>I have the following code that creates a notification when an SMS message is received by the phone.  It displays the notification correctly; however, when the user clicks the notification, nothing happens.  It should open up the SMS inbox so the user can view their message. Thanks in advance.</p><pre><code>mNotificationManager = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE);Uri uri = Uri.parse(""content://sms/inbox"");PendingIntent contentIntent = PendingIntent.getActivity(arg0, 0, new Intent(Intent.ACTION_VIEW, uri), Intent.FLAG_ACTIVITY_NEW_TASK);String tickerText = arg0.getString(R.string.newmsg, msgs[i].getMessageBody().toString());Notification notif = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());notif.setLatestEventInfo(arg0, msgs[i].getOriginatingAddress(), msgs[i].getMessageBody().toString(), contentIntent);notif.vibrate = new long[] { 100, 250, 100, 500 };mNotificationManager.notify(R.string.recv_msg_notif_id, notif);</code></pre>","315917","","","","","2011-09-01 11:38:43","Android Unable to launch the Inbox from a notification","<android><notifications>","1","2","","",""
"2633334","1","2633457","","2010-04-13 21:24:29","15","5186","<p>What are the advantages/disadvantages in placing a lengthy network access code in a thread in an activity or a thread in a service?  How would it affect the application?  I am writing a streaming audio player and from what I've read so far putting the code in a service will still end up blocking the application so a new thread is needed, does anyone know if it makes more sense to put this piece of code in a service.</p><p>Thanks</p>","315915","","","","","2012-03-22 14:56:57","Application threads vs Service threads","<android><multithreading><service><media-player>","2","0","5","",""
"2633428","1","2694933","","2010-04-13 21:39:58","0","2882","<p>RED 5 video server on Android mobile phone... Is there any Open Source port project? So like simple opensource live Camera Video \ Audio encoding to FLV... I need such Opensource project to create Android live video streaming client for my server (I want to encode video on clients into FLV)</p>","434051","","","","","2010-06-15 11:07:08","RED 5 video server on Android mobile phone... Is there any Open Source port?","<java><android><flv><red5>","2","0","1","",""
"2633742","1","2633760","","2010-04-13 22:52:24","17","38175","<p>What is the most efficient way to port an iPhone app to Android?  I know Apple doesn't like 3rd-party, non-Objective C platforms generating code for their platform ... but is there something out there that can take an iPhone app and convert it to Android friendly code?</p><p>If not, how have folks out there been creating Android versions of their existing iPhone apps?</p><p>Thanks</p>","54818","","","","","2013-07-24 19:15:52","Port iPhone application to Android","<java><iphone><objective-c><android>","8","0","7","",""
"2633769","1","2633839","","2010-04-13 22:58:03","7","6558","<p>I will try to explain a simple app scenario: My app goes right to a 'main view'. In this main view I have inserted a <code>TextView</code> which displays current settings created by way of the <code>PreferenceManager</code>. For simplicity sake, let's say I have a checkbox in my settings. When I first start my app - the <code>TextView</code> on my main view shows my checkbox setting correctly (true). Now I go to the settings menu, it pops-up, and then I change it to false. I go back to the main view and see no change. It still say's true even after I changed it to false. If I end the app and then re-start it - all is well and it shows my change.</p><p>Apparently the main view just stays in the background while I'm changing settings? How can I redraw or update the main view after I change settings?</p>","237863","","121278","","2013-03-01 14:28:10","2013-03-01 14:28:10","After changing a preference (a setting), text showing settings doesn't update","<android><android-preferences>","2","0","4","",""
"2633973","1","5493490","","2010-04-13 23:47:12","2","502","<p>How do I display an image of arbitrary size without OOMing or downscaling the image.I dont want to downscale due to zooming and dragging of the picture?</p><p>If it isnt possible to display an image of arbitrary size, how do I determine the maximum possible size of the image to display, without causing a OOM?</p>","300314","","881229","","2014-02-01 20:21:33","2014-02-01 20:21:33","Displaying a bitmap of arbitrary size without running out of memory","<android><memory><android-widget><out-of-memory>","1","0","","",""
"2634073","1","3952933","","2010-04-14 00:10:59","49","30039","<p>I want to make an <code>Animation</code> for when a <code>View</code> gets it's visibility set to <code>GONE</code>. Instead of just dissapearing, the <code>View</code> should 'collapse'. I tried this with a <code>ScaleAnimation</code> but then the <code>View</code> is collapse, but the layout will only resize it's space after (or before) the <code>Animation</code> stops (or starts).</p><p>How can I make the <code>Animation</code> so that, while animating, the lower <code>View</code>s will stay directly below the content, instead of having a blank space?</p>","120309","","120309","","2010-04-14 21:49:56","2013-09-16 10:06:20","How do I animate View.setVisibility(GONE)","<android><animation>","4","4","42","",""
"2634183","1","","","2010-04-14 00:46:25","1","4145","<p>i am trying to create two spinning wheels, as in pulleys, so everytime the attached rope moves, the two pulleys will rotate.  i have tried two approaches:</p><p>1) use Matrix.postRotate within the onDraw() method of the View class, which calls the following:</p><pre><code>private void drawSpinningWheel(Canvas canvas){    try    {        canvas.save();            Bitmap bitmapOrg = null;        int iDrawable = R.drawable.spinning_button;        bitmapOrg = BitmapFactory.decodeResource(getResources(), iDrawable);        if(bitmapOrg != null)        {            int width = bitmapOrg.getWidth();             int height = bitmapOrg.getHeight();             int newWidth = 24;             int newHeight = 24;             // calculate the scale - in this case = 0.4f             float scaleWidth = ((float) newWidth) / width;             float scaleHeight = ((float) newHeight) / height;             // createa matrix for the manipulation             Matrix matrix = new Matrix();             // resize the bit map             matrix.postScale(scaleWidth, scaleHeight);             matrix.postRotate((float) mDegrees++);            Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,                     width, height, matrix, true);             canvas.drawBitmap(resizedBitmap, matrix, null);        }        canvas.restore();    }    catch(Exception e)    {        Log.e(TAG + ""drawSpinningWheel"", e.getMessage());    }}</code></pre><p>but it seems like the image not only spins but rotates around another axis</p><p>2) use SurfaceView and a separate thread, in the run() call this:</p><pre><code>    private void doDraw(Canvas canvas) {        // Draw the background image. Operations on the Canvas accumulate        // so this is like clearing the screen.        canvas.drawBitmap(mBackgroundImage, 0, 0, null);        int yTop = mCanvasHeight - ((int) mY + mSpinningWheelImageHeight / 2);        int xLeft = (int) mX - mSpinningWheelImageWidth / 2;</code></pre><p>...</p><pre><code>        // Draw the ship with its current rotation        canvas.save();        canvas.rotate((float) mHeading++, (float) mX, mCanvasHeight                - (float) mY);            mSpinningWheelImage.setBounds(xLeft, yTop, xLeft + mSpinningWheelImageWidth, yTop                    + mSpinningWheelImageHeight);            mSpinningWheelImage.draw(canvas);        canvas.restore();    }</code></pre><p>i get the spinning to work but i can't add another spinning wheel.  i even tried to create another thread for the second spinning wheel, only one shows up.  can someone point me in the right direction?  thanks.</p><p>3) ok now i also tried RotateAnimation:</p><p>public class GraphicsView extends View{    private static final String QUOTE =        ""Nobody uses Java anymore. It's this big heavyweight ball and chain."";</p><pre><code>private Animation anim;private Animation anim2;private Bitmap jobs;private Bitmap wheel;private int jobsXOffset;        private int jobsYOffset;private int wheelXOffset;        private int wheelYOffset;public GraphicsView(Context context) {    super(context);    jobs = BitmapFactory    .decodeResource(getResources(), R.drawable.spinning_button);    jobsXOffset = jobs.getWidth() / 2;    jobsYOffset = jobs.getHeight() / 2;    wheel = BitmapFactory    .decodeResource(getResources(), R.drawable.wheel);    wheelXOffset = jobs.getWidth() / 2;    wheelYOffset = jobs.getHeight() / 2;}private void createAnim(Canvas canvas) {    anim = new RotateAnimation(0, 360, canvas.getWidth() / 2, canvas            .getHeight() / 2);    anim.setRepeatMode(Animation.INFINITE);    anim.setRepeatCount(Animation.INFINITE);    anim.setDuration(10000L);    anim.setInterpolator(new AccelerateDecelerateInterpolator());    startAnimation(anim);}private void createAnim2(Canvas canvas) {    anim2 = new RotateAnimation(0, 360, canvas.getWidth() / 2+30, canvas            .getHeight() / 2);    anim2.setRepeatMode(Animation.INFINITE);    anim2.setRepeatCount(Animation.INFINITE);    anim2.setDuration(10000L);    anim2.setInterpolator(new AccelerateDecelerateInterpolator());    startAnimation(anim);}@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    // creates the animation the first time    if (anim == null) {        createAnim(canvas);    }    int centerX = canvas.getWidth() / 2;    int centerY = canvas.getHeight() / 2;    canvas.drawBitmap(jobs, centerX - jobsXOffset,            centerY - jobsYOffset, null);    canvas.drawBitmap(wheel, centerX - wheelXOffset + 30,            centerY - wheelYOffset, null);}</code></pre><p>}</p><p>but the result is similar to Canvas.Rotate, i was able to get the first image to rotate fine, but the second image will simply revolve around the first image, although i notice the second image is actually rotating too.  looks like i will need a separate view for the second image, i was hoping to avoid this, because i am not sure how to make the wheel spin but the attached rope to not spin.</p>","270811","","270811","","2010-04-14 23:43:28","2010-06-29 03:30:34","android spinning image","<android><image><spinning>","2","0","","",""
"2634399","1","","","2010-04-14 01:58:32","11","4864","<p>I have an early version of my app that I want some testers to take a look at.  But I am not ready to put it on Market.  How do I distribute it to my testers and how do they install it on their phones.  One of the beta testers has a Asus eeePC with Android 2.0 installed and I would like him to try it too.  How does this work?</p>","316077","","","","","2014-04-16 15:24:41","How do I distribute Android app to beta tester without using Market","<android>","5","0","5","",""
"2634422","1","2634708","","2010-04-14 02:03:59","0","382","<p>I apologize if this code looks a bit like a mess (considering the length); I figured I'd just include everything that goes on in my program at the moment.</p><p>I'm attempting to create a fairly simple Tic Tac Toe app for Android. I've set up my UI nicely so far so that there are a ""grid"" of TextViews. As a sort of ""debug"" right now, I have it so that when one clicks on a TextView, it should display the value of buttonId in a message box. Right now, it displays the correct assigned value for the first element I click, but no matter what I click afterwards, it always just displays the first value buttonID had. I attempted to debug it but couldn't exactly find a point where it would pull the old value (to the best of my knowledge, it reassigned the value).</p><p>There's a good possibility I'm missing something small, because this is my first Android project (of any note). Can someone help get different values of buttonId to appear or point out the error in my logic?</p><p><strong>The code:</strong></p><pre><code>package com.TicTacToe.app;import com.TicTacToe.app.R;//Other import statementspublic class TicTacToe extends Activity {public String player = ""X"";public int ALERT_ID;public int buttonId;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //Sets up instances of UI elements    final TextView playerText = (TextView)findViewById(R.id.CurrentPlayerDisp);    final Button button = (Button) findViewById(R.id.SetPlayer);    final TextView location1 = (TextView)findViewById(R.id.location1);    final TextView location2 = (TextView)findViewById(R.id.location2);    final TextView location3 = (TextView)findViewById(R.id.location3);    final TextView location4 = (TextView)findViewById(R.id.location4);    final TextView location5 = (TextView)findViewById(R.id.location5);    final TextView location6 = (TextView)findViewById(R.id.location6);    final TextView location7 = (TextView)findViewById(R.id.location7);    final TextView location8 = (TextView)findViewById(R.id.location8);    final TextView location9 = (TextView)findViewById(R.id.location9);    playerText.setText(player);    //Handlers for events    button.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            // Perform action on click            if (player.equals(""X"")){                player = ""O"";                playerText.setText(player);            }            else if(player.equals(""O"")){                player = ""X"";                playerText.setText(player);            }            //Sets up the dialog            buttonId = 0;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location1.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 1;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location2.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 2;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location3.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 3;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location4.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 4;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location5.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 5;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location6.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 6;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location7.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 7;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location8.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 8;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });    location9.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            //Sets up the dialog            buttonId = 9;            ALERT_ID = 0;            onCreateDialog(ALERT_ID);            showDialog(ALERT_ID);        }    });}protected Dialog onCreateDialog(int id){    String msgString = ""You are on spot "" + buttonId;    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(msgString)            .setCancelable(false)            .setNeutralButton(""Ok"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    dialog.cancel();                    }                });    AlertDialog alert = builder.create();    return alert;}}</code></pre>","316079","","","","","2010-04-14 03:37:08","Clicking Elements in Android Doesn't Display the Correct Values","<java><android>","1","0","","",""
"2634850","1","","","2010-04-14 04:17:12","34","38041","<p>I can't seem to control the dialog width.  I have a simple layout like so`</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:theme=""@android:style/Theme.Dialog""&gt; &lt;ScrollView     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=""fill_parent""&gt;    &lt;TextView android:id=""@+id/name_prompt_view""        android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/name_prompt""     android:padding=""10dip""/&gt;    &lt;EditText android:id=""@+id/name_inp"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""    android:lines=""1""      android:maxLines=""1""      android:maxLength=""48""      android:inputType=""text""&gt; &lt;/EditText&gt;  &lt;TextView android:id=""@+id/t1_prompt_view""        android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/t1_prompt""     android:padding=""10dip""/&gt;    &lt;Spinner android:id=""@+id/t1_inp"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""    android:lines=""1""      android:maxLines=""1""      android:maxLength=""48""      android:inputType=""text""      android:singleLine=""true""      android:layout_weight=""1""      android:entries= ""@array/t1_allowed_values""&gt; &lt;/Spinner&gt;     &lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>for some reason the dialog is only wide enough for  the text input field about 11 chars wide.  How do I make the dialog width fill the screen?</p>","316141","","760489","","2011-10-04 05:38:17","2013-04-26 10:41:24","Android dialog width","<android><dialog><width>","5","2","10","",""
"2634973","1","2635311","","2010-04-14 04:50:14","1","616","<p>Can we use DDMS to take a screen capture with a device skin? Right now I'm just getting the exact screen rect area in my screen captures,</p><p>Thanks</p>","246114","","","","","2012-04-19 17:09:11","Android ddms screen capture with skin?","<android><android-emulator>","2","0","","",""
"2634975","1","","","2010-04-14 04:50:35","2","1957","<p>Creating a game in Android using multiple Buttons to display an image from the drawable folder. I want to change the button to a different image after the button has been clicked on. Here is the button code:</p><pre><code>    &lt;Button android:id=""@+id/b36""    android:background=""@drawable/black""    android:layout_width=""45px""    android:layout_height=""45px""    /&gt;  </code></pre><p>I can't find anything about how to change the actual image of the button. You can change the color of the button by using the following code in the java file:</p><pre><code>b36.setBackgroundColor(0xAA00AA00);</code></pre>","316148","","316148","","2010-04-14 05:29:32","2010-04-14 13:35:19","Changing Image In a Button After Being Clicked?","<xml><android><button>","3","0","","",""
"2634991","1","2639515","","2010-04-14 04:55:13","125","69410","<p>I'm trying to open a dialog window, but every time I try to open it it throws this exception:</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionandroid.view.WindowManager$BadTokenException:      Unable to add window -- token null is not for an application  at android.view.ViewRoot.setView(ViewRoot.java:460)  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)  at android.app.Dialog.show(Dialog.java:238)  at android.app.Activity.showDialog(Activity.java:2413)</code></pre><p>I'm creating it by calling <code>showDialog</code> with the display's id. The <code>onCreateDialog</code> handler logs fine and I can step through it without an issue, but I've attached it since it seems like I'm missing something:</p><pre><code>@Overridepublic Dialog onCreateDialog(int id){    Dialog dialog;    Context appContext = this.getApplicationContext();    switch(id)    {        case RENAME_DIALOG_ID:            Log.i(""Edit"", ""Creating rename dialog..."");            dialog = new Dialog(appContext);            dialog.setContentView(R.layout.rename);            dialog.setTitle(""Rename "" + noteName);            break;        default:            dialog = null;            break;    }    return dialog;      }</code></pre><p>Is there something missing from this? Some questions have talked about having this problem when creating a dialog from <code>onCreate</code>, which happens because the activity isn't created yet, but this is coming from a call from a menu object, and the <code>appContext</code> variable seems like it is correctly populated in the debugger.</p>","32771","","356895","","2013-11-22 16:34:52","2014-02-24 06:56:20","Android 1.6: ""android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application""","<android><android-dialog><runtimeexception><android-windowmanager>","7","0","33","",""
"2635183","1","","","2010-04-14 06:00:42","0","1937","<p>I have uploaded my application's .apk file to a server.When i try to download that .apk file to my android HTC HERO phone then it gives error saying""file size cannot be determined"".</p><p>I also enabled settings to ""allow install of non-Market applications"" in my HTC HERO.</p><p>Please help me if i am missing somthing .</p><p>and is there any signing we have to do in android like symbian signing in Symbian Devices???</p>","316190","","114066","","2010-07-19 12:22:00","2010-07-19 12:22:00","Android : uploaded .apk file to server but cant download that .apk file","<android>","2","1","","",""
"2635486","1","2635521","","2010-04-14 07:08:27","0","383","<p>I want to implement an android app which compares recorded audio files with our sound database and reports a similiarity metric. The app will work somehow like Shazam but is matched against our database audio files. Can anyone point me to an open source project which implements adequate algorithms to do the sound recogognition/comparision on our server ? Thanks</p>","20278","","881229","","2013-09-10 17:28:17","2013-09-10 17:28:17","Framework/Algorithms/Library for server side estimation/recognition of audio file similarity?","<android><audio><sound-recognition>","1","0","2","2013-09-11 13:13:15",""
"2635685","1","3159792","","2010-04-14 07:44:50","4","9688","<p>Android:How to display images from the web in a ListView?I have the following code to display image from a URL in an ImageView:</p><pre><code>import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import android.app.ListActivity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.widget.ImageView;public class HttpImgDownload extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Bitmap bitmap =            // DownloadImage(           // ""http://www.streetcar.org/mim/cable/images/cable-01.jpg"");            DownloadImage(         ""http://s.twimg.com/a/1258674567/images/default_profile_3_normal.png"");        ImageView img = (ImageView) findViewById(R.id.img);        img.setImageBitmap(bitmap);    }       private InputStream OpenHttpConnection(String urlString)     throws IOException    {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);         URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))                                 throw new IOException(""Not an HTTP connection"");        try{            HttpURLConnection httpConn = (HttpURLConnection) conn;            httpConn.setAllowUserInteraction(false);            httpConn.setInstanceFollowRedirects(true);            httpConn.setRequestMethod(""GET"");            httpConn.connect();             response = httpConn.getResponseCode();                             if (response == HttpURLConnection.HTTP_OK) {                in = httpConn.getInputStream();                                             }                             }        catch (Exception ex)        {            throw new IOException(""Error connecting"");                    }        return in;         }    private Bitmap DownloadImage(String URL)    {                Bitmap bitmap = null;        InputStream in = null;                try {            in = OpenHttpConnection(URL);            bitmap = BitmapFactory.decodeStream(in);            in.close();        } catch (IOException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        }        return bitmap;                    }}</code></pre><p>Now how can i display images in an array in a listview? Here's how i want to display the images: <a href=""http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&amp;width=279"" rel=""nofollow"">http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&amp;width=279</a></p><hr><p>This is what i have come up with:</p><pre><code>import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import android.app.Activity;import android.os.Bundle;import android.app.ListActivity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.view.View;import android.view.ViewGroup;import android.view.LayoutInflater;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;public class ImageFromWeb extends ListActivity {    /** Called when the activity is first created. */    TextView selection;    Bitmap bitmap;    String[] items={""lorem"", ""ipsum"", ""dolor"", ""sit"", ""amet"",                    ""consectetuer"", ""adipiscing"", ""elit"", ""morbi"", ""vel"",                    ""ligula"", ""vitae"", ""arcu"", ""aliquet"", ""mollis"",                    ""etiam"", ""vel"", ""erat"", ""placerat"", ""ante"",                    ""porttitor"", ""sodales"", ""pellentesque"", ""augue"",                    ""purus""};    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);     bitmap =             DownloadImage(            ""http://www.streetcar.org/mim/cable/images/cable-01.jpg"");            //DownloadImage(        // ""http://s.twimg.com/a/1258674567/images/default_profile_3_normal.png"");        //ImageView img = (ImageView) findViewById(R.id.img);        //icon.setImageBitmap(bitmap);        //icon       // ImageView icon=(ImageView)row.findViewById(R.id.icon);        //setListAdapter(new IconicAdapter());        //selection=(TextView)findViewById(R.id.selection);    }    private InputStream OpenHttpConnection(String urlString)     throws IOException    {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);         URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))                                 throw new IOException(""Not an HTTP connection"");        try{            HttpURLConnection httpConn = (HttpURLConnection) conn;            httpConn.setAllowUserInteraction(false);            httpConn.setInstanceFollowRedirects(true);            httpConn.setRequestMethod(""GET"");            httpConn.connect();             response = httpConn.getResponseCode();                             if (response == HttpURLConnection.HTTP_OK) {                in = httpConn.getInputStream();                                             }                             }        catch (Exception ex)        {            throw new IOException(""Error connecting"");                    }        return in;         }    private Bitmap DownloadImage(String URL)    {                Bitmap bitmap = null;        InputStream in = null;                try {            in = OpenHttpConnection(URL);            bitmap = BitmapFactory.decodeStream(in);            in.close();        } catch (IOException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        }        return bitmap;                    }    public void onListItemClick(ListView parent, View v,                                                            int position, long id) {        selection.setText(items[position]);    }    class IconicAdapter extends ArrayAdapter {        IconicAdapter() {            super(ImageFromWeb.this, R.layout.row, items);        }        public View getView(int position, View convertView,                                                ViewGroup parent) {            LayoutInflater inflater=getLayoutInflater();            View row=inflater.inflate(R.layout.row, 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].length()&gt;4) {                //icon.setImageResource(R.drawable.delete);                //icon.setI                icon.setImageBitmap(bitmap);            //}            //else {                //icon.setImageResource(R.drawable.ok);            //}            return(row);        }    }}</code></pre><p>main.xml</p><p></p><pre><code>&lt;TextView    android:id=""@+id/selection""    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=""fill_parent""    android:drawSelectorOnTop=""false""    &gt;</code></pre><p></p><p>row.xml</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""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""22px""        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:textSize=""40sp""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>But the image is not displayed from the web. There is something wrong in the sequence of this code. Can someone sort it out?</p>","2355649","","16587","","2013-03-08 13:27:12","2013-03-08 13:27:12","Android:How to display images from the in a ListView?","<android><list>","2","0","1","",""
"2635708","1","2635792","","2010-04-14 07:48:38","6","16482","<p>I'm only starting with Android dev, and while the Milestone is a nice device Java is not my natural language and I'm struggling with both the Google docs on Android SDK, Eclipse and Java itself. Anyway...</p><p>I'm writing a microblog client for Android to go along with my Windows client (MahTweets). At the moment I've got Tweets coming and going without fail, the problem is with the UI. </p><p>The initial call will order items correctly (as in highest to lowest)</p><ul><li>3</li><li>2</li><li>1</li></ul><p>When a refresh is made</p><ul><li>3</li><li>2</li><li>1</li><li>6</li><li>5</li><li>4</li></ul><p>After the tweets are processed, I'm calling <code>adapter.notifyDataSetChanged();</code>Initially I thought that getItem() on the Adapter needed to be sorted (and the code below is what I ended up with), but I'm still not having any luck.</p><pre><code>public class TweetAdapter extends BaseAdapter{private List&lt;IStatusUpdate&gt; elements;private Context c;public TweetAdapter(Context c, List&lt;IStatusUpdate&gt; Tweets){    this.elements = Tweets;    this.c = c;}public int getCount() {    return elements.size();}public Object getItem(int position) {    Collections.sort(elements, new IStatusUpdateComparator());    return elements.get(position);}public long getItemId(int id) {    return id;}public void Remove(int id){       notifyDataSetChanged();}public View getView(int position, View convertView, ViewGroup parent) {    RelativeLayout rowLayout;    IStatusUpdate t = elements.get(position);            rowLayout = t.GetParent().GetUI(t, parent, c);    return rowLayout;}class IStatusUpdateComparator implements Comparator{    public int compare(Object obj1, Object obj2)    {        IStatusUpdate update1 = (IStatusUpdate)obj1;        IStatusUpdate update2 = (IStatusUpdate)obj2;        int result = update1.getID().compareTo(update2.getID());        if (result == -1)        return 1;        else if (result == 1)        return 0;        return result;    }}}</code></pre><p>Is there a better way to go about sorting ListViews in Android, while still being able to use the LayoutInflater? (<code>rowLayout = t.GetParent().GetUI(t, parent, c)</code> expands the UI to the specific view which the microblog implementation can provide)</p>","657177","","","","","2010-04-14 08:05:38","Sorting Android ListView","<java><android><listview>","1","0","4","",""
"2635746","1","2637380","","2010-04-14 07:57:27","1","899","<p>I am a student in the process a building an Android app that can post a GPS track into a Rails application.  I would like to do things the ""Rails"" way and take advantage of the REST.  My rails application basically has 3 models at this point: users, tracks, and points.  A user has_many tracks and a track has_many points.  A track also has a total distance.  Points have a latitude and longitude. I have successfully been able to create an empty track with:</p><pre><code>curl -i -X POST -H 'Content-Type: application/xml' -d '&lt;track&gt;&lt;distance&gt;100&lt;/distance&gt;&lt;/track&gt;' http://localhost:3000/users/1/tracks</code></pre><p><strong>Whoo hoo!</strong>  That is pretty cool.  I am really impressed that rails do this.  Just to see what would happen I tried the following:</p><pre><code>curl -i -X POST -H 'Content-Type: application/xml -d '&lt;track&gt;&lt;distance&gt;100&lt;/distance&gt;&lt;points&gt;&lt;point&gt;&lt;lat&gt;3&lt;/lat&gt;&lt;lng&gt;2&lt;/lng&gt;&lt;/point&gt;&lt;/points&gt;&lt;/track&gt;' http://localhost:3000/users/1/tracks</code></pre><p><strong>Fail!</strong> The server spits back: </p><blockquote>  <p>Processing TracksController#create (for 127.0.0.1 at 2010-04-14 00:03:25) [POST]    Parameters: {""track""=>{""points""=>{""point""=>{""lng""=>""2"", ""lat""=>""3""}}, ""distance""=>""100""}, ""user_id""=>""1""}    User Load (0.6ms)   SELECT * FROM ""users"" WHERE (""users"".""id"" = 1) </p>    <p>ActiveRecord::AssociationTypeMismatch (Point(#-620976268) expected, got Array(#-607740138)):    app/controllers/tracks_controller.rb:47:in `create'</p></blockquote><p>It seems my tracks_controller doesn't like or understand what it's getting from the params object in my tracks_controller.rb:</p><pre><code>def create    @track = @user.tracks.build(params[:track])</code></pre><p>My xml might be wrong, but at least Rails seems to be expecting a Point from it.  Is there anyway I can fix TracksController.create so that it will be able to parse xml of a track with nested multiple points?  Or is there another way I should be doing this entirely?</p>","216548","","","","","2010-04-14 12:51:23","How do I utilize REST to post GPS data from an Android device into a Ruby on Rails application?","<ruby-on-rails><xml><ruby><android><rest>","1","0","1","",""
"2635786","1","","","2010-04-14 08:04:59","8","3872","<p>I'm trying to download large file from Internet (>20Mb)</p><pre><code>private class DownloadTask extends AsyncTask&lt;DatabaseInfo, Integer, String&gt; {    private DatabaseInfo info;    protected String doInBackground(DatabaseInfo... dbInfo) {        int count;        info = dbInfo[0];        try {            URL url = new URL(dbInfo[0].dbPath);            InputStream input = new BufferedInputStream(url.openStream());            OutputStream output = new FileOutputStream(""/sdcard/db.zip"");            byte data[] = new byte[1024];            int total = 0;            while ((count = input.read(data)) != -1) {                //output.write(data, 0, count);                total += count;                if (total % 10240 == 0) {                    publishProgress(total);                }            }            output.flush();            output.close();            input.close();        }         catch (Exception e) {            Log.e(""err"", e.getMessage());        }        return null;    }    protected void onProgressUpdate(Integer... total) {        int perc = (int) ((float) total[0] / (float) info.dbZipSize * 100);        mProgressDialog.setProgress(perc);    }    protected void onPostExecute(String s) {        dismissDialog(DIALOG_PROGRESS);        Log.e(""err"", ""finish!"");    }}</code></pre><p>If I uncomment line</p><pre><code>//output.write(data, 0, count);</code></pre><p>after 7-15% downloading progressbar dialog dismiss and I see ""finish!"" in Log. Why?</p>","301249","","579828","","2013-07-20 19:22:39","2013-07-20 19:22:39","Android: download large file","<android><asynchronous><download><android-asynctask>","1","5","4","",""
"2635945","1","2636252","","2010-04-14 08:38:12","5","2223","<p>Need to know this so that i could send DTMF and that is going to be my second question!</p>","279560","","","","","2012-01-16 14:59:54","How to know if i am successfully connected to my outgoing number in Android?","<java><android><telephony>","1","1","1","",""
"2636048","1","","","2010-04-14 08:51:57","0","1792","<p>I have already posted my query <a href=""http://www.anddev.org/prevent_manual_moving_of_seekbar_widget-t13048.html"" rel=""nofollow"">here</a>, but unfortunately, not getting the required support for this simple query.</p><p>I am using a progressbar widget in my application to show the download progress.</p><p>In the current state, I am able to manually move the slider back and forth while download is progressing. How can I prevent the manual moving of progressbar, instead it works only based on</p><p><code>progressbar.setProgress(progressbar.getProgress() + 1024);</code> -- currently this works perfect, but I need to prevent the manual moving of progressbar during download.</p>","316328","","114066","","2010-07-06 14:16:58","2010-07-06 14:16:58","Stop Progressbar manual scrolling in Android","<android><android-widget>","1","0","","",""
"2636098","1","2649198","","2010-04-14 09:01:21","14","18210","<p>The OnItemSelectedListener event handler gets called both when a spinnerselection is changed programmatically, and when a user physically clicks the spinner control.Is is possible to determine if an event was triggered by a userselection somehow?</p><p>Or is there another way to handle spinner user selections?</p>","164460","","","","","2014-03-15 20:05:52","Android Spinner selection","<android><selection><spinner>","8","1","9","",""
"2636184","1","","","2010-04-14 09:16:31","0","403","<p>is it possible to use the com.androird.alarmclock so that I can use it to kick off alarm features in my application.  if it is how can i do it?</p>","316341","","","","","2011-04-07 00:50:18","using android alarmclock","<android>","3","0","1","",""
"2636206","1","","","2010-04-14 09:20:03","0","185","<p>I dont know why the sample application from the android website gives me 300+ errors when i try to run it in ecplise galileo. The application i am trying is Bluetoothchat it is straight from the sdk sample folder so it shouldn't contain any. I have added android.jar and I do have an emulator. I have tried HelloWorld and it worked..Could someone help me? Thanks</p>","316305","","","","","2010-10-14 08:45:37","Why does eclipse give me errors when i try to run sample application?","<java><android><bluetooth><sample>","1","1","","",""
"2636250","1","2636363","","2010-04-14 09:28:38","0","3454","<p>I have a ImageView and draw some things on that view. Now I want to have the position of the click in the onClickListener.</p><p>Although I think that's not really possible (storing the position in the onTouchListener is not working), I want to ask, if there is any other way to accomplish that?</p><p>The goal is to have a image with some overlays, that should be clickable. I thought about AbsolutLayout, but that is depracated, so what now?</p><p>Thx for any help.</p>","316353","","","","","2010-04-14 09:48:48","Android ImageView clickable overlays","<android><overlay><imageview><clickable>","1","0","","",""
"2636333","1","2637031","","2010-04-14 09:43:10","1","1325","<p>I suspect that adding a certain letter/character to the beginning of my text will solve an alignment problem I am currently facing. Needless to say that I do not wish for this letter to appear.<br>Is there a way to tell a portion of the text to be invisible/transparent?<br>I reviewed the <em>Spannable</em>  interface could not find anything related to visibility.  </p><p>Thanks,Rob</p>","283630","","","","","2010-04-14 13:15:07","Android, make portions of text invisible in TextView","<android><text><visibility>","2","1","","",""
"2636617","1","2636891","","2010-04-14 10:34:04","7","3905","<p>What is better, to develop my Android app on a Windows PC or a mac?</p>","237863","","","","","2010-04-14 14:15:20","Android: Which is better, develop Android app on a mac or a windows pc?","<android>","5","3","","",""
"2636629","1","2637034","","2010-04-14 10:35:54","2","1415","<p>I have a ratingbar in my app, and I would like when I pass the mouse over it, the rating changes</p><p>How can I do that ? it's possible? </p><p>best regards</p>","309897","","","","","2012-02-25 05:13:15","Change Rating Bar on Android","<java><android>","2","2","1","",""
"2636729","1","2638742","","2010-04-14 10:55:14","1","2533","<p>I could send mail from my Activity when i have already configured with any email account in android.</p><p>But in case if have not configured, is there any way to launch email setup screen from my Activity ,or at least check whether email account is setup  before sending a email.  </p><p>If i haven't set up my email account then the following code takes me to compose SMS/MMS,which i don't want ,Please give your suggestion. </p><pre><code>Intent emailIntent = new Intent(Intent.ACTION_SEND);emailIntent.putExtra(Intent.EXTRA_EMAIL, ""example.com"");emailIntent.putExtra(Intent.EXTRA_SUBJECT, ""..."");emailIntent.putExtra(Intent.EXTRA_TEXT,""..."");emailIntent.setType(""text/plain"");startActivity(Intent.createChooser(emailIntent, ""Send mail...""));</code></pre>","286044","","219883","","2014-03-21 05:24:42","2014-03-21 05:24:42","How to launch android email setup screen programmatically from my activity","<android><email>","2","1","1","",""
"2636805","1","2637061","","2010-04-14 11:12:40","2","2399","<p>I am making a menu for an app and was pointed to <a href=""http://androiddrawableexplorer.appspot.com/"" rel=""nofollow"">this useful resource</a> which lists all the drawables that are part of the android 2.0 jar. the usage example given is </p><pre><code>myMenuItem.setIcon(android.R.drawable.ic_menu_save);</code></pre><p>Unfortunately, the one I want (and most of the list) are not available by default. I get</p><pre><code>android.R.drawable.ic_menu_login cannot be resolved</code></pre><p>when I try to set the menu item images:</p><pre><code>    @Overridepublic boolean onCreateOptionsMenu(Menu menu) {    // Add two example menu buttons    int groupId = 0;    int menuItemOrder = Menu.NONE;    int menuItemId = 1;    String menuItemText = ""Add Login Details"";    MenuItem menuItem = menu.add(groupId, menuItemId, menuItemOrder, menuItemText);    menuItem.setIcon(android.R.drawable.ic_menu_login )</code></pre><p>Did something change in recent android releases? It seems that most of these are now 'private resources'... couldn't find much info on this but I found some advice:</p><blockquote>  <p>It is used to access private  resources. Do not use it because these  private resources are often  removed/renamed/etc. Using it would  most likely break your app in the  future.</p></blockquote><p>Why would they change the resource names anyway?(the images behind them sure, but the names?) How do I access ic_menu_login then? Is there a better reason not to than the above?</p>","65025","","","","","2010-04-14 11:52:58","clarification on 'private' drawables in android.R.drawable","<android><resources><drawable>","1","0","2","",""
"2636906","1","2636991","","2010-04-14 11:27:55","4","399","<p>This question occured to me while programming a Android application,but it seems to be a general programming question more.</p><p>The situation is, I am extending (subclass-ing) an class from a library, and overriding a method. how do I know if I should invoke the method of super-class? and when? (in the beginning of the overridden method or in the end?)</p><p>For example, I am overriding the method ""public boolean onCreateOptionsMenu(Menu menu)"" from class ""Activity"" in Android platform. And I saw someone write ""return super.onCreateOptionsMenu(menu)"" in the end of the method, in an example. But how do I know it should be done this way? and it is correct or not? what's the difference if I begin my method with ""super.onCreateOptionsMenu(menu)""?</p><p>BR,Henry</p>","316435","","","","","2010-04-15 07:26:33","how do I know when/where to invoke the overridden method of the super class","<java><android>","6","1","","",""
"2637047","1","","","2010-04-14 11:49:22","1","3789","<p>In my Application, I display data in webview but it can't display the images in the webview.</p><p>I used loadDatawithBaseURL() method.</p><p>This is my code..</p><p>webview.loadDataWithBaseURL(""file:///059600656X/"", data, ""text/html"", ""UTF-8"", ""about:blank"");</p><p>// here data is a string object which contain html parsing data.</p><p>I think it cant find the images in given directory.</p><p>Can Anybody help me? </p>","316451","","182690","","2010-04-19 18:52:33","2013-09-18 03:55:45","problem in display image with loadDataWithBaseURL() in Android","<android><webview>","3","3","2","",""
"2637178","1","2641499","","2010-04-14 12:11:51","1","776","<p>Sorry for the extremely bad title, I have no other idea what to call this question. What I'm trying to do is this: have a <code>RelativeLayout</code> which has two children:</p><ol><li>one with <code>layout_centerInParent=""true""</code></li><li>one with <code>layout_alignParentBottom=""true""</code></li></ol><p>However, when the device is in landscape mode, element (1) appears slightly <em>over</em> or <em>under</em> element (2). But, element (1) has enough space above it to appear <strong>above</strong> element (2). How could I make the layout so that if the screen is too small to center element (1) and make both elements <strong>not</strong> overlap, then align element (1) <strong>above</strong> (as in <code>layout_above</code>) element (2)?</p>","180784","","","","","2010-04-14 22:27:40","Snapping elements / conditional layouts","<android><android-layout>","3","0","1","",""
"2637320","1","2641380","","2010-04-14 12:34:23","2","2510","<p>I would like to ask you if is possible to add a shadow to each item in a gallery. And if is possible, what is the easiest way to do it?</p><p>Thanks in advance!</p>","316477","","","","","2011-10-12 04:02:54","Android: Gallery widget and shadows","<android><gallery><shadow><imageview>","2","0","4","",""
"2637606","1","","","2010-04-14 13:15:43","1","9049","<p>My Android application needs to react differently to different Mobile Country Codes.  </p><p>It seems like it is hardcoded to mcc310 (US).  I can read this value from TelephonyManager.getSimCountryIso() or by using a resource folder like res/values-mcc123/, but how do I set this value in the emulator?  </p>","13365","","","","","2014-04-13 01:01:49","How do I change the Mobile Country Code (MCC) in the Android Emulator?","<android><android-emulator><mcc><mobile-country-code>","2","0","1","",""
"2637617","1","2637685","","2010-04-14 13:16:55","0","434","<p>There is an class <strong>android.os.Build</strong> that got static variables cointaining device info,but when i try to access it I allways get a runtime exception.</p><p>E.x on how I try to access it:</p><pre><code>String model = Build.MODEL;</code></pre><p>I always get an Exception like this:</p><pre><code>04-14 14:57:45.266: ERROR/AndroidRuntime(770): java.lang.VerifyError: com.mypackage.Main</code></pre><p>I cant find any info about needing any special security permission on this.</p><p>Anyone got a clue?</p>","133858","","","","","2010-04-14 13:26:51","How to retrieve brand and model info by code on Android?","<android><exception><build><model><permissions>","1","0","","",""
"2637957","1","2638706","","2010-04-14 14:00:35","12","12768","<p>I'd like to know if it is possible to trigger programmatically the installation of an apk that is on the card ?  </p>","304866","","","","","2011-05-22 02:31:12","automatic install of apk","<android>","3","4","12","",""
"2638107","1","2638398","","2010-04-14 14:19:27","0","270","<p>How can i get the size of an Document object?</p><pre><code>        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        DocumentBuilder db = dbf.newDocumentBuilder();        InputStream iStr = urlConnection.getInputStream();        doc = db.parse(iStr);        ???? --&gt; Log.i(""Bytes"",String.valueOf(doc.get????));</code></pre>","193850","","","","","2010-04-14 14:54:09","size or length of a Document object","<java><android>","2","0","","",""
"2638160","1","","","2010-04-14 14:25:47","10","10914","<p>How can you hide an item in a ListView or at least set its height to zero?</p><p>I have tried setting the visibility of the View to GONE but it still maintains the item's space (height).</p>","61525","","","","","2014-01-24 17:42:50","Android: How to hide a ListView Item","<android><listview><visibility><listviewitem>","5","2","3","",""
"2638161","1","","","2010-04-14 14:25:57","35","26625","<p>I'm looking for a very obvious thing (in other languages !!) and it drives me crazy !</p><p>I would like to know how I can change indeterminate ProgressBar color from basis white/grey color to black ? When I change the indeterminateDrawable, I get a static image instead of a moving animated progressBar. Is there any way to do it simply in xml ? </p><p>Thank you ! </p>","316594","","","","","2014-01-14 10:04:52","How to change android indeterminate ProgressBar color?","<android>","5","0","23","",""
"2638194","1","2668713","","2010-04-14 14:29:34","1","697","<p>I'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.</p><p><code>alert(localStorage);</code> just hang on v1.5 while on v2.0.1 it alerts correctly.</p><p>is there an unblocking way to do it or to detect the version of Android with javascript?</p>","286557","","","","","2012-10-26 04:51:34","how to detect javascript features on Android 1.5","<javascript><android>","3","0","1","",""
"2638202","1","2639150","","2010-04-14 14:30:47","36","24191","<p>I'm confused regarding the densities. I see that with medium density, the screen resolution could be either 320x480, 480x800, or 480x854. So if I have an image thats 300px wide in the mdpi folder, how is it going to look the same size on all 3 different screen sizes (mainly 320x480 vs the other 2)? And by look the same size, I mean scale to be bigger or smaller depending upon the screen size. Thanks.</p>","315854","","","","","2013-05-13 09:02:46","Android multiple screen sizes with same density","<android>","7","1","32","",""
"2638274","1","","","2010-04-14 14:40:17","1","1271","<p>I am trying to display one png (drawable) on a map in about 300 points. I am retrieving the coordinates from a Sqlite table, dumping them in a cursor. When I try to display them by parsing through the cursor, it takes for ever for the images to be drawn, about .5 second per image. I find that to be suspiciously slow, so some insight on how I can increase performance would help. Here is the snippet of my code that does the rendering:</p><pre><code>while (!mFlavorsCursor.isAfterLast())            {                Log.d(""cursor"",""""+(i++));              point = new GeoPoint(                      (int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LATITUDE))*1000000),                      (int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LONGITUDE))*1000000));              overlayitem = new OverlayItem(point, """", """");              itemizedoverlay.addOverlay(overlayitem);              itemizedoverlay.doPopulate();              mFlavorsCursor.moveToNext();            }            mapOverlays.add(itemizedoverlay);</code></pre><p>I tried to isolate all the steps and it looks like the slow one is this:</p><p><strong>itemizedoverlay.doPopulate();</strong></p><p>This is a public method in my class that extends ItemizedOverlay that runs the private <strong>populate()</strong> method.</p>","316597","","","","","2011-07-14 16:41:47","Performance of map overlay in conjunction with ItemizedOverlay is very poor","<android><performance><maps><itemizedoverlay>","2","2","1","",""
"2638342","1","2761184","","2010-04-14 14:47:25","18","15204","<p>A call to <code>getLocationOnScreen()</code> or <code>getLocationInWindow()</code> both give me a <code>top/Y</code> coordinate that is about ~30px (status/notifications bar's height) too far down.  The <code>left/X</code> coordinate is dead on.  </p><p>As I hinted above, I believe the difference is because of the status/notification bar...  I could be wrong.  I think I can solve this if I can determine the size of the notification bar but, I'm having trouble doing just that.</p><p>Any help would be greatly appreciated.</p>","316592","","316592","","2010-04-14 19:00:58","2014-03-31 19:50:19","Incorrect Coordinates From getLocationOnScreen/getLocationInWindow","<android><android-widget>","4","0","10","",""
"2638349","1","2641314","","2010-04-14 14:48:16","2","1638","<p>I have an XML file in my layout folder that has how i want my custom widget/view (not sure what correct terminology is here).</p><p>but how do i make it so that i can programatically, add one or more to an activity</p><p>the xml file is as follows</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:id=""@+id/viewLog""&gt;  &lt;TextView android:id=""@+id/viewLogClimbName""            android:layout_width=""fill_parent""            android:singleLine=""true""            android:ellipsize=""end""            android:gravity=""left""  /&gt;  &lt;LinearLayout android:orientation=""horizontal""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_weight=""1""&gt;    &lt;LinearLayout android:orientation=""vertical""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""&gt;      &lt;TextView android:id=""@+id/viewLogDate""                android:layout_width=""fill_parent""                android:singleLine=""true""                android:ellipsize=""end""                android:gravity=""left""      /&gt;      &lt;TextView android:id=""@+id/viewLogStyle""                android:layout_width=""fill_parent""                android:singleLine=""true""                android:ellipsize=""end""                android:gravity=""left""      /&gt;    &lt;/LinearLayout&gt;    &lt;TextView android:id=""@+id/viewLogDetails""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:ellipsize=""end""              android:gravity=""left""              android:layout_weight=""1""    /&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I have looked at the android how-to and dont really understand what its getting at</p>","298895","","","","","2010-04-14 21:51:03","Android custom xml widget","<android><widget>","2","0","","",""
"2638413","1","2640957","","2010-04-14 14:55:44","0","239","<p>I have a DatePicker-view as well as a TimePicker-view in my layout, and everytime the date or time is changed I want to update a value. On the TimePicker I can simply set a setOnTimeChangedListener, but nothing corresponding exists for the DatePicker. A listener called OnDateChangedListener can be set in the init()-function, but it does not trigger each time the date is changed. Is there a corresponding listener, or is there a hack available to solve this problem in a satisfactory manner?</p><p><a href=""http://developer.android.com/intl/de/reference/android/widget/DatePicker.html"" rel=""nofollow"">http://developer.android.com/intl/de/reference/android/widget/DatePicker.html</a>http://developer.android.com/intl/de/reference/android/widget/TimePicker.html</p><p>Cheers,</p>","249871","","24587","","2010-04-15 07:42:53","2010-04-15 07:42:53","alternative to the missing setOnDateChangeListener()-function","<android><datepicker>","1","0","","",""
"2638569","1","","","2010-04-14 15:12:32","0","6043","<p>I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins. I have the following:</p><pre><code>@Overridepublic void onStart(){ super.onStart(); callProfileDialog();}</code></pre><p>And <code>callProfileDialog()</code> is just:</p><pre><code>private void callProfileDialog(){ Intent i = new Intent(this, com.utility.ProfileDialog.class);    startActivityForResult(i, PROFDIALOG);}</code></pre><p><code>ProfileDialog.class</code> returns a String from an input box. If the result returned is <code>RESULT_CANCELED</code> then I restart the activity. </p><p>The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a <code>RESULT_CANCELED</code> is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a <code>RESULT_CANCELED</code>). Why can't I get the activities show by calling <code>ProfileDialog.class</code> from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart(). Thanks for the help.</p><p>Edit: I have also tried the following:</p><pre><code>@Overridepublic void onWindowFocusChanged(boolean hasFocus){    if(hasFocus)    callProfileDialog();}</code></pre><p>But this doesn't work either. It all works fine once I hit the back button but without doing that, it's all black.</p>","278447","","278447","","2010-04-14 20:31:02","2012-11-30 20:59:16","Problems with starting an activity in onStart","<android><activity>","3","0","","",""
"2638627","1","2638709","","2010-04-14 15:18:39","7","953","<p>Is it possible to use C/C++ code in Android?And how easy is it?</p>","287316","","","","","2010-04-14 15:27:00","C/C++ in Android?","<c++><c><android>","1","1","1","",""
"2639002","1","","","2010-04-14 16:02:43","3","6274","<p><strong>How do I get smooth curves instead of dots or circles, when I draw with my finger on the touch screen, in Android? I am using the following code-</strong></p><pre><code>public class DrawView extends View implements OnTouchListener {private static final String TAG = ""DrawView"";List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();Paint paint = new Paint();public DrawView(Context context) {    super(context);    setFocusable(true);    setFocusableInTouchMode(true);    this.setOnTouchListener(this);    paint.setColor(Color.WHITE);    paint.setAntiAlias(true);}     @Override    public void onDraw(Canvas canvas) {    for (Point point : points) {        canvas.drawCircle(point.x, point.y, 5, paint);        // Log.d(TAG, ""Painting: ""+point);    }}public boolean onTouch(View view, MotionEvent event) {    // if(event.getAction() != MotionEvent.ACTION_DOWN)    // return super.onTouchEvent(event);    Point point = new Point();    point.x = event.getX();    point.y = event.getY();    points.add(point);    invalidate();    Log.d(TAG, ""point: "" + point);    return true;}}class Point {float x, y;@Overridepublic String toString() {    return x + "", "" + y;}}</code></pre>","315126","","881229","","2014-01-31 05:16:12","2014-01-31 05:16:12","Android paint/canvas issue; drawing smooth curves","<android><android-canvas><paint><draw><curvesmoothing>","3","0","1","",""
"2639192","1","","","2010-04-14 16:31:46","1","278","<p>I want to use ConcurrentLinkedQueue in an android application, have written the code, but now I'm getting an error when the project builds:</p><pre><code>Conversion to Dalvik format failed with error 2</code></pre><p>I'm using Eclipse with the lastest version of the ADT plugin.</p><p>Any ideas how I can fix this problem?</p>","119396","","","","","2010-10-28 17:41:24","Android & java.util.concurrent.ConcurrentLinkedQueue","<android><java.util.concurrent>","1","0","","",""
"2639275","1","","","2010-04-14 16:44:39","3","16000","<p>I'm trying to generate the MD5 fingerprint from the <code>debug.keystore</code> file using keytool.exe in my JDK so I can use Google Maps in my Android project.I've located the keystore file and have moved it into <code>C:\android</code> just to make things easier.</p><p>Then in a command prompt I type</p><pre><code>c:\Program Files\Java\jdk1.5.0_13\bin&gt;keytool -list -alias androiddebugkey -keystore ""C:\android\debug.keystore"" -storepass android -keypass android</code></pre><p>And I keep getting the error:</p><pre><code>keytool error: java.lang.Exception: Keystore file does not exist: C:\android\debug.keystore</code></pre><p>I've also tried entering the keystore in from its original location rather than moving to <code>c:\android</code> but I still get the same error.</p><p>Does anyone have any idea why this is happening?Also, is there any other way to get this MD5 fingerprint? Some program maybe?</p>","314610","","496830","","2011-08-01 13:00:45","2013-05-15 16:26:58","Android: keytool error on the command line when locating debug.keystore","<android><google-maps><cmd>","7","0","","",""
"2639911","1","","","2010-04-14 18:17:17","4","2382","<p>I need to be able to play an encrypted file in Android.</p><p>The file is AAC.</p><p>The only way I can see to do this is either:</p><ol><li>decrypt the file to internal private storage and point the player at that file to play, or</li><li>decrypt &amp; decode the file to pcm and feed it to an AudioTrack.</li></ol><p>1 isn't great because it takes a long time to do that.<br>2 isn't great either because I don't know how I can take advantage of the HW decoder to do this.</p><p>Any ideas?</p><p>tia.</p>","306517","","","","","2011-05-25 23:28:51","how to play an encrypted file in Android","<android><encryption><media-player>","2","0","2","",""
"2640119","1","","","2010-04-14 18:46:50","8","15929","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/937313/android-basic-gesture-detection"">Android - basic gesture detection</a>  </p></blockquote><p>I'm trying to have a View sensitive to double taps on an Android.  So far, I learned to set up the double tap and know what place to handle the event for action:<br>API: android.view.GestureDetector.OnDoubleTapListener</p><pre><code>    private GestureDetector mGestureDetector;    …    mGestureDetector = new GestureDetector(this);    …    mGestureDetector.setOnDoubleTapListener(new MyDoubleTapListener());    …    private class MyDoubleTapListener implements GestureDetector.OnDoubleTapListener {    public boolean onDoubleTapEvent(MotionEvent e) {                                                             return false;                          }                    @Override                    public boolean onDoubleTap(MotionEvent e) {                                    // TODO Auto-generated method stub                                    return false;                    }                    @Override                    public boolean onSingleTapConfirmed(MotionEvent e) {                                    // TODO Auto-generated method stub                                    return false;                    }}</code></pre><p><br>But How do I link it to the View?  This is in a class that has a few View members.</p><p>I'll really appreciate you helping me connect the dots!</p>","280641","","","","","2012-10-09 23:38:44","How to detect doubletap on a View?","<android><uiview><gesture-recognition>","1","0","4","2012-10-10 22:14:36",""
"2640877","1","3021192","","2010-04-14 20:41:01","28","24447","<p>I have an Android scrollview with a white background. The fading edge is a white translucent gradient. I would like to change it be black instead of white. I have a ListView in the same project with a white background that has a black fading edge by default, but I can't find where (if anywhere) that was set.</p>","186501","","1164929","","2012-02-09 12:58:04","2013-08-15 15:05:37","How to set the color of an Android ScrollView fading edge?","<android><scrollview><fading>","5","0","6","",""
"2640919","1","","","2010-04-14 20:48:30","3","1340","<p>I have a textview displaying many individual words, each word is a link using Spans and setMovementMethod(LinkMovementMethod.getInstance());  The textview is wrapped by a ScrollView. </p><p>However the ScrollView does not work as the links in the TextView are activated instead.</p><p>Is there a way to combine a ScrollView and TextView so that both the scrolling and links in the text work?</p>","294123","","1250370","","2013-02-18 11:58:27","2013-02-18 11:58:27","ScrollView containing TextView does not scroll","<java><android>","1","0","","",""
"2641111","1","2641218","","2010-04-14 21:17:45","23","28235","<p>I'm looking at the Android Camera code and when I try importing android.os.SystemProperties It cannot be found.</p><p>here is the file I'm looking at.<a href=""http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=src/com/android/camera/VideoCamera.java;h=8effd3c7e2841eb1ccf0cfce52ca71085642d113;hb=refs/heads/eclair"">http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=src/com/android/camera/VideoCamera.java;h=8effd3c7e2841eb1ccf0cfce52ca71085642d113;hb=refs/heads/eclair</a></p><p>I created a new 2.1 project and tried importing this namespace again, but It still cannot be found. I checked developer.android.com and SystemProperties was not listed</p><p>Did i miss something?</p>","67605","","","","","2014-02-25 06:15:43","Where is android.os.SystemProperties","<android>","4","0","17","",""
"2641115","1","","","2010-04-14 21:18:06","4","1540","<p>Does android expose an API or somesuch for the development of thirdparty keyboard applications? There are several existing apps which can replace the default input methods, however I cannot seem to find any information about it.</p>","316957","","","","","2010-04-14 21:40:03","Android keyboard api","<android><android-sdk-2.1>","1","0","1","",""
"2641197","1","2677465","","2010-04-14 21:30:07","19","22042","<p>I followed this guide here perfectly and have gone through it again but when I run the program on my google avd the page loads but only grey tiles appear and it doesn't show a map which it should. </p><p>Does anyone have any ideas?</p><p>Thanks</p>","314610","","","","","2012-11-29 18:28:16","Android app google maps showing grey tiles and not map!","<android><google-maps><android-emulator>","7","5","7","",""
"2641435","1","2641741","","2010-04-14 22:13:30","0","474","<p>hi I have a datepickerdialog but i´d like to change always one day before</p><pre><code>DatePickerDialog.OnDateSetListener dini=new DatePickerDialog.OnDateSetListener() {    public void onDateSet(DatePicker view, int year, int monthOfYear,            int dayOfMonth) {        myInitialDate.set(Calendar.YEAR, year);        myInitialDate.set(Calendar.MONTH, monthOfYear);        myInitialDate.set(Calendar.DAY_OF_MONTH, dayOfMonth);        monthOfYear +=1; //fix month                }};</code></pre>","","Alexi","","","","2010-04-14 23:26:09","set DatePickerDialog one day before","<android><datepicker>","1","0","","",""
"2641621","1","","","2010-04-14 22:56:10","1","4393","<p>I am new to android development. I just started with creating my own media player application by looking at the code samples given in Android SDK. While I am trying to play a local media file (m.3gp), I am getting IOException error :: error(1,-4). Please can somebody help me in this regard. </p><h2>Here is my code.</h2><pre><code>package com.mediaPlayer;import java.io.IOException;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.media.MediaPlayer;import android.media.MediaPlayer.OnBufferingUpdateListener;import android.media.MediaPlayer.OnCompletionListener;import android.media.MediaPlayer.OnPreparedListener;import android.media.MediaPlayer.OnVideoSizeChangedListener;import android.view.SurfaceHolder;import android.util.Log;public class MediaPlayer1 extends Activity implements OnBufferingUpdateListener, OnCompletionListener,OnPreparedListener, OnVideoSizeChangedListener,SurfaceHolder.Callback { private static final String TAG = ""MediaPlayerByMangesh""; // Widgets in the application private Button btnPlay; private Button btnPause; private Button btnStop; private MediaPlayer mMediaPlayer; private String path = ""m.3gp""; private SurfaceHolder holder; private int mVideoWidth;    private int mVideoHeight; private boolean mIsVideoSizeKnown = false; private boolean mIsVideoReadyToBePlayed = false; // For the id of radio button selected private int radioCheckedId = -1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  Log.d(TAG, ""Entered OnCreate:"");  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  Log.d(TAG, ""Creatinging Buttons:"");  btnPlay = (Button) findViewById(R.id.btnPlay);  btnPause = (Button) findViewById(R.id.btnPause);  // On app load, the Pause button is disabled  btnPause.setEnabled(false);  btnStop = (Button) findViewById(R.id.btnStop);  btnStop.setEnabled(false);  /*   * Attach a OnCheckedChangeListener to the radio group to monitor radio   * buttons selected by user   */  Log.d(TAG, ""Watching for Click"");  /* Attach listener to the Calculate and Reset buttons */  btnPlay.setOnClickListener(mClickListener);  btnPause.setOnClickListener(mClickListener);  btnStop.setOnClickListener(mClickListener); } /*  * ClickListener for the Calculate and Reset buttons. Depending on the  * button clicked, the corresponding method is called.  */ private OnClickListener mClickListener = new OnClickListener() {  @Override  public void onClick(View v) {  switch (v.getId()) {  case R.id.btnPlay:   Log.d(TAG, ""Clicked Play Button"");   Log.d(TAG, ""Calling Play Function"");   Play();      break;  case R.id.btnPause:   Pause();   break;  case R.id.btnStop:   Stop();   break;  }  } }; /**  * Play the Video.  */ private void Play() {   // Create a new media player and set the listeners        mMediaPlayer = new MediaPlayer();        Log.d(TAG, ""Entered Play function:"");        try        {        mMediaPlayer.setDataSource(path);        }        catch(IOException ie)        {         Log.d(TAG, ""IO Exception:"" + path);                }        mMediaPlayer.setDisplay(holder);        try        {         mMediaPlayer.prepare();        }        catch(IOException ie)        {         Log.d(TAG, ""IO Exception:"" + path);                }        mMediaPlayer.setOnBufferingUpdateListener(this);        mMediaPlayer.setOnCompletionListener(this);        mMediaPlayer.setOnPreparedListener(this);        //mMediaPlayer.setOnVideoSizeChangedListener(this);        //mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);   } public void onBufferingUpdate(MediaPlayer arg0, int percent) {        Log.d(TAG, ""onBufferingUpdate percent:"" + percent);    }    public void onCompletion(MediaPlayer arg0) {        Log.d(TAG, ""onCompletion called"");    }   public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {        Log.v(TAG, ""onVideoSizeChanged called"");        if (width == 0 || height == 0) {            Log.e(TAG, ""invalid video width("" + width + "") or height("" + height + "")"");            return;        }        mIsVideoSizeKnown = true;        mVideoWidth = width;        mVideoHeight = height;        if (mIsVideoReadyToBePlayed &amp;&amp; mIsVideoSizeKnown) {            startVideoPlayback();        }    }    public void onPrepared(MediaPlayer mediaplayer) {        Log.d(TAG, ""onPrepared called"");        mIsVideoReadyToBePlayed = true;        if (mIsVideoReadyToBePlayed &amp;&amp; mIsVideoSizeKnown) {            startVideoPlayback();        }    } public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) {        Log.d(TAG, ""surfaceChanged called"");    }    public void surfaceDestroyed(SurfaceHolder surfaceholder) {        Log.d(TAG, ""surfaceDestroyed called"");    }    public void surfaceCreated(SurfaceHolder holder) {        Log.d(TAG, ""surfaceCreated called"");        Play();    }    private void startVideoPlayback() {        Log.v(TAG, ""startVideoPlayback"");        holder.setFixedSize(176, 144);        mMediaPlayer.start();    } /**  * Pause the Video  */ private void Pause() {  ;  /*   * If all fields are populated with valid values, then proceed to   * calculate the tips   */   } /**  * Stop the Video.  */ private void Stop() {  ;  /*   * If all fields are populated with valid values, then proceed to   * calculate the tips   */   } /**  * Shows the error message in an alert dialog  *  * @param errorMessage  *            String the error message to show  * @param fieldId  *            the Id of the field which caused the error. This is required  *            so that the focus can be set on that field once the dialog is  *            dismissed.  */ private void showErrorAlert(String errorMessage, final int fieldId) {  new AlertDialog.Builder(this).setTitle(""Error"")    .setMessage(errorMessage).setNeutralButton(""Close"",      new DialogInterface.OnClickListener() {       @Override       public void onClick(DialogInterface dialog,         int which) {        findViewById(fieldId).requestFocus();       }      }).show(); }}</code></pre><hr><p>Thanks,Mangesh Kumar K.</p>","317021","","35501","","2010-04-14 23:08:44","2010-07-03 15:50:27","Regarding playing media file in Android media player application","<android><media-player><ioexception>","1","1","1","",""
"2641726","1","3365097","","2010-04-14 23:22:43","46","39741","<p>I decode bitmaps from the SD card using <code>BitmapFactory.decodeFile</code>. Sometimes the bitmaps are bigger than what the application needs or that the heap allows, so I use <code>BitmapFactory.Options.inSampleSize</code> to request a subsampled (smaller) bitmap.</p><p>The problem is that the platform does not enforce the exact value of inSampleSize, and I sometimes end up with a bitmap either too small, or still too big for the available memory. </p><p>From <a href=""http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize"">http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize</a>:</p><blockquote>  <p>Note: the decoder will try to fulfill  this request, but the resulting bitmap  may have different dimensions that  precisely what has been requested.  Also, powers of 2 are often  faster/easier for the decoder to  honor.</p></blockquote><p>How should I decode bitmaps from the SD card to get a bitmap of the exact size I need while consuming as little memory as possible to decode it? </p><p><strong>Edit:</strong></p><p>Current source code:</p><pre><code>BitmapFactory.Options bounds = new BitmapFactory.Options();this.bounds.inJustDecodeBounds = true;BitmapFactory.decodeFile(filePath, bounds);if (bounds.outWidth == -1) { // TODO: Error }int width = bounds.outWidth;int height = bounds.outHeight;boolean withinBounds = width &lt;= maxWidth &amp;&amp; height &lt;= maxHeight;if (!withinBounds) {    int newWidth = calculateNewWidth(int width, int height);    float sampleSizeF = (float) width / (float) newWidth;    int sampleSize = Math.round(sampleSizeF);    BitmapFactory.Options resample = new BitmapFactory.Options();    resample.inSampleSize = sampleSize;    bitmap = BitmapFactory.decodeFile(filePath, resample);}</code></pre>","143378","","143378","","2010-04-23 09:34:09","2014-01-25 06:49:04","Decoding bitmaps in Android with the right size","<android><memory><bitmap><sd-card>","7","9","21","",""
"2641936","1","","","2010-04-15 00:21:52","0","426","<p>A beta tester of mine has a Asus eee pc 701 running Android 2.0 and he is trying to install an app on it from my web site.  He is able to download the app but is getting a ""Parse Error: There is a problem parsing the package"" error.  I don't really know if this problem is with the eee pc or with the apk since he is the first person to try to install it.  I built it for 2.0, the manifest has 5 as the minimum API level and I used Eclipse to export and sign it.  But this is my first Android app and he is the first to try to install it, so I am not sure what the problem might be?  Could just be the Android implementation too.  Here is a site about putting Android on the Asus: <a href=""http://www.liliputing.com/2009/01/how-to-built-google-android-for-the-asus-eee-pc-701.html"" rel=""nofollow"">http://www.liliputing.com/2009/01/how-to-built-google-android-for-the-asus-eee-pc-701.html</a>  </p><p>Any thoughts on what I might try to get this app installed on his machine?</p>","316077","","","","","2011-02-18 11:28:58","Parse error when trying to install app on Asus eee PC 701 running Android 2.0","<android><parsing>","1","2","","",""
"2641998","1","","","2010-04-15 00:42:46","0","617","<p>Can the xdpi and ydpi settings be relied upon to accurately represent the physical pixels in once inch of screen space?  I need this to be accurate for some display code I'm writing.  I realize the documention says that this is the case, but I need to know if individual handsets get this right MOST OF THE TIME.</p><p>I know I can alternately use ""densitiy"" which will give me 120, 160, 240 steps of DPI, but an exact dpi would be much better.</p><p>Thanks!</p>","317070","","","","","2010-08-20 18:48:15","Is displayMetrix xdpi and ydpi accurate?","<android>","2","0","","",""
"2642226","1","2642248","","2010-04-15 01:42:42","1","98","<p>When I try to use layout_above to position a view above another view, it can't find the ID if it's not in the same XML file. I'm adding my XML files at run time but I still want to be able to position them relative to eachother. Any suggestions?</p>","92259","","","","","2010-04-15 02:50:03","Pointing layout_above to an external ID?","<java><android><layout>","2","0","","",""
"2642453","1","2643252","","2010-04-15 02:53:46","1","811","<p>In college, my senior project was to create a simple 2D game engine complete with a scripting language which compiled to bytecode, which was interpreted. For fun, I'd like to port the engine to android. I'm new to android development, so I'm not sure which way to go as far as deploying the engine on the phone.</p><p>The easiest way I suppose would be to require the engine/interpreter to be bundled with every game that uses it. This solves any versioning issues. There are two problems with this. One: this makes each game app larger and two: I originally released the engine under the LGPL license (unfortunately), but this deployment strategy makes it difficult to conform to the rules of that license, particularly with respect to allowing users to replace the lib easily with another version.</p><p>So, my other option is to somehow have the engine stand alone as an Activity or service that somehow responds to intents raised by game apps, and somehow give the engine app permissions to read the scripts and other assets to ""run"" the game. The user could then be able to replace the engine app with a different version (possibly one they made themselves).</p><p>Is this even possible? What would you recommend? How could I handle it in a secure way?</p>","278966","","","","","2010-04-15 06:50:37","Game engine deployment strategy for the Android?","<android><dsl><scripting-language>","1","0","","",""
"2642802","1","","","2010-04-15 04:47:06","0","141","<p>I have a strange issue in which on rotating the Screen to Landscaped mode the Views present inside Remain at the same place But I cannot scroll them inside the screen.</p><p>How can I make them Scroll so that every thing that move out should be displayed properly to the user.</p><p>Should there be any more attribute to be set for allowing such kind of behavior.</p>","92039","","","","","2010-04-15 05:03:10","Android Layouts Scrolling in Landscaped Mode","<android>","1","1","","",""
"2642962","1","","","2010-04-15 05:35:07","0","268","<p>In my system sometimes ddms (dalvik debugger) tool sometimes doesn't open. What is the problem? And what can I do for this problem? When I open it through command prompt it displays the following error:</p><blockquote>  <p>38:16 E/DeviceMonitor: Failed to read the adb response!<br>  38:24 E/DeviceMonitor: Failed to read the adb response!</p></blockquote><p>What can I do?</p>","454808","","527702","","2012-11-21 11:55:11","2012-11-21 11:55:11","DDms is not opened sometimes","<android><ddms>","1","1","","",""
"2643198","1","2644875","","2010-04-15 06:36:38","8","5426","<p>I need to determine the screen density at runtime in an Android AppWidget.  I've set up an HDPI emulator device (avd).  If set up a regular executable project, and insert this code into the onCreate method:</p><pre><code>DisplayMetrics dm = getResources().getDisplayMetrics();Log.d(""MyTag"", ""screen density "" + dm.densityDpi);</code></pre><p>This outputs ""screen density 240"" as expected.</p><p>However, if I set up an AppWidget project, and insert this code into the onUpdate method:</p><pre><code>DisplayMetrics dm = context.getResources().getDisplayMetrics();Log.d(""MyTag"", ""screen density "" + dm.densityDpi);</code></pre><p>This outputs ""screen density 160"".  I noticed, hooking up the debugger, that the mDefaultDisplay member of the Resources object here is null in the AppWidget case.</p><p>Similarly, if I get a resource at runtime using the Resources object obtained from context.getResources() in the AppWidget, it returns the wrong resource based on screen density.  For instance, I have a 60x60px drawable for mdpi, and an 80x80 drawable for hdpi.  If I get this Drawable object using context.getResources().getDrawable(...), it returns the 60x60 version.</p><p>Is there any way to correctly deal with resources at runtime from the context of an AppWidget?</p><p>Thanks!</p>","305542","","","","","2010-04-15 11:43:47","How can I get the correct DisplayMetrics from an AppWidget in Android?","<android><resources><android-widget><appwidget>","1","0","1","",""
"2643256","1","","","2010-04-15 06:52:06","7","2369","<p>I want Messaging (Sms/Mms) application to be part of the global search i.e., when I type a word in the omni search box (on home screen), it should show me the messages which has that word.  Currently, we have local search within messaging app which works fine but how do I make messaging globally searchable.</p><p>I tried refereing searchable dictornary example and also some online resource but didn't help.  Please provide me the steps to make messaging application part of global search.</p><p>Regards,Sunil.</p>","317205","","","","","2012-07-30 14:24:37","Global Search In Android","<android>","1","1","4","",""
"2643310","1","","","2010-04-15 07:05:08","1","970","<p>I have created a custom component in my program by extending a ViewGroup. This component listens to touch events and are supposed to start animations when the user has move their finger past some certain points.</p><p>I'm able to start animations while the user is touching the screen. But I'm not able to start animations if the user doesn't move their finger. It's probably that the phone thinks it doesn't have to update the screen if the user isn't moving their finger.</p><p>I added some logs and according to them the animation starts and ends but it doesn't draw on the screen. I have the same problems when starting an animation with a timer.</p><p>I use AlphaAnimations and TranslateAnimations on ImageViews. I have tried to use invalidate() both on the component and the ImageView but it doesn't help.</p><p>Anyone who has an idea how to solve this? </p>","265023","","","","","2011-05-23 12:03:00","Android animation doesn't work, probably some kind of screen redraw problem","<android><animation>","1","1","","",""
"2643385","1","2643472","","2010-04-15 07:27:27","4","1519","<p>I need directions on how to start the android browser through code .Thanks !</p>","304866","","","","","2010-04-15 07:46:05","Start the android browser","<android>","2","0","5","",""
"2643540","1","2643710","","2010-04-15 07:52:15","0","359","<p>From my android code I try with the android browser to access a tomcat service running on my computer like this :</p><pre><code> Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(""http://localhost:8080/615734.apk"")); startActivity(myIntent);</code></pre><p>Unfortunately all I get is ""page unavailable"" . What should I do to be able to have this running ?</p>","304866","","","","","2012-07-04 09:18:54","emulator networking","<android>","4","0","","",""
"2643562","1","","","2010-04-15 07:55:39","0","850","<p>Consider following code, it saves static variable: mMyArray in onSaveInstanceState and restore it in onRestoreInstanceState, however I found it can't save the int array at all. I tried primative type value (int), it can save/restore primative type value.</p><pre><code>public class StaticVarActivity extends Activity {    private static final String TAG = ""StaticVarActivity"";    private static int[] mMyArray = { 1, 1 };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.d(TAG, ""Setting values to 2 in onCreate"");        mMyArray[0] = 2;        mMyArray[1] = 2;        findViewById(R.id.btn).setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Log.d(TAG, ""Setting values to 3 in onClick"");                mMyArray[0] = 3;                mMyArray[1] = 3;            }        });    }    /* (non-Javadoc)     * @see android.app.Activity#onRestoreInstanceState(android.os.Bundle)     */    @Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {        super.onRestoreInstanceState(savedInstanceState);        Log.d(TAG,""onRestoreInstanceState 1:""+mMyArray[0]+"",""+mMyArray[1]);        mMyArray = savedInstanceState.getIntArray(""key"");        Log.d(TAG,""onRestoreInstanceState 2:""+mMyArray[0]+"",""+mMyArray[1]);    }    /* (non-Javadoc)     * @see android.app.Activity#onSaveInstanceState(android.os.Bundle)     */    @Override    protected void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);        Log.d(TAG,""onSaveInstanceState 1:""+mMyArray[0]+"",""+mMyArray[1]);        //int[] sss = new int[]{mMyArray[0],mMyArray[1]};        //outState.putIntArray(""key"", sss);        outState.putIntArray(""key"", mMyArray);        Log.d(TAG,""onSaveInstanceState 2:""+mMyArray[0]+"",""+mMyArray[1]);    }}</code></pre><p>The log:</p><hr><p>04-14 15:16:00.633: DEBUG/StaticVarActivity(7251): Setting values to 2 in onCreate04-14 15:16:19.843: DEBUG/StaticVarActivity(7251): Setting values to 3 in onClick</p><p><strong>// Make configure change, e.g change orientation</strong></p><p>04-14 15:16:23.893: DEBUG/StaticVarActivity(7251): onSaveInstanceState 1:3,304-14 15:16:23.893: DEBUG/StaticVarActivity(7251): onSaveInstanceState 2:3,304-14 15:16:24.073: DEBUG/StaticVarActivity(7251): Setting values to 2 in onCreate04-14 15:16:24.073: DEBUG/StaticVarActivity(7251): onRestoreInstanceState 1:2,204-14 15:16:24.073: DEBUG/StaticVarActivity(7251): onRestoreInstanceState 2:2,2</p><hr><p>If I change  to:</p><pre><code>private int[] mMyArray = { 1, 1 };</code></pre><p>The log will be:</p><hr><p>04-14 15:18:29.183: DEBUG/StaticVarActivity(7355): Setting values to 2 in onCreate04-14 15:18:32.123: DEBUG/StaticVarActivity(7355): Setting values to 3 in onClick</p><p><strong>// Make configure change, e.g change orientation</strong></p><p>04-14 15:18:33.353: DEBUG/StaticVarActivity(7355): onSaveInstanceState 1:3,304-14 15:18:33.353: DEBUG/StaticVarActivity(7355): onSaveInstanceState 2:3,304-14 15:18:33.373: DEBUG/StaticVarActivity(7355): Setting values to 2 in onCreate04-14 15:18:33.393: DEBUG/StaticVarActivity(7355): onRestoreInstanceState 1:2,204-14 15:18:33.393: DEBUG/StaticVarActivity(7355): onRestoreInstanceState 2:3,3</p><hr><p>I got to know it doesn't need to save the static variable, but why this happen?</p>","317233","","","","","2010-04-15 11:36:22","Static variables can't be saved in onSaveInstanceState?","<android>","1","0","","",""
"2643689","1","","","2010-04-15 08:18:12","2","1199","<p>How can I make an activity temporarily not touchable and not focusable  ? </p>","164460","","","","","2012-10-20 08:23:15","Android disable activity","<android><activity>","1","3","","",""
"2643705","1","","","2010-04-15 08:21:12","2","4359","<p>I'm trying to zoom in on a Google MapView on step in the oncreateMethod of my Activity.Everytime I try to zoom the map via the mapController I get an IllegalArgumentException:</p><pre><code>04-15 10:16:51.012: ERROR/AndroidRuntime(528): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.client/android.client.ui.showstores.StoreMap}: java.lang.IllegalArgumentException: width and height must be &gt; 0</code></pre><p>This Exception is thrown if I call the zoomOut or zoomIn function of <a href=""http://code.google.com/intl/de-DE/android/add-ons/google-apis/reference/index.html?com/google/android/maps/package-tree.html"" rel=""nofollow"">MapController</a>. Sadly the zoomIn function I'm using does not take any arguments. </p><p>The onCreateMethod where I'm calling the zoom functions looks like this:</p><pre><code>    mapView = (MapView) findViewById(R.id.map);    mapView.setBuiltInZoomControls(true);    MapController mapController = mapView.getController();    mapController.zoomIn();</code></pre><p>I'm a little bit at loss here because I'm doing nothing special.</p><p>The whole stacktrace is: </p><pre><code>04-15 10:16:51.012: ERROR/AndroidRuntime(528): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.client/android.client.ui.showstores.StoreMap}: java.lang.IllegalArgumentException: width and height must be &gt; 004-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.os.Handler.dispatchMessage(Handler.java:99)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.os.Looper.loop(Looper.java:123)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.main(ActivityThread.java:4203)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at java.lang.reflect.Method.invokeNative(Native Method)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at java.lang.reflect.Method.invoke(Method.java:521)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at dalvik.system.NativeStart.main(Native Method)04-15 10:16:51.012: ERROR/AndroidRuntime(528): Caused by: java.lang.IllegalArgumentException: width and height must be &gt; 004-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.graphics.Bitmap.nativeCreate(Native Method)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:305)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:137)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:126)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.MapView.doZoom(MapView.java:1459)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.MapView.doZoom(MapView.java:1468)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at com.google.android.maps.MapController.zoomIn(MapController.java:427)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.client.ui.showstores.StoreMap.onCreate(StoreMap.java:58)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)04-15 10:16:51.012: ERROR/AndroidRuntime(528):     ... 11 more</code></pre>","114066","","114066","","2010-04-19 10:32:44","2012-10-26 14:52:41","IllegalArgumentException: width and height must be > 0 during zoomOut in Google MapView","<android><android-mapview><illegalargumentexception>","3","0","","",""
"2643779","1","","","2010-04-15 08:34:27","0","1135","<p>I'm trying to call a thread on a button click (btn_more) but i cant get it right. The thread is to get some data and update the images. The problem i have is if i only update 4 or 5 images then it works fine. But if i load more than 5 images i will get a force close. At times when the internet is slow I will face the same problem too. Can please help me to solve this problem or provide me some guidance? Here is the error i got from LogCat:</p><blockquote>  <p>04-19 18:51:44.907: ERROR/AndroidRuntime(1034): Uncaught  handler: thread main exiting due to  uncaught exception 04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):  java.lang.NullPointerException 04-19  18:51:44.927:  ERROR/AndroidRuntime(1034):     at  mobile9.android.gallery.GalleryWallpapers.setWallpaperThumb(GalleryWallpapers.java:383)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  mobile9.android.gallery.GalleryWallpapers.access$4(GalleryWallpapers.java:320)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  mobile9.android.gallery.GalleryWallpapers$1.handleMessage(GalleryWallpapers.java:266)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  android.os.Handler.dispatchMessage(Handler.java:99)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  android.os.Looper.loop(Looper.java:123)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  android.app.ActivityThread.main(ActivityThread.java:4310)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  java.lang.reflect.Method.invokeNative(Native  Method) 04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  java.lang.reflect.Method.invoke(Method.java:521)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  04-19 18:51:44.927:  ERROR/AndroidRuntime(1034):     at  dalvik.system.NativeStart.main(Native  Method)</p></blockquote><p>My Code:</p><blockquote>  <p>public class GalleryWallpapers extends Activity implements Runnable {</p><pre><code>  public static String MODEL = android.os.Build.MODEL ;</code></pre></blockquote><pre><code>    private static final String rootURL = ""http://www.uploadhub.com/mobile9/gallery/c/"";    private int wallpapers_count = 0;    private int ringtones_count = 0;    private int index = 0;    private int folder_id;    private int page;    private int page_counter = 1;    private String family;    private String keyword;    private String xmlURL = """";    private String thread_op = ""xml"";    private ImageButton btn_back;    private ImageButton btn_home;    private ImageButton btn_filter;    private ImageButton btn_search;    private TextView btn_more;    private ProgressDialog pd;    GalleryExampleHandler myExampleHandler = new GalleryExampleHandler();    Context context = GalleryWallpapers.this.getBaseContext();    Drawable image;    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            MODEL = ""HTC Legend"";  // **needs to be remove after testing**            try {                 MODEL = URLEncoder.encode(MODEL,""UTF-8"");            } catch (UnsupportedEncodingException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();            }            requestWindowFeature(Window.FEATURE_NO_TITLE);            setContentView(R.layout.gallerywallpapers);            Bundle b = this.getIntent().getExtras();            family = b.getString(""fm"").trim();            folder_id = Integer.parseInt(b.getString(""fi""));            keyword = b.getString(""kw"").trim();            page = Integer.parseInt(b.getString(""page"").trim());            WindowManager w = getWindowManager();            Display d = w.getDefaultDisplay();            final int width = d.getWidth();            final int height = d.getHeight();            xmlURL = rootURL + ""wallpapers/1/?output=rss&amp;afm=wallpapers&amp;mdl="" + MODEL + ""&amp;awd="" + width + ""&amp;aht="" + height;            if (folder_id &gt; 0) {                  xmlURL = xmlURL + ""&amp;fi="" + folder_id;            }            pd = ProgressDialog.show(GalleryWallpapers.this, """",            ""Loading..."", true, false);            Thread thread = new Thread(GalleryWallpapers.this);            thread.start();            btn_more = (TextView) findViewById(R.id.btn_more);            btn_more.setOnClickListener(new View.OnClickListener() {                  public void onClick(View view) {                            myExampleHandler.filenames.clear();                            myExampleHandler.authors.clear();                            myExampleHandler.duration.clear();                            myExampleHandler.fileid.clear();                            btn_more.setBackgroundResource(R.drawable.btn_more_click);                            page = page + 1;                            thread_op = ""xml"";                            xmlURL = rootURL + ""wallpapers/1/?output=rss&amp;afm=wallpapers&amp;mdl="" + MODEL + ""&amp;awd="" + width + ""&amp;aht="" + height;                            xmlURL = xmlURL + ""&amp;pg2="" + page;                            index = 0;                            pd = ProgressDialog.show(GalleryWallpapers.this, """",                    ""Loading..."", true, false);                            Thread thread = new Thread(GalleryWallpapers.this);                            thread.start();                       }                 });   }        public void run() {            if(thread_op.equalsIgnoreCase(""xml"")){                     readXML();            }            else if(thread_op.equalsIgnoreCase(""getImg"")){                     getWallpaperThumb();            }            handler.sendEmptyMessage(0);         }         private Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        int count = 0;        if (!myExampleHandler.filenames.isEmpty()){            count = myExampleHandler.filenames.size();        }        count = 6;        if(thread_op.equalsIgnoreCase(""xml"")){            pd.dismiss();            thread_op = ""getImg"";            btn_more.setBackgroundResource(R.drawable.btn_more);        }        else if(thread_op.equalsIgnoreCase(""getImg"")){            setWallpaperThumb();            index++;            if (index &lt; count){                Thread thread = new Thread(GalleryWallpapers.this);                thread.start();            }        }    }};    private void readXML(){    if (xmlURL.length() != 0) {        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             */            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) {            //showDialog(DIALOG_SEND_LOG);        }    }}    private void getWallpaperThumb(){           int i = this.index;           if (!myExampleHandler.filenames.elementAt(i).toString().equalsIgnoreCase("""")){                     image = ImageOperations(context,                myExampleHandler.thumbs.elementAt(i).toString(), ""image.jpg"");           }     }      private void setWallpaperThumb(){            int i = this.index;            if (myExampleHandler.filenames.elementAt(i).toString() != null) {                    String file_info = myExampleHandler.filenames.elementAt(i).toString();                    String author = ""\nby "" + myExampleHandler.authors.elementAt(i).toString();                    final String folder = myExampleHandler.folder_id.elementAt(folder_id).toString();                    final String fid = myExampleHandler.fileid.elementAt(i).toString();                    ImageView imgView = new ImageView(context);                    TextView tv_filename = null;                    TextView tv_author = null;                    switch (i + 1) {                            case 1:                                  imgView = (ImageView) findViewById(R.id.image1);                                  tv_filename = (TextView) findViewById(R.id.filename1);                                  tv_author = (TextView) findViewById(R.id.author1);                                  break;                            case 2:                                  imgView = (ImageView) findViewById(R.id.image2);                                  tv_filename = (TextView) findViewById(R.id.filename2);                                  tv_author = (TextView) findViewById(R.id.author2);                                  break;                            case 3:                                  imgView = (ImageView) findViewById(R.id.image3);                                  tv_filename = (TextView) findViewById(R.id.filename3);                                  tv_author = (TextView) findViewById(R.id.author3);                                  break;            case 4:                .                                    .                                    .                                    .                                    .            case 10:                                  imgView = (ImageView) findViewById(R.id.image10);                                  tv_filename = (TextView) findViewById(R.id.filename10);                                  tv_author = (TextView) findViewById(R.id.author10);                                  break;                    }                    if (image.getIntrinsicHeight() &gt; 0) {                         imgView.setImageDrawable(image);                    } else {                         imgView.setImageResource(R.drawable.default_wallpaper);                    }                    tv_filename.setText(file_info);                    tv_author.setText(author);                    imgView.setOnClickListener(new View.OnClickListener() {                           public void onClick(View view) {                // Perform action on click            }        });    }}    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;            }     }  }</code></pre>","679696","","679696","","2010-04-19 04:32:24","2010-04-19 04:34:20","How to call a new thread from button click","<android><multithreading>","1","0","","",""
"2643892","1","","","2010-04-15 08:53:29","1","3558","<p>Is there a way to automatically trigger the installation process of a just downloaded apk ?</p><p>Currently  after I download the package , nothing happens unless I click the package ,in which case the packege installer is launched  !</p><p>The tomcat server from where I download the package has in the web.xml file the following :</p><pre><code>    &lt;mime-mapping&gt;        &lt;extension&gt;apk&lt;/extension&gt;        &lt;mime-type&gt;application/vnd.android.package-archive&lt;/mime-type&gt;    &lt;/mime-mapping&gt;</code></pre>","304866","","","","","2012-03-07 20:00:15","how to automatically install an apk","<android>","2","1","1","",""
"2643949","1","2644401","","2010-04-15 09:01:56","1","345","<p>I want to refer to a static Java variable in my styles.xml, is that possible?  Here's a pseudo-xml example:</p><pre><code>&lt;style name=""Artwork""&gt;    &lt;item name=""android:background""&gt;@drawable/border_{Constants.MY_COLOR}&lt;/item&gt;&lt;/style&gt;</code></pre>","13365","","","","","2010-04-15 10:18:59","Can I use a static variable from a Java class in res/values/styles.xml?","<java><xml><android><styles>","1","0","","",""
"2643993","1","2645194","","2010-04-15 09:10:24","25","50442","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations"">J2ME/Android/BlackBerry - driving directions, route between two locations</a>  </p></blockquote><p>I'm just writing an App for displaying the route between two coords (lat, long) in google maps view.Displaying an single coord (even with a marker) works fine, but how to draw route between two point with 2 markers?</p><p>I must admit that I'm quite new to Android and the maps-API...</p>","317301","","560648","","2012-02-25 18:57:21","2012-06-10 02:03:04","How to display a route between two geocoords in google maps?","<android><google-maps><overlay><route>","2","1","13","2013-01-29 04:38:33",""
"2644015","1","","","2010-04-15 09:13:27","0","666","<pre><code> private Cursor getContacts(CharSequence constraint) {  boolean hasConstrains = constraint != null &amp;&amp; constraint.length() != 0;  Uri uri = ContactsContract.Contacts.CONTENT_URI;        String[] projection =  new String[]{ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME };        String selection = hasConstrains ? projection[1] + "" LIKE '""+constraint+""%'"" : null;        String[] selectionArgs = null;        String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" ASC"";        return managedQuery(uri, projection, selection, selectionArgs, sortOrder); }</code></pre><p>The first time issue it i give null as parameter to the function to the selection parameter is empty, meaning i don't filter any rows.The problem is i get only contacts i created myself using no syncAdapter.I used facebook app to synch my facebook contacts, but this query doesn't return them.I extracted the contacts2.db from the emulator and the view_contacts view shows me all the contacts, so the DB is updated.</p><p>What should i do to get all the contacts regardless of how they were created (with which synch adapter)</p>","296356","","296356","","2010-04-15 09:29:41","2011-02-05 07:09:53","getting all contacts (including from other syncAdapters) in android content handler","<android><facebook><contacts>","1","0","","",""
"2644134","1","2644266","","2010-04-15 09:33:37","121","93073","<p>I'm trying to generate a custom dialog in Android. I create my Dialog like this:</p><pre><code>dialog = new Dialog(this);dialog.setContentView(R.layout.my_dialog);</code></pre><p>Everythings works fine except for the title of the Dialog.Even if I don't set the title of the dialog the dialog popup has a blank space at the position of the dialog. </p><p>Is there any way to hide this part of the Dialog? </p><p>I tried it with an AlertDialog but it seems the layout is not set properly: </p><pre><code>LayoutInflater inflater =     (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View view = inflater.inflate(R.layout.map_dialog, null);AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setView(view);// dialog = new Dialog(this);// dialog.setContentView(R.layout.map_dialog);dialog = builder.create();((TextView) dialog.findViewById(R.id.nr)).setText(number);</code></pre><p>If I use this code I get a null Pointer Exception in the last line.  The dialog is not null so the TextView I try to retrieve does not exist.<br>If I uncomment the part where I use the Dialog Constructor everything works fine but for the title above my dialog layout.</p>","114066","","172525","","2014-02-05 13:09:33","2014-02-05 13:09:33","Android: How to create a Dialog without a title?","<android><android-layout><dialog>","19","3","42","",""
"2644342","1","","","2010-04-15 10:09:55","3","6243","<p>I have four images in the Gallery View. When we do swipe from left to right or right to left the Gallery View moves all the images i.e if I swipe from left to right from the first image then it will move to all the four images. </p><p>What I want is that when I swipe it should only move to the next image. Can someone let me know how is this possible?</p><p>Hope to get a reply soon.</p><p>RegardsSunil</p>","261566","","","","","2012-10-03 20:13:47","Moving the Gallery view to the next image on one swipe in Android?","<android><image><gallery><swipe>","3","2","3","",""
"2644377","1","2644430","","2010-04-15 10:14:30","12","11233","<p>So I have a language setting in my application. When the language is switched, I would like all the textviews etc to change language immediately. Currently I just change the locale in the configuration, so the language has changed when the user restarts the activity.</p><p>An ugly solution to my problem would be to make each textview load the new resources each time the language is changed. Is there a better solution? Perhaps a neat way to discretely restart the activity? Or maybe just force reload of the resources?</p><p>Cheers,</p>","249871","","","","","2012-11-05 16:57:27","Changing locale: Force activity to reload resources?","<android><localization><resources>","4","0","6","",""
"2644570","1","2644935","","2010-04-15 10:50:14","7","10802","<p>I have the Button defined as follows:</p><pre><code>&lt;Button android:drawableTop=""@drawable/ico"" android:gravity=""center"" android:id=""@+id/StartButton2x2"" android:text=""@string/Widget2x2StartBtnLabel"" android:layout_width=""0dip""  android:layout_height=""fill_parent"" android:layout_weight=""1""  android:background=""@drawable/widgetbtn_bg""/&gt;</code></pre><p>The problem is that 'drawableTop' image is aligned to the top border of the Button view. I would like to center it (together with text label) vertically on the button. </p><p>'android:gravity' seems to work only on text label. It does not affect 'drawableTop' positioning.</p><p>I was able to center it vertically using 'android:paddingTop' - but that does not seem to be a good idea. I guess it would not work properly on different screen resolution/size.</p>","306831","","","","","2012-10-11 01:25:55","How to center drawableTop and text vertically on the Button in Android?","<xml><android><layout><button>","3","1","3","",""
"2644656","1","2644703","","2010-04-15 11:03:22","0","1298","<p>What is the best way to evaluate simple conditional statements like:</p><pre><code>""a&gt;b"" ?""x-4&lt;10+y &amp; y&gt;x"" ?</code></pre><p>Expressions are loaded from external file. Variables are set in application. Syntax used is not essential. It may be ""&amp;"" or ""and"" or any other supported with language/library.</p><p>I need to take different action depending on result of evaluation - is it true or false.</p><p>Could I use any parser already included with Andorid?</p><p>Is there some way to use JS ""eval"" from browser component?</p><p>Is it possible to use <a href=""http://www.sqlite.org/lang_expr.html"" rel=""nofollow"">sqlite expressions</a> to get true/false result without selecting anything?</p><p>Those libraries are implemented in native code. Will it be faster and less battery expensive?</p>","51086","","","","","2012-03-13 15:44:40","Expression parser library for Android","<android><parsing>","2","2","","2012-03-13 15:54:29",""
"2645041","1","","","2010-04-15 12:11:33","33","44173","<p>I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial?I am not sure how to realize step 4  to 5.</p><blockquote>  <p>STEP4: Configuring ...</p>    <p>STEP5: cd to your NDK root dir, type make TARGET_ARCH=arm APP=ffmpeg-org</p></blockquote><p>It seems to me that building an application like it is explained in the tutorial in step 5 need some previous steps. Unfortunately I have no app in the folder to make. I am using the current android ndk release 3 and checked out the actual ffmpeg releases from [3] and [4]. I am thankful for every advice.</p><p>[1] <a href=""http://slworkthings.wordpress.com/"">http://slworkthings.wordpress.com/</a><br>[2] <a href=""http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android"">http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android</a><br>[3] <a href=""http://ffmpeg.org/download.html"">http://ffmpeg.org/download.html</a></p>","317462","","149841","","2011-08-05 15:10:07","2014-04-13 09:38:58","ffmpeg for a android (using tutorial: ""ffmpeg and Android.mk"")","<android><ffmpeg><cross-compiling><android-ndk>","4","2","42","",""
"2645100","1","2645148","","2010-04-15 12:21:17","0","2248","<p>when I put the setContentView in thread as below, it crashes while running in emulator.</p><pre><code>      new Thread(){          public void run() {                          setContentView(R.layout.main_layout);          }        }.start();</code></pre>","301549","","82515","","2010-04-15 12:25:48","2011-03-15 05:08:46","application crashes while putting setContentView in thread class in emulator","<android><android-emulator>","3","2","","",""
"2645131","1","","","2010-04-15 12:26:08","1","1196","<p>Currently i am using ContentObserver on the Uri</p><pre><code>ContentResolver contentResolver = context.getContentResolver();SMSObserver m_SMSObserver = new SMSObserver(context);contentResolver.registerContentObserver(Uri.parse(""content://sms""), true, m_SMSObserver);</code></pre><p>in this manner <strong>onChange</strong> method call in both the cases i.e incoming and outgoing sms.but i need it only outgoing SMS.and it is noted that </p><pre><code> Uri.parse(""content://sms/sent"") Uri.parse(""content://sms/outbox"")</code></pre><p>not workingKindly help me how i can trace the outgoing message.</p><p>thankz.</p>","309990","","96194","","2010-04-15 12:33:11","2013-02-28 22:30:22","tracing Outgoing SMS","<java><android><sms>","1","7","","",""
"2645271","1","2650863","","2010-04-15 12:43:43","1","7278","<p>I am using below code where , i want to show dialog in front and loading content in background but not able to do the same . Please advise.</p><pre><code>dialog = ProgressDialog.show(this, """", ""Loading. Please wait..."", true);runOnUiThread(new Runnable(){  public void run() {    setContentView(R.layout.main_layout);    dialog.dismiss();  }});</code></pre>","301549","","88558","","2010-04-15 12:46:38","2012-07-30 05:49:18","showing dialog while loading layout by setContentView in background","<android><android-emulator>","3","0","1","",""
"2645473","1","2645589","","2010-04-15 13:07:42","0","348","<p>Is there a piece of code I could write to be notified when a download finishes in android, and  be able to execute some custom actions on this event ?</p>","304866","","","","","2010-04-15 13:22:07","onDownload complete notification","<android>","1","0","","",""
"2645475","1","","","2010-04-15 13:08:03","3","374","<p>In my desperation with trying to get LiveFolders working, I have tried the following in my <code>LiveFolder</code> <code>ContentProvider</code>:</p><pre><code>public Cursor query(Uri uri, String[] projection, String selection,        String[] selectionArgs, String sortOrder) {    MatrixCursor mc = new MatrixCursor(new String[] { LiveFolders._ID, LiveFolders.NAME, LiveFolders.INTENT } );    Intent i = null;    for (int j=0; j &lt; 5; j++) {        i = new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.google.com/""));        mc.addRow(new Object[] { j, ""hello"", i} );    }    return mc;}</code></pre><p>Which, in all normalness, should launch the Browser and display the Google homepage when clicking on an item in the LiveFolder. But it doesn't. It gives a <code>Application is not installed on your phone</code> error. No, I'm not defining a base intent for my LiveFolder.</p><p><code>logcat</code> says:</p><pre><code>I/ActivityManager(   74): Starting activity: Intent { act=android.intent.action.VIEW dat=Intent { act=android.intent.action.VIEW dat=http://www.google.com/ } flg=0x10000000 }</code></pre><p>It seems it embeds the <code>Intent</code> I give it in the <code>data</code> section of the actually fired <code>Intent</code>. Why is it doing this? I'm really starting to believe it's a platform bug.</p><hr><p><strong>Update:</strong> I have filed <a href=""http://code.google.com/p/android/issues/detail?id=7766"" rel=""nofollow"">an issue</a> and removed the LiveFolders feature. I will include it in my app when I'll get a response either here or there that clarifies this thing. If I get the time I think I'll upload a demo app to that issue.</p><hr><p><strong>Update:</strong> I have received a notification that the bounty is expiring in 3 days. No one wants it? :)</p><hr><p><strong>Update 04/25/2010:</strong> I have updated <a href=""http://code.google.com/p/android/issues/detail?id=7766"" rel=""nofollow"">the issue</a> on the Android project and uploaded a test application. It would be nice if someone could test this application on a device, maybe it's such a subtle problem that it only appears on the emulator.</p>","180784","","180784","","2010-04-25 16:20:33","2012-11-11 21:45:50","Intent provided by Cursor is not fired correctly (LiveFolders)","<android><android-livefolders>","3","3","1","",""
"2645648","1","","","2010-04-15 13:28:51","10","8966","<p>I just wanted to know if there is some kind of class to use the multitouch features of android 2.1.  Specifically I am trying to implement pinch-zoom and was wondering if I always have to measure the distance between two touch events and calculate the zoom level on my own?</p><p>Thanks,chris</p>","317534","","13070","","2010-04-15 14:08:56","2013-09-15 16:07:56","Is there a built in API for handling pinch-zoom functionality in Android","<android><multi-touch>","5","2","5","",""
"2645703","1","4948064","","2010-04-15 13:36:54","1","2823","<p>I have created three tabs in <a href=""http://developer.android.com/reference/android/app/TabActivity.html"" rel=""nofollow"">TabActivity</a> <a href=""http://developer.android.com/reference/android/app/ActivityGroup.html#onCreate%28android.os.Bundle%29"" rel=""nofollow"">onCreate</a>.</p><p>How can I hide one tab at runtime?</p>","316286","","29995","","2011-07-08 21:40:31","2013-02-28 14:08:58","How do I hide a tab in a TabActivity?","<android><android-widget><tabactivity>","3","0","1","",""
"2645902","1","2645913","","2010-04-15 13:57:20","2","1248","<p>Can YouTube videos be played from within an AndroidOS without launching the separate YouTube player? How about WebOS or Blackberry?</p><p>On the iPhone I can do this with a WebView and the embedded YouTube code and I'm weighing the possibility of porting my app to other mobile platforms. Thanks</p>","1580229","","","","","2011-03-29 14:46:31","Can YouTube be embedded in Android Applications? How about WebOS or Blackberry?","<iphone><android><video><youtube><webos>","3","0","3","",""
"2646001","1","2646113","","2010-04-15 14:09:39","10","7736","<p>I would like some of my preferences to have icons, like the Settings app.</p><p>I guess one way of doing this would be to copy all the relevant code and resources from the Settings app, but it seems like overkill for a couple of icons. </p><p>Also I don't like the idea of having to duplicate the code and resources in each project that requires settings icons.</p><p>Has anyone solved this already with a simpler or resource-free approach?</p>","143378","","","","","2013-08-06 12:03:39","Using icons in Android preferences","<android><resources><settings>","4","1","9","",""
"2646028","1","2655740","","2010-04-15 14:12:08","156","68699","<p>I have a ScrollView that surrounds my entire layout so that the entire screen is scrollable.  The first element I have in this ScrollView is a HorizontalScrollView block that has features that can be scrolled through horizontally.  I've added an ontouchlistener to the horizontalscrollview to handle touch events and force the view to ""snap"" to the closest image on the ACTION_UP event.</p><p>So the effect I'm going for is like the stock android homescreen where you can scroll from one to the other and it snaps to one screen when you lift your finger.</p><p>This all works great except for one problem:  I need to swipe left to right almost perfectly horizontally for an ACTION_UP to ever register.  If I swipe vertically in the very least (which I think many people tend to do on their phones when swiping side to side), I will receive an ACTION_CANCEL instead of an ACTION_UP.  My theory is that this is because the horizontalscrollview is within a scrollview, and the scrollview is hijacking the vertical touch to allow for vertical scrolling.  </p><p>How can I disable the touch events for the scrollview from just within my horizontal scrollview, but still allow for normal vertical scrolling elsewhere in the scrollview?</p><p>Here's a sample of my code:</p><pre><code>public class HomeFeatureLayout extends HorizontalScrollView {private ArrayList&lt;ListItem&gt; items = null;private GestureDetector gestureDetector;View.OnTouchListener gestureListener;private static final int SWIPE_MIN_DISTANCE = 5;private static final int SWIPE_THRESHOLD_VELOCITY = 300;private int activeFeature = 0;public HomeFeatureLayout(Context context, ArrayList&lt;ListItem&gt; items){    super(context);    setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    setFadingEdgeLength(0);    this.setHorizontalScrollBarEnabled(false);    this.setVerticalScrollBarEnabled(false);    LinearLayout internalWrapper = new LinearLayout(context);    internalWrapper.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    internalWrapper.setOrientation(LinearLayout.HORIZONTAL);    addView(internalWrapper);    this.items = items;    for(int i = 0; i&lt; items.size();i++){        LinearLayout featureLayout = (LinearLayout) View.inflate(this.getContext(),R.layout.homefeature,null);        TextView header = (TextView) featureLayout.findViewById(R.id.featureheader);        ImageView image = (ImageView) featureLayout.findViewById(R.id.featureimage);        TextView title = (TextView) featureLayout.findViewById(R.id.featuretitle);        title.setTag(items.get(i).GetLinkURL());        TextView date = (TextView) featureLayout.findViewById(R.id.featuredate);        header.setText(""FEATURED"");        Image cachedImage = new Image(this.getContext(), items.get(i).GetImageURL());        image.setImageDrawable(cachedImage.getImage());        title.setText(items.get(i).GetTitle());        date.setText(items.get(i).GetDate());        internalWrapper.addView(featureLayout);    }    gestureDetector = new GestureDetector(new MyGestureDetector());    setOnTouchListener(new View.OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            if (gestureDetector.onTouchEvent(event)) {                return true;            }            else if(event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL ){                int scrollX = getScrollX();                int featureWidth = getMeasuredWidth();                activeFeature = ((scrollX + (featureWidth/2))/featureWidth);                int scrollTo = activeFeature*featureWidth;                smoothScrollTo(scrollTo, 0);                return true;            }            else{                return false;            }        }    });}class MyGestureDetector extends SimpleOnGestureListener {    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        try {            //right to left             if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                activeFeature = (activeFeature &lt; (items.size() - 1))? activeFeature + 1:items.size() -1;                smoothScrollTo(activeFeature*getMeasuredWidth(), 0);                return true;            }              //left to right            else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                activeFeature = (activeFeature &gt; 0)? activeFeature - 1:0;                smoothScrollTo(activeFeature*getMeasuredWidth(), 0);                return true;            }        } catch (Exception e) {            // nothing        }        return false;    }}</code></pre><p>}</p>","302749","","","","","2014-03-05 14:41:44","Android - HorizontalScrollView within ScrollView Touch Handling","<android><scrollview><horizontalscrollview><ontouchlistener>","7","0","167","",""
"2646315","1","2647142","","2010-04-15 14:46:54","1","4367","<p>How to change the size of LinearLayout when it is runtime ?</p><p>I've set the size dynamically when it is runtime. But no luck. Didn't change the size of LinearLayout. </p><p>How to code it ?</p><p>Thanks in advance.</p>","164589","","","","","2011-11-29 19:11:57","How to change size of the LinearLayout when it is runtime?","<android>","2","0","","",""
"2646331","1","","","2010-04-15 14:48:27","3","4730","<p>I have an image on a private file.I read the file, create the drawable, and assign it to an ImageView.The ImageView has WRAP_CONTENT so the size is automatic.</p><p>On 320x480 screens, the image looks goodBut on screens with more resolution and high density 480x800 or 480x854 (N1, droid) , when the image is for example 150x150, I see the image as 100x100.</p><p>Of course it has something to do with the density but not sure how should I resolve this.</p><p>This is my code:</p><pre><code>FileInputStream fis = this.openFileInput(""icon.png"");icon = Drawable.createFromStream(fis, ""icon"");fis.close();imageView.setImageDrawable(icon);</code></pre><p>thanks</p><p>================================================================</p><p>update:</p><p>with the following code: </p><blockquote>  <p>FileInputStream fis = this.openFileInput(""icon.png"");</p>    <p>icon = Drawable.createFromStream(fis, ""icon"");</p></blockquote><p>if I then inspect the size of the icon, android thinks the size is 100x100, when really is 150x150.</p><p>Looks like its reducing the image by the density.Can anybody explain this and how to avoid this.</p><p>Thanks</p>","237115","","237115","","2010-04-16 13:50:58","2013-05-14 07:30:36","android drawable changes sizes on screen when reading image from file","<android><screen><resolution>","4","0","","",""
"2646387","1","","","2010-04-15 14:54:53","2","564","<p>I am using WCF to write a server that should be able to communicate with .Net clients, Android clients and possibly other types of clients.</p><ul><li><p>The main type of client is a desktop application that will be written in .Net. This client will usually be on the same intranet as the server. It will make an initial call to the server to get the current state of the system and will then receive updates from the server whenever a value changes. These updates are frequent, perhaps once a second.</p></li><li><p>The Android clients will connect over the Internet. This client is also interested in updates, but it is not as critical as for the desktop client so a (less frequent) polling scenario might be acceptable.</p></li><li><p>All clients will have to login to use the services, and when connecting over the Internet the connection should be secure. </p></li></ul><p>I am familiar with WCF but I am not sure what bindings are most appropriate for the scenario and what security solution to use. Also, I have not used Android, but I would like to make it as simple as possible for the person implementing the Android client to consume my services. So, what is my strategy?</p>","310042","","","","","2011-01-22 22:37:25","Strategy for WCF server with .Net clients and Android clients?","<c#><.net><android><wcf>","2","0","","",""
"2646393","1","2646688","","2010-04-15 14:55:06","0","1456","<p>How can you put text in the status bar and get it to stay there when the window is not expanded? Similar to using text instead of an icon?</p>","274365","","623518","","2012-05-01 08:45:49","2012-05-01 08:45:49","Status bar text instead of an icon","<android><notifications><statusbar>","1","0","","",""
"2646501","1","2646646","","2010-04-15 15:08:23","5","3834","<p>Is it possible to write ""extensions"" for the webkit based browser found on Android devices? </p><p>i.e. extensions akin to Google Chrome's ?</p>","171461","","","","","2011-03-21 18:05:17","Android Browser Extensions","<android><browser>","2","0","1","",""
"2646669","1","","","2010-04-15 15:29:12","0","498","<p>How can i develop  a  Test Automation Framework for Embedded Devices to achieve the challenge of no dedicated and successful framework for Embedded application in current IT industry.and what are the ways to develop this framework?</p>","396643","","","","","2011-01-31 13:04:14","Test Automation Framework For Embedded Platforms","<android><java-me>","1","2","1","",""
"2646977","1","","","2010-04-15 16:06:24","-2","294","<p>I want to play power point presenetaions on android.basically when user cliks on button , play ppt file. How to do that? any example?</p>","307289","","","","","2012-07-02 15:01:00","android and power point","<android>","1","3","","",""
"2647103","1","2647155","","2010-04-15 16:22:53","0","927","<p>I'm using Windows to develop android apps and want to know where user preference data is located. It says at /data/data/package/...., but where can I actually see the preference file? Via eclipse or command line tools?</p>","253800","","","","","2010-04-15 16:30:36","android: user preference data location in windows","<android><preferences>","1","0","","",""
"2647481","1","2647554","","2010-04-15 17:16:02","0","6654","<p>For debugging purposes, I wanted to have a couple of mp3 files located somewhere ""in"" my android emulator. Is there anyway to directly push files from my OS file system to the storage system of android? </p><p>If so, which directory does android keep audio files?</p><p>if not, how can I access an SD card via emulator?</p><p>[update2]: The problem in update1 solved. Should use adb push.[update1]: I followed kgiannakakis's advice to create an sdcard for my avd. However, I got Permission denied error when I try to create new directory inside it.</p><pre><code>$ cd sdcard$ lsLOST.DIR$mkdir musicsmkdir failed for musics, Permission denied$ su mkdir musicssu: uid 10016 not allowed to su</code></pre>","253800","","67566","","2011-07-11 02:21:25","2011-07-11 02:21:25","android: adding audio files to android emulator [update] permission denied","<android><audio><storage>","2","0","","",""
"2647515","1","2647705","","2010-04-15 17:20:42","2","4180","<p>I have a Button on appwidget, that I need to 'enable'/'disable' programmatically from a Service.</p><p>First idea was to call <code>setBoolean(R.id.buttonid, ""setClickable"", false)</code> to disable it, but apparently you can't call <code>setClickable</code> remotely.</p><p>Another idea was was remove the text label from it with <code>rv.setTextViewText(R.id.buttonid, """")</code> and then remove the click handler by <code>rv.setOnClickPendingIntent(R.id.buttonid, null)</code>. Unfortunately passing <code>null</code> to it causes <code>NullPointerException</code> in in <code>android.app.ActivityThread.handleServiceArgs</code></p><p>Is there some other way to programmatically disable/enable appwidget Button? I could just call <code>rv.setViewVisibility(R.id.buttonid, View.GONE)</code> to hide the button completely instead of disabling it. This would however completely break whole widget layout and I would like to avoid it. </p><p>The solution I'm using now is hiding the button with <code>setViewVisibility</code> and showing other blank button instead to the keep appwidget layout as it was before.</p>","306831","","","","","2013-03-14 15:25:06","How to programmatically disable onClick handler on Android AppWidget Button","<android><layout><android-widget>","2","0","0","",""
"2647542","1","9485796","","2010-04-15 17:23:50","22","34663","<p>We are using <code>AsyncTasks</code> to access database tables and cursors.</p><p>Unfortunately we are seeing occasional exceptions regarding the database being locked.</p><pre><code>E/SQLiteOpenHelper(15963): Couldn't open iviewnews.db for writing (will try read-only):E/SQLiteOpenHelper(15963): android.database.sqlite.SQLiteException: database is lockedE/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)E/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1637)E/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1587)E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:659)E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:652)E/SQLiteOpenHelper(15963):  at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)E/SQLiteOpenHelper(15963):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)E/SQLiteOpenHelper(15963):  at com.iview.android.widget.IViewNewsTopStoryWidget.initData(IViewNewsTopStoryWidget.java:73)E/SQLiteOpenHelper(15963):  at com.iview.android.widget.IViewNewsTopStoryWidget.updateNewsWidgets(IViewNewsTopStoryWidget.java:121)E/SQLiteOpenHelper(15963):  at com.iview.android.async.GetNewsTask.doInBackground(GetNewsTask.java:338)E/SQLiteOpenHelper(15963):  at com.iview.android.async.GetNewsTask.doInBackground(GetNewsTask.java:1)E/SQLiteOpenHelper(15963):  at android.os.AsyncTask$2.call(AsyncTask.java:185)E/SQLiteOpenHelper(15963):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)E/SQLiteOpenHelper(15963):  at java.util.concurrent.FutureTask.run(FutureTask.java:122)E/SQLiteOpenHelper(15963):  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)E/SQLiteOpenHelper(15963):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)E/SQLiteOpenHelper(15963):  at java.lang.Thread.run(Thread.java:1060)</code></pre><p>Does anybody have a general example for code which writes to a database from a different thread than the one reading and how can we ensure thread safety.</p><p>One suggestion I've had is to use a <code>ContentProvider</code>, as this would handle the access of the database from multiple threads. I am going to look at this, but is this the recommended method of handling such a problem? It seems rather heavyweight considering we're talking about in front or behind.</p>","219360","","648313","","2012-02-15 12:19:31","2013-11-13 12:34:26","Android threading and database locking","<android><sqlite><locking><thread-safety><android-asynctask>","7","0","18","",""
"2647850","1","","","2010-04-15 18:10:26","1","1326","<p>I'm looking for a way to automatically start the android Package Installer , after the browser finishes downloading an apk file . Any  ideas on this ? Currently after the download  is over the list of downloaded files is displayed and clicking on the downloaded apk launches the Package installer . (step which I'd like to automatize) </p><p>I've thought on launching the instalation manually with code like this :</p><pre><code>intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(""file:///sdcard/downloadedApk""),""application/vnd.android.package-archive"");startActivity(intent); </code></pre><p>,but I'm unable to find when the download completes to execute the snipet above.</p>","284609","","","","","2010-04-16 08:18:44","Launching The package installer","<android>","2","1","0","",""
"2648381","1","","","2010-04-15 19:31:17","0","243","<p>HI,</p><p>I want to create Login option in my application , so that once a person gets login that device creates token which is saved over server. From next time whenever he/she operates the application, directly goes to next label by checking that token keyvalue pair over server.IT requires login page only when that keyvalue pair is deleted from the server.     </p><p>Can anyone help me from this.I will be very grateful to you.Looking for reply.</p><p>Regards,Praween</p>","292605","","","","","2010-04-16 01:38:48","How to optimize the login option in android?","<android>","1","1","","",""
"2648391","1","2649965","","2010-04-15 19:32:35","4","2530","<p>So - Android is build on top of a stripped down linux system. Most of the convenient utilities are missing but all the basics are there.</p><p>I can call insmod and rmmod. No problem.</p><p>But where do kernel-modules and firmware files reside? I can't find any. there is no /lib/modules in the standard distribution. </p><p>Problem: I need modules. For sure don't want to compile support for each and every usb-device in the world into the linux-kernel. Where should I put them?</p>","15955","","","","","2010-04-16 01:04:39","Android and Kernel-Modules","<android><linux><kernel-module>","1","0","","",""
"2648470","1","2649960","","2010-04-15 19:44:30","0","899","<p>I am getting an exception in a very simple 'study' application, so I expect the problem to be in my project setup, but I don't know how to debug ...</p><p>What is the context of the exception, ""ExceptionInInitializationError""?</p><p>Where is it documented?  A: Search Android Developers Guide</p><p>Stack trace from within Eclipse Debugger with: select thread -> right-click -> copy stack</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception ExceptionInInitializerError))       Class.newInstance() line: 1479      Instrumentation.newActivity(ClassLoader, String, Intent) line: 1021     ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2367      ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2470       ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119     ActivityThread$H.handleMessage(Message) line: 1821      ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4310        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>Here is the logcat:</p><pre><code>I/ActivityManager(   52): Starting activity: Intent { flg=0x10000000 cmp=com.androidcode.study_wikinotes/.WikiNotes }D/AndroidRuntime(  198): Shutting down VMD/dalvikvm(  198): DestroyJavaVM waiting for non-daemon threads to exitD/dalvikvm(  198): DestroyJavaVM shutting VM downD/dalvikvm(  198): HeapWorker thread shutting downD/dalvikvm(  198): HeapWorker thread has shut downD/jdwp    (  198): JDWP shutting down net...I/jdwp    (  198): adbd disconnectedD/dalvikvm(  198): VM cleaning upE/AndroidRuntime(  198): ERROR: thread attach failedI/ActivityManager(   52): Start proc com.androidcode.study_wikinotes for activity com.androidcode.study_wikinotes/.WikiNotes: pid=219 uid=10023 gids={}D/dalvikvm(  198): LinearAlloc 0x0 used 634508 of 5242880 (12%)D/ddm-heap(  155): Got feature list requestD/ddm-heap(  169): Got feature list requestD/ddm-heap(  183): Got feature list requestD/ddm-heap(  206): Got feature list requestD/ddm-heap(  219): Got feature list requestW/ActivityThread(  219): Application com.androidcode.study_wikinotes is waiting for the debugger on port 8100...I/System.out(  219): Sending WAIT chunkI/dalvikvm(  219): Debugger is activeI/System.out(  219): Debugger has connectedI/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): waiting for debugger to settle...I/System.out(  219): debugger has settled (1382)W/dalvikvm(  219): Exception Ljava/util/regex/PatternSyntaxException; thrown during Lcom/androidcode/study_wikinotes/WikiNotes;.&lt;clinit&gt;W/dalvikvm(  219): Class init failed in newInstance call (Lcom/androidcode/study_wikinotes/WikiNotes;)</code></pre><p>Ahh ... I have an incomplete class in WikiNotes.  Would you say the answer is to ""start with logcat""? :)  Thanks for the help.  Go ahead and add your answer and I will accept it.</p>","295278","","295278","","2010-04-15 22:49:51","2010-04-16 01:04:21","how to debug ExceptionInInitializationError?","<android><debugging><exception><logcat>","1","6","","",""
"2648482","1","","","2010-04-15 19:45:40","9","10297","<p>i want to add many different markers on an android map. My code works good so far with the same overlay over and over again:</p><pre><code>mapOverlays = mapView.getOverlays();drawable = this.getResources().getDrawable(R.drawable.marker);itemizedOverlay = new MyItemizedOverlay(drawable);OverlayItem overlayItem = new OverlayItem(geoPoint, ""foo"", ""bar"");mapOverlays.add(itemizedOverlay);</code></pre><p>This works fine so far. But every marker is the same. What I want to do now is having different markers on the map like the ones you see on Google Maps Webapp (a marker named ""A"", the next one ""B"", and so on).How can I achieve this? Do I have to add an extra png marker file to my app ? (marker_a.png, marker_b.png,...) or is there a simpler way to achieve this? It could also be that there will be more than 26 results so that i possibly need different colours of the markers. </p>","317913","","","","","2012-01-24 10:10:32","Different named Markers on Google Android Map","<android><map><overlay><marker>","5","0","9","",""
"2648949","1","2651560","","2010-04-15 21:02:35","0","632","<p>I am developing a small application in Android. I come across a problem, and not sure whether it is possible in Android platform.</p><p>I have some local html files. There is an Activity contains a webview, which is used to display these local html files. In some cases, I want to display a picture selected from phone into one of these local html files.</p><p>Is it possible? Has anyone resolved such problem? I appreciate any of your replies.</p><p>Best</p>","317992","","","","","2010-04-16 08:22:48","How to display a pic selected from phone to a local html in the Webview","<android>","2","0","","",""
"2649152","1","","","2010-04-15 21:37:02","0","9837","<p>So far I just have one XML layout file, and one drawable directory, drawable-hdpi. I first want to target the high density screens. </p><p>I added a bunch of imagebuttons to a relativelayout and everything looks perfect in the WVGA800 emulator. The problem arises when I view it in the WVGA854 emulator. Not only do the imagebuttons not position the same, but the images are blurry. I used dip for the layout margins on the imagebuttons even though it shouldn't matter in this case because WVGA800 and 854 are both high density. What is the problem? Why would it look totally different on emulators that have the same density and almost have the same exact screen dimensions?</p><p>Thanks!</p>","313717","","","","","2011-09-19 04:37:34","Getting differences between WVGA800 and WVGA854 in Android Emulator","<android>","1","1","","",""
"2649202","1","2649444","","2010-04-15 21:46:12","0","412","<p>I'm currently exploring Broadcast Receivers and Broadcast Intent.  There are some aspects of the tutorials which are ambiguous to me.  To my knowledge this is how the process works.  I can broadcast an intent from my application and any receiver on the phone can act on that intent as long as the actions match.  I can register a broadcaster receiver on anything that extends Context and when I do so I must provide a filter which will allow the receiver to act on one or more intent actions.</p><p>The part which confuses me is defining a receiver via the manifest.  Must the name of said receiver match a class name?  Why should I ever define an intent filter with an action in the project manifest if I always have to provide another intent filter when I register my receiver in code?</p><p>If anyone has a good tutorial or example of the best way to use broadcast receivers and how I should define them I would appreciate it.</p>","303256","","303256","","2010-04-16 14:11:25","2010-04-16 14:11:25","What is the point of defining actions within intent filters on a reciever tag","<android><android-intent><broadcastreceiver>","1","0","","",""
"2649403","1","","","2010-04-15 22:24:45","1","3263","<p>Although my relativelayout looks very similar on WVGA800 and WVGA854 on the emulator, theres different spacing on some of the objects because I'm going off of marginleft or marginright. Since the 854 is a greater width, its pushing some objects differently. Is there any way I could target either one to adjust for the different margins?</p>","313717","","","","","2010-06-21 18:00:08","Android WVGA800 and 854","<android>","1","0","","",""
"2649422","1","2649454","","2010-04-15 22:28:00","7","18983","<p>My client wants to dogfood my android app. They don't have eclipse and don't want to install it. Is there a more convenient way to send my apk to them? Can I send it via email and let them open the attachment in mobile device? Will it start installing itself automatically?</p>","253800","","253800","","2010-04-15 22:35:41","2014-01-05 11:58:38","android: test app on a real device","<android><testing>","8","0","5","",""
"2649641","1","2724641","","2010-04-15 23:22:16","1","1583","<p>Building our Android app from Ant fails with this error:</p><pre><code>    [apply]     [apply] UNEXPECTED TOP-LEVEL ERROR:    [apply] java.lang.OutOfMemoryError: Java heap space    [apply]     at java.util.HashMap.&lt;init&gt;(HashMap.java:209)    [apply]     at java.util.HashSet.&lt;init&gt;(HashSet.java:86)    [apply]     at com.android.dx.ssa.Dominators.compress(Dominators.java:96)    [apply]     at com.android.dx.ssa.Dominators.eval(Dominators.java:132)    [apply]     at com.android.dx.ssa.Dominators.run(Dominators.java:213)    [apply]     at com.android.dx.ssa.DomFront.run(DomFront.java:84)    [apply]     at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:265)    [apply]     at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:51)    [apply]     at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:100)    [apply]     at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:74)    [apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)    [apply]     at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)    [apply]     at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)    [apply]     at com.android.dx.command.dexer.Main.processClass(Main.java:297)    [apply]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)    [apply]     at com.android.dx.command.dexer.Main.access$100(Main.java:56)    [apply]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)    [apply]     at com.android.dx.command.dexer.Main.processOne(Main.java:245)    [apply]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)    [apply]     at com.android.dx.command.dexer.Main.run(Main.java:139)    [apply]     at com.android.dx.command.dexer.Main.main(Main.java:120)    [apply]     at com.android.dx.command.Main.main(Main.java:87)BUILD FAILED</code></pre><p>Ive tried giving Ant more memory by setting ANT_OPTS=""-Xms256m -Xmx512m"". (This build machine has 1Gb RAM).</p><p>Do I just need more memory or is there anything else I can try?</p>","246793","","","","","2010-06-22 07:00:05","Ant build from Android-generated build file fails - how to fix?","<android><memory><ant><build>","3","2","","",""
"2649657","1","","","2010-04-15 23:25:24","0","1051","<p>In my android application, I would like to support multiple screens.So I have my layout xml files in res/layout (the layout are the same across different screen resolution). And I place my high-resolution asserts in res/drawable-hdpi</p><p>In my layout xml, I have</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:background=""@drawable/bkg""&gt;</code></pre><p>And I have put bkg.png in res/drawable-hdpi</p><p>And I have started my emulator with WVGA-800 as avd. But my application crashes:</p><pre><code>    E/AndroidRuntime(  347): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020023 a=-1 r=0x7f020023}E/AndroidRuntime(  347):        at android.content.res.Resources.loadDrawable(Resources.java:1677)E/AndroidRuntime(  347):        at android.content.res.TypedArray.getDrawable(TypedArray.java:548)E/AndroidRuntime(  347):        at android.view.View.&lt;init&gt;(View.java:1850)E/AndroidRuntime(  347):        at android.view.View.&lt;init&gt;(View.java:1799)E/AndroidRuntime(  347):        at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:284)E/AndroidRuntime(  347):        at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)E/AndroidRuntime(  347):        ... 42 more</code></pre><p>Does anyone know how to fix my problem?</p><p>Thank you.</p>","286802","","","","","2012-05-01 10:27:33","Need help in support multiple resolution screen on android","<android>","2","0","","",""
"2650081","1","2650358","","2010-04-16 01:44:03","-2","1264","<p>Hey i want to develop a player on Android, which can play streaming audio and video.how should i start about?</p>","318127","","","","","2010-04-16 03:14:32","Android Application","<android>","1","0","","",""
"2650208","1","","","2010-04-16 02:28:42","1","1181","<p>My app icon shows up on my Nexus One, but not on the Android Market site or the emulator. Is there some naming convention to use?</p><p>Thanks.</p>","318151","","","","","2010-04-16 04:53:02","App Icon does not show up","<android>","1","0","","",""
"2650259","1","2680834","","2010-04-16 02:45:07","3","1293","<p>I am working on an app which calls a rest web service.  Sometimes the xml responses contain characters which the phone can not display.  When displaying these characters, an empty box is displayed instead.  I would like to filter out these characters.  How can I detect if a character will be able to be displayed on the screen?</p><p>Some specific characters include:</p><p><a href=""http://www.fileformat.info/info/unicode/char/0094/index.htm"" rel=""nofollow"">http://www.fileformat.info/info/unicode/char/0094/index.htm</a> <a href=""http://www.fileformat.info/info/unicode/char/0080/index.htm"" rel=""nofollow"">http://www.fileformat.info/info/unicode/char/0080/index.htm</a> <a href=""http://www.fileformat.info/info/unicode/char/0092/index.htm"" rel=""nofollow"">http://www.fileformat.info/info/unicode/char/0092/index.htm</a> </p>","240566","","240566","","2010-04-26 12:20:16","2010-04-26 12:23:02","How do I remove unrecognized characters which come back from a web service?","<java><xml><android><parsing><encoding>","3","3","1","",""
"2650351","1","5110580","","2010-04-16 03:10:53","14","13461","<p>I'm creating something like a SlideDrawer but with most customization, basically the thing is working but the animation is flickering at the end.</p><p>To further explain, I got an TranslateAnimation then after this animation it returns back to the original position, if i set setFillAfter then the buttons inside the layout stops working. If i listen to onAnimationEnd and set other's layout to View.GONE the layout fickers. Judging from it is that on animation end, the view goes back to original position before the View.GONE is called.</p><p>Any advice would be awesome. Thanks</p>","258648","","","","","2013-07-11 01:48:41","Android TranslateAnimation resets after animation","<android><animation>","6","0","12","",""
"2650429","1","","","2010-04-16 03:41:28","0","140","<p>How can I use Nmap port scanner on Android SDK in Windows?</p>","275674","","651104","","2012-04-22 00:35:52","2012-04-22 00:35:52","Android cross compilation","<android>","1","0","","",""
"2650465","1","","","2010-04-16 03:50:48","2","11521","<p>Is it possible to place buttons at an X,Y position over the top of a Canvas?</p><p>For example, on the opening screen of my game, I would like to place buttons for ""Play Now"", ""Instructions"", etc, right on top of the canvas.  </p><p>Right now, I'm looking at Touch locations on the Canvas and comparing them to various X,Y bounds.  It works, but adding a button with a click listener would probably be much more efficient.</p>","179518","","","","","2013-07-03 02:20:41","Android: how to place a button at an x,y position over top of Canvas","<android><button><canvas>","1","0","2","",""
"2650602","1","2650668","","2010-04-16 04:24:59","0","417","<p>Brand new to droid programming, but would love to learn as much as possible, so I finally got my emulator working correctly, I even got a hello world button to work,</p><p>I'm attempting to make this button display a random number, I've googled this and came up with this code:</p><pre><code>Random generator = new Random();int n = generator.nextInt(n);</code></pre><p>I fixed the Random function by including some Random java utility.</p><p>I'm assuming this code above goes in the .java file of the project, so my button code looks as follows (tested and works):</p><pre><code>PopUpText.makeText(v.getContext(), ""Hello World"", PopUpText.LENGTH_LONG).show();</code></pre><p>I figured I could replace ""Hello World"" with n to display the number in the box, however the following error is stopping the compile: </p><blockquote>  <p>The local variable n may not have been initialized</p></blockquote><p>Any ideas why this is happening? Any advice would be hugely appreciated.</p>","242934","","23897","","2010-04-16 04:30:00","2013-06-23 21:21:56","Noob Droid Question regarding random number","<android><random>","3","4","1","",""
"2650853","1","2655727","","2010-04-16 05:37:18","1","415","<p>I am trying to make Layout that contains 2 layout, vertical and horizontal scrolls. </p><p>Like this :<a href=""http://202.131.244.11/demo/VerticalAndHorizontalScrolls.PNG"" rel=""nofollow"">http://202.131.244.11/demo/VerticalAndHorizontalScrolls.PNG</a></p><p>How to make it ?I've tried it. But horizontal scroll doesn't work for me.</p><p>Please advise. </p>","164589","","","","","2010-04-16 19:48:59","How to make Verital and Horizontal scroll on 2 layouts?","<android><layout>","1","0","","",""
"2651045","1","2651304","","2010-04-16 06:27:38","0","598","<p>I am working on an Location Based Application. In this application iam using LocationListener class to update the location when theLocation is changed.In each Activity i have differentLocationListener  to update location and do some specific work onupdated location. But my problem is that when i am changing mylocation through DDMS , the LocationListener is being called of thatcurrent Activity as well as all the activities of the wholeapplication where LocationListener has been defined. I don't knowwhether there should be one LocationListener for the whole applicationor for each Activity we should have different LocationListener.</p><p>Please help me......Its urgent..........Thanks in Advance.....</p>","307585","","","","","2013-06-23 21:21:47","LocationListener is being called multiple times","<android>","1","1","","",""
"2651070","1","2668538","","2010-04-16 06:33:21","3","21471","<p>How to make button show it is clicked (by setting it go down/some change) for buttons using custom background image in Android.I do not want to include more images and set different one to different states like shown in google hello views example.Thanks.</p>","315619","","315619","","2010-04-17 02:49:45","2013-03-15 12:01:21","How to make button with custom background image show click animation in Android","<android>","4","5","5","",""
"2651161","1","2651309","","2010-04-16 06:53:04","1","2672","<ol><li><p>We know that we can use a concept ""Java Package"", but I just wanted toknow whether Android has provided a DLL or DLL like concept where we can write a most of the functionality.</p></li><li><p>Or can we use <em>Activity</em> for serving a purpose of DLL.</p></li></ol><p>Is there any concept like DLL on Android OS? Can we develop a DLL for better modularization and other benefits on Android?</p><p>Thanks and Regards,Prashant.</p>","312490","","1007364","","2011-12-02 17:04:54","2011-12-02 17:32:15","Is there any DLL or DLL like concept in Android?","<android><dll>","1","4","","",""
"2651235","1","2656327","","2010-04-16 07:10:40","0","2352","<p>I have a collection of strings and declared the strings individually as arrays using</p><pre><code>ArrayList&lt;String&gt; al=new ArrayList&lt;String&gt;();</code></pre><p>and called the arrays in the program by using</p><pre><code>al=getIntent().getStringArrayListExtra(""titles"");</code></pre><p>Now, instead of declaring each of the arrays i have created SongsArray.java like below...</p><pre><code>public class SongsArray {private String title;private String movieName;private String singerName;private String imagePath;private String mediaPath;public String gettitle() {    return title;}public void settitle(String title) {    this.title = title;}public String getmovieName() {    return movieName;}public void setmovieName(String movieName) {    this.movieName = movieName;}public String getsingerName() {    return singerName;}public void setsingerName(String singerName) {    this.singerName = singerName;}public String getimagePath() {    return imagePath;}public void setimagePath(String imagePath) {    this.imagePath = imagePath;}public String getmediaPath() {    return mediaPath;}public void setmediaPath(String mediaPath) {    this.mediaPath = mediaPath;}</code></pre><p>}</p><p>Now i want to call the arrays that i have declared. How can i do that??? I want to get values of each string individually...</p>","303155","","303155","","2010-04-16 07:16:36","2010-04-16 21:59:12","Getting the values from an array in android","<android>","1","2","","",""
"2651287","1","2653762","","2010-04-16 07:24:06","1","540","<p>I completely revamped an app. Tested it for a while on my device and emulator. The app worked fine. However when I updated the app through the Android market, my users experienced crashes.</p><p>Since there is no way to properly debug this procedure I asume the crash is caused by old data which is not being removed from the device (probably from the onsavedstate bundle?!). </p><p>Is there a way to do a ""clean/total"" reinstall without having the user to do it manually?</p><p>Best RegardsJohe</p>","268125","","","","","2010-04-16 14:40:12","Get rid of all user data of Android application after bigger update","<android><google-play>","1","4","","",""
"2651360","1","3139403","","2010-04-16 07:37:47","64","52586","<p>I have two Activities A and B. I want to have the shrink Animation when Activity A calls B and maximize animation when Activity B calls A. I don't need the animation xml files for this.</p><p>When we call another Activity in Android it gives its default animation and then it calls shrink animation. </p><p>What I want is that the default animation should not occur and the animation that I want should occur.</p><p>Can we actually give the animation when calling another Activity?</p>","261566","","844882","","2012-07-02 03:59:48","2014-01-02 13:10:49","How to provide animation when calling another activity in Android?","<android><animation><android-activity>","4","0","33","",""
"2651499","1","2651535","","2010-04-16 08:05:59","2","3083","<p>Hey, it's me again,I've got another question regarding to basic Android programming:</p><p>How can I access the GPS for getting the current Position of the mobile phone the app is running on? How long can this take to retrieve the information?In this case the GPS might be disabled, how can I enable/disable it again.</p><p>Which permissions must be granted in the andorid manifest?</p><p>Greetings and thanks for ur answers,</p><p>poeschlorn</p>","317301","","","","","2010-04-27 09:14:22","Getting the Position of an Android phone by using GPS","<java><android><gps>","2","0","2","",""
"2651574","1","2652377","","2010-04-16 08:25:54","0","207","<p>How can I add graphic elements in android without the use of drag it into main.xml?I mean using code to make them</p>","309166","","","","","2010-04-16 11:05:56","How can I add graphic elements in android using code?","<android><graphics><element>","1","0","","",""
"2651631","1","2652961","","2010-04-16 08:39:54","3","6031","<p>I'm trying to create an icon/widget (1 cell x 1 cell) that can be placed on the home screen of android. The widget will look and act exactly like the other standard shortcuts in android. It will have an icon and under that a label, it will be selectable with the trackball (highlight able) it will be highlighted when it is selected/clicked.</p><p>How do I go about creating this home screen widget?</p><p>Do I have to create the widget myself using code/xml or is there some standard xml, style, theme, code that I can use to ensure that the widget will have the same style/theme as the other home screen widgets? </p><p>I currently have the following</p><p>res/drawable/corners.xml</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/Corners""&gt;    &lt;stroke android:width=""4dp"" android:color=""#CC222222""  /&gt;    &lt;padding android:left=""4dp"" android:top=""1dp"" android:right=""4dp"" android:bottom=""1dp"" /&gt;    &lt;corners android:radius=""4dp"" /&gt;&lt;/shape&gt;</code></pre><p>res/layout/widget.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/Widget""    android:layout_width=""72dip""    android:layout_height=""72dip""    android:orientation=""vertical""    android:focusable=""true""    android:gravity=""center_horizontal""    style=""@android:style/Widget""       &gt;    &lt;ImageView        android:id=""@+id/WidgetIcon""        android:src=""@drawable/icon""        android:layout_width=""fill_parent""         android:layout_height=""50dip""        android:paddingTop=""3dip""        android:gravity=""center""        /&gt;    &lt;TextView        android:id=""@+id/WidgetLabel""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:text=""@string/app_name""        android:textSize=""15dip""        android:background=""@drawable/corners""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>The resulting widget looks some what close, but its not selectable, it doesn't get highlighted when clicked and the label isn't exactly in the correct location or the correct style.</p><p>Any ideas, if there is a correct way to do this, or should I just keep working away on the above until I am closer?</p>","318302","","","","","2013-09-06 09:00:41","Android Home Screen Widget (icon, label - style)","<android><android-widget>","2","2","1","",""
"2651642","1","","","2010-04-16 08:42:28","1","968","<p>How do I pick out a bookmark that I saved on my Android without using the cursor method? (http://stackoverflow.com/questions/1561535/android-how-do-i-deal-with-storing-bookmarks)</p><p>Intents? or other ways?</p><p>thanks.</p>","280641","","","","","2011-02-15 07:34:41","How do I call a bookmark library in the Android and return a bookmark?","<android><bookmarks>","0","4","1","",""
"2651756","1","","","2010-04-16 09:05:52","0","620","<p>Actually my map layout code with out tab is below one</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;FrameLayout     android:id=""@+id/FrameLayoutPeople""     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=""wrap_content""&gt;&lt;com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanelandroid:id=""@+id/transparent_panel"" android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:paddingTop=""5px""android:paddingLeft=""5px""android:paddingBottom=""10px""android:paddingRight=""5px"" &gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/LinearLayout5"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical""&gt; &lt;TextView android:id=""@+id/TextViewEmpty""android:layout_width=""wrap_content"" android:layout_height=""5dip"" /&gt; &lt;TextView android:id=""@+id/TextViewName""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:text=""People""  android:textStyle=""bold""  android:layout_gravity=""center_vertical|center_horizontal"" android:textSize=""20dip"" android:textColor=""@android:color/white""/&gt;&lt;TextView android:id=""@+id/TextViewEmpty""android:layout_width=""wrap_content""android:layout_height=""5dip""/&gt;&lt;LinearLayout android:id=""@+id/LinearLayout02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:clickable=""false""&gt;&lt;TextViewandroid:id=""@+id/TextViewEmpty"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""30dp""/&gt; &lt;TextView android:id=""@+id/TextViewName""android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:text=""Name""  android:textStyle=""bold""  android:width=""100sp"" android:textColor=""@android:color/white""/&gt; &lt;TextView android:id=""@+id/TextViewLatitude"" android:layout_width=""fill_parent""android:layout_height=""wrap_content""  android:text=""Address"" android:textStyle=""bold""android:width=""100dip"" android:textColor=""@android:color/white""/&gt;&lt;/LinearLayout&gt;&lt;ScrollViewandroid:id=""@+id/ScrollView01""  android:layout_width=""fill_parent""android:layout_height=""150sp"" android:orientation=""vertical"" &gt;&lt;LinearLayout android:id=""@+id/LinearLayoutPeople"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_margin=""10dip""&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;LinearLayout    android:id=""@+id/LinearLayoutButtons""    android:layout_width=""wrap_content""     android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:gravity=""bottom""&gt;&lt;TextView     android:id=""@+id/TextViewEmpty""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:width=""10dip""/&gt;&lt;ImageView     android:id=""@+id/ImageViewBackinPeople""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:clickable=""true""     android:focusable=""true""            android:src=""@drawable/back_normal_icon""&gt;     &lt;/ImageView&gt;    &lt;TextView     android:id=""@+id/TextViewEmpty""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:width=""30dip""/&gt;&lt;ImageView    android:id=""@+id/ImageViewAddRemoveinPeople""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:clickable=""true""     android:focusable=""true""            android:src=""@drawable/addremove_normal_icon""&gt;     &lt;/ImageView&gt;&lt;TextView     android:id=""@+id/TextViewEmpty""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:width=""40dip""/&gt; &lt;ImageView     android:id=""@+id/ImageViewShowDetailsinPeoples""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:clickable=""true""     android:focusable=""true""     android:src=""@drawable/showdetails_normal_icon""     &gt;     &lt;/ImageView&gt;     &lt;/LinearLayout&gt;   &lt;/LinearLayout&gt;  &lt;/com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel&gt;  &lt;/RelativeLayout&gt;  &lt;/FrameLayout&gt; </code></pre><p>in that when i add tab code at top of this code like </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;TabWidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;/TabHost &gt;</code></pre><p>it shows error.and other thing in java file i perform some operations on map when the java is extend with TabActivity those are not working.so,Give me some suggestions for this .Thanks in advance</p>","454808","","1613508","","2013-03-20 08:24:22","2013-03-20 08:35:29","An activity contain both map and tab in android","<android>","2","0","","",""
"2651791","1","2652979","","2010-04-16 09:11:45","3","4053","<p>I have a comprehension question about Android Services. I have a Service that performs background http operations and a Activity that should display the current state of these http operations. </p><p>So I implementet the Binder interface and so on. I can call the bindService method and onServiceConnected of my ServiceConnnection is getting called. But as far as I know, onBind doesn't calls onStartCommand() and so onStart() of the Service is never called.</p><p>So how can I call the onStart() method of the service class and start my operations. Or how is the best way to start my operations in the service, when I also want a binding between the Activity and the Service.</p>","316353","","","","","2010-04-16 12:43:41","Android Service onBind -> onStart","<android><binding><service>","1","0","1","",""
"2651796","1","","","2010-04-16 09:12:36","1","104","<p>Could someone describe to me what happens when an android application is updated? Is it the old version uninstalled and then installed the new one ?  What about the resources the application might need ?</p>","304866","","","","","2010-04-16 11:51:30","details of the update process","<android>","1","0","1","",""
"2651804","1","","","2010-04-16 09:14:09","2","3182","<p>I found several references in the mailinglist archive about Xerces, but it is still not clear to me if it is possible use Xerces succesfully in Android. Could you please provide me this information?</p><p>If the answer is Yes, could you please give me some tips or references on how use Xerces instead of default Android XML parser?</p><p>Thanks in advance for your support</p><p>kind regardsBarbara</p>","318339","","","","","2013-09-17 22:18:15","Xerces on Android","<android>","4","3","2","",""
"2651816","1","2663962","","2010-04-16 09:16:29","12","9018","<p>I'm porting to Android.  My existing project has a ton of resource files that I'm porting into my Android project.  I have them all in /res/raw/, and I would like to access those resources in my native library with functions such as fopen() and such.  Can this be done, or do I have to go through JNI for this as well?  I would really prefer not to, for ease of porting and possible speed and memory reasons.</p>","267391","","","","","2012-08-28 02:50:59","Reading Resource Files from my own APK in Android Native Environment","<android><file-io><android-ndk>","2","0","6","",""
"2651818","1","2659534","","2010-04-16 09:17:05","5","3408","<p>Ok, so I wrote an ExpandableListView and subclassed BaseExpandableListAdapter... Everything works fine except I cannot get the child views to take focus when clicked.  If I use the trackball everything works fine.  But if I try to click on a child I get no feedback whatsoever.</p><p>I have tried setting android:focusable, android:focusableInTouchMode, and android:clickable (and I have also tried setting this via code) but I can't get anything to work.  Any ideas?</p><p>Here is my Adapter code:</p><pre><code>public class ExpandableAppAdapter extends BaseExpandableListAdapter{    private PackageManager m_pkgMgr;    private Context m_context;    private List&lt;ApplicationInfo&gt; m_groups;    private List&lt;List&lt;ComponentName&gt;&gt; m_children;    public ExpandableAppAdapter(Context context, List&lt;ApplicationInfo&gt; groups, List&lt;List&lt;ComponentName&gt;&gt; children)    {        m_context = context;        m_pkgMgr = m_context.getPackageManager();        m_groups = groups;        m_children = children;    }    @Override    public Object getChild(int groupPos, int childPos)     {        return m_children.get(groupPos).get(childPos);    }    @Override    public long getChildId(int groupPos, int childPos)     {        return childPos;    }    @Override    public int getChildrenCount(int groupPos)     {        return m_children.get(groupPos).size();    }    @Override    public View getChildView(int groupPos, int childPos, boolean isLastChild, View convertView, ViewGroup parent)     {        if (convertView == null)        {            LayoutInflater inflater = LayoutInflater.from(m_context);            convertView = inflater.inflate(R.layout.expandable_app_child_row, null);        }        ComponentName child = (ComponentName)getChild(groupPos, childPos);        TextView txtView = (TextView)convertView.findViewById(R.id.item_app_pkg_name_id);        if (txtView != null)            txtView.setText(child.getPackageName());        txtView = (TextView)convertView.findViewById(R.id.item_app_class_name_id);        if (txtView != null)            txtView.setText(child.getClassName());        convertView.setFocusableInTouchMode(true);        return convertView;    }    @Override    public Object getGroup(int groupPos)     {        return m_groups.get(groupPos);    }    @Override    public int getGroupCount()     {        return m_groups.size();    }    @Override    public long getGroupId(int groupPos)     {        return groupPos;    }    @Override    public View getGroupView(int groupPos, boolean isExpanded, View convertView, ViewGroup parent)     {        if (convertView == null)        {            LayoutInflater inflater = LayoutInflater.from(m_context);            convertView = inflater.inflate(R.layout.expandable_app_group_row, null);        }        ApplicationInfo group = (ApplicationInfo)getGroup(groupPos);        ImageView imgView = (ImageView)convertView.findViewById(R.id.item_selection_icon_id);        if (imgView != null)        {            Drawable img = m_pkgMgr.getApplicationIcon(group);            imgView.setImageDrawable(img);            imgView.setMaxWidth(20);            imgView.setMaxHeight(20);        }        TextView txtView = (TextView)convertView.findViewById(R.id.item_app_name_id);        if (txtView != null)            txtView.setText(m_pkgMgr.getApplicationLabel(group));        return convertView;    }    @Override    public boolean hasStableIds()     {        return false;    }    @Override    public boolean isChildSelectable(int groupPos, int childPos)     {        return true;    }}</code></pre><p>Thanks in advance!</p>","249412","","","","","2012-07-18 04:49:40","ExpandableListView child items don't get focus when touched","<android><focus><touch><expandablelistview>","1","3","2","",""
"2651907","1","2652238","","2010-04-16 09:35:45","7","5017","<p>I have a project written for Android devices. It generates a large number of files, each day. These are all text files and images. The app uses a database to reference these files.</p><p>The app is supposed to clear up these files after a little use (perhaps after a few days), but this process may or may not be working. This is not the subject of this question.</p><p>Due to a historic accident, the organization of the files are somewhat naive: everything is in the same directory; a <code>.hidden</code> directory which contains a zero byte <code>.nomedia</code> file to prevent the MediaScanner indexing it.</p><p>Today, I am seeing an error reported: </p><pre><code>java.io.IOException: Cannot create: /sdcard/.hidden/file-4200.html  at java.io.File.createNewFile(File.java:1263)</code></pre><p>Regarding the sdcard, I see it has plenty of storage left, but counting </p><pre><code>$ cd /Volumes/NO_NAME/.hidden$ ls | wc -w9058</code></pre><p>Deleting a number of files seems to have allowed the file creation for today to proceed.</p><p>Regrettably, I did not try <code>touch</code>ing a new file to try and reproduce the error on a commandline; I also deleted several hundred files rather than a handful.</p><p>However, my question is:</p><ul><li>are there hard limits on filesize or number of files in a directory?</li><li>am I even on the right track here?</li></ul><p>Nota Bene:The SD card is as-is - i.e. I haven't formatted it, so I would guess it would be a FAT-* format.</p><p>The FAT-32 format has hard limits of filesize of 2GB (well above the filesizes I am dealing with) and a limit of number of files in the root directory. I am definitely not writing files in the root directory.</p>","4737","","213269","","2010-12-21 16:37:13","2010-12-21 16:37:13","Is there a limit for the number of files in a directory on an SD card?","<java><android><sd-card><ioexception><fat32>","3","0","","",""
"2651915","1","","","2010-04-16 09:36:48","1","588","<p>I use this code:</p><pre><code>ContentValues values = new ContentValues();values.put(ContactsContract.Data.CUSTOM_RINGTONE, Environment.getExternalStorageDirectory().getPath() + ""/ring.wav"");getContentResolver().update(ContactsContract.Contacts.CONTENT_URI, values , ""DISPLAY_NAME = 'Ani'"", null);</code></pre><p>It works great but it play only one time. How do I make it to play in a loop?</p>","309166","","","","","2010-04-16 09:36:48","When I assign ringtone in android using code it won't paly it in a loop, why?","<android><loops><ringtone>","0","2","","",""
"2652109","1","","","2010-04-16 10:17:53","29","28817","<p>I've seen example <strong>com.example.android.apis.view.List11</strong> from ApiDemos. In that example, each row takes the view <strong>android.R.simple_list_item_multiple_choice</strong>. Each such view has a TextView and a CheckBox.</p><p>Now I want each view to have 2 TextView's and 1 CheckBox, somewhat similar to the <strong>List3</strong> example. I tried creating a custom layout file row.xml like this:</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;CheckBox        android:id=""@+id/checkbox""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" /&gt;    &lt;TextView        android:id=""@+id/text_name""        android:textSize=""13px""        android:textStyle=""bold""        android:layout_toLeftOf=""@id/checkbox""        android:layout_alignParentLeft=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;TextView        android:id=""@+id/text_phone""        android:textSize=""9px""        android:layout_toLeftOf=""@id/checkbox""        android:layout_below=""@id/text_name""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt; &lt;/RelativeLayout&gt;</code></pre><p>Then in Activity.onCreate(), I do like this: </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Query the contacts    mCursor = getContentResolver().query(Phones.CONTENT_URI, null, null, null, null);    startManagingCursor(mCursor);    ListAdapter adapter = new SimpleCursorAdapter(this,            R.layout.row,            mCursor,             new String[] { Phones.NAME, Phones.NUMBER},             new int[] { R.id.text_name, R.id.text_phone });    setListAdapter(adapter);    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);}</code></pre><p>The result kind of looks like what I want, but it looks like the list doesn't know which item of it is selected. Also, I need to click exactly on the checkbox. In the List11 example, I only need to click on the item row.</p><p>So what do I need to do to make a multiple choice list with my custom view for each row? Many thanks.</p>","159759","","","","","2013-10-15 14:28:39","Multiple choice list with custom view?","<android><listview><user-interface><custom-view>","8","2","19","",""
"2652414","1","2652629","","2010-04-16 11:13:32","23","59569","<p>I am trying to get the selected items string out of a <code>Spinner</code>. So far I have gotten this:</p><pre><code>bundle.putString(ListDbAdapter.DB_PRI, v.getText().toString());</code></pre><p>This does not work and gives a class casting exception (I thought I could cast a <code>View</code> to a widget that inherits it. Obviously not!) So how do you get the selected value of a <code>Spinner</code>?</p>","318418","","","user1521536","2013-03-27 11:53:55","2013-03-27 11:53:55","How do you get the selected value of a Spinner?","<java><android><spinner>","5","0","6","",""
"2652615","1","","","2010-04-16 11:47:11","0","375","<p>I am trying to enable global search for messaging application (i.e., messages can be searched from home screen search box).  I have followed all the steps given in </p><p><a href=""http://developer.android.com/reference/android/app/SearchManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/SearchManager.html</a></p><p>I am getting the following exception</p><p>04-16 12:49:26.917: ERROR/DatabaseUtils(102): java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.MmsSmsProvider uri content://mms-sms/search_suggest_query/m?limit=58 from pid=106, uid=10000 requires android.permission.READ_SMS</p><p>I have set permission in MmsSmsProvider.java file for read, write sms and global search, but still I get this error.</p><p>Can anyone help.</p><p>Regards,Sunil.</p>","317205","","","","","2014-01-03 05:08:24","Security Exception while implementing global search for Messaging","<android>","1","0","","",""
"2652910","1","","","2010-04-16 12:32:58","1","2346","<p>I need to change or customize the call screen when initiating a call on Android.</p><p>After searching on google I do not find any way to do it.</p><p>There is no way to send DTMF tones during a call, the idea is to send a specific number to the call screen. So when a call is made is possible to see the number to dial during a call to the PBX.</p><p>I tried to putting the number in the ""status bar"", but the notification hide after seconds and it is not practical.</p><p>I appreciate any other suggestion.</p><p>Thanks</p>","318476","","","","","2013-11-15 05:42:11","Change Call Screen","<android><screen><call><customization><dtmf>","2","1","","",""
"2652918","1","","","2010-04-16 12:34:28","2","561","<p>I would like to use Android for Model-Driven-Software-Development.</p><p>For this, I need to locate the Android Model in the SDK. I already searched a while for it, but were not able to find it. Has anyone an idea where it could be?</p><p>Is it possible, that it is the AndroidManifest.xml-File in the folder android-sdk-\platforms\android-x\android.jar? After unpacking this file, I am not able to open that file correctly on Windows XP, because a lot of characters have the wrong character set. </p><p>Or is it also possible, that it is only located in the source code?</p><p>Thanks in advance,Dominik</p>","318477","","","","","2010-12-09 22:15:29","Where is the Android Metamodel located?","<android><mda><mdsd><metamodel>","6","1","1","",""
"2652935","1","2653121","","2010-04-16 12:37:05","6","7433","<p>how can you retrieve yours phone internal storage from an app?  I found memoryinfo, but it seems that returns information on how much memory your currently running tasks.  I am trying to get my app to retrieve how much internal phone storage is available.</p>","274365","","274365","","2010-04-16 12:57:39","2013-02-28 10:11:15","android internal phone storage","<android><memory><storage><phone><internal>","2","0","9","",""
"2653122","1","2653376","","2010-04-16 13:07:35","11","1543","<p>I am entering mobile development.  I have been working primarily in .NET since 1.0 came out in beta.  Before that, I was mostly a C++ and Delphi guy and still dabble in C++ from time to time.  I do web apps quite a bit so I am reasonably proficient with Javascript, JQuery and CSS.  I have also done a few Java applications.  I started web programming with CGI and live mostly in the ASP.NET MVC world these days.</p><p>I am trying to decide on which platform/OS and tool to select.  I am concerned with the size of the market available for my applications as well as the marketibility of the skills I will pick up.  </p><p>The apps I have in mind would work on both phones and pads.  Some aspects of what I have in mind will play better on the bigger screens that will be available on pads.</p><p>Here are the options I am considering:</p><ol><li>Apple iPhone/iPad using pure Apple SDK (Objective-C)</li><li>Apple iPhone/iPad using Mono Touch (C#) </li><li>Android using pure Android SDK (Java)</li><li>Multiple platforms using something like Titanium to generate native apps from web technologies (HTML, CSS and Javascript)</li><li>Multiple platforms using HTML5 web applications that run in the browser (HTML, CSS and Javascript). </li></ol><p>Which option would you choose?  Do you have a different suggestion?  What are the pros and cons?</p>","314649","","121278","","2010-04-16 15:35:24","2010-04-21 02:24:26","Suggestions for entering mobile development -- pure iPhone SDK, Android SDK, Mono Touch or Titanium?","<iphone><android><ipad><monotouch><titanium>","9","0","3","",""
"2653270","1","2653609","","2010-04-16 13:36:27","4","1651","<p>I have a widget on my home screen with several ImageButtons which have default background images. Through the configuration activity, I can change the image on any of the ImageButtons. The problem is that when the screen is rotated, the image on the ImageButton disapears and it changes back to the default image.</p><p>I don't know why this happens or how to fix it</p>","318525","","","","","2010-04-16 14:21:28","Android widget ImageButton loses image when screen is rotated","<android><background><rotation><widget><imagebutton>","1","0","1","",""
"2653271","1","3216931","","2010-04-16 13:36:35","3","4542","<p>Is it possible to have an EditText that allows multilines and doesn't show the suggestions? I tried with this code:</p><pre><code>android:inputType=""textFilter|textMultiLine""</code></pre><p>Which I saw in this <a href=""http://stackoverflow.com/questions/1959576/turn-off-autosuggest-for-edittext"">question</a>, but it didn't work for me. If I try to use both at the same time, the EditText supports multiline, but the suggestions appear. Separately, they work properly.</p><p>Is this a bug in the SDK? Or maybe it is not possible to combine them?</p><p>Thanks!</p>","316477","","","","","2013-04-12 11:27:29","Android: Multiline & No autosuggest in EditText","<android><edittext>","4","0","1","",""
"2653597","1","2653657","","2010-04-16 14:19:54","4","1281","<p>Unlike the iPhone simulator, the Android emulator doesn't look like an Android device.</p><p>If you have to create a screencast or promotional video of your Android application, the default skin of the emulator is no good.</p><p>Is there any way to configure the emulator to look like an Android device? If you have dealt with this already, what other things do you recommend taking into account to record an emulator screencast?</p><p>Not a programming question per se, but an useful question for Android developers.</p>","143378","","","","","2010-04-16 14:25:53","Recording a screencast of an Android app using the emulator","<android><emulator>","1","2","1","",""
"2653830","1","2653886","","2010-04-16 14:47:56","1","1524","<p>I am writing a android application where, on startup activity view, I have a button ""DoIt"". When user clicks ""DoIt"" button, I start another activity with different layout. On newly started activity, I have a button ""Back"" which should take me to the first activity. How to accomplish this. What code should I write on OnClick method of ""Back"" button. Also, I want the newly created activity to die after back button is pressed and application comes back to start-up activity.</p>","248132","","","","","2011-08-17 16:46:28","Moving between android activities on button clicks","<android>","3","0","","",""
"2653923","1","","","2010-04-16 14:57:50","3","2199","<p>I have a problem interacting with a Web View. I'm showing an html login form within a web view and I can't type inside of any of the input fields of the forms. I do can interact with the links, select boxes, buttons, etc.</p><p>Here is an example of my code. Basically I'm retrieving the web view from the xml and setting it a WebViewClient and a WebChromeClient.</p><pre>webview = (WebView) findViewById(R.id.loginWebview);webview.getSettings().setJavaScriptEnabled(true);WebViewClient client = new WebViewClient();webview.setWebViewClient(client);webview.setWebChromeClient(new WebChromeClient());webview.loadUrl(""http://www.google.com"");</pre><p>Any ideas?</p>","267779","","","","","2010-11-18 11:11:48","Can't type inside a Web View","<android><android-widget>","1","2","1","",""
"2653954","1","2654241","","2010-04-16 15:02:07","6","5310","<p>I'm just getting started with android programming, and want to see if there is a way to programmatically set the lock screen image. I've found various ways of setting the wallpaper in the API, but I can't seem to find the equivalent ways of setting the lock screen image.</p><p>I've seen various posts saying that customising the lock screen by adding widgets or bits of applications is not possible, but surely there must be a way to set the image programmatically?</p><p>Cheers,</p><p>Robin</p>","1912","","","","","2010-04-16 15:36:03","How to set android lock screen image","<java><android><image><wallpaper>","2","0","1","",""
"2654063","1","2654087","","2010-04-16 15:14:28","0","825","<p>All I'm trying to do is open a very simple application that is supposed to do nothing but display an imageView above a textView. The application worked fine until I added the imageView so I'm assuming my problem has something to do with that.</p><p>Here is the code:</p><pre><code>package com.isi.sa;import android.app.Activity;import android.os.Bundle;public class SimpleAssessment extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);    }}</code></pre><p>Here is my 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;ImageView        android:layout_width=""fill_parent""        android:src=""@drawable/isi_logo""/&gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:text=""@string/hello""        android:background=""@color/white""        android:textColor=""@color/black""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When I try and run the app in Eclipse through the Emulator the emulator gives me the following error:</p><pre><code>The application Application Name (process.com.isi.sa) has stopped unexpectedly. Please try again.</code></pre><p>The Console log in Eclipse shows the following messages:</p><pre><code>[2010-04-16 11:08:44 - SimpleAssessment] ------------------------------[2010-04-16 11:08:44 - SimpleAssessment] Android Launch![2010-04-16 11:08:44 - SimpleAssessment] adb is running normally.[2010-04-16 11:08:44 - SimpleAssessment] Performing com.isi.sa.SimpleAssessment activity launch[2010-04-16 11:08:44 - SimpleAssessment] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'[2010-04-16 11:08:44 - SimpleAssessment] Launching a new emulator with Virtual Device 'my_avd'[2010-04-16 11:08:47 - SimpleAssessment] New emulator found: emulator-5554[2010-04-16 11:08:47 - SimpleAssessment] Waiting for HOME ('android.process.acore') to be launched...[2010-04-16 11:09:31 - SimpleAssessment] WARNING: Application does not specify an API level requirement![2010-04-16 11:09:31 - SimpleAssessment] Device API version is 3 (Android 1.5)[2010-04-16 11:09:31 - SimpleAssessment] HOME is up on device 'emulator-5554'[2010-04-16 11:09:31 - SimpleAssessment] Uploading SimpleAssessment.apk onto device 'emulator-5554'[2010-04-16 11:09:31 - SimpleAssessment] Installing SimpleAssessment.apk...[2010-04-16 11:10:04 - SimpleAssessment] Success![2010-04-16 11:10:04 - SimpleAssessment] Starting activity com.isi.sa.SimpleAssessment on device [2010-04-16 11:10:09 - SimpleAssessment] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.isi.sa/com.isi.sa.SimpleAssessment} }</code></pre><p>Thanks in advance for the help!</p>","198116","","","","","2010-04-16 15:17:01","Android App Fails To Launch","<android><android-emulator><imageview>","1","1","","",""
"2654168","1","","","2010-04-16 15:26:32","12","4625","<p>Is there any way to catch crashes in my own android app? Something like a global uncaught exception handler? Just wondering if I could install something like that, then if an uncaught exception is thrown, I could pop up a dialog for the user and ask if they want to mail a dump of the exception to me.</p><p>Thanks</p>","246114","","","","","2012-08-28 06:42:38","Global uncaught exception handler -> email log to me?","<android>","5","0","5","",""
"2654258","1","","","2010-04-16 15:38:03","0","336","<pre><code>Cursor cursor = db.rawQuery(""SELECT COUNT(rat)                                FROM ""+ TABLE_NAME_EXTRA +"" apkid=\""""+apkid, null);cursor.moveToFirst();int somatotal = cursor.getInt(0);</code></pre><p>I'm trying to do a SQL function like count and sum, but this code returns a exception saying ""emptyvalues"".</p><p>anyone know why?</p>","309897","","135152","","2010-04-16 15:41:42","2010-04-16 16:29:57","SQl function in android","<java><sql><android>","1","6","","",""
"2654907","1","2656019","","2010-04-16 17:15:31","0","1282","<p>This is related to my previous post: <a href=""http://stackoverflow.com/questions/2649422/android-test-app-on-a-real-device"">http://stackoverflow.com/questions/2649422/android-test-app-on-a-real-device</a></p><p>Here is what I did: followed every step to create keystore, sign, zipalign, versioning, labeling and naming my app. Resulted in an .apk file.</p><p>Upload my file to tomcat/webapps/ROOT/myapp.apk</p><p>changed tomcat/conf/web.xml by adding</p><pre><code>&lt;mime-mapping&gt;&lt;extension&gt;apk&lt;/extension&gt;&lt;mime-type&gt;application/vnd.android.package-archive&lt;/mime-type&gt;</code></pre><p></p><p>Restarted tomcat and send the link to my client.</p><p>After my client downloaded the app, it shows ""parsing error"".</p><p>What could be the cause? I did not rename my app, it is the same as the project name.</p>","253800","","","","","2010-04-16 20:46:44","android: error parsing apk from tomcat server","<android><tomcat><mime><publishing>","1","4","","",""
"2655402","1","2657684","","2010-04-16 18:49:25","22","58683","<p>I have a view, I'm drawing with the Canvas object in the onDraw(Canvas canvas) method. My code is:</p><pre><code>Paint paint = new Paint();paint.setColor(Color.WHITE);paint.setStyle(Style.FILL);canvas.drawPaint(paint);paint.setColor(android.R.color.black);paint.setTextSize(20);canvas.drawText(""Some Text"", 10, 25, paint);</code></pre><p>The problem is the text doesn't show through the background, what am I doing wrong? If I remove the canvas.drawPaint(paint) and paint.setColor(android.R.color.black) you can see the text on the screen.....</p>","119396","","","","","2010-04-17 07:52:22","Android Canvas.drawText","<android><canvas><drawtext>","1","0","7","",""
"2655825","1","2656275","","2010-04-16 20:10:56","0","2000","<p>I'm pretty new to android. I want to create a table in my Wapplication that will have three columns. Once column would have string, another would have a image and last column would have a integer. Again, I want to have table rows selectable. Can this be achieved by extending ListActivity ?  What is the best to way to create such a table in android ?</p>","248132","","","","","2010-04-16 21:46:38","Using listactivity view to create table in android","<android>","2","0","1","",""
"2655972","1","","","2010-04-16 20:40:20","19","20901","<p>I want to display pdf contents on webview.Here is my code:</p><pre><code>WebView webview = new WebView(this); setContentView(webview);webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl(""http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf"");</code></pre><p>I am getting a blank screen. I have set internet permission also.</p>","307289","","1368721","","2014-02-07 08:03:14","2014-02-07 08:03:14","How can I display a pdf document into a Webview?","<android><pdf><webview>","3","0","13","",""
"2656156","1","","","2010-04-16 21:18:02","0","302","<p>This is a simple question about getting started with developing Android apps using Eclipse.  I have followed all the tutorials on the developer site for installing Eclipse, the SDK and the ADT plugin.  When trying to run a simple Hello World program, everything seems to compile correctly, but then the virtual machine comes up empty.  In the Console Window it reads:    </p><p>The program then just sits and my text never comes up.  Any idea with what the problem could be?</p>","318901","","","","","2010-04-16 22:38:20","I can't get my Android program to run correctly on an AVM in Eclipse","<android>","1","0","","",""
"2656239","1","2656296","","2010-04-16 21:37:40","1","1295","<p>In my android app I have a Tabhost with a ListView as one of the tabs.  By clicking on an item in the ListView (an address) I start an Intent to Google Maps for directions and the choice dialog pops up for google maps, web browser etc.  Problem is if I press the hard back button then the launch dialog goes away but also the ListView is cleared.  Any idea why?</p>","297762","","","","","2010-04-16 21:51:29","Android ListView clears when hard BACK key is pressed","<android><listview>","1","1","2","",""
"2656330","1","","","2010-04-16 22:00:39","1","760","<p>I'm wondering if anyone out there has used xdpi and ydpi and gotten the actual physical dpi of the device?</p><p>Thanks</p>","318920","","","","","2011-11-23 17:46:33","Has anyone used xdpi, ydpi and gotten correct results","<android>","2","0","1","",""
"2656554","1","2680139","","2010-04-16 23:09:04","0","500","<p>I have a broadcast receiver that listens for incoming calls, then displays a popup. The popup is a dialog type of theme and has FLAG_NOT_FOCUSABLE and FLAG_NOT_TOUCHABLE - basically, it's an informational window that goes away after x seconds, and is not meant to interfere or take focus over anything else.</p><p>The issue is that the incoming call intent, built into android, is getting the broadcast <em>after</em> my intent. This is causing that window to be stacked in front of mine. How to I get my window to always be on top?</p><p>Thanks! </p>","318953","","","","","2011-06-09 09:21:29","Implement a top level window from a broadcast receiver","<android>","1","0","","",""
"2656595","1","2660825","","2010-04-16 23:26:13","1","11266","<p>I've been trying for a couple hours now, and have hit all of the sites Google found, but i cannot get the Android USB driver on my XP box to talk to my new Xperia X10a. I found the lines that some kind soul posted, and has been syndicated repeated, but they don't work for me. The idea is to add them to the <code>Google.NTx86</code> and <code>Google.NTamd64</code> sections of the <code>android_winusb.inf</code> file:</p><pre><code>;Xperia X10%SingleAdbInterface%        = USB_Install, USB\VID_0FCE&amp;PID_E12E%CompositeAdbInterface%     = USB_Install, USB\VID_0FCE&amp;PID_E12E&amp;MI_01</code></pre><p>I tried a number of variations of the first line, including <code>Sony Ericsson X10a</code>, which is what XP shows me in both the ""found new hardware"" wizard and the device manager, but no luck. The result is always the same. Here are my steps:</p><ul><li>Plug in the phone via USB</li><li>""found new hardware wizard"" appears</li><li>Choose ""No, not this time"" and ""next""</li><li>Choose ""Install from a list or specific location..."" and ""next""</li><li>Choose ""Search for best driver..."", check ""Include this location..."", and browse for the ""usb_driver"" folder in the Android SDK installation. Click ""next""</li></ul><p>It does a quick search and then says ""Cannot install this hardware"", ""... because the wizard cannot find the necessary software"". </p><p>I've tried more things that i can recall now, including deleting registry entries, but it just won't work. Any help would be appreciated at this point.</p>","318961","","1337","","2012-01-25 21:28:47","2012-01-25 21:28:47","Android USB driver for Xperia X10a","<android>","5","0","3","",""
"2656826","1","","","2010-04-17 01:04:56","0","368","<p>How to move horizontal scroll by giving size to left or right using programmable way?Is it possible ?</p><p>Thanks in advance.</p>","164589","","164589","","2010-04-17 01:17:19","2010-04-17 01:17:19","How to move horizontal scroll giving size to left or right?","<android>","0","3","","",""
"2656999","1","2658094","","2010-04-17 02:39:59","2","6653","<pre>[2010-04-16 23:31:34 - MobileDataKeeper] Error in an XML file: aborting build.[2010-04-16 23:31:57 - MobileDataKeeper] Error in an XML file: aborting build.[2010-04-16 23:32:28 - MobileDataKeeper] Error in an XML file: aborting build.[2010-04-16 23:34:56 - MobileDataKeeper] Error in an XML file: aborting build.[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.xml:0: error: Resource entry main is already defined.[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0: Originally defined here.[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.xml:0: error: Resource entry main is already defined.[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0: Originally defined here.[2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.out.xml:1: error: Error parsing XML: no element found[2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.xml:1: error: Error parsing XML: no element found[2010-04-16 23:35:49 - MobileDataKeeper] Error in an XML file: aborting build.</pre><p>Main.xml.out.* are empty. The MobileDataKeeper.java is default and the Mainx.xml out is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&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;</code></pre><p>Every time i change something in the Main.xml get this problem. It's very frustrating and I don't know what the heck is going on. A trained eye is requiered!</p><p>Thanks!</p>","162414","","","","","2011-08-31 00:46:57","Error starting an Android program","<android><compiler-errors>","3","1","","",""
"2657105","1","","","2010-04-17 03:27:45","1","1187","<p>I have an Android live wallpaper that I suspect is leaking memory, probably either textures or vertex arrays.  I'm calling glDeleteTextures on my texture IDs, but don't see any sort of equivalent for my vertex buffers.  I'd like to be able to be sure both my textures and buffers are getting unloaded by OpenGL, am i missing something?</p><p>The documents I've found seem to suggest OpenGL just works it out on its own, but that's not giving me a lot of comfort.</p>","319036","","44729","","2010-04-17 03:48:59","2010-04-17 17:36:07","Unloading vertex buffers in OpenGL","<android><opengl-es><unload><buffer>","3","0","","",""
"2657134","1","2658141","","2010-04-17 03:42:14","0","843","<p>I am writing for Android, and  I can't figure out how to replicate the effect of the Android browser where the progress bar is at the top of the screen, with the webview below it, yet when you scroll down, the bar scrolls with the page.</p><p>I've tried placing both the webview and the progress bar into a scrollview, but when I do that, the webview becomes completely unresponsive and will not load (or respond to any commands, for that matter).</p><p>Any help would be greatly appreciated.</p><p>Thanks!</p><p>P.S., I'm using the Eclipse IDE, and I'd like to to continue using the 1.5 SDK if possible to maintain backwards compatibility (and just to be able use my own application -- my phone isn't getting 2.1 for a couple of months).</p>","253567","","","","","2010-04-17 11:08:44","Replicate behavior of Android browser","<android><webview><scrollview><android-webview>","2","0","","",""
"2657272","1","","","2010-04-17 04:46:01","1","708","<p>I am facing to a problem related virtual keyboard.</p><p>I've created a layout that contains Button, TextView and EditText. </p><p>When its screen orientation is Portrait, it can show the Virtual Keyboard by one touching on the EditText.</p><p>Then I've changed screen orientation to Landscape. At this moment Virtual Keyboard hasn't been appeared. </p><p>What is wrong here ?</p><p>How to fix it ?</p><p>I think this is big problem for my application.</p><p>Please help. guys.</p><p>Thanks.</p>","164589","","","","","2010-04-17 05:19:38","Virtual Keyboard doesn't appear when rotate the screen?","<android><layout>","1","0","","",""
"2657348","1","2657640","","2010-04-17 05:17:21","34","12967","<p>When I execute the command </p><p><code>adb logcat</code> </p><p>while running the android emulator, all of the old logs blow past and so I figure they are stored in a file somewhere. Is there a command I can run to clear the logs and start fresh? If not, is there some other way to do this?</p>","43792","","1525300","","2012-08-23 19:10:59","2012-08-23 19:10:59","How can I erase the old data from logcat?","<android><android-emulator><logcat>","1","0","6","",""
"2657490","1","","","2010-04-17 06:24:04","0","591","<p>I want Access a single Activity using 2 different tabs.For Ex I have a single Activity like People and  two tabs those names are tab1 and tab2.when i click on tab1 I want to display the people page as my group and when i click on tab2 that same page displayed the show all title.That means I want to Access a single Intent for two tabs In the same way the Information in that Activity is displayed According to Tab.For this purpose what can i do?Give me some suggestions.Thanks in advance.</p>","454808","","","","","2010-04-17 14:16:44","TabHost Problem in android","<android>","2","0","","",""
"2657766","1","2660337","","2010-04-17 08:26:29","3","755","<p>How can I reduce the power usage in my application?  What code can I use to implement this?</p>","254790","","144669","","2011-06-28 17:20:27","2011-06-28 17:20:27","How can I reduce power usage in a location-based Android application?","<android>","1","0","3","",""
"2657827","1","","","2010-04-17 08:50:53","0","4445","<p>I am using <code>MediaStore.Images.Media.insertImage(ContentResolver cr, String imagePath, String name, String description)</code> function to insert a newly created image into gallery. System is naming the file by default, but it's diferent than names of pictures taken by orginal app (Time stamp). Is there easy way to set it up? </p>","319136","","1108213","","2012-03-18 19:16:24","2013-05-22 14:58:50","File name after MediaStore.Images.Media.insertImage","<java><android><image><rename>","3","0","","",""
"2658036","1","2658086","","2010-04-17 10:26:02","0","671","<p>I have checked the regional settings in my emulator and I can't yet choose Hungarian.I am wondering how can I make my application to work in hungarian? How do I set what language to use?</p>","243782","","243782","","2010-04-17 10:47:00","2013-09-17 07:59:59","How to use Android in hungarian?","<android>","2","0","","",""
"2658253","1","2719395","","2010-04-17 11:54:18","3","570","<p>Is there anything the Dalvik VM supports (in terms of bytecode) which is not used currently because the .class files don't have it?</p><p>As an example, if people would write their own Source-to-DX converter for their functional language XYZ, would they be able to implement e. g. full tail calls although the .class file does support tail calls only under certain circumstances?</p>","297776","","","","","2010-04-27 07:21:23","Does the Dalvik file format (*.dx) support more instructions than a Java .class file?","<android><class><format><bytecode><dalvik>","1","0","1","",""
"2658439","1","2658550","","2010-04-17 13:06:25","2","485","<p>I'm working on a project with a group that is using Eclipse, but I'm using Netbeans. Up until today this wasn't an issue. When updating from the repo they have added some source code as a library under a directory called <code>/lib-src</code>. When I try to compile the code I get an error that it can't find certain packages... these are the packages under <code>/lib-src</code>.</p><p>Using NetBeans I can add the library as a folder so now the references to those packages are happy. However, I'm getting this new error when compiling:</p><pre><code>UNEXPECTED TOP-LEVEL ERROR:java.lang.OutOfMemoryError: Java heap space    at java.util.HashMap.addEntry(HashMap.java:753)    at java.util.HashMap.put(HashMap.java:385)    at com.android.dx.dex.file.ClassDataItem.addStaticField(ClassDataItem.java:134)    at com.android.dx.dex.file.ClassDefItem.addStaticField(ClassDefItem.java:280)    at com.android.dx.dex.cf.CfTranslator.processFields(CfTranslator.java:159)    at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:130)    at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)    at com.android.dx.command.dexer.Main.processClass(Main.java:297)    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)    at com.android.dx.command.dexer.Main.access$100(Main.java:56)    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:134)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)    at com.android.dx.command.dexer.Main.processOne(Main.java:245)    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)    at com.android.dx.command.dexer.Main.run(Main.java:139)    at com.android.dx.command.dexer.Main.main(Main.java:120)    at com.android.dx.command.Main.main(Main.java:87)/home/aaron/NetBeansProjects/xbmc-remote/nbproject/build-impl.xml:411: exec returned: 3BUILD FAILED (total time: 1 minute 25 seconds)</code></pre><p>I can include the build-impl.xml file if you need it, but I don't think that is main issue.</p><p>Any ideas?</p>","43792","","","","","2010-04-18 11:36:36","NetBeans not liking libraries in lib-src","<java><android><eclipse><netbeans>","2","2","","",""
"2658772","1","2659038","","2010-04-17 14:57:01","43","48063","<p>I'm trying to figure out how to define a vertical line (1dp thick) to be used as a drawable.</p><p>To make a horizontal one, it's pretty straightforward:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""line""&gt;    &lt;stroke android:width=""1dp"" android:color=""#0000FF""/&gt;    &lt;size android:height=""50dp"" /&gt;     &lt;/shape&gt;</code></pre><p>The question is, how to make this line vertical?</p><p>Yes, there are workarounds, such as drawing a rectangle shape 1px thick, but that complicates the drawable XML, if it consists of multiple <code>&lt;item&gt;</code> elements.</p><p>Anyone had any chance with this?</p><p><strong>UPDATE</strong></p><p>Case is still unsolved. However,For anyone on a Android documentation crusade - you might find this useful:<strong><a href=""http://idunnolol.com/android/drawables.html"">Missing Android XML Manual</a></strong> </p><p><strong>UPDATE</strong></p><p>I found no other way other than the one that I marked as correct. It does the trick though feels a bit ""heavy"", thus if you happen to know the answer don't forget to share ;)</p>","55583","","56285","","2013-12-30 13:51:24","2013-12-30 13:51:24","Vertical line using XML drawable","<android><android-layout><line><android-xml><android-drawable>","8","0","22","",""
"2658945","1","2659216","","2010-04-17 15:41:22","0","427","<p>In Android, I have some code to check whether the user has GPS switched on, and launch the Settings for them to turn it on if they don't. It looks like this:</p><pre><code>private void buildAlertMessageNoGps() {    final AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder    .setMessage(    ""Your GPS seems to be disabled - you need it to get a location fix. Turn it on now?"")    .setCancelable(false).setPositiveButton(""Yes"",            new DialogInterface.OnClickListener() {        public void onClick(                @SuppressWarnings(""unused"") final DialogInterface dialog,                @SuppressWarnings(""unused"") final int id) {            Intent j = new Intent();            j.setAction(""android.settings.LOCATION_SOURCE_SETTINGS"");            startActivity(j);        }    }).setNegativeButton(""No"",            new DialogInterface.OnClickListener() {        public void onClick(final DialogInterface dialog,                @SuppressWarnings(""unused"") final int id) {            dialog.cancel();        }    });    final AlertDialog alert = builder.create();    alert.show();}</code></pre><p>However, I'm finding that if the user opens the Settings, turns GPS on, then carries on using the app as normal, there is an odd problem. Often, when the user reopens the app, the Settings are at the front. How can I set them so they don't keep reappearing?</p><p>I wonder if I should be using the CLEAR_TOP flag or something similar... I've tried looking at the docs for the Activity flags but find them a bit confusing. Anyone know?</p>","267831","","","","","2010-04-17 17:00:26","Android: stop activity appearing when an app is reopened?","<android>","1","0","","",""
"2658985","1","2659500","","2010-04-17 15:52:13","2","2833","<p>According to the instructions found <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">here</a>, to make your app state which screen sizes you can support, you'll need to compile your app against Android 1.6.</p><p>Using the minSdkVersion and targetSdkVersion this should run also on Android 1.5:</p><pre><code>  &lt;uses-sdk android:minSdkVersion=""3""           android:targetSdkVersion=""4""/&gt;</code></pre><p>However, when I try to launch my app from Eclipse to run in a emulated 1.5, I get the following error:</p><pre><code> Failed to find an AVD compatible with target 'Android 1.6'.</code></pre><p>Is this an error of the eclipse tools/emulator? Or how do I get it to also target 1.5 correctly while giving me the option to specify the supported screens?</p>","107029","","102703","","2010-04-17 18:25:33","2010-04-17 18:31:41","Android: How to maintain backwards-compatibility?","<android><eclipse><android-emulator><backwards-compatibility>","1","2","1","",""
"2659148","1","2659469","","2010-04-17 16:39:34","1","1902","<p>I'm planning on doing a application for Android 2.1 that changes song every minute (through what I hope exists in Android, ""next"") for the application using the audio device atm.</p><p>So if I have <a href=""http://www.spotify.com"" rel=""nofollow"">Spotify</a> running in background already, playing music, can I through my program change to the next track?</p><p>Let me know if I was unclear about anything.Thanks in advance!</p>","59329","","2951","","2010-04-17 17:01:07","2012-01-08 22:39:05","Possible to skip track from an Android application?","<java><android><spotify>","3","0","2","",""
"2659215","1","","","2010-04-17 16:59:30","2","447","<p>I am using a scrollview in my application. I want to know how can it be possible to change the default appearance of a scrollview(i.e a line) to something different, maybe an image or arrows in android.</p><p>Any kind of help or hint would be highly appreciated.</p><p>Thanks in advance,HM </p>","315782","","143804","","2010-04-17 17:06:01","2010-04-17 18:25:41","how to change the default look of a scrollview in android?","<android><scrollview>","1","1","","",""
"2659372","1","2659449","","2010-04-17 17:44:24","2","581","<p>I'm searching for some good material on android threads but I couldn't find references for a complete description about this subject. So if you know any valuable reference please point them to me.</p>","284609","","","","","2013-02-09 04:36:38","android threads","<android>","1","0","1","",""
"2659770","1","","","2010-04-17 19:49:33","5","5237","<p>I have a map in my android application that shows many markers (~20-50). But the app performs very poor when i try to scroll/zoom (in Google Android Maps i did a sample search for pizza and there were also some 20-50 results found and i didn't notice any particular performance problems when zooming/scrolling through the map).</p><p>Here is my (pseudo)code:</p><pre><code>onCreate() {    ....    drawable = this.getResources().getDrawable(R.drawable.marker1);    itemizedOverlay = new MyItemizedOverlay(drawable,mapView);    ...    callWebServiceToRetrieveData();    createMarkers();}createMarkers(){    for(elem:bigList){        GeoPoint geoPoint = new GeoPoint((int)(elem.getLat()*1000000), (int) (elem.getLon()*1000000));        OverlayItem overlayItem = new OverlayItem(geoPoint, elem.getName(), elem.getData());        itemizedOverlay.addOverlay(overlayItem);        mapOverlays.add(itemizedOverlay);}mapView.invalidate();</code></pre><p>}</p><p>the MyItemizedOverlay.addOverlay looks like this:</p><pre><code>public void addOverlay(OverlayItem overlay) {    m_overlays.add(overlay);    populate();}</code></pre>","309871","","","","","2011-11-14 09:06:45","Android Map Performance poor because of many Overlays?","<android><performance><map><overlay>","3","0","4","",""
"2659898","1","2659977","","2010-04-17 20:19:07","4","597","<p>I have a few separate applications which are all launched purely through a main application. </p><p>I am wondering if I'd be able to use intents to retrieve a list of all the sub-applications which match some discovery intent.</p><p>The main application currently needs to know what Intents to use to START these sub-applications, but is there a way to use intents to see if other Activities on the device match a set of intent-filters?</p>","231768","","114066","","2010-08-02 07:43:14","2010-08-02 07:43:14","How to list Activities which match an intent?","<android><android-intent><intentfilter>","1","0","3","",""
"2659906","1","2660141","","2010-04-17 20:22:20","0","442","<p>I just want to check if I understood well the way asynchronous Http request work on Android.Suppose I make such a request and set a <code>ResponseHandler&lt;String&gt; responseHandler</code> to handle the response. By doing this is it possible to have the UI thread blocked waiting for the response ? The implication being that the code in the function:</p><pre><code>public String handleResponse(HttpResponse response)</code></pre><p>is also executed on the UI thread or is there silently spawned a thread that waits for the response and calls the handleResponse(HttpResponse response) function  when the response arrives ? </p>","284609","","","","","2010-04-17 21:27:02","question about asynchronous http","<android>","1","0","1","",""
"2659954","1","2660148","","2010-04-17 20:33:07","11","10324","<p>I have a TimePickerDialog  with is24Hour set to false since I want to present the end-user with the more familiar 12 hour format. When the hour, minute and AM PM indicator are set and the time is returned how can I identify whether the end-user has selected AM or PM?</p><p>This is what I have for the listener:</p><pre><code>private TimePickerDialog.OnTimeSetListener mTimeSetListener =      new TimePickerDialog.OnTimeSetListener() {    @Override    public void onTimeSet(TimePicker view, int hourOfDay,       int minute) {     mHour = hourOfDay;     mMinute = minute;    // mIsAM = WHERE CAN I GET THIS VALUE    }};</code></pre>","312443","","1288","","2012-06-11 17:38:33","2013-02-20 10:49:35","TimePickerDialog and AM or PM","<android><timepicker>","3","0","9","",""
"2659987","1","2660021","","2010-04-17 20:41:26","1","1168","<p>I wanna change APN settings in a phone. Looked the api and there is a content provider named ACTION_APN_SETTINGS</p><p>developer.android.com/reference/android/provider/Settings.html#ACTION_APN_SETTINGS</p><p>but i'm having a hard time figuring out how to use it. Is there any example or something that does not involve the ""contacts"" content provider?</p><p>Thanks.</p>","162414","","","","","2011-03-17 16:08:13","Trying to understand setting content providers in Android","<android><android-contentprovider>","1","0","","",""
"2660081","1","2660144","","2010-04-17 21:06:14","17","8114","<p><strong>Edit</strong>: I voted to close this question as it is off-topic. I asked it when I didn't know any better.</p><p>What's your experience distributing Android apps outside of the Android Market?</p><p>Which alternative markets an Android developer should consider? Any success/horror stories?</p>","143378","","143378","","2013-03-28 09:02:49","2014-03-27 07:23:47","Distributing Android apps outside of the Android Market","<android><distribution><google-play>","6","2","15","2013-03-28 12:23:32","2010-04-17 21:06:25"
"2660605","1","2660923","","2010-04-18 00:23:17","0","121","<p>I have to make a simple layout in android but have problem with the heigh of the central element. basically I have a header, a body and a footer. header and footer have fixed height but I'd like the body to fill the remaining space. this should be screen size independent so I'd like the height of the body to be dynamically worked out when the layout is being rendered. </p><p>do you guyz know how I can achieve the result?</p><p>thanks</p>","87624","","","","","2010-04-18 03:52:34","height worked out dynamically at rendering time","<android>","3","0","","",""
"2660613","1","2660696","","2010-04-18 00:27:32","2","6788","<p><strong>Is it possible to stop all started services when the user hits the Home Button?</strong></p><p>I use:</p><pre><code>startService(new Intent(ClassName.this, ClassName2.class));stopService(new Intent(ClassName.this, ClassName2.class));</code></pre><p>This means I will have to somehow add the 'stopService()' for 7+ of my app classesI've researched this topic and I think there's 'onTerminate' but still not sure how this should be implemented.</p><p>Any help or hints would be appreciated!Thanks!</p>","203111","","","","","2010-04-18 07:52:28","Stop All Started Services on App Close / Exit","<android>","2","0","3","",""
"2660806","1","","","2010-04-18 01:56:53","3","3127","<p>i'm trying to use</p><pre><code>SQLiteDatabase.openDatabase(    ""/data/data/edwin11.myapp/databases/myapp.db"", null, (SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.NO_LOCALIZED_COLLATORS));</code></pre><p>to create/open a database instead of making use of the SQLiteOpenHelper (because i want to pass in the flag <code>SQLiteDatabase.NO_LOCALIZED_COLLATORS</code>.</p><p>However, i am getting this exception for that line of code:</p><pre><code>04-18 09:50:03.585: ERROR/Database(3471): sqlite3_open_v2(""/data/data/edwin11.myapp/databases/myapp.db"", &amp;handle, 6, NULL) failed04-18 09:50:03.665: ERROR/AndroidRuntime(3471): java.lang.RuntimeException: An error occured while executing doInBackground()04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at android.os.AsyncTask$3.done(AsyncTask.java:200)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at java.lang.Thread.run(Thread.java:1060)04-18 09:50:03.665: ERROR/AndroidRuntime(3471): Caused by: android.database.sqlite.SQLiteException: unable to open database file04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1584)04-18 09:50:03.665: ERROR/AndroidRuntime(3471):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)...</code></pre><p>Doing some testing just before that line of code (using <code>File.isExists</code>) shows that the file <code>/data/data/edwin11.myapp/databases/myapp.db</code> does not exist.</p><p>Would that be the cause of the error? (Or am i just using <code>SQLiteDatabase.openDatabase</code> the wrong way?)</p><p>Would it help if i create the file beforehand? (Shouldn't that be taken care of by the <code>SQLiteDatabase.CREATE_IF_NECESSARY</code> flag that i passed in?)</p><p>If creating the file manually is the way to go, is it just an empty file, or do i have to write something to it?</p><p>Thanks and Regards.</p>","254959","","","","","2011-11-29 08:16:52","Android - How to Use SQLiteDatabase.open?","<android>","2","0","1","",""
"2660935","1","2661034","","2010-04-18 02:54:13","2","968","<p>For an example of what I'm looking for, hit the Home button while you're composing a message in the Gmail app. A little message will pop up at the bottom of the screen for a moment that says ""Message saved as Draft.""</p><p>I can't figure out how to display one of those messages myself, and I'm not sure what to call it so I can't do a search for it.</p>","319506","","101318","","2011-05-19 18:36:39","2011-05-19 18:36:39","How to display a non-modal, temporary pop-up message in Android?","<android>","1","0","","",""
"2660946","1","2662286","","2010-04-18 02:57:49","3","8049","<p>I have used a bit of Android code to override the ""Done"" button in my EditText field:</p><pre><code>   myEditField.setOnEditorActionListener(new TextView.OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            if (actionId == EditorInfo.IME_ACTION_DONE) {                mySubroutine();                return true;            }            return false;        }    });</code></pre><p>Activating the field calls up the keyboard, and pressing ""Done"" evaluates mySubroutine() successfully. However, the keyboard no longer goes away when I press ""Done"". How do I restore this default behaviour to the routine?</p>","317172","","","","","2012-10-24 13:39:44","Android: Hiding the keyboard in an overrided ""Done"" keypress of EditText","<android><override><edittext>","3","0","3","",""
"2660968","1","2681792","","2010-04-18 03:09:23","34","37948","<p>This problem has been solved! Thanks a lot to Brad, Denis and junkie! You're the heroes! :)</p><p>This is the working code. It connects to Zeemote and reads data from it.</p><h2>===== Code =====</h2><pre>public class ZeeTest extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            for (int i = 0; i &lt; 3; i++) {                test();            }        } catch (Exception e) {            e.printStackTrace();        }    }    private boolean connected = false;    private BluetoothSocket sock;    private InputStream in;    public void test() throws Exception {        if (connected) {            return;        }        BluetoothDevice zee = BluetoothAdapter.getDefaultAdapter().            getRemoteDevice(""00:1C:4D:02:A6:55"");        Method m = zee.getClass().getMethod(""createRfcommSocket"",            new Class[] { int.class });        sock = (BluetoothSocket)m.invoke(zee, Integer.valueOf(1));        Log.d(""ZeeTest"", ""++++ Connecting"");        sock.connect();        Log.d(""ZeeTest"", ""++++ Connected"");        in = sock.getInputStream();        byte[] buffer = new byte[50];        int read = 0;        Log.d(""ZeeTest"", ""++++ Listening..."");        try {            while (true) {                read = in.read(buffer);                connected = true;                StringBuilder buf = new StringBuilder();                for (int i = 0; i &lt; read; i++) {                    int b = buffer[i] & 0xff;                    if (b &lt; 0x10) {                        buf.append(""0"");                    }                    buf.append(Integer.toHexString(b)).append("" "");                }                Log.d(""ZeeTest"", ""++++ Read ""+ read +"" bytes: ""+ buf.toString());            }        } catch (IOException e) {}        Log.d(""ZeeTest"", ""++++ Done: test()"");    }    @Override    public void onDestroy() {        try {            if (in != null) {                in.close();            }            if (sock != null) {                sock.close();            }        } catch (IOException e) {            e.printStackTrace();        }        super.onDestroy();    }}</pre><h2>===== Original question =====</h2><p>I'm trying to connect to a Zeemote (http://zeemote.com/) gaming controller from Moto Droid running 2.0.1 firmware. The test application below does connect to the device (LED flashes) but connection is dropped immediately after that. </p><p>I'm pasting two test apps below: one that actually tries to read from input stream and second one that just sits there, waiting for the device to disconnect after 5 seconds. And yes, I do have third version :) which first waits for ACL_CONNECTED and then opens socket but there's nothing new in its behaviour.</p><p>Some background info:I can connect to the Zeemote from my laptop perfectly fine using bluez tools (log attached as well). I know for sure that Droid <em>is</em> able to talk to Zeemote as well because 'Game Pro' from the Market works fine with it (but then it's a driver/service so maybe it uses lower-level API?).</p><p>I noticed that 'adb bugreport' reports neither UUID nor RFCOMM channel for Zeemote while it does so for all other devices (including Moto HS815 headset, another dumb device for which 'sdp browse' reports nothing). Also, when the device boots, Zeemote's priority is 0 (others have priority 100+).</p><p>I'm quite at a loss here, I worked on it for so long that I ran out of ideas so any help would be very much appreciated (even if you don't know <em>the</em> answer :) )</p><p>Thanks,Max</p><h1>Test application No. 1</h1><p>This app tries to actually read from the device.</p><h2>===== Code =====</h2><pre>public class ZeeTest extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            test();        } catch (IOException e) {            e.printStackTrace();        }    }    private BluetoothSocket sock;    private InputStream in;    public void test() throws IOException {        BluetoothDevice zee = BluetoothAdapter.getDefaultAdapter().                      getRemoteDevice(""00:1C:4D:02:A6:55"");        sock = zee.createRfcommSocketToServiceRecord(                      UUID.fromString(""8e1f0cf7-508f-4875-b62c-fbb67fd34812""));        Log.d(""ZeeTest"", ""++++ Connecting"");        sock.connect();        Log.d(""ZeeTest"", ""++++ Connected"");        in = sock.getInputStream();        byte[] buffer = new byte[1];        int bytes = 0;        int x = 0;        Log.d(""ZeeTest"", ""++++ Listening..."");        while (x &lt; 2) {            x++;            try {                bytes = in.read(buffer);                Log.d(""ZeeTest"", ""++++ Read ""+ bytes +"" bytes"");            } catch (IOException e) {                e.printStackTrace();                try { Thread.sleep(100); } catch (InterruptedException ie) {}            }        }        Log.d(""ZeeTest"", ""++++ Done: test()"");    }    @Override    public void onDestroy() {        try {            if (in != null) {                in.close();            }            if (sock != null) {                sock.close();            }        } catch (IOException e) {            e.printStackTrace();        }        super.onDestroy();    }}</pre><h2>===== Log =====</h2><pre>04-19 22:27:01.147: DEBUG/ZeeTest(8619): ++++ Connecting04-19 22:27:04.085: INFO/usbd(1062): process_usb_uevent_message(): buffer = add@/devices/virtual/bluetooth/hci0/hci0:104-19 22:27:04.085: INFO/usbd(1062): main(): call select(...)04-19 22:27:04.327: ERROR/BluetoothEventLoop.cpp(4029): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/4121/hci0/dev_00_1C_4D_02_A6_5504-19 22:27:04.491: VERBOSE/BluetoothEventRedirector(7499): Received android.bleutooth.device.action.UUID04-19 22:27:04.905: DEBUG/ZeeTest(8619): ++++ Connected04-19 22:27:04.905: DEBUG/ZeeTest(8619): ++++ Listening...04-19 22:27:05.538: WARN/System.err(8619): java.io.IOException: Software caused connection abort04-19 22:27:05.600: WARN/System.err(8619):     at android.bluetooth.BluetoothSocket.readNative(Native Method)...04-19 22:27:05.717: WARN/System.err(8619): java.io.IOException: Software caused connection abort04-19 22:27:05.717: WARN/System.err(8619):     at android.bluetooth.BluetoothSocket.readNative(Native Method)...04-19 22:27:05.819: DEBUG/ZeeTest(8619): ++++ Done: test()04-19 22:27:07.155: VERBOSE/BluetoothEventRedirector(7499): Received android.bleutooth.device.action.UUID04-19 22:27:09.077: INFO/usbd(1062): process_usb_uevent_message(): buffer = remove@/devices/virtual/bluetooth/hci0/hci0:104-19 22:27:09.085: INFO/usbd(1062): main(): call select(...)04-19 22:27:09.139: ERROR/BluetoothEventLoop.cpp(4029): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/4121/hci0/dev_00_1C_4D_02_A6_55</pre><h1>Test application No. 2</h1><p>This test connects and waits -- useful for displaying the auto-disconnect issue.</p><h2>===== Code =====</h2><pre>public class ZeeTest extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getApplicationContext().registerReceiver(receiver,                    new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED));        getApplicationContext().registerReceiver(receiver,                    new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED));        try {            BluetoothDevice zee = BluetoothAdapter.getDefaultAdapter().                            getRemoteDevice(""00:1C:4D:02:A6:55"");            sock = zee.createRfcommSocketToServiceRecord(                            UUID.fromString(""8e1f0cf7-508f-4875-b62c-fbb67fd34812""));            Log.d(""ZeeTest"", ""++++ Connecting"");            sock.connect();            Log.d(""ZeeTest"", ""++++ Connected"");        } catch (IOException e) {            e.printStackTrace();        }    }    private static final LogBroadcastReceiver receiver = new LogBroadcastReceiver();    public static class LogBroadcastReceiver extends BroadcastReceiver {        @Override        public void onReceive(Context context, Intent intent) {            Log.d(""ZeeReceiver"", intent.toString());            Bundle extras = intent.getExtras();            for (String k : extras.keySet()) {                Log.d(""ZeeReceiver"", ""    Extra: ""+ extras.get(k).toString());            }        }    }    private BluetoothSocket sock;    @Override    public void onDestroy() {        getApplicationContext().unregisterReceiver(receiver);        if (sock != null) {            try {                sock.close();            } catch (IOException e) {                e.printStackTrace();            }        }        super.onDestroy();    }}</pre><h2>===== Log =====</h2><pre>04-19 22:06:34.944: DEBUG/ZeeTest(7986): ++++ Connecting04-19 22:06:38.202: INFO/usbd(1062): process_usb_uevent_message(): buffer = add@/devices/virtual/bluetooth/hci0/hci0:104-19 22:06:38.202: INFO/usbd(1062): main(): call select(...)04-19 22:06:38.217: ERROR/BluetoothEventLoop.cpp(4029): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/4121/hci0/dev_00_1C_4D_02_A6_5504-19 22:06:38.428: VERBOSE/BluetoothEventRedirector(7499): Received android.bleutooth.device.action.UUID04-19 22:06:38.968: DEBUG/ZeeTest(7986): ++++ Connected04-19 22:06:39.061: DEBUG/ZeeReceiver(7986): Intent { act=android.bluetooth.device.action.ACL_CONNECTED (has extras) }04-19 22:06:39.108: DEBUG/ZeeReceiver(7986):     Extra: 00:1C:4D:02:A6:5504-19 22:06:39.538: INFO/ActivityManager(4029): Displayed activity zee.test/.ZeeTest: 5178 ms (total 5178 ms)04-19 22:06:41.014: VERBOSE/BluetoothEventRedirector(7499): Received android.bleutooth.device.action.UUID04-19 22:06:43.038: INFO/usbd(1062): process_usb_uevent_message(): buffer = remove@/devices/virtual/bluetooth/hci0/hci0:104-19 22:06:43.038: INFO/usbd(1062): main(): call select(...)04-19 22:06:43.069: ERROR/BluetoothEventLoop.cpp(4029): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/4121/hci0/dev_00_1C_4D_02_A6_5504-19 22:06:43.124: DEBUG/ZeeReceiver(7986): Intent { act=android.bluetooth.device.action.ACL_DISCONNECTED (has extras) }04-19 22:06:43.124: DEBUG/ZeeReceiver(7986):     Extra: 00:1C:4D:02:A6:55</pre><h1>System logs</h1><h2>===== Terminal log =====</h2><pre>$ sdptool browseInquiring ...Browsing 00:1C:4D:02:A6:55 ...$ sdptool records 00:1C:4D:02:A6:55Service Name: ZeemoteService RecHandle: 0x10015Service Class ID List:  UUID 128: 8e1f0cf7-508f-4875-b62c-fbb67fd34812Protocol Descriptor List:  ""L2CAP"" (0x0100)  ""RFCOMM"" (0x0003)    Channel: 1Language Base Attr List:  code_ISO639: 0x656e  encoding:    0x6a  base_offset: 0x100$ rfcomm connect /dev/tty10 00:1C:4D:02:A6:55Connected /dev/rfcomm0 to 00:1C:4D:02:A6:55 on channel 1Press CTRL-C for hangup# rfcomm show /dev/tty10rfcomm0: 00:1F:3A:E4:C8:40 -> 00:1C:4D:02:A6:55 channel 1 connected [reuse-dlc release-on-hup tty-attached]# cat /dev/tty10(nothing here)# hcidumpHCI sniffer - Bluetooth packet analyzer ver 1.42device: hci0 snap_len: 1028 filter: 0xffffffff&lt; HCI Command: Create Connection (0x01|0x0005) plen 13&gt; HCI Event: Command Status (0x0f) plen 4&gt; HCI Event: Connect Complete (0x03) plen 11&lt; HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2&gt; HCI Event: Read Remote Supported Features (0x0b) plen 11&lt; ACL data: handle 11 flags 0x02 dlen 10    L2CAP(s): Info req: type 2&gt; HCI Event: Command Status (0x0f) plen 4&gt; HCI Event: Page Scan Repetition Mode Change (0x20) plen 7&gt; HCI Event: Max Slots Change (0x1b) plen 3&lt; HCI Command: Remote Name Request (0x01|0x0019) plen 10&gt; HCI Event: Command Status (0x0f) plen 4&gt; ACL data: handle 11 flags 0x02 dlen 16    L2CAP(s): Info rsp: type 2 result 0      Extended feature mask 0x0000&lt; ACL data: handle 11 flags 0x02 dlen 12    L2CAP(s): Connect req: psm 3 scid 0x0040&gt; HCI Event: Number of Completed Packets (0x13) plen 5&gt; ACL data: handle 11 flags 0x02 dlen 16    L2CAP(s): Connect rsp: dcid 0x04fb scid 0x0040 result 1 status 2      Connection pending - Authorization pending&gt; HCI Event: Remote Name Req Complete (0x07) plen 255&gt; ACL data: handle 11 flags 0x02 dlen 16    L2CAP(s): Connect rsp: dcid 0x04fb scid 0x0040 result 0 status 0      Connection successful&lt; ACL data: handle 11 flags 0x02 dlen 16    L2CAP(s): Config req: dcid 0x04fb flags 0x00 clen 4      MTU 1013(events are properly received using bluez)</pre><h2>===== Part of adb bugreport =====</h2><pre>--Known devices--00:19:A1:2D:16:EA     bonded (0) LG U830    00001105-0000-1000-8000-00805f9b34fb RFCOMM channel = 1700:1C:4D:02:A6:55     bonded (0) Zeemote JS100:0B:2E:6E:6F:00     bonded (0) Motorola HS815    00001108-0000-1000-8000-00805f9b34fb RFCOMM channel = 1    0000111e-0000-1000-8000-00805f9b34fb RFCOMM channel = 200:1F:3A:E4:C8:40     bonded (0) BRCM BT4X    00001105-0000-1000-8000-00805f9b34fb RFCOMM channel = 900:18:42:EC:E2:99     bonded (0) N95    00001105-0000-1000-8000-00805f9b34fb RFCOMM channel = 9</pre><h2>===== Excerpt from boot log =====</h2><pre>04-18 21:55:10.382: VERBOSE/BluetoothEventRedirector(1985): Received android.bluetooth.adapter.action.STATE_CHANGED04-18 21:55:10.421: DEBUG/BT HSHFP(1237): Loaded priority 00:19:A1:2D:16:EA = 10004-18 21:55:10.428: DEBUG/BT HSHFP(1237): Loaded priority 00:1C:4D:02:A6:55 = 004-18 21:55:10.444: DEBUG/BT HSHFP(1237): Loaded priority 00:0B:2E:6E:6F:00 = 10104-18 21:55:10.749: DEBUG/BT HSHFP(1237): Loaded priority 00:1F:3A:E4:C8:40 = 10004-18 21:55:10.780: DEBUG/BT HSHFP(1237): Loaded priority 00:18:42:EC:E2:99 = 100</pre>","277174","","277174","","2010-04-21 19:04:18","2011-07-16 11:01:47","How to prevent Android bluetooth RFCOMM connection from dying immediately after .connect()?","<android><bluetooth><motorola><rfcomm>","4","0","35","",""
"2661073","1","2661803","","2010-04-18 03:57:01","0","58","<p>It seems that android has enforced that a listview must have the name android:id=""@android:id/list"", is there anyway to create multiple listview then? I have two activities which are both listview but have to control different format of Lists, one with image+text the other is just text.</p>","253800","","","","","2010-04-18 09:49:55","android: how to specify multipe listivews","<android><listview>","2","0","1","",""
"2661223","1","2687316","","2010-04-18 05:21:29","2","5914","<p>I have used ImageView's before and understand the different scale types that can be set... However I am having an incredibly difficult time trying to get an ImageView to scale properly in the row of a ListActivity or an ExpandableListActivity.</p><p>I have tried setting the android:scaleType property to every single value but the image never scales down.  I have set the min and max sizes as well and they don't seem to have any effect.  I have done both of these things in both the XMl and in code to no avail...</p><p>Does anyone have any ideas or perhaps a workaround?</p><p>Thanks in advance!</p><p>EDIT: Here is the XML for the group rows in an ExpandableListView</p><pre><code>&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/item_selection_icon_id""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginRight=""5dp""    android:layout_marginLeft=""30dp""    android:minWidth=""10dp""    android:minHeight=""10dp""    android:maxWidth=""10dp""    android:maxHeight=""10dp""    android:scaleType=""centerInside""/&gt;&lt;!--  App Name --&gt;&lt;TextView    android:id=""@+id/item_app_name_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/item_selection_icon_id""    android:layout_alignBaseline=""@id/item_selection_icon_id""    android:textStyle=""normal|bold""    android:textSize=""24sp""/&gt;&lt;!-- Package Information --&gt;&lt;TextView    android:id=""@+id/item_app_pkg_name_id""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/item_app_name_id""    android:layout_toRightOf=""@id/item_selection_icon_id""    android:layout_weight=""2""    android:textStyle=""italic""    android:textSize=""12sp""/&gt;&lt;/RelativeLayout&gt;</code></pre>","249412","","249412","","2010-04-20 22:59:19","2010-04-21 23:49:36","ImageView scale type not working in list activity","<android><listview><scale><imageview><expandablelistview>","1","4","2","",""
"2661536","1","5651242","","2010-04-18 07:58:29","94","48579","<p>How can I take screenshot of selected area of phone-screen not by any program, but from code. </p>","309793","","99834","","2012-10-23 09:38:22","2013-11-19 14:14:42","How to programatically take a screenshot on Android?","<android><screenshot>","10","4","74","",""
"2661932","1","2871706","","2010-04-18 10:41:11","3","15328","<p>I have a Samsung Spica i5700 which I already have updated to Android 2.1. I am using the phone with an application called Run.GPS (<a href=""http://www.rungps.net"" rel=""nofollow"">http://www.rungps.net</a>). This application logs data such as GPS position, route, speed, bearing etc. It can also log heartrate provided the user has a Zephyr HxM bluetooth heart rate monitor (""HxM""), which I do have.</p><p>I can pair the HxM to the phone through the standard bluetooth utility. I'm prompted for the PIN, which I enter and the device is shown as 'Paired but not connected'.</p><p>In the Run.GPS application itself, I click on 'Connect Heartrate Monitor'. This times out after about 30 seconds and the error message is 'Could not connect to heartrate monitor. Please try other settings'.</p><p>I used a friend's HTC Windows Mobile as a control device to see if the HxM works there. It does. The Run.GPS application automatically sets the baud rate (initially to 9600 IIRC, though the connection also worked with higher baud rates) and it is possible to choose between various COM ports as well as a .Net COM port.</p><p>I did some testing on my Spica Android, to try to find out why the bluetooth connection doesn't work. Below are some log files that I connected over adb when I clicked on 'Connect to Heartrate Monitor' in the Run.GPS application.</p><p>I would be interested in any tips (including if I'm posting to the wrong forum here ;-)) - whether or not it's possible to experiment with the baud rate in Android etc. I still don't know if the problem is with the Run.GPS application (I've posted already on the development forum there) or with Android 2.1. I checked out another application - Endomondo - which is also a sport tracking application which supports heartrate monitor only with the HxM. There, what looked like exactly the same error occurred - I clicked on 'Connect Zephyr HxM'. For a few seconds I was shown the 'Connecting...' status, but then it timed out into 'Not Connected'. I'm thus tending towards looking at Android for the problem.</p><p><strong>Here's the output of adb logcat while trying to connect</strong></p><pre><code>./adb logcat | grep Run.GPS  D/WYNEX&gt; (11551): Excute :: Run.GPS Trainer UV, (null)  E/Run.GPS (11997): Cannot connect to BT device  E/Run.GPS (11997): java.io.IOException: Service discovery failed  E/Run.GPS (11997): at  android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:374)  E/Run.GPS (11997): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:184)  E/Run.GPS (11997): at ju.a(Unknown Source)  E/Run.GPS (11997): at qk.j(Unknown Source)  E/Run.GPS (11997): at fs.c(Unknown Source)  E/Run.GPS (11997): at le.a(Unknown Source)  E/Run.GPS (11997): at s.b(Unknown Source)  E/Run.GPS (11997): at pb.a(Unknown Source)  E/Run.GPS (11997): at as.a(Unknown Source)  E/Run.GPS (11997): at am.b(Unknown Source)  E/Run.GPS (11997): at gf.onTouchEvent(Unknown Source)  E/Run.GPS (11997): at android.view.View.dispatchTouchEvent(View.java:3709)  E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1665)  E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)  E/Run.GPS (11997): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)  E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1649)  E/Run.GPS (11997): at android.view.ViewRoot.handleMessage(ViewRoot.java:1694)  E/Run.GPS (11997): at android.os.Handler.dispatchMessage(Handler.java:99)  E/Run.GPS (11997): at android.os.Looper.loop(Looper.java:123)  E/Run.GPS (11997): at android.app.ActivityThread.main(ActivityThread.java:4363)  E/Run.GPS (11997): at java.lang.reflect.Method.invokeNative(Native Method)  E/Run.GPS (11997): at java.lang.reflect.Method.invoke(Method.java:521)  E/Run.GPS (11997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  E/Run.GPS (11997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  E/Run.GPS (11997): at dalvik.system.NativeStart.main(Native Method)  E/Run.GPS (11997): Cannot connect to BT device  E/Run.GPS (11997): java.io.IOException: Service discovery failed</code></pre><p><strong>Here's the output of dmesg while trying to connect the heartrate monitor</strong></p><pre><code>&lt;4&gt;[74726.239833] select 11691 (.serviceModeApp), adj 15, size 3205, to kill&lt;4&gt;[74726.240741] select 11739 (com.wssnps), adj 15, size 3207, to kill&lt;4&gt;[74726.246870] select 11750 (id.partnersetup), adj 15, size 3219, to kill&lt;4&gt;[74726.253390] select 11857 (p.bluetoothicon), adj 15, size 3299, to kill&lt;4&gt;[74726.259879] select 13131 (ndroid.settings), adj 15, size 4586, to kill&lt;4&gt;[74726.266372] send sigkill to 13131 (ndroid.settings), adj 15, size 4586&lt;7&gt;[74733.945097] [BT] GPIO_BT_WAKE = 1&lt;7&gt;[74733.945121] [BT] wake_lock(bt_wake_lock)&lt;7&gt;[74733.951799] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74733.951822] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74735.890196] [BT] GPIO_BT_HOST_WAKE = 0&lt;7&gt;[74736.150987] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74736.151009] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74737.490185] [BT] GPIO_BT_HOST_WAKE = 0&lt;7&gt;[74740.073913] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74740.073948] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74741.315336] [BT] GPIO_BT_HOST_WAKE = 0&lt;7&gt;[74743.249747] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74743.249768] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74744.865099] [BT] GPIO_BT_HOST_WAKE = 0&lt;7&gt;[74745.154487] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74745.154509] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74748.852534] [BT] GPIO_BT_HOST_WAKE = 0&lt;7&gt;[74749.156256] [BT] GPIO_BT_HOST_WAKE = 1&lt;7&gt;[74749.156278] [BT] wake_lock timeout = 5 sec&lt;7&gt;[74750.490018] [BT] GPIO_BT_HOST_WAKE = 0&lt;4&gt;[74754.230424] select 11691 (.serviceModeApp), adj 15, size 3191, to kill&lt;4&gt;[74754.231326] select 11739 (com.wssnps), adj 15, size 3193, to kill&lt;4&gt;[74754.237473] select 11750 (id.partnersetup), adj 15, size 3205, to kill&lt;4&gt;[74754.243950] select 11857 (p.bluetoothicon), adj 15, size 3283, to kill&lt;4&gt;[74754.250452] select 13140 (com.svox.pico), adj 15, size 3465, to kill&lt;4&gt;[74754.256787] send sigkill to 13140 (com.svox.pico), adj 15, size 3465 </code></pre><p><strong>Here's the logcat output when I click 'connect zephyr' in Endomondo</strong></p><pre><code>I/PUSH Event(19147): MotionEvent : QueuedEvent{43d7d480 MotionEvent{440b5680 action=1 x=228.28438 y=212.55624 pressure=0.0 size=0.0}} D/BluetoothZephyrService(23605): connect to: 00:07:80:88:F5:ADD/BluetoothSocket(23605): BluetoothSocket created fd: -1uuid00001101-0000-1000-8000-00805f9b34fbport -1                     D/BluetoothSocket.cpp(23605): initSocketNative      I/BLZ20_WRAPPER(23605): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM                                                      D/BLZ20_WRAPPER(23605): blz20_init: initializing...       D/BTL_IFC_WRP(23605): wsactive_init: init active list                                                                          I/BTL_IFC (23605): main_client_thread: Client main thread starting                                                               D/BLZ20_WRAPPER(23605): blz20_init: success       I/BTL_IFC (23605): BTL_IFC_RegisterSubSystem: Register subsystem [(null)]                                                         I/BTL_IFC (23605): btl_ifc_ctrl_connect: Connect control channel for subsystem [(null)]                                           D/BTL_IFC_WRP(23605): wrp_sock_create: CTRL D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1                                               D/BTL_IFC_WRP(23605): wrp_sock_create: 28D/BTL_IFC_WRP(23605): wrp_sock_connect: wrp_sock_connect 127.0.0.1:9000 (28)                                      I/BTL-IFS (21889): main_server_thread: [CTRL] Client connected (14)                                               I/BTL_IFC_WRP(23605): wrp_sock_connect: Connected. (28)                                                           I/BTL_IFC (23605): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ ((null)) 0 pbytes (hdl 28)      I/BTL-IFS (21889): attach_client: multiclient index 1                                                                       I/BTL-IFS (21889): attach_client: ######## Attached client subsystem  (14) ########                                                  I/BTL-IFS (21889): btl_if_notify_local_event: Notify local event BTLIF_SUBSYSTEM_ATTACHED D/        (21889): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_SUBSYSTEM_ATTACHED (4112) on hdl 14                 I/        (21889): btlif_rfc_ctrl_chan_attached: client attached ctrl handle 14                                               D/BTL-IFS (21889): send_registration_rsp: send_registration_rsp [0]                                                             I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_REGISTER_SUBSYS_RSP (CTRL) 2 pbytes (hdl 14)                        D/BTL_IFC (23605): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set                                                     D/BTL_IFC_WRP(23605): wrp_wsock_create: (null)     D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 15                                                            D/BTL_IFC_WRP(23605): wrp_wsock_create: 32     D/BLZ20_WRAPPER(23605): btsk_alloc_add: success    I/BLZ20_WRAPPER(23605): blz20_wrp_socket: return 32                                                                            D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt:  fd (-1:32), bta -1, rc 0, wflags 0x0                                                I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)                       I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: successD/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt:  fd (-1:32), bta -1, rc 0, wflags 0x0                                            I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes                                            I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success D/BluetoothSocket.cpp(23605): ...fd 32 created (RFCOMM, lm = 26)                                                               D/BluetoothSocket.cpp(23605): initSocketFromFdNative              D/BluetoothZephyrService(23605): setState() 0 -&gt; 2                                                                              I/BluetoothZephyrService(23605): BEGIN mConnectThread      E/BluetoothService.cpp(19147): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session) D/BluetoothSocket(23605): connect                  D/BluetoothSocket(23605): doSdp                 I/BluetoothService.cpp(19147): ... Object Path = /org/bluez/21902/hci0/dev_00_07_80_88_F5_AD      I/BluetoothService.cpp(19147): ... Pattern = 00001101-0000-1000-8000-00805f9b34fb, strlen = 36                                 I/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 2                                                                             D/DEVICE  (21902):     *************DiscoverServices********                         I/DTUN_HCID(21902): dtun_client_get_remote_svc_channel: starting discovery on  (uuid16=0x0011)                                               I/DTUN_HCID(21902):    bdaddr=00:07:80:88:F5:AD                     I/DTUN_CLNT(21902):     Client calling DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4)                                       I/        (21889): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 4354                                   I/        (21889): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4), len 134 E/BTLD    (21889): ****************search UUID = 1101***********         I//system/bin/btld(21888):              btapp_dm_GetRemoteServiceChannel()                              W/BTLD    (21889): SDP - Rcvd conn cnf with error: 0x4  CID 0x42                                                               I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 13 pbytes (hdl 10)                          I/DTUN_CLNT(21902): dtun-rx signal [DTUN_SIG_DM_RMT_SERVICE_CHANNEL] (id 42) len 15                                           I/DTUN_HCID(21902): dtun_dm_sig_rmt_service_channel: success=1, service=00000000                                                          E/DTUN_HCID(21902): discovery unsuccessful!             V/BluetoothEventRedirector(21741): Received android.bleutooth.device.action.UUID  E/CachedBluetoothDevice(21741): onUuidChanged: Time since last connect9266997                                                            D/BluetoothService(19147): Cleaning up failed UUID channel lookup: 00:07:80:88:F5:AD 00001101-0000-1000-8000-00805f9b34fb                                       D/BluetoothSocket(23605): onRfcommChannelFound -1                                                                             D/BluetoothZephyrService(23605): setState() 2 -&gt; 1                                                                             D/BluetoothSocket(23605): close                D/BluetoothSocket(23605): cancel            D/BluetoothSocket.cpp(23605): abortNative         D/BluetoothSocket.cpp(23605): ...asocket_abort(32) complete                                                                    D/BluetoothSocket.cpp(23605): destroyNative        D/BluetoothSocket.cpp(23605): ...asocket_destroy(32) complete                                                                       D/BluetoothZephyrService(23605): start         D/BluetoothSocket(23605): close              D/BluetoothSocket(23605): BluetoothSocket created fd: -1uuidnullport 1                                                   D/BluetoothSocket.cpp(23605): initSocketNative         I/BLZ20_WRAPPER(23605): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM                                                           D/BTL_IFC_WRP(23605): wrp_wsock_create: (null)  D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 15                                                            D/BTL_IFC_WRP(23605): wrp_wsock_create: 32  D/BLZ20_WRAPPER(23605): btsk_alloc_add: success    D/BLZ20_WRAPPER(23605): btsk_dump_list:  fd (-1:32), bta -1, rc 0, wflags 0x0                                                I/BLZ20_WRAPPER(23605): blz20_wrp_socket: return 32                                                                             E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####          D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                        D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                          E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########     D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt:  fd (-1:32), bta -1, rc 0, wflags 0x0                                        I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)                       I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success  E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####           D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                           D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                          E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########     D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt:  fd (-1:32), bta -1, rc 0, wflags 0x0                                           I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes                                          I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success D/BluetoothSocket.cpp(23605): ...fd 32 created (RFCOMM, lm = 26)                                                        D/BluetoothSocket.cpp(23605): initSocketFromFdNative         D/BluetoothSocket(23605): bindListen                    D/BluetoothSocket.cpp(23605): bindListenNative                 I/BLZ20_WRAPPER(23605): blz20_wrp_bind: s 32   E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####           D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                           D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                           E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########     D/BLZ20_WRAPPER(23605): blz20_wrp_bind: bind socket fd (-1:32), bta -1, rc 0, wflags 0x0                                       D/BLZ20_WRAPPER(23605): __bind_prot_rfcomm: rc_chan 1                                                                       D/BTL_IFC_WRP(23605): wrp_sock_bind: wrp_sock_bind on port 9050                                                             I/BLZ20_WRAPPER(23605): blz20_wrp_listen: s 32, backlog 1                                                                      E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####            D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 1, wflags 0x0                                         D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0                                        E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########     D/BLZ20_WRAPPER(23605): blz20_wrp_listen:  fd (-1:32), bta -1, rc 1, wflags 0x0                                             D/BLZ20_WRAPPER(23605): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_LISTEN_REQ, wait for |BTLIF_BTS_RFC_LISTEN_RSP|                           D/BTL_IFC (23605): BTL_IFC_CtrlSend: BTL_IFC_CtrlSend    I/BTL_IFC (23605): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_LISTEN_REQ ((null)) 20 pbytes (hdl 28)                    D/        (21889): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_BTS_RFC_LISTEN_REQ (4433) on hdl 14                  I/        (21889): btlif_rfc_listen_req: Allocated dynamic server channel 4                                                  D/        (21889): bts_chan_alloc_add: bts_chan_alloc_add : success (tot 1)                                                   D/        (21889): bts_chan_dump_all: ### channel list ###                                                                       D/        (21889): bts_chan_dump_all:  type 3, dhdl -1, bta_hdl -1, scn -1, phdl 65535, lstpnd 0, -1:-1 (L:D)I/        (21889): btlif_rfc_listen_req: start rfcomm server on scn 4, role 1, sec_mask 0x30D/        (21889): jw_if_rfcomm_srv_cback: event=BTA_JV_RFCOMM_START_EVTI/        (21889): jw_if_rfcomm_srv_cback: [BTA_JV_RFCOMM_START_EVT] start status: 0, handle:0, security id: 47I/        (21889): jv_rfc_srv_listen_started: jv_rfc_srv_listen_startedI/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_BTS_RFC_LISTEN_RSP () 17 pbytes (hdl 14)I/BTL_IFC (23605): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_LISTEN_RSP ((null)) 19 pbytes (hdl 28)I/BLZ20_WRAPPER(23605): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_LISTEN_RSPE/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 1, wflags 0x2D/BLZ20_WRAPPER(23605): btsk_check_duplicates:  fd (-1:32), bta -1, rc 0, wflags 0x0E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########I/BLZ20_WRAPPER(23605): btlif_process_listen_rsp: listen response for bta hdl 0D/BLZ20_WRAPPER(23605): btlif_signal_event:  fd (-1:32), bta 0, rc 1, wflags 0x2D/BLZ20_WRAPPER(23605): btlif_signal_event: event BTLIF_BTS_RFC_LISTEN_RSP matchedD/BLZ20_WRAPPER(23605): btlif_send_msg_wait_response: unblocked fd (-1:32), bta 0, rc 1, wflags 0x0I/BLZ20_WRAPPER(23605): __listen_prot_rfcomm: success, scn 4D/BTL_IFC_WRP(23605): wrp_sock_listen_bl: wrp_sock_listen_bl : fd 32 127.0.0.1:9050 backlog 1I/BLZ20_WRAPPER(23605): __listen_prot_rfcomm: successD/BluetoothSocket.cpp(23605): ...bindListenNative(32) successI/DTUN_CLNT(21902):     Client calling DTUN_METHOD_DM_ADD_SDP_REC (id 17)I/        (21889): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 4354I/        (21889): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_ADD_SDP_REC (id 17), len 270I/        (21889): btapp_bts_convert_rc_chan_to_scn: found scn 4I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 12 pbytes (hdl 10)I/DTUN_CLNT(21902): dtun-rx signal [DTUN_SIG_DM_SDP_REC_HANDLE] (id 50) len 14I/DTUN_HCID(21902): dtun_dm_sig_sdp_rec_handle: handle = 0x10006D/BluetoothService(19147): new handle 0I/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 1I/BluetoothZephyr(23605): Unable to connect deviceD/BluetoothZephyrService(23605): setState() 1 -&gt; 1D/BluetoothZephyrService(23605): BEGIN mAcceptThreadThread[Thread-9,5,main]D/BluetoothSocket(23605): acceptD/BluetoothSocket.cpp(23605): acceptNativeI/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 1D/WynexActivity(19215): &lt;&gt;&lt;&gt;&lt;&gt;ACTION ::android.intent.action.TIME_TICKD/LocationMasfClient(19147): getNetworkLocation(): Location not found in cache, making network requestD/ProtoRequestListener(19147): requestFailed()I/power   (19147): *** set_screen_state 0</code></pre>","319634","","319634","","2010-04-19 11:05:09","2010-05-20 07:18:52","Problem with bluetooth on android 2.1 (samsung spica i5700) where pairing works but connection does not work","<android><debugging><connection><bluetooth><adb>","5","1","3","",""
"2661961","1","2662117","","2010-04-18 10:48:49","3","234","<p>Is there a central place where I can find the specs for the majority of the Android phones available on the market? I want to create avds for each of them.</p>","292263","","","","","2010-04-18 14:21:02","Specs for all android phones","<android><specs>","2","0","","",""
"2662358","1","2662775","","2010-04-18 13:23:03","11","11178","<p>I have a list view which is populated via records from the database. Now i have to make some records visible but unavailable for selection, how can i achieve that?</p><p>here's my code </p><pre><code>public class SomeClass extends ListActivity {     private static List&lt;String&gt; products;     private DataHelper dh;     public void onCreate(Bundle savedInstanceState) {         dh = new DataHelper(this);         products = dh.GetMyProducts();  /* Returns a List&lt;String&gt;*/         super.onCreate(savedInstanceState);         setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.myproducts, products));         ListView lv = getListView();        lv.setTextFilterEnabled(true);         lv.setOnItemClickListener( new OnItemClickListener() {             @Override             public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {                 // TODO Auto-generated method stub                 Toast.makeText(getApplicationContext(), ((TextView) arg1).getText(), Toast.LENGTH_SHORT).show();             }         });     } }</code></pre><p>The layout file myproducts.xml is as follows:</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""&gt; &lt;/TextView&gt;</code></pre>","180950","","2117960","","2013-12-12 15:48:09","2013-12-12 15:48:09","How to disable items in a List View?","<android><android-widget><listviewitem>","1","0","4","",""
"2662477","1","","","2010-04-18 14:09:47","1","604","<p>I need as simple as possible solution for uploading files (eg. photos) to my website from mobile devices (iPhone, Android, BB, Nokia). Is it possible to do it in same way? Using Java or XHTML?</p>","222418","","","","","2012-11-27 14:36:52","Cross platform mobile file upload - possible?","<iphone><android><file><upload><cross-platform>","2","0","2","",""
"2662531","1","2663565","","2010-04-18 14:27:41","124","77787","<p>My app needs to show Google Maps directions from A to B, but I don't want to put the Google Maps into my application - instead, I want to launch it using an Intent. Is this possible? If yes, how?</p>","1507543","","","","","2014-02-19 13:25:01","Launching Google Maps Directions via an intent on Android","<java><android><google-maps>","4","0","70","",""
"2662650","1","12941873","","2010-04-18 15:02:14","133","78334","<p>The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem when testing games and visual effects.</p><p>How do you make the emulator run as fast as possible? I've been toying with its parameters but haven't found a configuration that shows a noticeable improvement yet.</p>","143378","","","","","2014-03-10 01:36:00","Making the Android emulator run faster","<android><performance><testing><android-emulator><emulator>","14","6","67","",""
"2662680","1","2664466","","2010-04-18 15:10:50","2","2044","<p>My application takes userid from user as input, the userid is alphanumeric i.e just the first character is (a-z), other part is numeric. How can I validate input of this type ( like G34555) ?</p>","257580","","","","","2010-08-03 10:04:32","How to check the value entered in EditText is aplhanumeric or not?","<android><validation><input><edittext>","3","0","","",""
"2662724","1","3181402","","2010-04-18 15:25:59","3","6115","<p>I am writing a app for android 1.5. I want to use a complex listview to display my data. I want to show a ImageView of a drawable object in my List item.</p><p>I learned from a demo:</p><pre><code>------&gt; listData.put(""Img"", listData.put(""Img"", R.drawable.XXX));            listData.put(""Time"", ""100"");            listItems.add(listData);</code></pre><p>It can display correctly, however, I want to change Img at runtime, The image maybe generated at run-time, so I change the code as follow, but it falls.Can anyone help me ? many thanks!</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.item_list);    itemListView = (ListView) findViewById(R.id.listview);         ArrayList&lt;HashMap&lt;String, Object&gt;&gt; listItems = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();         for(int i = 0;i &lt;XXX.size(); ++i)         {            HashMap&lt;String, Object&gt; listData = new HashMap&lt;String, Object&gt;();---------&gt;          1)  listData.put(""Img"", new Drawable(XXX));            2)  listData.put(""Time"", ""100"");            3)  listItems.add(listData);         }        SimpleAdapter listItemAdapter = new SimpleAdapter(this, listItems,                R.layout.listitem,                new String[] { ""Img"", ""Time""},                new int[] { R.id.listitem_img, R.id.listitem_time });        itemListView.setAdapter(listItemAdapter);listitem.xml&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     android:layout_width=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""     android:paddingBottom=""4dip""    android:paddingLeft=""12dip""     android:paddingRight=""12dip""&gt;    &lt;ImageView         android:paddingTop=""12dip""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:id=""@+id/listitem_img"" /&gt;    &lt;TextView          android:layout_height=""wrap_content""        android:textSize=""20dip""         android:layout_width=""wrap_content""        android:id=""@+id/listitem_time"" /&gt;&lt;/LinearLayout&gt;</code></pre>","288462","","","","","2011-02-05 05:35:44","How can I set drawable to a ListView in android","<android><listview><imageview><drawable>","1","0","1","",""
"2662927","1","2663620","","2010-04-18 16:17:27","51","11922","<p>The Android SDK has some convenience methods for manipulating data with SQLite. However both the <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#insert%28java.lang.String,%20java.lang.String,%20android.content.ContentValues%29%29"">insert</a> and <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#replace%28java.lang.String,%20java.lang.String,%20android.content.ContentValues%29"">replace</a> methods use some <code>nullColumnHack</code> parameter which usage I don't understand.</p><p>The documentation explains it with the following, but what if a table has multiple columns that allow NULL? I really don't get it :/</p><blockquote>  <p>SQL doesn't allow inserting a completely empty row, so if initialValues is empty this column [<em>/row for replace</em>] will explicitly be assigned a NULL value</p></blockquote>","216074","","","","","2013-10-10 09:15:10","Android SQLite: nullColumnHack parameter in insert/replace methods","<android><sqlite>","1","0","18","",""
"2662992","1","","","2010-04-18 16:35:24","3","6216","<p>I have a <code>TextView</code> with its <code>MovementMethod</code> set to <code>LinkMovementMethod</code>. Text added to the <code>TextView</code> is a combination of normal text and URLs. For URLs, I would like to offer a context menu when the URL is long pressed for doing things such as copying the address. I've had a look at the source for <code>LinkMovementMethod</code> but it doesn't seem to have any long pressed related code I could override. Any ideas on how to go around achieving this?</p>","240251","","","","","2010-04-19 22:38:48","Show context menu when link is long pressed in TextView","<android><contextmenu><textview>","1","1","3","",""
"2663108","1","2663423","","2010-04-18 17:05:56","5","5256","<p>I am trying to set speakerphone on in a call programmatically using <code>audiomanager.setSpeakerphoneOn(true)</code> in a service but it seems it is not working and I don't know why.Should I do something else?</p><p>Thanks</p>","269585","","","","","2013-06-24 13:25:56","Android set speakerphone on programmatically","<android><audio><speakerphone>","1","1","1","",""
"2663315","1","2663343","","2010-04-18 18:11:20","4","21583","<p>I just got my first Android device, I love it... I also love the fact that you can create your own applications and distribute them as you please.</p><p>I've read a little bit about Monodroid, and also that apparently Microsoft wants to put Silverlight on these devices, although there is not too much information about either of them... but what about Moonlight?</p><p>If Monodroid is like Mono... why do we need it? wouldn't be better having Moonlight instead? Therefore we could create rich applications for Android devices. In Silverlight 4, if you install the app locally as full trust, it won't depend on the cross domain policies and you can connect wherever you want...</p><p>What do you think?</p>","307976","","78101","","2010-04-18 18:19:36","2011-05-11 14:55:25","Silverlight/Moonlight on Android devices","<android><silverlight><mono><moonlight><monodroid>","3","0","1","",""
"2663351","1","","","2010-04-18 18:20:28","0","593","<p>I'm developing an Android app.</p><p>I have class derived from button to represent a special type of button.This special type has some properties (integers) and according to these one or more circles have to be drawn on top of the button.</p><p>So I overrode the onDraw function, which looks the values up and accordingly draws the circles.</p><p>But the class has a function to set new values for its properties. So new values are set but the changes are not reflected in the UI. It seems like the onDraw function is not called.</p><p>When later I click the button or show a pop up message above my interface the onDraw function is called and the button is drawn correctly.</p><p>So my question: when changing the properties how can I say that the button has to be redrawn?</p><p>Thanks a lot!</p>","319804","","","","","2010-04-18 20:30:12","custom button: properties change, button should be redrawn","<java><android><button>","1","0","","",""
"2663427","1","2663607","","2010-04-18 18:39:44","11","7489","<p>I have tried to freeze orientation using:</p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);</code></pre><p>Although the display stays in portrait orientation, the activity is still recreated. Any ideas how to solve this?</p><p>How can the orientation of the application be locked such that the activity is not recreated on orientation change?</p>","62192","","1820501","","2014-03-11 00:14:44","2014-03-11 00:14:44","How is application orientation (landscape or portrait) locked?","<android><screen-orientation>","2","0","5","",""
"2663487","1","2663555","","2010-04-18 18:50:56","3","755","<p>I'm guessing MonoDroid compiles directly into ARM code. And the NDK, too.</p>","41860","","213269","","2010-05-10 16:17:13","2010-05-10 16:17:13","The WeTab will run Android applications but uses an Atom CPU. What does this mean for NDK and MonoDroid?","<android><x86><arm><android-ndk><monodroid>","1","0","","",""
"2663491","1","2664418","","2010-04-18 18:51:44","1","1492","<p>I’m currently writing an application for the Android platform that <em>requires</em> a mounted SD card (or <em>ExternalStorage</em>). I know that it might not be the best way to require something like that, but the application will work with quite a lot of data, and I don’t even want to think about storing that on the device’s storage.</p><p>Anyway, to ensure that the application won’t run without the external storage, I do a quick check in the activity’s <code>onCreate</code> method. If the card is not mounted, I want to display an error message and then quit the application.</p><p>My current approach looks like this:</p><pre><code>public void onCreate ( Bundle savedInstanceState ){    super.onCreate( savedInstanceState );    setContentView( R.layout.main );    try    {        // initialize data storage        // will raise an exception if it fails, or the SD card is not mounted        // ...    }    catch ( Exception e )    {        AlertDialog.Builder builder = new AlertDialog.Builder( this );        builder            .setMessage( ""There was an error: "" + e.getMessage() )            .setCancelable( false )            .setNeutralButton( ""Ok."", new DialogInterface.OnClickListener()            {                public void onClick ( DialogInterface dialog, int which )                {                    MyApplication.this.finish();                }            } );            AlertDialog error = builder.create();            error.show();            return;    }    // continue ...}</code></pre><p><s>When I run the application, and the exception gets raised (I raise it manually to check if everything works), the error message is displayed correctly. However when I press the button, the application closes and I get an Android error, that the application was closed unexpectedly (and I should force exit).</s></p><p>I read some topics before on closing an application, and I know that it maybe shouldn’t happen like that. But how should I instead prevent the application from continuing to run? How do you close the application correctly when an error occurs?</p>","216074","","216074","","2010-04-18 20:36:16","2010-04-18 23:26:44","Close application on error","<android>","1","3","","",""
"2663767","1","","","2010-04-18 20:07:24","0","1129","<p>Hoi,</p><p>I have a simple app with a surfaceview nothing special one would say. However when installing on my phone I get two warnings.</p><p>1 - Phone calls- read phone state and identity2 - Storage- modify/delete SD card content.</p><p>My really is nothing more than a simple puzzle and I dont understand why I get these warnings.</p><p>Any ideas how to avoid this?</p><p>Help is very much appreciated,Kind regardsJasper de Keijzer.</p>","241217","","","","","2010-05-05 05:03:25","Application installer tells that my app reads Phone State and identity :-(","<android>","2","0","","",""
"2663778","1","","","2010-04-18 20:10:00","0","299","<p>I'm making an Android App, and i need to put a control that let user choose between 4 different colors. I want to do this with something like radio buttons: the problem is that radiobuttons are round...</p><p>is there a way to set them looks like square/rect buttons, and assign a color to their inside rect area ?</p><p>If not, how can i achieve that choose for the user ?</p><p>I need this because i'm making a Todo/Task android application, and i need the user to choose the priority of a task, between for priority level that are rapresented with a color. So i think to do that by showing 4 buttons, each with a different color associated, and a text inside (""0"", ""1"", ""2"", ""3"") </p><p>Thanks!</p>","319844","","","","","2010-07-24 07:17:11","In Android, how can i allow the user to choose a color between 4?","<android><controls><radio-button><widget>","1","0","1","",""
"2663791","1","","","2010-04-18 20:15:38","0","376","<p>I am new to Android and java development. I create a WebView object in the OnCreate function. Now I need to be able to pass this same object to other functions in the code, such as the onOptionsItemSelected function. I currently have it where I just create a new WebView object in each function where I need it, but this slows down the code since it has to recreate it and such.</p>","319847","","","","","2010-04-18 20:58:21","Need help with android WebView","<android><variables><webview><global>","1","4","","",""
"2663898","1","2664016","","2010-04-18 20:50:36","0","543","<p>I guess my previous question wasn't clear enough ( <a href=""http://stackoverflow.com/questions/2549585/android-failed-to-setcontentview-when-switching-to-listactivity"">http://stackoverflow.com/questions/2549585/android-failed-to-setcontentview-when-switching-to-listactivity</a> ), so I explain as follows.</p><p>In my app I have two listactivities which uses two different listviews:</p><pre><code>public class Activity1 extends ListActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    try{    super.onCreate(savedInstanceState);    setContentView(R.layout.listview1); }public class Activity2 extends ListActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    try{    super.onCreate(savedInstanceState);    setContentView(R.layout.listview2); }</code></pre><p>}</p><p>As required by android, listview must have an ID which is exactly ""@android:id/list"". If I set the listview in both listview1 and listview2 with the same ID, then they will end up using the same format of listview, which is not what I want. But if I set one of the IDs to be sth like ""@+id/listview2"", android gave me the error:java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</p><p>How do I handle this dilema?</p><p>btw: my listview is sort of complicated, customed list with image icons and text, so in my code, I also extended the ListAdapter:</p><pre><code>this.mListAdapter = new myListAdapter(this,             R.layout.listview1, mTiebaInfo);     setListAdapter(this.mListAdapter);</code></pre>","253800","","253800","","2010-04-18 21:35:37","2010-04-18 21:35:37","android: having two listviews in two listactivities didn't work","<android><listview>","1","0","1","",""
"2664057","1","2664124","","2010-04-18 21:34:37","0","2741","<p>I have an Android application which grabs some data from an external XML source. I've stripped out some HTML from one of the XML elements, but it's in the format:</p><pre><code>&lt;p class=""x""&gt;Some text...&lt;/p&gt;&lt;p&gt;Some more text&lt;/p&gt;&lt;p&gt;Some final text&lt;/p&gt;</code></pre><p>I want to extract the middle paragraph text, how can I do this? Would a regular expression be the best way? I don't really want to start including external HTML parsing libraries.</p>","277668","","","","","2010-04-19 11:08:41","Java (Android) regular expression to strip out HTML paragraph","<java><html><android><regex>","5","0","","",""
"2664073","1","","","2010-04-18 21:38:38","8","21836","<p>I am trying to layout 1 textview (upText) left aligned and 1 textview (downText) and an image view (image) both on the same line and right aligned.</p><p>how can I do that? I tried that, but both 'textview' and image view at left aligned.</p><p></p><pre><code>        &lt;TextView            android:id=""@+id/uptext""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""left""/&gt;        &lt;TextView            android:id=""@+id/downtext""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:singleLine=""true""            android:gravity=""right|bottom""/&gt;        &lt;ImageView            android:id=""@+id/image""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:gravity=""right|bottom""/&gt;    &lt;/LinearLayout&gt;</code></pre>","286802","","","","","2010-04-18 23:24:07","How to layout view right aligned and bottom of an LinearLayout","<android>","1","0","2","",""
"2664353","1","2664377","","2010-04-18 22:58:27","3","2488","<p>Basically, I want to get a list of all installed apps and pick one to run from an activity.</p><p>I've tried ACTION_PICK with Intents but that seems to leave out apps that were downloaded and it has a bunch of junk in it.</p><p>Thanks</p>","306410","","","","","2012-08-30 12:57:41","How do I start another application (downloaded or preinstalled) from an activity?","<android><activity>","2","1","","",""
"2664425","1","","","2010-04-18 23:30:07","5","23454","<p>Where do I copy the apk file on the Motorola Droid?  Which directory?  Are there any possible issues I need to be careful of, it's also my personal phone...</p>","319909","","319909","","2010-04-29 17:10:18","2012-10-04 15:33:30","How to test my app on my phone? I have Eclipse w/ Android plug-in","<android>","3","3","2","",""
"2664702","1","","","2010-04-19 01:12:43","1","1372","<p>My application should hold a camera preview surface. The camera is fixed to landscape view via AndroidMainfest.xml</p><pre><code>&lt;application android:icon=""@drawable/icon""     android:label=""Camera""&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;uses-feature android:name=""android.hardware.camera"" /&gt;    &lt;uses-feature android:name=""android.hardware.camera.autofocus"" /&gt;    &lt;activity android:name="".CameraPreview""            android:label=""Camera""            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;</code></pre><p> </p><p><em>If there is another way to get the camera preview itself to behave correctly, please let me know.</em></p><p>Now I need to have an overlay that holds a bunch of buttons. Due to usability, the user interface should be set to portrait view (or even better orientation aware).</p><p>Is there a way to have a transparent layout (for buttons and other GUI elements) in portrait orientation?</p><p>I tried to write a special rotated layout by extending a RelativeLayout, but the onDraw method isn't called at anytime.</p><pre><code>public class RotatedOverlay extends RelativeLayout {private static final String TAG = ""RotatedOverlay"";public RotatedOverlay(Context context, AttributeSet attrs ) {    super(context, attrs);}@Overrideprotected void onDraw(Canvas canvas) {    canvas.rotate(90);    super.onDraw(canvas);}</code></pre><p>I am quite new to the Android plattform programming. Of course I dont know much about the programming tricks and workarounds yet. I did a lot of research over the last two weeks (even studied the native Camera implementation), but couldnt find a good solution so far.</p><p>Maybe it works with two seperate Activities, but I dont think, that this can the right solution.</p>","319919","","319919","","2010-04-20 06:28:17","2010-08-27 18:01:16","Can I add a portrait layout on top of a landscape Camera SurfaceView?","<android><camera><orientation><android-layout>","1","0","1","",""
"2664750","1","2666324","","2010-04-19 01:29:54","2","1622","<p>I have an application I am creating with a DashboardActivity &amp; a SettingsActivity. On the dashboard, I have one object displayed, but when I go into settings, I want to be able to select/deselect X options. Once the user clicks the back button, I save that data locally and to the server. Once the phone receives a success message from the server that it was stored properly, I want to reload the dashboard. </p><p>I thought I would do this with the onPause and onResume, but they are called when the DashboardActivity is first created. What would be the best way to reload the dashboard by calling my web service after the settings were saved to the server? Here is what I am doing when the back button is hit</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    //Save data to the server once the user hits the back button    if ((keyCode == KeyEvent.KEYCODE_BACK)) {        SchoolSearchActivity.this.divisionProxy = new DivisionProxy(SchoolSearchActivity.this.saveUserDivisionHandler);        SchoolSearchActivity.this.divisionProxy.submitUserDivisions(SchoolSearchActivity.this.userDivisions, SchoolSearchActivity.this.user_id);        //SchoolSearchActivity.this.finish();        //Toast.makeText(SchoolSearchActivity.this, ""Divisions Saved"",Toast.LENGTH_LONG).show();    }    return true;}</code></pre><p>The above opens an HTTP connection, and when the response is received, the handler processes the response. I want to:1) submit the data to the server2) return to the previous activity3) show a progress dialog until the response from #1 returns (response handler is in the settings activity; and we are now in the dashboard activity)4) ""refresh"" the dashboard</p><p>What is the best way to accomplish this so I can just resume the dashboard as it was. Like I said, when I overwrite the onResume method, it is called when the activity is first created.  I was considering putting my webservice call in onResume, so it's called once everytime you make it to the Activity, but it doesn't seem like the cleanest way.</p><p>What would you suggest for 1-4?</p>","239375","","239375","","2010-04-19 03:39:08","2010-04-19 09:08:24","Resume Activity with back button","<android>","1","0","2","",""
"2664922","1","2687268","","2010-04-19 02:33:40","4","2893","<p>My android application has several warnings of the following form when I run it in the emulator:</p><blockquote>  <p>""Resources don't contain package for resource number &lt;Hex Address&gt;""</p></blockquote><p>How can I fix these warnings? In particular, is there an easy way to find out what the hex address refers to?</p>","165495","","","","","2010-04-21 23:48:25","Android - ""Resources don't contain package for resource number""","<android><debugging>","2","1","2","",""
"2664984","1","2795825","","2010-04-19 03:00:01","3","190","<p>Android's messaging app, located in projects/platform/packages/apps/Mms.git has a class called RecipientsEditor. I would like to be able to create MultiAutoCompleteTextView that will filter contacts the same way, to make contact selection easy in my app. using the mms app is cumbersome since it uses internal apis and has everything split across classes.</p><p>Has anyone made an easy way to do this?</p>","312463","","","","","2010-05-08 22:06:45","How do I replicate the functionality of selecting contacts in messaging app?","<android><messaging><android-widget><contacts><autocompletetextview>","1","0","","",""
"2664987","1","","","2010-04-19 03:01:00","0","674","<p>I query the table by using this function below</p><pre><code>   public Cursor getTableInfo() throws SQLException {             return db.query(TableName, null,             null,             null,             null,             null,             null);}</code></pre><p>I got the error ""View Root.handleMessage(Message)line:1704"". I could insert the data but can't query the data. I called this function below</p><pre><code>      Cursor c = db.getTableInfo();      int cRow = c.getCount();      if (cRow == 0)      {       Toast.makeText(NewContact.this,                 ""No Record"",                                 Toast.LENGTH_LONG).show();      }</code></pre><p>In SQLite, is there any case-sensitive in the name of database, table, column?</p><p>Please help me.</p>","305732","","305732","","2010-04-19 03:32:52","2010-07-12 03:19:44","SQLite table query","<android><sqlite>","2","1","","",""
"2664990","1","2665014","","2010-04-19 03:01:20","4","342","<p>I'm building an android application, which has a list view, and in the list view, a click listener, containing an onItemClick method.  So I have something like this:</p><pre><code>public class myList extends ListActivity {    @Overridepublic void onCreate(Bundle savedInstanceState) {        getListView().setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view,        int position, long id) {            /* Do something*/        }    }}</code></pre><p>Normally, this works fine.  However, many times I find myself needing too preform an application using the outer class as a context.  thusfar, I've used:</p><pre><code>parent.getContext();</code></pre><p>to do this, but I would like to know, is that a bad idea?  I can't really call:</p><pre><code>super</code></pre><p>because it's not really a subclass, just an embedded one.  So is there any better way, or is that considered cosure?  Also, if it is the right way, what should I do if the embedded method doesn't have a parameter to get the outside class?</p><p>Thank you.</p>","288439","","49246","","2010-05-09 06:47:45","2010-05-09 06:47:45","Pass in the object a java class is embedded in as a parameter","<java><android><class><inner-classes>","2","0","1","",""
"2665198","1","","","2010-04-19 04:33:19","3","2423","<p>Is there anyway to set a custom font or color for the selected item in a Spinner? For example, I open the spinner and click a priority of ""High"". I'm my layout containing the spinner, I would like to see the word ""High"" in red or a custom font. </p><p>I can't seem to obtain the textview to make the necessary change. I always obtain a NullPointerException if I typecast the spinner.getSelectedView() to textview and attempt to set the color. any ideas? thanks in advance!</p>","320000","","","","","2011-01-05 17:29:10","How to set a custom font for a spinner?","<android>","2","1","0","",""
"2665206","1","2665307","","2010-04-19 04:37:11","3","431","<p>I have an interesting problem being reported to me from an android application I have published. I have a two-dimensional array that I am iterating through using two for loops like so:</p><pre><code>for (int i = 0; i &lt; arr.length; ++i){    for (int j = 0; j &lt; arr[i].length; ++j)    {        if (arr[i][j] != 0)            // does stuff    }}</code></pre><p>The problem is, somehow arr[i][j] != 0 is throwing an ArrayIndexOutOfBoundsException. But very rarely. I have thousands of people use the app on a daily basis and get maybe twenty force close reports.</p><p>Is this something I can't avoid, maybe a problem with the phones memory, etc. or is there something I can do that I haven't thought of yet? Thanks.</p>","2053380","","","","","2010-04-19 05:24:22","Android / Java rare and seemingly impossible exception causing force close","<java><android><arrays><exception><multidimensional-array>","1","1","","",""
"2665255","1","2665305","","2010-04-19 05:03:27","1","8515","<p>Alright, here is the output I get:</p><pre><code>arm-none-linux-gnueabi-ld --entry=main -dynamic-linker=/system/bin/linker -rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++ -lm -lGLESv1_CM -rpath=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -rpath=../../YoghurtGum/lib/Android -L./lib/Android intermediate/Alien.o intermediate/Bullet.o intermediate/Game.o intermediate/Player.o ../../YoghurtGum/bin/YoghurtGum.a -o bin/Galaxians.androidintermediate/Game.o: In function `Galaxians::Init()':/media/YoghurtGum/Tests/Galaxians/src/Game.cpp:45: undefined reference to `__cxa_end_cleanup'/media/YoghurtGum/Tests/Galaxians/src/Game.cpp:44: undefined reference to `__cxa_end_cleanup'intermediate/Game.o:(.ARM.extab+0x18): undefined reference to `__gxx_personality_v0'intermediate/Game.o: In function `Player::Update()':/media/YoghurtGum/Tests/Galaxians/src/Player.h:41: undefined reference to `__cxa_end_cleanup'intermediate/Game.o:(.ARM.extab.text._ZN6Player6UpdateEv[_ZN6Player6UpdateEv]+0x0): undefined reference to `__gxx_personality_v0'intermediate/Game.o:(.rodata._ZTIN10YoghurtGum4GameE[_ZTIN10YoghurtGum4GameE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'intermediate/Game.o:(.rodata._ZTI6Player[_ZTI6Player]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Game.o:(.rodata._ZTIN10YoghurtGum6EntityE[_ZTIN10YoghurtGum6EntityE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Game.o:(.rodata._ZTIN10YoghurtGum6ObjectE[_ZTIN10YoghurtGum6ObjectE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'intermediate/Game.o:(.rodata._ZTI6Bullet[_ZTI6Bullet]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Game.o:(.rodata._ZTI5Alien[_ZTI5Alien]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Game.o:(.rodata+0x20): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'../../YoghurtGum/bin/YoghurtGum.a(Sprite.o):(.rodata._ZTIN10YoghurtGum16SpriteDataOpenGLE[_ZTIN10YoghurtGum16SpriteDataOpenGLE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'../../YoghurtGum/bin/YoghurtGum.a(Sprite.o):(.rodata._ZTIN10YoghurtGum10SpriteDataE[_ZTIN10YoghurtGum10SpriteDataE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'make: *** [bin/Galaxians.android] Fout 1</code></pre><p>Here's an error I managed to decipher:</p><pre><code>intermediate/Game.o: In function `Galaxians::Init()':/media/YoghurtGum/Tests/Galaxians/src/Game.cpp:45: undefined reference to `__cxa_end_cleanup'/media/YoghurtGum/Tests/Galaxians/src/Game.cpp:44: undefined reference to `__cxa_end_cleanup'</code></pre><p>This is line 43 through 45:</p><pre><code>Assets::AddSprite(new Sprite(""media\\ViperMarkII.bmp""),     ""ship"");Assets::AddSprite(new Sprite(""media\\alien.bmp""),           ""alien"");Assets::AddSprite(new Sprite(""media\\bat_ball.bmp""),        ""bullet"");</code></pre><p>So, what seems funny to me is that the first <code>new</code> is fine (line 43), but the second one isn't. What could cause this?</p><pre><code>intermediate/Game.o: In function `Player::Update()':/media/YoghurtGum/Tests/Galaxians/src/Player.h:41: undefined reference to `__cxa_end_cleanup'</code></pre><p>Another issue with <code>new</code>: </p><pre><code>Engine::game-&gt;scene_current-&gt;AddObject(new Bullet(m_X + 10, m_Y));</code></pre><p>I have no idea where to begin with the other issues.</p><p>These are my makefiles, They're a giant mess because I'm just trying to get it to work.</p><p>Static library:</p><pre><code># ====================================== ##                                        ##       YoghurtGum static library        ##                                        ## ====================================== #include ../YoghurtGum.mkPROGS = bin/YoghurtGum.aSOURCES = $(wildcard src/*.cpp)#$(YG_PATH_LIB)/libGLESv1_CM.so \#$(YG_PATH_LIB)/libEGL.so \YG_LINK_OPTIONS = -sharedYG_LIBRARIES = \  $(YG_PATH_LIB)/libc.a \  $(YG_PATH_LIB)/libc.so \  $(YG_PATH_LIB)/libstdc++.a \  $(YG_PATH_LIB)/libstdc++.so \  $(YG_PATH_LIB)/libm.a \  $(YG_PATH_LIB)/libm.so \  $(YG_PATH_LIB)/libui.so \  $(YG_PATH_LIB)/liblog.so \  $(YG_PATH_LIB)/libGLESv2.so \  $(YG_PATH_LIB)/libcutils.so \YG_OBJECTS = $(patsubst src/%.cpp, $(YG_INT)/%.o, $(SOURCES))YG_NDK_PATH_LIB = /home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/liball: $(PROGS)rebuild: clean $(PROGS)# remove all .o objects from intermediate and all .android objects from binclean:    rm -f $(YG_INT)/*.o $(YG_BIN)/*.acopy:    acpy ../$(PROGS)   $(PROGS): $(YG_OBJECTS)    $(YG_ARCHIVER) -vq $(PROGS) $(YG_NDK_PATH_LIB)/crtbegin_static.o $(YG_NDK_PATH_LIB)/crtend_android.o $^ &amp;&amp; \  $(YG_ARCHIVER) -vr $(PROGS) $(YG_LIBRARIES) $(YG_OBJECTS): $(YG_INT)/%.o : $(YG_SRC)/%.cpp    $(YG_COMPILER) $(YG_FLAGS) -I $(GLES_INCLUDES) -c $&lt; -o $@</code></pre><p>Test game project:</p><pre><code># ====================================== ##                                        ##               Galaxians                ##                                        ## ====================================== #include ../../YoghurtGum.mkPROGS = bin/Galaxians.androidYG_COMPILER = arm-none-linux-gnueabi-g++YG_LINKER = arm-none-linux-gnueabi-ldYG_PATH_LIB = ./lib/AndroidYG_LIBRARIES = ../../YoghurtGum/bin/YoghurtGum.aYG_PROGS = bin/Galaxians.androidGLES_INCLUDES = ../../YoghurtGum/srcANDROID_NDK_ROOT = /home/oem/android-ndk-r3NDK_PLATFORM_VER = 5YG_NDK_PATH_LIB = $(ANDROID_NDK_ROOT)/build/platforms/android-$(NDK_PLATFORM_VER)/arch-arm/usr/libYG_LIBS = -nostdlib -lstdc++ -lm -lGLESv1_CM#YG_COMPILE_OPTIONS = -g -rdynamic -Wall -Werror -O2 -wYG_COMPILE_OPTIONS = -g -Wall -Werror -O2 -wYG_LINK_OPTIONS = --entry=main -dynamic-linker=/system/bin/linker -rpath-link=$(YG_NDK_PATH_LIB) -L$(YG_NDK_PATH_LIB) $(YG_LIBS)SOURCES = $(wildcard src/*.cpp)YG_OBJECTS = $(patsubst src/%.cpp, intermediate/%.o, $(SOURCES))all: $(PROGS)rebuild: clean $(PROGS)clean:    rm -f intermediate/*.o bin/*.android$(PROGS): $(YG_OBJECTS)    $(YG_LINKER) $(YG_LINK_OPTIONS) -rpath=$(YG_NDK_PATH_LIB) -rpath=../../YoghurtGum/lib/Android -L$(YG_PATH_LIB) $^ $(YG_LIBRARIES) -o $@$(YG_OBJECTS): intermediate/%.o : src/%.cpp    $(YG_COMPILER) $(YG_COMPILE_OPTIONS) -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -c $&lt; -o $@</code></pre><p>Any help would be appreciated.</p>","141057","","","","","2012-02-10 10:33:05","Linux C++: Linker is outputting strange errors","<c++><android><linux><makefile><android-ndk>","2","0","","",""
"2665495","1","2666081","","2010-04-19 06:21:10","0","161","<p>I have just started with Android with the usual Hello World project template in Eclipse. I modified the layout XML and removed the label that says ""Hello World, !"", and added a couple of other controls. However, these are not reflected in the app, within the emulator. When I run this app from Eclipse again it is still showing the Hello World label!</p><p>I'm sure it's something terribly simple that I have completely missed. Can someone please point me in the right direction?</p><p>Many thanks,Dany.</p>","150061","","","","","2010-04-19 09:56:25","Newbie Android question","<android><eclipse><hello-world>","3","0","","",""
"2665507","1","7831805","","2010-04-19 06:23:58","15","14200","<p>So I am using the techniques in <a href=""http://stackoverflow.com/questions/2086989/custom-title-with-image"">this thread</a> to use a custom background for my titlebar. Unfortunately the framework places my layout inside a <code>FrameLayout</code> (<code>title_container</code>) which has padding as seen below.</p><p><img src=""http://lh3.ggpht.com/_KP55v0Zt2pk/S80CUbrYkCI/AAAAAAAAARY/FJ_WPt8ah2s/s800/title_bar.png"" alt=""alt text""></p><p>Is there anyway to remove the grey borders? The frame layout is defined in <code>com.android.internal.R.id.title_container</code>, so accessing the frame by ID would be fragile.</p>","165495","","165495","","2010-04-29 01:02:03","2013-03-18 21:03:35","Custom title bar without padding (Android)","<android><user-interface>","6","0","7","",""
"2665634","1","","","2010-04-19 06:49:26","21","30685","<p>Is it possible to clear a notification programatically?</p><p>I tried it with the <code>NotificationManager</code> but its not working.Is there any other way I can do it?</p>","316190","","1058406","","2013-11-08 06:58:44","2014-04-14 18:25:02","How to clear a notification in Android","<android><notifications>","6","2","4","",""
"2665796","1","2671032","","2010-04-19 07:30:30","4","2813","<p>I am building an Android application that requires OAuth.  I have all the OAuth functionality working except for handling the callback from Yahoo.  I have the following in my AndroidManifest.xml :</p><pre>  &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.test.com"" android:scheme=""http""&gt;&lt;/data&gt;   &lt;/intent-filter&gt;</pre><p>Where www.test.com will be substituted with a domain that I own.  It seems :</p><ul><li>This filter is triggered when I click on a link on a page.  </li><li>It is not triggered on the redirect by Yahoo, the browser opens the website at www.test.com  </li><li>It is not triggered when I enter the domain name directly in the browser.</li></ul><p>So can anybody help me with</p><ul><li>When exactly this intent-filter will be triggered?</li><li>Any changes to the intent-filter or permissions that will widen the filter to apply to redirect requests?</li><li>Any other approaches I could use?</li></ul><p>Thanks for your help.</p>","294123","","","","","2011-05-09 13:55:33","Android : Handle OAuth callback using intent-filter","<android><oauth>","1","1","","",""
"2665896","1","","","2010-04-19 07:48:36","1","1705","<p>why do we need xml parsing in android and which one is really better (SAX,DOM.PULL)</p>","320106","","20261","","2010-04-19 07:51:41","2011-09-06 05:44:01","why xml parsing in android","<xml><android>","1","0","","",""
"2665966","1","","","2010-04-19 07:59:26","2","2357","<p>Can anybody help me to know , in how many ways we can develop application for Android platform.The only one way that i know is through Java.Somewhere i read that other than Java like Python , Rails and Native C are also used to develop android application.Please help me if anybody knows it, in terms of how these languages are used to create application with any tutorials ,documents or books.</p>","131062","","","","","2014-01-21 07:55:45","What are different ways to develop application in android?","<android>","4","0","","",""
"2666341","1","2666562","","2010-04-19 09:11:16","5","9025","<p>I try to use the GradientDrawable to set a gradient to some backgrounds and buttons. Sadly the <a href=""http://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html"" rel=""nofollow"">documentation</a> is not very detailed. </p><p>What are the main attributes to configure the gradient? I understand start and endcolor but some of the other attributes could need some explanation.</p><p>At the moment I used images as the background for the buttons but a drawable defined in XML would be much nicer. </p><p>I try to get a look like this (It is a very light gradient): <img src=""http://janusz.de/~janusz/RedButton.png"" alt=""alt text""></p>","114066","","267269","","2013-05-08 06:05:21","2013-05-08 06:05:21","How to use Android GradientDrawable","<android><android-layout>","2","0","1","",""
"2666388","1","2902819","","2010-04-19 09:49:30","3","632","<p>I have a problem handling messages in a Thread. My run-method looks like this </p><pre><code>public void run() {              Looper.prepareLooper();   parserHandler = new Handler {      public void handleMessage(Message msg) {         Log.i("""",""id from message: ""+msg.getData.getString(""id""));         // handle message         this.wait();      }   }}</code></pre><p>I have several Activities sending messages to this thread, like this: </p><pre><code>Message parserMessage = new Message();Bundle data = new Bundle();data.putString(""id"", realId);data.putString(""callingClass"", ""CategoryList"");parserMessage.setData(data);parserMessage.what = PARSE_CATEGORIES_OR_PRODUCTS;parserHandler = parser.getParserHandler();synchronized (parserHandler) {    parserHandler.notify();    Log.i("""",""message ID:  "" + parserMessage.getData().getString(""id""));}parserHandler.sendMessage(parserMessage);</code></pre><p>The problem is that the run-method logs ""id from message: null"" though ""message ID"" has a value in the Log-statement. Why does the message ""lose"" it's data when being send to the thread? Has it something to do with the notify? Thanks for your help</p>","320183","","","","","2012-05-04 11:35:10","Thread loses Message after wait() and notify()","<android><multithreading><message-queue><handler>","1","0","0","",""
"2666500","1","2666649","","2010-04-19 10:10:34","1","464","<p>I don't know how to create an custom Activity extending MapActivity and ListActivity ?I am trying screen that contains of google map and list view.</p><p>How to make it ?</p><p>Thanks in advance.</p>","164589","","2140191","","2013-05-08 06:14:57","2013-05-08 06:14:57","How to make a screen contains google MapView and ListView?","<android><android-layout><android-listview><android-mapview>","1","0","","",""
"2666628","1","","","2010-04-19 10:33:04","0","1000","<p>Here's the problem I'm facing : I try to download a file from a tomcat server using the following snipet of code </p><pre><code>try {   BufferedInputStream getit = new BufferedInputStream(new URL(""http://192.168.2.180:8080/android.apk"").openStream());   FileOutputStream saveit = new FileOutputStream(path);   BufferedOutputStream bout = new BufferedOutputStream(saveit,1024);   byte data[] = new byte[1024];   int readed = getit.read(data,0,1024);   while(readed != -1)    {        bout.write(data,0,readed);        readed = getit.read(data,0,1024);    }    bout.close();    getit.close();    saveit.close();}catch(Exception e){   e.printStackTrace}</code></pre><p>The above works just fine when I run it on the emulator , but when I try to test it on my device it doesn't do anything  , and ~50 sec later it throws a ""socket timeout""exception at the line</p><pre><code> BufferedInputStream getit = new BufferedInputStream(new URL(""http://192.168.2.180:8080/android.apk"").openStream());</code></pre><p>What is this happening and how can I fix it ?</p><p>here's the stacktrace</p><pre><code>04-19 12:28:19.865: WARN/System.err(2962): java.net.SocketException: The operation timed out04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native Method)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:125)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:227)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:521)04-19 12:28:19.865: WARN/System.err(2962): at java.net.Socket.connect(Socket.java:1019)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:67)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:73)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:826)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:812)04-19 12:28:19.865: WARN/System.err(2962): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1054)04-19 12:28:19.865: WARN/System.err(2962): at java.net.URL.openStream(URL.java:674)</code></pre>","304866","","304866","","2010-04-19 12:32:51","2011-12-04 05:13:24","Problem when downloading a file","<android>","2","10","","",""
"2666922","1","2668076","","2010-04-19 11:21:49","8","3732","<p>I've got 2 GeoPoints given to show them on the map with markers.</p><p>How can I get the optimum zoom level for the MapController in order to focus the middle of both points, but also have them on the map.</p><p>The whole thing should work at different screen resolutions.</p>","317301","","881229","","2013-12-09 04:07:24","2013-12-09 07:39:50","Auto-size zoom on Google Maps in java? (depending android screen resolution)","<java><android><google-maps><zoom>","2","0","","",""
"2666964","1","2667093","","2010-04-19 11:31:22","1","321","<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 am considering to start writing  apps for android. Could some-one post list with all tools needed to start coding. My programming skills by language are C# - excellent Java - moderatec/c++ - beginner</p><p>I have heard something about Mono for android, whats the status of it?  is it any good?</p><p>Also it would be  helpful to hear how Java performs on android.Any other points and issues regarding the android platform are also welcomed.</p>","71896","","","","","2010-04-19 11:52:12","starting with android","<android>","2","1","1","2011-12-18 07:10:39",""
"2666966","1","2671008","","2010-04-19 11:31:28","5","18279","<p>I am parsing data through the web service. I want the flipping horizontally rather than vertically. Here is a tutorial where ViewFlipper is used but it is for static data.</p><hr><p>Here is our code where we need flipping between 2 activities:    </p><p>Splash.java</p><pre><code>public class Splash extends Activity{        /** Called when the activity is first created. */        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);                    startActivity(new Intent(Splash.this, MainMenu.class));                    Splash.this.finish();                                             }    }</code></pre><p>Splash.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout 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/splash""&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Menu.java</p><pre><code>public class Menu extends Activity{        /** Called when the activity is first created. */        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);                           setContentView(R.layout.menu);                                               }    }</code></pre><p>Menu.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout 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/menu""&gt;&lt;/AbsoluteLayout&gt;</code></pre>","2355649","","1045074","","2012-02-17 10:56:21","2012-02-17 10:56:21","How can i make a dynamic flipping screen(like that of iPhone) in Android","<android><viewflipper>","4","2","15","",""
"2667133","1","2667762","","2010-04-19 11:58:08","7","6159","<p>I've an application in the market and many users have reported that the app is crashing a lot randomly. I'm trying to fix this but cannot fully understand the logs. Here's a extract from the log, </p><pre><code>04-16 13:16:32.407 E/AndroidRuntime( 9237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.tabview.Tabs3}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$104-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.access$2200(ActivityThread.java:119)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Handler.dispatchMessage(Handler.java:99)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Looper.loop(Looper.java:123)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.main(ActivityThread.java:4363)04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invokeNative(Native Method)04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invoke(Method.java:521)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-16 13:16:32.407 E/AndroidRuntime( 9237): at dalvik.system.NativeStart.main(Native Method)04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$104-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2335)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:648)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.setCurrentTab(TabHost.java:320)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.CustomTabHost.setCurrentTab(CustomTabHost.java:43)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.addTab(TabHost.java:213)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.doCreateTabs(Tabs3.java:180)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.onCreate(Tabs3.java:149)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 11 more04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.ClassCastException: android.view.AbsSavedState$104-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AbsSpinner.onRestoreInstanceState(AbsSpinner.java:440)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.dispatchRestoreInstanceState(View.java:5940)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:1140)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:767)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.restoreHierarchyState(View.java:5919)04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1454)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.onRestoreInstanceState(Activity.java:835)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.performRestoreInstanceState(Activity.java:807)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2473)04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 22 more</code></pre><p>I got this log from one of my users.</p><p>Any help on this would be very very helpful.</p><p>Regards,Hari</p><hr><p>I was finally able to replicate this issue through an emulator set up with 50MB memory and running on GSM network speed. The issue seems to be because of history being cleared and so the data being lost which the app was already having. Not sure how I can handle this though.. any help???</p>","320293","","50049","","2011-08-21 18:59:43","2012-08-24 05:02:17","Classcastexception occurs randomly","<android>","5","2","2","",""
"2667319","1","2667611","","2010-04-19 12:26:26","29","16598","<p>I know I can put escaped HTML tags in string resources. However, looking at the source code for the Contacts application I can see that they have a way of not having to encode the HTML. Quote from the Contacts application <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=res/values/strings.xml;h=e37c1182741baf957fa47c3b2fc345be86b659c1;hb=HEAD"">strings.xml</a>:</p><pre><code>&lt;string name=""contactsSyncPlug""&gt;&lt;font fgcolor=""#ffffffff""&gt;Sync your Google contacts!&lt;/font&gt; \nAfter syncing to your phone, your contacts will be available to you wherever you go.&lt;/string&gt;</code></pre><p>Unfortunately, when I try something similar (like <code>Hello, &lt;b&gt;World&lt;/b&gt;!</code>), <code>getString()</code> returns the string without the tags (I can see that in <code>logcat</code>). Why is that? How can I get the original string, with tags and everything? How is the Contacts application doing it?</p>","180784","","","","","2014-01-22 23:50:24","HTML in string resource?","<android>","4","0","11","",""
"2667324","1","","","2010-04-19 12:27:01","2","937","<p>I'm trying to modify the Notepad tutorial (the Notepadv3 solution) to take in a value into the NoteEdit class, given to by the Notepadv3 class. I've successfully used .putExtra in the OnListItemClick method to place the value into the NoteEdit class, but I'm struggling to do this for the createNote method; I'm getting a force close when I try to create a new note.</p><p>I bet there's a simple solution, but I'm pretty new to Java &amp; Android and would very much appreciate your help.</p><p>Here's the code in question in the Notepadv3 class: </p><pre><code>private void createNote() {    Intent i = new Intent(this, NoteEdit.class);    i.putExtra(""key"", 1);    startActivityForResult(i, ACTIVITY_CREATE);}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, NoteEdit.class);    i.putExtra(NotesDbAdapter.KEY_ROWID, id);    i.putExtra(""key"", 1);    startActivityForResult(i, ACTIVITY_EDIT);}@Overrideprotected void onActivityResult(int requestCode, int resultCode,                                 Intent intent) {    super.onActivityResult(requestCode, resultCode, intent);    fillData();}</code></pre><p>And here's the receiving code in the NoteEdit class:</p><pre><code>mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID)                                         : null;    if (mRowId == null) {        Bundle extras = getIntent().getExtras();                    mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)                                 : null;                    value = extras.getInt(""key"");    }</code></pre><p>I'm fairly sure that (mRowId == null) is not true when I'm using the createNote method so therefore getExtras won't be called. One of my questions would be how can I make my NoteEdit class get this value when I use the createNote method? I'm new to this so sorry if this is a simple question for you all.</p><p>Thanks,</p><p>Joe</p>","310794","","310794","","2010-04-19 12:32:11","2012-01-21 17:31:44","Question about passing data using intents","<android><android-intent>","2","10","","",""
"2667386","1","2667871","","2010-04-19 12:37:24","6","5536","<p>Sometimes when trying to get the Latitude span or Longitude span of a mapview with getLatitudeSpan() and getLongitudeSpan() I get 0 and 360*1E6 respectively. This doesn't happen always but it is a problem, has anybody got this problem? Any workarounds? I tried using getProjection() too but I get the same problem. Here is the piece of code:</p><pre><code>MapView mapView = (MapView) findViewById(R.id.mapview);int lat = mapView.getLatitudeSpan(); // sometimes returns 0int long = mapView.getLongitudeSpan(); // sometimes returns 360*1E6</code></pre>","265375","","","","","2011-11-17 08:24:52","Mapview getLatitudeSpan and getLongitudeSpan not working","<android><android-mapview><latitude-longitude>","4","2","2","",""
"2667399","1","2889233","","2010-04-19 12:39:00","10","6760","<p>When exporting a signed Android application using Eclipse, is there a purpose to using multiple aliases? According to the <a href=""http://developer.android.com/guide/publishing/app-signing.html"">official guide about signing</a>, it's recommended that you sign all applications with the same certificate to allow your applications to share data, code and be updated in modular fashion. Assuming that ""alias"", ""key"" and ""certificate"" are essentially interchangeable in this context, is there a reason why someone would <em>want</em> to use different aliases for all their applications? The only reason I can think of is that it adds more security to your applications, in the sense that a compromised key/password doesn't compromise everything. Are there other reasons?</p><p>Also, is the generated key dependent on the name of the alias? In other words, if you change the name of the alias but not the password, would the generated certificate be different?</p><p>Thanks.</p>","235654","","","","","2013-03-12 18:46:31","Keystore and Aliases - is there a use to multiple aliases?","<android><eclipse><google-play><keystore>","4","1","","",""
"2667470","1","2668088","","2010-04-19 12:48:34","1","1631","<p>I want to create a layout in such a way that on top edittext and button should be there in one row. The search text I enter in editext and click on search button. Then I want to display a custom list view where each row contains image and text.(As per the API demos example list14 I have tried). But when I run the application, button and edittext are being added to each row (i.e., Each row contains a image, text, editext, button. Can Any one guide how to resolve this issue.</p><p>Below is my xml file:</p><pre><code>&lt;!--    &lt;FrameLayout android:layout_width=""wrap_content""    android:layout_height=""0dip"" android:layout_weight=""1""&gt;&lt;/FrameLayout&gt;--&gt;&lt;ImageView android:id=""@+id/icon"" android:layout_width=""48dip""    android:layout_height=""48dip"" /&gt;&lt;TextView android:id=""@+id/text"" android:layout_gravity=""center_vertical""    android:layout_width=""0dip"" android:layout_weight=""1.0""    android:layout_height=""wrap_content"" /&gt;&lt;!--    &lt;EditText android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/prdsearchtb""    android:text=""@string/tb_prd_search_lbl""&gt;&lt;/EditText&gt;--&gt;&lt;!--    &lt;TableLayout android:id=""@+id/TableLayout01""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt; &lt;TableRow&gt;--&gt;&lt;Button android:id=""@+id/prdsrcbutton"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""@string/btn_lbl_prd_search""    android:layout_x=""2px"" android:layout_y=""410px""&gt;&lt;/Button&gt;&lt;!-- &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>--></p><p>and Java File:/** *  */package org.techdata.activity;</p><p>import android.app.AlertDialog;import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;</p><p>/** * @author jayanthg *  */public class ProductSearch extends ListActivity {</p><pre><code>private static class ProductSearchAdapter extends BaseAdapter {    private LayoutInflater mInflater;    private Bitmap mIcon1;    private Bitmap mIcon2;    public ProductSearchAdapter(Context context) {        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);    }    @Override    public int getCount() {        return DATA.length;    }    @Override    public Object getItem(int position) {        return position;    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(final int position, View convertView,            ViewGroup parent) {        ViewHolder holder;        Button btn=null;        if (convertView == null) {            convertView = mInflater.inflate(R.layout.productsearch, 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);            btn=(Button)convertView.findViewById(R.id.prdsrcbutton);            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);        holder.icon.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Log.i(""image"", "" u clicked on icon Position"" + position);            }        });        holder.text.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Log.i(""Text"", "" u clicked on text Position"" + position);            }        });        btn.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Log.i(""Button"",""U clicked on button"");            }        });        return convertView;    }    static class ViewHolder {        TextView text;        ImageView icon;    }    private static final String[] DATA = { ""Abbaye de Belloc"",            ""Abbaye du Mont des Cats"" };}ListView product_search_list;Button srch_btn;EditText srch_text;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new ProductSearchAdapter(this));    // setContentView(R.layout.productsearch);    // getListView().setEmptyView(findViewById(R.id.text));    // srch_text = (EditText)findViewById(R.id.prdsearchtb);    // srch_btn = (Button) findViewById(R.id.prdsearchtb);    // srch_btn.setOnClickListener(new View.OnClickListener() {    //          // @Override    // public void onClick(View v) {    // callProductSearchAdapter();    //    // }    // });}void callProductSearchAdapter() {    setListAdapter(new ProductSearchAdapter(this));}private void createDialog(String title, String text, final Intent i) {    if (i == null) {        AlertDialog ad = new AlertDialog.Builder(this).setIcon(                R.drawable.alert_dialog_icon).setPositiveButton(""Ok"", null)                .setTitle(title).setMessage(text).create();        ad.show();    }}</code></pre><p>}</p><p>Regards:Jayanth</p>","320276","","","","","2010-04-20 06:33:21","How to add Editext and Button to Efficent Adapter which has a Icon and text","<android><listview><textview><edittext><imageview>","1","0","","",""
"2667471","1","2688587","","2010-04-19 12:48:37","3","17669","<p>I have text area and and down to that ""ok"" and ""cancel"" button.when i click on text area keyboard appear and focus on the text area and buttons get hide behind the keyboard.</p><p>i want when text area get focus scroll a little bit and also display the bottom buttons while text area id selected.</p>","216431","","","","","2010-04-22 06:13:59","android scroll down","<android><scrolling><textview>","2","0","2","",""
"2667989","1","2668105","","2010-04-19 14:05:00","1","552","<p>Is there a built in mechanism for server push on Android?</p><p>What I want to achieve is to start an application based on a server request (without involving SMS, only data connection).</p><p>Is this possible without having a service always running?</p><p>ThanksFlaviu </p>","316877","","4419","","2012-04-24 20:53:45","2012-04-24 20:53:45","Is there a built in mechanism for server push on Android?","<android><xtify>","2","0","","",""
"2668282","1","","","2010-04-19 14:37:18","3","29468","<p>How can I copy files to the file system (place) in android? How can I access it?</p>","309166","","","","","2011-12-15 05:59:10","how can I copy files to the file system of android?","<android><filesystems>","5","5","3","",""
"2668445","1","2668939","","2010-04-19 15:00:25","0","2386","<p>I have a strange problem. To detect outgoing calls I have registered a broadcast receiver for <code>android.intent.action.PHONE_STATE</code>. When the state becomes OFFHOOK, then a conversation is started. It seems working on emulator: the debugger in fact reaches some code while it doesn't work on real device (Acer Liquid). Is it possible? Which is a way to detect outgoing calls?</p><p>Thanks</p>","269585","","","","","2013-02-28 13:34:47","Detect outgoing calls and problem with a real device","<android><call><broadcastreceiver>","1","0","","",""
"2668750","1","2669270","","2010-04-19 15:38:34","0","586","<p>I need some simple databinding for a Spinner. I want to display 2 items for each dropdownitem.<br>So when the user clicks the spinner I get a list like:</p><pre><code>-------------------Name123456-------------------Name123456-------------------</code></pre><p>I understand this can be done when using a Cursor, according to the <a href=""http://developer.android.com/guide/topics/ui/binding.html"" rel=""nofollow"">databinding info</a> on android dev. Like:</p><pre><code>SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,    R.layout.my_custom_spinner_item_layout,    cur,    new String[] {People.NAME, People.ID},     new int[] {android.R.id.text1, android.R.id.text2}); </code></pre><p>However, I don't get my data from a database, so I don't use a cursor, I use a ArrayAdapter. Unfortunately it looks like there is no support for databinding with this adapter. </p><p>Is there a way to do this?</p>","107029","","107029","","2010-04-19 16:12:34","2010-04-19 16:53:53","Android: databinding when using a ArrayAdapter: possible?","<android><data-binding>","1","0","","",""
"2668801","1","2669882","","2010-04-19 15:45:10","1","675","<p>If I have a Android Dev Phone 2 phone that comes with 1.6, can I upgrade it to Android 2.1 ?</p><p>Thanks</p>","237115","","","","","2010-04-20 03:32:03","android - is it possible to update the Android Dev Phone 2 sold by google to 2.1 OS?","<android><version>","2","0","","",""
"2668828","1","2668869","","2010-04-19 15:48:45","1","1271","<p>Does anyone know if it's possible to use Multitouch on an Android 1.5 device?</p><p>I have a HTC Hero, and it's still running 1.5 (HTC have been a little slow on getting the 2.1 ROM out).</p><p>The Android MotionEvent documentation shows the constants (ACTION_POINTER_1_DOWN, ACTION_POINTER_1_UP.....etc...) I need to implement multitouch as only avaliable from API 5 :(</p><p>Is there a way round this other then waiting for HTC to get the update out or buying a 2.1 handset?</p><p>Code Snippet:</p><pre><code>public boolean onTouchEvent (MotionEvent event) {    //TODO: determine if the event object is an ACTION_POINTER_DOWN etc...    //for ACTOIN_DOWN it is    if(event.getAction() == MotionEvent.ACTION_DOWN) {        //do something here.....    }}</code></pre>","119396","","119396","","2010-04-21 11:03:08","2010-04-29 15:07:18","Android 1.5 Multitouch","<android><multi-touch>","2","2","","",""
"2669181","1","","","2010-04-19 16:41:54","0","240","<p>Here's the problem I'm facing: trying to do my own application update I download the update apk from a web server on the sd card and then I launch the Package Installer with the downloading path (while the old application is running). So far after the package installer starts and the user agrees to install the application  I get the following message ""MyApp Could not be installed on this phone"" and in the logcat then following  message is printed:""No package identifier when getting value for resource number 0x00000000"". I could not find a reason for this behaviour, so please if there is something that I'm missing do point it to me!</p><pre><code>try {   BufferedInputStream getit = new BufferedInputStream(new URL(""http://mywebserver:8080/myapk.apk"").openStream());   FileOutputStream saveit = new FileOutputStream(path);   BufferedOutputStream bout = new BufferedOutputStream(saveit,1024);   byte data[] = new byte[1024];   int readed = getit.read(data,0,1024);   while(readed != -1)    {        bout.write(data,0,readed);        readed = getit.read(data,0,1024);    }    bout.close();    getit.close();    saveit.close();}catch(Exception e){   e.printStackTrace}</code></pre>","284609","","227532","","2010-04-19 19:35:09","2010-04-19 19:35:47","An update question!","<android>","1","0","","",""
"2669647","1","2670118","","2010-04-19 17:53:37","2","1605","<p>I've tried both of the following:</p><pre><code>repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.1repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair</code></pre><p>Both give the same output:</p><pre><code>Getting repo ...   from git://android.git.kernel.org/tools/repo.gitfatal: The remote end hung up unexpectedly</code></pre><p>Any ideas what I am doing wrong?  </p><p>fyi I tried again at 0700 uk time and worked fine this time</p><pre><code>$ repo init -u git://android.git.kernel.org/platform/manifest.git -b eclairGetting repo ...</code></pre>","320592","","844882","","2012-03-18 05:00:27","2012-03-18 05:00:27","How to download eclair sources with repo","<android><git><repository>","1","0","","",""
"2669908","1","2672044","","2010-04-19 18:40:37","21","10222","<p>Is there any cheat sheet available for Android programming. Most commonly used classes with package description, just like a reference sheet would be nice.</p>","165375","","100297","","2013-10-19 11:24:13","2013-10-19 11:24:13","Cheatsheet for Android programming?","<android>","5","4","14","2013-10-19 01:00:36",""
"2670011","1","2670085","","2010-04-19 18:59:17","0","755","<p>Actually I am confronted with a Problem. I've got a "".apk-File"" in one Package of my Application. apk is a kind of a jar File (apk = Android Package).I now want to copy this jar-file out of my Programm onto any other Location at the PC. Normally I would do this by using: </p><pre><code>FileInputStream is = new FileInputStream(this.getClass().getResource(""/resources/myApp.apk"").getFile());</code></pre><p>And then write it on the disk with using a FileOutputStream.... but since an .apk is a kind of a .jar it doesn't work. It just copies the .apk file. but without the containing other files. </p><p>any help would be appreciated</p>","209902","","","","","2010-04-19 20:41:08","Java - copy Jar Folder","<java><android><jar><getresource>","2","0","","",""
"2670391","1","2716946","","2010-04-19 19:55:44","0","2297","<p>I'm  developing an application which is mainly a webview and will display a JQTouch UI.  Two of the 3 views work just fine, however, I have a view which loads another page with a form which does not work at all.  This view loads up just fine but when I click the link to go to the form the link just stays highlighted and nothing happens.  I have overriden all of the methods in webviewclient and webchromeclient and placed breakpoints within with no luck.  None of the hooks catch when I click the links.</p><p>The part that truly confounds me is that it works in the phones browser but not in my webview.  Is there a setting on webview that I may be missing which would make it act like the phones browser?</p><p>Any help or suggestions would be appreciated.</p>","303256","","","","","2010-12-22 19:28:20","JQTouch android webView configuration","<android><webview><jqtouch>","1","1","","",""
"2670458","1","","","2010-04-19 20:04:14","1","2476","<p>my program compiles nicely for Android, however when I try to copy it to the Android emulator, it gives the following error:</p><pre><code>knight666@Katja-Linux /media/Data/Shared/Galaxians $ acpy Galaxians.androidFilename: 'Galaxians.android'819 KB/s (420657 bytes in 0.501s)link_image[1638]:   825 could not load needed library 'libstdc++.so.6' for '/system/sbin/Galaxians.android' (load_library[984]: Library 'libstdc++.so.6' not found)CANNOT LINK EXECUTABLE</code></pre><p><code>acpy</code> is a small script I wrote that does the following:</p><pre><code>#!/bin/shFILEPATH=`dirname $1`FILENAME=`basename $1 .c`echo ""Filename: '$FILENAME'""adb push $FILEPATH/$FILENAME /system/sbin/$FILENAMEadb shell chmod 777 /system/sbin/$FILENAMEadb shell /system/sbin/$FILENAME</code></pre><p>Here is how I build my application:</p><pre><code>oem@androiddev /media/YoghurtGum/Tests/Galaxians $ sudo makearm-none-linux-gnueabi-g++ -static-libgcc -g -Wall -Werror -O2 -w -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -c src/Alien.cpp -o intermediate/Alien.oarm-none-linux-gnueabi-g++ -static-libgcc -g -Wall -Werror -O2 -w -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -c src/Bullet.cpp -o intermediate/Bullet.oarm-none-linux-gnueabi-g++ -static-libgcc -g -Wall -Werror -O2 -w -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -c src/Game.cpp -o intermediate/Game.oarm-none-linux-gnueabi-g++ -static-libgcc -g -Wall -Werror -O2 -w -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -c src/Player.cpp -o intermediate/Player.oarm-none-linux-gnueabi-gcc -Wl,--entry=main,-dynamic-linker=/system/bin/linker,-rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib,-rpath=../../YoghurtGum/lib/Android,-L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++ intermediate/Alien.o intermediate/Bullet.o intermediate/Game.o intermediate/Player.o ../../YoghurtGum/lib/Android/libstdc++.a ../../YoghurtGum/bin/YoghurtGum.a -o bin/Galaxians.android</code></pre><p>Line breaks are only for clarity, none exist in the actual output.</p><p>YoghurtGum is my game library that already statically and dynamically links to <code>libstdc++</code>.</p><p>When I remove <code>lstdc++</code>, the program doesn't compile because it can't find the library. </p><p>Is there a way to link to <code>stdlibc++</code> statically or link the application to the correct dynamic library in the emulator?</p><p>Thanks in advance.</p>","141057","","","","","2011-03-16 14:57:59","Android: Statically link against libstdc++","<c++><android><linux><android-ndk>","1","0","1","",""
"2670719","1","2670823","","2010-04-19 20:41:48","1","1757","<p>I slapped together a simple test application that has a button, and makes a noise when the user clicks on it.  Here are it's method:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button b = (Button)findViewById(R.id.easy);    b.setOnClickListener(this);}public void onClick(View v) {    MediaPlayer mp = MediaPlayer.create(this, R.raw.easy);    mp.start();    while(true) {        if (!mp.isPlaying()) {            mp.release();            break;        }    }}</code></pre><p>My question is, why is onCreate acting like it's in a while loop?  I can click on the button whenever, and it makes the sound.  I might think it was just a property of listeners, but the Button object wasn't a member variable.  I thought that Android would just go through onCreate onse, and proceed onto the next lifecycle method.</p><p>Also, I know that my current way of seeing if the sound is playing is crap...I'll get to that later.  :)</p><p>Thank you.</p>","288439","","","","","2010-04-19 20:57:03","Application lifecycle and onCreate method in the the android sdk","<java><android><button><listener>","1","0","1","",""
"2671069","1","2825608","","2010-04-19 21:30:51","7","12304","<p>On the emulator, I can unmount the SD card from the Settings.</p><p>I can then mount it on my OS, then unmount it normally.</p><p>I haven't been able to figure out how to re-mount it then on the emulator (without rebooting it).</p><p>hints:</p><ul><li>the <code>adb</code> command <code>remount</code> is unrelated: it's about <code>/system</code></li><li>the <code>emulator</code> command is unrelated: it's only about starting the emulator</li><li>mounting the SD card in two places of course messing everything up (I tried)</li></ul><p>more:</p><ul><li><p><code>mount</code> outputs the following:</p><p><code>/dev/block//vold/179:0 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0</code></p></li><li><p>trying to mount again from the shell after unmounting it, using the same options as above, gives a segfault</p></li><li>no idea why the double slash in <code>block//vold</code>, I guess it's just a typo</li></ul>","207655","","1892635","","2013-01-31 20:00:24","2013-01-31 20:00:24","(re)mounting the SD card on android emulator","<android><linux><android-emulator><sd-card><mount>","2","3","2","",""
"2671108","1","5806559","","2010-04-19 21:36:39","7","1494","<p>DialerFilter, located in Android.widget has almost zero documentation. Has anyone tried to use it / knows what it does?</p>","312463","","","","","2011-04-27 15:25:09","Has anyone ever tried to use DialerFilter?","<android><android-widget>","1","0","1","",""
"2671163","1","2671746","","2010-04-19 21:48:17","0","2033","<p>I've been looking all over <a href=""http://android.git.kernel.org"" rel=""nofollow"">http://android.git.kernel.org</a> for <code>Genie Widget</code> code but unfortunately there's no top level search and lot of GITs to go through. If someone can point me to the right location I would really appreciate it.The <code>Genie Widget</code> is also known as <code>News &amp; Weather</code></p><p>P.S. According to the good folks from Android Developer forum, <a href=""http://groups.google.com/group/android-developers/browse_frm/thread/00e05d65dc84aa76?pli=1"" rel=""nofollow"">this widget's source is not available</a> plus they hinted that implementation is also subpar.</p>","135946","","540162","","2011-10-08 18:25:59","2011-10-08 18:25:59","Android - where's code for Genie widget?","<android><source-code>","1","3","1","",""
"2671404","1","2707271","","2010-04-19 22:41:37","3","2113","<p>I'm trying to get an AutoCompleteTextView(ACTV) to display results I'm a getting from a network resource. I have set the completion-treshold to 2 and I can see that the request is fired when I enter to characters.</p><p>The result I am getting is the correct one. Lets say I write ""ca"", and I get the result ""car"" as an autocompletion. I have a callback function which receives the result from an AsyncTask and puts the result into the ArrayAdapter. Then I call .showDropDown() on the ACTV and an empty dropdown is shown (half the size of a normal element). Then if I enter the last letter ""r"" and the ACTV shows ""car"", the dropdown is shown and the result is suddenly in the list.</p><p>The same happens if I have entered two characters (which returns a valid result), and the remove the last letter. When the letter is removed, ""car"" is shown as an autocompletion value.</p><p>Has anyone had this problem? It looks like the adapter is filled with the result, but the result does not show until the next action I do. I have also tried to run .notifyDataSetChanged() after I have added the result to the adapter, but that should not be needed, or?</p>","217283","","","","","2010-04-25 05:30:33","AutoCompleteTextView not displaying result even when the ArrayAdapter is updated","<android><adapter><autocompletetextview>","1","1","1","",""
"2671430","1","","","2010-04-19 22:50:28","2","608","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view"">How to programmatically setting style attribute in a view</a>  </p></blockquote><p>hello</p><p>I was wondering how to assign a style via code in adroid.</p><p>suppose I have a TextView created with the following snippet:</p><pre><code>TextView myText = new TextView(this);     </code></pre><p>how do I assign the class xxx so that myText will be styled like an hard coded TextView like this:    </p><pre><code>&lt;TextView style=""@style/xxx"" /&gt; </code></pre><p>thanks</p>","87624","","","","","2010-04-19 23:45:52","adding the style attribute via code","<android>","0","0","2","2011-06-03 10:13:49",""
"2671434","1","","","2010-04-19 22:51:19","5","701","<p>I am wondering what my options are for using GData and specifically the analytics api on android to build a small widget. After searching around for a while I couldnt come up with any libraries with decent examples.</p><p>Are there any dedicated libraries with some decent examples / doco to do this sort of thing? I would like to target 1.5 but if the are 2.0 only I guess that is fine too.</p>","71683","","71683","","2010-04-19 22:57:13","2011-08-17 18:25:59","Using GData and the Google Analytics on Android","<android><google-analytics><gdata-api>","2","0","3","",""
"2671523","1","2671720","","2010-04-19 23:09:42","1","234","<p>I have a text view. I would like to add a 'vertical line' on the left side of the TextView to act as a separator.</p><p>Is there a way to do that?</p><p>Thank you.</p>","286802","","","","","2010-04-20 00:08:20","How to set the left background of an TextView","<android>","1","0","1","",""
"2671552","1","","","2010-04-19 23:14:37","13","4230","<p>I have an ArrayAdapter wrapped around an ArrayList of custom objects.  I'd like to write a custom filter for that adapter so that when I call <code>getListAdapter().getFilter().filter(""abc"")</code> the list will get filtered by an arbitrary transformation of ""abc"".</p><p>I thought I would just try to override <code>ArrayAdapter.getFilter()</code>, but that requires I re-implement the private <code>ArrayAdapter.ArrayFilter</code> which requires access to a bunch of ArrayAdapter's private instances.</p><p>What's the simplest way to do this?</p>","82156","","","","","2010-11-21 00:23:30","How to override filter in android's ArrayAdapter?","<android><filter><android-arrayadapter>","1","2","8","",""
"2671652","1","2671756","","2010-04-19 23:47:05","4","6022","<p>I need to obtain the velocity of an android device, based on the accelerometer values. I made a code that allows me to get the accelerometer values, and then I calculate the velocity, using the formula:v = v0 + at. (vector calculation)</p><p>My problem is that my velocity only increases and never decreases. I think the problem is that the device never gets an negative acceleration. </p><p>Can you help me with this?</p>","47177","","","","","2010-08-22 12:34:33","Android Speed based on accelerometer values","<java><android>","3","0","2","",""
"2671657","1","2879680","","2010-04-19 23:47:46","9","5077","<p>I have an application, which has a Spinner that I want populated with some numbers (4,8,12,16).  I created an integer-array object in strings.xml with the items mentioned above,  set the entries of the Spinner to the integer-array, and when I run the app I get:</p><pre><code>04-19 23:38:48.016: ERROR/AndroidRuntime(10193): java.lang.NullPointerException04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:198)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.View.measure(View.java:7965)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.View.measure(View.java:7965)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.View.measure(View.java:7965)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.View.measure(View.java:7965)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.View.measure(View.java:7965)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1632)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.os.Handler.dispatchMessage(Handler.java:99)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.os.Looper.loop(Looper.java:123)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at android.app.ActivityThread.main(ActivityThread.java:4310)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at java.lang.reflect.Method.invokeNative(Native Method)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at java.lang.reflect.Method.invoke(Method.java:521)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-19 23:38:48.016: ERROR/AndroidRuntime(10193):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>As soon as I changed the array to a string-array, this works fine.  Is this normal?  I realize that I can (and will) just convert the string array values to an int, but it seems weird that I have to.</p><p>Thanks!</p><p>EDIT: Anyone?  Anything?</p>","231768","","231768","","2010-05-13 21:38:46","2012-04-13 14:22:21","Spinner cannot load an integer array?","<android><spinner><android-arrayadapter>","2","2","1","",""
"2671816","1","2671872","","2010-04-20 00:39:05","0","214","<p>Building an iPhone OS application that will allow users to anonymously post information to a web application (in my particular case it will be a Rails based site) ... and I want to ensure that I only accept posts that originate from a specific application running on an iPhone/iTouch.</p><p>How is this best accomplished?</p><p>(btw, if your answer applies to Android please feel free to post it here as well as I'm curious to know if the techniques are the same or vary).</p><p>Thanks</p>","54818","","","","","2010-04-20 07:53:39","How to ensure/determine that a post is coming from an specific application running on an iPhone/iTouch?","<iphone><android><web-applications>","4","0","1","",""
"2671871","1","2671876","","2010-04-20 00:55:53","4","1054","<p>Besides making an HTML5 app (which may very well be the answer to this question), are there any other languages I can develop in for android besides Java?</p>","1063","","","","","2014-01-18 16:19:12","Can I develop for Android in something other than Java?","<java><android>","5","0","2","",""
"2671955","1","2672381","","2010-04-20 01:20:46","9","5071","<p>My Android application uses a secret key to generate a token for authentication purposes. Is there a more secure way to store this than just putting this in the data store? I think for the iPhone, we store it in the keychain. I am aware of android.accounts.AccountManager, but this seems to give other applications potentially the ability to access the password (if the user selects the wrong option) and so seems less secure.</p>","165495","","","","","2012-11-28 23:08:00","Storing a secret key on Android","<android>","3","0","3","",""
"2672073","1","","","2010-04-20 01:59:11","0","1864","<p>I had an activity which calls a thread for 10times one after another. However, if the network is slow or too much information loaded, force close will occur. Will adding sleep in each thread help to solve this problem? or is there any other ways to solve it?</p><pre><code>   public void run() {         if(thread_op.equalsIgnoreCase(""xml"")){              readXML();         }         else if(thread_op.equalsIgnoreCase(""getImg"")){              getWallpaperThumb();         }         handler.sendEmptyMessage(0);    }    private Handler handler = new Handler() {            @Override            public void handleMessage(Message msg) {                    int count = 0;                    if (!myExampleHandler.filenames.isEmpty()){                          count = myExampleHandler.filenames.size();                    }                    count = 5;                    if(thread_op.equalsIgnoreCase(""xml"")){                            pd.dismiss();                            thread_op = ""getImg"";                            btn_more.setBackgroundResource(R.drawable.btn_more);                    }                    else if(thread_op.equalsIgnoreCase(""getImg"")){                            setWallpaperThumb();                            index++;                            if (index &lt; count){                                    Thread thread = new Thread(GalleryWallpapers.this);                                    thread.start();                            }                    }            }    };</code></pre>","679696","","679696","","2010-04-20 02:42:40","2010-04-20 18:15:21","sleep/wait in android apps","<android><sleep>","2","2","1","",""
"2672100","1","2672121","","2010-04-20 02:07:01","22","28383","<p>I want to develop applications on Android. Can the SDK be installed on Mac?</p>","283638","","126039","","2010-04-20 02:09:34","2013-11-03 09:10:06","Can I develop Android on Mac?","<android>","8","1","14","2012-08-14 03:27:59",""
"2672231","1","","","2010-04-20 02:50:57","1","2944","<p>I have a ViewFlipper for which I want a listener to fire when the child displayed is changed.  I have set an OnFocusChangeListener to the ViewFlipper but it never fires when I flip from child 0 to child 1 or vice-versa.  The ViewFlipper contains two RelativeLayouts and I have tried setting OnFocusChangeListeners for those but I get a ClassCastException when I try to set it.  Here's my code:</p><pre><code>RelativeLayout songsLayout = (RelativeLayout) findViewById(R.id.song_page_layout);songsLayout.setOnFocusChangeListener(new OnFocusChangeListener() {    public void onFocusChange(View view, boolean hasFocus) {        showPopUp(""View "" + view.getId() + "" now has focus: "" + hasFocus);    }       } );</code></pre><p>R.is.song_page_layout is one of my RelativeLayouts and showPopUp() is a function I use to show, well, popups.</p><p>Does anyone have working code for some sort of trigger that fires when a ViewFlipper changes which child is displayed?</p>","267369","","","","","2010-04-20 03:45:07","android: How to set a listener that fires when my ViewFlipper shows a new child","<android><layout><view><listener><viewflipper>","1","0","","",""
"2672258","1","4380853","","2010-04-20 03:00:07","1","1274","<p>I am writing a tutorial about the HTML5 Canvas for mobile and did some basic tests. While I can call the getDataURL() Method on an iPhone's HTML5 Canvas Element, it does not seem to return the data URL on Android 2.1 (Google Nexus One) and it's webkit-based default browser. Here is the sample:</p><pre>var dataURL = canvas.toDataURL();var img = document.createElement('img');img.setAttribute('src', dataURL);document.getElementById('box').appendChild(img);</pre><p>This will work on iPhone, it will add a new image element with the same content as the canvas. It does nothing or fails on Android 2.1. </p><p>Has anyone ever gotten this to work? </p><p>I am also wondering if anyone could help me with understanding the WebKit Build numbers and what it means with regards to what features I can expect. For the iphone, I see a build number of 528.18, on Android 2.1's Browser I see (from the user agent strign) a WebKit build 530.17.So it looks Android 2.1's webkit browser is more up to date, still some features work on iPhone's webkit but not on Android. Does this comparison just make no sense?</p><p>Thanx all!</p>","320938","","","","","2010-12-07 19:41:04","Can I use Data URLs in Android 2.1's Webkit-based browser?","<android><html5><webkit><canvas>","2","0","","",""
"2672314","1","4828102","","2010-04-20 03:19:07","4","4128","<p>Hey folks,i am developing a RTP client on an Android device which can play streaming videos from a server. I am confused regarding how should i start about?i am thinking of developing a web app, using HTML,CSS and Javascript, which can later be wrapped in Android.is this approach correct? does javascript support real time media player? please guide me, i am a fresher and completely clueless..:(</p>","318127","","","","","2013-08-11 12:18:15","RTP Client Application on Android Mobile Device","<android><rtp>","3","0","2","",""
"2672478","1","2673328","","2010-04-20 04:09:03","0","727","<p>I am trying to display the list of songs using array adapters. But the problem is i couldnt display the list and only empty screen with preset background is showing up. Here's the code...All the thee are seperate classes... Plz help me...</p><pre><code>public class SongsAdapter extends ArrayAdapter&lt;SongsList&gt;{private Context context;TextView tvTitle;TextView tvMovie;TextView tvSinger;String s;    public SongsAdapter(Context context, int resource,            int textViewResourceId, String title) {        super(context, resource, textViewResourceId);        this.context=context;    }public View getView(int position, View convertView, ViewGroup parent) {    final int i=position;       List&lt;SongsList&gt; listSongs = new ArrayList&lt;SongsList&gt;();    String title = listSongs.get(i).gettitleName().toString();    String album = listSongs.get(i).getmovieName().toString();    String artist = listSongs.get(i).getsingerName().toString();    String imgal = listSongs.get(i).gettitleName().toString();    LayoutInflater inflater = ((Activity) context).getLayoutInflater();    View v = inflater.inflate(R.layout.row, null);     tvTitle=(TextView)v.findViewById(R.id.text2);    tvMovie=(TextView)v.findViewById(R.id.text3);    tvSinger=(TextView)v.findViewById(R.id.text1);    tvTitle.setText(title);    tvMovie.setText(album);    tvSinger.setText(artist);    final ImageView im=(ImageView)v.findViewById(R.id.image);        s=""http://www.gorinka.com/""+imgal;         String imgPath=s;        AsyncImageLoaderv asyncImageLoaderv=new AsyncImageLoaderv();        Bitmap cachedImage = asyncImageLoaderv.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {            public void imageLoaded(Bitmap imageDrawable, String imageUrl) {                im.setImageBitmap(imageDrawable);           }          });         im.setImageBitmap(cachedImage);       return v;}   </code></pre><hr><pre><code> public class imageloader implements Runnable{        private String ss;        private ImageView im;         public imageloader(String s,  ImageView im) {             this.ss=s;             this.im=im;             Thread thread = new Thread(this);             thread.start();             }        public void run(){             try {                 HttpGet httpRequest = null;                              httpRequest = new HttpGet(ss);                  HttpClient httpclient = new DefaultHttpClient();                    HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);                    HttpEntity entity = response.getEntity();                    BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);                     InputStream is = bufHttpEntity.getContent();                     Bitmap bm = BitmapFactory.decodeStream(is);                     Log.d(""img"",""img"");                     is.close();                     im.setImageBitmap(bm);             } catch (Exception t) {                Log.e(""bitmap url"", ""Exception in updateStatus()"", t);            }     }  }}</code></pre><hr><pre><code>public class SongsList {private String titleName;private String movieName;private String singerName;private String imagePath;private String mediaPath;// Constructor for the SongsList classpublic SongsList(String titleName, String movieName, String singerName,String imagePath,String mediaPath ) {    super();    this.titleName = titleName;    this.movieName = movieName;    this.singerName = singerName;    this.imagePath = imagePath;    this.mediaPath = mediaPath;}public String gettitleName() {    return titleName;}public void settitleName(String titleName) {    this.titleName = titleName;}public String getmovieName() {    return movieName;}public void setmovieName(String movieName) {    this.movieName = movieName;}public String getsingerName() {    return singerName;}public void setsingerName(String singerName) {    this.singerName = singerName;}public String getimagePath() {    return imagePath;}public void setimagePath(String imagePath) {    this.imagePath = imagePath;}public String getmediaPath() {    return mediaPath;}public void setmediaPath(String mediaPath) {    this.mediaPath = mediaPath;}}</code></pre><hr><pre><code>public class MusicListActivity extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.openadiuofile);    ListView list = (ListView)findViewById(R.id.list1);    SongsAdapter adapter = new SongsAdapter(this,R.layout.row, R.id.text2, null);    list.setAdapter(adapter);}   }</code></pre>","303155","","114066","","2012-01-27 08:51:24","2012-01-27 08:51:24","How to correctly display a list of songs using an ArrayAdapter?","<android><android-listview>","1","0","","",""
"2672618","1","2904169","","2010-04-20 04:49:53","0","512","<p>I have a ListView with a ContextMenu, it has one CheckBox (the CheckBox has android:focusable=""false"") and one TextView per row, but you can hide the TextView in the preferences menu. </p><p>After doing that, the CheckBox wasn't registering the ContextMenu, so of course, why not registerForContextMenu(cb) and unregisterForContextMenu(getListView())? Yes, i did that, but then, when when i call the delete command of onContextItemSelected, the app crashs.</p><pre><code>  AdapterContextMenuInfo info=(AdapterContextMenuInfo)item.getMenuInfo();  db.deletarTarefa(info.id);</code></pre><p>So here i am, accepting ideias and help! :)</p>","2443607","","114066","","2010-04-20 07:29:38","2010-05-25 11:41:27","CheckBox and the ContextMenu","<android><listview><checkbox>","1","1","","",""
"2672809","1","2674797","","2010-04-20 05:39:13","0","526","<p>is there any posibilty to intercept the contact.if user add,delete and update any contact system notify that changes occur in the contact.</p><p>thanks</p>","309990","","","","","2010-07-10 00:19:43","contacts interception","<android><contacts>","1","0","","",""
"2672922","1","2672950","","2010-04-20 06:08:40","13","9825","<p>I have used <code>PreferenceActivity</code> to have preference in my android application. I want one preference say ""pref 2"" to be enabled when other preference say ""pref 1"" is NOT checked and ""pref 2"" to be disabled when ""pref 1"" is checked. i.e.  exactly opposite of the <code>android:dependancy</code> attribute.</p><p>How can I do that?</p>","301444","","","","","2011-06-23 15:03:25","How to enable a preference in my android application when other preference is disabled?","<android><android-preferences>","5","0","2","",""
"2672993","1","","","2010-04-20 06:22:38","1","1809","<p>I have multiple ListViews and would like to add those to Gallery.</p><p>I tried with addView but it is not supported since Gallery view is an AdapterView.</p><p>Can someone let me know how to go about it?</p><p>Regards</p><p>Sunil</p>","261566","","","","","2011-03-16 08:59:24","How to add View to Gallery?","<android><view><gallery><add>","2","0","1","",""
"2673107","1","","","2010-04-20 06:42:18","0","1282","<p>Does the calendar application in Android maintain a cache of its database?Whenever I edit and mark some events via the calendar app, it is stored in the database but if I edit the calendar.db from some outside source the changes made are not reflected in the calendar app. So my question is:</p><ul><li>Does the calendar app maintain a cache or some other form of database?</li><li>If yes then where and how?</li></ul>","321033","","15168","","2010-04-20 06:48:28","2010-04-20 07:06:03","Storage of events in Calendar application in Android 2.1","<android><calendar>","2","1","","",""
"2673128","1","2674244","","2010-04-20 06:46:58","0","258","<p>I have the below code which is suppose to show a list of contact with check box on left side, I use Android API version 4 and running on a emulator with Android 2.1. The check box is shown but not the contact names right to check box is shown. What is that I am doing wrong.</p><pre><code>public class CheckListActivity extends ListActivity {    private SimpleCursorAdapter adapter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Cursor c = getContentResolver().query(People.CONTENT_URI, null, null,                null, null);        startManagingCursor(c);        String[] projection = new String[] { People.DISPLAY_NAME };        int[] names = new int[] { R.id.text_view };        adapter = new SimpleCursorAdapter(this, R.layout.main, c, projection, names);        this.setListAdapter(adapter);    }}</code></pre>","165375","","","","","2010-04-20 10:22:13","Why is android contact detail not shown?","<android><listview><contacts>","1","0","","",""
"2673323","1","","","2010-04-20 07:27:24","10","13454","<p>I'm trying to find information on how to programmatically access the <code>HTC Droid Incredible's</code> supposed <strong><code>8GB</code></strong> of <code>Internal Storage Memory</code>.</p><p>To determine the <code>External Storage (SD Card) Location</code>, I'm using the command:  </p><pre><code>android.os.Environment.getExternalStorageDirectory().</code></pre><p>I've not been able to find any corollary for <code>Internal phone Storage</code>.</p><p>In examining <strong>HTC/Google Nexus One</strong>, <strong>Motorola Droid</strong>, and <strong>HTC Dream/G1 phones</strong>, there (as would be expected) does not appear to be any <code>Mount Point</code> for such <code>Arbitrary Internal Storage</code>.  </p><p>On these phones the <code>Internal Storage</code> is divided amongst <code>/data</code>, <code>/system</code>, and <code>/cache</code> partitions.  </p><p>The Incredible's <code>Internal Storage</code> is certainly not going to be located in <code>/system</code>.  <code>/cache</code> is also unlikely given that it is globally <strong>non-readable/non-executable</strong>.  </p><p>I'd read in reviews that the phone will still be limited to <code>512MB</code> or so for apps, suggesting that it is not simply a subdirectory of <code>/data</code>.</p><p>Any suggestions would be greatly appreciated.  I do not have access to a <code>Droid Incredible</code> unit myself, of course.</p>","321049","","1155805","","2012-08-21 04:51:15","2012-08-21 04:51:15","Programmitically accessing internal storage (not SD card) on Verizon HTC Droid Incredible (Android)","<android>","2","0","4","",""
"2673338","1","","","2010-04-20 07:30:32","0","1274","<p>is there any way to intercept MMS(not SMS).How to track outgoing and incoming MMS.i have completed SMS interception but not get any appropriate help to implement MMS interception.also provide links also if possible.</p><p>thanks.</p>","309990","","950427","","2014-02-17 03:21:51","2014-02-17 03:21:51","How to receive MMS in Android?","<android><mms>","0","3","1","",""
"2673436","1","2799584","","2010-04-20 07:49:05","14","15956","<p>I'm trying to create a mobile website for android. When I set the width of the body to 480px (the width of the screen) the result is about 50% larger than what I expect. It seems that android is scaling what it draws and messing up all my layouts. Does anyone know how to disable this, or work around it? </p><p>I'm already using this:</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"" /&gt;</code></pre>","92259","","","","","2014-01-22 07:59:28","Android browser scaling?","<android><browser><mobile><webkit>","2","0","1","",""
"2673497","1","2674057","","2010-04-20 08:00:21","0","994","<p>Is there any way to modify the generic Android Exception message ""The application ... has stopped unexpectedly. Please try again later.” to display something more meaningful to the user?</p>","299080","","","","","2010-04-20 09:50:59","How to change Exception message, ""The application ... has stopped unexpectedly. Please try again later.”","<android><exception><crash><message>","1","0","","",""
"2673506","1","3085258","","2010-04-20 08:02:02","0","1357","<p>A month ago I asked this <a href=""http://stackoverflow.com/questions/2411281/iphone-like-keychain-in-android"">question</a>. Even with a Bounty nobody came up with a better answer then using the Imei of the device to identify the user and then sync the phone with the server. </p><p>Now I stumbled across the Android <a href=""http://developer.android.com/reference/android/accounts/AccountManager.html"" rel=""nofollow"">AccountManager</a> classes. Would it be possible to use this classes to store a username and a password that could be accessed after a delete/reeinstall cycle of my application?  </p><p>If yes how would I do this? And would that require the user to enter its keystore credentials every time the application runs and the keystore isn't opened already?</p>","114066","","137483","","2010-06-16 16:01:27","2011-03-08 14:48:54","Using the android Account Manager to keep a username even if the app is deleted","<android><accountmanager>","2","0","","",""
"2673510","1","2673624","","2010-04-20 08:02:59","5","1768","<p>I have a static Preferences class that hold some application preferences and stuff like that. Is it ok to store reference to ApplicationContext there? I need that reference so i can get cache folder and stuff like that in classes that don't inherit Activity.</p>","189986","","","","","2010-04-20 08:26:42","Android - storing references to ApplicationContext","<java><android><static><reference>","1","0","2","",""
"2673674","1","2674362","","2010-04-20 08:36:49","10","4082","<p>In the new version(s) of Android such as version 2.1, default widget (music widget, news and weather widget, youtube widget) have been restyled to use a black background with a white radial gradient at the top in the middle. I've seen other widgets starting to use the exact same background.</p><p>However, I can't find this background anywhere. The widget design guidelines (http://developer.android.com/intl/fr/guide/practices/ui_guidelines/widget_design.html) still refer to the outdated background (or frames as they are referred to on that page).</p><p>How can I get hold of that background? Ofcourse, I could try to design it myself to make it look like the default style as much as possible but that's seems stupid. :)</p>","321103","","21234","","2010-06-25 13:19:54","2012-11-29 20:19:57","Android widget design - default black background","<android><design><themes><android-widget>","4","0","4","",""
"2673746","1","","","2010-04-20 08:47:51","15","6698","<p>I want to test my Android applications UI, with keyevents and pressed buttons and so on. I've read som documentation that Instrumentation would be able to use for this purpose. </p><p>Anyone with expericence with using Instrumentation for UI testing?</p>","270273","","","","","2014-03-26 07:57:46","GUI testing with Instrumentation in Android","<android><gui><testing><user-interface><instrumentation>","4","2","4","",""
"2673956","1","2674836","","2010-04-20 09:33:25","0","622","<p>How to add ListView to MapView from the xml resource ?</p><p>In order words, I am trying to make a screen contains google MapView and ListView. </p><p>Because impossible to extends 2 Activitys' (ListActivity &amp; MapActvity), I am trying to add a ListView(It is created from xml resource) to MapView.</p><p>Thanks in advance.</p>","164589","","","","","2010-04-20 11:59:12","How to add ListView to MapView from the xml resource?","<android><layout><activity>","1","0","","",""
"2673960","1","2674842","","2010-04-20 09:34:03","0","143","<p>I have a curiosity about application updates . What happens after such a process with the resources supposing that the update needs different resources than the ones the old version used ? Are they overwritten ?( like overwrite string.xml) or the old resources are deleted and replaced with the new ones ?</p>","304866","","958370","","2012-02-04 10:59:42","2012-02-04 10:59:42","application resources after update","<android><android-resources>","1","0","","",""
"2674166","1","","","2010-04-20 10:09:09","1","1624","<p>In my android development project under the folder <code>res</code> there are all the resources my application uses. The size is 3.11 mb and contains 1013 files . On the other hand in the <code>apk</code> there is the folder <code>res</code> with all the resources as well , but this has a size of only 760 kb and contains only 332 files . Now does this means that not all the resources are packed? If this is the case what happens when a needed resources is referenced?</p>","304866","","958370","","2012-02-04 10:58:59","2012-02-04 10:58:59","android resources in apk","<android><android-resources>","2","0","","",""
"2674193","1","2674474","","2010-04-20 10:14:09","1","4477","<p>When I exit my android application it resumes to the previous screen.  How can I exit the Android application properly?</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // TODO Auto-generated method stub    switch(item.getItemId()) {         case EXIT:             try {                 this.finish();             } catch(Exception e) {             }             break;      }      return false; }</code></pre>","312789","","3171","","2010-04-20 11:00:56","2012-05-02 09:09:13","Can't exit an Android application","<android>","3","0","","",""
"2674632","1","2674673","","2010-04-20 11:30:21","1","601","<p>I'm thinking about putting a <code>.txt</code> file in <code>res/drawable</code> or in <code>res/layout</code> to have it in the apk when the application is packed, and then after install to open and read from it to perform some tasks. Can this be done? If yes please let me know how can I access the file, as I don't know it's path.</p>","304866","","958370","","2012-02-04 11:17:14","2012-02-04 11:17:14","access resources of an apk","<android><android-resources>","1","0","","",""
"2674657","1","2674709","","2010-04-20 11:33:40","4","132","<p>Can I upload content(any type png/jpg) onto android market, which I could download while the application is running. </p>","321234","","","","","2010-04-20 11:42:16","Store content in android market","<android><content>","2","0","","",""
"2674856","1","2675187","","2010-04-20 12:02:07","5","9194","<p>i have searched for a awnser for this for a while today. It all looks so easy but i never get it to work. I want to fill a spinner with my cursor. I have been trying to use SimpleCursorAdapter for this as a lot of sites say i shall but i never get it to work. Show me just how easy it is :)</p><p>Thanks for your time!</p><p>My cursor</p><pre><code>Cursor cursor = db.query(DATABASE_TABLE_Clients, new String[] {""_id"", ""C_Name""}, null, null, null, null, ""C_Name"");</code></pre><p>My spinner</p><pre><code>(Spinner) findViewById(R.id.spnClients);</code></pre><p>My Code</p><pre><code>Cursor cursor_Names = SQLData.getClientNames();startManagingCursor(cursor_Names);String[] columns = new String[] { ""C_Name"" };int[] to = new int[] { R.id.txt_Address };SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_dropdown_item, cursor_Names, columns, to);Spinner spnClients = (Spinner) findViewById(R.id.spnClients);spnClients.setAdapter(mAdapter);</code></pre>","211351","","211351","","2010-04-20 12:36:28","2012-06-16 11:41:26","Fill spinner from cursor in android","<android>","3","2","2","",""
"2674914","1","","","2010-04-20 12:12:26","0","1652","<pre><code>04-20 16:53:39.010: ERROR/Database(419): Leak found04-20 16:53:39.010: ERROR/Database(419): java.lang.IllegalStateException: mPrograms size 104-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:1668)04-20 16:53:39.010: ERROR/Database(419):     at dalvik.system.NativeStart.run(Native Method)04-20 16:53:39.010: ERROR/Database(419): Caused by: java.lang.IllegalStateException: /data/data/com.example.search/databases/rlite.db SQLiteDatabase created and never closed04-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1694)04-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738)04-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760)04-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753)04-20 16:53:39.010: ERROR/Database(419):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473)04-20 16:53:39.010: ERROR/Database(419):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)04-20 16:53:39.010: ERROR/Database(419):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)04-20 16:53:39.010: ERROR/Database(419):     at com.example.search.Database.&lt;init&gt;(Database.java:33)04-20 16:53:39.010: ERROR/Database(419):     at com.example.search.JobDetails.applyJob(JobDetails.java:120)04-20 16:53:39.010: ERROR/Database(419):     at com.example.search.JobDetails.jobdetailsAction(JobDetails.java:98)04-20 16:53:39.010: ERROR/Database(419):     at java.lang.reflect.Method.invokeNative(Native Method)04-20 16:53:39.010: ERROR/Database(419):     at java.lang.reflect.Method.invoke(Method.java:521)04-20 16:53:39.010: ERROR/Database(419):     at android.view.View$1.onClick(View.java:2026)04-20 16:53:39.010: ERROR/Database(419):     at android.view.View.performClick(View.java:2364)04-20 16:53:39.010: ERROR/Database(419):     at android.view.View.onTouchEvent(View.java:4179)04-20 16:53:39.010: ERROR/Database(419):     at android.widget.TextView.onTouchEvent(TextView.java:6540)04-20 16:53:39.010: ERROR/Database(419):     at android.view.View.dispatchTouchEvent(View.java:3709)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-20 16:53:39.010: ERROR/Database(419):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)04-20 16:53:39.010: ERROR/Database(419):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)04-20 16:53:39.010: ERROR/Database(419):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)04-20 16:53:39.010: ERROR/Database(419):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)04-20 16:53:39.010: ERROR/Database(419):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)04-20 16:53:39.010: ERROR/Database(419):     at android.os.Handler.dispatchMessage(Handler.java:99)04-20 16:53:39.010: ERROR/Database(419):     at android.os.Looper.loop(Looper.java:123)04-20 16:53:39.010: ERROR/Database(419):     at android.app.ActivityThread.main(ActivityThread.java:4363)04-20 16:53:39.010: ERROR/Database(419):     at java.lang.reflect.Method.invokeNative(Native Method)04-20 16:53:39.010: ERROR/Database(419):     at java.lang.reflect.Method.invoke(Method.java:521)04-20 16:53:39.010: ERROR/Database(419):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-20 16:53:39.010: ERROR/Database(419):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-20 16:53:39.010: ERROR/Database(419):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>when i read the database show error like this. please do reply me</p>","312789","","130929","","2010-04-20 12:16:53","2010-04-20 12:26:29","android database leak found IllegalStateException","<android>","1","0","1","",""
"2675353","1","2679531","","2010-04-20 13:15:18","1","1087","<p>I'm trying to create a map overlay for displaying a video stream (MJPEG) on top of a Mapview.   </p><p>Currently I've a standalone activity that creates a data thread for fetching MJPEG video frames. I'm using a handler to send a frame (as a Bitmap) from the data thread to the main activity which then updates the UI.</p><p>I'm not sure how to implement ""refresh"" for updating my ""overlayed"" video stream. </p><p>EDIT: What I mean by ""refresh"" is - how can I update the video portion (not the mapview)  of my UI whenever I get a new video frame. I plan to paint the video frame (bitmap) in the ""draw method"" of my implementation of the Overlay subclass. But the ""draw"" method is not invoked by me directly.   </p><p>Thanks. </p>","306346","","306346","","2010-04-21 14:46:16","2010-04-21 14:46:16","Creating a dynamic (video) Overlay on Google Maps on Android 2.1","<android><video><google-maps><mjpeg><overlays>","1","2","","",""
"2675380","1","2698157","","2010-04-20 13:18:53","12","8357","<p>I have a weird problem with the Android emulator. I have created a virtual device through Android AVD manager (newly created emulator with platform 2.1 and API level 7). I have tried with standard settings and with added hardware parameter for larger (256 MB) device RAM size but nothing changed.</p><p>I need to come files to the system partition to test a project (called haggle), but for some reason the system partition has no space from start.</p><pre><code>aa a@aaa /home/haggle-0.2-android$ adb -s emulator-5554 shell # dfdf/dev: 47084K total, 0K used, 47084K available (block size 4096)/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)/system: 73600K total, 73600K used, 0K available (block size 4096)/data: 65536K total, 18464K used, 47072K available (block size 4096)/cache: 65536K total, 1156K used, 64380K available (block size 4096)</code></pre><p>As you can see the system partition has 0K space available. When a connect a non-rooted HTC Nexus One and do the same I get these values:</p><pre><code>/dev: 108896K total, 0K used, 108896K available (block size 4096)/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)/system: 148480K total, 116364K used, 32116K available (block size 4096)/data: 200960K total, 22296K used, 178664K available (block size 4096)/cache: 97280K total, 1852K used, 95428K available (block size 4096)/sdcard: 3864064K total, 118496K used, 3745568K available (block size 32768)</code></pre><p>Why does the system partition on the emulator have 0K free space from beginning, and what can I do to change that? Even if I make the partition write-able with mount/remount I get the same 0K values.</p><p>Any tips?</p>","287774","","496830","","2011-11-10 18:38:24","2012-11-05 08:37:33","Android emulator system partition no space from start","<android><emulator><adb>","1","0","8","",""
"2675388","1","2675864","","2010-04-20 13:20:15","4","3368","<p>So I have an app on the market, and with an update I want to add some columns to the database. No problems so far. But I want to detect if the database in use is missing these columns, and add them if this is the case. I need this to be done dynamically and not just after the update to the new version, because the application is supposed to still be able to import older databases. Normally I would be able to use the <a href=""http://www.sqlite.org/pragma.html"" rel=""nofollow"" title=""PRAGMA"">PRAGMA</a> query, but Im not sure how to do this with Android. I cant use execSQL since it is a query, and I cant figure out how to use PRAGMA with the query()-function.</p><p>Ofcourse I could just catch exceptions and then add the column, or always add the columns to each table before I start to work with it, but that is not a neat solution.</p><p>Cheers,</p>","249871","","","","","2010-04-20 14:27:44","Detect if a table contains a column in Android/sqlite","<android><sqlite><pragma>","4","0","","",""
"2675479","1","","","2010-04-20 13:34:05","2","478","<p>In Symbian, if we set a parameter frri, we can make the appmanager to run the new application on completion of download and installation. Do we have any feature as such in android so that application will start as soon as it gets installed on to device.</p><p>Thx.</p>","321234","","","","","2010-04-20 13:39:43","First run run after install","<android><content>","1","0","","",""
"2675672","1","","","2010-04-20 13:59:24","1","2649","<p>Ok so I've built an app that uses a remote service to do some real time GPS tracking. I am using the below code to start and bind to the service. </p><p>The remote service uses aidl, sets up a notification icon, runs the GPS and locationListener. In onLocationChanged, a handler sends data back to the caller via the callback. Pretty much straight out of the examples and resources online.</p><p>I want to allow the service to continue running even if the app closes. When the app is restarted, I want the app to again bind to the service (using the existing service if running) and again receive data from the tracker.</p><p>I currently have the app mode set to singleTask and cannot use singleinstance due to another issue.</p><p>My problem is that quit often even after the app and service are shut down either from the app itself, or from AdvancedTaskKiller, or a Forceclose, the service will restart and initialize the GPS. touching on the notification will open the app. I again stop the tracking which removes the notification and turns off the GPS Close the app, and again after a few seconds the service restarts. The only way to stop it is to power off the phone.</p><p>What can I do to stop this from happening. Does it have to do with the mode of operation?  START_NOT_STICKY or START_REDELIVER_INTENT? Or do I need to use stopSelf()?</p><p>My understanding is that if the service is not running when I use bindService() that the service will be created...so do I really need to use start/stopService also? I thought I would need to use it if I want the service to run even after the app is closed. That is why i do not unbind/stop the service in onDestroy(). Is this correct?</p><p>I've not seen any other info an this, so I,m not sure where to look.</p><p>Please Help! ThanksPatrick</p><pre><code> //Remote Service Startup        try{startService();     }catch (Exception e) {Toast.makeText(ctx, e.getMessage().toString(), Toast.LENGTH_SHORT).show();                      } }try{bindService();     }catch (Exception e) {Toast.makeText(ctx, e.getMessage().toString(), Toast.LENGTH_SHORT).show();}//Remote service shutdown            try {      unbindService(); }catch(Exception e) {     Toast.makeText(ctx, e.getMessage().toString(), Toast.LENGTH_SHORT).show(); } try{stopService(); }catch(Exception e) {Toast.makeText(ctx, e.getMessage().toString(), Toast.LENGTH_SHORT).show(); }private void startService() {  if( myAdapter.trackServiceStarted() ) {    if(SETTING_DEBUG_MODE)      Toast.makeText(this, ""Service already started"", Toast.LENGTH_SHORT).show();      started = true;      if(!myAdapter.trackDataExists())          insertTrackData();      updateServiceStatus();  } else {         startService( new Intent ( ""com.codebase.TRACKING_SERVICE"" )  );    Log.d( ""startService()"", ""startService()"" );    started = true;    updateServiceStatus();  }}  private void stopService() {    stopService( new Intent ( ""com.codebase.TRACKING_SERVICE"" )  );      Log.d( ""stopService()"", ""stopService()"" );      started = false;      updateServiceStatus();  }  private void bindService() {  bindService(new Intent(ITrackingService.class.getName()),          mConnection, Context.BIND_AUTO_CREATE);  bindService(new Intent(ITrackingSecondary.class.getName()),           mTrackingSecondaryConnection, Context.BIND_AUTO_CREATE);    started = true;  }  private void unbindService() {  try {      mTrackingService.unregisterCallback(mCallback);  } catch (RemoteException e) {      // There is nothing special we need to do if the service      // has crashed.      e.getMessage();  }  try {      unbindService(mTrackingSecondaryConnection);      unbindService(mConnection);  } catch (Exception e) {      // There is nothing special we need to do if the service      // has crashed.      e.getMessage();  }    started = false;  }   private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        // This is called when the connection with the service has been        // established, giving us the service object we can use to        // interact with the service.  We are communicating with our        // service through an IDL interface, so get a client-side        // representation of that from the raw service object.        mTrackingService = ITrackingService.Stub.asInterface(service);        // We want to monitor the service for as long as we are        // connected to it.        try {            mTrackingService.registerCallback(mCallback);        } catch (RemoteException e) {            // In this case the service has crashed before we could even            // do anything with it; we can count on soon being            // disconnected (and then reconnected if it can be restarted)            // so there is no need to do anything here.        }    }    public void onServiceDisconnected(ComponentName className) {        // This is called when the connection with the service has been        // unexpectedly disconnected -- that is, its process crashed.        mTrackingService = null;    }  };  private ServiceConnection mTrackingSecondaryConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className,            IBinder service) {        // Connecting to a secondary interface is the same as any        // other interface.        mTrackingSecondaryService = ITrackingSecondary.Stub.asInterface(service);        try{        mTrackingSecondaryService.setTimePrecision(SETTING_TIME_PRECISION);        mTrackingSecondaryService.setDistancePrecision(SETTING_DISTANCE_PRECISION);        } catch (RemoteException e) {            // In this case the service has crashed before we could even            // do anything with it; we can count on soon being            // disconnected (and then reconnected if it can be restarted)            // so there is no need to do anything here.        }    }    public void onServiceDisconnected(ComponentName className) {        mTrackingSecondaryService = null;    }   };    //TrackService onDestry()public void onDestroy() {try{  if(lm != null) {    lm.removeUpdates(this);  }  if(mNotificationManager != null) {    mNotificationManager.cancel(R.string.local_service_started);  }  Toast.makeText(this, ""Service stopped"", Toast.LENGTH_SHORT).show();}catch (Exception e){    Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();}    // Unregister all callbacks.    mCallbacks.kill();    // Remove the next pending message to increment the counter, stopping    // the increment loop.    mHandler.removeMessages(REPORT_MSG);  super.onDestroy();}</code></pre><p>ServiceConnectionLeaked: I'm seeing a lot of these:</p><pre><code>04-21 09:25:23.347: ERROR/ActivityThread(3246): Activity com.codebase.GPSTest has leaked ServiceConnection com.codebase.GPSTest$6@4482d428 that was originally bound here 04-21 09:25:23.347: ERROR/ActivityThread(3246): android.app.ServiceConnectionLeaked: Activity com.codebase.GPSTest has leaked ServiceConnection com.codebase.GPSTest$6@4482d428 that was originally bound here 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:977) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:872) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ApplicationContext.bindService(ApplicationContext.java:796) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.content.ContextWrapper.bindService(ContextWrapper.java:337) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at com.codebase.GPSTest.bindService(GPSTest.java:2206) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at com.codebase.GPSTest.onStartStopClick(GPSTest.java:1589) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at com.codebase.GPSTest.onResume(GPSTest.java:1210) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.Activity.performResume(Activity.java:3763) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2516) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3625) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.access$2300(ActivityThread.java:119) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1867) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.os.Handler.dispatchMessage(Handler.java:99) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.os.Looper.loop(Looper.java:123) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at android.app.ActivityThread.main(ActivityThread.java:4363) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at java.lang.reflect.Method.invokeNative(Native Method) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at java.lang.reflect.Method.invoke(Method.java:521) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 04-21 09:25:23.347: ERROR/ActivityThread(3246):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>And These: Is this ok, or do I need to make sure i deactivate/close</p><pre><code>     04-21 09:58:55.487: INFO/dalvikvm(3440): Uncaught exception thrown by finalizer (will be discarded): 04-21 09:58:55.487: INFO/dalvikvm(3440): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@447ef258 on gps_data that has not been deactivated or closed 04-21 09:58:55.487: INFO/dalvikvm(3440):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 04-21 09:58:55.487: INFO/dalvikvm(3440):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","244190","","244190","","2010-04-21 14:04:35","2010-05-15 20:12:09","Android Remote Service Keeps Restarting","<android>","0","4","1","",""
"2675869","1","2677969","","2010-04-20 14:22:07","3","1931","<p>I have tried to write an Android application with an activity that should be launched from a different application. It is not a content provider, just an app with a gui that should not be listed among the installed applications. I have tried the code examples <a href=""http://www.damonkohler.com/2009/02/android-recipes.html"" rel=""nofollow"">here</a> and it seems to be quite easy to launch existing providers and so on, but I fail to figure out how to just write a ""hidden"" app and launch it from a different one.</p><p>The basic use case is: </p><ul><li>App A is a normal apk launchable from the application list. </li><li>App B is a different apk with known package and activity names, but is is not visible or launchable from the application list. </li><li>App A launches app B using the package and class names (or perhaps a URI constructed from these?).</li></ul><p>I fail in the third step. Is it possible to do this?</p>","128800","","","","","2010-04-21 04:39:39","Is it possible to start an activity in a different apk using startActivity on Android using the activity name or similar?","<java><android><activity><android-intent>","3","2","2","",""
"2675941","1","2676015","","2010-04-20 14:30:49","0","186","<p>My application is a trial version apk. Once the period is completed, can I initiate another application to be installed/downloaded from the android market ( purchasing process) which is a paid application using the current running trail application.</p>","321234","","114066","","2010-04-21 07:39:47","2010-04-21 07:39:47","Application running triggers another application installation","<android><content>","1","0","","",""
"2676044","1","2676199","","2010-04-20 14:43:29","16","14255","<p>Does Android broadcast an intent when the network state has changend, i.e. from GSM to Wifi? And if so what permission do I need and what is the intent action called?</p>","283494","","","","","2013-06-18 21:01:49","Broadcast Intent when network state has changend","<java><android><broadcastreceiver>","3","0","15","",""
"2676073","1","","","2010-04-20 14:47:11","2","7454","<p>I am currently somewhat struggling to get the Android emulator to use a custom DNS server, which is running on localhost (127.0.0.1).</p><p>As of now, I have tried various approaches trying to convince the emulator to use my DNS server, so far without success. In the end, it always boils down to the following error message:</p><pre><code>### WARNING: can't resolve DNS server name 'localhost'### WARNING: will use system default DNS server</code></pre><p>localhost, however, resolves correctly when supplied to nslookup:</p><pre><code>$ nslookup localhostServer:  dnszrh01.xxxAddress:  10.xxx.xxx.xxxNon-authoritative answer:Name:    localhost.xxxAddress:  127.0.0.1</code></pre><p>Using the IP address instead of the hostname also does not help much,it just changes the error message to:</p><pre><code>### WARNING: can't resolve DNS server name '127.0.0.1'### WARNING: will use system default DNS server</code></pre><p>The extra command line I am using to start the emulator reads:</p><pre><code>-http-proxy http://proxy.xxx:8080 -dns-server 127.0.0.1 -debug-proxy -verbose</code></pre><p>This is happening with Android emulator version 5.0 (build_idECLAIR-24846) running on Windows.</p><p>Any hint how to get this working is much appreciated!</p>","43575","","","","","2013-04-04 14:27:09","Android emulator -dns-server usage","<android><android-emulator>","1","0","","",""
"2676190","1","2677447","","2010-04-20 15:03:30","1","18476","<p>I am using a header for a Listview. ListView header has three columns. Say a,b,c. I am using two LinearLayouts to design ListView header as shown 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=""40dip""   android:padding=""0dip""&gt;   &lt;LinearLayout      android:orientation=""horizontal""      android:background=""#1e90ff""      android:layout_width=""0dip""      android:layout_weight=""1""      android:padding=""5dip""      android:layout_height=""40dip""&gt;      &lt;TextView          android:id=""@+id/a""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:textColor=""#000000""          android:layout_weight=""1""          android:gravity=""center_vertical""          android:text=""@string/a""      /&gt;      &lt;TextView          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:textColor=""#000000""          android:layout_weight=""1""          android:gravity=""center_vertical""          android:id=""@+id/b""          android:singleLine=""true""          android:text=""@string/b""      /&gt;      &lt;TextView          android:layout_width=""fill_parent""           android:layout_height=""fill_parent""          android:textColor=""#000000""          android:layout_weight=""1""          android:gravity=""center_vertical""          android:id=""@+id/c""          android:singleLine=""true""          android:text=""@string/c""      /&gt;   &lt;/LinearLayout&gt;   &lt;/LinearLayout&gt;</code></pre><p>Now i want to fix the width of columns a, b, c respectively. How to set width of these columns ? Again, is it a good practise to use LinearLayout for this ? Please Advise.</p>","248132","","67606","","2011-11-29 11:47:58","2014-03-14 10:55:13","Setting width of textview in a LinearLayout","<android>","3","0","2","",""
"2676280","1","3038928","","2010-04-20 15:15:21","7","8483","<p>keeping my question short, I have created an application with 3 activities, where A - list of categories, B - list of items, C - single item. Data displayed in B and C is parsed from online XML. But, if I go through A -> B1 -> C, then back to A and then back to B1, I would like to have its data cached somewhere so I wouldn't have to request the XML again.</p><p>I'm new to Android and Java programming, I've googled a lot and still can't find (or simply do not have an idea where to look) a way to do what I want.</p><p>Would storing all received data in main activity A (HashMaps? ContentProviders?) and then passing to B and C (if they get same request that was before) be a good idea?</p>","90571","","96301","","2011-04-26 16:04:21","2011-04-26 16:04:21","Good way to cache data during Android application lifecycle?","<android><android-contentprovider>","3","0","7","",""
"2676635","1","2677055","","2010-04-20 15:59:44","2","303","<p>I'd like to port my iPhone app to Android. The interface is constructed with artwork designed for 320x480 resolution. What steps do I need to take when I'm constructing the XML interface for the Android so that my GUI will be compatible with the different screen sizes (or at least the most popular ones...)?</p>","1580229","","","","","2010-04-20 16:58:55","Is there a rule of thumb when porting iPhone graphics to Android?","<iphone><android><gui><port><resolution>","1","2","","",""
"2676698","1","2677362","","2010-04-20 16:09:59","4","4655","<p>While playing around with the emulator, I noticed that when trying to view a YouTube video the browser gives an error saying it can not load the page at <code>vnd.youtube:ngc978y6rCU?some=parameters</code>. I don't have an Android device, but by this I can suppose that launching a <code>VIEW</code> intent with the data URI set to <code>vnd.youtube:VIDEO_ID</code> would launch the default YouTube application and watch that video.</p><p>Now, my application has to be able to display YouTube videos. Right now I have a custom-made YouTube activity which does just that, but I'm thinking of:</p><ul><li>Removing my custom activity and just launching a <code>VIEW</code> intent with a <code>vnd.youtube:VIDEO_ID</code> Uri, or</li><li>Testing whether that <code>Intent</code> <a href=""http://developer.android.com/training/basics/intents/sending.html#Verify"" rel=""nofollow"">is available</a> and using it, or, if it's not available, using my custom activity.</li></ul><p>Is this a good idea? Does this work at all (as I said I have no Android device, I'll just be borrowing one from a friend to test my final application)? Which way should I go?</p>","180784","","1217087","","2014-03-18 02:35:16","2014-03-18 02:35:16","Should I use vnd.youtube:videoID?","<android><android-intent>","2","0","","",""
"2676719","1","2676810","","2010-04-20 16:12:05","8","23313","<p>I'm currently developing a simple 2D game for Android.  I have a stationary object that's situated in the center of the screen and I'm trying to get that object to rotate and point to the area on the screen that the user touches.  I have the constant coordinates that represent the center of the screen and I can get the coordinates of the point that the user taps on.  I'm using the formula outlined in this forum:  <a href=""http://www.gamedev.net/community/forums/topic.asp?topic_id=318640"">How to get angle between two points?</a></p><ul><li><p>It says as follows ""If you want the the angle between the line defined by these two points and the horizontal axis:</p><pre><code>double angle = atan2(y2 - y1, x2 - x1) * 180 / PI;"".</code></pre></li><li><p>I implemented this, but I think the fact the I'm working in screen coordinates is causing a miscalculation, since the Y-coordinate is reversed.  I'm not sure if this is the right way to go about it, any other thoughts or suggestions are appreciated.</p></li></ul>","94541","","789593","","2011-10-18 10:18:01","2013-04-21 01:18:06","Calculating the angle between the line defined by two points","<java><android><graphics>","4","3","2","",""
"2676884","1","","","2010-04-20 16:30:40","0","656","<p>I have a slider for the user to control the volume of my application. What I'd like to have is a icon or something else similar to ""volume display"" like in the next picture at the slider summary. Is this possible ? How could this be accomplished ?<img src=""http://sites.google.com/site/udcaus/_/rsrc/1259487806068/holden/graphic_LCD_screen1.JPG"" alt=""alt text""></p>","284609","","","","","2010-04-20 17:27:51","Custom preference screen","<android>","1","0","","",""
"2676892","1","2676972","","2010-04-20 16:32:10","1","3078","<p>I've got some Buttons that I want to make un-clickable (but still appear on the screen) until another process (thread) has finished its work ? How would you do this ?</p><p>The goal is to avoid my users to keep clicking on this button and so, launching a new thread every time they click on it ...</p><p>Thanks for your help.</p><p>Hubert</p>","116573","","","","","2010-04-20 16:50:00","Android: How would you make Buttons un-clickable for some period?","<android><button><onclick>","1","0","2","",""
"2676906","1","2677154","","2010-04-20 16:34:06","6","4214","<p>So within my application is a form for creating a new user, with relevant details and information about the user.  There's no problems there, it's just what happens when the user leaves the activity without pressing the confirm button.</p><p><strong>Here's what I want to do:</strong></p><ol><li>If the user presses the back button, attempt to save all the data to the database and inform the user.</li><li>If the activity is interrupted (ie by a phone call), save all the data into a temporary location so when the activity is at the top of the stack again, nothing appears to have changed (but the data still hasn't yet been saved to the database).</li><li>If the activity gets killed for more resources when in the background, do the same as point 2 above (ie when the activity is started again, it appears that nothing has changed).</li><li>If the whole application is started again (by clicking on the icon again) and there is temporary data stored from either points 2 or 3 above, navigate to the ""create user"" activity and display data as if nothings changed.</li></ol><p><strong>Here's how I'm currently trying to do it:</strong></p><ul><li>Use <code>onDestroy()</code> and <code>isFinishing()</code> functions to find when the activity is being killed, to cover point 1 above (to then try and save all data).</li><li>Save all data with <code>onSaveInstanceState</code> into a bundle (to cover point 2 above)</li><li>Does the bundle created with <code>onSaveInstanceState</code> survive the activity being killed for more resources, so when its recreated the previous state can be retrieved (as in point 3 above)?</li><li>No idea how to implement point 4.</li></ul><p>Any help would be massively appreciated.</p><p>Cheers!</p>","295930","","","","","2010-04-20 18:40:28","Android - Lifecycle and saving an Instance State questions","<android><lifecycle>","2","2","1","",""
"2677431","1","2678161","","2010-04-20 17:52:28","61","34414","<p>This question was asked by <a href=""http://stackoverflow.com/questions/2309950/proper-location-to-install-android-sdk-on-mac"">Prembo</a> back in February, but nobody answered.  Maybe now someone has a recommendation?  Thanks.</p>","82118","","99834","","2011-10-08 13:40:44","2013-09-02 17:12:33","Where to install Android SDK on Mac OS X?","<android><configuration><osx>","6","1","12","",""
"2677643","1","2724627","","2010-04-20 18:32:02","4","4850","<p>When trying to run my application on the emulator I get an error from the activitymanager:</p><p>ActivityManager: Error type 3</p><p>My activity exists, is listed in the manifest (in fact, its the MAIN launcher activity).</p><p>Anyone know what this error means?</p>","246793","","","","","2014-02-19 12:40:53","Cannot run Android application on emulator/device - activity doesn't exist?","<android><activity><manager><error-codes>","8","2","0","",""
"2677659","1","2677677","","2010-04-20 18:34:02","0","1736","<p>I've read the lame documentation, and checked other answers.  I'd like my Android app to print some debug statements in the logcat window of Eclispe.  If I use the isLoggable method on the various types of debug levels on the Log class, I find that WARN and INFO are returning true.</p><p>Log.w, and Log.i do not produce any output.  Does anyone know which gotchas I've missed?</p><p>And just to vent, why should this be hard?  I've published apps for iphone and bberry and while appreciate the use of java, the platform is reeking of too many ""genuiuses"" being involved.  I suppose Activities and Intents are very flexible, but why?  I just want to put up some screens, take some input and show some results.  The bberry pushscreen and popscreen is a lot less pretentious.</p><p>Thanks,Gerry</p>","321594","","","","","2010-04-20 23:19:48","How to get debugging statements for Android in Eclipse","<android><debugging><logging>","2","0","","",""
"2677698","1","","","2010-04-20 18:38:56","24","31098","<p>Is it possible to style the Android Tabhost to look like that of the iPhone?If not, is there any open source code that can show how to create Bottom Tabs for Android ?</p><p><img src=""http://images.appshopper.com/screenshots/305/690205_2.jpg"" alt=""alt text"">  <img src=""http://i.stack.imgur.com/6XvZS.png"" alt=""alt text""></p>","93141","","454824","","2013-03-27 14:16:40","2013-03-27 14:16:40","Android - iphone style tabhost","<android><tabs><android-tabhost><android-style-tabhost>","4","12","33","2013-01-24 14:35:10",""
"2677863","1","2678056","","2010-04-20 19:03:45","5","13946","<p>I've a form with 2 fields, after First login, i store the Mail in SharedPreferences and i restore when user start app again,But how to set focus on Pass Field ? it's not very nice to see that mail is fill but focus is still on mail field.</p><p>Thanks</p><pre><code>&lt;EditText android:id=""@+id/Email"" android:text="""" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:layout_below=""@+id/labelEmail"" android:inputType=""textEmailAddress""android:padding=""10px""&gt;&lt;/EditText&gt;&lt;EditText android:id=""@+id/Pass""  android:text=""""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:layout_below=""@+id/labelPass"" android:padding=""10px""android:inputType=""textPassword""android:password=""true""&gt;&lt;/EditText&gt;</code></pre>","144587","","","","","2012-06-07 01:31:43","Android : How change focus on form with out user action?","<android><forms><edittext>","2","0","1","",""
"2678098","1","2678157","","2010-04-20 19:40:41","2","595","<p>I'm having a very hard time getting the 2 buttons in the 2nd child linearlayout to display as I want them to... I want them centered, on the same row but they appear left-aligned and on the same row. Can anyone help me with 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=""fill_parent""    android:background=""@color/black""    android:orientation=""vertical""&gt;  &lt;LinearLayout      android:id=""@+id/splash""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:orientation=""vertical""&gt;    &lt;ImageView      android:id=""@+id/imageLogo1""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:adjustViewBounds=""true""      android:cropToPadding=""true""      android:scaleType=""fitXY""      android:src=""@drawable/isi_logo""      android:paddingLeft=""50sp""      android:paddingRight=""50sp""      android:paddingTop=""20sp""/&gt;    &lt;ImageView      android:id=""@+id/imageLogo2""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:adjustViewBounds=""true""      android:cropToPadding=""true""      android:scaleType=""fitXY""      android:src=""@drawable/sa_logo""      android:paddingLeft=""100sp""      android:paddingRight=""100sp""      android:paddingBottom=""20sp""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:layout_gravity=""center""&gt;    &lt;Button        android:id=""@+id/buttonScores""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:width=""100sp""      android:text=""@string/scores""/&gt;    &lt;Button      android:id=""@+id/buttonStart""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:width=""100sp""      android:text=""@string/test""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","198116","","","","","2010-04-20 19:50:20","Problem with Android Layout","<android><android-layout>","1","0","","",""
"2678312","1","2678364","","2010-04-20 20:15:37","0","277","<p>I have an SMS broadcast receiver in my application with a static boolean value to make the receiver active or not. </p><pre><code>public class SmsListener extends BroadcastReceiver {        public static boolean activated = false;        @Override        public void onReceive(Context context, Intent intent)             if (activated){ //do something              }          ...      }}</code></pre><p>I have then a widget to activate or not the sms receiver (through this static value). Everything works well but I just noticed that, if the phone memory gets low, the sms listener loses its state and the application doesn't work as expected. I guess it is related to android lifecycle. I have no service in background and the system kills the process. Should the approach I used be avoided? Should I always start a service  only to avoid android process kill? </p><p>Thanks</p><p>Tobia Loschiavo</p>","269585","","","","","2010-04-20 20:24:00","Android lifecycle problem","<android><service><lifecycle>","1","0","","",""
"2678325","1","2983274","","2010-04-20 20:18:39","3","946","<p>I am contemplating creating a realtime app where an iPod Touch/iPhone/iPad talks to a server-side component (which produces MIDI, and sends it onward within the host). When I ping my iPod Touch on Wifi I get huge latency (and a enormous variance, too):</p><pre><code>64 bytes from 192.168.1.3: icmp_seq=9 ttl=64 time=38.616 ms64 bytes from 192.168.1.3: icmp_seq=10 ttl=64 time=61.795 ms64 bytes from 192.168.1.3: icmp_seq=11 ttl=64 time=85.162 ms64 bytes from 192.168.1.3: icmp_seq=12 ttl=64 time=109.956 ms64 bytes from 192.168.1.3: icmp_seq=13 ttl=64 time=31.452 ms64 bytes from 192.168.1.3: icmp_seq=14 ttl=64 time=55.187 ms64 bytes from 192.168.1.3: icmp_seq=15 ttl=64 time=78.531 ms64 bytes from 192.168.1.3: icmp_seq=16 ttl=64 time=102.342 ms64 bytes from 192.168.1.3: icmp_seq=17 ttl=64 time=25.249 ms</code></pre><p>Even if this is double what the iPhone->Host or Host->iPhone time would be, 15ms+ is too long for the app I'm considering. <strong>Is there any faster way around this (e.g., USB cable)? If not, would building the app on Android offer any other options?</strong></p><p>Traceroute reports more workable times:</p><pre><code>traceroute to 192.168.1.3 (192.168.1.3), 64 hops max, 52 byte packets 1  192.168.1.3 (192.168.1.3)  4.662 ms  3.182 ms  3.034 ms</code></pre><p>can anyone decipher this difference between ping and traceroute for me, and what they might mean for an application that needs to talk to (and from) a host?</p>","8047","","8047","","2010-04-20 21:25:58","2010-06-06 06:00:04","Are Large iPhone Ping Times Indicative of Application Latency?","<iphone><android><latency>","3","4","","",""
"2678819","1","","","2010-04-20 21:32:35","5","2471","<p>I am new to Android development and I ran into a problem which I find difficult to solve. I am trying to figure out how to use an <code>AutoCompleteTextView</code> widget properly. I want to create a <code>AutoCompleteTextView</code>, using XML data from a web service. I managed to get it to work, but I am defenitely not pleased with the output. </p><p>I would like to put a <code>HashMap</code> with id => name pairs into the <code>AutoCompleteTextView</code> and get the id of the clicked item. When I click on the autocomplete filtered set output, I want to populate a list underneath the autocompletion box, which I also managed to get to work.</p><p>Done so far:  </p><ul><li>autocomplete works well for simple ArrayList, all data filtered correct</li><li>onItemClick event fires properly after click</li><li>parent.getItemAtPosition(position) returns correct String representation of the clicked item</li></ul>  <p>The event onItemClick(AdapterView parent, View v, int position, long id) does not behave as I would like. How can I figure out the unfiltered array position of the clicked item? The position of the filtered one is the one I am not interested in.</p><p>Further questions:</p><ul><li>How to handle HashMaps or Collections in AutoCompleteTextView</li><li>How to get the right itemId in the onItemClick event</li></ul><p>I did very extensive research on this issue, but did not find any valuable information which would answer my questions.</p>","321698","","1288","","2011-06-01 13:30:13","2011-06-11 09:35:52","AutoCompleteTextView onItemClick item position or id using HashMap","<android><hashmap><autocompletetextview>","1","2","","",""
"2678997","1","2679039","","2010-04-20 22:01:49","0","1047","<p>I'm abit new to programming Android App's, however I have come across a problem, I can't find a way to make global variables -unlike other coding like php or VB.NET, are global variables possible? If not can someone find a way (and if possible implement the way into the code I will provide below) to get a value from the variable 'songtoplay' so I can use in another Public Void...</p><p>Here is the code:</p><pre><code>    final Spinner hubSpinner = (Spinner) findViewById(R.id.myspinner);    ArrayAdapter adapter = ArrayAdapter.createFromResource( this, R.array.colours, android.R.layout.simple_spinner_item); adapter    .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    hubSpinner.setAdapter(adapter);    //    hubSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {             //code          Object ttestt = hubSpinner.getSelectedItem();          final String test2 = ttestt.toString();          Toast message1 = Toast.makeText(Textbox.this, test2, Toast.LENGTH_LONG);        message1.show();            String songtoplay = test2;          // Need songtoplay to be available in another 'Public Void'        }        public void onNothingSelected(AdapterView&lt;?&gt; parentView) {             //Code        }    });</code></pre><p>Basically, it gets the value from the Spinner 'hubSpinner' and displays it in a Toast. I then want it to return a value for string variable 'songtoplay' -or find a way to make it global or useable in another Public Void, (Which is will a button, -loading the song to be played)</p><p>Please help me,</p><p>Thanks alot.</p><p>James</p>","321763","","","","","2010-04-22 17:27:42","Returning a variable in a public void","<java><android><eclipse><variables><global-variables>","3","1","","",""
"2679250","1","2687979","","2010-04-20 22:53:16","35","14799","<p>I am trying to setResult after the BACK button was pressed. I call in onDestroy</p><pre><code>Intent data = new Intent();setResult(RESULT_OK, data) </code></pre><p>But when it comes to</p><pre><code>onActivityResult(int requestCode, int resultCode, Intent data) </code></pre><p>the resultCode is 0 (RESULT_CANCELED) and data is 'null'.</p><p>So, how can I pass result from activity terminated by BACK button?</p>","62192","","","","","2014-03-04 13:36:14","setResult does not work when BACK button pressed","<android>","10","0","12","",""
"2679473","1","2680868","","2010-04-20 23:50:40","6","7537","<p>I wonder if is the Android multi-touch support reliable? I've read it suffers from some problems.</p><p>I also wonder, how can I define custom multi-touch gestures? Like: 3 fingers rotate or 3 fingers stay static and fourth is moving.</p><p>I've come across some resources (Gestures or MotionEvent on developer.android.com) but nothing states it clearly.</p><p>Regards,</p><p>Zdenek</p>","321824","","","","","2010-04-21 07:00:35","Android multi-touch support","<android><multi-touch>","1","0","5","",""
"2679479","1","","","2010-04-20 23:52:31","1","859","<p>Why does <code>gravity</code> offer a ""fill_vertical"" option? How is this any different from setting <code>layout_height</code> ""fill_parent""? What if I choose a fixed <code>layout_height</code> and ""fill_vertical"" for gravity? Won't this contradict?</p>","165495","","","","","2010-04-21 02:10:31","gravity=""fill_vertical"" vs. layout_height=""fill_parent"" in Android","<android><user-interface>","1","0","","",""
"2679699","1","2703882","","2010-04-21 01:10:07","16","11510","<p>What special characters are allowed for file names on Android?</p><pre><code>~!@#$%^&amp;*()_+/\.,</code></pre><p>Also, can I save file with Unicode name?</p>","62192","","","","","2012-11-21 21:02:13","What characters allowed in file names on Android?","<android><filenames>","3","2","4","",""
"2679804","1","2680332","","2010-04-21 01:46:18","15","9082","<p>If you have a handle to a <code>Spinner</code> object in an Android <code>activity</code>, can you programmatically pop open the spinner options - thereby forcing the user to choose an option even though they did not click on the <code>spinner</code> themselves? </p>","268648","","1570662","","2014-02-22 07:35:43","2014-02-22 07:35:43","Possible to programmatically open a Spinner in Android app?","<android>","3","1","1","",""
"2679948","1","2680077","","2010-04-21 02:37:16","61","47362","<p>I've spent about 6 hours on this so far, and been hitting nothing but roadblocks.  The general premise is that there is some row in a ListView (whether it's generated by the adapter, or added as a header view) that contains an EditText widget and a Button.  All I want to do is be able to use the jogball/arrows, to navigate the selector to individual items like normal, but when I get to a particular row -- even if I have to explicitly identify the row -- that has a focusable child, I want that child to take focus instead of indicating the position with the selector.</p><p>I've tried many possibilities, and have so far had no luck.</p><p>layout:</p><pre><code>&lt;ListView    android:id=""@android:id/list""     android:layout_height=""fill_parent""     android:layout_width=""fill_parent""    /&gt;</code></pre><p>Header view:</p><pre><code>EditText view = new EditText(this);listView.addHeaderView(view, null, true);</code></pre><p>Assuming there are other items in the adapter, using the arrow keys will move the selection up/down in the list, as expected;  but when getting to the header row, it is also displayed with the selector, and no way to focus into the EditText using the jogball.  Note: tapping on the EditText <em>will</em> focus it at that point, however that relies on a touchscreen, which should not be a requirement.</p><p>ListView apparently has two modes in this regard:<br>1. <code>setItemsCanFocus(true)</code>: selector is never displayed, but the EditText can get focus when using the arrows.  Focus search algorithm is hard to predict, and no visual feedback (on any rows: having focusable children or not) on which item is selected, both of which can give the user an unexpected experience.<br>2. <code>setItemsCanFocus(false)</code>: selector is always drawn in non-touch-mode, and EditText can never get focus -- even if you tap on it.</p><p>To make matters worse, calling <code>editTextView.requestFocus()</code> returns true, but in fact does not give the EditText focus.</p><p>What I'm envisioning is basically a hybrid of 1 &amp; 2, where rather than the list setting if <em>all</em> items are focusable or not, I want to set focusability for a <em>single</em> item in the list, so that the selector seamlessly transitions from selecting the entire row for non-focusable items, and traversing the focus tree for items that contain focusable children.</p><p>Any takers?</p>","231078","","","","","2013-11-22 17:08:58","Focusable EditText inside ListView","<android>","8","0","60","",""
"2680492","1","3008489","","2010-04-21 05:17:08","18","6585","<p>I just installed NetBeans and the Android SDK following the instructions <a href=""http://wiki.netbeans.org/IntroAndroidDevNetBeans"">here</a>. I am running Ubuntu 9.10 (Karmic). NetBeans is 6.7.1. The Android SDK is version 7.</p><p>When I try to compile a new project it gives me the following error:</p><pre><code>Execute failed: java.io.IOException: Cannot run program ""/home/oz/android-sdk/platforms/android-7/tools/aapt"" (in directory ""/home/oz/projects/ArmyBuilder/android""): java.io.IOException: error=2, No such file or directory</code></pre><p>When I go into that directory, I see that the file does exist and it has proper permissions to be executable by anyone, yet even bash can't find it!</p><pre><code>oz@Ivory-Coast:~/android-sdk/platforms/android-7/tools$ pwd/home/oz/android-sdk/platforms/android-7/toolsoz@Ivory-Coast:~/android-sdk/platforms/android-7/tools$ ls -ltotal 4652-rwxrwxrwx 1 oz oz 3472784 2010-04-20 18:16 aapt-rwxrwxrwx 1 oz oz 1050336 2010-04-20 18:16 aidl-rwxrwxrwx 1 oz oz  213698 2010-04-20 18:16 dexdump-rwxrwxrwx 1 oz oz    2497 2010-04-20 18:16 dxdrwxr-xr-x 2 oz oz    4096 2010-04-20 18:16 lib-rw-r--r-- 1 oz oz   10800 2010-04-20 18:16 NOTICE.txtoz@Ivory-Coast:~/android-sdk/platforms/android-7/tools$ ./aaptbash: ./aapt: No such file or directoryoz@Ivory-Coast:~/android-sdk/platforms/android-7/tools$ </code></pre><p>Googling for this error turns up a few other people having this same issue (http://www.mentby.com/erisa/aapt-not-found.html, <a href=""http://www.helloandroid.com/content/file-not-found-hello-world-application"">http://www.helloandroid.com/content/file-not-found-hello-world-application</a>) both with no responses.</p>","321937","","321937","","2010-04-21 05:45:41","2011-04-04 23:41:57","aapt not found when building new Android app in NetBeans","<android><netbeans><file-not-found><aapt>","1","0","4","",""
"2680514","1","2688315","","2010-04-21 05:21:51","0","2348","<p>I want to handle key press and long key press for the key code KEYCODE_BACK(back button). can any one suggest me how to do this in android 1.5(API level 3).</p><p>Here is the code.</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_BACK) {                if(event.getRepeatCount()==0) {                   // normal key press                   //Do something here                   // But problem is, this code is hitting for long press also, how to avoid this                } else {                    // Long key press                    //Do something here                }                // Always consume back key event by returning true                //so that default behavior of back is overrided                return true;            }        return super.onKeyDown(keyCode, event);    }</code></pre><p>The problem is the code for normal key press is also executed on long press. I want to avoid this.</p><p>Note: I can't use methods like <code>onKeyLongPress()</code> , <code>startTracking()</code> etc as they are introduced in API level 5</p>","301444","","","","","2010-04-22 04:48:44","Long key press handling in android 1.5","<android><keyevent>","1","0","","",""
"2680607","1","2718930","","2010-04-21 05:43:33","23","11482","<p>How would I extend <code>TextView</code> to allow the drawing of text with a gradient effect?</p>","165495","","165495","","2010-04-21 06:21:15","2011-07-12 05:23:45","Text with gradient in Android","<android><user-interface>","5","0","17","",""
"2680610","1","2743350","","2010-04-21 05:44:45","0","2617","<p>Can anyone please help me on adding new contacts in address book and apply them in batch by using new ContactsContract API? I could not find a proper tutorial on this.</p><p>I am able to add a single contact. But batch update fails with Unknown contacts being added.</p><p>Currently I am looping through while loop while collecting info. of users to write, store it in the <code>ArrayList&lt;ContentProviderOperation&gt;</code> and applying and</p><pre><code>ContentProviderResult[] result = getContentResolver().applyBatch(ContactsContract.AUTHORITY, op_list);</code></pre><p>But only one contact is updated with name and other are updated as unknown contacts.</p><p>Please help with a sample code which adds the fields like name,nickname,mobile,title,email,Skype id,work-country etc.</p><p>Any help ? Thanks .</p>","315619","","1076164","","2012-01-03 21:59:20","2012-01-03 21:59:20","Adding contacts using ContactsContract in batch","<android><contactscontract>","2","1","1","",""
"2680758","1","2680960","","2010-04-21 06:25:09","6","2853","<p>Is there a way to get a system notification when an app has been uninstalled? </p><p>I would like to maintain a table of all clients' info currently using my app. However, that seems impossible if there is no way to detect this event. </p><p>The first solution I can think of is to have an always running service in the background listening for <code>android.intent.action.PACKAGE_REMOVED</code>. But then would that service be killed once the uninstallation process has ended, or would it be stopped just before the process has kicked off? Also even if this is a solution it's has the potential to put off a lot of people when they realise that part of the app is running in the background.</p><p>Any suggestions? Thanks!</p>","224956","","","","","2013-04-26 06:08:09","Detect if an app was uninstalled","<android>","2","1","","",""
"2680812","1","","","2010-04-21 06:42:49","4","223","<p>im planning to develop a game for iphone and android. what programming language can i use to create a shared codebase between the two platform. i understand that there are some parts which are device specific.</p>","321994","","","","","2010-04-21 06:45:40","game programming iphone osx android 1.6 shared codebase","<iphone><android>","1","0","1","",""
"2680827","1","2681165","","2010-04-21 06:47:05","550","307743","<p>In my Android application in Eclipse I get the following error.</p><blockquote>  <p>UNEXPECTED TOP-LEVEL EXCEPTION:<br/>  java.lang.IllegalArgumentException: already added: Lorg/xmlpull/v1/XmlPullParser;<br/>  ....<br/>  Conversion to Dalvik format failed with error 1<br/></p></blockquote><p>This error only appears when I add a specific external JAR file to my project. I searched for a long time for the possible solution, but none of the possible solutions work. I even tried to change to Android 1.6 instead of 1.5 (the current version I use).</p>","193850","","63550","","2012-02-26 20:37:52","2014-04-01 11:31:26","""Conversion to Dalvik format failed with error 1"" on external JAR","<android><dalvik><android-sdk-1.6>","58","3","143","","2012-01-18 05:36:23"
"2681035","1","","","2010-04-21 07:28:53","2","4314","<p>Can i share one application related data with another. Say I have a music file in resources/raw folder of apk2. Can I use the same file in apk1.</p><p>thx...</p>","321234","","","","","2010-04-21 10:11:21","Share files between applications","<android><file><sharing>","3","0","1","",""
"2681053","1","","","2010-04-21 07:33:00","2","1328","<p>I have a view as a main screen of the application which contains the available application's actions as icon+text pairs ( desktop like).</p><p>I want to find out programatically what are the activities defined ONLY in my AndroidManifest.xml</p><p>Suppose I have :</p><pre><code>&lt; activity android:name=""example.mainActivity"" android:label=""mainActivity""&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=""example.activity1"" android:label=""Activity1""&gt;      &lt; intent-filter&gt;          &lt; action android:name=""android.intent.action.VIEW"" /&gt;          &lt; category android:name=""example.custom.ACTIVITY"" /&gt;      &lt; /intent-filter&gt;  &lt; /activity&gt;  &lt; activity android:name=""example.activity2"" android:label=""Activity2""&gt;      &lt; intent-filter&gt;          &lt; action android:name=""android.intent.action.VIEW"" /&gt;          &lt; category android:name=""example.custom.ACTIVITY"" /&gt;      &lt; /intent-filter&gt;  &lt; /activity&gt;  </code></pre><p>I want that in the mainActivity to dinamically read Activity1 and Activity2 because when i add Activity3 for example it will be automatically read.</p><p>Intent intent = new Intent(""android.intent.action.VIEW"");intent.addCategory(""example.custom.ACTIVITY"");List resolves = getPackageManager().queryIntentActivities(intent, 0);</p><p>In the resolves list i expect to have the two defined activities so i can get their label and image and create the icon for the desktop</p><p>I thought that this could be done by defining a custom category, example.custom.ACTIVITY, and in the mainActivity  use the  packageManager.queryIntentActivities(Intent intent, int flags) but it doesn't seem to be working.</p><p>I really would like to code it to dinamically discover the installed activities in my application. Do you have any ideas on how to do this?Thank you</p>","322030","","7888","","2011-10-19 20:50:33","2013-07-07 22:26:09","Android custom categories","<android><android-manifest>","1","0","2","",""
"2681222","1","","","2010-04-21 08:06:52","1","808","<p>I'm interested in doing some enhancements to android emulator (implement webcam on emulator). Therefore I'm following the android source and emulators source to get basic understanding  &amp; the connection between modules. But its really hard to understand it for someone who is new to android. Therefore can anyone please direct me to some resource to understand this. May be some proper documentation, tutorials or anything that i can understand this.</p><p>And since i'm interested in emulator if i change the code of emulator with in ""external\qemu"" , then build it using ""m emulator"" and run using ""emulator"" , will those changes effect or apply onto the started emulator.</p><p>And if anyone know please let me know that, what is the sdk it uses when it run as ""emulator"" from the build android source code. Cos if i want to install some application to that emulator how can i do that?</p><p>Please help if anyone know...</p>","322063","","3052751","","2014-01-08 15:22:57","2014-01-08 15:22:57","Implement Camera on Android Emulator | Need some knowledge","<android><android-emulator><emulator><qemu>","1","0","1","",""
"2681491","1","2681660","","2010-04-21 09:00:33","3","2886","<p>I am trying to set up a private repository of Android source code while hosting the git trees on github as private repos.</p><p>I have no problem changing the manifest.xml file to point to public git trees hosted on github in the same way that CynagonMod does, but when trying to point to private repos I get the following error when trying ""repo sync"":</p><blockquote>  <p>Initializing project username/android_external_webkit ...</p>    <p>fatal: The remote end hung up unexpectedly</p>    <p>error: Cannot fetch username/android_external_webkit</p></blockquote><p>Where username/android_external_webkit is of course a private github repo of the same name.</p><p>I understand the error occurs since I did not specify my user name and credentials to github, but I fail to see how to do it in the manifest.xml with repo. </p><p>Any ideas?</p><p>Thanks!Gilad</p>","60232","","60232","","2010-04-21 09:11:56","2010-04-21 09:26:37","How to set up an Android source repo while hosting the git trees as private repositories on github?","<android><github><android-manifest><repository>","1","0","3","",""
"2681499","1","2903866","","2010-04-21 09:01:35","35","26772","<p>In an Android application, we usually got the ""Force Closed"" error if we didn't get the exceptions right.</p><p>How can I restart my application automatically if it force closed?</p><p>Is there any specific permission is used for this?</p>","234939","","","","","2014-01-02 15:25:27","Android: How to auto-restart application after it's been ""force closed""?","<android>","4","3","30","",""
"2681551","1","","","2010-04-21 09:08:40","1","437","<p>I am trying to use an alarm to set my widget layout after some minutes. Everything works correctly in normal situation but, if I try to delete the process of my application ( simulating a system kill) after the alarm is set, then no alarm is executed. Why? From documentation it seems that alarms are executed by AlarmManager service...so it should work.I have tried both with Receivers and with Services with no luck.  </p><p>Thanks</p><p>Tobia Loschiavo</p>","269585","","269585","","2010-04-21 09:53:02","2010-04-21 09:53:02","Alarm not working if application gets killed","<android><lifecycle><alarmmanager>","0","2","","",""
"2681640","1","","","2010-04-21 09:23:22","8","18867","<p>Can anybody tell how to add a button in android?</p>","322121","","1470567","","2012-07-19 18:27:01","2013-04-24 12:02:14","How to add a button in android?","<android><button>","2","2","","",""
"2681659","1","2682130","","2010-04-21 09:26:22","0","2056","<p>I have some proccess that i would like to run in the background the whole time.so i made it ""service"".my question is: is there anyway to prevent from the user to kill this service? (even if he uses third party app)</p><p>thanks,</p><p>ray.</p>","260511","","","","","2013-08-23 01:24:23","Infinite service","<android>","4","0","","",""
"2681681","1","","","2010-04-21 09:29:26","0","351","<p>I'm creating a datalogger which logs the gps data and the sensor data of the phone. I've just a strange problem. If the phone is not touched for few minutes it goes into standby mode (screen goes black), and that causes the logger to stop working. Actually the firewriting in the logger stops working. The GPS resumes fine after coming out of blackscreen, but when I check the log I created it only shows saved points for few minutes.</p><p>Does anyone have idea what is causing this? </p>","569554","","","","","2010-04-21 11:25:57","Data 'logger' turning off when phone goes to standbymode","<android><gps><sensor>","1","0","1","",""
"2681837","1","","","2010-04-21 09:52:28","0","312","<p>when I login in and try get extended premissins displays ""You must be logged in to Facebook to use this feature"".How can I get extended premissions for posting messages in facebook?</p>","321532","","","","","2010-04-21 10:08:06","Android FBConnect: unable to get extended premissions","<android><fbconnect>","1","0","","",""
"2682043","1","2682215","","2010-04-21 10:25:33","60","21750","<p>I need to check if my registered receiver is still registered if not how do i check it any methods?</p>","279560","","1765530","","2014-02-21 10:57:58","2014-02-21 10:57:58","how to check if Receiver is registered in android","<java><android><broadcastreceiver>","6","3","9","",""
"2682051","1","2959289","","2010-04-21 10:26:32","11","22474","<p>I want to change the text inside a button to be bold when the button is highlighted or pressed. I currently use a xml file to define the button and use the XML to change how it looks when pressed but I would like to do this without using an image.</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=""false""           android:drawable=""@drawable/reset_hover"" /&gt;    &lt;item android:state_focused=""true""           android:state_pressed=""true""          android:drawable=""@drawable/reset_hover"" /&gt;    &lt;item android:state_focused=""false""           android:state_pressed=""true""      android:drawable=""@drawable/reset_hover"" /&gt;    &lt;item android:drawable=""@drawable/reset"" /&gt;&lt;/selector&gt;</code></pre><p>I tried using something like the following,  but it doesn't seem to ever get called.</p><pre><code>    final Button btn_reset = (Button) findViewById(R.id.btn_reset);    btn_reset.setOnClickListener(this);     btn_reset.setOn(new OnFocusChangeListener() {    @Override    public void onFocusChange(View v, boolean hasFocus) {        if (hasFocus){btn_reset.setTypeface(null, Typeface.BOLD);}        else{btn_reset.setTypeface(null, Typeface.NORMAL);}    }   });</code></pre>","315998","","","","","2010-06-02 15:46:53","Android how to make button text bold when pressed or focussed","<android>","2","1","2","",""
"2682105","1","5232593","","2010-04-21 10:33:59","6","2763","<p>From the signing documentation at <a href=""http://developer.android.com/intl/zh-TW/guide/publishing/app-signing.html"" rel=""nofollow"">http://developer.android.com/intl/zh-TW/guide/publishing/app-signing.html</a>:</p><blockquote>  <p>When the system is installing an update to an application, if any of the certificates in the new version match any of the certificates in the old version, then the system allows the update.</p></blockquote><p>This indicates that an application can be signed with multiple certificates.</p><p>This is an interesting option to allow multiple entities to sign an application. e.g: A system application which was initially signed by the device's manufacturer. Further updates could be signed by the developer.</p><p>Am I misreading the documentation or is this really possible? If so, how?</p><p>Is there any other way for an application to support different certificates and with that, having two or more entities sign it?</p>","139992","","114066","","2011-03-08 11:41:55","2011-03-08 12:41:56","Sign application with several certificates","<android><certificate><keytool><apk>","2","2","2","",""
"2682228","1","2683464","","2010-04-21 10:53:03","0","650","<p>I am making a Google Finance application and searching for the APIs. </p><p>I have found the API on Google Finance site but there news also coming.</p><p>I have tried to search but could not get the API for the news.</p><p>Can you please guide me in this regard?</p>","297082","","105971","","2012-03-27 19:24:23","2012-03-27 19:24:23","RSS for Google Finance news","<android><rss><google-finance-api>","1","0","","",""
"2682338","1","","","2010-04-21 11:10:09","2","437","<p>i'm looking for a PND on which i can install android. </p><p>For example: <a href=""http://www.medion.com/de/electronics/prod/MEDION%C2%AE+GoPal%C2%AE+P4440+EU/30010109A1?category=navigation_28&amp;recId=&amp;wt_mc=de.intern.m-shop.pro-pla.on-ma&amp;wt_cc1=m-shop_topseller_navigation-2-links&amp;wt_cc2=30010109A1&amp;wt_cw=30.2.8&amp;utm_source=Internetseite-intern&amp;utm_medium=Kachel&amp;utm_content=navigation_2-links&amp;utm_campaign=Kategoriekachel-Hotspots&amp;utm_term=30010109A1"" rel=""nofollow"">http://www.medion.com/de/electronics/prod/MEDION%C2%AE+GoPal%C2%AE+P4440+EU/30010109A1?category=navigation_28&amp;recId=&amp;wt_mc=de.intern.m-shop.pro-pla.on-ma&amp;wt_cc1=m-shop_topseller_navigation-2-links&amp;wt_cc2=30010109A1&amp;wt_cw=30.2.8&amp;utm_source=Internetseite-intern&amp;utm_medium=Kachel&amp;utm_content=navigation_2-links&amp;utm_campaign=Kategoriekachel-Hotspots&amp;utm_term=30010109A1</a></p><p>I would like to install Android - not on a mobile phone, like it’s commonly down - but on a navigation device. In doing so I want to completely remove the old operating system and replace it with Android. Is this even possible, provided the hardware matches Android’s requirements, or are there other criteria to be aware of ?</p><p>Unfortunately I have not found any implementations of this kind yet and am therefore hoping that you can provide me with some help in this regard.</p><p>Sincerely yours, Christian</p>","322202","","","","","2010-04-21 11:15:51","Using Android on a PND(portable navigation device)?","<android>","1","2","","",""
"2682582","1","2682614","","2010-04-21 11:52:33","5","8007","<p>Spinner with checkbox items, is it possible?</p>","265375","","918414","","2012-01-30 09:24:53","2012-09-11 06:13:41","Spinner with checkbox items, is it possible?","<android><checkbox><spinner>","4","0","2","",""
"2682850","1","2721611","","2010-04-21 12:34:15","1","605","<p>I am currently developing an Android app i previously developed for IPhone. My Backend is built using WCF service with basichttpEndpoint, i also enabled RESTful methods for better support with other Mobile platforms as well. </p><p>Now i want to access my existing WCF service(SOAP/REST endpoint) on Android but i need some good ProxyGenerator to consume my services. I just google around for some solution and i found wsimport and wsdl2java(Axis) are two options in java domain. But i am still unable to find any solution related to Android. Can anyone suggest me the best practice in such scenario? </p>","189786","","","","","2011-09-30 03:23:40","wsimport and Android or any other ProxyGenerator for android?","<android><wcf><rest><wcf-rest>","1","0","","",""
"2682897","1","2683089","","2010-04-21 12:40:03","1","1514","<p>How could you delete a service permanently, I couldn't remove it.</p>","260511","","114066","","2010-04-21 15:54:46","2010-04-21 15:54:46","Delete service from the phone","<android>","1","0","","",""
"2683287","1","2683396","","2010-04-21 13:29:18","0","3928","<p>i have an address for a location. when i click some button in my app. it should redirect to default google map in android and drop the pin to that particular location. how to do that? Any Idea?</p>","267269","","267269","","2010-04-21 17:28:55","2012-02-09 20:49:20","Drop Pin on Default Google Maps from My App in Android?","<android><google-maps><android-mapview><android-maps>","2","0","","",""
"2683706","1","","","2010-04-21 14:18:31","11","1590","<p>I am trying to use gwt-mobile-webkit, particularly its location api. It works well with iPhone (both device and simulator) and Firefox and on G1 with 1.6 Android, however, it does not work on G2 with Android 1.5 on it. In result I am getting onFailure callback with Permission Denied error.</p><p>So it seems, that there is some geolocation API (gears or HTML5) in the browser available, but it just does not want to ask user for granting permissions.</p><p>Do you know if there is any workaround or just enable it somewhere in settings?</p>","98354","","","","","2010-05-05 22:08:19","Gears or HTML5 Location API on Android 1.5","<android><gwt><html5><geolocation><gears>","2","1","2","",""
"2683924","1","2684201","","2010-04-21 14:41:11","0","1712","<p>I've been working with Android's TTS functions with general success however, one piece of it refuses to work for me; I can not successfully assign an OnUtteranceCompletedListener to my TextToSpeech object.</p><p>I've tried implementing OnUtteranceCompletedListener in one of my classes and I've tried creating a new, stand-alone OnUtteranceCompletedListener instance.  Both approaches are simple enough to implement and appear to yield proper listeners without exceptions...yet setOnUtteranceCompletedListener(myListener) ALWAYS returns -1 (ERROR).</p><p>The documentation for this seems straight forward.  Has anyone gotten this to work? I'm targeting SDK 4. Are there known issues with this with SDK4/v1.6?</p>","262119","","262119","","2010-04-21 14:46:19","2011-03-21 21:19:49","TextToSpeech setOnUtteranceCompletedListener always returns -1 error?","<android><text-to-speech>","2","0","1","",""
"2684022","1","2684146","","2010-04-21 14:52:58","2","2162","<p>I am developing an application with a large number of elements that must be ordered alphabetically, and I'd like it to have the same look and feel as android's contact list, That is</p><pre><code>[Letter]&lt;contact&gt;&lt;contact&gt;[Letter]&lt;contact&gt;&lt;contact&gt;&lt;contact&gt;</code></pre><p>etc.</p><p>Which is the best way to achieve this same layout? I've seen several tutorials concerning scrollable lists, but this is a bit different. I've looked a bit through android's source code, but if anyone has the answer, it would save me a lot of time.</p><p>Thanks in advance.</p>","218473","","","","","2010-04-21 15:09:21","View like android's contact screen","<android><contacts>","1","0","1","",""
"2684055","1","6279906","","2010-04-21 14:56:56","1","536","<p>I am working on a multi-platform app (Mono) that will store text in a centralized location on the web and synchronize this text across clients that could potentially be IPhone/Android/WP7/OSX/Windows(WPF)/Linux/Web.  I need to support some degree of rich text (at minimum bold/italic/etc./basic lists/alignment), and I am trying to find a format that will be easily displayable and editable across all these platforms (though I'm using Mono, the GUI will be implemented with the native toolkit for each platform), so far I can only think of HTML or RTF, neither of which sound very pleasant. </p><p>Thanks!</p>","95909","","","","","2011-06-08 14:00:01","How to represent formatted text for display on IPhone/Android/WP7/PC","<iphone><wpf><android><text><formatting>","1","0","","",""
"2684103","1","2686914","","2010-04-21 15:02:53","1","1105","<p>I'm having strange issue with R.java file and styles defined in my resources.</p><p>Here's some code:</p><p>In res/values/strings.xml:</p><pre><code>&lt;style parent=""android:Theme.Dialog"" name=""PopupWindowStyle""&gt;&lt;item name=""android:windowBackground""&gt;@drawable/bg1&lt;/item&gt;&lt;item name=""android:textColor""&gt;@android:color/black&lt;/item&gt;&lt;/style&gt;</code></pre><p>In AndroidManifest.xml:</p><pre><code>&lt;activity    android:name="".RegisterScreen""    android:icon=""@drawable/ico""     android:label=""@string/applicationName""     android:theme=""@style/PopupWindowStyle""    android:configChanges=""locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale""&gt;&lt;/activity&gt;</code></pre><p>In autogenerated gen/.../R.java:</p><pre><code>public static final class style {    public static final int PopupWindowStyle=0x7f090000;}</code></pre><p>After some changes in the project, eclipse changed autogenerated value for <code>PopupWindowStyle</code> from 0x7f080000 to 0x7f090000. After that, on Android 1.5, <code>RegisterScreen</code> activity is displayed without <code>PopupWindowStyle</code> style - there is an error displayed in logcat:</p><p><code>Skipping entry 0x7f090000 in package table 0 because it is not complex!</code></p><p>On Android 1.6 however everything works fine - <code>PopupWindowStyle</code> works like it was before it's integer value has changed.</p><p>I was testing this issue, by reverting the source code to older revisions. I can confirm, that this problem started occurring after src code commit, which changed two files completely unrelated to this part of code - and an autogenerated R.java file.</p><p>Any idea what could cause that? </p>","306831","","","","","2012-02-28 04:30:28","Android 1.5/1.6 issue with style and autogenerated R.java file","<java><android>","3","2","","",""
"2684296","1","2684365","","2010-04-21 15:29:50","8","19825","<p>So far Ive managed to download and install the SDK and its in my PATH. Problem now is that I can't run ""android update sdk"" since it expects to be connected to a display and Im connected to a remote headless server through ssh (its a build server so there's no desktop env). Is there a command-line option for the android tool that tells it to run without X ?</p>","246793","","","","","2013-03-08 19:35:38","How to setup Android sdk from command-line on headless server?","<android><sdk><install><headless>","3","1","2","2013-10-23 12:13:05",""
"2684398","1","","","2010-04-21 15:42:46","1","2213","<p>Just to get this out in the open I am new to JAVA, KSOAP, and JSON. So I'll try to explain this the best I can.</p><p>A while ago I created a webservice to be consumed by Blackberry Apps that we're built using the plug in for Visual Studio. Now the project I am working on, I want to consume the same webservice for Android devices. For the most part I have the base code for the Android app done and working. Here's my problem:</p><p>I can successfully call the webservice and get a response. I know from creating the webservice that it sends a JSON response. My problem is trying to parse through the JSON response. I have found a few examples that I have been suiting to my needs however I am hung up on one thing.</p><p>In the JSON each element is preceeded by ""anyType"" which is forcing my code to return no results (Ultimately I am binding the data to an ArrayList) Here's what I get if I ""getProperty(0).toString()...</p><pre><code>anyType{Artist=anyType{TrackName=Champagne Supernova;};</code></pre><p>Here is the code I am using to parse the JSON Object....</p><pre><code>SoapObject gr = (SoapObject)envelope.getResponse();        String ro = gr.getProperty(0).toString();              //Added just to see structure of response        Artist_Result.add(gr.toString());        if (ro.startsWith(""{""))        {            JSONObject JSONObj = new JSONObject(ro);            Iterator&lt;String&gt; itr = JSONObj.keys();            while (itr.hasNext())            {                String key = (String)itr.next();                String value = JSONObj.getString(key);                //bundleResult.putString(key, value);                Artist_Result.add(value);            }        }        else if (ro.startsWith(""[""))        {            JSONArr = new JSONArray(ro);            for (int i = 0; i &lt; JSONArr.length(); i++)            {                JSONObj = (JSONObject)JSONArr.get(i);                //bundleResult.putString(String.valueOf(i), JSONObj.toString());                Artist_Result.add(JSONObj.toString());            }        }</code></pre><p>WebService Code:</p><pre><code> [WebMethod][return: System.Xml.Serialization.XmlArrayItemAttribute(typeof(Artist))]public Artist[] GetArtist(string ArtistQuery){   // All the SQL Stuff Here    SqlDataReader sReader;    sReader = cmd.ExecuteReader();    List&lt;Artist&gt; Artists = new List&lt;Artist&gt;();    while (sReader.Read())    {        Artist result = new Artist();        result.TrackName = sReader.GetString(0);        Artists.Add(result);    }    sReader.Close();    sqlConn.Close();    return Artists.ToArray();}public class Artist{    public string TrackName;}</code></pre><p>Sample of XML Output from a browser:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; - &lt;ArrayOfArtist xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns=""http://bb.mcrcog.com/""&gt;    - &lt;Artist&gt;          &lt;TrackName&gt;Champagne Supernova&lt;/TrackName&gt;       &lt;/Artist&gt;    - &lt;Artist&gt;         &lt;TrackName&gt;Don't Look Back In Anger&lt;/TrackName&gt;       &lt;/Artist&gt;    - &lt;Artist&gt;          &lt;TrackName&gt;D'you Know What I Mean&lt;/TrackName&gt;       &lt;/Artist&gt;    - &lt;Artist&gt;          &lt;TrackName&gt;Go Let It Out&lt;/TrackName&gt;       &lt;/Artist&gt;</code></pre><p>I have a feeling I will need to implement a Class, and Getters/Setters on the Android side. I'm just not sure how to go about doing that. Any help would be greatly appreciated!</p>","311165","","311165","","2010-04-21 18:32:52","2010-04-26 15:52:27","Parsing a JSON Response from a .Net webservice","<java><.net><android><json>","2","3","1","",""
"2684623","1","","","2010-04-21 16:11:05","-1","459","<p>I want to load a single XML file of 1.2Mb in  android  through assets folder as raw file. I heard that there is a limitation in android of 1Mb for a single xml file. How can i get rid of it? Is there any option to overcome this issue? please provide me some help UrGently!!!!!!!!!!!!.</p><p>Thanks in advance.</p><p>Praween</p>","292605","","","","","2010-04-21 18:01:51","How to upload XML file data in android emulator of more than 1.2Mb","<android>","1","1","","",""
"2684775","1","2685130","","2010-04-21 16:34:26","6","16757","<p>I am using Tablerow+TextView to make a simple view for blog posts and their replies. In each TableRow I put a TextView in. Now I have two issues:</p><ol><li><p>The text which is longer than the screen won't automatically wrap up to be multi-line. Is it by design of TableRow? I've already set <code>tr_content.setSingleLine(false);</code> [update] This has been addressed, I think I should change Fill_parent to be Wrap_content in textView.<code>tr_author_time.setLayoutParams(new LayoutParams(                     LayoutParams.**WRAP_CONTENT**,                     LayoutParams.WRAP_CONTENT));</code></p></li><li><p>The Table won't scroll like ListView. My rows are more than the screen size. I expect the table could be scrolled down for viewing just like ListView. Is that possible?</p></li></ol><p>Here is my code:</p><pre><code>    TableLayout tl = (TableLayout) findViewById(R.id.article_content_table);        TextView tr_title = new TextView(this);    TextView tr_author_time = new TextView(this);    TextView tr_content = new TextView(this);    TableRow tr = new TableRow(this);    for(int i = 0; i &lt; BlogPost.size(); i++){        try{        // add the author, time        tr = new TableRow(this);        /////////////////add author+time row        BlogPost article = mBlogPost.get(i);        tr_author_time = new TextView(this);        tr_author_time.setText(article.author+""(""+                article.post_time+"")"");        tr_author_time.setTextColor(getResources().getColor(R.color.black));        tr_author_time.setGravity(0x03);        tr_author_time.setLayoutParams(new LayoutParams(                     LayoutParams.FILL_PARENT,                     LayoutParams.WRAP_CONTENT));         tr.addView(tr_author_time);         tl.addView(tr,new TableLayout.LayoutParams(                 LayoutParams.FILL_PARENT,                 LayoutParams.WRAP_CONTENT));        ////////////////////// then add content row        tr = new TableRow(this);                    tr_content = new TextView(this);        tr_content.setText(article.content);        tr_content.setSingleLine(false);        tr_content.setGravity(0x03);        tr_content.setLayoutParams(new LayoutParams(                     LayoutParams.FILL_PARENT,                     LayoutParams.WRAP_CONTENT));                    tr.addView(tr_content);                tr.setBackgroundResource(R.color.white);            tl.addView(tr,new TableLayout.LayoutParams(                     LayoutParams.FILL_PARENT,                     LayoutParams.WRAP_CONTENT));    }   </code></pre>","253800","","253800","","2010-04-21 17:20:14","2014-01-07 15:27:29","android: two issues using Tablerow+TextView in Tablelayout","<android><textview><tablelayout><tablerow>","3","1","4","",""
"2684878","1","2684990","","2010-04-21 16:50:30","5","1350","<p>Iam planning to create an app, and not to publish it at the google market.i want the users to update thire app once in a while when an updates will be rlsd via server(let's not get into the idea how i gonna do this)... so for this i need to give to each app some ID, so i know that that user gotta update his app, and not new installation (i wanna avoid the case the user will have two versions of the app).. and ofcourse install the app to new users.how could i sign those apps with version when i rls an update manually?mybe some other idea?</p><p>thanks,ray.</p>","260511","","","","","2013-04-19 10:39:15","Create manual versions","<android>","2","0","2","",""
"2684948","1","2685437","","2010-04-21 17:00:08","1","4454","<p>I have a track I want to play 'megadeth', i'm calling it by...</p><pre><code>    final MediaPlayer mp = MediaPlayer.create(this, R.raw.megadeth);</code></pre><p>And playing it by using 'mp.start'</p><p>And I just want to know, how can I get this audio mp3 to loop?-Can you give me the code?</p><p>Thanks alot,</p>","321763","","","","","2013-10-19 20:01:35","Doing a loop on android (Audio)","<java><android><eclipse><audio><media>","2","2","","",""
"2685106","1","2687786","","2010-04-21 17:23:08","0","1826","<p>I have a crash (Application Stopped Unexpectedly) problem with this main.xml is a ""HelloWorld"" type project (while testing and learning features I need for my app) :</p><p>I isolated the ImageButton as an issue, but I can't isolate any of the parameters...</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;ImageButton android:id=""@+id/picture""        android:layout_width=""240dip""        android:layout_height=""180dip""    android:layout_gravity=""center_horizontal""    android:src=""@drawable/icon""    android:adjustViewBounds=""true""         android:cropToPadding=""true""        android:clickable=""true""        android:scaleType=""fitCenter"" /&gt;    &lt;/LinearLayout&gt;</code></pre><p>icon.png exists in my resources...I can see the preview in the Layout tab, even though the image is not centered on the button, but I read that it was normal.</p><p>The code below works fine (as a regular Button). I can also do the same as an ImageView.</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;Button android:id=""@+id/picture""    android:layout_width=""240dip""    android:layout_height=""180dip""    android:layout_gravity=""center_horizontal"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I use Eclipse and the AVD, and all my learning is done on 2.1 (SDK level 7).I can't test the app on an actual device yet as I don't have it yet.</p><p>Thanks in advance !</p>","322533","","","","","2010-04-22 02:00:49","Android crashes when calling ImageButton","<android><imagebutton>","1","1","","",""
"2685117","1","2686791","","2010-04-21 17:24:21","1","336","<p>I'm trying to run the google maps<br>example but it keep giving me in the console:  </p><pre><code>""WARNING: Application does not specify an API level requirement!""  ""Device API version is 7 (Android 2.1)""</code></pre><p>The application never starts,instead, it shows that frame with:   </p><pre><code>""The application (...) has stopped unexpectedly...""</code></pre><p>Can Anyone point what might be the the problem?  </p><p>Thanks</p>","243376","","","","","2010-04-22 15:40:41","Cannot run the Map Example","<android>","2","0","","",""
"2685254","1","2685306","","2010-04-21 17:44:42","0","1195","<p>I have this code:</p><pre><code>    hubSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {     public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {      final MediaPlayer mp2 = MediaPlayer.create(Textbox.this, R.raw.hero);      mp2.start();        }        public void onNothingSelected(AdapterView&lt;?&gt; parentView) {        }    });</code></pre><p>(The code basically runs when a new item is selected of a spinner and then plays a song, -which later will be a variable based on what was picked, but i'm fine as it is for now)</p><p>Problem:</p><p>And I want to be able to use 'mp2' out of this public void, (I want a button which pauses it) How can I do this?</p><p>Please explain/show...</p><p>Thanks alot</p><p>James</p>","321763","","","","","2010-04-21 19:32:58","Getting a variable out of a Public Void (Android)","<java><android><eclipse><variables><media-player>","2","0","","",""
"2685305","1","2693432","","2010-04-21 17:52:48","1","1826","<p>I'm trying to use a list view, and when I add an item to the ArrayList of its ListAdapter and call notifyDataSetChanged, it throws an exception.  Calling the addItem routine below will throw an exception.</p><p>The message says Source not Found, and then this:// Compiled from DataSetObservable.java (version 1.5 : 49.0, super bit)// Signature: Landroid/database/Observable;public class android.database.DataSetObservable extends android.database.Observable {</p><p>// Method descriptor #8 ()V  // Stack: 3, Locals: 1  public DataSetObservable();     0  aload_0 [this]     1  invokespecial android.database.Observable() [1]     4  new java.lang.RuntimeException [2]     7  dup     8  ldc  [3]    10  invokespecial java.lang.RuntimeException(java.lang.String) [4]    13  athrow      Line numbers:        [pc: 0, line: 5]      Local variable table:        [pc: 0, pc: 14] local: this index: 0 type: android.database.DataSetObservable</p><p>My initialization code:</p><pre><code>    tickerList = (ListView)findViewById(R.id.ListView01);    tickerModel = new StockAdapter(stocks);    tickerList.setAdapter(tickerModel);</code></pre><p>I've included my custom adapter class. (Modified from an online example)</p><pre><code>private class StockAdapter extends BaseAdapter {    private ArrayList &lt;Stockdata&gt;mData = new ArrayList&lt;Stockdata&gt;();    private LayoutInflater mInflater;    public StockAdapter(ArrayList&lt;Stockdata&gt;rows) {        mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        mData = rows;    }    public void addItem(Stockdata item) {        mData.add(item);        notifyDataSetChanged();    }    @Override    public int getCount() {        return mData.size();    }    @Override    public Stockdata getItem(int position) {        return mData.get(position);    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        System.out.println(""getView "" + position + "" "" + convertView);        ViewHolder holder = null;        if (convertView == null) {            convertView = mInflater.inflate(R.layout.row, null);            holder = new ViewHolder();            holder.textView = (TextView)convertView.findViewById(R.id.SYMBOL_CELL);            convertView.setTag(holder);        } else {            holder = (ViewHolder)convertView.getTag();        }        holder.textView.setText(mData.get(position).getSymbol());        return convertView;    }}public static class ViewHolder {    public TextView textView;}</code></pre>","321594","","","","","2010-04-22 18:32:11","Adding item to ListAdapter causes exception","<android><exception><listview>","1","3","","",""
"2685489","1","2685553","","2010-04-21 18:20:44","3","484","<p>sorry for a newbie question..but ""Service"" by it's defenision meaning the same as ""Remote service"" in Android?</p><p>and if not, what is the diffrence between them?</p><p>thanks,</p><p>moshik.</p>","273550","","","","","2010-04-21 18:29:42","services \ remote service","<android>","1","1","2","",""
"2685546","1","","","2010-04-21 18:29:04","6","238","<p>I am unable to understand and fix the following behavior displayed by the Package Installer : in my application when I press on a ""update application"" button I download from a web server un update apk (in case there is) and start the Package Installer afterwards to install the package. Everything goes well and after the installation finishes  there is displayed a view with two buttons ""open"" and ""done"" . However pressing the ""open"" button fails to open the installed update as it should even if the intent to the startup activity is sent  as I observed in logcat . Pressing on menu button and going through the applications installed I am able to find the updated app and start it from here . What should I do to start the update by pressing open in the final Package Installed view ?</p>","284609","","","","","2010-05-09 16:25:48","Package Installer misbehavoir","<android>","1","4","3","",""
"2686126","1","2699955","","2010-04-21 19:55:14","2","1178","<p>I'm trying to implement a Cometd/Bayeux server on Android using iJetty.  The Jetty implementation itself works just fine serving static pages along with servlets.  I am trying to up the ante a bit and create a Bayeux application on the phone but I'm having some trouble.  I can hit the page that has the dojo cometd scripts on it, but I am unable to subscribe to the channel.  When I view firebug/chome developer tools, I see a series of posts/gets that last a couple of milliseconds (~14).  However, when I run a cometd application on a normal machine, the posts/gets last several seconds (~14 seconds) before timing out and reopening the connection.  This second scenario makes sense to me with my understanding of how continuation in HTTP works.  So I'm thinking that something is not allowing those connections to hang open and prematurely returning a value and consequently closing the connection.  I would post my source but I'm not sure what to post short of posting everything...(it is open source though so if you want to have a look it's at <a href=""http://webtext-android.googlecode.com"" rel=""nofollow"">http://webtext-android.googlecode.com</a>).</p><p>So my question is, does anybody think that there could be some underlying limitation imposed by the Android system that is preventing these servlets from working? Are there assumptions that are made by the Jetty Bayeux implementation with regards to the underlying system? Or is it more likely that somehow I have a bad implementation of the ContinuationCometdServelt?  I should note that all of the posts/gets from the client return 200 OK messages so I'm not inclined to think that the Android system is simply terminating the connection.</p><p>I know this is a bit off the wall and I'm definitely trying to do something a bit out of the ordinary but any suggestions or tips would be greatly appreciated.</p><p>Thanks,</p><p>Chris</p>","150771","","","","","2010-04-23 15:47:17","System requirements for Cometd/Bayeux Usage on Android","<java><android><jetty><cometd><bayeux>","1","2","","",""
"2686264","1","2686315","","2010-04-21 20:19:48","11","1113","<p>I'm a beginner in programming. My experience so far is only in Actionscript 2 and 3. So I have a basic understanding of declaring variables, loops, arrays, if/then, do/while... I'm wanting to move to developing for Android phones so I'm wondering what suggestions people have for where to go next. Should I jump right to Android? Start with a 'beginning Java' approach? Or should I go some other route to beef up my knowledge of OOP concepts before launching into Android? I have my Dev environment set up and completed the Hello Android tutorial and I'm just wondering if I am going to be in over my head quickly?</p>","322655","","157882","","2011-10-23 14:18:49","2013-03-31 10:06:35","Beginning Programmer Interested in Android - Should I Start with Java?","<java><android>","5","0","3","2013-05-21 17:27:53",""
"2686509","1","2687218","","2010-04-21 20:58:20","3","3449","<p>I was wondering if it is possible to start a ListActivity and in real time decide how far down the list it should be focused on. (Example: When the activity is started it checks for certain conditions and then it may scroll down to a row partially through the list.) </p><p>Thanks,Rob</p>","289153","","","","","2010-04-21 23:22:58","Moving to a certain position in a ListView upon creation. (Android)","<android><listview>","1","0","","",""
"2686556","1","2840407","","2010-04-21 21:04:45","12","19446","<p>I am trying to use a custom title  to include an image button to the title bar. I got a lot of help form this post: <a href=""http://stackoverflow.com/questions/2569753/android-adding-button-to-the-title-of-the-app"">http://stackoverflow.com/questions/2569753/android-adding-button-to-the-title-of-the-app</a>, but could not get it work for my ListActivity.</p><p>In a nutshell, following is what I have:</p><ol><li>I hide the titlebar in the AndroidManifest.xml</li><li><p>The specify a relative layout for the custom title (workorder_list_titlebar.xml)</p></li><li><p>My Activity Class looks like the following:</p></li></ol><pre>    public class WorkOrderListActivity extends ListActivity {     String[] orders={""WO-12022009"", ""WO-12302009"",""WO-02122010"", ""02152010""};     @Override     public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);          requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);       this.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.workorder_list_titlebar);       setContentView(R.layout.workorder_list);       setListAdapter(new ArrayAdapter(this,R.layout.workorder_list, R.id.label,orders));                }    }</pre><p>When I ran the app, I got AndroidRuntimeException: You cannot combine custom titles with other title features. </p><p>Base on the stack trace, the exception was thrown by com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:183), that was triggered by setlistAdapter call.</p><p>Does anyone have the same problem with ListActivity?Also once I manage to get this work, how do I attach listeners to the image button for it to do something?</p><p>Thanks in advance.</p>","313322","","378445","","2011-08-15 20:37:05","2012-12-02 09:12:23","Try to use Window.FEATURE_CUSTOM_TITLE but got Exception:You cannot combine custom titles with other title feature..","<android>","9","0","9","",""
"2686712","1","2694499","","2010-04-21 21:30:32","0","13510","<p>probably I don't understand the layout properties of TableLayout yet. It doesn't seem to be possible to achieve such a flexible table like in HTML, because there are no cells. My target is it to achieve such a layout:</p><p><img src=""http://i.stack.imgur.com/UWdvO.jpg"" alt=""enter image description here""></p><p>How can I do that? I thought about using a GridView but this doesn't seem to be useful in XML.My efforts look like this:</p><pre><code>        &lt;TableLayout        android:id=""@+id/tableLayout""        android:layout_width=""320sp""        android:layout_height=""fill_parent""        android:layout_gravity=""center_horizontal""        android:gravity=""bottom""        android:layout_alignParentBottom=""true""&gt;        &lt;TableRow        android:background=""#333333""        android:gravity=""bottom""        android:layout_width=""fill_parent""&gt;             &lt;Button            android:id=""@+id/btnUp""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:gravity=""left""            android:text=""Lift U""            /&gt;        &lt;Button            android:id=""@+id/btnScreenUp""            android:gravity=""right""            android:layout_gravity=""right""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:text=""Scrn U""            /&gt;        &lt;/TableRow&gt;        &lt;TableRow          android:background=""#444444""          android:gravity=""bottom""          android:layout_gravity=""right""&gt;          &lt;Button            android:id=""@+id/btnDown""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:text=""Lift D""            /&gt;           &lt;Button            android:id=""@+id/btnScreenLeft""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:gravity=""right""            android:layout_gravity=""right""            android:text=""Scrn L""            /&gt;           &lt;Button            android:id=""@+id/btnScreenDown""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:gravity=""right""            android:layout_gravity=""right""            android:text=""Scrn D""            /&gt;           &lt;Button            android:id=""@+id/btnScreenRight""            android:layout_width=""60sp""            android:layout_height=""50sp""            android:gravity=""right""            android:layout_gravity=""right""            android:text=""Scrn R""            /&gt;        &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","319773","","319773","","2012-01-14 14:56:40","2012-01-14 14:56:40","How to align Buttons in a TableLayout to different directions?","<android><android-layout>","2","0","1","",""
"2686823","1","2686982","","2010-04-21 21:50:54","3","245","<p>When I tried to do a simple modification of the ""hello android"" program that eclipse adt plugin generates I get error and can't get the program to run again even if I restore the file to its original contents. The modification was that I changed a string in strings.xml. the line was: </p><pre><code>&lt;string name=""app_name""&gt;Todo List&lt;/string&gt;</code></pre><p>and the app was runnable, then I changed it to</p><pre><code>&lt;string name=""app_name""&gt;Todo List1&lt;/string&gt;</code></pre><p>and it was an error: </p><pre><code>[2010-04-21 23:18:03 - Todo_list] Error in an XML file: aborting build.</code></pre><p>And a new empty file also showed up called: strings.out.xmlAnd then I can't get the prrogram back into runnable state even if I delete the empyt file and restore the original line, I'm a confused beginner of java, android and eclipse.</p>","199138","","","","","2011-03-17 18:28:07","simple modification results in error","<java><android><eclipse>","3","0","","",""
"2686933","1","2687066","","2010-04-21 22:16:39","1","911","<p>I'm using a WebViewClient that overrides shouldOverrideUrlLoading so the browsing stays inside the WebView.  I initially call loadDataWithBaseURL with some HTML I have in memory, which has links in it.  When I click the links, they load correctly in the webView.  </p><p>Everything is good up till now, but when I press back, effectively calling webView.goBack(), the webView loads the failUrl I passed to loadDataWithBaseURL.</p><p>Why does it work going forward, but not going backward?</p>","135199","","","","","2010-04-21 22:44:47","Android WebView can render HTML going forward, but not backward","<android>","1","0","","",""
"2687015","1","2687093","","2010-04-21 22:29:58","16","13509","<p>I'm trying to modify the SurfaceView I use for doing a camera preview in order to display an overlaying square. However, the onDraw method of the extended SurfaceView is never called.</p><p>Here is the source :</p><pre><code>public class CameraPreviewView extends SurfaceView {    protected final Paint rectanglePaint = new Paint();    public CameraPreviewView(Context context, AttributeSet attrs) {        super(context, attrs);        rectanglePaint.setARGB(255, 200, 0, 0);        rectanglePaint.setStyle(Paint.Style.FILL);        rectanglePaint.setStrokeWidth(2);    }    @Override    protected void onDraw(Canvas canvas){        canvas.drawRect(new Rect(10,10,200,200), rectanglePaint);        Log.w(this.getClass().getName(), ""On Draw Called"");    }}public class CameraPreview extends Activity implements SurfaceHolder.Callback{    private SurfaceHolder holder;    private Camera camera;    @Override    protected void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        // We remove the status bar, title bar and make the application fullscreen        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                WindowManager.LayoutParams.FLAG_FULLSCREEN);        // We set the content view to be the layout we made        setContentView(R.layout.camera_preview);        // We register the activity to handle the callbacks of the SurfaceView        CameraPreviewView surfaceView = (CameraPreviewView) findViewById(R.id.camera_surface);        holder = surfaceView.getHolder();        holder.addCallback(this);        holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {        Camera.Parameters params = camera.getParameters();        params.setPreviewSize(width, height);        camera.setParameters(params);        try {            camera.setPreviewDisplay(holder);        } catch (IOException e) {            e.printStackTrace();        }        camera.startPreview();    }    public void surfaceCreated(SurfaceHolder holder) {        camera = Camera.open();    }    public void surfaceDestroyed(SurfaceHolder holder) {        camera.stopPreview();        camera.release();       }}</code></pre>","126912","","","","","2011-12-30 21:00:57","Extended SurfaceView's onDraw() method never called","<android>","3","1","10","",""
"2687027","1","2687060","","2010-04-21 22:35:04","145","137854","<p>The Android SDK offers the standard menu icons via <code>android.R.drawable.X</code>. However, some standard icons, such as <code>ic_menu_refresh</code> (the refresh icon), are missing from <code>android.R</code>.</p><p>Is there any way to get the original icons, maybe by extracting them from the applications? I already checked the Android source, but it's a bit too huge to look everywhere for the images.</p><p>I know the <em><a href=""http://androiddrawableexplorer.appspot.com"">Android Drawables</a></em> website, but I would like to get the correct <em>hdpi</em>, <em>mdpi</em> and <em>ldpi</em> version, preferable the original ones.</p>","216074","","63550","","2011-08-29 07:56:11","2013-06-15 02:26:54","Standard Android menu icons, for example refresh","<android>","5","0","60","2013-06-15 08:10:29",""
"2687234","1","2687502","","2010-04-21 23:27:47","2","438","<p>right now, for an explosion, i am just showing 3 images in a for loop, is there any better way to create a more realistic explostion? thanks.</p>","270811","","","","","2010-11-07 19:32:54","how to create more realistic explosions","<java><android><animation>","4","1","","",""
"2687379","1","","","2010-04-22 00:04:34","1","132","<p>I want to be able to have many button and objects in my project but they all wont fit on the screen at once so i would like the user to be able to scroll down and have more appear but i cant get it to work. I tried using ScrollView but it always throws me errors. Here is what I have so far. Please, any help would be great.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""Hello World, tipcalc""/&gt;&lt;TextViewandroid:id=""@+id/widget28""android:layout_width=""99px""android:layout_height=""17px""android:text=""Monthly Income""android:layout_x=""40px""android:layout_y=""32px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget29""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Cable""android:layout_x=""40px""android:layout_y=""82px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget30""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Internet""android:layout_x=""40px""android:layout_y=""132px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget33""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Total To Pay""android:layout_x=""40px""android:layout_y=""302px""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/btncalculate""android:layout_width=""87px""android:layout_height=""wrap_content""android:text=""Calculate""android:layout_x=""40px""android:layout_y=""182px""&gt;&lt;/Button&gt;&lt;Buttonandroid:id=""@+id/btnreset""android:layout_width=""86px""android:layout_height=""wrap_content""android:text=""Reset""android:layout_x=""140px""android:layout_y=""182px""&gt;&lt;/Button&gt;&lt;EditTextandroid:id=""@+id/Monthly""android:layout_width=""wrap_content""android:layout_height=""35px""android:text=""100""android:textSize=""18sp""android:layout_x=""200px""android:layout_y=""22px""&gt;&lt;/EditText&gt;&lt;EditTextandroid:id=""@+id/Internet""android:layout_width=""51px""android:layout_height=""36px""android:text=""10""android:textSize=""18sp""android:layout_x=""200px""android:layout_y=""72px""&gt;&lt;/EditText&gt;&lt;EditTextandroid:id=""@+id/Cable""android:layout_width=""wrap_content""android:layout_height=""39px""android:text=""1""android:textSize=""18sp""android:layout_x=""200px""android:layout_y=""122px""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/txttotal""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""""android:layout_x=""200px""android:layout_y=""302px""&gt;&lt;/TextView&gt;&lt;/AbsoluteLayout&gt;</code></pre>","302991","","","","","2010-04-23 06:56:43","Can someone please help, I cant get this simple scolling feature","<android>","1","2","","",""
"2687712","1","","","2010-04-22 01:41:38","4","11370","<p>My use case is writing an overlay controller activity for a landscape camera preview. I followed the instructions from a couple of tutorials for writing a transparent theme.</p><p>So my res/values/style.xml looks like this:</p><pre><code>&lt;resources&gt;  &lt;style name=""Theme"" parent=""android:Theme"" /&gt;  &lt;style name=""Theme.Transparent""&gt;      &lt;item name=""android:windowBackground""&gt;@drawable/transparent_background&lt;/item&gt;  &lt;/style&gt;  &lt;drawable name=""transparent_background""&gt;#00000000&lt;/drawable&gt;&lt;/resources&gt;</code></pre><p>The activity snippet:</p><pre><code>    &lt;activity android:name="".CameraPreview""       android:label=""Camera""       android:screenOrientation=""landscape""       android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&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="".Controlls""              android:label=""Controlls""              android:screenOrientation=""portrait""              android:theme=""@android:style/Theme.Translucent""&gt;    &lt;/activity&gt;</code></pre><p>When I start this activity from my root activity, the layout gets drawn correctly, but the background stays black. I tried to use <code>@android:style/Theme.Translucent</code> instead, but this Theme inherits the orientation from the calling activity (landscape) and thats not what I want.</p><p><strong>Edit:</strong></p><p>The application holding the camera preview is set to landscape view as it does not display the preview correctly in portrait orientation. (see <a href=""http://code.google.com/p/android/issues/detail?id=1193"" rel=""nofollow"">old google bug report</a>)</p><p>What I wanted to do was to put an independent activity for user interaction interface in front of the camera surface holder (this activity should be set to 'portrait', or even better to 'sensor')</p>","319919","","319919","","2010-04-22 19:19:49","2012-01-20 21:12:01","Activity should be transparent, but has black background","<android><android-layout>","4","0","0","",""
"2687773","1","","","2010-04-22 01:56:24","29","54480","<p>I'm trying to use the <a href=""http://soft.antonspaans.com/products/smugfig-api"">SmugFig</a> SmugMug API on Android.  It was designed for J2SE I would imagine, so I'm not sure it will even work on Android, but I figured it was worth trying as opposed to trying to create my own API.  </p><p>When I load the project though, I get the following error:</p><pre><code>Conversion to Dalvik format failed: Unable to execute dex: null</code></pre><p>It doesn't say what package it fails on, just ""Android Packaging Problem"", but it did not do this before I added SmugFig and it's dependency JARS to the build path.</p><p>Where should I look? Or does this mainly me that it just won't work with those libraries?</p>","194","","137483","","2010-06-16 15:49:16","2013-04-29 10:29:17","Android: Conversion to Dalvik format failed: Unable to execute dex: null","<java><android><eclipse><dalvik>","13","1","5","",""
"2687894","1","2690023","","2010-04-22 02:33:04","0","2804","<p>I would like to know how can I import songs from a web service into<br>Android library without having to download the file into sdcard.I have all the data from the web service but I do not know how to<br>integrate the tracks into Android database. My idea is not to have to<br>download the files, but playing them on streaming using the music<br>player.Do I need to download the tracks to the sd card and then Android does<br>all the stuff?</p><p>Thanks in advance </p>","241911","","","","","2010-11-22 23:16:40","How to import music into Android library","<android><import><media><player>","1","0","","",""
"2687934","1","","","2010-04-22 02:44:57","1","1596","<p>Basic example, if I bought a chipset with a light socket and bulb soldered to the chipset; then put a USB cable with the mini-USB plug on the end to get plugged into the android phone. Can I write a Java application to turn on/off the light, get the status of the light(on/off) and maybe power a super-small led/bulb with power from the phone itself?</p><p>Any insight at all would be greatly appreciated. Thank you</p>","322865","","322865","","2010-04-22 02:51:21","2012-01-17 16:23:17","Can Android OS be programmed to interface with a external device via the mini-USB port?","<android><usb><usbserial>","3","0","","",""
"2688169","1","2690030","","2010-04-22 04:04:55","5","28891","<p>I take a picture with the camera using</p><pre><code>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );startActivityForResult( intent, 22 );</code></pre><p>When the activity completes, I write the bitmap picture out to a PNG file.</p><pre><code>    java.io.FileOutputStream out = openFileOutput(""myfile.png"", Context.MODE_PRIVATE);    bmp.compress(Bitmap.CompressFormat.PNG, 90, out);</code></pre><p>That goes OK, and I can see the file is created in my app private data space.</p><p>I'm having difficulty when I later want to display that image using an ImageView.</p><p>Can anyone suggest code to do this?</p><p>If I try to create a File with path separators in, it fails.If I try to create a Uri from a name without separators, that fails.</p><p>I <em>can</em> open the file OK using:</p><pre><code>        java.io.FileInputStream in = openFileInput(""myfile.png"");</code></pre><p>But that doesn't give me the Uri I need to set an image with</p><pre><code>   iv.setImageURI(u)</code></pre><p>Summary: I have the picture in a png file in private app data.  What's the code to set that into an ImageView?</p><p>Thanks.</p>","253661","","","","","2013-07-17 19:20:04","How to load an ImageView from a png file?","<android><file><load><png><imageview>","6","0","2","",""
"2688193","1","2693630","","2010-04-22 04:10:09","10","44952","<p>I have a web service that returns a super simple list of objects</p><p>MyObject[] data = webServiceCall();</p><p>MyObject has 1 field i want to display, <code>""Name""</code> (i.e. <code>data[0].Name</code> )</p><p>How can i turn this into an activity that lists just the name of these objects in a scrollable <code>listActivity</code> on Android.  I am getting really confused with Cursors and am not sure if I need Cursors and I""m not sure what kind of adapter to implement (<code>BaseAdapter</code>, <code>SimpleAdapter</code> etc)  </p><p>So i guess i'm looking for three things, </p><p>the activity, the adapter and the <code>layout.xml</code> </p><p>Just trying to figure this android stuff out, definitely a noob here</p>","202064","","202064","","2013-06-03 21:56:35","2013-06-03 21:56:35","Is there a super simple List / ListAdapter example out there for android","<android><listview><activity><listadapter>","3","0","6","",""
"2688332","1","","","2010-04-22 04:58:28","3","720","<p>I'm running one application in android browser which contain the following code..</p><pre><code>if (typeof XPathResult != ""undefined"") {    //use build in xpath support for Safari 3.0    var xmlDocument = doc;    if (doc.nodeType != 9) {        xmlDocument = doc.ownerDocument;    }    results = xmlDocument.evaluate( xpathExpr,                                    doc,                                    function(prefix) {                                        return namespaces[prefix] || null;                                    },                                    XPathResult.ANY_TYPE,                                    null );    var thisResult;    result = [];    var len = 0;    do {        thisResult = results.iterateNext();        if (thisResult) {            result[len] = thisResult;            len++;        }    } while ( thisResult );}else {    try {        if (doc.selectNodes) {            result = doc.selectNodes(xpathExpr);        }    } catch (ex) {}}return result;</code></pre><p>but when i run this app in Firefox control come in if statement and everything works fine..</p><p>but in android browser it's giving error  ...XPathResult undefined...this time control come to else statement and even here it's showing that selectNodes is undefind and. so the result come as null whereas in Firefox it's giving list of nodes..</p><p>realy need it to be done ...  help needed..</p><p>thanks... </p>","323876","","539542","","2012-01-15 05:31:43","2012-01-15 05:31:43","xpath evaluating error in android","<xml><android><xpath>","1","4","","",""
"2688440","1","2701561","","2010-04-22 05:32:20","3","11097","<p>I am implementing  one application gust i am adding validations in login page implemented then two fields required username and password  button login i am applying validations then focus are not getting then set focus in unfilled edittext </p><p>></p><pre><code> if(Username.contentEquals("""")) {    &gt; Toast.makeText(LBS.this, ""Please enter    &gt; username "",Toast.LENGTH_SHORT).show();     &gt; } else { if( pwd.contentEquals(""""))     &gt; Toast.makeText(LBS.this, ""Please enter    &gt; password "",Toast.LENGTH_SHORT).show();    &gt; else    &gt;             try { ........................... }</code></pre><p>not filling username then filling password then username entered some toast displayed fine focus are entered in username edittext this is the problem how can implemented focus in unfilled username   </p>","254790","","","","","2010-08-17 19:48:05","set focus in unfilled edittext how can implemented android application","<android>","1","0","3","",""
"2688763","1","3556786","","2010-04-22 06:52:33","3","1139","<p>So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it's displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode=""singletask"" in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I'm not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity.</p><p>I hope that made sense. I can post code if necessary, but I think that should explain my situation.</p>","375874","","","","","2010-08-24 13:23:20","Passing bundle to activity set as singletask","<java><android><activity>","1","0","2","",""
"2689210","1","","","2010-04-22 08:20:25","2","1207","<p>Is there any way to make the progress bar into a circle shape? I have a play button in my apps and would like to show the progress of loading the song around the button. </p>","679696","","437","","2012-04-30 18:35:23","2012-04-30 18:35:23","progress indicator","<android><progress-bar>","1","2","1","",""
"2689301","1","","","2010-04-22 08:37:21","2","282","<p>Can I share a library between two applications/apks where it is packed with any one of it?</p>","321234","","1288","","2010-04-22 13:48:37","2010-07-23 20:05:56","Sharing of library files between apks","<android><content>","3","0","","",""
"2689351","1","2689897","","2010-04-22 08:48:06","2","1078","<p>I've been given some Symbian C++ code to port over for use with the Android NDK.</p><p>The code has lots of Symbian specific code in it and I have very little experience of C++ so its not going very well.</p><p>The main thing that is slowing me down is trying to figure out the alternatives to use in normal C++ for the Symbian specific code.</p><p>At the minute the compiler is throwing out all sorts of errors for unrecognised types.</p><p>From my recent research these are the types that I believe are Symbian specific:</p><blockquote>  <p><strong>TInt, TBool, TDesc8, RSocket, TInetAddress, TBuf, HBufc,  RPointerArray</strong></p></blockquote><p>Changing TInt and TBool to int and bool respectively works in the compiler but I am unsure what to use for the other types?</p><p>Can anyone help me out with them? Especially TDesc, TBuf, HBuf and RPointerArray.</p><hr><p>Also Symbian has a two phase contructor using </p><blockquote>  <p><strong>NewL</strong></p></blockquote><p>and </p><blockquote>  <p><strong>NewLc</strong></p></blockquote><p>But would changing this to a normal C++ constructor be ok?</p><hr><p>Finally Symbian uses the clean up stack to help eliminate memory leaks I believe, would removing the clean up stack code be acceptable, I presume it should be replaced with try/catch statements?</p>","243999","","243999","","2010-04-22 08:58:08","2010-04-26 21:23:03","Porting Symbian C++ to Android NDK","<c++><android><symbian><porting><android-ndk>","4","2","2","",""
"2689373","1","","","2010-04-22 08:52:56","1","214","<p>I want to access ""http://www.persistent.co.in website through Web View.I am using following APIs</p><pre><code>webView.getSettings().setJavaScriptEnabled(true) ;webView.getSettings().setLoadsImagesAutomatically(true);webView.loadUrl(""http://www.somesite.co.in"");</code></pre><p>On this website there are some images,but I am not able to see that images.</p><p>Can anyone tell me what is the problem???</p>","323062","","323062","","2010-05-05 08:38:53","2010-05-05 08:38:53","Problem while accessing website in web view in Android Application","<android><android-widget>","0","1","","",""
"2689621","1","2690066","","2010-04-22 09:31:32","2","684","<p>    </p><pre><code>    &lt;TextView        android:id = ""@+id/txtBabbleListTitle""    android:layout_width = ""wrap_content""    android:layout_height = ""wrap_content""    android:textColor = ""#000000""               android:text = ""New Babble has been put up."" &gt;    &lt;/TextView&gt;    &lt;TextView        android:id = ""@+id/txtBabbleDateTime""    android:layout_width = ""wrap_content""    android:layout_height = ""wrap_content""    android:layout_alignParentBottom = ""true""    android:textColor = ""#000000""        android:text = ""2010-04-10 09:47:42"" &gt;    &lt;/TextView&gt;    &lt;TextView        android:id = ""@+id/txtBabbleTotalReplies""        android:layout_width = ""wrap_content""    android:layout_height = ""wrap_content""    android:layout_alignParentRight = ""true""    android:textColor = ""#000000""               android:text = ""(7)"" &gt;   &lt;/TextView&gt; &lt;/RelativeLayout&gt;</code></pre><p>This is the layout that I am inflating in the Adapter. Everything is displayed, but only the second textview which should be displayed at the bottom is getting displayed at the top. Can someone let me know the problem with this?</p><p>I I view this in the layout tab in Eclipse then it displays properly. The problem occurs only when the text is fetched dynamically.</p>","261566","","1069068","","2013-03-19 14:47:45","2013-03-19 14:47:45","Layout not displayed properly while dynamically loading a listview in Android?","<android><listview><dynamic><relativelayout>","1","0","","",""
"2689729","1","2725220","","2010-04-22 09:49:19","16","15483","<p>I would like to put a progress bar in the notification bar. The idea is showing the progress bar while the program uploads a file to a server. Everything else is ok, but I can not figure out how to refresh the progress bar inside the notification. Does anybody knows any pattern to play with? I mean, where I should refresh the progress bar, in a service or activity and so.</p>","241911","","437","","2012-04-30 18:34:12","2014-02-22 16:08:29","Refresh progress bar in notification bar","<android><progress-bar><notification-bar>","3","3","10","",""
"2689850","1","2689980","","2010-04-22 10:09:02","1","193","<p>Through the housekeeping stuff my android application has to do is to read and write some files and sometimes to delete others and create new ones. The files in cause have all ""sdcard/"" as root. Is it safe if I perform all this task using Java style functions ? To me it is very handy to do it this way  but I've read that not always the java functions can be applied when it comes to files in Android.</p>","304866","","","","","2010-04-22 10:30:28","Android files manipulation","<android>","1","0","","",""
"2689854","1","2689915","","2010-04-22 10:10:00","3","892","<p>can anyone tell me how I programmatically retrieve the actual Locale and/or Language in Android ?</p>","162147","","","","","2010-04-22 10:18:21","How to retrieve actual Locale/Language","<android><locale>","1","0","1","",""
"2690115","1","2690785","","2010-04-22 10:54:05","0","79","<p>Hi i have a problem accessing run() method in my program. The rum method is not getting focus at all. The Log message that is present outside the loop is getting displayed and i am getting a blank screen with preset background.Here's the code...</p><pre><code>public class MusicListActivity extends Activity {List&lt;HashMap&lt;String, String&gt;&gt; songNodeDet = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();HashMap&lt;?,?&gt;[] songNodeWeb; XMLRPCClient client;String logInSess;ArrayList&lt;String&gt; paths=new ArrayList&lt;String&gt;();public ListAdapter adapter ;Object[] websongListObject;List&lt;SongsList&gt; SongsList=new ArrayList&lt;SongsList&gt;();Runnable r;ProgressDialog p;ListView lv;@Overridepublic void onCreate(Bundle si){    super.onCreate(si);    setContentView(R.layout.openadiuofile);    lv=(ListView)findViewById(R.id.list1);    r=new Runnable(){        public void run(){            try{                getSongs();                list();                Log.d(""handler"",""handler"");                  removeDialog(0);                p.dismiss();            } catch (MalformedURLException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (XMLRPCException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    };              Log.e(""***"",""process over"");}@Overrideprotected void onResume() {    // TODO Auto-generated method stub      super.onResume();}    public void webObjectList(Object[] songListObj) throws XMLRPCException{    songNodeWeb = new HashMap&lt;?,?&gt;[songListObj.length];    for(int i=0;i&lt;songListObj.length;i++){         songNodeWeb[i]=(HashMap&lt;?,?&gt;)songListObj[i];        String nodeid=(String) songNodeWeb[i].get(""nid"");        Log.e(""Song"",i+""completed"");        HashMap&lt;String,String&gt; nData=new HashMap&lt;String,String&gt;();        nData.put(""nid"",nodeid);                Object nodeget=client.call(""node.get"",nodeid);        HashMap&lt;?,?&gt; songNode=(HashMap&lt;?,?&gt;)nodeget;        String title=(String) songNode.get(""title"");        String album=(String) songNode.get(""album"");            String artist=(String) songNode.get(""artist"");        nData.put(""title"", title);        nData.put(""album"", album);        nData.put(""artist"", artist);        Object[]  songObject=(Object[])songNode.get(""title_format"");        HashMap&lt;?,?&gt;[] songDetails=new HashMap&lt;?,?&gt;[songObject.length];        songDetails[0]=(HashMap&lt;?, ?&gt;)songObject[0];        String path=(String) songDetails[0].get(""filepath"");        if(path.contains("" "")){            path=path.replace("" "", ""%20"");        }        String songPath=""http://www.gorinka.com/""+path;        paths.add(songPath);        nData.put(""path"", songPath);        Log.e(""my path"",path);        SongsList songsList=new SongsList(title, album, artist,songPath,songPath);        SongsList.add(i,songsList);        songNodeDet.add(i,nData);    }    Log.e(""paths values"",paths.toString());         handler.sendEmptyMessage(0);}public void list()  {      Log.d(""#####"",""#####"");     LayoutInflater inflater=getLayoutInflater();        String[] from={};        int[] n={};     adapter=new SongsAdapter(getApplicationContext(),songNodeDet,R.layout.row,from,n,inflater);     lv.setAdapter(adapter);  }public void getSongs() throws MalformedURLException, XMLRPCException{      String ur=""http://www.gorinka.com/"";    URL u=new URL(ur);     client = new XMLRPCClient(u);           websongListObject =(Object[]) client.call(""nodetype.get"",""titles"");     webObjectList(websongListObject);     Log.d(""webObjectList"",""webObjectList"");     runOnUiThread(r);}private Handler handler = new Handler() {    public void handleMessage(Message msg){       Log.d(""handler"",""handler"");              removeDialog(0);      p.dismiss();     }</code></pre><p>};   }</p><p>I m trying to access the strings through simple adapter... Here's the code for adapter...</p><pre><code>public class SongsAdapter extends SimpleAdapter{static List&lt;HashMap&lt;String,String&gt;&gt; songsList;Context context;LayoutInflater inflater;public SongsAdapter(Context context,List&lt;HashMap&lt;String,String&gt;&gt; imgListWeb,int layout,String[] from,int[] to,LayoutInflater inflater) {    super(context,songsList,layout,from,to);    this.songsList=songsList;    this.context=context;    this.inflater=inflater;    // TODO Auto-generated constructor stub}@Overridepublic View getView(int postition,View convertView,ViewGroup parent)throws java.lang.OutOfMemoryError{    try {    View v = ((LayoutInflater) inflater).inflate(R.layout.row,null);    ImageView images=(ImageView)v.findViewById(R.id.image);    TextView tvTitle=(TextView)v.findViewById(R.id.text1);    TextView tvAlbum=(TextView)v.findViewById(R.id.text2);    TextView tvArtist=(TextView)v.findViewById(R.id.text3);    HashMap&lt;String,String&gt; songsHash=songsList.get(postition);    String path=songsHash.get(""path"");    String title=songsHash.get(""title"");    String album=songsHash.get(""album"");    String artist=songsHash.get(""artist"");    String imgPath=path;        final ImageView imageView = (ImageView) v.findViewById(R.id.image);    AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv();    Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {        public void imageLoaded(Bitmap imageDrawable, String imageUrl) {            imageView.setImageBitmap(imageDrawable);        }        });    imageView.setImageBitmap(cachedImage);    tvTitle.setText(title);    tvAlbum.setText(album);    tvArtist.setText(artist);    return v;    }    catch(Exception e){        Log.e(""error"",e.toString());    }    return null;}public static Bitmap loadImageFromUrl(String url) {    InputStream inputStream;Bitmap b;try {    inputStream = (InputStream) new URL(url).getContent();    BitmapFactory.Options bpo=  new BitmapFactory.Options();    bpo.inSampleSize=2;     b=BitmapFactory.decodeStream(inputStream, null,bpo );     return b;} catch (IOException e) {        throw new RuntimeException(e);    }}</code></pre><p>}</p><p>Plz help me determinre the problem and solution for my problem... Need it badly...</p>","303155","","","","","2010-04-22 12:39:41","problem accessing run() in android","<android>","1","0","","",""
"2690134","1","2690354","","2010-04-22 10:56:54","4","2012","<p>i have the following question.</p><p>I have an activity which is showing a progress bar while a service is downloading data from an API. I want that when i press Home and relaunch my program the activity and which is not the first activity called but it is in the stack was recovered in order to continue showing the progress.</p><p>I have read about the cycle of life of activities but i don't find a clear solution. </p><p>The same thing happens If i am in the activity which is showing the progress bar and i press a button that takes me to another activity, when i go back, can i recover the old activity instead launch one new?</p><p>Anyone helps me?</p><p>Thanks</p>","258863","","258863","","2010-04-22 12:46:33","2010-04-22 13:03:43","Android: Recovery Activity When I press Home","<android><activity>","1","0","2","",""
"2690170","1","2690630","","2010-04-22 11:03:52","4","3336","<p>How to set style(small and large) to Button programmable way ?</p><p>Is it possible ? </p><p>I can set the style to the Button from xml resource (like styte= ?android:attr/buttonStyleSmall).But I don't know how set it programmable way.</p><p>Thanks in advance. </p>","164589","","164589","","2010-04-22 11:31:26","2011-05-23 10:45:46","How to set style(small and large) to Button programmable way?","<android>","2","1","","",""
"2690212","1","2690685","","2010-04-22 11:11:21","1","901","<p>I would like to have a checkbox preference that takes the user to a new (sub)preference screen if the user presses on the actual text (and not on the checkbox to the right).</p><p>Just as the control under Settings -> Wireless -> Mobile Network Settings -> Access Point Names.</p>","276052","","","","","2010-04-22 12:23:50","How do I write a combined CheckboxPreference / PreferenceScreen?","<android><checkbox><preference>","2","0","1","",""
"2690389","1","2690405","","2010-04-22 11:39:36","2","11113","<p>I want to integrate the zxing source code to my android application. I have downloaded the zxing1.5 and integrate the whole code to my application and i am calling the activity ""CaptureActivity"" through intent. It is showing only the camera view but it is not scanning the barcode. Can u please tell me how to solve this problem because i want my application to be stand alone. i don't want to install BarcodeScanner.apk separately in the device.</p><p>thanks in advance.... </p>","307585","","21886","","2010-04-22 11:41:39","2012-02-09 16:15:39","Zxing barcode source code integration to the android project","<android>","2","1","2","",""
"2690503","1","","","2010-04-22 11:55:37","0","3640","<p>I am working on Android. Trying to display the ""favicon"" (aka ""shortcut icon"") or web pages.</p><p>So I already have the code to get the URL of this icon from any website, and download it onto my Android.</p><p>Now I am trying to make a Bitmap out of it, but always get null as a result.</p><p>The code:</p><pre><code>String src = String.format(""file:///data/data/com.intuitiveui.android/files/%s"",prefName);// prefName is ""facebook.ico"", and I do see tht file in my DDMS file browser. It's// a valid icon file.Bitmap res = BitmapFactory.decodeFile(src);// This returns null</code></pre><p>TIA</p>","323208","","3265095","","2014-03-24 07:10:24","2014-03-24 07:10:24","Can BitmapFactory.decodeFile handle .ICO (Windows icons) files?","<android><bitmap><icons>","4","0","1","",""
"2690534","1","","","2010-04-22 11:59:58","0","566","<p>I am looking to find out how to assign an image to a imageview in each child of an expandable list. </p><p>If anyone has any information or links to find out how to do this I would be most appreciative.</p><pre><code>expListAdapter =            new SimpleExpandableListAdapter(                 main.this,                createGroupList(),                R.layout.parentnode,                new String[] { ""day"", ""number"" },                new int[] { R.id.TextView01, R.id.TextView02 },                createChildList(),                R.layout.child_row,                new String[] { ""image"", ""childName"", ""date""},                new int[] { R.id.ImageView01, R.id.childname, R.id.date }            );        setListAdapter( expListAdapter );</code></pre><p>is what my adapter looks like at the moment, I have very little experience in customising adapters so I do not know where to start.</p><p>Any help would be great :D</p>","287072","","","","","2010-04-22 13:46:08","Adding a imageview to child elements in a expandable list query","<android><android-widget><expandablelistview>","1","0","","",""
"2690648","1","3157700","","2010-04-22 12:18:13","0","121","<p>is there any way to intercept calendar task,meetings.Means track task and meeting on insert,edit and update.</p><p>Thanks.</p>","309990","","","","","2010-07-01 12:25:17","intercept Calendar task,meetings","<android><calendar>","2","0","","",""
"2690739","1","","","2010-04-22 12:31:33","2","70","<p>how powerfull is google android bluetooth programming?    </p><p>is it considered a low level programming langauge/emulator that enables me to have full control over bluetooth? ie protocols,encryption,layers....</p>","323234","","","","","2010-04-22 12:45:09","help with google android","<java><android>","1","1","","2012-08-14 10:58:54",""
"2690920","1","3110359","","2010-04-22 12:56:56","1","2128","<p>I’m currently working on a Android project and is very newbie to the Android platform. It’s an exercise I got from an article where I have to create a twitterlike application so that one Android platform can write to another and it automatically is updating. I’m using a Bluetooth emulator for Android to test. </p><p>But before I start with that I’ve facing some difficulties with the initiating a Bluetooth connection and have tried out several tutorials inclusive the official Android API / samples.</p><p>I got a class called “BlueTweetService” and within this I got three methods: <code>configureBluetoothServerSocket</code>, <code>connectToServerDevice</code> and <code>shutdownBluetoothServerSocket</code>.</p><p>In the first method, <code>configureBluetoothServerSocket</code>, I’ve to open a <code>BluetoothServerSocket</code> and using the properties String <code>BluetoothTweetName</code> and UUID <code>BlueTweetUuid</code>.</p><p>I’ve tried to create / open the serversocket but I gives me errors no matter what I do.</p><p>I would really appreciate if someone could help me with the code how to create / open that serversocket.</p><p>If I need to provide some information, please let me know and I’ll post them.</p><p>SincerelyMestika</p>","188082","","","","","2010-06-24 13:29:24","Android: Bluetooth connection, socket and thread","<android><bluetooth><uuid><serversocket>","1","0","2","",""
"2691026","1","","","2010-04-22 13:10:49","4","6352","<p>When writing :</p><pre><code> CountDownTimer timer = new CountDownTimer(1000, 100)  {      @Override       public void onTick(long l)        {       }       @Override       public void onFinish()        {       }; }.start();</code></pre><p>are we actually starting a new thread that handles ticks?  If not, what is really happening?</p>","304866","","403455","","2012-08-07 20:02:40","2012-11-13 21:00:09","Android CountDownTimer","<android><countdowntimer>","2","0","1","",""
"2691130","1","2691654","","2010-04-22 13:22:15","2","698","<p>I am using a ListView to display my custom item layout, which may contain some TextViews and an ImageView.</p><p>This is the item layout I made (post_item.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=""60dip""    android:padding=""5dip""    &gt;    &lt;TextView android:id=""@+id/listItem_title""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        android:layout_weight=""1""        /&gt;    &lt;FrameLayout android:id=""@+id/listItem_frameContent""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_below=""@id/userStream_listItem_title""        android:layout_weight=""1""        &gt;    &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I don't put the ImageView initially in the xml layout, but I will insert it when I need to the FrameLayout programmatically (I also put another views in it when needed). So, there will be some items which has ImageView in it and which don't.</p><p>I get the image to fill the ImageView from the Internet (through URL), decode it as Bitmap, and keep it as a Bitmap variable in a class represents the custom item layout (class PostItem).</p><p>When the activity shows for the first time it looks fine, but as I scrolled through the items then a problem showed up, the items which shouldn't show any image show the image from the other item which should, although they don't have any ImageView (because I didn't insert it). </p><p>I am using SDK 1.6 and the emulator. Haven't tried it in real device because I don't have it.</p><p>Here is my code for the Adapter:</p><pre><code>private class PostItemAdapter extends ArrayAdapter&lt;PostItem&gt; {        private List&lt;PostItem&gt; mPostItems;        public PostItemAdapter(Context context, int textViewResourceId, List&lt;PostItem&gt; postItems) {            super(context, textViewResourceId, postItems);            mPostItems = postItems;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View view = convertView;            if (view == null) {                LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);                view = layoutInflater.inflate(R.layout.post_item, null);            }            PostItem postItem = mPostItems.get(position);            if (postItem != null) {                final FrameLayout contentFrame = (FrameLayout) view.findViewById(R.id.listItem_frameContent);                final TextView titleTextView = (TextView) view.findViewById(R.id.listItem_title);                if (titleTextView != null) {                    titleTextView.setText(postItem.getTitle());                }                if (contentFrame != null) {                    if (postItem.hasImagePreview()) {                        final ImageView previewImageView = new ImageView(getApplicationContext());                        previewImageView.setId(LIST_ITEM_IMAGEVIEW_ID);                        previewImageView.setAdjustViewBounds(true);                        previewImageView.setMaxHeight(75);                        previewImageView.setMaxWidth(75);                        previewImageView.setImageBitmap(postItem.getImagePreview());                        final RelativeLayout.LayoutParams layoutParams =                             new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,                                     RelativeLayout.LayoutParams.WRAP_CONTENT);                        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);                        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);                        contentFrame.addView(previewImageView, layoutParams);                    }                    if (postItem.hasContent()) {                        final TextView contentTextView = new TextView(getApplicationContext());                        contentTextView.setText(postItem.getContent());                        final RelativeLayout.LayoutParams layoutParams =                             new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT,                                     RelativeLayout.LayoutParams.WRAP_CONTENT);                        layoutParams.addRule(RelativeLayout.BELOW, LIST_ITEM_IMAGEVIEW_ID);                        layoutParams.addRule(RelativeLayout.ALIGN_LEFT, LIST_ITEM_IMAGEVIEW_ID);                        layoutParams.alignWithParent = true;                        contentFrame.addView(contentTextView, layoutParams);                    }                }                           }            return view;        }    }</code></pre><p>And this is the code to prepare the items:</p><pre><code>/* inside a method to prepare the items */mPostItems = new ArrayList&lt;PostItem&gt;();for (int i=0; i&lt;total); i++) {    /* operation to generate titleToDisplay and contentToDisplay */    /* contentToDisplay might be null */    mPostItems.add(new PostItem(            titleToDisplay,            contentToDisplay,            generateImagePreview()));}/* another method */private Bitmap generateImagePreview(ActivityObject object) {        Bitmap imagePreview = null;        if (/*some condition*/) {                try {                    InputStream inStream = (InputStream) (new URL(""http://a1.typepad.com/6a010535617444970b0133ecc20b29970b-120si"")).getContent();                    imagePreview = Drawable.createFromStream(inStream, ""linkHref"");                }                catch (MalformedURLException ex) {                    Log.e(""INSIDE generateImagePreview()"", ex.getMessage());                }                catch (IOException ex) {                    Log.e(""INSIDE generateImagePreview()"", ex.getMessage());                }                catch (Exception ex) {                    Log.e(""INSIDE generateImagePreview()"", ex.getMessage());                }        }        return imagePreview;}</code></pre><p>Is this the bug in the emulator or there is some mistake in my code (probably memory problem for the Bitmap)? Please help me, I'm really stuck in this. Any help or advice will be very appreciated. Thanks in advance :)</p>","305864","","305864","","2010-04-23 11:34:57","2010-04-23 11:34:57","Cannot display image correctly using custom item layout in ListView","<java><android><listview>","1","0","0","",""
"2691204","1","","","2010-04-22 13:29:57","0","561","<p>I want to have a toast message to display ""Enter numeric characters only"" whenever the user presses a non-numeric key on the virtual keyboard. Any clue? </p>","2355649","","21234","","2010-04-22 13:35:02","2010-05-07 07:15:16","How to validate keys on the virtual keyboard on Android?","<android><validation>","3","1","","",""
"2691235","1","2691322","","2010-04-22 13:34:01","3","7680","<p>after a little bit of work my route application works fine :)The only thing I just want to add is a double tap zoom in function, but I don't know how...</p><p>could you give me a hint?</p><p>nice greetings,poeschlorn</p>","317301","","","","","2013-05-20 04:40:39","Double Tap -> Zoom on Android MapView?","<java><android><maps><zoom>","5","0","1","",""
"2691368","1","2691884","","2010-04-22 13:50:05","18","12941","<p>I've been reviewing the <a href=""http://d.android.com/guide/practices/screens_support.html"">Supporting Multiple Screens</a> documentation on the Android and I just need some additional clarification...</p><p>It's my understanding that designing three unique interfaces (ldpi, mdpi, and hdpi) would be the best way to go about supporting all the potential android screens with minimal scaling/distortion. </p><p>Yes, I know there are similar questions posted, however... If I create an image for the benchmark mdpi (let's say my image is 300x210, just for example) how to I determine what size I will need to recreate that image at ldpi &amp; hdpi? <a href=""http://stackoverflow.com/questions/1922697/not-understanding-how-to-use-different-density-images-for-1-6"">This post</a> as well as a google search leads me to believe that ldpi is just 75% of the mdpi image, and the hdpi is 150% of the mdpi image. Is this accurate?</p>","1580229","","1140748","","2012-05-06 16:51:21","2014-01-06 09:51:55","Determining image sizes for multiple android screen sizes/densities","<android><interface><resolution>","1","0","17","",""
"2691405","1","","","2010-04-22 13:56:08","2","232","<p>Does anybody knows how could one programmatically decompress an archive in android ?</p>","304866","","","","","2010-04-22 13:59:09","decompress an archive in android","<android>","1","0","","",""
"2691513","1","2692824","","2010-04-22 14:08:05","4","4542","<p>I am trying to fetch sms messages from inbox, sent items and drafts. I would like to do a pagination for my list view for that it's imperative that I fetch records in pages/chunks.</p><p>I am not familiar with sqlite which is the database I understand android use to store the data. Can someone tell me how can I restrict the number of records I am fetching by using contentResolver.query?</p><p>Also what is the way to pull the sqlite database file onto my machine and browse/query it locally to experiment or see data on my machine?</p><p><strong>Are there any other better ways to implement pagination in android??</strong></p><p>Thanks</p>","57847","","","","","2012-04-05 13:01:29","Limit Records fetched in Android (Sqlite database)","<sql><android><sqlite><pagination>","5","0","","",""
"2691570","1","2692301","","2010-04-22 14:13:34","7","22877","<p>I have an app that starts playing sounds and begins/resumes gameplay in the onResume() method, but what I'm noticing is that if my app was the last run application when I put the phone into standby (screen off), and I just press the Menu button to check the time, then the phone starts playing the game and sounds in the background (the app isn't actually visible, only the screen with the date/time is, yet onResume must have been called in my app). What am I to do here? Is there a way to discern what is reactivating the app, and then add a conditional statement that only starts the game when the app is actually visible?</p><p>Here is a snippet from my onResume:</p><pre><code>@Override    protected void onResume()    {        mySaveGame = Utilities.loadSavegame(this);        //check the savegame        if(mySaveGame!=null)        {            //start game using savegame values            this.startFromSavedGame(mySaveGame.getIsLevelComplete());           }        else        {            //run the 1st-run components            this.startFirstRun();        }        super.onResume();    }</code></pre><p>The only thing I can think of doing to prevent the game from starting whenever the screen gets turned on (even when the app isn't visible) is to put this.finish() as the last line in onPause()... but that forces you to restart the app every time you want to go back to it because the precess itself was killed (which is fine because my onPause saves persistent data, but it's not an elegant solution).</p><p>Please help.</p>","272302","","","","","2012-09-12 13:45:22","Android -- How to properly handle onPause/onResume methods?","<android><session-state><state>","2","0","5","",""
"2691772","1","2877795","","2010-04-22 14:40:13","48","35952","<p>I am using a PreferenceActivity to let the user set some values.I am feeding it the xml file with the defined preferences.</p><p>I have set all the <code>android:defaultValue=""""</code> for them.</p><p>When I start my application, I need the preferences, or if they are not set yet manually, I want the default values:</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);boolean value = prefs.getBoolean(""key""), false); </code></pre><p>However, when <code>android:defaultValue=""true""</code> I still get <code>false</code>. So, it looks like the defaultValues set in the XML are not used anywhere but when initializing the preferences-screen.</p><p>I don't want to hardcode the default values in the <code>getBoolean()</code> method. So, is there a way get the default-values with only defining these in 1 place?</p>","107029","","","","","2012-07-26 15:56:16","Android Preferences: How to load the default values when the user hasn't used the preferences-screen?","<android><default><preferences>","3","0","21","",""
"2692092","1","2692322","","2010-04-22 15:20:03","2","265","<p>I have a lot of time information in the format of hh:mm and I was wondering if there is a good way to take this information and compare it to the current time. Say I have a list of times for a day and I want to find out which time in this array of strings is the first that has not already passed in this day. </p><p>I was looking at the Calendar API and I figured I could break the strings up into hours and minutes by splitting it at the "":"" and then create a calendar object from that but that seems rather inefficient. </p><p>Just looking for some input; thanks,Rob </p><pre><code>&lt;string-array name=""example""&gt;    &lt;item&gt;6:58&lt;/item&gt;    &lt;item&gt;7:41&lt;/item&gt;    &lt;item&gt;8:08&lt;/item&gt;    &lt;item&gt;8:28&lt;/item&gt;    &lt;item&gt;8:48&lt;/item&gt;    &lt;item&gt;9:08&lt;/item&gt;    &lt;item&gt;9:43&lt;/item&gt;    &lt;item&gt;10:13&lt;/item&gt;    &lt;item&gt;10:43&lt;/item&gt;    &lt;item&gt;11:13&lt;/item&gt;    &lt;item&gt;11:43&lt;/item&gt;    &lt;item&gt;12:09&lt;/item&gt;    &lt;item&gt;12:29&lt;/item&gt;    &lt;item&gt;12:49&lt;/item&gt;    &lt;item&gt;1:09&lt;/item&gt;    &lt;item&gt;1:29&lt;/item&gt;    &lt;item&gt;1:49&lt;/item&gt;    &lt;item&gt;2:09&lt;/item&gt;    &lt;item&gt;2:29&lt;/item&gt;    &lt;item&gt;2:49&lt;/item&gt;    &lt;item&gt;3:09&lt;/item&gt;    &lt;item&gt;3:29&lt;/item&gt;    &lt;item&gt;3:49&lt;/item&gt;    &lt;item&gt;4:09&lt;/item&gt;    &lt;item&gt;4:29&lt;/item&gt;    &lt;item&gt;4:49&lt;/item&gt;    &lt;item&gt;5:09&lt;/item&gt;    &lt;item&gt;5:29&lt;/item&gt;    &lt;item&gt;5:49&lt;/item&gt;    &lt;item&gt;6:29&lt;/item&gt;    &lt;item&gt;7:09&lt;/item&gt;    &lt;item&gt;7:47&lt;/item&gt;    &lt;item&gt;8:27&lt;/item&gt;    &lt;item&gt;9:07&lt;/item&gt;    &lt;item&gt;9:47&lt;/item&gt;    &lt;item&gt;10:27&lt;/item&gt;&lt;/string-array&gt;</code></pre>","289153","","26428","","2010-07-24 17:56:27","2010-07-24 17:56:27","Using times on the Android platform","<android>","2","0","1","",""
"2692163","1","5757918","","2010-04-22 15:27:52","3","1233","<p>I was trying the TabLayout Tutorial from official developers site. I didnt copy paste it as such and some minor changes and corrections to typos in the tut.</p><pre><code>package com.org.example;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class HalloTabLayout extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent intent;     TabHost tabhost = getTabHost();     TabHost.TabSpec tabspec;     Resources res = getResources();        //For the Family Tab        //Intent        intent = new Intent().setClass(this, FamilyLayout.class);        //Setting the tab        tabspec = tabhost.newTabSpec(""family"").setIndicator(""Family"", res.getDrawable(R.drawable.tab_spec)).setContent(intent);        tabhost.addTab(tabspec);       //Default tab to display        tabhost.setCurrentTabByTag(""family"");    }</code></pre><p>}</p><p>As a first step and make sure the code is right, I wanted to have a Single tab displayed.</p><p>I added the FamilyLayout activity to AndroidManifest.xml file and also made changes suggested in here. <a href=""http://stackoverflow.com/questions/2209406/issues-with-android-tabhost-example"">http://stackoverflow.com/questions/2209406/issues-with-android-tabhost-example</a></p><p>But the application keeps crashing on run time in the emulator. Any help would be much appreciated. </p><p><strong>[Solution:]</strong> I used a .jpeg of high resolution and size(3.5mb) which was cause of trouble. I changed it into a lower resolution, size pic and it worked without troubles. I found out via trial and error that images beyond 1600*900 will make apps crash. Not an exact statistic, but it may help.</p>","323404","","156869","","2011-03-11 03:41:42","2011-04-22 17:05:10","Android: TabLayout not working","<android>","2","3","","",""
"2692306","1","2696944","","2010-04-22 15:46:14","6","6634","<p>So I have a huge maze of activities in my application. What I need to do, is that when the user logs in into the system, the activity history should be cleared. I cant just use finish() when I start a new activity, because I want the activities to have a history until the user logs in. I have experimentet with the different flags when starting an activity, but I have had no success. Any ideas?</p><p>Cheers,</p>","249871","","","","","2012-11-05 14:23:33","Start Activity and clear activity history","<android><activity>","2","0","4","",""
"2692587","1","2692915","","2010-04-22 16:18:38","2","10874","<p>If I want to enforce a maximum length of input in an EditText field, I can use the maxLength attribute.  But if I want to enforce a minimum length (in my case, simply non-blank), I find no corresponding minLength attribute.</p><p>I've also looked at the various 'inputType' attributes (phone, password, etc) but I don't see anything like 'required' or 'non-blank'.  </p><p>I can't believe this would require a custom input filter; it's more likely the answer is so obvious it just doesn't get written down in the form I'm asking the question.</p>","165164","","","","","2010-11-22 15:42:18","Android: need to validate an edittext for non-blank input","<android><edittext><maxlength><required-field><nonblank>","2","0","","",""
"2692814","1","2693032","","2010-04-22 16:53:10","18","6812","<p>I'm writing a client that is making repeated http requests for xml data that is changing over time.  It looks like the Android stack is caching my page requests and returning the same page repeatedly.  How do I make sure it gets a fresh page each time?</p><p>-- code ---</p><pre><code>HttpClient client = new DefaultHttpClient();HttpGet request = new HttpGet(url);HttpResponse response;    response = client.execute(request);InputStream in;in = response.getEntity().getContent();BufferedReader reader = new BufferedReader(new InputStreamReader(in));</code></pre><p>Thanks,Gerry</p>","321594","","228208","","2012-06-29 16:55:46","2012-06-29 16:55:46","HttpRequest without caching","<android><http><httprequest><no-cache>","2","0","7","",""
"2692943","1","","","2010-04-22 17:12:05","2","1061","<p>I need post the event in google calendar from my android app.I downloaded gdata-library v.2.1, but can't find any documentation for that.</p>","321532","","","","","2011-03-08 07:06:00","Android: post event in google calendar","<android><google-calendar>","3","0","","",""
"2692977","1","2694010","","2010-04-22 17:17:52","4","830","<p>I tend to believe that developing mobile applications in an enterprise environment is best suited by developing intranet web applications. That said I have been asked to think about whether there are specific <strong>enterprise</strong> applications that could only be accomplished or would be more successful as native applications. I am curious as to what the Stack Overflow community thinks.</p><p><em>Note</em>: As an organization we primarily use BlackBerry devices but are other platform curious.</p>","61654","","","","","2010-08-05 15:58:21","Enterprise Native Mobile Application Development","<iphone><android><blackberry><mobile>","5","1","4","2012-08-14 12:22:03","2010-04-22 17:17:52"
"2693102","1","2693328","","2010-04-22 17:38:06","2","88","<p>I want to build some libraries into executables that I need to use with my application. For example I need to build the C library slocate, so that I can use it in my application. Another example, I have to build sqlite-3.1 db to be usable with Python from ASE.</p><p>How can I go about achieving that?</p><p>Thanks a lot.</p>","320599","","","","","2010-04-22 18:17:39","Building stuff for android","<android>","1","0","","",""
"2693108","1","2693192","","2010-04-22 17:39:52","1","6221","<p>I have this problem, I have some audio I wish to play...</p><p>And I have two buttons for it, 'Play' and 'Stop'...</p><p>Problem is, after I press the stop button, and then press the Play button, nothing happens. -The stop button stops the song, but I want the Play button to play the song again (from the start) Here is my code:</p><pre><code>final MediaPlayer mp = MediaPlayer.create(this, R.raw.megadeth);</code></pre><p>And then the two public onclicks:</p><p>(For playing...)</p><pre><code> button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                // Perform action on click             button.setText(""Playing!"");             try {     mp.prepare();    } catch (IllegalStateException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }             mp.start();             //            }        });</code></pre><p>And for stopping the track...</p><pre><code>    final Button button2 = (Button) findViewById(R.id.cancel);    button2.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {         mp.stop();         mp.reset();        }    });</code></pre><p>Can anyone see the problem with this? If so could you please fix it... (For suggest)</p><p>Thanks alot...</p><p>James</p>","321763","","","","","2010-10-08 19:47:32","Stopping and Play button for Audio (Android)","<java><android><eclipse><button><media-player>","3","1","0","",""
"2693174","1","2693780","","2010-04-22 17:51:04","3","1727","<p>I am developing a library for Android applications which does not use native code (JNI). I have tried suppling the library as an external jar in my Android projects but this method does not include the library contents in the apk and thus throws class not found errors when run in the emulator or device. I have also tried creating the library as an Android project in itself and this does work, but only for public static properties (not methods). With the library and application both being in separate apk's I can see that the VM notices references to the library and can read some properties, but when an attempt to instantiate a class in the library is executed I get class not found even though I can read the public static properties from it (very frustrating!!). </p><p>I realize that Davlik byte code is not the same as Java byte code but I am having trouble even finding good information about how to solve what would seem to be a very simple issue in Android. I am looking into the old PlatformLibrary stuff right now but I am not convinced this will work either since the sample has been removed from the Android site :(</p><p>So help me out if you can, if I find the answer before this happens I will share it.</p><p>viva la Android!</p>","127938","","","","","2010-04-22 19:21:53","Android shared library which is not JNI based","<java><android>","1","1","2","",""
"2693482","1","2696313","","2010-04-22 18:39:47","8","1363","<p>Is it possible to use SpatiaLite database on Android platform (1.6)? I am trying to program a google buzz-like app which need to take advantage of SpatiaLite functions, like calculating distance between 2 points, etc. Any external library needed? Thanks.</p>","248430","","","","","2013-01-11 17:34:32","Does Android platform support SpatiaLite?","<android><sqlite><geospatial>","2","2","3","",""
"2693735","1","","","2010-04-22 19:15:57","1","309","<p>I'm having trouble porting a simple game I developed for the iPhone over to Android. The game has an animated ball which moves from Point A to Point B. The user must touch the ball before it reaches point B or lose the game. This was easy to implement on the iPhone using Core Animation since I could locate the current position of the ball by accessing its animation layer. In Android, I attempted to recreate the game using tweened animation and represented the ball as a Drawable. My issue is that I can't determine if the user is touching the spot because the Drawable apparently bounds do not update as the ball visually moves - making the program think the ball is always in its original position. While searching these forums I saw an Android team dev. confirm that you can't get the current location in a tweened animation but offered no solution for a workaround. Can I accomplish this on the Android using my current approach? If not, what approach should I use? Best regards,Michael</p>","323614","","","","","2010-09-12 11:44:12","Touching an object in a tweened animation?","<android><animation>","1","0","1","",""
"2693744","1","2693763","","2010-04-22 19:16:52","6","28780","<p>Does anyone know how to perform or have a good reference for doing an activity layout at runtime in android?</p><p>Here is the code for my activity. I'm sure I'm just neglecting to do something here:</p><pre><code>package com.isi.sa;import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.TextView;public class SimpleAssessmentTest extends Activity {  LinearLayout layout;  TextView question;  @Override  public void onCreate(Bundle icicle) {    super.onCreate(icicle);    layout = new LinearLayout(this);    question = new TextView(this);    layout.setLayoutParams(new ViewGroup.LayoutParams(-1,-1));    layout.setBackgroundColor(R.color.blue);    question.setLayoutParams(new ViewGroup.LayoutParams(-1,-2));    question.setTextColor(R.color.green);    question.setTextSize(1,14);    question.setText(""This is question1"");    layout.addView(question);    setContentView(layout);  }}</code></pre><p>As you can see I'm just trying to add a linear layout with a single text view (just for testing purposes) however, when the activity starts I just get a black screen with a title bar of my app name.</p><p>Thanks</p>","198116","","198116","","2010-04-23 11:48:44","2011-02-11 22:48:03","Android Runtime Layout Tutorial","<android><runtime><android-layout>","4","0","8","",""
"2693752","1","2694385","","2010-04-22 19:18:15","1","612","<p>I'm on the android bandwagon and started going through google's ""view"" tutorials. Here is what I'm using:Eclipse GalileoAndroid SDK 2.1Java SDK 6.Something I think.</p><p>Everything was hunky-dory until I hit the grid view tutorial. I got errors all over the place when I started editing the ""HelloGridview.java"" File. I thought I'd fix it by following through with the next part of the tutorial, creating the ImageAdapter class, but it created more. I realized alot of my issues could be resolved by importing widgets which were not mentioned in the tutorial (i.e. android.widget.GridView, .ImageView, .BaseAdapter etc.) However, after all the reconciliation suggested by eclipse the files were finally showing no errors. I go to run it as an android app and bam, ""Your project contains error(s)."" window comes up. There are no errors showing on the files I've created. I cleared the error log and shut down eclipse and started again the error log now reads: Conversion to Dalvik format failed with error 1. I'm a little lost at this point. I think I've included the required information. If you need to know more let me know.</p><p>Any help is appreciated.</p>","317705","","","","","2011-11-26 23:58:57","Conversion to Dalvik format failed error for Android Grid View","<java><android><eclipse><android-sdk-2.1>","2","0","","",""
"2693914","1","","","2010-04-22 19:41:46","4","5626","<p>Is the source available for the default Android Keyboard?</p>","291323","","648313","","2011-07-13 20:59:51","2013-06-27 07:00:41","Android Keyboard Source","<android><android-source>","3","0","","",""
"2694259","1","2751269","","2010-04-22 20:32:47","2","9896","<p>I've just set up my first Android development environment consisting of </p><ul><li>Eclipse 3.5</li><li>Mac OSX 10.5</li><li>Android SDK for x86 macs</li><li>ADT Eclipse plugin 0.9.6</li></ul><p>I've set set $PATH to my SDK/tools directory (which shouldn't matter if I only use Eclipse right?) and started Eclipse, but when I try to set the path to the SDK in Eclipse, i get the error ""parseSdkContent failed"". The stack trace of from the thrown exception is</p><pre><code>java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchemaat javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:181)at com.android.ide.eclipse.adt.internal.sdk.LayoutDevicesXsd.getValidator(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.parseLayoutDevices(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultLayoutDevices(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultAndUserDevices(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.Sdk.&lt;init&gt;(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadSdk(Unknown Source)at com.android.ide.eclipse.adt.AdtPlugin$13.run(Unknown Source)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre><p>I can't see that I've missed anything in the setup process, according to the instructions it should basically just work out of the box. Any ideas as to why this might fail? </p>","64579","","","","","2014-03-28 08:18:30","Android ADT Eclipse plugin, parseSDKContent failed","<android><eclipse><adt>","4","0","1","",""
"2694392","1","","","2010-04-22 20:53:00","12","21911","<p>I have a standard Java project in which I've written code to parse some BBC Radio XML data from the internet. The project is called BBCSchedules and the class I'm interested in is called BBCChannel.</p><p>I'm now trying to use the BBCChannel class in an Android application. How should I go about doing this?</p><p>I've tried various things, following various bits of advice on the internet, and the place I've got to at the moment is compiling my BBCSchedules project to a .jar file, and importing that to the Android project using the Build Path/Library/Add External Jar option. However, Eclipse still doesn't recognise the BBCChannel class, and won't let me run the application because of this.</p><p>I guess I've done something silly wrong, but what is it?</p><p>UPDATE: I've tried the steps listed in <a href=""http://stackoverflow.com/questions/1334802/how-can-I-use-external-jars-in-an-Android-project"">How can I use external JARs in an Android project?</a> and various other StackOverflow questions I can find that seem to be related to this, but absolutely nothing seems to work. Any other ideas?</p><p>UPDATE: The discussions I've had with the author of the first answer below suggest that it is something to do with how I am using Eclipse to attach the .jar file. The project he sent me with the .jar file already attached didn't work. Any other ideas anyone?</p>","1912","","815724","","2013-03-09 23:50:22","2013-03-11 01:47:55","Importing external .jar file to Android project","<java><android><jar>","3","2","3","2013-03-13 03:23:17",""
"2694500","1","","","2010-04-22 21:06:18","2","2997","<p>My problem is that I want to send an SMS message of a certain Class and with a certain encoding. (Class 0 and 7-bit encoding).</p><p>When checking the Android.Telephony.SmsManager and SmsMessage there is not so much you can do. The SmsManager offers the two functionsSendTextMessage and SendDataMessage. The first one works fine if you simply wants to send a normal SMS to somebody. So I guess that the SendDataMessage is the function that I somehow needs to use. However I can not figure out how to use it. And there seems to be no examples on the web (that I can find) of anyone using this function.</p><p>Does anyone know anything that would help me? :-)Either how to send a Class0 7-bit encoded sms, or how to use the SendDataMessage function properly.</p>","","Thomas Hermansson","1069068","","2013-03-19 14:47:21","2013-03-19 14:47:21","Encoding SMS messages in Android","<android><character-encoding><sms><pdu>","1","1","7","",""
"2694562","1","","","2010-04-22 21:15:15","1","903","<p>I'm doing bluetooth development for connecting with a PC. I've basicly used the BTChatExample and changed the UUID to the standard PC SPP-profile.</p><ol><li><p>Trying to close a bluetooth application during a blocking read, by closing the BluetoothSocket will leave the Bluetooth stack in a unusable state. This can only be fixed by disabling and enabling bluetooth and restarting the application. Checking logcat, you can see that some of the internal methods are failing, leaving a open port. Any information on this?</p></li><li><p>First of all there seams to be differences on how bluetooth is implemented on N1 and HTC Legend/Desire both running 2.1, do you know anything about this?</p></li><li><p>Connecting isn't 100% reliable, sometimes I get a warning saying <code>~PortSystemContext init: FAILED</code>. This leaves bluetooth unusable, and restarting is needed.</p></li><li><p>Am I right in assuming that SPP is the only profile supported for use with the APIs? That's what the docs on the BluetoothAdapter says.</p></li></ol><p>I would love to discuss issues on bluetooth with a developer and iron out these bugs so that Android can have good proper Bluetooth support it deserves.</p>","323707","","844882","","2012-03-17 20:27:48","2012-03-17 20:27:48","Bluetooth on 2.0+","<android>","3","0","2","",""
"2694663","1","","","2010-04-22 21:31:07","10","3008","<p>In my application I create dynamic rows in table much as in this tutorial:<a href=""http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout"">http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout</a></p><pre><code> for(int i = startDay; i &lt; startDay + 7; i++){      /* Create a TextView to be the row-content. */      TextView day = new TextView(this);      day.setText(Integer.toString(i));      day.setLayoutParams(new LayoutParams(                LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));      day.setOnClickListener(new OnClickListener() {          @Override          public void onClick(View v) {              Log.i(""Listener: "", ""Click"");          }</code></pre><p>So now when I click on a TextView I can register click event, but how do I determine which TextView was clicked?</p><p>Not just an object which I get with an event but data like which day number was clicked?</p><p>Ideally I would want to have data attached to every view I create dynamically.Something like data() method in Javascript jQuery. </p><p>Right now I can see only 1 way to solve this - while creating TextView add id with data and when clicked - get id back and parse it to get my data. But it strikes me as ugly approach.</p><p>Is there a way to attach arbitrary data to android views?</p>","219449","","","","","2010-04-22 21:39:56","Android - attach data to views","<android><android-widget>","1","0","2","",""
"2694731","1","","","2010-04-22 21:41:48","0","1347","<p>I have a query result set which I like to edit first and then put it to my ListView. Without editing my data first, I could use SimpleCursorAdapter like that:</p><pre><code>ListAdapter adapter = new SimpleCursorAdapter(    this,     R.layout.list_item,     mCursor,     new String[] { ""address"", ""city"" },     new int[] { R.id.address, R.id.zip_city });this.setListAdapter(adapter);</code></pre><p>But now, I put everything in a multidimensional array like that:</p><pre><code>if(mCursor.isFirst()) {        //create a new array        String[][] listData = new String[mCursor.getCount()][3];        int i = 0;        do {            listData[i] = new String[] {                mCursor.getString(mCursor.getColumnIndex(""address"")),                mCursor.getString(mCursor.getColumnIndex(""zip"")) + "" "" + mCursor.getString(mCursor.getColumnIndex(""city"")),                calculateDistance(Double.parseDouble(mCursor.getString(mCursor.getColumnIndex(""diff""))))                };            i++;        } while(mCursor.moveToNext());    }</code></pre><p>So my problem is now, I have no idea how to put this to my ListView. Could someone help me here? Sorry for my bad english and Java knowledge. :)</p>","323726","","","","","2014-04-17 16:22:32","Multidimensional array to ListView.. how?","<java><android><listview><multidimensional-array>","2","0","1","",""
"2694797","1","2695160","","2010-04-22 21:53:14","6","4648","<p>I have seen several questions regarding SocketException when using Android, but none of them cover the BindException that I get even with the INTERNET permission specified in my manifest.</p><p>Here is part of my manifest:<code>     </p><pre><code>&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;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_OWNER_DATA""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCOUNT_MANAGER""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.AUTHENTICATE_ACCOUNTS""&gt;&lt;/uses-permission&gt;</code></pre><p></code></p><p>Here is the relevant portion of my LogCat output:</p><pre>04-22 14:49:06.117: DEBUG/MyLibrary(4844): Address to bind: 192.168.1.14 port: 84304-22 14:49:06.197: WARN/System.err(4844): java.net.BindException: Permission denied (maybe missing INTERNET permission)04-22 14:49:06.207: WARN/System.err(4844):     at org.apache.harmony.luni.platform.OSNetworkSystem.socketBindImpl(Native Method)04-22 14:49:06.207: WARN/System.err(4844):     at org.apache.harmony.luni.platform.OSNetworkSystem.bind(OSNetworkSystem.java:107)04-22 14:49:06.217: WARN/System.err(4844):     at org.apache.harmony.luni.net.PlainSocketImpl.bind(PlainSocketImpl.java:184)04-22 14:49:06.217: WARN/System.err(4844):     at java.net.ServerSocket.bind(ServerSocket.java:414)04-22 14:49:06.227: WARN/System.err(4844):     at org.apache.harmony.nio.internal.ServerSocketChannelImpl$ServerSocketAdapter.bind(ServerSocketChannelImpl.java:213)04-22 14:49:06.227: WARN/System.err(4844):     at java.net.ServerSocket.bind(ServerSocket.java:367)04-22 14:49:06.237: WARN/System.err(4844):     at org.apache.harmony.nio.internal.ServerSocketChannelImpl$ServerSocketAdapter.bind(ServerSocketChannelImpl.java:283)04-22 14:49:06.237: WARN/System.err(4844):     at mylibrary.net.PolicyConnection$PolicyServerWorker.(PolicyConnection.java:201)</pre><p>I Really hope this is a simple problem and not something complicated by the fact that the binding is occurring within a worker thread on a port less than 1024.</p><p><b>Update</b></p><p>Looks as if this is a privileged port issue, anyone know how to bind to ports lower than 1024 in Android? </p><pre><code>    SelectorProvider provider = SelectorProvider.provider();    try {        ServerSocketChannel channel = provider.openServerSocketChannel();        policySocket = channel.socket();        Log.d(""MyLibrary"", ""Address to bind: "" + device.getAddress().getAddress() + "" port: 843"");                      InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(device.getAddress().getAddress()), 843);        policySocket.bind(addr);        policySocket.setReuseAddress(true);        policySocket.setReceiveBufferSize(256);    } catch (Exception e) {        e.printStackTrace();    }</code></pre>","127938","","127938","","2010-04-22 22:10:59","2011-11-16 21:42:40","BindException with INTERNET permission requested","<java><android><sockets><bind>","2","0","2","",""
"2694816","1","","","2010-04-22 21:56:14","5","203","<p>I'd like a Javascript library that will stretch/scale <a href=""http://developer.android.com/guide/topics/resources/available-resources.html#ninepatch"" rel=""nofollow"">9-patch</a> images correctly. Know of one?</p>","76835","","","","","2010-04-22 23:13:37","Is there a tool to allow the use of Android's 9-patches in Javascript?","<javascript><android><nine-patch>","1","0","0","",""
"2694818","1","","","2010-04-22 21:56:25","2","496","<p>I'm newbie in Android (and programming) and I would like to connect an USB Phidgets accelerometer (<a href=""http://www.phidgets.com/products.php?category=5&amp;product_id=1059"" rel=""nofollow"">product description</a>) using Android OS. On his website, Phidgets gives code samples including JAVA and others (see previous hyperlink). Could someone tell me if these samples are supposed to work with Anrdoid OS ? Any other suggestions to achieve this goal kepping Anroid and using other acelerometer and/or programming language ?</p>","323737","","","","","2010-04-22 21:56:25","Connection of phidgets accelerometer using Android OS","<java><android><usb><sensor>","0","1","","",""
"2694909","1","","","2010-04-22 22:14:03","4","6211","<p>The playlist names can be found by a query on <code>MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI</code>and then look at the <code>MediaStore.Audio.PlaylistsColumns.NAME</code> column.There is a data column too, MediaStore.Audio.PlaylistsColumns._DATA, but it is returning null.</p><p>The list of songs (<code>MediaStore.Audio.Media.EXTERNAL_CONTENT_URI/id</code>) do not seem to show any playlist affiliation. </p>","323749","","464552","","2012-12-21 10:23:38","2013-11-29 20:47:13","Given an Android music playlist name, how can one find the songs in the playlist?","<android><media><playlists>","1","0","1","",""
"2694924","1","2695090","","2010-04-22 22:16:35","3","146","<p>In my chat app, I am adding the ability to log chats. The logs are saved on the sdcard and one <code>BufferedWriter</code> is kept open for every person/channel chat is done with. I'm wondering what effects this might have have on the sdcard and its life.</p><p>My <code>BufferedWriter</code>'s buffer size is to 1024, I'm also wondering if that is too small or too big.</p>","240251","","","","","2010-04-22 22:55:31","Effect of frequent sdcard writes","<android><bufferedwriter><android-sdcard>","1","1","1","",""
"2694947","1","2696922","","2010-04-22 22:23:06","2","4943","<p>I am trying to receive data from new Activity to old Activity.</p><p>In other words, newer Activity must send intend data to old activity when it finishes.</p><p>I've use <code>setResult(resultcode, NewActivity.this.getIntend);</code> on newer activity and </p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    if(data != null) {        // doing something    }     }</code></pre><p>on old activity. Receives intend data from newer activity.</p><p>But this code doesn't work. Always getting data is null. </p><p>How to send intent data from finishing Activity to parent activity ?</p><p>Also when create new Activity, I am using following code: </p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK);intent.setClass(OldActivty.this, NewActivity.class);startActivityForResult(intent, 0);</code></pre><p>I don't understand why always getting null intent data from newer one.</p><p>how to fix it ?</p><p>Please advice. </p><p>Thanks,</p>","164589","","","","","2010-04-23 07:35:37","Passing data from New activity to old activity?","<android><activity>","1","1","1","",""
"2694978","1","2697334","","2010-04-22 22:28:42","4","7652","<p>When I run this could and click on the dialog box my radiobuttons do not become selected like intended</p><pre><code>    package edu.elon.cs.mobile;public class PTCalculator extends Activity{    private RadioButton maleRadioButton;    private RadioButton femaleRadioButton;    private EditText ageEdit;    private EditText pushUpsEdit;    private EditText sitUpsEdit;    private EditText mileMinEdit;    private EditText mileSecEdit;    private Button calculate;    private TextView score;    protected AlertDialog genderAlert;    private int currScore;    private int age;    private int sitUps;    private int runTime;    private int pushUps;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.pt);        maleRadioButton = (RadioButton) findViewById(R.id.male);        femaleRadioButton = (RadioButton) findViewById(R.id.female);        ageEdit = (EditText) findViewById(R.id.ageEdit);        pushUpsEdit = (EditText) findViewById(R.id.pushupEdit);        sitUpsEdit = (EditText) findViewById(R.id.situpEdit);        mileMinEdit = (EditText) findViewById(R.id.minEdit);        mileSecEdit = (EditText) findViewById(R.id.secEdit);        calculate = (Button) findViewById(R.id.calculateButton);        calculate.setOnClickListener(calculateButtonListener);        score = (TextView) findViewById(R.id.scoreView);        genderAlert = makeGenderDialog().create();    }    private OnClickListener calculateButtonListener = new OnClickListener() {        @Override        public void onClick(View arg0) {            age = (Integer.parseInt(ageEdit.getText().toString()));            pushUps = (Integer.parseInt(pushUpsEdit.getText().toString()));            sitUps = (Integer.parseInt(sitUpsEdit.getText().toString()));            int min = (Integer.parseInt(mileMinEdit.getText().toString())*60);            int sec = (Integer.parseInt(mileSecEdit.getText().toString()));            runTime = min + sec;            if(maleRadioButton.isChecked()){                MalePTTest mPTTest = new MalePTTest(age, pushUps, sitUps, runTime);                currScore = mPTTest.malePTScore();                score.setText((Integer.toString(currScore)));            }else if(femaleRadioButton.isChecked()){                 FemalePTTest fPTTest = new FemalePTTest(age, pushUps, sitUps, runTime);                currScore = fPTTest.femalePTScore();                score.setText((Integer.toString(currScore)));            }else                genderAlert.show();        }    };    public AlertDialog.Builder makeGenderDialog(){        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(""Select a Gender"")        .setCancelable(false)        .setPositiveButton(""Female"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                femaleRadioButton.setSelected(true);                FemalePTTest fPTTest = new FemalePTTest(age, pushUps, sitUps, runTime);                currScore = fPTTest.femalePTScore();                score.setText((Integer.toString(currScore)));            }        })        .setNegativeButton(""Male"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                maleRadioButton.setSelected(true);                MalePTTest mPTTest = new MalePTTest(age, pushUps, sitUps, runTime);                currScore = mPTTest.malePTScore();                score.setText((Integer.toString(currScore)));            }        });        return builder;    }}</code></pre><p>Any suggestions?</p>","180825","","180825","","2010-04-22 22:58:38","2010-04-23 09:01:59","Make my radio buttons become selected in Android","<java><android><radio-button>","1","0","","",""
"2695109","1","2695123","","2010-04-22 22:59:29","0","1123","<p>I have the following question:</p><p>I start my activity and i call bindService in order to start a service which in background downloads data from an API.When it finish, it calls stopSelf().</p><p>But if i want to call again bindService in my Activity in order to download other data, nothing happens.</p><p>Any idea?</p>","258863","","","","","2010-04-22 23:02:32","Android Restart a Service","<android><service>","1","0","","",""
"2695386","1","","","2010-04-23 00:08:43","5","2193","<p>Are there any USB functions for Android devices (all user devices, not rooted)?<br />I'm curious because I might want to make an app that puts things through USB</p>","323801","","","","","2012-09-11 21:20:24","Android USB Functions?","<android><usb>","3","1","2","",""
"2695505","1","2698599","","2010-04-23 00:50:11","0","592","<p>This is my first post! I hope you can help me out! :-)</p><p>I used the code provided by the NotePadExample from the developers doc to create a database. Now I want to add a second table to store different data. I can add notes without a problem, and the notes table is created in a similar way as my routes table is. I simply ""copied"" and edited the given code, but when I try to insert into the new table I get an error saying:</p><p>""0ERROR/Database(370): android.database.sqlite.SQLiteException: no such table: routes: , while compiling: INSERT INTO routes(line, arrival, duration, start) VALUES(?, ?, ?, ?);""</p><p>Can someone please take quick look at my DbAdapter class, especially the onCreate() method.  and give me a hint or a solution? I really don't see any problem. my code compiles without any errors.. </p><p>thanks in advance!</p><h2>CODE:</h2><pre><code>public class DbAdapter {public static final String KEY_FROM  = ""title"";public static final String KEY_TO    = ""body"";public static final String KEY_ROWID = ""_id"";public static final String KEY_START    = ""start"";public static final String KEY_ARRIVAL  = ""arrival"";public static final String KEY_LINE     = ""line"";public static final String KEY_DURATION = ""duration"";private static final String DATABASE_NAME           = ""data"";private static final String DATABASE_NOTESTABLE     = ""notes"";private static final String DATABASE_ROUTESTABLE    = ""routes"";private static final String TAG = ""DbAdapter"";private DatabaseHelper mDbHelper;private SQLiteDatabase mDb;/** * Database creation sql statement */private static final String DATABASE_CREATE_NOTES =        ""create table notes (_id integer primary key autoincrement, ""                + ""title text not null, body text not null)"";private static final String DATABASE_CREATE_ROUTES =    ""create table routes (_id integer primary key autoincrement, ""            + ""start , arrival , ""             + ""line , duration );"";private static final int DATABASE_VERSION = 3;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_NOTES);        Log.d(TAG, ""created notes table"");        db.execSQL(DATABASE_CREATE_ROUTES);        Log.d(TAG, ""created routes table"");    }    @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"");        db.execSQL(""DROP TABLE IF EXISTS routes"");        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 createNote(String title, String body) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_FROM, title);    initialValues.put(KEY_TO, body);    return mDb.insert(DATABASE_NOTESTABLE, null, initialValues);}/** * Create a new route using the title and body provided. If the route is * successfully created return the new rowId for that route, otherwise return * a -1 to indicate failure. *  * @param start the start time of the route * @param arrival the arrival time of the route * @param line the line number of the route * @param duration the routes duration  * @return rowId or -1 if failed */public long createRoute(String start, String arrival, String line, String duration){    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_START, start);    initialValues.put(KEY_ARRIVAL, arrival);    initialValues.put(KEY_LINE, line);    initialValues.put(KEY_DURATION, duration);    return mDb.insert(DATABASE_ROUTESTABLE, null, initialValues);}/** * Delete the note with the given rowId *  * @param rowId id of note to delete * @return true if deleted, false otherwise */public boolean deleteNote(long rowId) {    return mDb.delete(DATABASE_NOTESTABLE, 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 fetchAllNotes() {    return mDb.query(DATABASE_NOTESTABLE, new String[] {KEY_ROWID, KEY_FROM,            KEY_TO}, null, null, null, null, null);}/** * Return a Cursor over the list of all routes in the database *  * @return Cursor over all routes */public Cursor fetchAllRoutes() {    return mDb.query(DATABASE_ROUTESTABLE, new String[] {KEY_ROWID, KEY_START,            KEY_ARRIVAL, KEY_LINE, KEY_DURATION}, 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 fetchNote(long rowId) throws SQLException {    Cursor mCursor =            mDb.query(true, DATABASE_NOTESTABLE, new String[] {KEY_ROWID,                    KEY_FROM, KEY_TO}, KEY_ROWID + ""="" + rowId, null,                    null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}/** * Return a Cursor positioned at the route that matches the given rowId *  * @param rowId id of route to retrieve * @return Cursor positioned to matching route * @throws SQLException if note could not be found/retrieved */public Cursor fetchRoute(long rowId) throws SQLException {    Cursor mCursor =            mDb.query(true, DATABASE_ROUTESTABLE, new String[] {KEY_ROWID,                    KEY_START, KEY_ARRIVAL, KEY_LINE, KEY_DURATION}, 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 updateNote(long rowId, String title, String body) {    ContentValues args = new ContentValues();    args.put(KEY_FROM, title);    args.put(KEY_TO, body);    return mDb.update(DATABASE_NOTESTABLE, args, KEY_ROWID + ""="" + rowId, null) &gt; 0;}public void deleteRoutesTable(SQLiteDatabase db){    db.delete(""routes"", null, null);}</code></pre><p>}</p><h2>ADD</h2><p>I want to implement a method like </p><pre><code>public void deleteTableRoutes(SQLiteDataBase db){ db.delete(""routes"", null, null);}</code></pre><p>my problem: I want to call this function from a point where I have no reference to my db (as far as I know) to pass as an argument for my deleteTableRoutes(SQLiteDataBase) ...</p>","323814","","323814","","2010-04-23 12:19:06","2010-04-23 12:51:29","Adding a second table in a database","<java><database><android><table><add>","2","1","0","",""
"2695537","1","2695546","","2010-04-23 01:01:50","12","5728","<p>In reviewing: <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"">http://developer.android.com/reference/android/graphics/Canvas.html</a></p><p>I'm wondering</p><p>translate(): ""preconcat the current matrix with the specified translation"" -- what does this mean?</p><p>I can't find a good definition of ""preconcat"" anywhere on the internet! The only place I can find it is in the Android Source - I'm starting to wonder if they made it up? :) </p><p>I'm familiar with ""concat"" or concatenate, which is to append to, so what is a pre-concat?</p>","268803","","268803","","2010-04-27 16:09:25","2012-05-31 04:38:27","What does it mean to ""preconcat"" a matrix in Android?","<android><view><canvas>","1","0","3","",""
"2695600","1","2695632","","2010-04-23 01:20:10","1","1242","<p>I want to write an app that a parent can use to disable phone functionality to prevent their child from using it.  One way the child could circumvent this is by uninstalling the app. </p><p>Is there a way to prevent application uninstall on the Android?</p>","7399","","","","","2010-04-23 01:31:23","Is it possible to prevent an app from being uninstalled?","<android>","1","1","","",""
"2695629","1","","","2010-04-23 01:30:35","0","86","<p>Sorry I'm new to Android handsets.  When you do a startActivity(intent) does it involve hitting Googles cloud services at all to resolve the [handler] or is this purely a local call?</p>","318920","","","","","2010-04-23 01:32:27","Does Android's Intent use Googles cloud at all?","<android>","1","0","","",""
"2695646","1","2695649","","2010-04-23 01:36:27","255","89926","<p>How do I declare an Android UI element using XML?</p>","165495","","","","","2014-02-27 19:26:53","Declaring a custom android UI element using XML","<xml><android><user-interface>","6","1","211","",""
"2695746","1","2696617","","2010-04-23 02:07:57","105","113033","<p>I asked a similar question to this earlier this week but I'm still not understanding how to get a list of all installed applications and then pick one to run. </p><p>I've tried: </p><pre><code>Intent intent = new Intent(ACTION_MAIN);intent.addCategory(CATEGORY_LAUNCHER);</code></pre><p>and this only shows application that are preinstalled or can run the ACTION_MAIN Intent type.</p><p>I also know I can use PackageManager to get all the installed applications, but how do I use this to run a specific application?</p><p>Thanks </p>","306410","","","","","2013-12-27 21:22:35","How to get a list of installed android applications and pick one to run","<android>","11","1","109","",""
"2696022","1","","","2010-04-23 03:25:29","2","1652","<p>I'm trying to map my movements with a android device into an OpenGL scene.</p><p>I've recorded accelerometer values for a simples movement: Moving the phone (lies flat on a table) 10cm forward (+x), and then 10cm backward (-x).</p><p>The problem is that this values when used to calculate velocity and position, makes only the opengl cube go forward. Seems like the negative acceleration recorded was not enough to reduce the speed and invert its movement.</p><p>What can be the problem?</p><p>This is my function that updates the velocity and position every time new data comes in:</p><pre><code>void updatePosition(double T2) {    double T = 0.005;    Vec3 old_pos = position.clone(), old_vel = velocity.clone();    velocity = old_vel.plus(acceleration.times(T));    position = old_pos.plus(old_vel.times(T).plus(acceleration.times(0.5 * Math.pow(T, 2))));}</code></pre><p>This is the X,Y,Z accelerometer values over the entire captured time:</p><p><img src=""http://img25.imageshack.us/img25/7528/forces.jpg"" alt=""alt text""></p>","2731698","","","","","2010-04-23 08:33:34","Accelerometer Values from Android/iPhone device","<java><iphone><android><accelerometer>","1","0","1","",""
"2696062","1","","","2010-04-23 03:39:30","0","825","<p>I have the following structure defined in an xml layout file.</p><pre><code>&lt;RelativeLayout android:id=""@+id/mainLayout""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;FrameLayout android:id=""@+id/frame"" android:layout_centerInParent=""true"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/FrameLayout&gt;&lt;Button android:id=""@+id/button"" android:layout_below=""@id/frame"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The FrameLayout is positioned correctly in the center of its parent.  But the Button isn't getting positioned under it.  Instead it's displaying in the top left corner.</p><p>Am I doing something incorrectly or is this a bug with RelativeLayout?</p>","233202","","","","","2010-04-23 06:23:58","RelativeLayout - positioning a View under a ViewGroup","<android>","1","0","","",""
"2696116","1","","","2010-04-23 03:59:33","1","377","<p>I had a pagination related question posted earlier. <a href=""http://stackoverflow.com/questions/2691513/limit-records-fetched-in-android-sqlite-database"">Here</a>I went through the posted answers and suggested choices and I realized that to implement pagination in an application I could still write db level queries and ensure that I could implement pagination, even if in a crude form. However I have few follow up questions now:</p><ul><li>I am trying to show SMS from a content provider. Suppose I don't want to use content provider; can I access SMS table in database through my application. Aoes android's security framework allow that?</li><li>How do people generally handle pagination problems in android, related to content that they are not storing but instead are fetching through content providers. (Android's own or custom)</li></ul><p>Isn't this a bigger problem. I am surprised to find so little text online about it. </p>","57847","","","","","2010-04-23 03:59:33","Pagination For SMS in Android specifically","<android><design><pagination><sms><android-contentprovider>","0","0","","",""
"2696154","1","2698088","","2010-04-23 04:12:25","0","2091","<p>I have a simple application with a view and a class that should return a ListView. The application works unless I refactor, and I am refactoring not just renaming, the name of the class. Everything seems to get changed properly but the application throws an exception of :android.view.InflateException: Binary XML file line #2: Error inflating class</p><p>If I refactor back to the original name all is well. What is not being renamed that I am missing?</p><p>The code is</p><pre><code>package com.mynamespace.more.views;import com.mynamespace.more.QTEvent;import android.content.Context;import android.util.AttributeSet;import android.widget.CheckedTextView;import android.widget.LinearLayout;public class MyListItem extends LinearLayout {    private QTEvent qtEvent;    private CheckedTextView checkbox;    public MyListItem(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected void onFinishInflate() {        super.onFinishInflate();        checkbox = (CheckedTextView)findViewById(android.R.id.text1);    }    public void setQTEvent(QTEvent q) {        this.qtEvent = q;        checkbox.setText(q.getName());        checkbox.setChecked(q.isComplete());    }    public QTEvent getEvent() {        return qtEvent;    }}</code></pre>","312443","","25818","","2011-03-24 01:59:43","2011-03-24 01:59:43","Android InflateException on refactor of class","<android><view><inflate>","1","0","","",""
"2696190","1","2701368","","2010-04-23 04:23:19","1","13355","<p>How to connect android to server(PC) and pass values to it</p>","278521","","","","","2010-04-23 19:20:45","How to connect android to server","<android>","2","1","2","",""
"2696296","1","","","2010-04-23 04:53:18","4","9463","<p>i am trying to get a simple image animation going. i want to make it looks as if the helicopter's propeller blades are turning.  i have 3 images for the helicopter, and i am showing one of these images depending on the animation progress. the problem is that all three images end up overlapping each other as opposed to just one image showing up at one time, thereby creating the animation.  this is what i did so far, i even tried to clear canvas by doing this canvas.drawColor(Color.BLACK), but that would clear out the whole canvas, which is not what i want. </p><p>this is what i have:</p><p>1) in the View class:</p><p>static class Helicopter {        private long mLastUpdate;        private long mProgress = 0;        private final float mX;        private final float mY;</p><pre><code>    private final Bitmap mHelicopter1;    private final Bitmap mHelicopter2;    private final Bitmap mHelicopter3;    private final float mRadius;    Helicopter(long mLastUpdate, float mX, float mY,              Bitmap helicopter1, Bitmap helicopter2, Bitmap helicopter3) {        this.mLastUpdate = mLastUpdate;        this.mX = mX;        this.mY = mY;        this.mHelicopter1 = helicopter1;        this.mHelicopter2 = helicopter2;        this.mHelicopter3 = helicopter3;        mRadius = ((float) mHelicopter1.getWidth()) / 2f;    }    public void update(long now) {        mProgress += (now - mLastUpdate);        if(mProgress &gt;= 400L)        {         mProgress = 0;        }        mLastUpdate = now;    }    public void setNow(long now) {        mLastUpdate = now;    }    public void draw(Canvas canvas, Paint paint)     {               if (mProgress &lt; 150L)         {            canvas.drawBitmap(mHelicopter1, mX - mRadius, mY - mRadius, paint);        }         else if (mProgress &lt; 300L)         {            canvas.drawBitmap(mHelicopter2, mX - mRadius, mY - mRadius, paint);        }         else if(mProgress &lt; 400L)        {         canvas.drawBitmap(mHelicopter3, mX - mRadius, mY - mRadius, paint);        }    }    public boolean done() {        return mProgress &gt; 700L;    }}private ArrayList&lt;Helicopter&gt; mHelicopters = new ArrayList&lt;Helicopter&gt;();</code></pre><p>2)    this is being called in the run() of a thread:</p><pre><code>private void doDraw(Canvas canvas)     {     final long now = SystemClock.elapsedRealtime();        canvas.save();        for (int i = 0; i &lt; mHelicopters.size(); i++) {            final Helicopter explosion = mHelicopters.get(i);            explosion.update(now);        }        for (int i = 0; i &lt; mHelicopters.size(); i++) {            final Helicopter explosion = mHelicopters.get(i);            explosion.draw(canvas, mPaint);        }        canvas.restore();    }</code></pre><p>can someone help me?  i have looked at a lot of the examples on the web on animation, they seem to always involve text, but not images.  thanks.</p>","270811","","267269","","2010-04-23 09:45:54","2013-02-18 23:47:42","how to do android image animation","<android><android-animation>","3","0","","",""
"2696298","1","","","2010-04-23 04:54:11","7","11361","<p>Man, I am <em>still</em> not able to save a picture when I send an intent asking for a photo to be taken.   Here's what I am doing:</p><ol><li><p>Make a URI representing the pathname</p><pre><code>android.content.Context c = getApplicationContext(); String fname = c.getFilesDir().getAbsolutePath()+""/parked.jpg"";java.io.File file = new java.io.File( fname ); Uri fileUri = Uri.fromFile(file);</code></pre></li><li><p>Create the Intent (don't forget the pkg name!) and start the activity</p><pre><code>private static int TAKE_PICTURE = 22;Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );intent.putExtra(""com.droidstogo.boom1."" + MediaStore.EXTRA_OUTPUT, fileUri);startActivityForResult( intent, TAKE_PICTURE );</code></pre></li><li><p>The camera activity starts, and I can take a picture, and approve it.  My <code>onActivityResult()</code> then gets called. But my file doesn't get written.The URI is:   file:///data/data/com.droidstogo.boom1/files/parked.jpg</p></li><li><p>I can create thumbnail OK (by not putting the extra into the Intent), and can write that file OK, and later read it back).</p></li></ol><p>Can anyone see what simple mistake I am making?  Nothing obvious shows up in the logcat - the camera is clearly taking the picture.  Thanks,</p><p>Peter</p><hr><p>I should mention that I have the appropriate permissions set in the AndroidManifest.xml file:</p><pre><code>    &lt;uses-permission android:name=""android.permission.READ_OWNER_DATA"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_OWNER_DATA"" /&gt;    &lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;    &lt;uses-feature android:name=""android.hardware.camera"" /&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;/application&gt;</code></pre><p>Any ideas?   Any ideas on things to try, to get more info about the problem?</p>","253661","","1288","","2012-04-12 23:34:53","2012-05-26 23:21:10","Problems saving a photo to a file","<android><image><file><camera><save>","4","2","10","",""
"2696329","1","2696648","","2010-04-23 05:04:15","2","392","<p>Can you please if how can I render text <code>TextView</code> with URL like appearance (blue text with an underline)? And it can mixed with regular text (display as plain text)? And when I click on it, it will launch <code>WebView</code> loading that URL?</p>","286802","","1288","","2013-03-06 13:57:55","2013-03-06 13:57:55","How to render text in TextView which has URL apparence","<android>","2","0","1","",""
"2696485","1","","","2010-04-23 05:52:08","2","582","<p>I juststarted programming in android a few weeks ago, so I am not entirely sure how to deal with listing values. Please help me out!I have some questions regarding displaying data sets from db in a list. Currently I have a cursor returned by my db points to a list of rows and I want display 2 columns values in a single row of the list. The row xml looks like this: </p><pre><code> &lt;TextView android:id=""@+id/text1""     android:textSize=""16sp""     android:textStyle=""bold""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""/&gt; &lt;TextView android:id=""@+id/text2""     android:textSize=""14sp""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""/&gt;</code></pre><p>so I was thinking using simplecursoradapter which supposedly makes my life easier by displaying the data in a list. However that is only true if I want to display the raw data. For the purpose of my program I need to do some computations on the raw data sets, then display them. I am not sure how to do that using SimpleCursorAdapter. Here's how I display the raw data:</p><pre><code>   String[] from = new String[]{BtDbAdapter.KEY_EX_TYPE,BtDbAdapter.KEY_EX_TIMESTAMP};   int[] to = new int[]{R.id.text1, R.id.text2};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter records =             new SimpleCursorAdapter(this, R.layout.exset_row, mExsetCursor, from, to);    setListAdapter(records);</code></pre><p>Is there a way to do computation on the data in those rows before I bind it with the SimpleCursorAdapter? I was trying to use an alternative way of doing this by using arraylist and arrayadapter, but that way I dont know to how achieve displaying 2 items in a single row.</p><p>This is my code for using arrayadapter which only display 1 text in a row instead of 2 textviews in a row:</p><pre><code>  //fill in the array  timestamp_arr = new ArrayList&lt;String&gt;();  type_arr = new ArrayList&lt;String&gt;();  fillRecord();  Log.d(TAG,""setting now in recordlist"");  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item,timestamp_arr));  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item2,type_arr));</code></pre><p>It's very obvious that it only displays one textview in a row because I set the second arrayadapter overwrites the first one! I was trying to use R.id.text1 and R.id.text2 for them, but it gave me some errors saying 04-23 01:40:58.658: ERROR/AndroidRuntime(3309): android.content.res.Resources$NotFoundException: Resource ID #0x7f070008 type #0x12 is not valid</p><p>I believe the second method can achieve this, but I'm not sure how do deal with the layout problems, so if you any suggestions, please post them out. Thank you!! </p>","323897","","","","","2011-01-25 12:29:34","Computation on db data then list them using either SimpleCursorAdapter or ArrayAdapter","<android>","1","0","2","",""
"2696684","1","2696766","","2010-04-23 06:37:21","3","5766","<p>Say if I have a locationManager(LM) object in activity A, which is my main menu. All the sub-activities need to use LM. In a good design, should I pass LM object to sub-activities? How? Please suggest some good coding pattern. Thanks.</p>","248430","","21886","","2010-04-23 07:05:50","2014-04-05 12:05:48","Android passing objects between activities","<android>","1","0","1","",""
"2696753","1","4887992","","2010-04-23 06:51:41","1","2555","<p>I readed this:<a href=""http://stackoverflow.com/questions/2683287/drop-pin-on-default-google-maps-in-android"">http://stackoverflow.com/questions/2683287/drop-pin-on-default-google-maps-in-android</a>and do all the same.But there is no pin droped on the map, after i call:startActivity(new Intent(Intent.ACTION_VIEW, uri));</p><p>The map centered on that uri-location, but no any pin dropped on the map.</p><p>So, there is a question:How to drop pin on the map?</p>","309793","","267269","","2010-04-23 09:44:52","2011-09-13 17:44:04","Drop pin in MapView","<android><maps><android-maps>","1","3","","",""
"2696846","1","4583322","","2010-04-23 07:17:28","0","5334","<p>I have a small problem so I would be grateful if anyone could help me in any way. Thank you ;)</p><p>I have this little ""application"", and I want when someone type in a AutoComplete textbox for example ""New"" it automatically displays ""New York"" as a option and that (AutoComplete function) works fine. But I want when user type in full location (or AutoComplete do it for him) - that text (location) input is forwarded to a database search which then searches through database and ""collects"" all rows with user-typed location. For example if user typed in ""New York"", database search would find all rows with ""New York"" in it. When it finds one/more row(s) it would display them below. In images...</p><p>I have this when user is typing...</p><p><a href=""http://www.imagesforme.com/show.php/1093305_SNAG0000.jpg"" rel=""nofollow"">http://www.imagesforme.com/show.php/1093305_SNAG0000.jpg</a></p><p>I have this when user choose a AutoComplete location</p><p>(h)ttp://www.imagesforme.com/show.php/1093306_SNAG0001.jpg (remove () on the beggining)</p><p>But I wanna this when user choose a AutoComplete location</p><p>(h)ttp://www.imagesforme.com/show.php/1093307_CopyofSNAG0001.jpg (remove () on the beggining)</p><p><strong>Complete Code</strong></p><pre><code>    package com.svebee.prijevoz;import android.app.Activity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.util.Log;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;import android.widget.TextView;public class ZelimDoci extends Activity {TextView lista; static final String[] STANICE = new String[] {   ""New York"", ""Chicago"", ""Dallas"", ""Los Angeles"" }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.zelimdoci);  AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, STANICE);  textView.setAdapter(adapter);  lista = (TextView)findViewById(R.id.lista);  SQLiteDatabase myDB= null;  String TableName = ""Database"";  String Data="""";  /* Create a Database. */  try {   myDB = this.openOrCreateDatabase(""Database"", MODE_PRIVATE, null);   /* Create a Table in the Database. */   myDB.execSQL(""CREATE TABLE IF NOT EXISTS ""     + TableName     + "" (Field1 INT(3) UNIQUE, Field2 INT(3) UNIQUE, Field3 VARCHAR UNIQUE, Field4 VARCHAR UNIQUE);"");    Cursor a = myDB.rawQuery(""SELECT * FROM Database where Field1 == 1"", null);   a.moveToFirst();   if (a == null) {      /* Insert data to a Table*/   myDB.execSQL(""INSERT INTO ""     + TableName     + "" (Field1, Field2, Field3, Field4)""     + "" VALUES (1, 119, 'New York', 'Dallas');"");   myDB.execSQL(""INSERT INTO ""     + TableName     + "" (Field1, Field2, Field3, Field4)""     + "" VALUES (9, 587, 'California', 'New York');"");   }   myDB.execSQL(""INSERT INTO ""     + TableName     + "" (Field1, Field2, Field3, Field4)""     + "" VALUES (87, 57, 'Canada', 'London');"");   }   /*retrieve data from database */   Cursor c = myDB.rawQuery(""SELECT * FROM "" + TableName , null);   int Column1 = c.getColumnIndex(""Field1"");   int Column2 = c.getColumnIndex(""Field2"");   int Column3 = c.getColumnIndex(""Field3"");   int Column4 = c.getColumnIndex(""Field4"");   // Check if our result was valid.   c.moveToFirst();   if (c != null) {    // Loop through all Results    do {     String LocationA = c.getString(Column3);     String LocationB = c.getString(Column4);     int Id = c.getInt(Column1);     int Linija = c.getInt(Column2);     Data =Data +Id+"" | ""+Linija+"" | ""+LocationA+""-""+LocationB+""\n"";    }while(c.moveToNext());   }   lista.setText(String.valueOf(Data));  }  catch(Exception e) {   Log.e(""Error"", ""Error"", e);  } finally {   if (myDB != null)    myDB.close();  } }}</code></pre><p><strong>.xml file</strong></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:textSize=""20sp"" android:gravity=""center_horizontal"" android:padding=""10sp"" android:text=""Test AutoComplete""/&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=""AutoComplete"" /&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;&lt;/LinearLayout&gt;</code></pre>","455268","","","","","2013-12-02 18:51:47","From AutoComplete textbox to database search and display?","<android><textbox><autocomplete>","2","0","1","",""
"2696939","1","3781480","","2010-04-23 07:40:25","0","603","<p>I have some text data in database which I have retrieved in a Cursor, and I am displaying it in a ListView. What I want to do now is that when you select click a particular row in the list its text content should be displayed in full screen and the user should be able to scroll horizontally (like scrolling between iPhone home screens) to view the contents of the Cursor.</p>","323133","","","","","2010-09-23 18:39:37","Android horizontal scrolling showing Cursor data","<android><scrolling><cursor><horizontal-scrolling>","1","0","","",""
"2697094","1","","","2010-04-23 08:14:38","0","2359","<p>My codes like this: </p><p>public void removeTabForLogout(){</p><pre><code>  if (tabHost.getTabWidget().getChildCount()==4){       tabHost.setCurrentTab(0);       tabHost.clearAllTabs();       tabHost.addTab(getTab1());       tabHost.addTab(getTab2());    }</code></pre><p>} </p><p>private TabSpec getTab1(){ </p><pre><code>    if (mTab1==null){         mTab1= tabHost.newTabSpec(""tab1"")             .setIndicator(...).setContent(intentForTab1);     }     return mTab1; </code></pre><p>} </p><p>private TabSpec getTab2(){ </p><pre><code>    if (mTab1==null){     mTab1= tabHost.newTabSpec(""tab2"")         .setIndicator(...).setContent(intentForTab2);     }     return mTab2; </code></pre><p>} </p><p>I have 4 tabs in TabHost: tab1, tab2, tab3, tab4 , when user logout i will remove tab3 and tab4, so i call the removeTabForLogout() , clear all tabs in tabHost and re-add the tab1 and tab2. </p><p>In android 1.5 and android 1.6, if current selected tab is tab1 when i call removeTabForLogout, there is a exception throw at tabHost.addTab(getTab1()): </p><p>ERROR/AndroidRuntime(205): java.lang.IllegalStateException: View com.android.internal.policy.impl.PhoneWindow$DecorView@437aba18 has already been added to the window manager.</p><p>at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:125) </p><p>........ </p><p>at android.widget.TabHost.setCurrentTab(TabHost.java:320) </p><p>at android.widget.TabHost.addTab(TabHost.java:210) </p><p>at aitao.mobile.android.actMain.removeTabForLogout(actMain.java:266) </p><p>But removeTabForLogout() works fine in android 2.0 and later version. </p><p>I can't find any usefull information on Google. Does any one can help me? Thanks very much!</p>","323992","","323992","","2010-04-23 08:24:59","2010-05-26 19:25:05","Dynamic remove Tab from TabHost problem on android1.5","<android><layout><android-tabhost>","1","0","","",""
"2697233","1","3026922","","2010-04-23 08:43:41","73","48785","<p>Is there any way to add a button to the bottom of preferences screen and make them work correct when scrolling?</p>","275909","","","","","2014-04-14 01:29:53","How to add a button to PreferenceScreen","<android><android-preferences>","6","2","63","",""
"2697283","1","","","2010-04-23 08:50:18","2","4696","<p>I'm writing an app with ListView layout and i want to add to any linein this ListView CheckBox.How can i do this?</p><p>This is my 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:layout_width=""wrap_content""       android:layout_height=""wrap_content""&gt;       &lt;ListView               android:id=""@+id/listView""               android:layout_width=""fill_parent""               android:layout_height=""fill_parent""               android:layout_weight=""1""&gt;       &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>ThanksMoshik.</p>","324011","","24054","","2010-04-23 09:04:59","2010-04-23 09:24:55","How to add CheckBox to any ListView item in android?","<android><listview><checkbox>","1","0","","",""
"2697484","1","","","2010-04-23 09:29:55","3","1248","<p>I posted this query here, but as usual, noone knows / no replies</p><p><a href=""http://www.anddev.org/viewtopic.php?p=41513#41513"" rel=""nofollow"">http://www.anddev.org/viewtopic.php?p=41513#41513</a></p><p>How can I launch the android default mail application through the click of a button in my code?</p><p>I would also like to know, how this can be done to launch the contacts list also.</p><p>Any help in this regard is appreciated,</p><p>Regards,Rony</p>","324036","","","","","2011-01-23 14:54:09","Launch Android Default Email application through btn click","<android><android-emulator><android-widget>","1","0","","",""
"2697572","1","4214608","","2010-04-23 09:46:37","0","707","<p>I need to develop an application that will check whether the phone is in roaming. If it's in roaming then the application should block internet for all applications except several from white list. In non-roaming mode it should allow all requests. There should be no way for user to kill or suspend the application or turn internet on.<br>I'm not familiar with android much so I really don't know whether it possible to implement without modification of OS. Is there any way to do this?</p>","66591","","","","","2010-11-18 12:13:50","Is it possible to implement a secure application to block internet on Android in roaming?","<java><android><android-ndk>","2","0","","",""
"2697644","1","2697915","","2010-04-23 09:58:26","2","3911","<p>I'm developing an <strong>Android game</strong> that has to download some <strong>assets</strong> to the <strong>SD card</strong> to keep the size of the app as small as possible. I was thinking of using an <strong>uncompressed zip</strong> file to bundle all the assets.</p><p>A requirement from the client is to <strong>protect</strong> these assets as much as possible. Being part of the apk is considered enough protection, but if I do this the <strong>apk size</strong> will be enormous. If I just put a zip bundle in the SD card, then anyone can unzip it and explore its contents.</p><p>Is there a <strong>simple</strong> way to do this without retorting to horrid DRM? </p><p>Obviously if someone <strong>really</strong> wants to check the resources of an Android game, they can. I'm just looking for a simple solution to avoid making this very easy.</p>","143378","","143378","","2010-04-23 11:25:27","2010-04-23 11:51:49","Downloading game assets to SD card on Android","<android><copy-protection><sd-card>","1","5","8","",""
"2697740","1","2698896","","2010-04-23 10:17:17","1","4343","<p>I have a <code>ListView</code> and I want to select multiple items in the <code>ListView</code> without using <code>CheckedTextView</code>. </p><p>Please help !!</p>","301444","","","","","2010-04-23 13:28:38","android select multiple items in ListView?","<android><listview>","2","0","","",""
"2697799","1","2698054","","2010-04-23 10:29:47","32","59116","<p>How can I make my page slide as the user slides finger on the screen? Any example code? </p><p><em>I just require the same feel as it is on my android g-phone's home screen. The screen moves as the finger moves (also includes the elastic effect).</em></p>","2355649","","1073386","","2014-02-23 19:11:51","2014-02-23 19:11:51","How can I make my page slide as the user slides finger on the screen?","<android><slider>","7","2","26","",""
"2697905","1","2698255","","2010-04-23 10:51:15","0","779","<p>anyone know how to do a listview which looks like this? I'm interesting in the style of rows with an own background and the selector working fine.</p><p><img src=""http://i40.tinypic.com/nv4ok8.png"" alt=""alt text""></p>","258863","","258863","","2010-04-23 11:28:57","2012-03-06 22:27:14","Android ListView","<android><listview>","1","1","1","",""
"2697951","1","2697991","","2010-04-23 11:00:15","0","1498","<p>I cant figure out why my program is showing null pointer exception. Plz help me...Here's the program...</p><pre><code>public class MusicListActivity extends Activity {List&lt;HashMap&lt;String, String&gt;&gt; songNodeDet = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();HashMap&lt;?,?&gt;[] songNodeWeb; XMLRPCClient client;String logInSess;ArrayList&lt;String&gt; paths=new ArrayList&lt;String&gt;();public ListAdapter adapter ;Object[] websongListObject;List&lt;SongsList&gt; SngList=new ArrayList&lt;SongsList&gt;();Runnable r;ProgressDialog p;ListView lv;String s;@Overridepublic void onCreate(Bundle si){    super.onCreate(si);    setContentView(R.layout.openadiuofile);    lv=(ListView)findViewById(R.id.list1);    r=new Runnable(){        public void run(){            try{                getSongs();            } catch (MalformedURLException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (XMLRPCException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    };              Thread t=new Thread(r,""background"");        t.start();          Log.e(""***"",""process over"");}@Overrideprotected void onResume() {    // TODO Auto-generated method stub      super.onResume();}    private Runnable returnRes = new Runnable() {    @Override    public void run() {         Log.d(""handler"",""handler"");              removeDialog(0);          p.dismiss();          list();        }                        };public void list(){      Log.d(""#####"",""#####""); LayoutInflater inflater=getLayoutInflater(); String[] from={}; int[] n={}; adapter=new SongsAdapter(getApplicationContext(),songNodeDet,R.layout.row,from,n,inflater); lv.setAdapter(adapter);}private Handler handler = new Handler() {    public void handleMessage(Message msg){       Log.d(""*****"",""handler"");              removeDialog(0);      p.dismiss();     }    };  public void webObjectList(Object[] imgListObj,String logInSess) throws XMLRPCException{    songNodeWeb = new HashMap&lt;?,?&gt;[imgListObj.length];    if(imgListObj!=null){        Log.e(""completed"",""completed"");        for(int i=0;i&lt;imgListObj.length;i++){ //imgListObj.length        songNodeWeb[i]=(HashMap&lt;?,?&gt;)imgListObj[i];        String nodeid=(String) songNodeWeb[i].get(""nid"");        break;        Log.e(""img"",i+""completed"");        HashMap&lt;String,String&gt; nData=new HashMap&lt;String,String&gt;();        nData.put(""nid"",nodeid);                Object nodeget=client.call(""node.get"",logInSess,nodeid);        HashMap&lt;?,?&gt; imgNode=(HashMap&lt;?,?&gt;)nodeget;        String titleName=(String) imgNode.get(""titles"");        String movieName=(String) imgNode.get(""album"");        String singerName=(String) imgNode.get(""artist"");        nData.put(""titles"", titleName);        nData.put(""album"", movieName);        nData.put(""artist"", singerName);        Object[]  imgObject=(Object[])imgNode.get(""field_image"");        HashMap&lt;?,?&gt;[] imgDetails=new HashMap&lt;?,?&gt;[imgObject.length];        imgDetails[0]=(HashMap&lt;?, ?&gt;)imgObject[0];        String path=(String) imgDetails[0].get(""filepath"");        if(path.contains("" "")){            path=path.replace("" "", ""%20"");        }         String imgPath=""http://www.gorinka.com/""+path;         paths.add(imgPath);        nData.put(""path"", imgPath);        Log.e(""my path"",path);        String mime=(String)imgDetails[0].get(""filemime"");        nData.put(""mime"", mime);        SongsList songs=new SongsList(titleName,movieName,singerName,imgPath,imgPath);        SngList.add(i,songs);        songNodeDet.add(i,nData);    }    Log.e(""paths values"",paths.toString());     //  return imgNodeDet;    handler.sendEmptyMessage(0);}  }    public void getSongs() throws MalformedURLException, XMLRPCException{      String ur=""http://www.gorinka.com/?q=services/xmlrpc"";    URL u=new URL(ur);     client = new XMLRPCClient(u);          //Connecting to the website    HashMap&lt;?, ?&gt; siteConn =(HashMap&lt;?, ?&gt;)  client.call(""system.connect"");    // Getting initial sessio id    String initSess=(String)siteConn.get(""sessid"");    //Login to the site using session id            HashMap&lt;?, ?&gt; logInConn =(HashMap&lt;?, ?&gt;)  client.call(""user.login"",initSess,""prakash"",""stellentsoft2009"");    //Getting Login sessid    logInSess=(String)logInConn.get(""sessid"");    websongListObject =(Object[]) client.call(""nodetype.get"",logInSess,"""");     webObjectList(websongListObject,logInSess);     Log.d(""webObjectList"",""webObjectList"");     runOnUiThread(returnRes);}</code></pre><p>}</p><p>Here's the Adapter associated...</p><pre><code>public class SongsAdapter extends SimpleAdapter{static List&lt;HashMap&lt;String,String&gt;&gt; songsList;Context context;LayoutInflater inflater;public SongsAdapter(Context context,List&lt;HashMap&lt;String,String&gt;&gt; imgListWeb,int layout,String[] from,int[] to,LayoutInflater inflater) {    super(context,songsList,layout,from,to);    this.songsList=songsList;    this.context=context;    this.inflater=inflater;    // TODO Auto-generated constructor stub}@Overridepublic View getView(int postition,View convertView,ViewGroup parent)throws java.lang.OutOfMemoryError{    try {    View v = ((LayoutInflater) inflater).inflate(R.layout.row,null);    ImageView images=(ImageView)v.findViewById(R.id.image);    TextView tvTitle=(TextView)v.findViewById(R.id.text1);    TextView tvAlbum=(TextView)v.findViewById(R.id.text2);    TextView tvArtist=(TextView)v.findViewById(R.id.text3);    HashMap&lt;String,String&gt; songsHash=songsList.get(postition);    String path=songsHash.get(""path"");    String title=songsHash.get(""title"");    String album=songsHash.get(""album"");    String artist=songsHash.get(""artist"");    String imgPath=path;        final ImageView imageView = (ImageView) v.findViewById(R.id.image);    AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv();    Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {        public void imageLoaded(Bitmap imageDrawable, String imageUrl) {            imageView.setImageBitmap(imageDrawable);        }        });    imageView.setImageBitmap(cachedImage);    tvTitle.setText(title);    tvAlbum.setText(album);    tvArtist.setText(artist);    return v;    }    catch(Exception e){        Log.e(""error"",e.toString());    }    return null;}public static Bitmap loadImageFromUrl(String url) {    InputStream inputStream;Bitmap b;try {    inputStream = (InputStream) new URL(url).getContent();    BitmapFactory.Options bpo=  new BitmapFactory.Options();    bpo.inSampleSize=2;     b=BitmapFactory.decodeStream(inputStream, null,bpo );     return b;} catch (IOException e) {        throw new RuntimeException(e);    }}</code></pre><p>}</p><p>Here is what logcat is showing...</p><pre><code>04-23 16:02:02.211: ERROR/completed(1450): completed04-23 16:02:02.211: ERROR/paths values(1450): []04-23 16:02:02.211: DEBUG/*****(1450): handler04-23 16:02:02.211: DEBUG/AndroidRuntime(1450): Shutting down VM04-23 16:02:02.211: WARN/dalvikvm(1450): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)04-23 16:02:02.222: ERROR/AndroidRuntime(1450): Uncaught handler: thread main exiting due to uncaught exception04-23 16:02:02.241: DEBUG/webObjectList(1450): webObjectList04-23 16:02:02.252: ERROR/AndroidRuntime(1450): java.lang.NullPointerException04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at com.stellent.gorinka.MusicListActivity$2.handleMessage(MusicListActivity.java:81)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at android.os.Handler.dispatchMessage(Handler.java:99)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at android.os.Looper.loop(Looper.java:123)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at android.app.ActivityThread.main(ActivityThread.java:4203)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at java.lang.reflect.Method.invokeNative(Native Method)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at java.lang.reflect.Method.invoke(Method.java:521)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)04-23 16:02:02.252: ERROR/AndroidRuntime(1450):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I have declared the getter and setter methods in a seperate claa named SongsList. Plz help me determine the problem...</p>","303155","","9990","","2010-04-23 11:02:13","2010-04-23 11:07:02","Reason for Null pointer Exception","<android>","1","4","","",""
"2698134","1","2721112","","2010-04-23 11:33:34","1","1694","<p>I have a database where I store two different kinds of data. One table is for favorite routes, the other stores the retrieved routes from a server.</p><p>I can retrieve the routes etc just fine. But after retrieving the first Route, pressing back or HOME, and then retrieving another route, the routes table is filled with all the old routes plus the new ones.</p><p>So my question: how do I delete ONLY the routes table and not the whole database because I don't want to delete the added favorites....?!</p><p>I found the following function in the android docs:</p><pre><code>public int delete (String table, String whereClause, String[] whereArgs)</code></pre><p>and I tried to implement it, but I must pass a SQLiteDataBase as an argument. But how?</p><p>I implemented: </p><pre><code>public void deleteTableRoutes(SQLiteDataBase db){  db.delete(""routes"", null, null);}</code></pre><p>But I want to call this function from a different class where I have no reference to the database.. so what do I have to pass as an argument? Or how do I get a reference to my database?</p><p>I build my database upon the code example of the NotePadExample from the dev docs.</p><p>How to solve this problem?thanks</p><p><b>This is an extract of my class from where I want to call deleteTableRoutes(...) </b></p><pre><code>package mjb.project.AVV;/** * Parse the request and fill the ListView with the results * @author MJB *  */import java.io.IOException;import java.net.MalformedURLException;import java.net.URL;import java.util.ArrayList;import java.util.List;import java.util.regex.Matcher;import java.util.regex.Pattern;import net.htmlparser.jericho.Element;import net.htmlparser.jericho.Source;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.util.Log;import android.widget.SimpleCursorAdapter;public class ParseHTML extends ListActivity {    private String start_from;    private String destination;    private int hour;    private int min;    private int day;    private int month;    private Source source;    private List&lt;Element&gt; tempList;    private List&lt;Element&gt; routes;    private String startT   = """";    private String arrivalT = """";    private String duration = """";    private String line     = """";    private boolean first=true;     private List&lt;ResultElement&gt; finalResult;    private List&lt;Element&gt; results;    private DbAdapter mDbHelper;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.parsehtml_list);        mDbHelper = new DbAdapter(this);                   mDbHelper.open();        // Used to store the final results + data        finalResult = new ArrayList&lt;ResultElement&gt;();        // Get applicationsContext        Context context = getApplicationContext();        // Receive extras from Input.class        ...        try {            // Set up the URL with the above parameters            source = new Source(new URL(""....""));               // Get the requested routes            getResultElements();                // Get the data from the Elements            getResultData();                // Print Result's data            printRes();                 // Delete old entries                                    deleteTableRoutes(context);</code></pre><p>// ERROR The method deleteRoutesTable(SQLiteDatabase) in the type DbAdapter is not applicable for the arguments (Context) .... of course, but how to get the reference to my db??</p><pre><code>            // Insert data to database            insertRoutesToDb();             // Fill data into the ListView            fillData();        } catch (MalformedURLException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        } finally {            mDbHelper.close();            mDbHelper=null;        }    }   }</code></pre><p><b>This is my DbAdapter</b></p><pre><code>package mjb.project.AVV;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;public class DbAdapter {    public static final String KEY_FROM  = ""title"";    public static final String KEY_TO    = ""body"";    public static final String KEY_ROWID = ""_id"";    public static final String KEY_START    = ""start"";    public static final String KEY_ARRIVAL  = ""arrival"";    public static final String KEY_LINE     = ""line"";    public static final String KEY_DURATION = ""duration"";    private static final String DATABASE_NAME           = ""data"";    private static final String DATABASE_NOTESTABLE     = ""notes"";    private static final String DATABASE_ROUTESTABLE    = ""routes"";    private static final String TAG = ""DbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    /**     * Database creation sql statement     */    private static final String DATABASE_CREATE_NOTES =            ""create table notes (_id integer primary key autoincrement, ""                    + ""title text not null, body text not null)"";    private static final String DATABASE_CREATE_ROUTES =        ""create table routes (_id integer primary key autoincrement, ""                + ""start , arrival , ""                 + ""line , duration );"";    private static final int DATABASE_VERSION = 3;    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_NOTES);            Log.d(TAG, ""created notes table"");            db.execSQL(DATABASE_CREATE_ROUTES);            Log.d(TAG, ""created routes table"");        }        @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"");            db.execSQL(""DROP TABLE IF EXISTS routes"");            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 createNote(String title, String body) {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_FROM, title);        initialValues.put(KEY_TO, body);        return mDb.insert(DATABASE_NOTESTABLE, null, initialValues);    }    /**     * Create a new route using the title and body provided. If the route is     * successfully created return the new rowId for that route, otherwise return     * a -1 to indicate failure.     *      * @param start the start time of the route     * @param arrival the arrival time of the route     * @param line the line number of the route     * @param duration the routes duration      * @return rowId or -1 if failed     */    public long createRoute(String start, String arrival, String line, String duration){        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_START, start);        initialValues.put(KEY_ARRIVAL, arrival);        initialValues.put(KEY_LINE, line);        initialValues.put(KEY_DURATION, duration);        return mDb.insert(DATABASE_ROUTESTABLE, null, initialValues);    }    /**     * Delete the note with the given rowId     *      * @param rowId id of note to delete     * @return true if deleted, false otherwise     */    public boolean deleteNote(long rowId) {        return mDb.delete(DATABASE_NOTESTABLE, 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 fetchAllNotes() {        return mDb.query(DATABASE_NOTESTABLE, new String[] {KEY_ROWID, KEY_FROM,                KEY_TO}, null, null, null, null, null);    }    /**     * Return a Cursor over the list of all routes in the database     *      * @return Cursor over all routes     */    public Cursor fetchAllRoutes() {        return mDb.query(DATABASE_ROUTESTABLE, new String[] {KEY_ROWID, KEY_START,                KEY_ARRIVAL, KEY_LINE, KEY_DURATION}, 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 fetchNote(long rowId) throws SQLException {        Cursor mCursor =                mDb.query(true, DATABASE_NOTESTABLE, new String[] {KEY_ROWID,                        KEY_FROM, KEY_TO}, KEY_ROWID + ""="" + rowId, null,                        null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    /**     * Return a Cursor positioned at the route that matches the given rowId     *      * @param rowId id of route to retrieve     * @return Cursor positioned to matching route     * @throws SQLException if note could not be found/retrieved     */    public Cursor fetchRoute(long rowId) throws SQLException {        Cursor mCursor =                mDb.query(true, DATABASE_ROUTESTABLE, new String[] {KEY_ROWID,                        KEY_START, KEY_ARRIVAL, KEY_LINE, KEY_DURATION}, 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 updateNote(long rowId, String title, String body) {        ContentValues args = new ContentValues();        args.put(KEY_FROM, title);        args.put(KEY_TO, body);        return mDb.update(DATABASE_NOTESTABLE, args, KEY_ROWID + ""="" + rowId, null) &gt; 0;    }    public void deleteRoutesTable(SQLiteDatabase db){        db.delete(""routes"", null, null);    }}</code></pre>","323814","","235654","","2010-04-27 15:10:34","2010-04-27 18:40:47","Delete ONE SPECIFIC table of a database - leave the rest intact","<database><android><table><delete>","3","1","0","",""
"2698179","1","","","2010-04-23 11:43:04","1","683","<p>I have the following activity structure in my application</p><p>A simple ""splash screen"" activity is started when the application is fired up (let's call it ""Splash""). This activity starts the main activity when the user presses a button (I will call it ""Main""). </p><p>Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one ""Form""), the second is a MapActivity that presents a map (it is called ""Map"").</p><p>Main, Form, and Map are declared exactly the same in the manifest:</p><pre><code>&lt;activity android:name=""fully qualified activity class""        android:screenOrientation=""landscape""     android:configChanges=""keyboard|keyboardHidden|orientation""    &gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.DEFAULT"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>When Main is active and I start Form and press ""back"", Main comes up again. Pressing ""back"" again brings up ""Splash"". Nothing strange here.</p><p>Now comes the strange part: when I am in Main, start Map, and press ""back"", Main comes up as expected. But pressing ""back"" again just restarts Main. A second press on ""back"" is needed to bring me back to Splash!</p><p>So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not!</p><p>Both Form and Map are started like this:</p><pre><code>startActivity(new Intent(this, MyActivity.class));</code></pre><p>I don not catch the back key in any activity.</p><p>Any clues on what is going on or how to debug this?</p>","324131","","","","","2010-04-23 12:07:34","Strange activity stack behavior when using MapActivity","<android><activity><android-mapview>","1","0","","",""
"2698295","1","2874396","","2010-04-23 12:07:15","6","7496","<p>I get that error message quite often when debugging my android app. What does it mean?</p>","70386","","","","","2014-03-02 15:01:39","What does ""Failed to find provider info for android.server.checkin"" mean?","<android><eclipse>","2","0","1","",""
"2698586","1","","","2010-04-23 12:50:32","2","942","<p>I have a code like  </p><pre><code>res = doc.evalute(xpathExpr,doc,                  function(prefix) {return namespaces[prefix] || null;},                  XPathResult.ANY_TYPE,null );</code></pre><p>Here doc is DOM document node</p><p>When i run for loop like this</p><pre><code>for(i in doc) alert(i);</code></pre><p>it gives evaluate method</p><p>but when i tried to use this method on dom node it giving me error like</p><p>xpathResult not defined...</p><p>i'm working in android browser</p><p>thanks in advance....</p>","323876","","24054","","2010-04-23 12:55:29","2011-05-10 13:49:49","document.evalute function giving exception","<xml><android><dom><xpath>","2","0","","",""
"2698593","1","2702025","","2010-04-23 12:50:53","1","371","<p>I'm wondering whether the official google Android Marketplace application has access to some restricted functionality in the OS, or if it just uses the standard APIs available. Anyone up to date on this matter?</p><p><strong>Update</strong></p><p>Would it be possible to get an application signed by the manufacturer so that you can access these functionalities, or does google have to do this?</p>","109097","","114066","","2010-08-16 16:02:49","2012-05-16 07:34:34","Android Marketplace","<android><marketplace>","2","0","","",""
"2698741","1","3119749","","2010-04-23 13:09:18","1","1760","<p>I have an Android activity with an ImageButton. I would like to execute some logic when the button is clicked and show a different image for the pressed state, but also receive the touch event on the activity.</p><p>By default only the button receives the touch event. If I set the clickable attribute of the button to false then only the activity receives the touch event.</p><p>What's the best way to implement the touch event in the activity and the click in the button?</p>","143378","","143378","","2010-05-16 20:42:47","2010-06-25 16:34:53","Intercepting touch events on activity and button on Android","<android><button><activity><touch-event>","2","0","0","",""
"2698817","1","2700501","","2010-04-23 13:18:23","91","120113","<p>I always read about this funny weight value in the Android documentations. Now I want to try it for the first time but it isn't working at all. </p><p>As I understand it from the documentations this layout: </p><pre><code>  &lt;LinearLayout     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""horizontal""&gt;     &lt;Button        android:text=""Register""        android:id=""@+id/register""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""10dip""        weight=""1"" /&gt;     &lt;Button        android:text=""Not this time""        android:id=""@+id/cancel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""10dip""        weight=""1"" /&gt;  &lt;/LinearLayout&gt;</code></pre><p>should create two buttons that are horizontally aligned and share the space equally. The problem is the two buttons don't grow to fill the space. The result is something like this: </p><p><img src=""http://janusz.de/~janusz/layout.png"" alt=""alt text""></p><p>I would like the buttons to grow and fill the whole line. If both buttons are set to fill parent only the first button is shown and fills the whole line. </p>","114066","","114066","","2012-02-02 13:03:42","2014-03-03 17:52:06","Linear Layout and weight in Android","<android><android-layout><android-linearlayout><weight>","12","1","53","",""
"2698906","1","","","2010-04-23 13:29:44","0","142","<p>i want to send input data in one application to the other application using ""intent"" or can we store user input from one application that can be used by other application.</p>","324225","","","","","2010-04-23 13:33:08","How to use data of one application into other application in Android","<android>","1","0","","",""
"2698981","1","","","2010-04-23 13:39:06","1","557","<p>I'm writing an android application which listens the phone calling events. What I want to do is, if there is a call incomes or outgoes, an activity shows with my customized info. I want to this screen keeps showing during the calling period. However, if a call is coming, the system UI which shows the contact always appears on top of my activity.  I've found some apps already realized this function, but mine can't. :(   Is there any way that I can achieve my goal? Any help will be appreciated. </p>","324214","","","","","2010-04-23 21:21:24","How can I show my activity(screen) on top of in-calling screen?","<android>","0","5","1","",""
"2699140","1","","","2010-04-23 14:01:39","0","817","<p>I got this trace when I tried to launch android 1.6 or 2.1. Android 1.5 is working fine. I tried to reinstall each SDK, but there is no way to get it working. I created those AVD with Eclipse plugin.</p><pre><code>geo@geo-laptop:~&gt; android/android-sdk-linux_86/tools/emulator -avd a16*** glibc detected *** android/android-sdk-linux_86/tools/emulator: free(): invalid pointer: 0x45454545 ***======= Backtrace: =========                                                                               /lib/libc.so.6(+0x6df7b)[0xb748cf7b]                                                                       /lib/libc.so.6(cfree+0xd9)[0xb7491ac9]                                                                     android/android-sdk-linux_86/tools/emulator[0x80db20c]                                                     android/android-sdk-linux_86/tools/emulator[0x840eb38]                                                     ======= Memory map: ========                                                                               08048000-08246000 r-xp 00000000 08:06 5693701    /home/geo/android/android-sdk-linux_86/tools/emulator     08246000-08249000 rw-p 001fd000 08:06 5693701    /home/geo/android/android-sdk-linux_86/tools/emulator     08249000-08445000 rw-p 00000000 00:00 0                                                                    08445000-08447000 rwxp 00000000 00:00 0                                                                    08447000-0874c000 rw-p 00000000 00:00 0          [heap]                                                    ad8e9000-ada86000 rw-s 00000000 00:04 85229580   /SYSV00000000 (deleted)                                   ada86000-adced000 rw-p 00000000 00:00 0                                                                    adced000-add0d000 rw-s 00000000 00:04 84770825   /SYSV0056a4d6 (deleted)                                   add0d000-adde4000 r-xp 00000000 08:05 22591      /usr/lib/libasound.so.2.0.0                               adde4000-adde5000 ---p 000d7000 08:05 22591      /usr/lib/libasound.so.2.0.0                               adde5000-adde8000 r--p 000d7000 08:05 22591      /usr/lib/libasound.so.2.0.0                               adde8000-adde9000 rw-p 000da000 08:05 22591      /usr/lib/libasound.so.2.0.0                               adde9000-ade09000 rw-s 00000000 00:05 3268       /dev/snd/pcmC0D0p                                         ade09000-b3e0b000 rw-p 00000000 00:00 0                                                                    b3e0b000-b3e0c000 ---p 00000000 00:00 0                                                                    b3e0c000-b55cd000 rw-p 00000000 00:00 0                                                                    b55cd000-b6dcd000 rwxp 00000000 00:00 0                                                                    b6dcd000-b6ea3000 rw-p 00000000 00:00 0                                                                    b6ea4000-b7205000 rw-p 00000000 00:00 0                                                                    b7205000-b7209000 r-xp 00000000 08:05 22491      /usr/lib/libXfixes.so.3.1.0                               b7209000-b720a000 r--p 00003000 08:05 22491      /usr/lib/libXfixes.so.3.1.0                               b720a000-b720b000 rw-p 00004000 08:05 22491      /usr/lib/libXfixes.so.3.1.0                               b7212000-b7222000 rw-s 00000000 00:05 3269       /dev/snd/pcmC0D0c                                         b7222000-b7226000 r-xp 00000000 08:05 22588      /usr/lib/alsa-lib/libasound_module_rate_speexrate.so      b7226000-b7227000 r--p 00003000 08:05 22588      /usr/lib/alsa-lib/libasound_module_rate_speexrate.so      b7227000-b7228000 rw-p 00004000 08:05 22588      /usr/lib/alsa-lib/libasound_module_rate_speexrate.so      b7228000-b7229000 rw-s 81000000 00:05 3268       /dev/snd/pcmC0D0p                                         b7229000-b722a000 r--s 80000000 00:05 3268       /dev/snd/pcmC0D0p                                         b722a000-b722b000 rw-s 00000000 00:04 84738056   /SYSV0056a4d5 (deleted)                                   b722b000-b7276000 r--p 00000000 08:05 85242      /var/cache/libx11/compose/l4_024_313cb605_00280cc0        b7276000-b72b5000 r--p 00000000 08:05 20724      /usr/lib/locale/en_US.utf8/LC_CTYPEb72b5000-b73d2000 r--p 00000000 08:05 101088     /usr/lib/locale/en_US.utf8/LC_COLLATEb73d2000-b73d9000 r-xp 00000000 08:05 22991      /usr/lib/libXrandr.so.2.2.0b73d9000-b73da000 r--p 00006000 08:05 22991      /usr/lib/libXrandr.so.2.2.0b73da000-b73db000 rw-p 00007000 08:05 22991      /usr/lib/libXrandr.so.2.2.0b73db000-b73e4000 r-xp 00000000 08:05 4146       /usr/lib/libXrender.so.1.3.0b73e4000-b73e5000 r--p 00008000 08:05 4146       /usr/lib/libXrender.so.1.3.0b73e5000-b73e6000 rw-p 00009000 08:05 4146       /usr/lib/libXrender.so.1.3.0b73e6000-b73f7000 r-xp 00000000 08:05 3705       /usr/lib/libXext.so.6.4.0b73f7000-b73f8000 r--p 00010000 08:05 3705       /usr/lib/libXext.so.6.4.0b73f8000-b73f9000 rw-p 00011000 08:05 3705       /usr/lib/libXext.so.6.4.0b73f9000-b73fa000 rw-p 00000000 00:00 0b73fa000-b73fc000 r-xp 00000000 08:05 8573       /usr/lib/libXau.so.6.0.0b73fc000-b73fd000 r--p 00001000 08:05 8573       /usr/lib/libXau.so.6.0.0b73fd000-b73fe000 rw-p 00002000 08:05 8573       /usr/lib/libXau.so.6.0.0b73fe000-b73ff000 rw-p 00000000 00:00 0b73ff000-b741d000 r-xp 00000000 08:05 3862       /usr/lib/libxcb.so.1.1.0b741d000-b741e000 r--p 0001d000 08:05 3862       /usr/lib/libxcb.so.1.1.0b741e000-b741f000 rw-p 0001e000 08:05 3862       /usr/lib/libxcb.so.1.1.0b741f000-b7583000 r-xp 00000000 08:05 39690      /lib/libc-2.11.1.sob7583000-b7584000 ---p 00164000 08:05 39690      /lib/libc-2.11.1.sob7584000-b7586000 r--p 00164000 08:05 39690      /lib/libc-2.11.1.sob7586000-b7587000 rw-p 00166000 08:05 39690      /lib/libc-2.11.1.sob7587000-b758a000 rw-p 00000000 00:00 0b758a000-b75a6000 r-xp 00000000 08:05 11519      /lib/libgcc_s.so.1b75a6000-b75a7000 r--p 0001b000 08:05 11519      /lib/libgcc_s.so.1b75a7000-b75a8000 rw-p 0001c000 08:05 11519      /lib/libgcc_s.so.1b75a8000-b768b000 r-xp 00000000 08:05 85419      /usr/lib/libstdc++.so.6.0.14b768b000-b768c000 ---p 000e3000 08:05 85419      /usr/lib/libstdc++.so.6.0.14b768c000-b7690000 r--p 000e3000 08:05 85419      /usr/lib/libstdc++.so.6.0.14b7690000-b7691000 rw-p 000e7000 08:05 85419      /usr/lib/libstdc++.so.6.0.14b7691000-b7698000 rw-p 00000000 00:00 0b7698000-b76c0000 r-xp 00000000 08:05 39698      /lib/libm-2.11.1.sob76c0000-b76c1000 r--p 00027000 08:05 39698      /lib/libm-2.11.1.sob76c1000-b76c2000 rw-p 00028000 08:05 39698      /lib/libm-2.11.1.sob76c2000-b76d9000 r-xp 00000000 08:05 39716      /lib/libpthread-2.11.1.sob76d9000-b76da000 r--p 00016000 08:05 39716      /lib/libpthread-2.11.1.sob76da000-b76db000 rw-p 00017000 08:05 39716      /lib/libpthread-2.11.1.sob76db000-b76de000 rw-p 00000000 00:00 0b76de000-b76e1000 r-xp 00000000 08:05 39696      /lib/libdl-2.11.1.sob76e1000-b76e2000 r--p 00002000 08:05 39696      /lib/libdl-2.11.1.sob76e2000-b76e3000 rw-p 00003000 08:05 39696      /lib/libdl-2.11.1.sob76e3000-b76eb000 r-xp 00000000 08:05 39720      /lib/librt-2.11.1.sob76eb000-b76ec000 r--p 00007000 08:05 39720      /lib/librt-2.11.1.sob76ec000-b76ed000 rw-p 00008000 08:05 39720      /lib/librt-2.11.1.sob76ed000-b76ef000 r-xp 00000000 08:05 39725      /lib/libutil-2.11.1.sob76ef000-b76f0000 r--p 00001000 08:05 39725      /lib/libutil-2.11.1.sob76f0000-b76f1000 rw-p 00002000 08:05 39725      /lib/libutil-2.11.1.sob76f1000-b7828000 r-xp 00000000 08:05 4550       /usr/lib/libX11.so.6.3.0b7828000-b7829000 r--p 00136000 08:05 4550       /usr/lib/libX11.so.6.3.0b7829000-b782c000 rw-p 00137000 08:05 4550       /usr/lib/libX11.so.6.3.0b782c000-b782d000 rw-s 81000000 00:05 3269       /dev/snd/pcmC0D0cb782d000-b782e000 r--s 80000000 00:05 3269       /dev/snd/pcmC0D0cb782e000-b782f000 rw-s 00000000 00:04 82771979   /SYSV0056a4d7 (deleted)b782f000-b7839000 r-xp 00000000 08:05 22208      /usr/lib/libXcursor.so.1.0.2b7839000-b783a000 r--p 00009000 08:05 22208      /usr/lib/libXcursor.so.1.0.2b783a000-b783b000 rw-p 0000a000 08:05 22208      /usr/lib/libXcursor.so.1.0.2b783b000-b783c000 r--p 00000000 08:05 20194      /usr/lib/locale/en_US.utf8/LC_NUMERICb783c000-b783d000 r--p 00000000 08:05 100190     /usr/lib/locale/en_US.utf8/LC_TIMEb783d000-b783e000 r--p 00000000 08:05 100189     /usr/lib/locale/en_US.utf8/LC_MONETARY[1]    24082 abort      android/android-sdk-linux_86/tools/emulator -avd a16</code></pre>","320252","","","","","2011-10-13 02:07:27","Unable to start Android emulator > 1.5","<android><android-emulator><glibc>","1","4","","",""
"2699215","1","2699288","","2010-04-23 14:13:12","3","6306","<p>I'm trying to get my location using it like this:</p><pre><code>LocationManager myLocationManager = (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 = myLocationManager.getBestProvider(criteria,true); if (provider != null) {     //there is a provider    myLocationManager.requestLocationUpdates(provider, 10L, 500.0f, (LocationListener) mainContext);    Location myCurLocation = myLocationManager.getLastKnownLocation(provider);             //here i'm trying to get some data from the            //myCurLocation but             //myCurLocation == NULL}</code></pre><p>but the myCurLocation is always == NULL</p><p>What am I doing wrong?</p>","379425","","114066","","2010-04-23 14:44:30","2010-04-23 14:44:30","get the current location (gps/wifi)","<android><location>","1","0","1","",""
"2699475","1","","","2010-04-23 14:48:07","3","980","<p>I've got a desire for a one-pixel divider line, just for looks.  I thought I could accomplish this using a View of height 1px, with a defined background.  However, I'm getting some very odd behavior on different devices - sometimes the 1px ends up as 2px.</p><p>Take this sample layout for example:</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;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1px""        android:background=""@android:color/white"" android:layout_marginBottom=""4dp"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>When run on my G1, <a href=""http://i.imgur.com/4aqjq.png"" rel=""nofollow"">this comes out fine</a>.  But on the Nexus One, <a href=""http://i.imgur.com/R6GE2.png"" rel=""nofollow"">it alternates between 1px lines and 2px lines</a>.</p><p>Does anyone know where this is going awry?  Why does Android sometimes make 1px into 2px?</p><p>Edit: To make this absolutely clear, I do not care about solving my example in particular; what I care about is being able to say ""this View shall be 1px high"", in any circumstance, not just this example.</p>","60261","","60261","","2010-04-23 19:32:43","2010-11-15 14:10:29","Why is 1px sometimes 2px when specified in Android XML?","<android>","3","0","3","",""
"2699729","1","2699786","","2010-04-23 15:16:52","1","17498","<p>I am a rookie to android. I am thinking of implementing a simple calculator in android to get a hold of the basics in android. I want to display a keypad with numbers and mathematical operations and when the user presses the keys the corresponding number is displayed in edit text. I tried using gettext() and updating the contents of edit text but it shows just the contents of pressed button. Also how do I read the contents of button so as to do mathematical operations in code? Any help would be much appreciated.</p><p>regards,</p><p>Primal</p>","323404","","","","","2012-09-21 23:59:56","Android: How to set the contents of a Edit text from a Button click?","<android>","4","0","1","",""
"2699917","1","3453575","","2010-04-23 15:41:58","2","2774","<p>I'm trying to write an XML parser that takes an RSS feed &amp; fetches the image urls shown in the url attribute of the <code>&lt;media:thumbnail&gt;</code> tag.  This is all being done via <code>android.Util.Xml</code>, &amp; is an adaptation of <a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html#N101E0"" rel=""nofollow"">the code shown here</a>.  An example RSS feed that I'm trying to use is the <a href=""http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"" rel=""nofollow"">BBC News RSS feed</a>.</p><p>However, media is an additional namespace &amp; (probably) as a result my parser isn't working as it should.</p><p>A version of my parse method is below.  Is there any (no doubt simple) way to get my list of image URLs working?</p><pre><code>public List&lt;string&gt; parse() {    URL feedUrl = new URL(""http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"");    InputStream feedStream;    try {        feedStream = feedUrl.openConnection().getInputStream();    } catch (IOException e) {        throw new RuntimeException(e);    }                  final List&lt;string&gt; ret = new ArrayList&lt;string&gt;();    RootElement root = new RootElement(""rss"");    Element channel = root.getChild(""channel"");    Element item = channel.getChild(""item"");    item.getChild(""media"", ""thumbnail"").getChild(""url"").setEndTextElementListener(new EndTextElementListener() {        public void end(String body) {            ret.add(body);        }    });    try {        Xml.parse(feedStream, Xml.Encoding.UTF_8, root.getContentHandler());    } catch (Exception e) {        throw new RuntimeException(e);    }    return ret;}</code></pre>","204168","","","","","2011-02-13 22:31:07","Processing RSS Feeds with Namespaces in Android","<android><rss><namespaces><xml-namespaces>","3","0","1","",""
"2699954","1","2700007","","2010-04-23 15:47:04","1","6166","<p>When I call </p><pre><code>myDB = this.openOrCreateDatabase(""DatabaseName"", MODE_PRIVATE, null);</code></pre><p>Where does the database file get created?</p><p>I can't find it anywhere. o_O</p>","283952","","","","","2010-04-23 15:55:13","New to Android: openOrCreateDatabase(): where does the sqlite file go?","<database><android><sqlite><sqlite3>","1","1","","",""
"2700038","1","","","2010-04-23 15:59:36","0","649","<p>I am trying to load hebrew rss using the fllow :</p><p>Xml.parse(_InputStream,  Xml.Encoding.ISO_8859_1 , root.getContentHandler());</p><p>taken from ibm site :<a href=""http://www.ibm.com/developerworks/xml/library/x-android/"" rel=""nofollow"">link text</a></p><p>I would like to use other Encoding like ""ISO8859_8"" rather than :</p><p>Xml.Encoding.ISO_8859_1,</p><p>Xml.Encoding.US_ASCII,</p><p>Xml.Encoding.UTF_16,</p><p>Xml.Encoding.UTF_8</p><p>Thanks a lot!</p>","1514062","","","","","2011-01-07 20:11:59","Changing Encoding while Xml.parse() with SaxFeedParser Java","<java><android><encoding>","1","0","","",""
"2700106","1","","","2010-04-23 16:06:47","5","1653","<p>I'm trying to compile SoundTouch on Android.  I started with this configure line:</p><p>./configure CPPFLAGS=""-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/"" LDFLAGS=""-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc"" --host=arm-eabi --enable-shared=yes CFLAGS=""-nostdlib -O3 -mandroid"" host_alias=arm-eabi --no-create --no-recursion</p><p>Because the Android NDK targets ARM, I also had to change the Makefile to remove the -msse2 flags to progress.</p><p>When I run 'make', I get:</p><pre><code>/bin/sh ../../libtool --tag=CXX   --mode=compile arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include  -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c -o FIRFilter.lo FIRFilter.cpplibtool: compile:  arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c FIRFilter.cpp -o FIRFilter.oFIRFilter.cpp:46:21: error: stdexcept: No such file or directoryFIRFilter.cpp: In member function 'virtual void soundtouch::FIRFilter::setCoefficients(const soundtouch::SAMPLETYPE*, uint, uint)':FIRFilter.cpp:177: error: 'runtime_error' is not a member of 'std'FIRFilter.cpp: In static member function 'static void* soundtouch::FIRFilter::operator new(size_t)':FIRFilter.cpp:225: error: 'runtime_error' is not a member of 'std'make[2]: *** [FIRFilter.lo] Error 1make[1]: *** [all-recursive] Error 1make: *** [all-recursive] Error 1</code></pre><p>This isn't very surprising, since the -nostdlib flag was required.  Android seems to have neither stdexcept nor stdlib.  <b>How can I get past this block of compiling SoundTouch?</b></p><p>At a guess, there may be some flag I don't know about that I should use.  I could refactor the code not to use stdexcept.  There may be a way to pull in the original stdexcept source and reference that.  I might be able to link to a precompiled stdexcept library.</p>","281519","","5","","2010-05-21 06:28:56","2010-05-31 18:30:36","stdexcept On Android","<android><compilation><android-ndk><soundtouch>","1","0","2","",""
"2700172","1","2701102","","2010-04-23 16:16:27","5","1524","<p>I have a cursor, and it got, lets say, 40 rows, I want to hide some rows when the user check a checkbox.</p><p>one way is run the query again on the cursor, but it doesn't help me because the condition is done by Java (calculate balance, with many logic).</p><p>I need something that will get the current row, and return if it can be show or not.</p><p>any help will be appreciated.</p>","324375","","","","","2010-04-23 18:36:32","How to hide specific rows of a Cursor in android","<android><sqlite><cursor>","2","0","2","",""
"2700583","1","2701194","","2010-04-23 17:22:29","1","5437","<p>I just can't display the button at the bottom of the screen. I have 2 textviews and 2 edittexts set as gone, and they become visible when user clicks checkbox. It's only then that my button gets positioned properly Otherwise it  sits on top of the app at launch of my app.(see here: <a href=""http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png"" rel=""nofollow"">http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png</a>) I also tried android:layout_alignParentBottom=""true"" but that doesnt help either.</p><pre><code> &lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/scrollview""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&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/txt1"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:text=""Krajevna skupnost: ""    android:layout_alignParentTop=""true"" /&gt; &lt;Spinner     android:id=""@+id/spinner1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:prompt=""@string/ks_prompt""    android:layout_below=""@id/txt1""    /&gt; &lt;TextView android:id=""@+id/txt2"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:text=""Zadeva: ""    android:layout_below=""@id/spinner1"" /&gt; &lt;Spinner     android:id=""@+id/spinner2""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:prompt=""@string/pod_prompt""    android:layout_below=""@id/txt2""/&gt;&lt;TextView android:id=""@+id/tv1"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:text=""Zadeva: ""    android:layout_below=""@id/spinner2"" /&gt;&lt;EditText android:id=""@+id/prvi"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/tv1"" /&gt;&lt;TextView android:id=""@+id/tv2"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/prvi""    android:text=""Vsebina: "" /&gt;&lt;EditText android:id=""@+id/drugi"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/tv2"" /&gt;    &lt;CheckBox android:id=""@+id/cek"" android:text=""Obvešcaj o odgovoru""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_below=""@id/drugi"" /&gt;&lt;TextView android:id=""@+id/tv3"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/cek""    android:text=""Email: ""     android:visibility=""gone""/&gt; &lt;EditText android:id=""@+id/tretji"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/tv3""    android:visibility=""gone"" /&gt;    &lt;TextView android:id=""@+id/tv4"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@id/tretji""    android:visibility=""gone""    android:text=""Telefon: "" /&gt; &lt;EditText android:id=""@+id/cetrti"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:visibility=""gone""    android:layout_below=""@id/tv4"" /&gt;    &lt;Button android:id=""@+id/gumb""    android:text=""Klikni""    android:typeface=""serif"" android:textStyle=""bold""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""     android:layout_below=""@id/cetrti"" /&gt;           &lt;/RelativeLayout&gt;          &lt;/ScrollView&gt;</code></pre>","324417","","","","","2010-04-23 18:52:22","Android relative layout problem","<java><android>","2","0","","",""
"2700769","1","2709427","","2010-04-23 17:47:56","1","1331","<p>it is difficult to test a game with the mouse pointer on android buttons. I would like to control those buttons with the hardware keyboard. Actually I don't want to control the buttons itself but I want to control the behaviour the buttons would also do. For example I have 4 buttons in the android application with ""arrow up, down, left, right"". I'd like to use the arrow buttons of my hardware keyboard to control the same. How can I do that? Actually the question is, where can I set the Listener? I tried something in my activity. I set this listener to the application button:</p><pre><code>        button.setOnKeyListener(new OnKeyListener() {                   @Override        public boolean onKey(View v, int keyCode, KeyEvent event) {            if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN)                //scroll down            return true;        }    });</code></pre><p>The behaviour is the following:I can't scroll down with my hardware keyboard but with the hardware keyboard I can select the android buttons (they will be highlighted when I move on any button). After I selected the button with the Listener I can't select any other button anymore but then the Listener comes into force. Now I can scroll down with the hardware keyboard arrow down button. I would like to achieve this behaviour without selecting any button. So I thought about setting the listener to the layout container or any other layout but this has no effect. Is there any other approach to achieve this?</p>","319773","","","","","2010-04-25 18:46:29","Using the hardware keyboard to simulate button press on Android","<android>","1","2","","",""
"2700855","1","2732770","","2010-04-23 18:01:10","0","2126","<p>I am working on a Windows XP Machine. When running AVDs out of Eclipse, I am getting ""No Network Connection"" when I am plugged into my company's network and using an AVD that was built with the ""Google APIs by Google Inc., Android API 7, revision 1"".</p><p>If I use this same AVD (Google API) and connect to the internet through a Verizon Wireless card, the AVD gets an Internet Connection. </p><p>If I use an AVD built with ""SDK Platform Android 2.1, API 7, revision 1"", and connect through my company's network, the AVD gets an Internet Connection. </p><p>Any ideas what might be blocking this? I am guessing it is something in my company's network, but why only with the AVD created with the Google API?</p>","300129","","","","","2011-01-13 02:18:02","Android AVD With GoogleApi, Not Getting Network Connection","<android><networking><connectivity><avd>","1","0","","",""
"2700970","1","","","2010-04-23 18:19:05","4","376","<p>What is the recommended way of creating a demo version for an application.  Basically, the demo version will be fully functional, but will be limited to running it 25 times.  My worry is that if the user uninstalls and reinstalls, the count will be reset.</p><p>I thought about writing a data file to the SD Card with the count of executions (hoping that would persist after uninstall), but I do not want to add that permission if I can avoid it.</p><p>Any suggestions on how to have some type of demo flag persist after an uninstall?</p>","324485","","","","","2010-04-23 18:37:36","Demo Version of Application","<android>","1","0","1","",""
"2700983","1","6516810","","2010-04-23 18:20:53","1","585","<p>Two of my users have reported a problem with my Android application, OftSeen Gestures. Both of them are using a Motorola Droid. The app saves a text file which is just a list of gesture names and phone numbers, both strings. It saves the file to the private data area. I don't know that it is this code that is failing but they report the assigned numbers disappearing after the phone comes out of screen sleep. Since the file is reread in OnCreate each time, I'm assuming the file doesn't exist on return.</p><p>As soon as I can get my hands on a Droid I will debug it but in the meantime can you see a reason why this save operation would fail on Droid (no other users have reported this)?</p><pre><code>    OutputStreamWriter out = new OutputStreamWriter(AppGlobal.getContext().openFileOutput(MAPPINGS_FILE_NAME, 0));    for (String key : mMap.keySet()) {        String number = mMap.get(key).number;        out.write(String.format(""%s,%s\n"", key, number == null ? """" : number));    }    out.close();</code></pre><p>AppGlobal.getContext returns the application context and the MAPPINGS_FILE_NAME resolves to ""gesture_mappings.txt"".</p><p>Like I say, I don't know that this is the problem. It could be something else to do with state management inside the app. If anyone has a Droid, maybe they could download the app from Market and test it for me? Note this is a genuine request for help - not an attempt to increase my downloads.</p>","81317","","","","","2011-06-29 06:55:07","Problem saving file on Motorola Droid, Android 2.1?","<android><motorola-droid>","1","3","0","",""
"2701078","1","2701535","","2010-04-23 18:33:49","34","25080","<p>I have a desktop application using git for synchronization. I have also an android application which do the same as the desktop, but I don't know how to do the synchronization part on it. I haven't found any implementation of git on android. I found a jgit, but its unwell documented and I was not able to do even a commit with that. </p><p>I was thinking about remote commands to my git server from my android app, but this is really a tease for me. Could you tell me if any other git implementation which can be used on android exists? If you have any idea how to solve that, please tell me. </p><p>Thanks for reply,</p><p>Dave</p>","324494","","","","","2013-11-20 15:57:20","using git on android","<android><git><synchronization>","9","1","16","",""
"2701105","1","","","2010-04-23 18:37:08","3","433","<p>l'm new here so hope to follow guidelines as I'm a newbie for both the side and android.</p><p>For my first app I'm trying to make a world clock.In order to check it the time is shown and update in seconds. (00:00:00)As the only thing I want to update every second is the time I don't want to use:ListView's notfiyDataHasChanged()</p><p>I have a custom ListView &amp; extended BaseAdapter and row.xml with each ListView item layout.</p><p>Trying:lv.getChildCount() returns 0;So I understand it has no child.But I don't know how I can retrieve the View of the specific item in the listview.Then call that view's TextView by findViewById(R.id.time) and set it each second.</p><p>I've googled and read alot of threads but still didn't get that :(</p><p>Thank You. </p>","324482","","","","","2011-07-20 10:04:32","Access a custom ListView item","<android><listview><item>","1","0","","",""
"2701216","1","","","2010-04-23 18:55:12","0","122","<p>As per my question here...</p><p><a href=""http://www.jetbrains.net/devnet/message/5261667#5261667"" rel=""nofollow"">http://www.jetbrains.net/devnet/message/5261667#5261667</a></p><p>Is it possible to use TeamCity with an Idea 9 project project that has 3 .iml modules where 2 are Java based and 1 in an Android module?</p>","97901","","","","","2010-04-24 00:35:16","Is it possible to use an Idea 9 Android module in a Teamcity IPR runner?","<android><teamcity><teamcity-5.1>","1","0","","",""
"2701500","1","2723680","","2010-04-23 19:39:56","3","1061","<p>I am learning how to program on Android phone. However I am unsure how to make my application work for the different screen sizes and resolutions.</p><p>I read the tutorial on the android site and still unsure how to do it.</p><p>First I know there are different files so could make a layout for each of the sizes but my problem is most of the screen needs to be dynamically created so there would not be much to put in these files.</p><p>So I am not sure how to android to re size dynamic controls based on the screen size.</p><p>I have also read it is bad practice to make controls in anything but the xml file as it separates view logic and programming logic. However they never talk about if you need to make these controls dynamically what you should do.</p><p>So is there some other way to do it that is considered good practice?</p><p><strong>Edit</strong></p><p>I get this error when I try to run the switcher application.</p><pre><code>[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: Error type 2[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: Error: Unable to connect to activity manager; is the system running?[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: usage: am [start|broadcast|instrument|profile][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am start [-D] INTENT[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am broadcast INTENT[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am instrument [-r] [-e &lt;ARG_NAME&gt; &lt;ARG_VALUE&gt;] [-p &lt;PROF_FILE&gt;][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-w] &lt;COMPONENT&gt;[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am profile &lt;PROCESS&gt; [start &lt;PROF_FILE&gt;|stop][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: INTENT is described with:[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-a &lt;ACTION&gt;] [-d &lt;DATA_URI&gt;] [-t &lt;MIME_TYPE&gt;][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-c &lt;CATEGORY&gt; [-c &lt;CATEGORY&gt;] ...][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-e|--es &lt;EXTRA_KEY&gt; &lt;EXTRA_STRING_VALUE&gt; ...][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [--ez &lt;EXTRA_KEY&gt; &lt;EXTRA_BOOLEAN_VALUE&gt; ...][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-e|--ei &lt;EXTRA_KEY&gt; &lt;EXTRA_INT_VALUE&gt; ...][2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-n &lt;COMPONENT&gt;] [-f &lt;FLAGS&gt;] [&lt;URI&gt;]</code></pre><blockquote>  <p>To your question: It's dynamic because  the buttons in my example grow and  shrink depending on one of the 3  possibles sizes, because they use  scaled pixel (You probably know that  you don't have to deal with screen  sizes itself). So a scaled pixel  compared to a real a pixel has a size  of 0.75px, 1.0px or 1.5px. Android  automatically and dynamically adjusts  it to the actual size. So you don't  have to care about this in your code.</p></blockquote><p>So if I use scaled pixels then I don't have to worry about different screen sizes? </p><blockquote>  <p>At the moment I don't know an example  except in games where you have to deal  with ""real"" pixel. But if you want use  it, multiply it with the value of the  current density. This is your ""ratio"".  I don't have the example with the ball  anymore but I have another which uses  the same technics. You can run it on  different screen sizes and you will  see that the buttons will always fit  into the layout. You could use the  same technics for your intents. In  this example you can scroll with the  ""Scrn"" buttons from one view to  another of 4 views. (At the moment  they all have a black background so  you don't see that they are different  views). The ""Enter"" button exits the  test. It's an Eclipse project. You can  download</p></blockquote><p>So if I want to deal with ratio then I use real pixels and not scaled pixels? What advantage does this give me?</p><p>will scaled pixels work with changing from portrait to landscape( ie will it fill up the new found space)?</p><p>Finally should I make the controls now through code or is there another way? As I said I am getting data from a webservice that must look like this</p><pre><code>checkbox label label</code></pre><p>It can be one record or 10,000 records I don't know so these have to be appended to something that is like a window panel( the controls in there get a scroll bar).</p><p>Thanks?</p>","130015","","130015","","2010-04-27 19:13:15","2010-04-27 20:27:46","How to deal with multiple screensizes + dynamic controls in Android?","<android>","3","2","","",""
"2701857","1","2706882","","2010-04-23 20:41:20","3","6594","<p>Is there a good solution for picking a file in an android application? I need the user to be able to browse their SD card for a file they would like to load. However, it cannot use an outside application (like andExplorer or OI File Manager). It must stay contained inside my application and not require users to install other applications.</p><p>Using Intent.GET_CONTENT will not work because the files are of a custom type.</p><p>Thanks!</p>","118241","","","","","2013-10-29 20:40:40","Android File Picker","<android><file-io><filepicker>","3","0","","2013-10-29 21:19:42",""
"2701877","1","2701903","","2010-04-23 20:45:37","65","35259","<p>I can find syntax ""charts"" on this on the sqlite website, but no examples and my code is crashing.  I have other tables with unique constraints on a single column, but I want to add a constraint to the table on two columns.  This is what I have that is causing a SQLiteException with the message ""syntax error"".</p><p>CREATE TABLE name (column defs) UNIQUE (col_name1, col_name2) ON CONFLICT REPLACE</p><p>I'm doing this based on the following:</p><p><a href=""http://www.sqlite.org/syntaxdiagrams.html#table-constraint"">table-constraint</a></p><p><strong>EDIT:</strong>To be clear, the documentation on the link I provided says that <code>CONTSTRAINT name</code> should come before my constraint definition.</p><p>Something that may lead to the solution though is that whatever follows my parenthesized column definitions is what the debugger complains about.</p><p>If I put </p><pre><code>...last_column_name last_col_datatype) CONSTRAINT ...</code></pre><p>the error is <strong>near ""CONSTRAINT"": syntax error</strong></p><p>If I put </p><pre><code>...last_column_name last_col_datatype) UNIQUE ...</code></pre><p>the error is <strong>near ""UNIQUE"": syntax error</strong></p>","53501","","53501","","2010-04-23 20:54:28","2010-04-23 20:54:28","Sqlite table constraint - unique on multiple columns","<java><android><sqlite><syntax>","2","0","23","",""
"2702162","1","2702375","","2010-04-23 21:47:47","4","1417","<p>When using an Android-generated ant build file, the file references your SDK installation via an sdk.dir property inside the local.properties files which is generated by ""android update project -p ."".</p><p>The comments in build.xml suggest that local.properties should NOT be checked into version control.</p><p>BUT, when you run your build from Hudson, it does a fresh checkout of your code from version control, hence local.properties does not exist and subsequently the build fails without sdk.dir being set. So its kind of chicken and egg problem. As a workaround I have checked local.properties into version control for now (nobody else will use it) but I was curious as to how other developers had tackled this problem ?</p>","246793","","","","","2010-04-24 05:56:46","Building Android app from ant via Hudson - chicken and egg problem","<android><ant><properties><build><local>","2","0","4","",""
"2702178","1","2702395","","2010-04-23 21:51:10","3","5678","<p>I have an android application that starts an activity and is running well. I need other developers to be able to integrate my APK into their applications in such a way that they can start the activity in my APK from their android applications. </p><p>What are the ways of achieving this? </p><p>ThanksGeorge</p>","324632","","","","","2010-11-04 22:01:07","Invoking activity from APK in another android application","<android><activity><apk>","2","0","0","",""
"2702218","1","","","2010-04-23 21:59:12","2","1345","<p>Every app I make starts out with a number of common base classes, interfaces, utility classes and a basic package structure that has been working for me.  Is there a way for me to set up a project template in Eclipse that will give me all of the basic Android project stuff PLUS a bunch of custom packages, classes and interfaces?</p><p>I guess I could just put all of this stuff into one or more libraries as opposed to creating a whole project template, so if you have a preferred approach or information/links/etc on how to do any of the above, please share (I'm relatively inexperienced with Eclipse, so the more detail the better).</p><p>Thanks.</p>","53501","","","","","2010-04-24 02:22:12","Creating custom Android project templates in Eclipse?","<java><android><eclipse>","1","0","1","",""
"2702423","1","2702432","","2010-04-23 22:56:01","12","14921","<p>I'm trying to create a list with headers above a grouping of items.  I was looking at SeperatedListAdapter available here: <a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/</a> but I ran into an error <code>(ERROR/AndroidRuntime(2025):</code> </p><pre><code>java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView) </code></pre><p>Now I'm looking into more options including making a new one.  Do you guys have any hints?</p><p>Thanks,Bryon</p>","324661","","1012284","","2014-02-17 11:14:13","2014-02-17 11:14:13","Android List with section headers","<android>","3","0","5","",""
"2702590","1","","","2010-04-23 23:43:53","1","783","<p>I'm wondering if it is possible to create a separate APK file which contains only language specific strings and somehow persuade my program to try to read the string resources first from that package's resource and then from the program's own resources... I would like to have a main program with 2-3 mayor laguages and the rest of the languages would go into a separate language pack. (This is to keep the main program size small as I have already 12 translations)</p>","","user188128","958370","","2012-02-04 10:59:13","2012-02-04 10:59:13","Language resources in separate APK?","<android><android-resources>","2","0","1","",""
"2702642","1","","","2010-04-24 00:00:59","2","2117","<p>I have a couple of list views, one uses TextViews laid out with xml, the other uses a custom class derived from View.  The default halloween color scheme is pretty ugly.  How can I change the background and selection colors for the list elements.</p><p>Ideally, I'd like to be able to do this in code not xml, to handle the custom view.</p><p>Thanks,Gerry</p>","321594","","","","","2010-04-24 00:56:14","How to change colors for ListView, alternating row color?","<android><listview><colors><selection>","1","0","1","",""
"2702695","1","2705969","","2010-04-24 00:21:40","14","17852","<p>I've got an Android activity which grabs an RSS feed from a URL, and uses the SAX parser to stick each item from the XML into an array. This all works fine but, as expected, takes a bit of time, so I want to use AsyncActivity to do it in the background. My code is as follows:</p><pre><code>class AddTask extends AsyncTask&lt;Void, Item, Void&gt; {    protected void onPreExecute() {        pDialog = ProgressDialog.show(MyActivity.this,""Please wait..."", ""Retrieving data ..."", true);    }    protected Void doInBackground(Void... unused) {        items = parser.getItems();        for (Item it : items) {            publishProgress(it);        }        return(null);    }    protected void onProgressUpdate(Item... item) {        adapter.add(item[0]);    }    protected void onPostExecute(Void unused) {        pDialog.dismiss();    }  }</code></pre><p>Which I call in <code>onCreate()</code> with</p><pre><code>new AddTask().execute();</code></pre><p>The line <code>items = parser.getItems()</code> works fine - <code>items</code> being the arraylist containing each item from the XML. The problem I'm facing is that on starting the activity, the ProgressDialog which i create in <code>onPreExecute()</code> isn't displayed until <em>after</em> the <code>doInBackground()</code> method has finished. i.e. I get a black screen, a long pause, then a completely populated list with the items in. Why is this happening? Why isn't the UI drawing, the ProgressDialog showing, the parser getting the items and incrementally adding them to the list, then the ProgressDialog dismissing?</p>","277668","","","","","2013-11-17 23:08:51","Android ASync task ProgressDialog isn't showing until background thread finishes","<android><android-asynctask>","5","2","4","",""
"2702785","1","","","2010-04-24 01:04:33","1","9716","<p>I'm having a problem when setting the visibility of two image buttons one on top of the other. The idea is to implement a play/pause control. The problem is that the only part where setting the visibility actually works is in the click listeners of the buttons. If I try to change it somewhere else nothing happens. Any idea why is this happening?</p><pre><code>playBtn.setOnClickListener(new OnClickListener() {//PLAY BUTTON LISTENER    public void onClick(View v) { playBtn.setVisibility(ImageButton.GONE); pauseBtn.setVisibility(ImageButton.VISIBLE); mp.start();    }});pauseBtn.setOnClickListener(new OnClickListener() {//PAUSE BUTTON LISTENER public void onClick(View v) {  pauseBtn.setVisibility(ImageButton.GONE);  playBtn.setVisibility(ImageButton.VISIBLE);  mp.pause(); }});final class SeekBarTask extends TimerTask {  public SeekBarTask(int duration) {  }  @Override  public void run() {   if(seekBar.getProgress() &gt;= mp.getDuration()) {//IF SONG HAS FINISHED...    pauseBtn.setVisibility(ImageButton.GONE);//THESE ONES    playBtn.setVisibility(ImageButton.VISIBLE);//DOESN'T WORK    mp.stop();   }   else {   seekBar.incrementProgressBy(100);   }  } }</code></pre>","324713","","928814","","2013-04-18 09:32:59","2013-08-18 12:47:31","Issue with ImageButton.setVisibility()","<android><imagebutton>","4","1","","",""
"2702860","1","2706123","","2010-04-24 01:39:16","9","10465","<p>Animated GIF images rendered by Android's WebView do not seem to animate.  Has anyone figured out how to make them work? I'm testing on an N1 with 2.1-u1. None of the web settings available seem applicable.</p>","4476","","73488","","2010-10-12 11:30:50","2010-10-12 11:30:50","How to make animated GIFs work from Android WebView","<android><android-widget><animated-gif>","4","0","1","",""
"2703174","1","2710426","","2010-04-24 04:03:42","0","1015","<p>I'm writing an app for Android OS, and I need to store some time values in the SQLite DB. I have been using android.text.format.Time to store the time values in the app, and then inserting the values as millis into the DB as REAL values. On the SDK emulator, everything works perfectly. On the sole phone I've had the opportunity to test my app (so far), my duration code doesn't work as expected. Some relevant code:</p><pre><code>private static final String DATABASE_CREATE =    ""create table "" + DATABASE_TABLE + "" (""     + KEY_ROWID + "" integer primary key autoincrement, ""     + KEY_START + "" REAL, ""     + KEY_STOP + "" REAL, ""     + KEY_DUR + "" REAL );"";</code></pre><p>...  </p><pre><code>private SQLiteDatabase mDb;ContentValues timerValues = new ContentValues();</code></pre><p>...</p><pre><code>timerValues.put(KEY_START, stime.toMillis(false));timerValues.put(KEY_STOP, etime.toMillis(false));timerValues.put(KEY_DURATION, stime.toMillis(false)-etime.toMillis(false));int result = mDb.insert(DATABASE_TABLE, null, timerValues);</code></pre><p>I pull this data from two separate functions with slightly different bits of code, both using Time.set(long millis), both giving incorrect results: The start and stop values come back correct, but the duration comes out 17 hours too large. Am I missing something about calculating durations or does this just seem like there's something ""special"" about this particular droid? I'll have another droid to test on Monday, but any ideas are appreciated.</p>","324755","","","","","2010-08-30 04:01:36","Problem inserting android.text.format.Time.toMillis value into SQLite DB on droid","<android><sqlite><time><duration>","2","1","","",""
"2703202","1","","","2010-04-24 04:16:13","1","776","<p>I have the following errors when i try to access the simple adapter from my program...</p><p>Plz can anyone help me solving the error... Desperate to get it done....</p><p><code>android.widget.SimpleAdapter.getCount(SimpleAdapter.java:95) android.widget.ListView.setAdapter(ListView.java:431) com.stellent.gorinka.MusicListActivity.list(MusicListActivity.java:76) com.stellent.gorinka.MusicListActivity$1.run(MusicListActivity.java:67) android.os.Handler.handleCallback(Handler.java:587) android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) android.os.Handler.handleCallback(Handler.java:587) android.os.Handler.dispatchMessage(Handler.java:92) android.os.Looper.loop(Looper.java:123)</code></p><p>Here' the code for Adapter...</p><pre><code>public class SongsAdapter extends SimpleAdapter{static List&lt;HashMap&lt;String,String&gt;&gt; songsList;Context context;LayoutInflater inflater;public SongsAdapter(Context context,List&lt;HashMap&lt;String,String&gt;&gt; imgListWeb,int layout,String[] from,int[] to,LayoutInflater inflater) {    super(context,songsList,layout,from,to);    this.songsList=songsList;    this.context=context;    this.inflater=inflater;    // TODO Auto-generated constructor stub}@Overridepublic View getView(int postition,View convertView,ViewGroup parent)throws java.lang.OutOfMemoryError{    try {    View v = ((LayoutInflater) inflater).inflate(R.layout.row,null);    ImageView images=(ImageView)v.findViewById(R.id.image);    TextView tvTitle=(TextView)v.findViewById(R.id.text1);    TextView tvAlbum=(TextView)v.findViewById(R.id.text2);    TextView tvArtist=(TextView)v.findViewById(R.id.text3);    HashMap&lt;String,String&gt; songsHash=songsList.get(postition);    String path=songsHash.get(""path"");    String title=songsHash.get(""title"");    String album=songsHash.get(""album"");    String artist=songsHash.get(""artist"");    String imgPath=path;        final ImageView imageView = (ImageView) v.findViewById(R.id.image);    AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv();    Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {        public void imageLoaded(Bitmap imageDrawable, String imageUrl) {            imageView.setImageBitmap(imageDrawable);        }        });    imageView.setImageBitmap(cachedImage);    tvTitle.setText(title);    tvAlbum.setText(album);    tvArtist.setText(artist);    return v;    }    catch(Exception e){        Log.e(""error"",e.toString());    }    return null;}</code></pre><p>And also in my main program the focus is not entering the loop... The implementation in the loop isnt getting executed...Here's the code for it...</p><pre><code>public void list(){      Log.d(""#####"",""#####""); LayoutInflater inflater=getLayoutInflater(); String[] from={}; int[] n={}; adapter=new SongsAdapter(getApplicationContext(),songNodeDet,R.layout.row,from,n,inflater); lv.setAdapter(adapter);}private Handler handler = new Handler() {    public void handleMessage(Message msg){       Log.d(""*****"",""handler"");              removeDialog(0);      p.dismiss();     }    };  public void webObjectList(Object[] imgListObj,String logInSess) throws XMLRPCException{    songNodeWeb = new HashMap&lt;?,?&gt;[imgListObj.length];    if(imgListObj!=null){        Log.e(""completed"",""completed"");        for(int i=0;i&lt;imgListObj.length;i++){ //imgListObj.length        songNodeWeb[i]=(HashMap&lt;?,?&gt;)imgListObj[i];        String nodeid=(String) songNodeWeb[i].get(""nid"");        Log.e(""img"",i+""completed"");        HashMap&lt;String,String&gt; nData=new HashMap&lt;String,String&gt;();        nData.put(""nid"",nodeid);                Object nodeget=client.call(""node.get"",logInSess,nodeid);        HashMap&lt;?,?&gt; imgNode=(HashMap&lt;?,?&gt;)nodeget;        String titleName=(String) imgNode.get(""titles"");        String movieName=(String) imgNode.get(""album"");        String singerName=(String) imgNode.get(""artist"");        nData.put(""titles"", titleName);        nData.put(""album"", movieName);        nData.put(""artist"", singerName);        Object[]  imgObject=(Object[])imgNode.get(""title_format"");        HashMap&lt;?,?&gt;[] imgDetails=new HashMap&lt;?,?&gt;[imgObject.length];        imgDetails[0]=(HashMap&lt;?, ?&gt;)imgObject[0];        String path=(String) imgDetails[0].get(""filepath"");        if(path.contains("" "")){            path=path.replace("" "", ""%20"");        }         String imgPath=""http://www.gorinka.com/""+path;         paths.add(imgPath);        nData.put(""path"", imgPath);        Log.e(""my path"",path);        String mime=(String)imgDetails[0].get(""filemime"");        nData.put(""mime"", mime);        SongsList songs=new SongsList(titleName,movieName,singerName,imgPath,imgPath);        SngList.add(i,songs);        songNodeDet.add(i,nData);    }    Log.e(""paths values"",paths.toString());     //  return imgNodeDet;    handler.sendEmptyMessage(0);}  }    public void getSongs() throws MalformedURLException, XMLRPCException{      String ur=""http://www.gorinka.com/?q=services/xmlrpc"";    URL u=new URL(ur);     client = new XMLRPCClient(u);          //Connecting to the website    HashMap&lt;?, ?&gt; siteConn =(HashMap&lt;?, ?&gt;)  client.call(""system.connect"");    // Getting initial sessio id    String initSess=(String)siteConn.get(""sessid"");    //Login to the site using session id            HashMap&lt;?, ?&gt; logInConn =(HashMap&lt;?, ?&gt;)  client.call(""user.login"",initSess,""prakash"",""stellentsoft2009"");    //Getting Login sessid    logInSess=(String)logInConn.get(""sessid"");    websongListObject =(Object[]) client.call(""nodetype.get"",logInSess,"""");     webObjectList(websongListObject,logInSess);     Log.d(""webObjectList"",""webObjectList"");     runOnUiThread(returnRes);}</code></pre><p>}</p>","303155","","243782","","2010-04-24 19:48:10","2010-04-24 19:48:10","Simple Adapter error","<android>","0","3","","",""
"2703240","1","2705808","","2010-04-24 04:36:00","1","1908","<p>I have Googled my butt off trying to find where if there is a surefire way to make rtsp work.  I have a radio station that I listen to that streams via rtsp.  Of course by default Android doesn't want to play it.  If I pop the URL into yourmuze.fm and create a station there it lets me stream it to my phone.  After checking how it works I come to find that it streams to the phone via rtsp!  So obviously there is something amiss.  What makes one stream work and one not?   This is the stream I am attempting :  rtsp://wms2.christiannetcast.com/yes-fm</p><p>It is an audio stream so I would be thrilled with most peoples problem of ""it only does audio and not video.""  When yourmuze.fm streams, DDMS states it brings up MovieView to play the audio if that helps at all.</p>","246892","","","","","2011-04-18 03:01:30","Android RTSP coding problem","<android><audio-streaming><rtsp>","1","0","","",""
"2703244","1","2703597","","2010-04-24 04:38:27","5","5735","<p>I'm new to Android programming.I've seen different phones with different screen resolutions that run on Android.How can I create an application that works on all android devices with out any distortion in my application views.....</p>","265341","","","","","2011-09-27 04:26:48","Android programming - screen resolution","<android><resolution>","3","0","2","",""
"2703532","1","2707624","","2010-04-24 06:53:47","0","242","<p>Please can anyone tell me what is, and when would it be good to use ""IPC"" ?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-04-25 08:28:20","using IPC under Service","<android>","1","0","","",""
"2703648","1","","","2010-04-24 07:46:51","2","4403","<p>I'd like to refresh the Listview items. These items are populated from SQLite database. My code is below</p><pre><code>public class Weeve extends Activity {      private String[] lv_arr;    protected ListView CView;    private DBAdapter mDbHelper;</code></pre><p>public void onCreate(Bundle savedInstanceState) {</p><pre><code>super.onCreate(savedInstanceState);   mDbHelper = new DBAdapter(this);    mDbHelper.open();    Cursor c = mDbHelper.getAll();    if (c.getCount() &gt; 0)    {if (c.moveToFirst())    {        ArrayList strings = new ArrayList();       do {                              String mC = c.getString(0);          strings.add(mC);         } while (c.moveToNext());       lv_arr = (String[]) strings.toArray(new String[strings.size()]);    }    }      else Toast.makeText(this,            ""No more Records"",            Toast.LENGTH_SHORT).show();    c.close();    ListView CView = new ListView(this);    CView.setAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1, lv_arr));          setContentView(CView);}}</code></pre><p>I'd like to make refreshing this list view after adding, updating or deleting SQLite table. These operations are called by content or option menu. I tried to create these code into a separated function and call it after every operation. But can't. I think setContentView(CView) statement.</p><p>I also tried to use SimpleCursorAdapter like notepad sample from Android.com. I got Thread error. Help me.</p>","305732","","","","","2010-11-22 08:11:00","Android ListView with SQLite","<android><sqlite><listview>","2","0","1","",""
"2703679","1","2704544","","2010-04-24 08:01:37","8","1943","<p>Quite a simple question, Is it possible to notice vibrations in the android emulator?</p>","315998","","","","","2010-04-24 13:06:43","In the android emulator is it possible to notice vibration effects?","<android><android-emulator>","1","0","","",""
"2703833","1","2704308","","2010-04-24 08:56:10","1","2767","<p>I am trying to display an indefinite ProgressDialog, while an AsyncTask binds to a RemoteService.  The RemoteService builds a list of the users contacts when the service is first created.  For a long list of contacts this may take 5~10 seconds.</p><p>The problem I am having, is that the ProgressDialog does not display until after the RemoteService has built it's list of contacts.  I even tried putting a Thread.sleep in to give the ProgressDialog time to show up. With the sleep statement the ProgressDialog loads and starts spinning, but then locks up as soon as the RemoteService starts doing it's work.</p><p>If I just turn the AsyncTask into dummy code, and just let it sleep for a while, everything works fine. But when the task has to do actual work, it is like the UI just sits and waits.   </p><p>Any ideas on what Im doing wrong ?  </p><pre><code>    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Log.d(IM,""Start Me UP!!"");    setContentView(R.layout.main);    Log.d(IM, ""Building List View for Contacts"");    restoreMe();     if (myContacts==null){         myContacts = new ArrayList&lt;Contact&gt;();         this.contactAdapter = new ContactAdapter(this,                                                   R.layout.contactlist,                                                   myContacts);         setListAdapter(this.contactAdapter);         new BindAsync().execute();     }     else{         this.contactAdapter = new ContactAdapter(this,                                                   R.layout.contactlist,                                                   myContacts);         setListAdapter(this.contactAdapter);     }}private class BindAsync extends AsyncTask&lt;Void, Void, RemoteServiceConnection&gt;{    @Override    protected void onPreExecute(){        super.onPreExecute();        Log.d(IM,""Showing Dialog"");        showDialog(DIALOG_CONTACTS);    }    @Override    protected RemoteServiceConnection doInBackground(Void... v) {        Log.d(IM,""Binding to service in BindAsync"");        try{        Thread.sleep(2000);        } catch (InterruptedException e){        }        RemoteServiceConnection myCon;        myCon = new RemoteServiceConnection();        Intent i = new Intent(imandroid.this,MyRemoteService.class);       bindService(i, myCon, Context.BIND_AUTO_CREATE);        startService(i);        Log.d(IM,""Bound to remote service"");        return myCon;    }    @Override    protected void onPostExecute(RemoteServiceConnection newConn){        super.onPostExecute(newConn);        Log.d(IM,""Storing remote connection"");        conn=newConn;    }};</code></pre><p>EDIT: Added onCreateDialog</p><pre><code> protected Dialog onCreateDialog(int id){    switch(id){    case DIALOG_CONTACTS:        ProgressDialog progDialog = new ProgressDialog(imandroid.this);        progDialog.setMessage(""Loading Contacts... Please Wait"");        progDialog.setCancelable(false);        return progDialog;    default:        return super.onCreateDialog(id);    }}</code></pre>","324826","","324826","","2010-04-24 16:33:17","2010-04-24 16:33:17","ProgressDialog does not display until after AsyncTask completes","<android><android-asynctask><progressdialog>","1","2","0","",""
"2703848","1","2704311","","2010-04-24 09:02:02","-1","1538","<p>I have 3 spinners (dropdown menus). I would like the user to select item from the first one and that would determine the options(different string array) on the second and on the third spinner.E.g. user selects the country in the first spinner and then gets popular music groups in that country on the second spinner and popular dishes on the third. What is the easiest way to do this?</p>","324417","","","","","2010-04-24 11:41:05","Android multiple spinners","<android>","1","0","","",""
"2704019","1","2704092","","2010-04-24 09:56:43","0","1648","<p>I want to show or hide some elements (textviews and edittexts) with checkbox. I set their visibility to gone in layout file. Showing them when user checks the box works, but the when user unchecks it, they don't hide. (android 1.5 and 1.6)</p><p>My code:</p><pre><code>cb=(CheckBox)findViewById(R.id.cek);cb.setOnClickListener(new OnClickListener() {  // checkbox listener    public void onClick(View v) {        // Perform action on clicks, depending on whether it's now checked        if (((CheckBox) v).isChecked()) {            tv1.setVisibility(0);  //visible==0            et3.setVisibility(0);        } else if (((CheckBox) v).isChecked() == false) {            tv1.setVisibility(2); //gone=2                  et3.setVisibility(2);        }    }});</code></pre>","324417","","17343","","2010-04-24 10:03:33","2010-04-24 10:24:45","Show/hide views with checkbox","<java><android>","1","0","","",""
"2704084","1","2704264","","2010-04-24 10:23:22","14","14669","<p>Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of ""wrapper"" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.  </p><p>If that is not possible, is there a way to remove the main activity from the stack so that clicking the back button does not take you to a blank UI?Here's an example of what I'm trying to do:</p><pre><code>public class WrapperActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(""tel:555-1212""));        startActivity(intent);    }}</code></pre>","236689","","","","","2013-08-17 23:11:29","How to launch an Activity without a UI?","<android>","7","0","7","",""
"2704497","1","2706098","","2010-04-24 12:45:55","0","213","<p>I am new to android.</p><p>Tell me how to add a button in android. And when we clicks on it it has to do a activity</p>","324903","","324903","","2010-04-24 12:57:17","2010-04-24 20:56:07","how to add a button in android?","<android>","2","3","","",""
"2704925","1","","","2010-04-24 15:11:22","4","1108","<p>I want to be able to control incoming text messages.  My application is still on a ""proof of concept"" version and I'm trying to learn Android programming as I go.</p><p>First my application need to catch incomming text messages.  And if the message is from a known number then deal with it.  If not, then send the message as nothing has happened to the default text message application.</p><p>I have no doubt it can be done, but I still have some concern and I see some pitfalls at how things are done on Android.</p><p>So getting the incomming text message could be fairly easy - except when there are other messaging applications installed and maybe the user wants to have normal text messages to pop up on one of them - and it will, after my application has had a look at it first.</p><p>How to be sure my application get first pick of incomming text messages?</p><p>And after that I need to send most text messages through to any other text message application the user has chosen so the user can actually read the message my application didn't need.</p><p>Since Android uses intents that are relative at best, I don't see how I can enforce my application to get a peek at all incomming text messages, and then stop it or send it through to the default text messaging application...</p>","324943","","324943","","2010-04-24 18:04:02","2010-11-26 11:55:49","How to catch an incomming text message","<android><android-intent>","2","0","1","",""
"2704956","1","2704963","","2010-04-24 15:22:29","12","12742","<p>I've got a problem that I'm rather confused about. I have the following lines of code in my android application:</p><pre><code>System.out.println(CurrentNode.getNodeName().toString());if (CurrentNode.getNodeName().toString() == ""start"") {    System.out.println(""Yes it does!"");} else {    System.out.println(""No it doesnt"");}</code></pre><p>When I look at the output of the first println statement it shows up in LogCat as ""start"" (without the quotes obviously). But then when the if statement executes it goes to the else statement and prints ""No it doesn't"".</p><p>I wondered if the name of the node might have some kind of non-printing character in it, so I've checked the length of the string coming from getNodeName() and it is 5 characters long, as you would expect.</p><p>Has anyone got any idea what's going on here?</p>","1912","","1288","","2012-07-11 15:12:16","2012-07-11 15:12:16","Strings don't seem to be equal in Java on Android, even though they print the same","<java><android><string><equals><equality>","3","0","3","",""
"2705013","1","2705078","","2010-04-24 15:33:48","9","2942","<p>I am trying to understand from the API the purpose of <code>PendingIntent</code>.</p><p>Sometimes some methods I use requires this, I still did not get the idea right.</p><p>Can anyone could explain? why can't i just use context?</p><p>Thanks,</p><p>moshik</p>","273550","","67097","","2013-02-17 22:04:36","2014-02-17 07:22:35","When would you use PendingIntent?","<android>","2","0","3","",""
"2705091","1","2705271","","2010-04-24 15:53:58","0","2084","<p>I'm relatively new to Java and am used to generics in C# so have struggled a bit with this code. Basically I want a generic method for getting a stored Android preference by key and this code, albeit ugly, works for a Boolean but not an Integer, when it blows up with a ClassCastException. Can anyone tell me why this is wrong and maybe help me improve the whole routine (using wildcards?)?</p><pre><code>    public static &lt;T&gt; T getPreference(Class&lt;T&gt; argType, String prefKey, T defaultValue,        SharedPreferences sharedPreferences) {    ...    try {        if (argType == Boolean.class) {            Boolean def = (Boolean) defaultValue;            return argType.cast(sharedPreferences.getBoolean(prefKey, def));        } else if (argType == Integer.class) {            Integer def = (Integer) defaultValue;            return argType.cast(new Integer(sharedPreferences.getInt(prefKey, def)));        } else {            AppGlobal.logWarning(""getPreference: Unknown type '%s' for preference '%s'. Returning default value."",                    argType.getName(), prefKey);            return defaultValue;        }    } catch (ClassCastException e) {        AppGlobal.logError(""Cast exception when reading pref %s. Using default value."", prefKey);        return defaultValue;    }}</code></pre><p>My calling code is:</p><pre><code>        mAccuracy = GlobalPreferences.getPreference(Integer.class, prefKey, mAccuracy, sharedPreferences);</code></pre><p>Here is the Android code for getInt():</p><pre><code>public int getInt(String key, int defValue) {        synchronized (this) {            Integer v = (Integer)mMap.get(key);            return v != null ? v : defValue;        }    }</code></pre><p>I've tried various ways - using the native int, casting to an Integer, but nothing works.</p>","81317","","21234","","2010-06-09 20:41:41","2010-06-09 20:41:41","How do I cast from int to generic type Integer?","<java><android><generics>","3","4","","",""
"2705105","1","","","2010-04-24 15:56:59","5","9541","<p>I have a simple <code>ListView</code> listing results in android. Upon click of each item, I would like it to slide down expand and show the content. Is there an easy way to do this in android?</p><p>Any help will be appreciated.</p>","57847","","810368","","2013-09-16 08:29:41","2013-09-16 08:29:41","Slide expand animation in android","<android><animation><android-listview><expand>","2","0","0","",""
"2705162","1","2707036","","2010-04-24 16:12:46","6","2621","<p>I'm writing an Android application and I would like to place a dialog or view over the home screen so that a user can enter text without jumping into my full application. I can't seem to get this to work. If I present a dialog (even in a transparent activity), my application launches.</p><p>If you don't know what I'm talking about, take a look at the Facebook widget. I want to replicate a similar behavior to the clicking on the ""What's on your mind?"" box.</p><p>Thanks for any help in advance!</p><p>-Brian</p>","253567","","","","","2010-04-25 03:24:50","How do they do it? Dialogs over home screen","<android><text><dialog><android-widget>","3","1","3","",""
"2705347","1","3030933","","2010-04-24 17:02:33","16","18943","<p>Is it possible to define a ListPreference in Xml and retrieve the value from SharedPreferences using getInt? Here is my Xml:</p><pre><code>&lt;ListPreference android:key=""@string/prefGestureAccuracyKey""    android:title=""@string/prefGestureAccuracyTitle"" android:summary=""@string/prefGestureAccuracyDesc""    android:entries=""@array/prefNumberAccuracyLabels"" android:entryValues=""@array/prefNumberAccuracyValues""    android:dialogTitle=""@string/prefGestureAccuracyDialog""    android:persistent=""true"" android:defaultValue=""2""    android:shouldDisableView=""false"" /&gt;</code></pre><p>And I want to get the value with something like: int val = sharedPrefs.getInt(key, defaultValue).</p><p>At the moment I have to use getString and parse the result.</p>","81317","","81317","","2011-06-16 07:37:28","2013-09-23 17:27:13","How to get an Android ListPreference defined in Xml whose values are integers?","<android><android-preferences>","4","3","3","",""
"2705414","1","2705434","","2010-04-24 17:19:56","0","171","<pre><code>Sudoko Android requires .class compatibility set to 5.0. Please fix project properties.</code></pre><p>What this error mean?Please let me know if i need to paste some code..</p>","179855","","","","","2010-04-29 18:55:48","Basic android error (Beginner)","<android>","2","0","","",""
"2705648","1","2705717","","2010-04-24 18:26:53","8","10655","<p>I've read that it's important to call setContentView() early in an activity since it builds the view objects that may be manipulated by subsequent code in onCreate().</p><p>In terms of lifecycle, does the view get drawn to screen as soon as setContentView() is called, or does it allow the onCreate() function to build/populate the information in the view objects, and wait to actually draw it after onCreate() completes?</p><p>Thanks!</p>","325011","","325011","","2010-04-24 18:46:30","2012-12-02 07:02:13","Android setContentView operation","<android><view><activity>","1","0","2","",""
"2705656","1","","","2010-04-24 18:29:27","4","2058","<p>I would like to create a program wich communicates between pc and an android mobile connected to USB via tcp/ip. Is this possible? How can I get the IP-address to a connected mobile from PC or the other way around?</p><p>Any help appreciated </p>","325048","","","","","2010-04-24 18:43:45","Communication PC <-> Android Device","<android>","1","0","","",""
"2706201","1","5398445","","2010-04-24 21:21:24","1","3618","<p>I would like to create a list of Integers in the /res folder of an android project.  However, I want those integers to point resources in /res/raw.  So for example, I would like something like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources&gt;        &lt;integer-array name=""built_in_sounds""&gt;            &lt;item&gt;@raw/sound&lt;/item&gt;    &lt;/integer-array&gt;&lt;/resources&gt;</code></pre><p>But id doesn't look like I can do that, is there any way to do this?  Or should I just create the list in a java class?</p><p>Thank you</p>","288439","","","","","2011-12-27 19:19:50","Creating a list of integers in XML for android","<java><xml><android><arrays><integer>","3","1","","",""
"2706303","1","2706327","","2010-04-24 21:51:09","1","1235","<p>I've developed an Application (called Instant Buttons) and the app has a widget feature. This widget uses PendingIntent for the onClick of the widget.</p><p>My PendingIntent code is something like this:</p><pre><code>    Intent active = new Intent(context, InstantWidget.class);    active.setAction(String.valueOf(appWidgetId));    active.putExtra(""blabla"", blabla); //Some data    PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);    actionPendingIntent.cancel();    actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);    remoteViews.setOnClickPendingIntent(R.id.button, actionPendingIntent);</code></pre><p>The onReceive gets the intent and do some stuff with the MediaPlayer class to reproduce a sound.</p><p>I have reports from some users that the widgets stop working after a while and with some research i've discovered is because the Task Killers. It seems that when you kill the app in the TaskKiller, the PendingIntent is erased from memory, so when you click the widget, it doesn't know what to do.</p><p>Is there any solution for this? Is my code wrong or something or it's the default behavior of the PendingIntent? Is there something I can use to avoid the TaskKiller to stop my widgets from working??</p><p>Greetings.</p>","309853","","","","","2010-04-24 21:57:14","PendingIntent in Widget + TaskKiller","<android><widget><android-widget><android-pendingintent>","1","1","","",""
"2706464","1","2706645","","2010-04-24 22:54:04","5","8496","<p>I am desperately trying to get my head wrapped around how to implement home screen widgets. Right now, I (finally) was able to get a button on my widget respond to a button press setting up an intent filter in the manifest. </p><p>However, I cannot for the life of me figure out how to launch an activity when the button is pressed. Basically, here's the code i have:</p><pre><code> @Override  public void onReceive(Context context, Intent intent)  {       super.onReceive(context, intent);       if(intent.getAction().equals(""com.bic.search.searchWidget.CLICK""))       {            Toast.makeText(context, ""It works!!"", Toast.LENGTH_SHORT).show();       }  } </code></pre><p>What I really want to do, though, is start a new activity, not display a toast message. I know it has something to do with pending intents, but I can't figure out how to get that to work.</p><p>Any help and sample code would be appreciated. Thanks a ton to whoever answers this!</p>","253567","","","","","2014-04-04 08:07:01","How to launch activity from android home screen widget","<android><activity><android-widget><appwidget>","2","0","1","",""
"2706541","1","","","2010-04-24 23:20:27","1","1013","<p>My problem is when I want to refresh data in ExpandableListView while being in that current activity. I create adapter and when I want to add new data to list I call again constructor of that adapter(it is my private variable) with all new data....and then I call onContentChanged() method to redraw my list.But what happens is that I cant expand my list any more...like it is blocked or something and logcat isn't saying anything...This is the code that i call after setting new data in arraylists and maps:</p><pre><code> mAdapter = new MyExpandableListAdapter(                         this,                         groupData,                         R.layout.contact_list_parent,                         new String[] { NAME ,NUM_PHOTOS},//NUM_PHOTOS                        new int[] { R.id.rowText1, R.id.rowText2, R.id.photoAlbumImg },                         childData,                         R.layout.contact_list_child,                         new String[] { NAME,NUM_PHOTOS}, //NUM_PHOTOS                        new int[] { R.id.rowText1, R.id.rowText2, R.id.photoAlbumImg }                 );          this.onContentChanged();</code></pre><p>If anyone knows answer to this question please help me:)Thanks.</p>","278231","","82118","","2010-06-05 16:18:50","2010-06-05 16:18:50","Problem with Refreshing data in ExpandableListView","<android>","0","0","","",""
"2706820","1","2707236","","2010-04-25 01:31:47","0","2504","<p>I am trying to create a drawable in code and change the color based on some criteria. I can get it to work but it doesn't want to let me set the padding on the view. Any help would be appreciated.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""50px""    android:layout_height=""fill_parent""/&gt;&lt;TextView    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""17px""    android:textSize=""28sp""/&gt;</code></pre><p></p><pre><code>            ImageView icon = (ImageView) row.findViewById(R.id.icon);        ShapeDrawable mDrawable;        int x = 0;        int y = 0;        int width = 50;        int height = 50;        float[] outerR = new float[] { 12, 12, 12, 12, 12, 12, 12, 12 };        mDrawable = new ShapeDrawable(new RoundRectShape(outerR, null, null));        mDrawable.setBounds(x, y+height, x + width, y);        switch(position){        case 0:            mDrawable.getPaint().setColor(0xffff0000);      //Red            break;        case 1:            mDrawable.getPaint().setColor(0xffff0000);      //Red            break;        case 2:            mDrawable.getPaint().setColor(0xff00c000);      //Green            break;        case 3:            mDrawable.getPaint().setColor(0xff00c000);      //Green            break;        case 4:            mDrawable.getPaint().setColor(0xff0000ff);      //Blue            break;        case 5:            mDrawable.getPaint().setColor(0xff0000ff);      //Blue            break;        case 6:            mDrawable.getPaint().setColor(0xff696969);      //Gray            break;        case 7:            mDrawable.getPaint().setColor(0xff696969);      //Gray            break;        case 8:            mDrawable.getPaint().setColor(0xffffff00);      //Yellow            break;        case 9:            mDrawable.getPaint().setColor(0xff8b4513);      //Brown            break;        case 10:            mDrawable.getPaint().setColor(0xff8b4513);      //Brown            break;        case 11:            mDrawable.getPaint().setColor(0xff8b4513);      //Brown            break;        case 12:            mDrawable.getPaint().setColor(0xffa020f0);      //Purple            break;        case 13:            mDrawable.getPaint().setColor(0xffff0000);      //Red            break;        case 14:            mDrawable.getPaint().setColor(0xffffd700);      //Gold            break;        case 15:            mDrawable.getPaint().setColor(0xffff6600);      //Orange            break;        }        icon.setBackgroundDrawable(mDrawable);        icon.setPadding(5, 5, 5, 5);</code></pre><p>If I set the padding in XML it just ignores it. </p><p>Thanks, Rob</p>","289153","","","","","2010-04-25 05:22:08","Android Drawable question","<android>","1","0","","",""
"2706913","1","2706944","","2010-04-25 02:25:59","166","111156","<p>I have set a background image in my app, but the background image is small and I want it to be repeated and fill in the whole screen. What should I do?</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:background=""@drawable/bg""    android:tileMode=""repeat""&gt;</code></pre>","238061","","10433","","2013-10-02 06:50:12","2014-03-15 15:20:19","How to make android app's background image repeat","<android><image><layout>","4","0","94","",""
"2707138","1","","","2010-04-25 04:21:40","1","7334","<p>I just noticed something concerning for-loop performance that seems to fly in the face of the recommendations given by the Google Android team. Look at the following code: </p><pre><code>package com.jackcholt;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class Main extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        loopTest();        finish();    }    private void loopTest() {        final long loopCount = 1228800;        final int[] image = new int[8 * 320 * 480];        long start = System.currentTimeMillis();        for (int i = 0; i &lt; (8 * 320 * 480); i++) {            image[i] = i;        }        for (int i = 0; i &lt; (8 * 320 * 480); i++) {            image[i] = i;        }        Log.i(""loopTest"", ""Elapsed time (recompute loop limit): "" + (System.currentTimeMillis() - start));        start = System.currentTimeMillis();        for (int i = 0; i &lt; 1228800; i++) {            image[i] = i;        }        for (int i = 0; i &lt; 1228800; i++) {            image[i] = i;        }        Log.i(""loopTest"", ""Elapsed time (literal loop limit): "" + (System.currentTimeMillis() - start));        start = System.currentTimeMillis();        for (int i = 0; i &lt; loopCount; i++) {            image[i] = i;        }        for (int i = 0; i &lt; loopCount; i++) {            image[i] = i;        }        Log.i(""loopTest"", ""Elapsed time (precompute loop limit): "" + (System.currentTimeMillis() - start));    }}</code></pre><p>When I run this code I get the following output in logcat:</p><pre><code>I/loopTest(  726): Elapsed time (recompute loop limit): 759I/loopTest(  726): Elapsed time (literal loop limit): 755I/loopTest(  726): Elapsed time (precompute loop limit): 1317</code></pre><p>As you can see the code that seems to recompute the loop limit value on every iteration of the loop compares very well to the code that uses a literal value for the loop limit.  However, the code that uses a variable which contains the precomputed value for the loop limit is significantly slower than either of the others.  I'm not surprised that accessing a variable should be slower that using a literal but why does code that looks like it should be using two multiply instructions on every iteration of the loop so comparable in performance to a literal?</p><p>Could it be that because literals are the only thing being multiplied, the Java compiler is optimizing out the multiplication and using a precomputed literal? </p>","284733","","","","","2010-04-25 04:39:10","For-Loop Performance Oddity","<android><for-loop>","1","0","","",""
"2707207","1","","","2010-04-25 04:58:16","0","281","<p>How can I determine if my main/launcher activity has been invoked from the home screen or by backing up the activity stack?</p><p>I display a splash screen and would only like to show it when a user has arrived there from the home screen.</p>","295392","","","","","2010-04-25 11:19:07","Activity: from home screen launch or back from the stack","<android>","1","0","","",""
"2707303","1","2709214","","2010-04-25 05:45:55","0","1404","<p>I have a linear layout in my main.xml which has a listview. Now I want to create a bottom bar below listview. </p><p>Bottombar has a background image and two buttons with their individual background images. I want to put these two buttons on common background image. </p><p>I have read that this can be achieved using FrameLayout. But since I am using LinearLayout as base layout in my main.xml, is there any way to this design using linearlayout ?</p>","248132","","","","","2010-04-25 17:46:32","Android Bottombar with two buttons having different backgrounds and a common background for two buttons","<android>","1","1","1","",""
"2707309","1","2727775","","2010-04-25 05:50:17","6","3145","<p>I'm attempting to port an application that plays chiptunes (NSF, SPC, etc) music files from Java SE to Android. The Android API seems to lack the javax multimedia classes that this application uses to output raw PCM audio. The closest analog I've found in the API is AudioTrack and so I've been wrestling with that.</p><p>However, when I try to run one of my sample music files through my port-in-progress, all I get back is static. My suspicion is that it's the AudioTrack I've setup which is at fault. I've tried various different constructors but it all just outputs static in the end.</p><p>The DataLine setup in the original code is something like:</p><pre><code>AudioFormat audioFormat = new AudioFormat( AudioFormat.Encoding.PCM_SIGNED,                44100, 16, 2, 4, 44100, true );DataLine.Info lineInfo = new DataLine.Info( SourceDataLine.class, audioFormat );DataLine line = (SourceDataLine)AudioSystem.getLine( lineInfo );</code></pre><p>The constructor I'm using right now is:</p><pre><code>AudioTrack = new AudioTrack( AudioManager.STREAM_MUSIC,        44100,        AudioFormat.CHANNEL_CONFIGURATION_STEREO,        AudioFormat.ENCODING_PCM_16BIT,        AudioTrack.getMinBufferSize( 44100,                AudioFormat.CHANNEL_CONFIGURATION_STEREO,                AudioFormat.ENCODING_PCM_16BIT ),        AudioTrack.MODE_STREAM );</code></pre><p>I've replaced constants and variables in those so they make sense as concisely as possible, but my basic question is if there are any obvious problems in the assumptions I made when going from one format to the other.</p>","226075","","","","","2013-05-02 15:02:06","Difficulty porting raw PCM output code from Java to Android AudioTrack API","<java><android><audio><pcm>","1","2","3","",""
"2707370","1","2708053","","2010-04-25 06:23:04","5","8823","<p>I'm running into an IllegalStateException updating an underlying List to an Adapter (might be an ArrayAdapter or an extension of BaseAdapter, I don't remember). I do not have or remember the text of the exception at the moment, but it says something to the effect of the List's content changing without the Adapter having been notified of the change.</p><p>This List /may/ be updated from another thread other than the UI thread (main). After I update this list (adding an item), I call notifyDataSetChanged. The issue seems to be that the Adapter, or ListView attached to the Adapter attempts to update itself before this method is invoked. When this happens, the IllegalStateException is thrown.</p><p>If I set the ListView's visibility to GONE before the update, then VISIBLE again, no error occurs. But this isn't always practical.</p><p>I read somewhere that you cannot modify the underlying this from another thread--this would seem to limit an MVC pattern, as with this particular List, I want to add items from different threads. I assumed that as long as I called notifyDataSetChanged() I'd be safe--that the Adapter didn't revisit the underlying List until this method was invoked but this doesn't seem to be the case.</p><p>I suppose what I'm asking is, can it be safe to update the underlying List from threads other than the UI? Additionally, if I want to modify the data within an Adapter, do I modify the underlying List or the Adapter itself (via its add(), etc. methods). Modifying the data through the Adapter seems wrong.</p><p>I came across a thread on another site from someone who seems to be having a similar problem to mine: <a href=""http://osdir.com/ml/Android-Developers/2010-04/msg01199.html"">http://osdir.com/ml/Android-Developers/2010-04/msg01199.html</a> (this is from where I grabbed the Visibility.GONE and .VISIBLE idea).</p><p>To give you a better idea of my particular problem, I'll describe a bit of how my List, Adapter, etc. are set up.</p><p>I've an object named Queue that contains a LinkedList. Queue extends Observable, and when things are added to its internal list through its methods, I call setChanged() and notifyListeners(). This Queue object can have items added or removed from any number of threads.</p><p>I have a single ""queue view"" Activity that contains an Adapter. This Activity, in its onCreate() method, registers an Observer listener to my Queue object. In the Observer's update() method I call notifyDataSetChanged() on the Adapter.</p><p>I added a lot of log output and determined that when this IllegalStateExcption occurs that my Observer callback was never invoked. So it's as if the Adapter noticed the List's change before the Observer had a chance to notify its Observers, and call my method to notify the Adapter that the contents had changed.</p><p>So I suppose what I'm asking is, is this a good way to rig-up an Adapter? Is this a problem because I'm updating the Adapter's contents from a thread other than the UI thread? If this is the case, I may have a solution in mind (give the Queue object a Handler to the UI thread when it's created, and make all List modifications using that Handler, but this seems improper).</p><p>I realize that this is a very open-ended post, but I'm a bit lost on this and would appreciate any comments on what I've written.</p>","300368","","","","","2011-02-13 19:00:47","What's the best-practice way to update an Adapter's underlying data?","<android>","2","0","2","",""
"2707448","1","","","2010-04-25 07:04:16","5","1131","<p>I have a <code>TabActivity</code> with four tabs (each is its own Activity). Each tab defines its own <code>onCreateOptionsMenu</code> (and in some cases, <code>onPrepareOptionsMenu</code>). When each tab is loaded, an <code>AsyncTask</code> is kicked off to retrieve the data needed to populate that tab's list.</p><p>If I switch between tabs very quickly (while they're still loading) and then press the menu button (while the current tab's <code>AsyncApiTask</code> is still running), I'm able to get the wrong options menu to appear.</p><p>For example, let's say <code>FooActivity</code> (tab 1) has an options menu with a ""Refresh"" item, and <code>BarActivity</code> (tab 2) has an options menu with a ""View All"" item. If I start the app (with tab 1 active), quickly switch to tab 2, and then hit menu, the ""Refresh"" item (rather than the expected ""View All"" item) will sometimes show.</p><p>Furthermore, while this weird behavior sometimes occurs just on the first menu press (and later presses show the right items), sometimes it gets ""stuck"", and the wrong items show up on every press until I switch tabs.</p><p>Any idea what could be going on? I haven't heard of this happening before, and haven't been able to find any good suggestions.</p>","96514","","","","","2013-09-17 20:16:53","Strange options menu behavior in Android TabActivity","<android><android-asynctask><android-tabhost><tabwidget><options-menu>","1","2","","",""
"2707501","1","","","2010-04-25 07:26:00","2","9878","<p>Hi I'm new to Android and web service development!currently I'm working in developing Android program that will send longitude and latitude information to asp.net website (to show the location change the website map)the questions are - how to send this data to the website (the best practice)!- any suggestions for a suitable framework starting from the android application itself , inserting to database , client/server connection !!</p><p>I've read a lot about web services specially REST ..but didn't find tutorials</p><p>Appreciate your kind help..</p>","325296","","","","","2012-02-05 10:14:53","How to send GPS data from android to a website?","<android><google-maps><web-services><client-server><gps>","1","2","1","",""
"2708050","1","","","2010-04-25 11:36:52","0","119","<p>I was reading on how Activities communicate and how the calls stack up on top of each other. But at any instant when the OS(or dalvik) is low on resources, it can choose to kill Paused or Stopped Activities. In this scenario, how do we restore previous state of the activity(in which it was before getting killed) when we reach the same activity on our way back.</p><p>Does stack store the state as well as references to the Activity? Aren't their chances of achieving a different state when we re-constuct activity (onCreate)?</p>","325356","","","","","2010-04-25 12:56:59","How Android retrieves info of the Stacked Activities which are killed when memory goes low","<android>","1","0","","",""
"2708084","1","2708161","","2010-04-25 11:51:10","2","702","<p>Is it possible to know if the phone has been touched/moved (lifting it for example), using some Events?<br>How would you code it?</p>","130929","","130929","","2011-04-16 12:03:42","2011-04-16 12:03:42","How to detect if an Android device has been touched or moved ","<android><device>","1","0","","",""
"2708128","1","2708394","","2010-04-25 12:07:06","31","13242","<p>I'm developing an app for Android 2.1 upwards.  I want to enable my users to select a profile picture within my app (I'm not using the contacts framework). </p><p>The ideal solution would be to fire an intent that enables the user to select an image from the gallery, but if an appropriate image is not available then use the camera to take a picture (or vice-versa i.e. allow user to take picture but if they know they already have a suitable image already, let them drop into the gallery and pick said image).</p><p>Currently I can do one or the other but not both.</p><p>If I go directly into camera mode using MediaStore.ACTION_IMAGE_CAPTURE then there is no option to drop into the gallery.  </p><p>If I go directly to the gallery using Intent.ACTION_PICK then I can pick an image but if I click the camera button (in top right hand corner of gallery) then a new camera intent is fired. So, any picture that is taken is not returned directly to my application. (Sure you can press the back button to drop back into the gallery and select image from there but this is an extra unnecessary step and is not at all intuitive).</p><p>So is there a way to combine both or am I going to have to offer a menu to do one or the other from within my application?  Seems like it would be a common use case...surely I'm missing something?</p>","227228","","","","","2014-03-25 11:37:12","Single intent to let user take picture OR pick image from gallery in Android","<android><image><camera><android-intent><gallery>","2","0","25","",""
"2708189","1","2708406","","2010-04-25 12:26:18","2","3309","<p>I'm stuck on a problem and if possible I will need help from the community. I'm not looking for a ready-made solution, but something which would help me to produce the result.</p><p>I'm looking for a way to produce a dynamic activity based on a JSONArray object.Here an example of a JSONArray object:</p><pre><code>[ { ""name"": ""my checkbox name"",    ""type"": ""checkbox"",    ""value"": ""one,two,three""  }  { ""name"": ""my edit text"",    ""type"": ""text"",    ""value"": """"  }  ...]</code></pre><p>This JSONArray could be totally random. It could have 2 text views, 3 select menus, 1 text view and so on.</p><p>The goal is to iterate over this JSONArray and create the appropriate elements within my android code.</p><p>To produce the result I've thought of a simple switch which would render one by one my different JSONArray to an android widget.</p><p>But after that how could I have access of every property of every widget rendered?</p><p>Edit: I need as well to assign an event listener on some widget as taking the GPS coordinated...</p><p>Thank you.</p><p><em>Edit: this is a JSONArray not a JSONObject...</em></p>","155144","","155144","","2010-06-01 14:22:56","2010-06-01 14:22:56","Create dynamic view with android","<android><json><activity><widget>","1","0","","",""
"2708392","1","2718193","","2010-04-25 13:34:28","10","2993","<p>I've followed the <a href=""http://developer.android.com/reference/android/app/SearchManager.html"">SearchManager</a> documentation yet am still having trouble making one of my app's activities searchable. From my activity, the Search dialog appears, I enter a query, hit search, my activity reopens, then I see this in the log:</p><pre><code>D/SearchDialog(  584): launching Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) }I/SearchDialog(  584): Starting (as ourselves) #Intent;action=android.intent.action.SEARCH;launchFlags=0x10000000;component=com.clinkybot.geodroid2/.views.Waypoints;S.user_query=sdaf;S.query=sdaf;endI/ActivityManager(  584): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) }D/WAYPOINTS( 1018): NI Intent { cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) }D/WAYPOINTS( 1018): NI nullD/WAYPOINTS( 1018): NI false </code></pre><p>It appears to me that everything is fine up until the last three lines. The ""NI"" lines are <code>getIntent().toString(), getIntent().getAction()</code>, and <code>getIntent().hasExtra(SearchManager.QUERY)</code> respectively.</p><p>ActivityManager appears to be starting my activity with the correct action. Then when my activity starts, it contains no action!? What am I doing wrong?</p><p>The relevant portion of my manifest is:</p><pre><code>&lt;activity android:name="".views.Waypoints"" android:label=""Waypoints"" android:launchMode=""singleTop""&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>","175307","","76835","","2010-04-26 03:27:10","2012-06-20 00:16:02","Why is my searchable activity's Intent.getAction() null?","<android><search><action><android-intent>","1","0","5","",""
"2708528","1","2708772","","2010-04-25 14:25:16","6","5341","<p>I would like to change the Orange border around a <code>EditText</code>. Like when the input is valid, I want it to become green.</p><p><img src=""http://developer.android.com/guide/tutorials/views/images/hello-relativelayout.png"" alt=""alt text""></p><p>However I do not seem to find a method to do this. Is it possible?</p>","107029","","","","","2010-04-26 09:40:17","Android: Is it possible to dynamically change the border color of a EditText?","<android><border><edittext>","1","0","4","",""
"2708771","1","","","2010-04-25 15:39:05","5","3171","<p>I am having a hard time understanding how to change the width of columns when creating a table view.</p><p>I know you can set the width in pixels of a column but that is not what I want to do.</p><p>Say, for instance, I have 2 columns and want each column to take up half the screen. How do I do this without explicitly setting the pixels, so that my code can work on multiple screen sizes?</p>","325434","","","","","2010-04-25 16:36:55","Setting column width in Table View","<android>","1","0","0","",""
"2708915","1","2709153","","2010-04-25 16:25:26","1","2740","<p>I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash. From com.gtosoft.dash I would like to start up the service which is defined in com.gtosoft.voyager...</p><p>I think I need an intent, but what arg(s) would I pass to the intent before kicking it off with startService()? </p><p>If they were in the same package I could just use </p><pre><code>Intent svc=new Intent (SettingsActivity.this,VoyagerService.class);startService(svc);</code></pre><p>Snippet of Manifest which defines the service</p><pre><code>&lt;application android:icon=""@drawable/voyagercarlogo"" android:label=""@string/app_name"" android:debuggable=""false""&gt;    &lt;provider android:name=""com.gtosoft.voyager.VoyagerCProvider""         android:authorities=""com.gtosoft.voyager""/&gt;    &lt;service android:name="".VoyagerService""/&gt;    &lt;activity android:name="".SettingsActivity""             android:label=""Voyager""            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;</code></pre>","268803","","","","","2010-12-05 23:59:22","How do I start a service which is defined in a different package?","<android><service><android-intent>","2","2","","",""
"2709057","1","2821662","","2010-04-25 17:03:16","0","3515","<p>In Android I can get phone numbers of all the contacts without any problem. </p><p>The problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included.</p><p>For example, if the user lives in US and he has 2 contacts: </p><ol><li><p>John - 555-123-1234   (local) (starting 1 not showing)</p></li><li><p>Jane - 44-123456787   (england phone number)</p></li></ol><p>The question is:  How do I get all the numbers in an international format, when some of the numbers doesnt include the country code?Any way to figure that out?</p>","237115","","92837","","2011-09-13 11:21:37","2011-09-13 11:21:37","Phone number contact format in Android","<android><formatting>","2","0","","",""
"2709087","1","2709109","","2010-04-25 17:10:28","45","35788","<p>I have a string, 'songchoice' I want it to become a 'Uri' so I can use with MediaPlayer.create(context, Uri)</p><p>Can someone help me to convert songchoice to the Uri?</p><p>Thanks,</p><p>James</p>","321763","","","","","2014-01-01 10:53:24","Turning a string into a Uri... (Android)","<java><android><uri>","1","0","8","",""
"2709107","1","","","2010-04-25 17:15:25","2","824","<p>I have made android app. my client ask me that change default language at soft keyboard case by case. one case, keyboard should be English keyboard, another, Korean keyboard.</p><p>how can i do?</p><p>thx.</p>","297060","","","","","2011-05-12 07:35:24","how do i change android soft keyboard's default language?","<android>","1","2","","",""
"2709161","1","2709172","","2010-04-25 17:31:44","1","9194","<p>I have an object variable <code>Object test = Spinner.getSelectedItem();</code>-It gets the selected item from the Spinner (called spinner) and names the item 'test'</p><p>I want to do an if statement related to that object e.g:</p><pre><code>'if (test = ""hello"") {//do something}'</code></pre><p>But it appears not to work....</p><p>Can someone give me some help?-Do I have to use a different if? or convert the object to string etc.?</p><p>Thanks alot...</p><p>James</p>","321763","","157882","","2010-05-09 05:13:50","2013-10-19 01:52:51","Using an object in an if statement... (Android)","<java><android><object><if-statement>","4","0","1","",""
"2709175","1","","","2010-04-25 17:37:10","0","2081","<p>I'm and android beginner, so go easy on me ;-)</p><p>I'm trying to play a sequence of video files which I'm downloading from a server.The challenge is that I want to have a smooth transition from one file to another.</p><p>My thought is to have two MediaPlayer instances each preparing and then playing in turn. It is not clear to me if they can both share the same SurfaceView?Or maybe, I should be using different views and swapping between them?Or, the idea is a bad idea all together?</p><p>When I try to run configure the MediaPlayer instance with a view that isn't visible it seems to crash my emulator.</p>","4697","","","","","2013-02-12 05:45:38","Does android support playlists for video files?","<android><android-video-player>","2","2","1","",""
"2709253","1","2709269","","2010-04-25 17:57:55","47","155259","<p>How do I convert a string into an integer?</p><p>I have a textbox I have the user enter a number into:</p><pre><code>     EditText et = (EditText) findViewById(R.id.entry1);     String hello = et.getText().toString();</code></pre><p>And the value is assigned to the string <code>hello</code>.</p><p>I want to convert it to a integer so I can get the number they typed; it will be used later on in code.</p><p>Is there a way to get the <code>EditText</code> to a integer? That would skip the middle man. If not, string to integer will be just fine.</p>","321763","","29995","","2013-01-05 19:45:31","2014-03-15 13:47:19","Converting a string to an integer on Android","<java><android><string><integer><edittext>","6","2","15","",""
"2709488","1","3201242","","2010-04-25 19:02:48","1","760","<p>I know you can 'seekto()' with Mediaplayer... (To start at a certain point)</p><p>But does anyone know if there is a way to make a track (the audio playing)... Stop at a certain point?-or would an if statement on a timer loop have to be used?</p><p>Please help...</p><p>Thanks alot,</p><p>James</p>","321763","","","","","2010-07-08 06:46:17","Stopping a track (At a certain point) on Android","<java><android><audio><stop>","3","0","","",""
"2709496","1","2803989","","2010-04-25 19:05:52","1","105","<p>I am trying to create a simple Icon+Text ListView but it does not work.I am using 2.1 Android SDK.</p><p>My main class is very small slightly modified from the tutorial:</p><pre><code>public class Stuffs extends ListActivity {    static final String[] COUNTRIES = new String[] {""A"", ""B"",""C""};    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.title, COUNTRIES));    }}</code></pre><p>and my list_item.xml file is 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:orientation = ""horizontal""&gt;    &lt;ImageView        android:id = ""@+id/icon""                android:src=""@drawable/icon"" /&gt;    &lt;TextView               android:id = ""@+id/title""        android:padding=""10dp""        android:textSize=""16sp"" &gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I have also created a ""drawable"" directory in my res directory and copied a ""icon.png"" into it.</p><p>But any time I try to run this the application hangs up unexpected in my android emulator.Am I missing something?</p>","74865","","","","","2010-05-25 11:17:48","ListView exception for Images + Text","<java><android>","1","3","","",""
"2709602","1","2709693","","2010-04-25 19:34:00","0","443","<p>I want to add a feature into my app where you can record sound and then use it within the app (MediaPlayer)</p><p>How can I do this?</p><p>-First, how do I record sound?-Second, how do I get it into a Mediaplayer? -Does it have to be saved? or can it go from being recorded -> into app straight away...</p><p>Please help,</p><p>Thanks alot...</p><p>James</p>","321763","","","","","2010-04-26 06:42:31","Recording sound, -and then using/saving it... (On android)","<java><android><audio><media-player><recording>","2","0","","",""
"2709850","1","","","2010-04-25 20:29:34","3","814","<p>New to android. Running Eclipse on Ubuntu 9.10 with Android SDK plugin installed and working. Trying to get some code samples from <a href=""http://developer.android.com/resources/samples/get.html"" rel=""nofollow"">http://developer.android.com/resources/samples/get.html</a> , and following its procedure to load said samples in Eclipse yields:</p><pre><code>Parent of resource: /home/user/android-sdk/platforms/android-4/samples/Notepad/.project is marked as read-only.</code></pre><p>chmod is not recursive, so I entered ~/android-sdk/platforms and ""chmod 777 *"" ie. all folders in /platforms. Still doesnt work. Appears to be be a bug in Eclipse that wants to create the project in the SDK folder rather than under ~/workspace. </p>","325549","","","","","2013-05-08 19:15:09","Getting started with Android code samples - permissions error","<android>","3","0","","",""
"2709864","1","2769981","","2010-04-25 20:34:29","4","3369","<p>When debugging a link error (<code>undefined reference to _dso_handle</code>) using the Android x86 toolchain, I noticed it's statically linking <code>crtbegin_dynamic.o</code>. What is the purpose of this file? There is another similar <code>crtbegin.o</code> in the toolchain install directory that contains the missing symbol (_dso_handle). What is the difference between crtbegin.o and crtbegin_dynamic.o?</p>","204317","","149841","","2011-08-01 17:52:22","2012-10-04 09:53:42","What is crtbegin.o and crtbegin_dynamic.o?","<android><c><linux><gcc><android-ndk>","2","0","","",""
"2709868","1","2711102","","2010-04-25 20:35:44","0","941","<p>I have a tabbed interface (one activity per tab) where one tab will be a browser view displaying a webpage. The application loads in a different activity / view, but I want it to begin to download the webpage in the background as soon as the app launches, before the user ever clicks on that tab and initiates that activity.</p><p>How can I do this?</p><p>Thanks!</p><p>-S</p>","325011","","325011","","2010-04-26 04:04:12","2010-04-26 04:04:33","Loading a Browser Page in the Background","<android><browser><download><tabs>","2","0","","",""
"2709888","1","2709959","","2010-04-25 20:43:44","1","2642","<h2><em><strong>EDIT: SORRY!</em></strong></h2><p>Turns out that I'm an idiot. The exception was being thrown from another call to r.nextInt() which was taking an uninitialized variable as an argument! Foot is very much in mouth.</p><p>I'm really not sure what else to say about this:</p><pre><code>Random r = new Random();class SomeClass {   public SomeClass(){       new SomeClass(r.nextInt(5));   }   public SomeClass(int i){   ...</code></pre><p>Throws a <code>NullPointerException</code> where r.nextInt(5) is called. Any ideas?</p>","209838","","209838","","2010-04-25 21:08:35","2010-04-25 21:11:21","Random.nextInt(5) throws an IllegalArgumentException","<java><android><exception>","5","5","1","2010-04-27 14:05:12",""
"2709927","1","","","2010-04-25 20:56:13","3","1437","<p>In my android application I have the following code:</p><pre><code>Notification notification = new Notification(icon, tickerText, when);        context = context.getApplicationContext();        CharSequence contentTitle = ""UK Radio Guide"";        CharSequence contentText = title + "" on "" + channel_id + "" at "" + start;        Intent notificationIntent = new Intent(context, ViewSchedules.class);        PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        notification.ledARGB = 0xff00ff00;        notification.ledOnMS = 300;        notification.ledOffMS = 1000;        notification.flags |= Notification.FLAG_SHOW_LIGHTS;        notification.sound = Uri.parse(""android.resource://com.robinwilson.radioguide/"" +R.raw.chimes);        notification.vibrate = new long[] { 0, 300, 200, 300, 400, 300 };        // Actually send the notification        nm.notify(0, notification);</code></pre><p>As far as I am aware, I have followed the steps in the documentation to set it to play a sound from the resources folder, and to flash the lights. However, neither of these happen. It does, however, vibrate, as instructed.</p><p>Any ideas what I'm doing wrong here? I've looked through the permissions that I can give the app in the AndroidManifest.xml file, but I can't see one for letting it flash the light or make sounds.</p>","1912","","","","","2010-04-26 05:00:50","Notification doesn't play sound or show lights even though set to","<java><android><audio><notifications>","1","0","1","",""
"2710137","1","2713748","","2010-04-25 21:56:30","5","2976","<p>I'm having some trouble with GSON, mainly deserializing from JSON to a POJO. </p><p>I have the following JSON: </p><pre><code>{    ""events"":     [        {            ""event"":             {                ""id"": 628374485,                 ""title"": ""Developing for the Windows Phone""            }        },        {            ""event"":             {                ""id"": 765432,                 ""title"": ""Film Makers Meeting""            }        }    ]}</code></pre><p>With the following POJO's ... </p><pre><code>public class EventSearchResult {    private List&lt;EventSearchEvent&gt; events;     public List&lt;EventSearchEvent&gt; getEvents() {        return events;    }}public class EventSearchEvent {    private int id;     private String title;    public int getId() {        return id;    }    public String getTitle() {        return title;    }}</code></pre><p>... and I'm deserializing with the following code, where json input is the json above</p><pre><code>Gson gson = new Gson();return gson.fromJson(jsonInput, EventSearchResult.class);   </code></pre><p>However, I cannot get the list of events to populate correctly. The title and id are always null. I'm sure I'm missing something, but I'm not sure what. Any idea? </p><p>Thanks</p>","5210","","","","","2010-04-26 13:25:30","Parsing JSON with GSON","<android><json><gson>","1","0","2","",""
"2710145","1","","","2010-04-25 21:58:45","3","966","<p>Is there any way to make DatePickerDialog not dismiss after clicking set button ?</p>","325577","","","","","2010-10-28 06:39:48","android DatePickerDialog","<android>","2","0","","",""
"2710353","1","","","2010-04-25 23:17:48","3","1159","<p>When you attach a file to an e-mail using the ACTION_SEND intent (with the extra EXTRA_STREAM) does the e-mail app copy that attached file to its own location? My app creates a file and attaches it to an email, but this can happen many times and I would like to be able to delete this file when it is no longer needed (so it doesn't flood the user's storage with junk data). Is the file safe to delete after the e-mail intent has started?</p>","325597","","","","","2011-09-27 17:51:18","Android ACTION_SEND Attached File","<android><email><file><attachment>","2","0","","",""
"2710469","1","2713551","","2010-04-26 00:09:06","1","6201","<p>Anything to help design GUI like a paint program? (Delphi, VB, MSVC, QtBuilder, etc)</p><p>And anything to help build packages, set permissions, etc?</p><p>What is there out there to take the drudge work out of Android app creation and leave me free to concentrate on design and development? </p>","192910","","","","","2012-11-27 18:08:17","Is there a RAD for Android?","<android>","5","0","1","",""
"2710470","1","2710596","","2010-04-26 00:09:08","15","9830","<p>The first Activity that loads in my application is an initialization activity, and once complete it loads a new Activity. I want to ensure if the user presses 'Back' they go straight to the Launcher, and not the initialization screen. <em>Side note, is this even the best approach, or would this be better done with some kind of Intent Flag?</em></p><p>Is it correct to call <em>finish()</em> after calling <em>startActivity()</em> on the new activity?</p><pre><code>onCreate() {...startActivity(new Intent(this, NextActivity.class));finish();...}</code></pre><p>I'm still taking in the whole 'Message Queue' method of doing things in Android, and my assumption is that calling <em>startActivity()</em> and then <em>finish()</em> from my first Activity's <em>onCreate()</em> will log each respective message in the message queue, but finish execution of <em>onCreate()</em> before moving on to starting the next Activity and finishing my first one.  Is this a correct understanding?</p>","325011","","","","","2010-04-26 00:59:41","Calling finish() After Starting a New Activity","<android><activity><message-queue>","1","1","5","",""
"2710499","1","2710529","","2010-04-26 00:19:09","57","37227","<p>Is it possible to develop using the Android SDK on a 64-bit linux machine. The available SDK downloads seem to be just for 32-bit versions of Linux. </p>","134397","","","","","2014-01-25 15:46:07","Android SDK on a 64-bit linux machine","<linux><android><64bit>","12","0","26","",""
"2710526","1","2710590","","2010-04-26 00:26:35","1","263","<p>While researching how to create custom compound views in Android, I have come across this pattern a lot (example comes from the <a href=""http://blog.orange11.nl/2009/10/08/exploring-the-world-of-android-part-3/"" rel=""nofollow"">Orange11 blog</a>) :</p><pre><code>public class FirstTab extends LinearLayout {private ImageView imageView;private TextView textView;private TextView anotherTextView;public FirstTab(Context context, AttributeSet attributeSet) {    super(context, attributeSet);    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    inflater.inflate(R.layout.firstTab, this);}</code></pre><p>}</p><p>I mostly understand how this is working, except for the part where inflate() is called.  The documentation says that this method returns a View object, but in this example the author does not store the result anywhere.  After inflation, how is the new View created fromt eh XML associated with this class? I thought about assigning it to ""this"", but that seems very wrong.  </p><p>thanks for any clarification.</p>","202431","","633239","","2012-05-02 11:38:36","2012-05-02 11:38:36","keeping references to inflated custom views","<android><views>","1","0","1","",""
"2710666","1","2712718","","2010-04-26 01:32:15","1","8609","<p>I have this XML code which generates a button, a textview and another button, How do I go about getting the button to appear in far left, the textview in the center and the last button on the far right?</p><pre><code>&lt; ?xml version=""1.0"" encoding=""utf-8""?&gt;  </code></pre><p>&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""></p><pre><code>          &lt;Button android:id=""@+id/Button01""                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""                   android:text=""Cancel""&gt;          &lt;/Button&gt;          &lt;TextView android:id=""@+id/TextView01""                     android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                     android:text=""New Place""&gt;          &lt;/TextView&gt;          &lt;Button android:id=""@+id/Button03""                   android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""                  android:text=""Save""&gt;          &lt;/Button&gt;</code></pre><p></p>","325634","","","","","2010-05-26 19:16:24","Android XML - how to get items aligned far left, center, and far right","<xml><android><layout><alignment>","2","0","1","",""
"2710793","1","2713323","","2010-04-26 02:24:05","59","30735","<p>I'm using a TableLayout in Android. Right now I have one TableRow with two items in it, and, below that, a TableRow with one item it it. It renders like this: </p><pre><code>-----------------------------|   Cell 1    |  Cell 2     |-----------------------------|   Cell 3    |---------------</code></pre><p>What I want to do is make Cell 3 stretch across both upper cells, so it looks like this:</p><pre><code>-----------------------------|   Cell 1    |  Cell 2     |-----------------------------|           Cell 3          |-----------------------------</code></pre><p>In HTML I'd use a COLSPAN.... how do I make this work in Android?</p>","73371","","","","","2014-03-01 12:28:11","What is the equivalent of ""colspan"" in an Android TableLayout?","<android>","6","1","12","",""
"2710871","1","","","2010-04-26 02:47:47","0","595","<p>I'm finally ready to upload my Android app to the market. I didn't create a fancy icon like it shows at the android developer site. I just made an image that I liked and made it 48x48 png. Will that be ok?</p>","237863","","","","","2010-04-26 05:33:06","Android: Can any launch icon be used, as long as it's 48x48 png?","<android>","1","2","","",""
"2710950","1","","","2010-04-26 03:13:46","0","1093","<p>Hi i<code>m trying to use Remote Service btween two simple application, But it</code>s not easy to me. So any advice you have will help me. </p><p>here`s my case. </p><p>I made one app which is playing Music in service, There are two components. one is Activity controlling service by using three buttons, play,pause, stop. and it is working fine. </p><p>and another one is just simple Activity which also has four buttons bind,play,stop,unbind. when i click bind, it`s confirmed by Toast msg, but when i click play button,it occurs error. </p><p>i want to control first activity<code>s Music playing service in second Activity. So i</code>m trying to use remote service. i made same .aidl file in each app project. In aidl file, i defined methods  ""playing"",""stoping"" and i implement those methods in Music service class, implementation is simply use intent and startService &amp; stopService. </p><p>In DDMS there is ""java.lang.SecurityException : Binder invocation to an incorrect interface"" that<code>s the case  what i</code>m doing. </p><p>So please tell me what`s the problem. any advice could help me. thanks Gun. </p>","325669","","","","","2010-04-26 11:28:19","how to use Remote Service?","<android><service>","1","0","","",""
"2711092","1","2711123","","2010-04-26 04:01:08","2","222","<p>I have a hobby project, which is basically to maintain 'todo' tasks in the way I like.One task can be described as:</p><pre><code>public class TodoItem {    private String subject;    private Date dueBy;    private Date startBy;    private Priority priority;    private String category;    private Status status;    private String notes;}</code></pre><p>As you can imagine I would have 1000s of todo items at a given time. </p><ul><li>What is the best strategy to store atodo item? (currently on an XML file)such that all the items are loadedquickly up on app start up(theapplication shows kind of a dashboardof all the items at start up)?</li><li>What is the best way to design itsback-end so that it can be ported toAndroid/or a J2ME based phone?</li><li>Currently this is done using JavaSwing. What should I concentrate on sothat it works efficiently on a devicewhere memory is limited?</li><li>The application throws open a formto enter new todo task. For now, Iwould like to save the newly addedtask to my-todos.xml once the userpresses ""save"" button. What are thecommon ways to append such a changeto an existing XML file?(note that I don't want to read the whole file again and then persist)</li></ul>","212211","","212211","","2010-04-26 04:09:45","2010-04-26 15:40:55","Java application design question","<java><android><design><swing><backend>","4","1","","",""
"2711143","1","2713036","","2010-04-26 04:22:33","2","1259","<p>I've singled out my problem to a few lines of code</p><pre><code>lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 5.0f, this);lat = location.getLatitude();lng = location.getLongitude();//lat = new Double(40.431682);//lng = new Double(-74.2021819);pLocation = new GeoPoint((int)(lat * 1000000), (int)(lng * 1000000));</code></pre><p>My onLocationChanged if you were wondering</p><pre><code>public void onLocationChanged(Location location) {        if (location != null) {        lat = location.getLatitude();        lng = location.getLongitude();        pLocation = new GeoPoint((int)(lat * 1000000), (int)(lng * 1000000));        }}</code></pre><p>My application crashes if I try to get the LastKnownLocation</p><p>But it works fine if I feed it a Location manually</p><p>I have no idea currently whats wrong</p>","106697","","","","","2010-05-25 19:09:05","Android Location Error","<java><android><gps><location><locationmanager>","4","0","","",""
"2711183","1","2713040","","2010-04-26 04:39:02","24","4194","<p>In the <a href=""http://developer.android.com/reference/android/os/AsyncTask.html"" rel=""nofollow"">documentation on AsyncTask</a> it gives the following as a rule related to threading:</p><blockquote>  <ul>  <li>The task can be executed only once (an exception will be thrown if a second execution is attempted.)</li>  </ul></blockquote><p>All this means is that you have to create a new instance of the class every time you want to use it, right? In other words, it must be done like this:</p><pre><code>new DownloadFilesTask().execute(url1, url2, url3);new DownloadFilesTask().execute(url4, url5, url6);</code></pre><p>Or conversely, you can NOT do the following:</p><pre><code>DownloadFilesTask dfTask = new DownloadFilesTask();dfTask().execute(url1, url2, url3);dfTask().execute(url4, url5, url6);</code></pre><p>Can someone verify this is an accurate interpretation?</p><p>I realize I pretty much just answered this for myself as I was typing this out... But it wasn't immediately obvious to me so I think this would be useful to have posted nonetheless.  </p>","325011","","385478","","2014-02-05 23:57:42","2014-02-05 23:57:42","AsyncTask Threading Rule - Can it really only be used once?","<android><android-asynctask>","3","0","5","",""
"2711246","1","","","2010-04-26 05:09:59","2","375","<p>How can I add application preference in device setting. I want to my preference setting be part of device setting opinion. My application setting can be appeared or displayed in device setting list. </p><p>Any API i need to use or keyword?</p>","304881","","","","","2010-04-26 11:39:38","Android application preference in device setting opinion","<android>","2","0","1","",""
"2711298","1","","","2010-04-26 05:33:24","1","3016","<p>Doing a bit of advance research, and am stuck on the point summarized in the title. Namely, is there any way to forward-lock an APK installed programmatically, from another app? I've not come across anything beyond a hint in the following post: <a href=""http://groups.google.com/group/android-developers/msg/e39941389d4a4cf8"" rel=""nofollow"">http://groups.google.com/group/android-developers/msg/e39941389d4a4cf8</a> </p><p>I can't see anything in the docs for PackageManager about forward- locking, but I readily confess that this is an unfamiliar area of the SDK for me. </p><p>[Cross-posted with the Android-Developers Google group]</p>","252080","","","","","2010-12-02 07:15:52","Programmatically forward-lock an Android APK","<android><copy-protection><apk>","2","0","","",""
"2711306","1","2711889","","2010-04-26 05:37:33","1","5893","<p>I am trying to retrieve a list of images and text from a web service. I have first coded to get the images to a list using Simple Adapter. The images are getting displayed the app is showing an error and in the Logcat the following errors occur...</p><pre><code>04-26 10:55:39.483: ERROR/dalvikvm-heap(1047): 8850-byte external allocation too large for this process.04-26 10:55:39.493: ERROR/(1047): VM won't let us allocate 8850 bytes04-26 10:55:39.563: ERROR/AndroidRuntime(1047): Uncaught handler: thread Thread-96 exiting due to uncaught exception04-26 10:55:39.573: ERROR/AndroidRuntime(1047): java.lang.OutOfMemoryError: bitmap size exceeds VM budget04-26 10:55:39.573: ERROR/AndroidRuntime(1047):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)04-26 10:55:39.573: ERROR/AndroidRuntime(1047):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:451)04-26 10:55:39.573: ERROR/AndroidRuntime(1047):     at com.stellent.gorinka.AsyncImageLoaderv.loadImageFromUrl(AsyncImageLoaderv.java:57)04-26 10:55:39.573: ERROR/AndroidRuntime(1047):     at com.stellent.gorinka.AsyncImageLoaderv$2.run(AsyncImageLoaderv.java:41)04-26 10:55:40.393: ERROR/dalvikvm-heap(1047): 14600-byte external allocation too large for this process.04-26 10:55:40.403: ERROR/(1047): VM won't let us allocate 14600 bytes04-26 10:55:40.493: ERROR/AndroidRuntime(1047): Uncaught handler: thread Thread-93 exiting due to uncaught exception04-26 10:55:40.493: ERROR/AndroidRuntime(1047): java.lang.OutOfMemoryError: bitmap size exceeds VM budget04-26 10:55:40.493: ERROR/AndroidRuntime(1047):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)04-26 10:55:40.493: ERROR/AndroidRuntime(1047):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:451)04-26 10:55:40.493: ERROR/AndroidRuntime(1047):     at com.stellent.gorinka.AsyncImageLoaderv.loadImageFromUrl(AsyncImageLoaderv.java:57)04-26 10:55:40.493: ERROR/AndroidRuntime(1047):     at com.stellent.gorinka.AsyncImageLoaderv$2.run(AsyncImageLoaderv.java:41)04-26 10:55:40.594: INFO/Process(584): Sending signal. PID: 1047 SIG: 3</code></pre><p>Here's the coding in the adapter...</p><pre><code>final ImageView imageView = (ImageView) rowView.findViewById(R.id.image);        AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv();        Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() {            public void imageLoaded(Bitmap imageDrawable, String imageUrl) {                imageView.setImageBitmap(imageDrawable);            }            });        imageView.setImageBitmap(cachedImage);</code></pre><p>To load the image...</p><pre><code>public static Bitmap loadImageFromUrl(String url) {            InputStream inputStream;Bitmap b;        try {            inputStream = (InputStream) new URL(url).getContent();            BitmapFactory.Options bpo=  new BitmapFactory.Options();            bpo.inSampleSize=2;             b=BitmapFactory.decodeStream(inputStream, null,bpo );             return b;        } catch (IOException e) {                throw new RuntimeException(e);            }           //return null;     }  </code></pre><p>Please tell me how to fix the error....</p>","303155","","","user658042","2011-10-13 10:33:28","2011-10-20 06:23:26","Out of memory error","<android>","1","1","","",""
"2711309","1","2711483","","2010-04-26 05:38:38","8","5885","<p>I have a linear layout which has a background image (a 9 patched png file).How can I add padding to left and right so that the background image does not take up the whole width? I have tried 'android:paddingLeft' and 'android:paddingRight', but that does not change anything.</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:paddingLeft=""25dip""android:paddingRight=""25dip""android:background=""@drawable/background""&gt;</code></pre><p>The whole background still stretches the whole screen width.</p><p>Thank you for any help.</p>","286802","","","","","2014-02-19 18:22:58","How to add padding for background image","<android>","3","0","3","",""
"2711500","1","","","2010-04-26 06:37:13","0","514","<p>I am using Activity-alias in AndroidManifest.xml to specify another entry point to my application using shortcut. I am seeing the shortcut in the shortcut list. How can I get my 2nd icon (shortcut) to show in the Home?</p>","325737","","","","","2011-01-29 15:02:19","how can i get my application shortcut to show up in the device","<android><shortcut>","1","0","","",""
"2711516","1","2711712","","2010-04-26 06:41:42","2","1057","<p>I've asked here a question about Task Killers and widgets stop working (<a href=""http://stackoverflow.com/questions/2706303/pendingintent-in-widget-taskkiller"">SO Question</a>) but now, I have reports of user that they don't use any Task Killer and the widgets didn't work after a while. I have a Nexus One and I don't have this problem.</p><p>I don't know if this is a problem of memory or something. Based on the API:</p><blockquote>  <p>A PendingIntent itself is simply a  reference to a token maintained by the  system describing the original data  used to retrieve it. This means that,  even if its owning application's  process is killed, the PendingIntent  itself will remain usable from other  processes that have been given it.</p></blockquote><p>So, I don't know why widget stop working, if Android doesn't kill the PendingIntent by itself, what's the problem?</p><p>This is my manifest code:</p><pre><code>    &lt;receiver android:name="".widget.InstantWidget"" android:label=""@string/app_name""&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/widget_provider"" /&gt;    &lt;/receiver&gt;</code></pre><p>And the widget code:</p><pre><code>public class InstantWidget extends AppWidgetProvider {    public static ArrayList&lt;Integer&gt; alWidgetsId = new ArrayList&lt;Integer&gt;();    private static final String PREFS_NAME = ""com.cremagames.instant.InstantWidget"";    private static final String PREF_PREFIX_NOM = ""nom_"";    private static final String PREF_PREFIX_RAW = ""raw_"";    /**     * Esto se llama cuando se crea el widget. Metemos en las preferencias los valores de nombre y raw para tenerlos en proximos reboot.     * @param context     * @param appWidgetManager     * @param appWidgetId     * @param nombreSound     * @param rawSound     */    static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,            int appWidgetId, String nombreSound, int rawSound){        //Guardamos en las prefs los valores        SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit();        prefs.putString(PREF_PREFIX_NOM + appWidgetId, nombreSound);        prefs.putInt(PREF_PREFIX_RAW + appWidgetId, rawSound);        prefs.commit();        //Actualizamos la interfaz        updateWidgetGrafico(context, appWidgetManager, appWidgetId, nombreSound, rawSound);    }    /**     * Actualiza la interfaz gráfica del widget (pone el nombre y crea el intent con el raw)     * @param context     * @param appWidgetManager     * @param appWidgetId     * @param nombreSound     * @param rawSound     */    private static void updateWidgetGrafico(Context context, AppWidgetManager appWidgetManager,            int appWidgetId, String nombreSound, int rawSound){        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);        //Nombre del Button        remoteViews.setTextViewText(R.id.tvWidget, nombreSound);        //Creamos el PendingIntent para el onclik del boton        Intent active = new Intent(context, InstantWidget.class);        active.setAction(String.valueOf(appWidgetId));        active.putExtra(""sonido"", rawSound);        PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);        actionPendingIntent.cancel();        actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);        remoteViews.setOnClickPendingIntent(R.id.btWidget, actionPendingIntent);        appWidgetManager.updateAppWidget(appWidgetId, remoteViews);    }    public void onReceive(Context context, Intent intent) {             final String action = intent.getAction();        //Esto se usa en la 1.5 para que se borre bien el widget        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 {            //Listener de los botones            for(int i=0; i&lt;alWidgetsId.size(); i++){                if (intent.getAction().equals(String.valueOf(alWidgetsId.get(i)))) {                    int sonidoRaw = 0;                    try {                        sonidoRaw = intent.getIntExtra(""sonido"", 0);                    } catch (NullPointerException e) {                    }                    MediaPlayer mp = MediaPlayer.create(context, sonidoRaw);                    mp.start();                    mp.setOnCompletionListener(completionListener);                }            }            super.onReceive(context, intent);        }    }    /** Al borrar el widget, borramos también las preferencias **/    public void onDeleted(Context context, int[] appWidgetIds) {        for(int i=0; i&lt;appWidgetIds.length; i++){            //Recogemos las preferencias            SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit();            prefs.remove(PREF_PREFIX_NOM + appWidgetIds[i]);            prefs.remove(PREF_PREFIX_RAW + appWidgetIds[i]);            prefs.commit();        }        super.onDeleted(context, appWidgetIds);    }    /**Este método se llama cada vez que se refresca un widget. En nuestro caso, al crearse y al reboot del telefono.    Al crearse lo único que hace es guardar el id en el arrayList    Al reboot, vienen varios ID así que los recorremos y guardamos todos y también recuperamos de las preferencias el nombre y el sonido*/    public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {        for(int i=0; i&lt;appWidgetIds.length; i++){            //Metemos en el array los IDs de los widgets            alWidgetsId.add(appWidgetIds[i]);            //Recogemos las preferencias            SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);            String nomSound = prefs.getString(PREF_PREFIX_NOM + appWidgetIds[i], null);            int rawSound = prefs.getInt(PREF_PREFIX_RAW + appWidgetIds[i], 0);            //Si están creadas, actualizamos la interfaz            if(nomSound != null){                updateWidgetGrafico(context, appWidgetManager, appWidgetIds[i], nomSound, rawSound);            }        }    }    MediaPlayer.OnCompletionListener completionListener = new MediaPlayer.OnCompletionListener(){        public void onCompletion(MediaPlayer mp) {            if(mp != null){                mp.stop();                mp.release();                mp = null;            }        }    };}</code></pre><p>Sorry for the comments in Spanish.</p><p>I have the possibility to put differents widgets on the desktop, that's why I use the widgetId as the ""unique id"" for the PendingIntent.</p><p>Any ideas please? The 70% of the functionality of my app is the widgets, and it isn't working for some users :(</p><p>Thanks in advance and sorry for my English.</p>","309853","","","","","2010-04-27 08:25:08","I need help with Widget and PendingIntents","<android><widget><android-widget><android-pendingintent>","1","0","","",""
"2711581","1","","","2010-04-26 06:58:14","3","175","<p>I am looking for Wrappable ViewGroup just like what TextView do. I need this for layout. This should be something like LinearLayout but wrappable to multiple lines. Or do I need something custom?</p>","325737","","","","","2010-04-26 11:35:08","Any wrapping viewgroup?","<android><layout>","1","0","","",""
"2711858","1","","","2010-04-26 07:58:35","24","23235","<p>I need to use certain font for my entire application. I have .ttf file for the same.Is it possible to set this as default font, at application start up and then use it elsewhere in the application? When set, how do i use it in my layout XMLs?</p><p>Sample code, tutorial that can help me here is appreciated.</p><p>Thanks. </p>","236128","","","","","2014-04-17 14:58:13","Is it possible to set font for entire Application?","<android><android-ui><android-fonts>","9","0","17","",""
"2712018","1","","","2010-04-26 08:32:02","3","621","<p>I have a following situation in my android app.</p><ol><li>I have an app that fetches messages from inbox, sent items and drafts based on search keywords. I use to accomplish this by fetching cursors for each manually based on selection by user and then populating them in a custom data holder object. Filter those results based on given keywords and then manually render view with respective data.</li></ol><p>Someone suggested that I should use a custom Cursor adapter to bind view and my cursor data. So I tried doing that. Now what I am doing is this:</p><ol><li>Fetch individual cursors for inbox, sent items and drafts. Merge them into one using Merge cursor and then pass that back to my CursorAdapter implmentation.</li><li>Now where or how do I filter my cursor data based on keywords; because now binding will ensure that they are directly rendered to view on list. Also, some post fetching operation like fetching sender's contact pic and all will be something that I do not want to move to adapter. If I do all this processing in adapter; it'll be heavy and ugly.</li></ol><p>How could I have designed it better such that it performs and the responsibilities are shared and distributed. </p><p>Any ideas will be helpful.</p>","57847","","","","","2011-12-22 13:39:29","Android listing design problem with cursors","<android><design><listview><filter><cursor>","1","1","","",""
"2712248","1","","","2010-04-26 09:13:18","3","140","<p>I have a LinearLayout with fixed view. I dynamically inject images in it (ImageViews) but I dunno in advance how many of them will be inserted. I'd like to have a layout where images wrap and go to a new line authomatically when they exceed the available width of the father (LinearLayout)</p><p>how do you recommend I should move?</p><p>thanks a lot</p>","87624","","","","","2010-04-26 11:36:46","List of images that wraps","<android>","2","0","","",""
"2712761","1","2712917","","2010-04-26 10:43:43","66","81957","<p>Where can I find the values that inputType can have?</p><p>I'm aware of <a href=""http://developer.android.com/reference/android/text/InputType.html"">http://developer.android.com/reference/android/text/InputType.html</a>, but how should the values look like in layout xml files?</p>","70386","","","","","2014-04-12 11:31:34","EditText, inputType values (xml)","<android><layout><edittext>","2","3","36","",""
"2712778","1","2713284","","2010-04-26 10:47:47","1","1703","<p>i have the following imageButton</p><pre><code>    &lt;ImageButton    android:id=""@+id/header_buttonleft""    android:layout_width=""40dip""    android:layout_height=""40dip""    android:layout_alignParentLeft=""true""    android:layout_marginLeft=""10dip""    android:layout_marginTop=""5dip""    android:src=""@drawable/icon_download""    android:clickable=""true""/&gt;</code></pre><p>But when i load my application in the device, it appears too small:</p><p><img src=""http://i42.tinypic.com/okts1k.png"" alt=""alt text""></p><p>Anyone knows how can i make the icon bigger. I have tried to increase the resolution (actually the icon is 70x70) but it still doesn't work. Any idea?</p>","258863","","","","","2010-04-26 12:11:09","Android Image Button Problem","<android><icons><imagebutton>","1","0","1","",""
"2712822","1","2712886","","2010-04-26 10:55:08","5","19995","<p>I have added <code>android:windowSoftInputMode=""stateAlwaysVisible""</code> to my Activity in <strong>AndroidManifest.xml</strong> and 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:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;    &lt;EditText android:id=""@+id/EditText02"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;    &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Send""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://img227.imageshack.us/img227/2006/18021414.png"" alt=""alt text""></p><p>When the Activity starts, the EditText is focused, but soft keyboard isn't displayed. If I click on the EditText, then I see the soft keyboard. Do I need to set aditional parameters to display soft keyboard when my Activity starts?</p><p>Thanks</p>","16622","","","","","2012-08-11 19:46:53","Soft keyboard does not show when Activity starts","<android><gui><user-interface><soft-keyboard>","3","0","3","",""
"2712857","1","2712934","","2010-04-26 10:59:49","4","991","<p>I have been given the tasks of speccing a mobile application, which will need to run on approx. 1000 devices. These devices already exist, and consist of iPhones, BlackBerrys, Androids, Windows Mobile and Netbooks. The application will have simple reporting capability, and a collection of forms.</p><p>Anyway, the obvious solution would be to develop some browser based solution, although given the occasionally connected nature of the devices, there's a potential for data to get lost / not saved.</p><p>So instead of creating a complex application for each platform, I was thinking we could build what is effectively a form generator, with basic offline storage capability (text files), designed to run on each device, and have the device generate a form, based on for example an XML file that it could request from a server somewhere, resulting in minimal specialist development costs, and the ability to run most of the logic from the server end, with the devices being dumb clients that render forms and upload the data when there is an available connection.</p><p>Anyway, my question summarised is, how have you made the decision on supporting multiple devices for your application. Is this always an unavoidable problem, and you just have to make the call to support 1 or 2, or pay for developers to write code for each platform, or alternatively supply pre-installed devices to the company?</p><p>Many thanks</p><p>James</p>","54123","","","","","2013-12-23 17:54:34","Most cost effective way to target multiple mobile platforms","<iphone><android><blackberry><mobile><compatibility>","4","1","4","2013-12-23 18:19:58",""
"2713019","1","2713057","","2010-04-26 11:28:24","3","768","<p>I'm trying to write a rogue-like game for my blackberry and hopefullyany other phone that supports some sort of JVM.</p><p>Because I use Java in my job I'm looking to write the game in another language but I cannot find a language that will work on multiple phones.</p><p>Am I stuck with Java?</p>","318174","","40342","","2010-04-27 11:13:16","2010-04-27 11:13:16","Is there any language other than Java that will work as ubiquitous on mobile?","<java><android><programming-languages><blackberry><mobile>","5","3","","",""
"2713165","1","2767758","","2010-04-26 11:52:34","9","19800","<p>I'm creating an Android application which uses user captured images as part of a larger process. So far my XML layout has a SurfaceView and Button inside a RelativeLayout. I've managed to get the camera preview to show on the SurfaceView but I'm stuck on how to take a picture and save it when a user presses the button.</p><p>My class file looks something like the CameraPreview API demo:<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p><p>Ideally, when the button it pressed the camera should autofocus, snap a picture (with the clicky sound), save it to <code>/data/data/app_package_structure/files/file_name.jpg</code>, then pop up a Toast to tell the user their image has been saved.</p><p>Any help is much appreciated :)</p>","205877","","","","","2012-07-26 15:38:29","Take and save picture on button press","<android><camera>","2","0","13","",""
"2713173","1","2829526","","2010-04-26 11:54:08","2","5498","<p>Just a little background. I am a proficient asp.net/c#/sql server programmer who has been learning Android for less than 2 days.</p><p>We have an existing .net website which stores a list of locations in MS SQL server 2008 and I'm trying to create and Android application that gets these locations and displays them on a Google Map.</p><p>The question really is how to get the app connected to the SQL database. I'm guessing there are a few options....</p><p>1) Some kind of direct connection between the app and the remote DB.</p><p>2) Creating some kind of middle layer using asp.net that would convert the data into something more usable to the Java code in the android app (bear in mind I know virtually NO java), in exactly the same was that we have .net code which supplies JSON to our web apps.</p><p>3) Creating some kind of web service to just return XML results from the web server. No idea how I would secure this so that only the Android app could request the data though.</p><p>Any help or advice on best practice would be really useful. I think I just need pointing in the general direction of a good strategy and I can work it out.</p>","56007","","207655","","2010-05-11 15:13:23","2010-05-14 08:23:41","Best way to get data into an android app?","<java><sql-server><android><web-services><flawed-concept>","5","0","3","",""
"2713191","1","4843797","","2010-04-26 11:58:02","0","242","<p>Let's suppose that: I delete an item from my sdcard and then I unmount the memory card. What happens when Android rescans my sdcard for changes? In MediaStore, every row has an _ID so after I delete an item what happens to this _ID: does it remain in MediaStore, it is associated with another item, or it is removed permanently? </p>","217360","","82118","","2011-10-06 20:01:51","2011-10-06 20:01:51","What happens with IDs from MediaStore when some items are deleted?","<android>","1","0","","",""
"2713264","1","","","2010-04-26 12:09:41","2","496","<p>I don't know why, but in Eclair, the default (non-fancy) gallery app changed its begaviour from the Cupcake version, and it broke one of my commercial applications :-(</p><p>Firstly, when long-pressing a gallery and choosing ""Diashow"", it does not publish an Intent to be picked up by any application that implements the Intent filter anymore. Instead, it will directly call ""com.android.gallery/com.android.camera.ViewImage"" with extras.</p><p>Question: is it still possible to intercept this intent and allow the user to choose my application to do the Diashow?</p><p>Secondly, the intent extras for the VIEW intent are messed up (in my build of 2.1 anyway): Instead of providing the BucketId of the picture in the Intent's queryparameter. But in 2.1, the BucketId is moved to the Intent's extras. Except; it is not passing the <code>BUCKET_ID</code>, but the unlocalized <code>BUCKET_DISPLAY_NAME</code> instead :-/</p><p><strong>Question:</strong> how can I still get the unique <code>BUCKET_ID</code> from the intent, so that I do not have to work with a potentially non-unique <code>BUCKET_DISPLAY_NAME</code>?</p><p>Is there anybody out there who has come up with a working solution for these problems?</p><p>I thought the whole idea of Android Intents was to be able to integrate your applications with the base Android environment, but my build of 2.1 proves that this idea still lives in the land of Theory :-(</p>","305221","","995926","","2012-05-22 08:20:46","2012-05-22 08:20:46","Android 2.1 gallery not backward compatible with Cupcake version, now what?","<android><gallery><compatibility><android-2.0-eclair>","2","0","0","",""
"2713383","1","2717153","","2010-04-26 12:26:28","0","7971","<p>I'm having some trouble getting pictures inside a tablelayout...actually, each I have 2 columns and when i put a picture in a cell of the table, it's completely streched and disproportionnated...I can't find how to make it stay it's original inside the cell and let the rest of the space filled by white background for instance....XML is like that :</p><pre><code>&lt;TableLayout android:layout_width=""fill_parent"" android:stretchColumns=""*""android:layout_marginLeft=""3dip"" android:layout_marginRight=""10dip""android:layout_height=""wrap_content""&gt;&lt;TableRow android:layout_marginBottom=""10dip""&gt;&lt;TextView android:id=""@+id/tv01"" android:text=""text1"" android:textSize=""14sp"" android:layout_margin=""1dip"" android:layout_height=""wrap_content"" android:textColor=""@color/bleuLink"" android:layout_width=""wrap_content"" android:layout_weight=""1"" android:background=""@color/background""&gt;&lt;/TextView&gt; &lt;Button android:id=""@+id/add"" android:background=""@drawable/addressbook""  android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt; &lt;Button android:id=""@+id/call"" android:background=""@drawable/greenphone""  android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt;</code></pre><p>    </p><p>help plz, thx</p>","263521","","263521","","2010-04-26 13:59:53","2010-08-30 03:28:48","insert an image in a tablelayout without streching it android","<android><image><tablelayout>","2","2","1","",""
"2713484","1","","","2010-04-26 12:45:13","1","5306","<p>I'm developing an media player application for Android, for which I need to handle any Alarm notification, and based on that I'll pause my playback. When the Alarm in snoozed or dismissed, I'll then resume the playback. </p><p>I googled a lot for the Alarm handling, but what I found was the way to enable Alarm notifications through code, set the intent and then handle it. However, no where could I locate just handling the Alarm notification part. I don't need to set the Alarm on, it could've been set by the user, and I don't need to programmatically. All I need is just handle that notification.</p><p>Any ideas on this would be extremely useful?</p><p>Thanks,Asheesh</p>","325991","","","","","2011-08-13 23:34:55","How to handle Alarm notification in Android?","<android><alarm>","2","0","2","",""
"2713686","1","2714577","","2010-04-26 13:18:19","0","650","<p>May we have rights to update the android database table schema such like People, Organization,Calendar,Events. i want to add triggers on the update, delete and insert of the above mention tables.</p>","309990","","139010","","2011-05-15 22:11:26","2011-05-15 22:11:26","Update the android default database table schema","<database><android>","1","0","","",""
"2713772","1","2714599","","2010-04-26 13:28:27","2","438","<p>I'm not looking for a mock up tool, I'm looking for a reasonable GUI design tool for the final product in the style of Apple's Interface Builder. Droid Draw is buggy, out of date and inaccurate in my experience. Using the Eclipse plug in to do a complex layout makes going to the dentist seem fun. I'd even settle for hand-coding CSS pixel coordinates over the current model. Is the solution found here: <a href=""http://andrdev.blogspot.com/2010/01/gui-designer.html"" rel=""nofollow"">http://andrdev.blogspot.com/2010/01/gui-designer.html</a> the best, or have one of you ninjas found something else? If there is an actively developed project that isn't ready for show yet, I'd like to know that as well.</p>","230571","","","","","2010-04-26 15:17:19","Android: Active project attempting to improve the GUI design process?","<android><gui>","1","2","1","",""
"2713774","1","2713850","","2010-04-26 13:28:29","3","3661","<p>I been following the Tab example provided by Google. I am trying to use the XML layout provided to setup a tab layout.</p><p>I use this XML layout @ <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-tabwidget.html</a></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>When ever I switch the Layout tab in the Eclipse layout designer I get a <strong>NullPointerException: null</strong> error inside my Eclipse.</p><p>This happens also when I try to drag and drop a TabHost, and then a TabWidget into an empty layout file.</p><p>What am I doing wrong ? this seems pretty simple.</p>","151447","","","","","2010-05-19 20:48:38","TabHost NullPointerException in layout","<android><eclipse>","1","1","","",""
"2713795","1","2714297","","2010-04-26 13:30:50","4","2955","<p>I do not know the difference between these two attributes and for the height also.</p><p>Take a TextView for example, what would happen if I set its layout_width to wrap_content and set its width to 50 dip?</p>","238061","","","","","2012-05-09 11:03:56","What is the difference between android:layout_width and android:width","<android><layout>","2","0","","",""
"2713905","1","","","2010-04-26 13:44:48","5","7981","<p>I'm using the following piece of code in Android to send a mail:</p><pre><code> Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.setType(""text/html""); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,sendTo ); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""test"" ); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""msg"" );</code></pre><p>When code is compiled and run, its asking me options of selecting applications like ""GMail"", ""BlueTooth"" etc. But I want the mail to be sent without user intervention. Even sending it by MMS will be much better for me. Can some one suggest me how to do it?</p>","265341","","","","","2013-08-15 17:47:01","Android Programming - Send mail","<android><email><mms>","2","0","5","",""
"2714152","1","2714228","","2010-04-26 14:16:44","1","1175","<p>I have a strange problem on my htc hero. When launching camera, i get out of memory exception. After that, if i launch any other application that uses camera, they also crash(when trying to use camera function).I call camera.release and camera.stoppreview in surfacedestroyed function, but that doesnt help. </p><p>What is the right way to release all resources? Could somebody please show his working surfacechanged, surfacecreated and surfacedestroyed functions?I have empty onPreviewFrame function, should i put something there?</p>","324417","","","","","2010-04-26 15:43:56","Android camera out of memory exception","<java><android>","2","1","","",""
"2714700","1","2714794","","2010-04-26 15:33:36","9","23998","<p>My issue is as follows :I have stored a few pictures into the sqlite database, using the blob format, which seems to work ok. now i want to get my pictures out of the DB and put then back into images... to complicate the matter, their format is variable (png, jpg, maybe something else, im not sure)Is there a way of doing so in android?</p><p>thank you</p>","263521","","","","","2010-04-26 17:51:48","byte[] to image android","<android><image><byte>","2","0","5","",""
"2714704","1","","","2010-04-26 15:34:10","1","984","<p>How can I temporarily block all user interactions with the views of an activity ?(Other than calling the setEnabled method on each view)</p>","164460","","","","","2010-04-26 15:58:50","android activity block user interactions","<android><activity>","2","0","","",""
"2714880","1","2780801","","2010-04-26 15:57:25","5","5063","<p>I have a Spinner with an ArrayAdapter that feeds Values into it. The layout for this views looks something like this:</p><pre><code>        &lt;TextView           android:text=""Household Income: ""           android:layout_width=""wrap_content""           android:layout_height=""fill_parent""           android:gravity=""center_vertical"" /&gt;        &lt;Spinner           android:id=""@+id/incomespinner""           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           android:padding=""2dip""  /&gt;</code></pre><p>The Problem is that the text is to long for the view and the result is a very very ugly spinner. As can be seen in the screenshot: </p><p><img src=""http://janusz.de/~janusz/spinner.png"" alt=""alt text""></p><p>I tried to pass the Id of my own TextView into the Adapter but everytime the spinner should be shown I get an Exception that the Id I supplied is not valid:</p><pre><code>04-26 17:38:39.695: ERROR/AndroidRuntime(4276): android.content.res.Resources$NotFoundException: Resource ID #0x7f09003a type #0x12 is not valid</code></pre><p>Where do I have to define the TextView? In a separate xml file? With a surrounding viewgroup? </p><p>It would help me a lot if I could see an example of the adapter initialization and the textview definition?</p>","114066","","114066","","2010-05-06 10:27:16","2012-05-08 09:39:50","How to customise the TextView inside a Spinner?","<android><layout><spinner>","3","0","3","",""
"2715095","1","2715236","","2010-04-26 16:29:42","5","10148","<p>I run my app in the AVD emulator using eclipse but I'm unable to change the screen orientation in the AVD (Android 2.0 platform on the emulator). </p><p>When I press <kbd>CTRL</kbd>+<kbd>F11</kbd> or <kbd>CTRL</kbd>+<kbd>F12</kbd> on the keyboard, nothing happens. No messages are generated in the adb debuglog/logcat either when I press either hotkey. </p><p>According to <a href=""http://developer.android.com/guide/developing/tools/emulator.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/emulator.html</a> these are the correct hotkeys to switch the emulator's screen orientation. </p><p>I tried it with my app, and with the messaging app. The hotkey has no affect in any case. </p><p>I'm running Fedora 12, Gnome. I checked my Keyboard Shortcuts in the System -> Preferences menu, nothing's attached to either hotkey.</p><p>Same problem, 3 different PCs (all running Fedora Gnome). </p>","268803","","513198","","2012-05-10 15:39:31","2014-04-16 15:12:33","AVD Screen orientation not changing with CTRL+F11 or CTRL+F12","<android><android-emulator><screen-orientation><avd>","4","2","","",""
"2715694","1","2715778","","2010-04-26 18:00:53","1","121","<p>I want to import all songs (on the Archos 5 IT) into an array in my app?</p><p>How can I do this?</p><p>-What is the file path?</p><p>-How do I get an array?</p><p>Please help...</p><p>Thanks alot,</p><p>James</p>","321763","","","","","2010-04-26 18:13:08","Archos 5 IT audio paths... (Android)","<java><android><audio><archos>","1","0","","",""
"2715805","1","","","2010-04-26 18:16:58","1","1467","<p>I have a main view that presents to the user the settings he/she can modify for an application . It's xml is something like this :</p><pre><code>&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""             android:key=""root_preferencescreen""&gt;    &lt;PreferenceScreen  android:key=""general_sett"" android:title=""general settings"" /&gt;     ....    &lt;PreferenceScreen  android:key=""extras_sett"" android:title=""extras settings"" /&gt;&lt;/PreferenceScreen&gt; </code></pre><p>When the user clicks on on preferenceScreen a secondary screen will open that contains the desired preferences . What I want is to be able to display a icon to the left of each of these preferenceScreens , something like this:</p><pre><code>&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""                 android:key=""root_preferencescreen""&gt;  &lt;LinearLayout  android:orientation=""horizontal""  android:layout_width=""fill_parent""... &gt;        &lt;ImageView id=""@+id/picview"" ... /&gt;        &lt;PreferenceScreen  android:key=""general_sett"" android:title=""general settings"" /&gt;  &lt;/LinearLayout&gt;    ......&lt;/PreferenceScreen&gt; </code></pre><p>Unfortunately this approach is not allowed by Android , so if you have any other idea or solution regarding this issue please inform me .</p>","284609","","","","","2012-08-14 08:53:27","Preference screen xml","<android>","2","1","","",""
"2715950","1","2716089","","2010-04-26 18:40:56","7","8138","<p>I'm working on an android form with a radio group containing a set of radio buttons. From what I can tell there is no way to set the color a radio button highlights when you select it. It seems to always default to some bright green color. Is this something that is editable or no?</p><p>Thanks</p>","198116","","","","","2010-04-26 19:02:08","Any way to change the color of a radio button?","<android><radio-button><android-layout>","1","0","2","",""
"2715990","1","2716187","","2010-04-26 18:47:14","0","1196","<p>I have some media (Audio tracks) on an app...</p><p>With file path 'R.raw.test'</p><p>I use some code to get it into a mediaplayer...</p><pre><code>MediaPlayer.create(Textbox.this, R.raw.fly);</code></pre><p>And it works PERFECTLY on the Android Emulator...(Plays track on click of button)</p><p>Can someone explain  why, when I put it on my Archos (5 IT) it doesnt work at all?</p><p>-As soon as the button is clicked, it crashes...</p><p>Do you have to do something to file paths or what?</p><p>Please help...</p><p>Thanks alot...</p><p>James</p>","321763","","","","","2010-04-26 19:19:21","Why doesnt R.raw.'songname' not work on android devices?","<java><android><audio><media-player><archos>","1","2","","",""
"2716063","1","2716150","","2010-04-26 18:57:21","4","7434","<p>I have a weird issue. I receive the following error that causes a force-close:</p><blockquote>  <p>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: no element found    at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:508)  at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467)  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329)  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286)</p></blockquote><p>After clicking the Force Close button, the Activity is recreated and the parsing completes without a hitch. I'm using the following code snippet inside doInBackground of an AsyncTask:</p><pre><code>URL serverAddress = new URL(url[0]);HttpURLConnection connection = (HttpURLConnection) serverAddress.openConnection();connection.setRequestMethod(""GET"");connection.setDoOutput(true);connection.setReadTimeout(10000);connection.connect();InputStream stream = connection.getInputStream();SAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();XMLReader xr = sp.getXMLReader();xr.parse(new InputSource(stream));  // The line that throws the exception</code></pre><p>Why would the Activity force-close and then run without any problems immediately after? Would a BufferedInputStream be any different? I'm baffled. :(</p><p>Thanks for your time everyone.</p><p>Update: It turns out HttpURLConnection.getResponseCode() returns -1 every so often, so the InputStream probably isn't being correctly set.</p>","264734","","264734","","2010-04-27 11:29:57","2010-09-17 18:12:47","Parse Exception: At line 1, column 0: no element found","<java><xml><android><parsing><httpurlconnection>","5","3","2","",""
"2716318","1","","","2010-04-26 19:40:30","0","779","<p>If an application begins a <code>Service</code> via <code>bindService</code> or <code>startService</code>, will this Service object ever run from a process different from that of the application?</p><p>I ask because many Android example projects begin a service and communicate to them using IPC which seems wholly unnecessary considering that, according to the Android <code>Service</code> documentation, ""... services, like other application objects, run in the main thread of their hosting process.""</p><p>IPC, AIDL, and the <code>IBinder</code> interface only seem useful if connecting to a <code>Service</code> started by an application other than your own.</p><p>Is this a correct or fair understanding?</p>","300368","","","","","2010-04-26 20:55:59","Can an application's Service ever run in a different process?","<android>","1","0","1","",""
"2716686","1","2751320","","2010-04-26 20:38:14","15","19084","<p>How can I have an imagebutton stay in the 'pressed' state when it is clicked? Basically I just want the background to be the depressed background, but I can't figure out how to set it. At the moment, I've just copied the selected button background into my res folder, but when I set it as the background, it becomes blurry (since the original image is bigger than the button itself). </p><p>Normal Background:<img src=""http://img707.imageshack.us/img707/9199/ss20100426163452.png"" alt=""alt text"">What I'm getting:<img src=""http://img707.imageshack.us/img707/912/ss20100426163357.png"" alt=""alt text""><img src=""http://img3.imageshack.us/img3/8304/ss20100426163623.png"" alt=""alt text""></p><p>Also I don't believe I can actually use this method considering the many different UI layouts. The button should stay pressed as per the UI the user is using.</p>","118241","","118241","","2010-05-01 18:10:39","2010-05-01 19:36:38","Android Set ImageButton as Toggle","<android><layout><toggle><imagebutton>","1","2","11","",""
"2716879","1","2716906","","2010-04-26 21:04:43","1","1830","<p>I have a jar that consists of a class that extends Activity and performs some activity on onCreate. I want to import this jar into my Android app and start the activity. </p><p>How can I go about this?</p><p>Thanks George</p>","324632","","","","","2012-01-06 12:37:10","Android - Invoke activity from within jar","<android><jar><activity>","2","0","0","",""
"2717040","1","","","2010-04-26 21:29:52","2","877","<p>I have had some reports from users of my android app that there is no sound being played on the X10. I'm a bit confused as it works on all other phones that I have tried, Neus One, Hero, Droid. I'm using the SoundPool class to play sounds, has anybody else had similar issues with the X10?</p><p>Thanks,Gaz</p>","119396","","213269","","2010-05-21 14:59:54","2010-07-24 16:16:40","Android Xperia X10 SoundPool","<android><audio>","1","3","0","",""
"2717073","1","2717534","","2010-04-26 21:35:18","0","1054","<p>I have a class that extends Application. In the class I make a call to AlarmManager and pass in an intent. As scheduled my EventReceiver class, that extends BroadcastReceiver, processes the call in the onReceive method. How would I call the intent again from the onReceive method to schedule another event?</p>","312443","","","","","2010-04-27 00:17:54","Scheduling a recurring alarm/event","<android><android-intent><broadcastreceiver>","2","0","","",""
"2717168","1","2717414","","2010-04-26 21:50:30","5","986","<p>From your experience, to develop an Android application for the Marketplace, do I need a real Android device to test my applications or using the emulator that ships with the SDK is enough?</p>","130929","","130929","","2011-01-31 08:06:25","2013-02-02 11:14:20","Do I need a real Android device to develop an Android application for the Marketplace?","<android><mobile>","7","1","2","",""
"2717220","1","2782166","","2010-04-26 21:57:47","2","4120","<p>I'm trying to use ksoap to call a simple webservice.  I followed <a href=""http://www.vimeo.com/9633556"" rel=""nofollow"">this video</a> to try to get started.  When I call ""getResponse()"" on the envelope I just get the string ""Error"".  There's no exceptions thrown or any other detail.  I've successfully connected to a simple webservice I just setup on my local machine.  Could this potentially be related to being behind a proxy server here at work?  My code is below:</p><pre><code>String SOAP_ACTION=""http://tempuri.org/CelsiusToFahrenheit"";String METHOD_NAME = ""CelsiusToFahrenheit"";String NAMESPACE = ""http://tempuri.org"";String URL = ""http://w3schools.com/webservices/tempconvert.asmx"";SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);PropertyInfo pi = new PropertyInfo();pi.setName(""Celsius"");pi.setValue(""32"");request.addProperty(pi);SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.dotNet = true;envelope.setOutputSoapObject(request);HttpTransportSE aht = new HttpTransportSE(URL);try{    aht.call(SOAP_ACTION, envelope);    SoapPrimitive results = (SoapPrimitive)envelope.getResponse();}catch (Exception e){    e.printStackTrace();}</code></pre>","326385","","","","","2012-05-02 09:01:48","Call webservice from Android using KSoap simply returning ""error"" string","<java><android><web-services><ksoap2>","2","0","","",""
"2717269","1","2717594","","2010-04-26 22:08:58","0","472","<p>I'm fairly new to the Android platform and was wondering if I could get some advice for my current head scratcher:</p><p>I'm making an app which in one view will need an image, which can be scrolled on one axis, with a load of selectable points over the top of it.  Each point needs to be positionable on the x and y (unlikely to change once the app is running, but I'll need to fine tune the positions whilst I'm developing it).  </p><p>I'd like to be able to let the user select each point and have a graphic drawn on the point the user has selected or just draw a graphic on one/more points without user intervention.</p><p>I though for the selectable points I could extend the checkbox with a custom image for the selected state - does that sounds right, or is there a better way of doing this?  Is there any thing I can read up on doing this, I can't seem to find anything on the net about replacing the default images?</p><p>I was going to use the absolute layout, but see that it's been depreciated and I can't find anything to replace it.</p><p>Can anyone give me some code or advice on where to read up on what I need to do?</p><p>Thank you in advance</p>","264276","","","","","2010-04-26 23:11:54","Custom layout in Android: scrollable graphic with selectable elements over top","<android><layout>","1","0","","",""
"2717278","1","4565841","","2010-04-26 22:10:28","10","7518","<p><a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"">Android NinePatch</a> images seem to be standard .png files with extra information. Is there a spec for the format anywhere, as I'd like to be able to implement this on other platforms?</p>","1737","","","","","2013-07-01 12:36:54","Android NinePatch .png file format?","<android><file-format><nine-patch>","7","0","0","",""
"2717587","1","2717652","","2010-04-26 23:10:11","0","66","<p>I've got a free app I'm planning on submitting to the marketplace. Looking over the submission form I see they expect a web site or email for support.</p><p>Users?! I've got to worry about users if I submit an app? I suppose I would like to get some abuse from users, but I don't want to go broke doing it.</p><p>So what are my options? </p><p>I have a web site--I suppose I could install forum software on it--that sounds like a lot of work though.</p><p>Some apps reference a blogspot page--or I could use my Word Press site. They seems a bit disorganized for getting user feedback though.</p>","325124","","","","","2010-04-26 23:24:24","Android App Support Options","<android><marketplace>","1","0","1","",""
"2717614","1","2717710","","2010-04-26 23:15:30","1","6601","<p>i am trying to display a random string each time a button is pressed from a set of strings defined in strings.xml . this is an example of the strings ID's</p><pre><code>&lt;string name=""q0""&gt;    &lt;string name=""q1""&gt;    &lt;string name=""q2""&gt;    &lt;string name=""q3""&gt;    &lt;string name=""q4""&gt;</code></pre><p>java code for getting a random string.</p><pre><code>private static final Random rgenerator = null;    int RandomQ = R.string.q0  (rgenerator.nextInt(5) + 1);    String q = getString(RandomQ);</code></pre><p>if i try to use this java code i get an error at ""q0"" in R.string.q0  which is <code>The method q0(int) is undefined for the type R.string</code> if i try to use the quick fix and create a method, it works. but it wont let me save or run the app because it replaces my create method and shows this message </p><pre><code>R.java was modified manually! Reverting to generated version!</code></pre><p>thanks for reading.</p>","326423","","","","","2013-03-12 23:13:42","Show random string","<android>","2","1","2","",""
"2717750","1","2717791","","2010-04-26 23:45:22","2","3707","<p>I'm having trouble with a WebView always filling the full screen and thus covering my tabs.  Here is my code for the tabhost..</p><pre><code>    public class tabNZBMobile extends TabActivity { public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);  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)  intent = new Intent().setClass(this, NewzbinMobile.class);  // Initialize a TabSpec for each tab and add it to the TabHost  spec = tabHost.newTabSpec(""search"").setIndicator(""Search"",    res.getDrawable(R.drawable.ic_tab_search))    .setContent(intent);  tabHost.addTab(spec);  // Do the same for the other tabs  intent = new Intent().setClass(this, sabnzbWeb.class);  spec = tabHost.newTabSpec(""sabnzbweb"").setIndicator(""SabNZBd"",    res.getDrawable(R.drawable.ic_tab_sabnzbweb))    .setContent(intent);  tabHost.addTab(spec);  tabHost.setCurrentTabByTag(""search""); }}</code></pre><p>My first tab (NewzbinMobile.class) displays correctly, it's just a relativelayout.  But my second tab is an activity showing a webview and it is showing, but using the whole screen, covering my tabs.  Here is the code for my second tab.</p><pre><code>    public class sabnzbWeb extends Activity { WebView mWebView; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  String sabNZBurl = new String(""http://test.server.org:8080/m"");  mWebView = new WebView(this);  mWebView.getSettings().setJavaScriptEnabled(true);  setContentView(mWebView);  mWebView.loadUrl(sabNZBurl); }}</code></pre>","326430","","","","","2010-04-27 14:10:25","WebView inside Tab hiding the tabWidgets","<android><webview><android-tabhost>","2","0","1","",""
"2717954","1","2717972","","2010-04-27 00:29:37","28","11702","<p>When i press a button in my app, I need to return to the last activity.</p><p>Any ideas?</p>","269671","","114066","","2011-01-25 09:07:50","2014-04-15 12:33:35","Android - Simulate Back Button","<android><button><back>","4","0","4","",""
"2718202","1","2726348","","2010-04-27 01:35:59","20","37951","<p>I'm trying to filter my ListView which is populated with this ArrayAdapter:</p><pre><code>package me.alxandr.android.mymir.adapters;import java.util.ArrayList;import java.util.Collection;import java.util.Collections;import java.util.HashMap;import java.util.Iterator;import java.util.Set;import me.alxandr.android.mymir.R;import me.alxandr.android.mymir.model.Manga;import android.content.Context;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.Filter;import android.widget.SectionIndexer;import android.widget.TextView;public class MangaListAdapter extends ArrayAdapter&lt;Manga&gt; implements SectionIndexer{    public ArrayList&lt;Manga&gt; items;    public ArrayList&lt;Manga&gt; filtered;    private Context context;    private HashMap&lt;String, Integer&gt; alphaIndexer;    private String[] sections = new String[0];    private Filter filter;    private boolean enableSections;    public MangaListAdapter(Context context, int textViewResourceId, ArrayList&lt;Manga&gt; items, boolean enableSections)    {        super(context, textViewResourceId, items);        this.filtered = items;        this.items = filtered;        this.context = context;        this.filter = new MangaNameFilter();        this.enableSections = enableSections;        if(enableSections)        {            alphaIndexer = new HashMap&lt;String, Integer&gt;();            for(int i = items.size() - 1; i &gt;= 0; i--)            {                Manga element = items.get(i);                String firstChar = element.getName().substring(0, 1).toUpperCase();                if(firstChar.charAt(0) &gt; 'Z' || firstChar.charAt(0) &lt; 'A')                    firstChar = ""@"";                alphaIndexer.put(firstChar, i);            }            Set&lt;String&gt; keys = alphaIndexer.keySet();            Iterator&lt;String&gt; it = keys.iterator();            ArrayList&lt;String&gt; keyList = new ArrayList&lt;String&gt;();            while(it.hasNext())                keyList.add(it.next());            Collections.sort(keyList);            sections = new String[keyList.size()];            keyList.toArray(sections);        }    }    @Override    public View getView(int position, View convertView, ViewGroup parent)    {        View v = convertView;        if(v == null)        {            LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.mangarow, null);        }        Manga o = items.get(position);        if(o != null)        {            TextView tt = (TextView) v.findViewById(R.id.MangaRow_MangaName);            TextView bt = (TextView) v.findViewById(R.id.MangaRow_MangaExtra);            if(tt != null)                tt.setText(o.getName());            if(bt != null)                bt.setText(o.getLastUpdated() + "" - "" + o.getLatestChapter());            if(enableSections &amp;&amp; getSectionForPosition(position) != getSectionForPosition(position + 1))            {                TextView h = (TextView) v.findViewById(R.id.MangaRow_Header);                h.setText(sections[getSectionForPosition(position)]);                h.setVisibility(View.VISIBLE);            }            else            {                TextView h = (TextView) v.findViewById(R.id.MangaRow_Header);                h.setVisibility(View.GONE);            }        }        return v;    }    @Override    public void notifyDataSetInvalidated()    {        if(enableSections)        {            for (int i = items.size() - 1; i &gt;= 0; i--)            {                Manga element = items.get(i);                String firstChar = element.getName().substring(0, 1).toUpperCase();                if(firstChar.charAt(0) &gt; 'Z' || firstChar.charAt(0) &lt; 'A')                    firstChar = ""@"";                alphaIndexer.put(firstChar, i);            }            Set&lt;String&gt; keys = alphaIndexer.keySet();            Iterator&lt;String&gt; it = keys.iterator();            ArrayList&lt;String&gt; keyList = new ArrayList&lt;String&gt;();            while (it.hasNext())            {                keyList.add(it.next());            }            Collections.sort(keyList);            sections = new String[keyList.size()];            keyList.toArray(sections);            super.notifyDataSetInvalidated();        }    }    public int getPositionForSection(int section)    {        if(!enableSections) return 0;        String letter = sections[section];        return alphaIndexer.get(letter);    }    public int getSectionForPosition(int position)    {        if(!enableSections) return 0;        int prevIndex = 0;        for(int i = 0; i &lt; sections.length; i++)        {            if(getPositionForSection(i) &gt; position &amp;&amp; prevIndex &lt;= position)            {                prevIndex = i;                break;            }            prevIndex = i;        }        return prevIndex;    }    public Object[] getSections()    {        return sections;    }    @Override    public Filter getFilter()    {        if(filter == null)            filter = new MangaNameFilter();        return filter;    }    private class MangaNameFilter extends Filter    {        @Override        protected FilterResults performFiltering(CharSequence constraint) {            // NOTE: this function is *always* called from a background thread, and            // not the UI thread.            constraint = constraint.toString().toLowerCase();            FilterResults result = new FilterResults();            if(constraint != null &amp;&amp; constraint.toString().length() &gt; 0)            {                ArrayList&lt;Manga&gt; filt = new ArrayList&lt;Manga&gt;();                ArrayList&lt;Manga&gt; lItems = new ArrayList&lt;Manga&gt;();                synchronized (items)                {                    Collections.copy(lItems, items);                }                for(int i = 0, l = lItems.size(); i &lt; l; i++)                {                    Manga m = lItems.get(i);                    if(m.getName().toLowerCase().contains(constraint))                        filt.add(m);                }                result.count = filt.size();                result.values = filt;            }            else            {                synchronized(items)                {                    result.values = items;                    result.count = items.size();                }            }            return result;        }        @SuppressWarnings(""unchecked"")        @Override        protected void publishResults(CharSequence constraint, FilterResults results) {            // NOTE: this function is *always* called from the UI thread.            filtered = (ArrayList&lt;Manga&gt;)results.values;            notifyDataSetChanged();        }    }}</code></pre><p>However, when I call filter('test') on the filter nothing happens at all (or the background-thread is run, but the list isn't filtered as far as the user conserns). How can I fix this?</p>","213323","","","","","2014-04-04 12:05:46","Custom filtering in Android using ArrayAdapter","<android><listview><filter><android-arrayadapter>","3","1","23","",""
"2718269","1","3107787","","2010-04-27 01:57:54","0","3406","<p>My application use the SDCard to store data (about 100 Mb of stuff). I would like to delete these file when the application is deleted through the application manager and offer a way to clear the data from there (like the Google Apps does). Any ideas ? </p>","211682","","","","","2010-06-24 06:53:59","Android - Remove data from SDCard","<java><android>","1","0","2","",""
"2718379","1","2725946","","2010-04-27 02:39:08","1","1211","<p>I have to build a feature in my application which allows user to send a skype message.For this I have installed skype lite client for Android (although offically the download has been currently withdrawn from Skype).Now how to initiate the activity from my application OR simply send the chat message without bringing it front, assuming I have skype installed in Android &amp; also signed in already.Any help ? Thanks.</p>","315619","","","","","2010-04-27 23:45:19","How to send IM message like Skype in Android?","<android>","1","1","","",""
"2718475","1","2719100","","2010-04-27 03:13:15","0","1329","<p>I'm a bit stumped here, I'm trying to make it so an image (already in the drawable folder) gets created everytime you touch the screen and removed when the finger is lifted. I have the touch part coded already, overriding the onTouch method with a couple switch cases that handle each type of action (down, up, move, etc). But I can't for the life of me figure out how to make the image appear and then disappear with the coordinates (matrix?) of where the finger is.</p><p>Any help would be greatly appreciated!</p>","326468","","","","","2010-04-27 06:12:17","Android SDK: Create image on touch","<android><image>","1","0","","",""
"2718486","1","","","2010-04-27 03:17:05","0","3950","<p>I have a custom checkbox with these attributes: </p><pre><code>android:id=""@+id/map_toolbar_details""android:layout_width=""80px""android:layout_height=""106px""android:scaleType=""center""macro:selectedResource=""@drawable/map_toolbar_details_selected""android:button=""@drawable/map_toolbar_details""</code></pre><p>When I load it up, the image gets stretched, even though it's set to scaleType center. If I set a background, I do not have this problem.</p>","92259","","","","","2011-08-27 22:57:28","Changing the appearance of a custom android checkbox without the image scaling?","<android><checkbox>","1","0","","",""
"2718489","1","3351829","","2010-04-27 03:20:00","17","4130","<p>I was wondering what the most effective way of preventing people from stealing my application (downloading a copy of the .apk online rather than buying it).</p><p>I've spent a <strong>lot</strong> of time on one in particular (Droidbox) and won't be releasing Sync until I can guarantee that the people who are providing illegal copies of the pro version aren't able to.</p><p>Anyone implemented this? I've tried checking my package signature verses an the signature of an unsigned copy but it appears to be the same - perhaps I'm doing something incorrectly here. I'm unsure whether people actually distribute the signed .apk in which case I don't think signature validation would work to begin with...</p><p><strong>Please note, this question is specific to Android Marketplace Applications</strong> - the difference being, application delivery is out of my hands and I have no way of linking between a legitimate purchase and an illegal download.</p>","110762","","114066","","2010-07-28 10:03:14","2014-02-08 04:29:46","How to prevent application thievery (specific to Android applications)?","<android><piracy-protection>","7","0","12","",""
"2718563","1","","","2010-04-27 03:43:27","0","364","<p>In Android, how can I apply a style to an API action?</p><p>I am using the RingtoneManager.RINGTON_PICKER action to let the user select an alarm, and would like to apply the standard theme that the other child-activities use.</p><p>Does anyone know how I can apply a theme? The code I'm using to open the RINGTONE_PICKER is</p><pre><code>Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);((Activity)mContext).startActivityForResult(intent, BackendConstant.RINGTONE_CODE);</code></pre>","308675","","308675","","2010-04-28 22:44:14","2010-04-29 06:59:54","How can I apply a theme/style to an Action android","<android><coding-style><action><themes>","1","0","","",""
"2718565","1","2718848","","2010-04-27 03:43:32","7","6053","<p>I am programming Android applications, and the best way here may or may not be the same as Java in general.</p><p>I simply want to be able to set a debug flag that will only execute certain portions of code when it's set to true––equiv to C++ setting a preprocessor #define DEBUG and using #ifdef DEBUG.</p><p>Is there an accepted or best way to accomplish this in Java?</p><p>Right now I'm just going to set a variable in my Application object, but I don't imagine this is the best way.</p>","325011","","774691","","2013-10-22 02:49:44","2013-10-22 02:49:44","Best Way to Include Debug Code?","<java><android><debugging><buildconfig>","5","1","7","",""
"2718664","1","2719559","","2010-04-27 04:09:01","2","246","<p>I am building and designing a (mostly) read-only interface to some data. I'll be uing ASP.NET MVC to build a psudo-restful API. I'm wondering if anyone can provide some resources for building full-client applications for various mobile platforms, iPhone, Android, Blackberry, Windows Mobile, etc.</p><p>I'm thinking that serving up XML data is going to be the most simple and universal, but parsing XML in objective-C for example doesn't sound like fun to me, but maybe there are some good libaries out there to help ease this task?</p><p>In other words, what formt will be the quickest to implement on the client side? Are there any JSON parsrs for iPhone or Android? I know there are .NET JSON parsers, but not sure about other platforms -- is ther another format that might better? Or should I stick with pure XML and deal with it on each platform differently?</p>","86860","","424723","","2010-11-10 00:11:45","2010-11-10 00:11:45","Designing a service for consumption on multiple mobile platforms","<.net><iphone><android><web-services><windows-phone-7>","5","0","1","",""
"2718775","1","2718787","","2010-04-27 04:39:32","8","1227","<p>Looking at various <a href=""http://developer.android.com/reference/java/lang/CharSequence.html"">pages in the Android docs</a>, some of them list ""Known Indirect Subclasses"". What does this mean?</p>","165495","","","","","2010-04-27 04:49:32","Define ""Indirect subclass"" in Android","<android><class>","1","0","1","",""
"2718800","1","2718868","","2010-04-27 04:46:49","0","595","<p>I am retrieving a list of images and text from a web service. The images are getting displayed in the list view. But the problem is, when i scroll down the list the entire images are getting loaded once again. When i scroll twice or thrice there is a OutofMemory occuring... Can anyone tell me how to cache the images and also to avoid the loading of the images that are already loaded when i scroll down. I have tried to increase inSampleSize but it didnt work... Here's the code....</p><pre><code>public static Bitmap loadImageFromUrl(String url) {    InputStream inputStream;    Bitmap b;    try {        inputStream = (InputStream) new URL(url).getContent();        BitmapFactory.Options bpo= new BitmapFactory.Options();        b=BitmapFactory.decodeStream(inputStream, null, bpo);        b.recycle();        bpo.inSampleSize = 2;        return b;    } catch (IOException e) {        throw new RuntimeException(e);    }//  return null;  } </code></pre>","303155","","180100","","2010-04-27 05:10:44","2010-04-27 05:13:52","caching images that are retrieved","<android><image><caching><bitmap>","1","0","","",""
"2718947","1","","","2010-04-27 05:33:43","4","2671","<p>I am developing a calendar app, wherein i will using a service to display date in the application icon text itself. For Eg: If date is: 26 Apr 2010, then my application name in the phone menu will also show the same.So I am not understanding how to change the application's icon text dynamically through program.</p>","326576","","","","","2010-05-26 14:15:57","Changing the application icon text dynamically in Android","<android><android-manifest>","2","0","1","",""
"2719031","1","2720622","","2010-04-27 05:55:37","4","913","<p>I need to use Helvetica font in my Android application. I have following questions regarding the same:<br>1. Is helvetica.ttf free for use in commercial projects?<br>2. What are the legal issues that one must consider when using fonts in their applications?</p><p>Thanks.</p>","236128","","","","","2011-10-14 21:35:32","Using fonts in my applications","<android><licensing><fonts><legal>","1","0","1","",""
"2719173","1","6211536","","2010-04-27 06:32:12","11","37675","<p>I'm trying to change the standard light grey to a light green. Seems that there is not a simple way to do this (through Android Themes, for example) but I have found a workaround as explained at this page: <a href=""http://tinyurl.com/342dgn3"" rel=""nofollow"">http://tinyurl.com/342dgn3</a>. </p><p>The author seems disappeared, can someone help me integrating this code?  I don't understand where I need to implement the <code>LayoutInflater</code> factory class. </p>","321354","","321354","","2013-04-27 17:08:15","2013-04-27 17:08:15","Change background color of android menu","<android><menu><background><layout-inflater>","3","4","2","2013-04-03 12:08:07",""
"2719257","1","3182442","","2010-04-27 06:49:22","2","1130","<p>I am trying to use the Jets3t library within an Android application, and I keep getting errors with the Rest service when I use the library.</p><pre><code>04-27 16:47:39.491: ERROR/S3Service(225): Couldn't initialize a sax driver for the XMLReader</code></pre><p>I have tried to include the Xerces library and the Crimson library, and it dont play well.   I get this error:</p><pre><code>Attempt to include a core class (java.* or javax.*) in something otherthan a core library. It is likely that you have attempted to includein an application the core library (or a part thereof) from a desktopvirtual machine. This will most assuredly not work. At a minimum, itjeopardizes the compatibility of your app with future versions of theplatform. It is also often of questionable legality.If you really intend to build a core library -- which is onlyappropriate as part of creating a full virtual machine distribution,as opposed to compiling an application -- then use the""--core-library"" option to suppress this error message.</code></pre><p>Is there something I can do to get it working ?</p>","151447","","","","","2010-07-05 22:19:11","Jets3t on Android","<android><jets3t>","1","1","2","",""
"2719285","1","","","2010-04-27 06:56:29","1","431","<p>I'm working on security application which will copy all contacts to some other database and delete all contacts from phonebook.I'm testing this on android HTC HERO.I'm successful to delete contacts from phonebook and create new contact info database,Till 200 it is working, but after 200 contacts its not working properly.After tht application starts throwing error.There is one Sync with Google Option in Menu>Setting>Data Sync, I think that is creating problem.</p><p>There is notification that ""Too many contacts deleted""n if i click tht there will b a dialog with title ""Delete Limit exceeded"".Is there anything i can do to stop syncronization or any other ideas by which i can achieverequired output?</p><p>Please Help me on this </p>","316190","","20261","","2010-04-27 07:21:14","2010-06-30 00:51:32","Cant delete more than 200 contacts in HTC HERO","<android><android-emulator><android-widget><android-manifest>","1","0","","",""
"2719415","1","2719570","","2010-04-27 07:25:09","0","1505","<p>So I have an app where I put arbitrary strings in a database and later extract them like this:</p><pre><code>Cursor DBresult = myDatabase.query(false, Constant.DATABASE_NOTES_TABLE_NAME,             new String[] {""myStuff""}, where, null, null, null, null, null);DBresult.getString(0);</code></pre><p>This works fine in all cases except for when the string looks like a float number, for example ""221.123123123"". After saving it to the database I can extract the database to my computer and look inside it with a DB-viewer, and the saved number is correct. However, when using cursor.getString() the string ""221.123"" is returned. I cant for the life of me understand how I can prevent this. I guess I could do a cursor.getDouble() on every single string to see if this gives a better result, but that feels sooo ugly and inefficient. Any suggestions?</p><p>Cheers,</p><p>edit: I just made a small test program. This program prints ""result: 123.123"", when I would like it to print ""result: 123.123123123""</p><pre><code>SQLiteDatabase database = openOrCreateDatabase(""databas"", Context.MODE_PRIVATE, null);database.execSQL(""create table if not exists tabell (nyckel string primary key);"");ContentValues value = new ContentValues();value.put(""nyckel"", ""123.123123123"");database.insert(""tabell"", null, value);Cursor result = database.query(""tabell"", new String[]{""nyckel""}, null, null, null, null, null);result.moveToFirst();Log.d(""TAG"",""result: "" + result.getString(0));</code></pre>","249871","","249871","","2010-04-27 07:51:19","2010-04-27 08:07:13","Storing float numbers as strings in android database","<android><sqlite>","1","2","","",""
"2719425","1","","","2010-04-27 07:26:43","4","6777","<p>I need to create a GUI (layout+views) in my .java activity class (I know it's far more flexible and easier to use .xml layout file, but I don't want to use it for now).</p><p>I can't find any setGravity() (but a ""Gravity"" object I can't figure how to use) or any set setMargin() method for the ""View"" object.</p><p>What is the easiest way to do it ?</p><p>Thanx.  </p>","220095","","","","","2011-01-04 13:55:06","Set attributes (margin, gravity, etc...) to an Android view programmatically (without XML)","<android><gui>","2","1","","",""
"2719430","1","","","2010-04-27 07:28:45","0","1392","<p>My android application is in blueotooth SPP server mode and listening for client devices,my application knows the passcode required for pairing of that devices.</p><p>My question is, Is it possible to handle pairing request through application.Thanks and Regards.</p>","271769","","","","","2013-01-30 10:35:38","handling bluetooth spp pairing request thru app","<android><bluetooth>","2","0","1","",""
"2719433","1","2720673","","2010-04-27 07:29:11","4","7302","<p>Is it at all possible, from within an AsyncTask that is NOT an inner class of the calling Activity class, to get a reference to the instance of Activity that initiated execution of the AsyncTask?</p><p>I am aware of <a href=""http://stackoverflow.com/questions/2379233/android-asynctask-in-external-class"">this thread</a>, however it doesn't exactly address how to reference the calling Activity.  Some suggest passing a reference to the Activity as a parameter to the AsyncTask constructor, however, it's reported that doing so will always result in a NullPointerException.</p><p>So, I'm at a loss. My AsyncTask provides robust functionality, and I don't want to have to duplicate it as an inner class in <em>every</em> Activity that wants to use it. There must be an elegant solution.</p>","325011","","","","","2013-03-30 21:10:45","Getting Reference to Calling Activity from AsyncTask (NOT as an inner class)","<android><android-asynctask><outer-classes>","2","0","3","",""
"2719535","1","2746167","","2010-04-27 07:50:41","10","4858","<p>I'm using Android's <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"">android.graphics.Canvas</a> class <a href=""http://code.google.com/p/publicobject/source/browse/shush/src/com/publicobject/shush/ClockSlider.java"">to draw a ring</a>. My onDraw method clips the canvas to make a hole for the inner circle, and then draws the full outer circle over the hole:</p><pre><code>    clip = new Path();    clip.addRect(outerCircle, Path.Direction.CW);    clip.addOval(innerCircle, Path.Direction.CCW);    canvas.save();    canvas.clipPath(clip);    canvas.drawOval(outerCircle, lightGrey);    canvas.restore();</code></pre><p>The result is a ring with a pretty, anti-aliased outer edge and a jagged, ugly inner edge:</p><p><img src=""http://3.bp.blogspot.com/_21QnE9BxmkU/S9PG2xO-pwI/AAAAAAAAB2g/YvdUt_2uOdA/s640/twoandahalfhours.png"" alt=""aliased""></p><p>What can I do to antialias the inner edge?</p><p>I don't want to cheat by drawing a grey circle in the middle because the dialog is slightly transparent. (This transparency isn't as subtle on on other backgrounds.)</p>","40013","","","","","2013-11-06 14:34:30","How do I antialias the clip boundary on Android's canvas?","<android><android-widget>","2","0","10","",""
"2719720","1","","","2010-04-27 08:24:34","0","368","<p>i ran into a problem with remote services. after i started and bound my service, i want/need to access it's functionality. this works just fine if i work with buttons and onclick-controllers just as in <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteServiceBinding.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteServiceBinding.html</a></p><p>but actually, i need to access the services functions DIRECTLY after binding the service, like:</p><p>Intent intent = new Intent(IwlService.class.getName());bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);</p><p>String.valueOf(wlService.getDataFromService()); // this will CRASH the app!!!</p><p>if i access the service function ""getDataFromService()"" in an onClickListener, it works perfectly.</p><p>how do i access the services functions directly after binding/starting the service?</p>","311004","","","","","2010-04-27 11:24:52","accessing remote services functions","<java><android><service>","1","0","","",""
"2719793","1","","","2010-04-27 08:39:50","0","315","<p>I am trying to accomplish a view like this: left side = live camera preview, right side = a column of 4 images. But all that I managed with the following xml was a fullscreen live camera preview. Android 1.5 emulator.</p><p>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=""fill_parent""&gt;    &lt;proto.wiinkme.SurfaceViewEx         android:id=""@+id/preview""         android:layout_height=""fill_parent""         android:layout_width=""wrap_content""         android:layout_alignParentLeft=""true""        android:layout_weight=""3""/&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_toRightOf=""@+id/preview""        android:layout_alignParentRight=""true""        android:layout_weight=""1""&gt;        &lt;ImageView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/mother_earth""            android:src=""@drawable/mother_earth_show"" /&gt;        &lt;ImageView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/meadow""            android:src=""@drawable/meadow_show"" /&gt;        &lt;ImageView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/trap""            android:src=""@drawable/trap_show"" /&gt;        &lt;ImageView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/whistle""            android:src=""@drawable/whistle_show"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","243827","","","","","2010-04-27 13:23:27","What is wrong with this layout? Android","<xml><android><gui>","3","0","","",""
"2719829","1","2720701","","2010-04-27 08:45:55","0","1233","<p>I am trying to get the GPS location of my HTC magic using the following code : </p><pre><code>public class TestGPS extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     final TextView tv1 = (TextView)findViewById(R.id.tv1);    final TextView tv2 = (TextView)findViewById(R.id.tv2);    LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new LocationListener()    {        public void onStatusChanged(String provider, int status, Bundle extras)        {        }        public void onProviderEnabled(String provider)        {        }        public void onProviderDisabled(String provider)        {        }        public void onLocationChanged(Location location)        {            tv1.setText(String.valueOf(location.getLatitude()));            tv2.setText(String.valueOf(location.getLongitude()));        }    });}</code></pre><p>}</p><p>I waited for 5 minutes 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 HTC Magic with 1.6 SDK.</p><p>Can someone please tell me what's wrong with the code? Thanks.</p>","164460","","","","","2010-10-27 18:47:10","Android GPS location updates doesn't work","<android><gps>","1","0","","",""
"2719862","1","2720710","","2010-04-27 08:53:16","2","758","<p>When a TabWidget is using intents to designate the target Activity for each tab, is there any special handling of those Activities on the Activity Stack outside of the default operation?</p><p>For Instance, if my app has tabs A, B, and C, and I click them in this order––A, B, A, C, A, B––how will the Activity stack change?</p><p>My understanding of the default operation, if startActivity() is called each time on the intent, would have the Stack keep loading up new instances of the activities: A, AB, ABA, ABAC, ABACA, ABACAB</p><p>It's hard to believe that's how it works though... Seems like it would be a waste of resources and could be endless. Can anyone tell me how this will actually work?</p>","325011","","","","","2010-04-27 12:00:25","TabWidget Activity Handling - Does it Create a New Activity EVERY Time?","<android><activity><tabwidget><activity-stack>","2","0","","",""
"2719870","1","","","2010-04-27 08:55:39","0","75","<p>I wonder if it's possbile, and if it is, what i`am suppose to know, in order to run an Activity in some application, while i am calling it from another application.</p><p>for example, now i am on Application A, and i want to run an Activity on Application B.what parameters do i need to know in order to do that?</p><p>Thanks,</p>","260511","","","","","2010-04-27 11:18:32","what to know in order running Activity in extern application","<android>","1","0","","",""
"2719995","1","2722127","","2010-04-27 09:20:27","0","949","<p>I'm creating an Android app where in the user can set the daily reminder, and at the designated time, the phone's alarm goes off and an activity is launched.</p><p>App uses the latest version of the SDK and the emulator. How do I get started with this? </p><p>Thanks,Sri</p>","156225","","","","","2010-04-27 14:39:12","Android: Daily Reminder","<android>","1","0","0","",""
"2720133","1","2720184","","2010-04-27 09:44:42","1","128","<p>Iam building a system with includes couple of applications,I would like to know if there is a way to design a ""main"" application which will include <strong>inside</strong> several applications, so in this case i could also share same proccess</p><p>thanks,</p><p>ray.</p>","260511","","14357","","2010-04-27 09:47:08","2010-04-27 11:55:12","Parent - child application model","<android>","2","0","1","",""
"2720164","1","","","2010-04-27 09:50:26","12","37795","<p>Maybe you can help.</p><p>Is it possible to get list of all <code>Processes</code> which are running in the Android system, and kill some of them? I know that there are some applications (<code>task managers</code>), but I would like to write my own, simple application.</p><p>I would like to write simple task manager, just list of all processes and button which will kill some of them.</p><p>Could you just write some Java methods which I can call in order to get list of process, and method for killing them. Or just give me some advice's.</p>","326723","","940096","","2012-07-25 04:18:40","2012-07-25 04:44:07","Android process killer","<android><processes>","3","0","14","",""
"2720268","1","2720363","","2010-04-27 10:09:24","0","746","<p>I want to use precise layout on Nexus One, my code is 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;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""90dp""&gt;    &lt;ImageView        android:layout_width=""5dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d10"" /&gt;    &lt;ImageView        android:layout_width=""94dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d5"" /&gt;    &lt;ImageView        android:layout_width=""94dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d6"" /&gt;    &lt;ImageView        android:layout_width=""94dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d7"" /&gt;    &lt;ImageView        android:layout_width=""94dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d8"" /&gt;    &lt;ImageView        android:layout_width=""94dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d9"" /&gt;    &lt;ImageView        android:layout_width=""5dp""        android:layout_height=""fill_parent""        android:src=""@drawable/d10"" /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>But it turns out on Nexus One, the screen width is not 480 px. So this LinearLayout will exceed the screen width.</p><p>How should I fix this?</p>","234939","","234939","","2010-04-27 10:41:07","2010-04-27 10:41:07","Can't get precise layout on Nexus One","<android>","1","3","","",""
"2720315","1","","","2010-04-27 10:20:01","72","22912","<p>I've seen AccountManager in the Android SDK and that it is used for storing account information. Thus, I cannot find any general discussion of what it is intended for. Does anyone know of any helpful discussions of what the intention behind AccountManager is and what it buys you? Any opinions of what type of Accounts this is suitable for?  Would this be where you'd put your user's account information for a general web service?</p>","29031","","356895","","2012-08-03 22:35:14","2013-09-23 07:48:33","What should I use Android AccountManager for?","<android><accountmanager>","3","2","24","2013-04-22 05:02:50",""
"2720719","1","2720868","","2010-04-27 11:30:53","3","9719","<p>I'm trying to get something like this: <a href=""http://img202.imageshack.us/img202/552/layoutoy.png"" rel=""nofollow"">http://img202.imageshack.us/img202/552/layoutoy.png</a>. I'm using this as a list item (technically as the group view of an ExpandableListView).</p><p>Here's the XML file:</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=""?android:attr/listPreferredItemHeight""&gt;    &lt;TextView        android:id=""@+id/list_item_text""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:ellipsize=""end"" /&gt;    &lt;Button        android:id=""@+id/list_item_button""        android:text=""Click me!""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_toRightOf=""@id/list_item_text"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>But this doesn't work. The Button doesn't wrap its contents, instead it uses all available horizontal space. The TextView <em>does</em> wrap its contents, but what I want it to do is to cut off when it overlaps the Button.</p><p>In other words, I want all the buttons to be of the same width, regardless of the amount of text in the textviews. Is this at all possible?</p>","279363","","","","","2011-05-27 06:14:56","How to align Button to the right, without being overlapped by TextView?","<java><xml><android><relativelayout>","2","0","","",""
"2720947","1","2721448","","2010-04-27 12:03:11","2","1524","<p>How to find what service running on background on Android?like input method service, ....Using adb or terminal on android device ?Could I use ""top"" or ""ps"" command? </p><p>Maybe I have to ask in another way?Does the service be presented as one ""process"", then we can use ""ps"" or ""top"" command to find it? </p>","206630","","206630","","2010-04-28 02:39:34","2010-04-28 02:39:34","How to find what service running on background on Android?","<android>","1","1","","",""
"2720967","1","4144613","","2010-04-27 12:06:14","1","2262","<p>I need to cancel the missed calls notification for a certain number. I've seen the NotificationMgr class on com.android.phone but i'm unable to call it trough reflection. Is there any other way?</p>","321354","","","","","2011-03-25 07:13:03","Update missed calls notification on android","<android>","2","0","0","",""
"2721236","1","2825756","","2010-04-27 12:45:40","0","154","<p>i have a small form with </p><p>four EditText fields in which second EditText is disable for text Editing.</p><p>now when i roll Android Phone ball to move from the top to bottom first time it selects disabled EditText and then third EditText and moves downward to foruth EditText.</p><p>but when i try to move upward  on Disabled EditText it displays me error Force Close after selecting it.</p><p>it is only happening in phone not in Emulator.</p><p>please guide how to resolve this issue?</p><p>any help would be appriciated.</p>","249991","","249991","","2010-05-13 09:39:04","2010-05-13 09:43:00","Force Close problem while Moving track ball on disabled EditText On HTC Hero Phone?","<android><activity>","1","4","","",""
"2721386","1","2725864","","2010-04-27 13:05:11","12","2785","<p>In Android <a href=""http://developer.android.com/intl/de/guide/publishing/app-signing.html"">documentation</a> concerning code signing we can read: ""<em>By signing multiple applications with the same certificate and using signature-based permissions checks, your applications can <strong>share code</strong> and data in a secure manner.</em>""</p><p>How exactly such code sharing can be done? Is it possible to release main application and multiple exchangeable plugins then discover them at runtime? What does source code looks like and what are advantages over ""standard"" intents calls from/to different APK packages?</p>","7162","","164901","","2010-06-05 23:06:46","2010-06-05 23:06:46","Android: how to share code between projects signed with the same certificate","<android><certificate><code-signing><apk>","1","0","8","",""
"2721496","1","","","2010-04-27 13:17:45","1","510","<p>I am trying develop an application which shows user current location. To find user's current location i am using following code: </p><pre><code>import android.location.Location;import android.location.LocationListener;import android.location.LocationProvider;import android.os.Bundle;public class MyLocationListener implements LocationListener {private static double latitude;private static double longitude;public static boolean gpsAvailable = false;@Overridepublic void onLocationChanged(Location arg0) {    latitude = arg0.getLatitude();    longitude = arg0.getLongitude();    // Log.d(""MyLocationListener"", ""onLocationChanged"");}@Overridepublic void onProviderDisabled(String provider) {    // Log.d(""MyLocationListener"", ""onProviderDisabled"");}@Overridepublic void onProviderEnabled(String provider) {    // Log.d(""MyLocationListener"", ""onProviderEnabled"");}@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {    // Log.d(""MyLocationListener"", ""onStatusChanged called"");    if (provider.equals(""gps"") &amp;&amp; status != LocationProvider.AVAILABLE) {        gpsAvailable = false;        // Log.d(""MyLocationListener"", ""status NOTAVAILABLE"");    } else {        gpsAvailable = true;        // Log.d(""MyLocationListener"", ""status AVAILABLE"");    }}public static double getLatitude() {    return latitude;}public static double getLongitude() {    return longitude;}}</code></pre><p>I have used this code to successfully get the GPS location on android 1.5 SDK but with 2.0 i am unable to find user's current location. I have tested this code on Droid and Magic.</p><p>Please help...</p>","152867","","","","","2010-04-27 13:17:45","Error getting GPS location on Droid + android 2.0 sdk","<android>","0","1","","",""
"2721562","1","","","2010-04-27 13:26:56","1","189","<p>I am trying to downgrade Android developer phone 1's firmware version from 1.6. to 1.5 by following <a href=""http://developer.htc.com/adp.html"" rel=""nofollow"">this</a> link...</p><p><a href=""http://developer.htc.com/adp.html"" rel=""nofollow"">http://developer.htc.com/adp.html</a></p><p>Here I have completed till steps #7 of <strong>Update the Device Radio Firmware</strong>. while in steps 8,</p><p>It start to load update.zip file.It analyze the update.zip file. and at last it shows that <strong>update Aborted</strong></p><p>I have followed exact all steps mentioned in that list. </p><p>Insight will be appreciated.</p><p>-Dhaiwat</p>","193583","","243999","","2010-04-27 14:13:49","2010-04-27 20:48:29","Android developer phone 1 downgrade firmware","<android><version><firmware><downgrade>","1","0","","",""
"2721580","1","","","2010-04-27 13:28:50","5","10302","<p>I need charts for my application where the user use gesture to redraw the charts in android. Could you suggest any charting API,tool or software which supports.</p>","326895","","","","","2013-03-10 16:04:38","How to create touch interactive charts for android","<android><charts><interactive>","4","1","3","2013-03-11 12:31:40",""
"2721839","1","2722774","","2010-04-27 14:04:23","0","418","<p>First:</p><p>Does anyone know the filepath for an Archos?I'm trying to get some media/audio to play, and it just won't find it...</p><pre><code> public void onClick(View v1) {                               final MediaPlayer mp = new MediaPlayer();                try {                    mp.setDataSource(""ARCHOS5:/Music/manowar.mp3"");                    mp.start();                    Toast.makeText(Textbox.this, ""Working"", Toast.LENGTH_LONG).show();                    mp.setLooping(true);                } catch (IllegalArgumentException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IllegalStateException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        });</code></pre><p>What is wrong with that code?</p><p>Second:</p><p>I can't get audio files in ""R.raw.'filename'"" to play...</p><p>It works PERFECTLY on the emulator, but when I press the play button (a different one) on the Archos, it just crashes...</p><p>Can someone give me some advice?</p><p>Thanks alot...</p><p>James</p>","321763","","","","","2010-04-27 15:55:49","Audio (MediaPlayer) On an Android (Archos 5 IT)","<java><android><audio><media-player><archos>","1","3","","",""
"2722001","1","4481744","","2010-04-27 14:24:01","4","8152","<p>How to finish any previous activity in application stack (at any level , I mean not immediate parent) , from current activity like on some particular event I want to invalidate this previous activity? Any help ? Thanks.</p>","315619","","","","","2012-02-25 20:21:31","Finish any previous activity in stack from current activity?","<android>","3","0","4","",""
"2722298","1","2851063","","2010-04-27 15:01:18","0","566","<p>I'm seeing a strange issue on a phone and I'm trying to come up with a way to troubleshoot it to find out more. </p><p>Is it possible to access the X-Mms-Content-Location attribute of a message from a MMS message programatically, using the Android SDK? </p><p>This is one example of the error that I am investigating. If I can access that attribute, then I may be able to code an app which repairs it so the message retrieval succeeds.</p><pre><code>04-26 19:11:35.573 V/RetrieveTransaction(  299): X-Mms-Content-Location: http://69.78.70..70/servlets/mms?message-id=&lt;GUID_REMOVED_FOR_PRIVACY&gt;&lt;snip&gt;04-26 19:11:35.783 I/InetAddress(  299): Unknown host 69.78.70..70, throwing UnknownHostException 04-26 19:11:35.793 V/RetrieveTransaction(  299): Unexpected IOException. 04-26 19:11:35.793 V/RetrieveTransaction(  299): java.io.IOException: Cannot establish route for http://69.78.70..70/servlets/mms?message-id=&lt;GUID_REMOVED_FOR_PRIVACY&gt;: Unknown host 04-26 19:11:35.793 V/RetrieveTransaction(  299):  at com.android.mms.transaction.Transaction.ensureRouteToHost(Transaction.java:206) 04-26 19:11:35.793 V/RetrieveTransaction(  299):  at com.android.mms.transaction.Transaction.getPdu(Transaction.java:171) 04-26 19:11:35.793 V/RetrieveTransaction(  299):  at com.android.mms.transaction.RetrieveTransaction.run(RetrieveTransaction.java:147) 04-26 19:11:35.793 V/RetrieveTransaction(  299):  at java.lang.Thread.run(Thread.java:1058) 04-26 19:11:35.793 E/RetrieveTransaction(  299): Retrieval failed. </code></pre>","268803","","268803","","2010-04-28 11:48:23","2010-05-17 16:59:17","Possible to programatically access X-Mms-Content-Location?","<android><debugging><mms>","1","0","","",""
"2722347","1","","","2010-04-27 15:08:13","2","839","<p>hey everybody,i'm devlopping an application for android,</p><p>i need to make a session between client(cell phone) and e web server (apache)and keep alive this session to receive notification from the server for this i may implement socket also make a listener for this socket to notify the client if a file is ready to download, after receiving this notifcation (the ID of the file) the client will download this file</p><p>so my question is, it's possible to implement that?the best solution is to use sockets or web servicecan you fill me some links or tutorials that's helps me to implement that</p><p>thank you so much</p>","326973","","","","","2010-04-27 15:08:13","android: implementation and make listener to a socket","<android><service><sockets><listener>","0","0","1","",""
"2722527","1","","","2010-04-27 15:26:57","2","445","<p>i want to add, delete, update mobile Calendar events. may i use gdata for it. if yes then my code is</p><pre><code>public void start() {        try {            CalendarService calService = new CalendarService(""MyCalendarInter"");\\ Line no 1            CalendarFeed resultFeed = calService.getFeed(new URL(""content://calendar/calendars""),                CalendarFeed.class);        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }</code></pre><p>i am using gdata 1.41.1and google android api level 3</p><p>exception in line number 1 is</p><p>java.lang.VerifyError: com.google.gdata.client.Service</p><p>reason of using gdata is<a href=""http://stackoverflow.com/questions/2713652/android-problem-deleting-event-in-calender"">http://stackoverflow.com/questions/2713652/android-problem-deleting-event-in-calender</a></p>","309990","","","","","2011-03-08 07:02:16","may i use gdata for mobile calendar","<android><calendar>","2","1","","",""
"2722896","1","","","2010-04-27 16:12:17","2","9507","<p>Why am i not able to show the virtual keyboard in my activity. Here is my code:   </p><p>package som.android.keypad;</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.inputmethod.InputMethodManager;import android.widget.EditText;public class ShowKeypad extends Activity {    InputMethodManager imm;    @Override    public void onCreate(Bundle icicle) {    super.onCreate(icicle);     EditText editText = (EditText)findViewById(R.id.EditText);    ((InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE)).showSoftInput(editText, 0);     }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""som.android.keypad""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".ShowKeypad""                  android:windowSoftInputMode=""stateAlwaysVisible""                    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=""4"" /&gt;&lt;/manifest&gt; </code></pre>","2355649","","","","","2013-06-26 04:31:10","How to show virtual keypad in an android activity","<android>","3","3","","",""
"2722949","1","","","2010-04-27 16:19:24","1","747","<p>I am having a Java application running in a Tomcat server using Spring, Hibernate, etc. and a two web interfaces, one implemented in Tapestry 5 and the other one using Flex with BlazeDS and Spring-BlazeDS.</p><p>In my first android application I would now like to log in to the server and retrieve some data.</p><p>I´m wondering how I could achieve this in a secure way. First of all I need to know which technology is the best to retrieve data from the server and how can I restrict the access to users only that have been successfully authenticated. </p><p>With what I read until now I would try to implement a HTTPServlet on the server and make server calls via HTTP Client. In the servlet I could probably use the HTTPSession to check if the request comes from an authenticated user. And the data I would try to send serialized (JSON). Unfortunately, I´ve never done those things and maybe I´m on the wrong way and there are more comfortable solutions.</p>","153721","","","","","2011-09-12 07:16:13","Android programming: Authentication and data exchange with Java EE","<java><android><spring><communication><rmi>","2","0","","",""
"2723173","1","2723527","","2010-04-27 16:48:31","0","288","<p>If I needed to build an android SDK that other developers can integrate into their android apps, is jarring my SDK the only way to go about it? As far as I have learnt, jarring has the following considerations:</p><ol><li>If your app uses a layout, then you have to create it programmatically. Since jar files cant carry any resources. </li><li>The jar will needs to be placed in the lib/assets folder and added to the build path (in Eclipse) -- Learnt here: <a href=""http://stackoverflow.com/questions/2716879/android-invoke-activity-from-within-jar"">http://stackoverflow.com/questions/2716879/android-invoke-activity-from-within-jar</a></li><li>The main app will have to create an Intent object and specify the package and class name in the jar to start the activity. </li></ol><p>Any one have other ideas of going about any of the above steps? </p><p>ThanksGeorge</p>","324632","","","","","2010-04-27 17:35:58","Android SDK - Other ways?","<android><jar><activity><android-intent>","1","0","1","",""
"2723740","1","","","2010-04-27 18:06:36","7","1700","<p>I am having difficulty capturing the backspace key as a keyboard Event in javascript/jQuery. In Firefox, Safari, Opera, Chrome, and on the iPhone/iPad, I capture a keyup event on a text input box like this:</p><pre><code>$(id_input).keyup(function(event) {   that.GetHints($(this).val().trim(), event, fieldName);});</code></pre><p>This event captures user keystrokes, then sends them to a function to issue an ajax lookup call. </p><p>My problem comes when a user wishes to backspace over a character he/she already typed. In all the browsers to which I have access except for my Droid phone, when I press the backspace key, this keyup event captures the value returned by $(this).val().trim() and sends it on to process in function GetHints. On the Droid, however, neither this keyup nor an equivalent keydown event fires until the user backspaces over every character in $(this). </p><p>So, for example, if I type ""cu"" then backspace over the ""u"" leaving only ""c"" in the input field, in all browsers except Droid, the keyup event will fire and call function <code>GetHints(""c"", event, fieldName)</code>. On the Droid, the keyup event never fires.</p><p>What am I missing? How/why does this backspace key, on either the soft keyboard or the hard keyboard, on my Droid not function as expected? How do I work around this?</p>","327131","","35070","","2011-06-02 15:06:51","2011-06-07 13:16:15","Capturing key event for backspace","<javascript><jquery><android>","1","2","1","",""
"2724017","1","","","2010-04-27 18:44:57","5","768","<p>What is the easiest way to find out how fast the Android device is traveling?</p><p>Also, is there a way to register an intent for speed? Example: intent if the device goes more than 20 miles an hour.</p>","327162","","234938","","2010-04-27 19:11:51","2010-04-27 19:11:51","What is the easiest way to determine the velocity of an Android device?","<android>","2","0","2","",""
"2724153","1","2724199","","2010-04-27 19:00:38","1","218","<p>I need to get an Android app to interface with an XML webservice (it's really just a request which returns XML), but as the data is large and includes some things I don't need (like a huge description block), I was thinking of transforming it via a server into a format that would be good for Android, and also to be reduced considering it will be used in a low bandwidth area.</p><p>Does anyone have any suggestions for a good lightweight protocol? I'm especially thinking about libraries for Android that already exist for say REST or even delimited data.</p>","56861","","","","","2010-04-27 19:07:36","Preferred Options for Webservice to Android","<android><web-services>","2","0","","",""
"2724217","1","","","2010-04-27 19:10:20","1","2546","<p>I am trying to install on a VM that is offline.  I have downloaded eclipse.  I have downloaded the android sdk and pointed to it in eclipse.  I still cannot see any target platforms in order to create an android project.  What am i missing?  I need to set this up without using the android sdk/avd manager to download the platforms.  Can anyone help me?  I have been trying to figure this out for 3 days.  Thanks.</p>","327181","","","","","2012-09-14 21:55:47","Offline SDK and ADT installation","<android><installation>","2","0","","",""
"2724452","1","2725344","","2010-04-27 19:39:26","0","1029","<p>I've got an application in the browser that's customized to use Android's browser geolocation APIs. I'd like to find a way to fake the lat/lng that's sent to the browser so I can type in arbitrary coordinates.</p><p>In doing some research I came across DDMS - <a href=""http://developer.android.com/guide/developing/tools/ddms.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/ddms.html</a> - which seems to do what I want, but seems to require the IDE or an emulator. I don't want to use an emulator because I want to test on the device and I don't have the IDE set up for Android.</p><p>Does anyone know if there's a way to send mock location data to an Android device without loading up the IDE (or doing it through the emulator)?</p>","166182","","","","","2010-10-16 21:59:55","Spoofing Location","<android><geolocation>","2","2","","",""
"2724598","1","2724638","","2010-04-27 19:59:19","0","284","<p>I'm using <code>setContentView(R.layout.somelayout);</code> to load an XML to my activity.<br>On this layout, there is a <code>FrameLayout</code>, I want to insert more objects in it dynamically, as an example, more <code>Button</code> Objects.  </p><p>I haven't found some getCurrentView() method yet... So, how can I get the current Layout from the activity? </p>","327217","","","","","2010-04-27 20:03:29","Insert more stuff in an XML loaded Layout","<android>","1","0","","",""
"2724599","1","2724691","","2010-04-27 19:59:20","1","1232","<p>We are using Hudson to automate our Android build. I need to incorporate the build number into the version string used in our app. Was wondering if anyone had an example of doing that before I (re?)invent that wheel. Obviously I need to replace a string value in one of our config files.</p>","246793","","","","","2010-04-27 20:09:41","Example using build number in version string when building Android project via ant?","<android><ant><build><hudson><numbers>","1","0","","",""
"2724670","1","2724792","","2010-04-27 20:07:50","0","1211","<p>I've got an android app that pulls a random 20 questions (rows) as a cursor from a SQLite DB and loops through all the questions to ask the user all 20 questions.</p><p>Is there some way to save the cursor's state/location when the activity is paused or stopped so that when the activity resumes the cursor is restored and in the same position as it was when the activity was paused/stopped?</p><p>If you need me to post my code just ask.</p><p>Thanks for your time!</p>","198116","","","","","2010-04-28 11:22:15","Saving cursor state with activity instance?","<android><cursor><cursor-position><savestate>","1","0","0","",""
"2724871","1","2726008","","2010-04-27 20:32:17","15","7690","<p>I'm creating notifications in my Android application, and would like to have an option in my preferences to set what sound is used for the notification. I know that in the Settings application you can choose a default notification sound from a list. Where does that list come from, and is there a way for me to display the same list in my application?</p>","1912","","","","","2013-02-06 15:15:50","How to bring up list of available notification sounds on Android","<java><android><audio><notifications>","2","0","13","",""
"2725005","1","","","2010-04-27 20:48:17","0","3732","<p>I have been using some nice tutorials on drawing graphics on my android.  I wanted to also add in the cool gesture demo found here:</p><p><a href=""http://developer.android.com/resources/articles/gestures.html"" rel=""nofollow"">http://developer.android.com/resources/articles/gestures.html</a></p><p>That takes these lines of code:</p><pre><code>GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);gestures.addOnGesturePerformedListener(this); </code></pre><p>This is fine and dandy yet I realize in my demo i'm trying to build using code from ""Playing with Graphics in Android"".  The demos make sense, everything makes sense but I found out by using:</p><pre><code>setContentView(new Panel(this));</code></pre><p>as is required by the Playing With Graphics tutorials, then the findViewById seems to no longer be valid and returns null.  At first I was about to post a stupider question as to why this is happening, a quick test of playing with the setContentView made me realize the cause of findViewById returning null, I just do not know how to remedy this issue.  Whats the key I am missing here?  I realize that the new Panel is doinking some reference up but I am not sure how to make the connection here.</p><p>The:R.id.gesturesis defined right int he main.xml as: (just like the tutorial)</p><pre><code>&lt;android.gesture.GestureOverlayView    android:id=""@+id/gestures""    android:layout_width=""fill_parent""     android:layout_height=""0dip""    android:layout_weight=""1.0"" /&gt;</code></pre><p>So I did confirm the </p><pre><code>setContentView(new Panel(this))</code></pre><p>is causing the issue.  So I know the issue is that I have to figure out how to add the android.gesture.GestureOverlayView to the panel class somehow, I am just not sure how to go about this.</p><p>After fighting with this I generally know what I need to do just now how to do it.  I think I need either the equivalent of creating a panel in that main.xml OR figuring out how to build whats in main.xml for the gestures in code.  I am close because I did this:    GestureOverlayView gestures = new GestureOverlayView(this);</p><p>which gets me a non null gestures now, unfortunately since I am not telling it to fill Parent anywhere I don't think its really showing up, so I am trying hard to figure out layout pa rams.  Am I even on the right track?</p>","327258","","327258","","2010-05-02 04:16:35","2013-09-04 04:48:22","Getting a gestureoverlayview","<android><graphics><gestures>","2","0","1","",""
"2725011","1","","","2010-04-27 20:49:11","8","8990","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3014089/maintain-save-restore-scroll-position-when-returning-to-a-listview"">Maintain/Save/Restore scroll position when returning to a ListView</a>  </p></blockquote><p>How can I maintain the position of my ListView in my activity when I go to another activity (by launching another intent) and then come back (press the back button)?</p><p>Thank you.</p>","286802","","","","","2012-11-29 09:54:27","How to maintain the position of ListView","<android>","5","0","5","2012-12-20 22:48:16",""
"2725174","1","7956785","","2010-04-27 21:11:22","3","4847","<p>how can I change the background of an ImageView from java? I have an ImageView and at a certain point I need to change the image that it displays (set in the styles). I tried to do it like this:</p><pre><code>placeHolder.setImageDrawable(myDrawb);</code></pre><p>but it looks like the old image remains there and it is partially covered but the new one (which in my case has different shape).</p><p>hope you guys can help!</p><p>cheers</p>","87624","","","","","2013-03-27 04:39:09","change background of an ImageView (the old image stays there!)","<android>","3","0","","","2010-04-27 21:11:22"
"2725270","1","","","2010-04-27 21:27:41","2","1166","<p>I have some C++ code that I want to make into a static lib for use with Java on the Android platform.  Can anyone point me to a resource that tells me how to do this?  I am completely new to Java and Android.</p>","327298","","319952","","2010-04-27 21:30:24","2012-03-12 10:41:03","Creating a C++ static lib to use with Java on Android","<java><c++><android><resources><static-libraries>","2","0","1","",""
"2725302","1","2725317","","2010-04-27 21:35:07","0","448","<p>I've noticed in recent ads that the Verizon Droid and Droid Eris have to put up acknowledgement on Lucasfilm's trademark of the word ""Droid"", and had to pay licensing fees to use it.</p><p>I'm wondering if an app I'm building that uses the word Droid in the naming is violating said trademark. I've noticed other apps that do it (Twitdroid), and never once considered it a problem.</p><p>The name in question would be <strong>ServiceDroid</strong>.</p>","101059","","","","","2012-11-13 16:25:38","Does apps that play on the word Droid need to worry about Lucasfilm's Trademark?","<android><legal>","4","3","","",""
"2725503","1","","","2010-04-27 22:05:33","2","1414","<p>I want to create an application for Android that enables me to get the geolocation of a user. This has to be made as a client-server app and for the server side I'm using OpenFire.For getting the user's location I would have to use XEP-0080, right? And SmackAPI also?I'm completely new to XMPP and Smack, so if anyone could get me a few pointers or maybe examples or any kind of documentation about this I'd be very grateful.</p><p>Thanks in advance for any help.</p>","327314","","","","","2010-04-27 22:16:13","using XMPP for user location","<android><xmpp><smack>","1","2","","",""
"2725695","1","","","2010-04-27 22:47:10","0","652","<p>I have yet to try this on an actual device, but expect similar results.Anyway, long story short, whenever I run my app on the emulator, it crashes due to an out of memory exception.</p><p>My code really is essentially the same as the camera preview API demo from google, which runs perfectly fine.</p><p>The only file in the app (that I created/use) is as below-</p><pre><code>package berbst.musicReader;import java.io.IOException;import android.app.Activity;import android.content.Context;import android.hardware.Camera;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.SurfaceView;/********************************** Music Reader v.0001* Still VERY under construction.* @author Bryan**********************************/public class MusicReader extends Activity {private MainScreen main;    @Override    //Begin activity    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        main = new MainScreen(this);        setContentView(main);    }class MainScreen extends SurfaceView implements SurfaceHolder.Callback {    SurfaceHolder sHolder;    Camera cam;    MainScreen(Context context) {        super(context);        //Set up SurfaceHolder        sHolder = getHolder();        sHolder.addCallback(this);        sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    public void surfaceCreated(SurfaceHolder holder) {        // Open the camera and start viewing        cam = Camera.open();        try {           cam.setPreviewDisplay(holder);        } catch (IOException exception) {            cam.release();            cam = null;        }    }    public void surfaceDestroyed(SurfaceHolder holder) {        // Kill all our crap with the surface        cam.stopPreview();        cam.release();        cam = null;    }    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {        // Modify parameters to match size.        Camera.Parameters params = cam.getParameters();        params.setPreviewSize(w, h);        cam.setParameters(params);        cam.startPreview();    }}</code></pre><p>}</p>","327336","","","","","2010-07-06 09:00:07","Why is my Android app camera preview running out of memory on my AVD?","<android><android-emulator>","1","1","","",""
"2725973","1","","","2010-04-27 23:56:42","0","1865","<p>I have an Activity that will display a custom view made up of 2 parts.  I want one part to be 1/3 of visible screen height, the other part to be 2/3.</p><p>I can override onMeasure and use display metrics to find the height of the display, but this does not account for the battery bar or view title sizes.</p><p>DisplayMetrics dm = new DisplayMetrics();             ((WindowManager)contxt.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(dm); int height = dm.heightPixels;</p><p>How can I tell the height of the displayable area?  I'm prepared to override the layout or whatever.  What is the Android best practices?  I've seen other questions along this line, but they are inconclusive.</p>","321594","","","","","2011-02-19 10:15:41","How to correctly size containing views","<android><layout><view><size>","1","0","1","",""
"2725997","1","2726103","","2010-04-28 00:03:54","8","5074","<p>Is it possible to port a C++ application which uses the STL extensively to Android? I understand that currently the NDK does not support this, but is there any effort (open source or otherwise) underway to achieve this? </p><p>If not is there a way to cross compile libstdc++ for Android? </p><p>UPDATE: Ndk Revision 5 promises a default STL implementation based on STLport. <a href=""http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html"" rel=""nofollow"">http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html</a> <a href=""http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html"" rel=""nofollow"">Read this official NDK blog post</a>, and the revision notes. </p>","57619","","57619","","2011-01-31 03:17:24","2011-01-31 03:17:24","Porting a C++ application to android","<android><android-ndk><libstdc++>","2","0","2","",""
"2726043","1","2726475","","2010-04-28 00:18:58","1","393","<p>I am trying to implement a TextView that is serving as a header for a ListView. I want to format it so that I have basically a title centered on the first line and then additional information on the lines following. How can I format the text/string to create this kind of formatting? </p><p>Thanks,Rob</p>","289153","","","","","2010-04-28 02:30:13","Android TextView formating","<android>","1","0","","",""
"2726055","1","2752709","","2010-04-28 00:21:25","1","861","<p>I am trying to style my ListView with two 9-patch background images (16px * 9px), one dark image for default state and another green image for selected and pressed state. </p><p>It works except for just one problem that when I select or press one list item, it seems that the selected item overlap the next one a little bit as I can see some pixels of the green background image is on the top of next item.</p><p>How to fix that?</p>","238061","","238061","","2010-09-21 13:51:52","2010-09-21 13:51:52","Overlap problem with Android ListView selector","<android><listview><coding-style><overlap>","1","2","","",""
"2726190","1","2733961","","2010-04-28 01:01:53","0","2799","<p>In Android documentation describing ""<a href=""http://developer.android.com/guide/appendix/faq/commontasks.html#configurewindowproperties"" rel=""nofollow"">Configuring General Window Properties</a>"", it is suggested that specifying properties via XML is preferable whenever possible to avoid seeing the title bar flash. As an example, instead of setting <code>Window.FEATURE_NO_TITLE</code> with requestWindowFeature, they set it to <code>@android:style/Theme.NoTitleBar</code>. Is there a similar way to set a custom title bar to be used in the XML?</p>","165495","","165495","","2010-04-29 00:05:29","2010-04-29 00:05:29","Display custom title bar for Android with XML","<xml><android>","1","0","1","",""
"2726280","1","2726322","","2010-04-28 01:26:09","0","626","<p>I cloned some of the trees from the Android Open Source Project to take a look at the code, but I can't build them because they reference classes which don't seem to exist.</p><p>For instance, the music application <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/AlbumBrowserActivity.java;h=ba3e2127606f310f61b1f32fe2d01656cd81a57e;hb=master"" rel=""nofollow"">here</a> references <code>android.media.MediaFile</code> which according to the <a href=""http://developer.android.com/reference/android/media/package-summary.html"" rel=""nofollow"">package summary</a> does not exist, as well as things like <code>ArrayListCursor</code> which has an old <a href=""http://www.androidjavadoc.com/m5-rc15/android/database/ArrayListCursor.html"" rel=""nofollow"">javadoc</a> around but is <a href=""http://developer.android.com/reference/android/database/AbstractCursor.html"" rel=""nofollow"">absent in current documentation</a>.</p><p>So is the open source project disjoint from the released SDK? Also, is there a way to build these open source packages with the current SDK?</p><p>Thanks,</p><p>-JQP</p>","278385","","648313","","2011-07-13 20:59:55","2011-07-13 20:59:55","Android source referencing missing classes","<android><android-source>","1","0","","",""
"2726295","1","2729122","","2010-04-28 01:30:28","0","2625","<p>I have this really annoying problem:</p><p>In my widget, i would like to change the background by code. I noticed on the Google doc than I can easily change the background of an Imageview:</p><pre><code>remoteViews.setImageViewResource(R.id.my_iv, R.drawable.my_bg);</code></pre><p>Ok, too easy, i want to change now the Linear layout.. What I read about the remoteview id that I can change a Bitmap, Int, Bool, String, etc... but not a drawable. So i guess i cannot use:</p><pre><code>remoteViews.setBitmap(R.id.my_ll,""setBackgroundDrawable"",BitmapFactory.decodeResource(context.getResources(), R.drawablemy_bg));</code></pre><p>I am totally disapointed and tried a last idea:</p><pre><code>views.setInt(R.id.my_ll,""setBackgroundResource"",R.drawable.my_bg);</code></pre><p>But The logcat told me: </p><blockquote>  <p>android.widget.RemoteViews$ActionException:view:  android.widget.LinearLayout can't use  method with RemoteViews:  setBackgroundResource(int)</p></blockquote><p>I am totally lost and I really don't know what to do...</p><p>I would really appreciate any help.</p><p>Thank a lot!</p>","327402","","327402","","2012-01-09 09:37:36","2012-01-09 09:37:36","Android: Changing LinearLayout in a widget","<java><android>","2","0","1","",""
"2726377","1","2726503","","2010-04-28 02:01:08","9","9493","<p>I'm displaying a webpage in a WebView and on the webpage, there is a button.  When you click the button, a confirmation dialog is supposed to popup, but it doesn't show in my WebView.  It does popup if I go to the same webpage in the android browser.  Anyone know how to handle popup dialogs coming from a webpage inside your WebView?</p>","326430","","135152","","2011-07-13 18:11:59","2013-03-12 10:13:54","How to handle a webview confirm dialog?","<android><dialog><webview><popup><handle>","1","0","9","",""
"2726494","1","2729090","","2010-04-28 02:36:32","6","3548","<p>What happens on Activity.finish() with an AsyncTask still running in background?</p><p>Does it just pop the Activity off the Activity Stack, but wait to destroy the Activity object until the AsyncTask fully completes (since the AsyncTask is an inner class of my Activity)?</p><p>Also, would it act any differently if the AsyncTask were a public, non-inner class that held no references to the instance of the Activity?</p>","325011","","","","","2010-04-28 11:46:30","What happens on Activity.finish() with AsyncTask still running in background?","<android><activity><android-asynctask>","1","0","2","",""
"2726501","1","2728451","","2010-04-28 02:40:14","0","1043","<p>package net.learn2develop.PopularAttractions;</p><p>import java.io.IOException;import java.util.List;import java.util.Locale;</p><p>import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;</p><p>import android.location.Address;import android.location.Geocoder;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent;import android.view.View;</p><p>import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.Toast;import android.widget.AdapterView.OnItemSelectedListener;</p><p>public class PopularAttractions extends MapActivity  {</p><pre><code>private String[ ][ ] locations = {        {""Chinatown Heritage Center"",""1.2836,103.84425""},        {""Escape Theme Park"",""1.38104,103.936928""},        {""G-Max Reverse Bungy"",""1.2906,103.845322""},        {""Jurong BirdPark"",""1.32005,103.707153""},        {""NEWater Visitor Center"",""1.33105,103.955311""},        {""Red Dot Design Museum"",""1.277762,103.846225""},        {""Singapore Botanic Garden"",""1.31471,103.815689""},        {""Singapore Science Center"",""1.3249,103.740578""},        {""Singapore Zoological Garden"",""1.40502,103.793449""},        {""Snow City"",""1.32823,103.74263""},        {""Sungei Buloh Wetland Reserver"",""1.445144,103.729595""},        {""Super Ice World"",""1.300422,103.875348""},    }; Spinner spinnerView; MapView mapView; MapController mc;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    spinnerView = (Spinner) this.findViewById(R.id.spinner1);    mapView = (MapView) findViewById(R.id.mapview1);    mc = mapView.getController();    ArrayAdapter&lt;CharSequence&gt; adapter = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_dropdown_item);    for(int i = 0; i &lt; locations.length; i++)        adapter.add(locations[i][0]);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinnerView.setAdapter(adapter);    spinnerView.setOnItemSelectedListener(selectListener);    gotoSelected();}private OnItemSelectedListener selectListener = new OnItemSelectedListener() {    public void onItemSelected(            AdapterView&lt;?&gt;parent, View v, int position, long id)    {        gotoSelected();    }    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {}};public void gotoSelected(){    int index = spinnerView.getSelectedItemPosition();    String[] coordinates = locations[index][1].split("","");    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.getFromLocation(lat, lng, 1);         Address ad = addresses.get(0);         String buff = new String();    for(int i = 0; i &lt;= ad.getMaxAddressLineIndex(); i++ ) {              buff += ad.getAddressLine(i);     Toast.makeText(getBaseContext(), buff, Toast.LENGTH_SHORT).show();  GeoPoint location = new GeoPoint (        (int)(lat * 1E6),        (int)(lng * 1E6));            mc.animateTo(location);            mc.setZoom(16);      mapView.setStreetView(true);     }     for (Address a : addresses) {          Log.v(""TAG"", a.toString());      }     } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } }public boolean onKeyDown(int keyCode, KeyEvent event) {    MapController mc = mapView.getController();     switch (keyCode)     {        case KeyEvent.KEYCODE_2:            mc.zoomIn();            break;        case KeyEvent.KEYCODE_1:            mc.zoomOut();            break;    }    return super.onKeyDown(keyCode, event);}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}}</code></pre>","312472","","312472","","2010-05-10 04:10:13","2010-05-10 04:10:13","How to add the coding for displaying the address when a particular set of latitude and longitude is selected into the following codes?","<java><android><latitude-longitude>","1","1","","",""
"2726535","1","","","2010-04-28 02:54:11","0","2316","<p>I'm learning android/java and have this example code I can't get to work:</p><pre><code>OnRatingBarChangeListener l = new OnRatingBarChangeListener() { public void onRatingChanged(RatingBar ratingBar, float rating,   boolean fromTouch) {  Integer myPos=(Integer)ratingBar.getTag();  RowModel model=getModel(myPos);  model.rating = rating;  LinearLayout p=(LinearLayout)ratingBar.getParent();  TextView l=(TextView)p.findViewById(R.id.label);  l.setText(model.toString()); }};</code></pre><p>Everything works except the LinearLayout / getParent() downcast. At runtime it creates a ClassCastException. If I comment out that block of code then everthing works fine. What am I missing?</p>","312424","","","","","2010-04-28 03:02:54","Help with getParent() downcast","<android>","1","0","","",""
"2726558","1","2726566","","2010-04-28 03:01:35","32","16214","<p>Does anyone know, if vendors provide or if there is a site where one could download AVD profiles for existing android devices on the market so you can run your apps in the emulator and basically see how they will run on said devices?</p><p>I know it's pretty easy to create a new device but it'd be great if one could just download the config file for each device and run it.</p>","303525","","","","","2013-06-30 13:59:25","Is there a repo where you can download android virtual devices?","<android><avd>","4","1","9","2013-06-30 14:37:22",""
"2726559","1","2726575","","2010-04-28 03:01:55","2","1772","<p>As part of the college mini-project, I am developing a micro-blogging platform for Android. I am planning to use Django framework in python to handle the communication between Android and remote server so as to make database API independent. I heard its best practice to use HTTP methods for the communication. Which is the best site/book to learn using HTTP methods for Android? I</p>","323404","","","","","2013-08-28 01:07:47","Communicating with remote server in Android","<android><django><http>","2","0","3","",""
"2726797","1","2726836","","2010-04-28 04:27:04","0","797","<p>I am using AutoCompleteTextView and want to limit the number of dropdown items visible at a time on screen. Currently it fills up the screen but can i limit it to say 2 items with a scroll bar for displaying more.</p>","315619","","","","","2010-04-28 04:39:10","How to limit the number of dropdown items visible at a time on screen in AutoCompleteTextView?","<android>","1","0","","",""
"2726824","1","","","2010-04-28 04:36:03","0","392","<p>I am writing a widget on Android 1.6 that shows the minutes that a person has used on the current month.The way I have it setup is by having a service that listens to the state of the phone and when  the phone is picked up, it starts the timer and when the person hangs up, ends a timer. I would like to send this variable(long duration) over to my appWidgetProvider so I could update the edit text on it.</p>","17162","","","","","2010-04-28 08:17:39","Send data from Service to Widget on Android","<java><android>","1","0","","",""
"2726976","1","","","2010-04-28 05:13:47","10","9443","<p>How to receive text sms to a specific port? I have been looking for an answer to this question but to no avail. This has been asked a few times but nobody seems to have a clear answer. My code is as follows:</p><p>--MANIFEST FILE-- </p><pre><code>&lt;receiver android:name="".SMSRecieve"" android:enabled=""true""> &lt;intent-filter> &lt;action android:name=""android.intent.action.DATA_SMS_RECEIVED""/> &lt;data android:scheme=""sms"" /> &lt;data android:host=""localhost"" /> &lt;data android:port=""15005"" /> &lt;/intent-filter> &lt;/receiver></code></pre><p>--SMS sending method-- </p><pre><code>String messageText = msgTxt.getText().toString(); short SMS_PORT = 15005; SmsManager smsManager = SmsManager.getDefault(); smsManager.sendDataMessage(""5556"", null, SMS_PORT, messageText.getBytes(), null, null); </code></pre><p>--Broadcast Receiver code-- </p><pre><code>static final String ACTION = ""android.intent.action.DATA_SMS_RECEIVED""; //static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";(tried this too, but failed) if (intent.getAction().equals(SMSNotifyExample.ACTION)) { ...do some work.. }</code></pre><p>I also tried to replace <code>android:name</code> to <code>android.provider.Telephony.SMS_RECEIVED</code> but the result is the same. </p><p>My application does not receive the SMS on the specified port. Once I remove the following line it works fine:</p><pre><code>&lt;data android:scheme=""sms"" /> &lt;data android:host=""localhost"" /> &lt;data android:port=""15005"" /> </code></pre><p>Could you suggest what am I missing?</p>","327491","","1716542","","2013-08-14 07:36:40","2014-01-07 14:11:40","how to receive text sms to specific port..","<android>","3","1","6","",""
"2727029","1","2741690","","2010-04-28 05:28:34","8","18661","<p>I've seen references to using the AccountManager like <a href=""http://stackoverflow.com/questions/2245545/accessing-google-account-id-username-via-android"">http://stackoverflow.com/questions/2245545/accessing-google-account-id-username-via-android</a> but it seems like it's for grabbing the authtoken?</p><p>I just need access to the username, no passwords or any auth tokens. </p><p>I'm using android 2.1 sdk.</p>","337493","","74815","","2010-04-28 05:31:32","2010-04-30 00:51:36","How can I get the google username on Android?","<android><username>","1","1","10","",""
"2727153","1","2728446","","2010-04-28 06:05:29","0","350","<p>I have an image which is 80px X 50 px, and I need to place that in one of the child of a FrameLayout, how can I specific the layout_width and layout_height of a Framelayout which fits an image without scaling it?</p><p>I know there is a layout_height=""wrap_content"" layout_wight=""wrap_content"" for FrameLayout, but I can't use it, since that FrameLayout has other children. So I would like to hard code the FrameLayout width/height to match the dimension of the image?</p><p>Should I use layout_width=""80px"" or layout_width=""80dip""?</p><p>Thank you.</p>","286802","","","","","2010-04-28 10:03:25","How can specific the layout_width and layout_height of a Framelayout which fits an image","<android>","1","0","","",""
"2727341","1","2727429","","2010-04-28 06:49:53","2","793","<p>Fault address occurred when i malloc pthread_t to save a newly created thread id and free it in another thread. Codes as follows:</p><pre><code>typedef struct _TaskInfo {     // int dummy_int;    pthread_t tid;} TaskInfo;void* dummy_task(void* pArg) {    free(pArg);    return NULL;}void create_task() {    TaskInfo *pInfo;    pthread_attr_t attr;    // set detached state stuff ...    pInfo = (TaskInfo*) malloc(sizeof(TaskInfo));    pthread_create(&amp;pInfo-&gt;tid, &amp;attr, dummy_task, pInfo);    // destroy pthread attribute stuff ...}int main() {    int i;    while(i &lt; 10000) {        create_task();        ++i;    }    return 0;}</code></pre><p>When I uncomment the member dummy_int of TaskInfo it sometimes ran successfully, but sometimes failed.My platform is VMWare + Ubuntu 9.10 + ndk r3</p><p>Thanks! </p>","327552","","327552","","2010-04-28 06:56:14","2010-04-28 07:08:55","Fault address when malloc/free pthread_t across threads","<android><android-ndk>","1","0","0","",""
"2727568","1","2728356","","2010-04-28 07:37:15","1","631","<p>I've got a serious problem with my GPS on my Nexus One: I wrote a kind of hello world with GPS, but the Toast that should be displayed isn't :(</p><p>I don't know what I'm doing wrong...maybe you could help me getting this work. Here's my code:</p><pre><code>package gps.test;import android.app.Activity;import android.content.Context;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.widget.Toast;public class GPS extends Activity {private LocationManager lm;private LocationListener locationListener;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // ---use the LocationManager class to obtain GPS locations---    lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    locationListener = new MyLocationListener();    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 100, 1,            locationListener);}private class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        if (loc != null) {            Toast.makeText(                    getBaseContext(),                    ""Location changed : Lat: "" + loc.getLatitude()                            + "" Lng: "" + loc.getLongitude(),                    Toast.LENGTH_SHORT).show();        }    }    @Override    public void onProviderDisabled(String provider) {        // TODO Auto-generated method stub    }    @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><p>Theoretically there should be a new toast every 100 milliseconds, shouldn't it? Or at least, when I change my position by one meter!?I've no idea why it doesn't. I must admit I'm new to the topic, maybe I've missed something?</p><p>It would be great if you could give me a hint :)</p><p>nice greetings,poeschlorn</p>","317301","","","","","2012-01-12 03:54:15","No GPS Update retrieved? Problem in Code?","<java><android><gps><location>","2","8","1","",""
"2727668","1","2729162","","2010-04-28 07:57:03","0","97","<p>I have preperd a remote service, i would like to know if it's possible somehow via this service to call another activities? coz usually what ive seen so far, is how external apps calling the remote service and using it's methods, but i want vice versa.. that the remote service will call an external app's activity,</p><p>thanks,</p><p>moshik.</p>","273550","","","","","2010-04-28 11:58:33","Remote servicve","<android>","1","0","","",""
"2727743","1","5063411","","2010-04-28 08:10:43","0","232","<p>I need to build some kind of listener,</p><p>now this listener suppose to run activies of diffrentz appz, i want this listener to be as a service that will run the appropriate activity,</p><p>should i make it as a remote service or local service(for this i need some app to hold it - make sense?)  what will fit in?</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-04-28 08:30:32","2011-02-21 07:38:12","Should i use remote or local service for this scenario?","<android>","1","0","","",""
"2727752","1","","","2010-04-28 08:13:06","6","7429","<p>Anyone know of any resource or documentation detailing all the default icons used on the standard Android and where those icons are used throughout the device etc?</p><p>I realise you can download the default set off the Android development site however there doesn't seem to be any documentation for them.</p><p>Any help would be very much appreciated and save me a huge amount of time as I have to create an entirely new set.</p><p>Many thanks </p>","327620","","50049","","2010-06-04 08:46:34","2010-06-04 08:46:34","Resource or documentation detailing all the default icons on the Android?","<android><icons>","1","0","2","",""
"2727763","1","2737388","","2010-04-28 08:15:51","54","39856","<p>I believe that it's possible to call Java methods from (PhoneGap) Javascript. </p><p>Anyone knows how to do that?? (I know how to do it by changing the source code of PhoneGap, but I'd avoid that)</p>","133648","","","","","2014-02-26 06:16:26","Communication between Android Java and Phonegap Javascript?","<android><phonegap>","7","2","57","",""
"2728017","1","2728282","","2010-04-28 08:57:46","0","1470","<p>It is a common thing to add a color name and a color RGB value in a config xml file for developing an Android application. It is boring sometimes for example, when I want to add color pink, I had to find some tool to show me what the exact RGB value for it and then fill it in that xml file.</p><p>I am wondering is there any predefined color file?</p>","238061","","","","","2011-02-10 19:49:25","Is there a common color file including all common colors for Android application development?","<android><coding-style><colors>","2","0","","",""
"2728039","1","2747660","","2010-04-28 09:02:18","2","1655","<p>It appears that <a href=""http://pyopengl.sourceforge.net/documentation/manual/glColorMaterial.3G.html"" rel=""nofollow""><code>glColorMaterial()</code></a> is absent from <a href=""http://www.khronos.org/opengles/sdk/1.1/docs/man/"" rel=""nofollow"">OpenGL ES</a>. According to <a href=""http://www.idevgames.com/forum/showthread.php?t=18189"" rel=""nofollow"">this post</a> (for iPhone), you may still enable <code>GL_COLOR_MATERIAL</code> in OpenGL ES 1.x, but you're stuck with the default settings of <code>GL_FRONT_AND_BACK</code> and <code>GL_AMBIENT_AND_DIFFUSE</code> that you would otherwise set with <code>glColorMaterial()</code>.  I would be OK with this, but the diffuse lighting is not working correctly.</p><p>I set up my scene and tested it with one light, setting <code>glMaterialfv()</code> for <code>GL_AMBIENT</code> and <code>GL_DIFFUSE</code> once in the initialization. The normals have been set correctly, and lighting works the way it's supposed to. I see the Gouraud shading.</p><p>With <code>GL_LIGHTING</code> disabled, the flat colors I have set with <code>glColor4f()</code> appear on the various objects in the scene. This also functions as expected.  However, when <code>glEnable(GL_COLOR_MATERIAL)</code> is called, the flat colors remain.  I would expect to see the lighting effects.</p><p>glColorMaterial() is also <a href=""http://www.anddev.org/viewtopic.php?p=33992"" rel=""nofollow"">mentioned on anddev.org</a>, but I'm not sure if the information there is accurate.</p><p>I'm testing this on an Android 2.1 handset (Motorola Droid).</p><p><strong>Edit</strong>: It works properly on my 1.6 handset (ADP1). I've filed <a href=""http://code.google.com/p/android/issues/detail?id=8015"" rel=""nofollow"">Issue 8015</a>.It does <strong>not</strong> work with the emulator for Android 1.6 or 2.1.</p><p>Here is a <a href=""http://sites.google.com/site/droidful/bugs/color_material_testcase.zip"" rel=""nofollow"">minimal testcase</a> to reproduce the problem.</p><p><strong>Screenshot on Android 1.6 (ADP1):</strong></p><p><img src=""http://sites.google.com/site/droidful/bugs/GL_COLOR_MATERIAL-1.6.png"" alt=""alt text""></p><p><strong>Screenshot of same code running on Android 2.1 (Motorola Droid):</strong></p><p><img src=""http://sites.google.com/site/droidful/bugs/GL_COLOR_MATERIAL-2.1.png"" alt=""alt text""></p><p><strong>Screenshot on Android 1.6 (Emulator):</strong></p><p><img src=""http://sites.google.com/site/droidful/bugs/GL_COLOR_MATERIAL-1.6-emulator.png"" alt=""alt text""></p>","105137","","105137","","2010-04-29 20:45:02","2010-04-30 21:00:51","GL_COLOR_MATERIAL with lighting on Android","<android><opengl-es>","1","0","1","",""
"2728064","1","4619251","","2010-04-28 09:06:09","11","28587","<p>Can anyone tell me how to parse a local xml file stored in the system using SAX ,with an example code.please also tell me where can i find information on that</p>","320106","","","","","2013-01-05 08:53:56","parsing local xml file using Sax in android","<xml><android><parsing><sax>","6","0","8","",""
"2728178","1","2728264","","2010-04-28 09:24:40","0","384","<p>i sell the application into android market with the version 1. i upgrade the application with version 2.in that version 2 i found one bug after upgrading.now i resolved that bug </p><p>is it possible to upgrade application ith version2</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2011-03-10 14:26:30","upgrading apk file in android market","<android>","3","0","0","",""
"2728323","1","","","2010-04-28 09:45:47","0","265","<p>Can anyone explain why my application exceeds 16 MB limit of memory while have the same time 2,3 MB of free  space?</p><p><img src=""http://cs9778.vkontakte.ru/u662625/106405353/x_22160203.jpg""/> </p><p><img src=""http://cs9778.vkontakte.ru/u662625/106405353/x_8879a4ed.jpg""/> </p>","307699","","","","","2010-04-28 09:45:47","Android. Can anyone explain why my application exceeds 16 MB limit of memory while have the same time 2,3 MB of free space?","<android><memory>","0","3","","",""
"2728348","1","2729298","","2010-04-28 09:48:29","0","1455","<p>i want to add the current string in a textview view to a string array in arrays.xml.then display the last/previous string of that array in a textview (setText).</p>","326423","","326423","","2010-04-28 09:57:08","2010-04-28 12:17:15","add string to string array and display last/previous string in that string array","<android>","1","0","","",""
"2728407","1","2732113","","2010-04-28 09:56:09","1","1380","<p>How to do the following stuffs in ListView</p><ol><li><p>Only show scroll bar when user flip the list.</p><p>By default, if the list is more than the screen, there is always a scrollbar on the right side. </p><p>Is there a way to set this scrollbar only shows when user flip the list?</p></li><li><p>Keep showing the list background image when scrolling.</p><p>I've set an image as the background of the ListView, but when I scroll the list, the background image will disappear and only shows a black list view background.</p><p>Is there any way to keep showing the list background image when scrolling?</p></li><li><p>Don't show the shadow indicator.</p><p>When the list has more items to display, there is a black-blur shadow to indicate userthat there are more items. Is there a way to remove this item?</p></li></ol>","234939","","28169","","2010-04-28 10:08:53","2010-04-28 18:20:44","How to do the following in ListView","<android>","2","0","1","",""
"2728465","1","","","2010-04-28 10:06:44","5","21175","<p>I want to call one android application from another application </p><p>I have tried some <a href=""http://www.anddev.org/install-run_applications_from_within_another_application-t6909.html"">examples</a>, but they are not working for me, I'm getting a Package parse error.</p><p>Consider there are two applications: Application1 and Application2</p><p>I want to call Application2 from Application1</p><p>Here is the some sample code to do this:</p><pre><code>Intent i = new Intent();i.setAction(android.content.Intent.ACTION_VIEW);i.setDataAndType(Uri.fromFile(fileName),""application/vnd.android.package-archive""); startActivity(i);</code></pre><p>Here <code>fileName = ""file://data/data/package_name/files/Application1.apk"";</code></p>","323062","","309308","","2010-12-18 11:21:58","2013-11-11 11:02:43","How to call one android application from another android application","<android>","3","1","5","",""
"2728541","1","2729309","","2010-04-28 10:17:28","0","2351","<p>I am having a listview in one of my activity.How to set foucs change listner.I tried with following block of code I am not getting result.</p><p>product_search_list = (ListView) findViewById(R.id.productlist);  product_search_list.setOnFocusChangeListener(onproductchangelistener);</p><p>private OnFocusChangeListener onproductchangelistener = new OnFocusChangeListener() {</p><p>@Override  public void onFocusChange(View v, boolean hasFocus) {   int index= (int) ((ListView)v).getSelectedItemId();   Log.i(""index"",""""+index);</p><p>} };</p><p>Actually on focus change of list items I want to get index of focused list item and do the necessary operations.</p><p>Thanks in advance.</p><p>Regards:Jayanth</p>","320276","","","","","2010-04-28 12:19:02","How to add Focuschange Listner to listview in android","<android><listview><onfocus>","1","0","","",""
"2728566","1","","","2010-04-28 10:20:50","22","7544","<p>I want to develop a web application using HTML, CSS and Javascript one thing that is really annoying is that any link or button etc when clicked inside the Android browser gets highlighted with a green border.</p><p>To demonstrate what I mean I have included a link to a page that contains a basic game written in CSS</p><p><a href=""http://marbles2.com/app/"">http://marbles2.com/app/</a></p><p>Is there any way that you are aware of to disable the click green border?</p><p>Cheers</p><p>Paul</p>","321282","","321282","","2010-04-28 11:42:27","2013-07-26 14:07:27","Android browser GREEN border on click","<android>","2","1","6","",""
"2729180","1","2730738","","2010-04-28 12:01:20","11","16262","<p>I have a progressbar with the following style: <code>style=""?android:attr/android:progressBarStyleSmall""</code> </p><p>Sadly the bar is nearly white and in my case displayed on a white background.The progressbar is nearly invisible because of that.</p><p>How can I change the color of the progressbar? A darker grey would be great.</p>","114066","","114066","","2010-08-17 07:50:11","2012-12-31 11:30:02","How to change the color of an indefinite ProgressBar?","<android><layout><progress-bar>","6","0","4","",""
"2729267","1","2737770","","2010-04-28 12:12:46","45","40067","<p>I need to push an intent to default camera application to make it take a photo, save it and return an URI. Is there any way to do this?</p>","218783","","218783","","2012-05-16 13:32:50","2013-07-03 23:23:37","Android camera intent","<android><android-camera><android-camera-intent>","2","0","43","",""
"2729361","1","","","2010-04-28 12:28:46","5","1874","<p>I'm running one web application...  in an Android emulator browser.  In one javascript file I'm trying to output some string as:</p><p><code>console.log(""android"");</code></p><p>But I didn't got this log using adb logcat.</p><p>I even tried to start adb logcat firstly and then tun the app, but didn't get a log message which I used in <code>console.log</code></p><p>Is there any way I can get my log message?</p>","323876","","364708","","2012-10-09 17:18:56","2012-10-09 17:18:56","console.log is not working in Android 2.1 emulator","<android><console><android-emulator><javascript>","2","0","1","",""
"2729384","1","2729532","","2010-04-28 12:33:18","2","1029","<p>Hey guys,I just wanted to know wether it is posssible to pass geocoords to the google maps app bis intents or something similar.</p><p>I wrote an app for displaying route, coords and so on by myself, but wouldn't it be more elegant to ask google maps itself for displaying this?</p><p>I don't know if this is possible, but maybe, one of you can answer this question.</p><p>IF THIS IS POSSIBLE, is it also possible to ask google maps to calculate the route by my CURRENT POSITION?</p><p>It would be great if one of you can show me a skeleton/dummy code. I have no idea how the intents would have to look like.</p><p>Nice greetings,Poeschlorn</p>","317301","","","","","2010-04-28 13:47:06","Using the pre-installed Google Maps instead of an own activity by using Intents?","<android><maps><android-intent>","3","0","1","",""
"2729438","1","","","2010-04-28 12:41:06","9","45683","<p>I need a step by step procedure for creating a database in Android.</p>","327850","","1318946","","2013-05-03 11:54:02","2014-01-11 16:03:16","How do I create a database in android?","<android><database><sqlite>","5","2","10","2013-05-03 12:16:27",""
"2729667","1","2787142","","2010-04-28 13:09:42","2","3798","<p>I have a layout issue. What I do is this:</p><ol><li>create TableLayout in xml with zero children:<br><code>&lt;TableLayout android:id=""@+id/t_layout_contents""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_below=""@id/l_layout_tags""android:stretchColumns=""1""android:paddingLeft=""5dip""android:paddingRight=""5dip"" /&gt;</code></li><li>Insert first row programmatically in onCreate():<br><code>TableLayout tLayoutContents = (TableLayout)findViewById(R.id.t_layout_contents);<br>NoteElement nr_1 = new NoteElement(this);<br>tLayoutContents.addView(nr_1);</code></li></ol><p>Class ""NoteElement"" extends TableRow. The 1st row just consists of a blank ImageView as a placeholder and an EditText to enter text. NoteElement's constructor looks like this:</p><pre><code>public NoteElement(Context c) {      super(c);      this.context = c;      defaultText = c.getResources().getString(R.string.create_note_help_text);      imageView = new ImageView(context);    imageView.setImageResource(android.R.color.transparent);    LayoutParams params = new LayoutParams(0);    imageView.setLayoutParams(params);    addView(imageView);    addView(addTextField());}</code></pre><p>Method addTextField() specifies the attributes for the EditText widget:</p><pre><code>private EditText addTextField() {      editText = new EditText(context);      editText.setImeOptions(EditorInfo.IME_ACTION_DONE);      editText.setMinLines(4);      editText.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);    editText.setHint(R.string.create_note_et_blank_text);    editText.setAutoLinkMask(Linkify.ALL);    editText.setPadding(5, 0, 0, 0);    editText.setGravity(Gravity.TOP);    editText.setVerticalScrollBarEnabled(true);    LayoutParams params = new LayoutParams(1);    editText.setLayoutParams(params);    return editText;}</code></pre><p>So far, so good. But my problem occurs as soon as the available space for the chars is depleted. The EditText does not resize itself but switches to a single line EditText.I am desperatly looking for a way in which the EditText resizes itself in its height dynamically, being dependant on the inserted text length.</p><p>Does anyone have a hint on this?<br>Thanks &amp; regards,<br>steff</p>","289849","","","","","2014-03-17 18:12:19","How to automatically resize an EditText widget (with some attributes) in a TableLayout","<android><resize><edittext><tablelayout><tablerow>","2","0","","",""
"2729932","1","3127027","","2010-04-28 13:42:36","4","3492","<p>I have an Android application that is a TabHost with a WebView. I use it to load a specific html file that has a text field in its bottom part.</p><p>When I touch the html textfield, the soft keyboard pops up, and hides the textfield, so that I cannot see what I have typed.</p><p>Here is the layout:</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 xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/main""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" &gt;        &lt;TabWidget            android:focusableInTouchMode=""false""            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""63dp"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;LinearLayout            xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/layout""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" &gt;                &lt;WebView                    android:id=""@+id/webview""                    android:layout_width=""fill_parent""                     android:layout_height=""fill_parent""                    android:layout_weight=""1"" /&gt;            &lt;/LinearLayout&gt;        &lt;/FrameLayout&gt;          &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I have tried to configure the AndroidManifest.xml file with <em>android:windowSoftInputMode=""adjustResize""</em> with no success. I have also tried replacing the <em>FrameLayout</em> in my layout with <em>ScollView</em>, but that caused my webview to increase in size indefinitely when the application is running.. this may be due to some javascript I have running on the page. </p><p>I have noticed that the android's web browser has a nifty behaviour - in a web page, after the soft keyboard pops up, the web page scrolls smoothly so that the focusable textfield is visible to the user. How can I have this kind of behavior in my applicaiton?</p>","280503","","","","","2013-01-28 15:57:52","html textfield in WebView in an Android application is hidden by the soft keyboard","<android><keyboard><webview><textfield>","2","1","2","",""
"2729947","1","","","2010-04-28 13:44:10","5","1124","<p>I'm working with the media player on a streaming application (RTSP):</p><p>Video and sound are played great but when an incoming call pauses the <code>Activity</code>, the Surface is destroyed (I know this because of traces in <code>SurfaceHolder.Callback</code>).</p><p>Once the call finishes, the activity is resumed and a new <code>Surface</code> is created. I've tried to  assign it to the player via <code>setDisplay(SurfaceHolder sh)</code> method but so far, only the sound of the video can be heard.</p><p>The work around to resume a video stream is:</p><ul><li>Restart the <code>MediaPlayer</code> object.</li><li>Wait for the buffer to fill.</li><li>Perform a seek via the mediaPlayer.</li><li>Wait for the buffer to fill.</li></ul><p>This is annoying as the player should be able to be paused when a call is received, bind the new surface when the call completed and the <code>Activity</code> resume and play the video with no buffering at all.</p>","327916","","327916","","2010-04-28 14:43:28","2011-11-01 13:43:56","How to resume video playback after the surface was destroyed?","<java><android><media-player><rtsp>","1","0","2","",""
"2729992","1","2731360","","2010-04-28 13:48:34","4","5248","<p>I have an XML layout which contains a TableLayout with an unknown number of TableRows...The number of Rows will be established durin runtime, what I do know though is that I want two columns...So I have a couple of questions regarding this :</p><ul>- is there a way to set the whole TableLayout to have 2 columns ?</ul><p>- is there a way programmatically to give an id to the (during runtime) created TableRows which will be placed within the TableLayout, so I can reference them later on from other parts of the software ?","162147","","","","","2010-04-28 16:29:34","Setting number of columns programmatically in TableLayout","<android><tablelayout>","1","0","1","",""
"2730192","1","","","2010-04-28 14:07:31","1","1036","<p>I have a android application which is write some html files on the sdcard.</p><p>The application run on emulator very well.</p><p>But when I tried to run the same application on OMAP android device It can't write files or mkdir on the device sdcard.</p><p>I don't know how it happened.</p><p>My OMAP device use sdcard for file system at the boot time thats why it is not taking the sdcard as a external storage device so ""android.permission.WRITE_EXTERNAL_STORAGE"" doesn't  works.</p><p>now please help me to solve this problem.</p>","316451","","12855","","2010-04-29 10:35:55","2010-04-29 10:35:55","problem in write file or mkdir on android device","<android><file><device>","0","2","","",""
"2730422","1","2730525","","2010-04-28 14:37:58","2","3766","<p>I am trying to create a list view which as TextView that can display html content , an WebView and other basic TextViews.I tried to extend SimpleAdapter but i struck with the problem ,I will be glad if someone can point out the mistake i am doing.</p><p>In onCreate method</p><pre><code> ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist= resultfromXmlparser(); adap = new MyAdapter(TourLandingPage.this, mylist, R.layout.row,            new String[] {""Name"", ""desc"",""Duration"",""Price"",""imgurl""},  new int[]            {R.id.productname,R.id.des,R.id.duration,R.id.pricefrom,R.id.photo});setListAdapter(adap);My custom Adapter looks like this private class MyAdapter extends SimpleAdapter {             ArrayList&lt;HashMap&lt;String,String&gt;&gt; elements;             Context ctx;             public MyAdapter(Context context, ArrayList&lt;HashMap&lt;String,String&gt;&gt; mylist,int textViewResourceId,String[] names,int[] resouceid) {             super(context, mylist,textViewResourceId, names,resouceid);             this.elements=mylist;             this.ctx=context;             }             @Override             public int getCount() {                  return elements.size();                 }             @Override             public Object getItem(int position) {                  return elements.get(position);              }            @Override            public long getItemId(int position) {                  return position;                 }                  @Override           public View getView(int position, View convertView, ViewGroup parent) {             RelativeLayout rowLayout;                    if (convertView == null) {                     rowLayout = (RelativeLayout)                          LayoutInflater.from(ctx).inflate(R.layout.rowfor_tourlist, parent, false);               } else {                rowLayout = (RelativeLayout) convertView;                     }                  TextView in = (TextView)rowLayout.findViewById(R.id.introduction);                  TextView du = (TextView)rowLayout.findViewById(R.id.duration);                  TextView pf = (TextView)rowLayout.findViewById(R.id.pricefrom);                  TextView pn = (TextView)rowLayout.findViewById(R.id.productname);                  WebView wv=(WebView)rowLayout.findViewById(R.id.photo);                    in.setText(Html.fromHtml(mylist.get(position).get(""desc"")));                  du.setText(mylist.get(position).get(""Duration""));                  pf.setText(mylist.get(position).get(""Price""));                  pn.setText(mylist.get(position).get(""Name""));                  wv.getSettings().setJavaScriptEnabled(true);                  wv.loadUrl(mylist.get(position).get(""imgurl""));                 return convertView;             }                  }//class</code></pre><p>and my row.xml file looks like </p><pre><code>  RelativeLayout     xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""  TextView        android:id=""@+id/productname""       ......  LinearLayout         android:layout_width=""wrap_content""         android:layout_height=""60dip""         android:layout_margin=""5dip""         android:layout_below=""@id/productname""         android:orientation=""horizontal""         android:id=""@+id/lay1""         WebView           android:id=""@+id/photo""          ....         TextView            android:id=""@+id/introduction""           ......   LinearLayout   TextView       android:id=""@+id/duration""       ....   TextView      android:id=""@+id/pricefrom""       ..... RelativeLayout</code></pre><p>The error i was getting was</p><pre><code>04-28 19:46:17.749: ERROR/AndroidRuntime(976): Uncaught handler: thread main exiting due to uncaught exception04-28 19:46:17.769: ERROR/AndroidRuntime(976): java.lang.NullPointerException04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.ListView.setupChild(ListView.java:1693)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.ListView.makeAndAddView(ListView.java:1671)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.ListView.fillDown(ListView.java:637)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.ListView.fillFromTop(ListView.java:694)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.ListView.layoutChildren(ListView.java:1521)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.onLayout(LinearLayout.java:920)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.View.layout(View.java:6831)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.os.Handler.dispatchMessage(Handler.java:99)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.os.Looper.loop(Looper.java:123)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at android.app.ActivityThread.main(ActivityThread.java:4338)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at java.lang.reflect.Method.invokeNative(Native Method)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at java.lang.reflect.Method.invoke(Method.java:521)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-28 19:46:17.769: ERROR/AndroidRuntime(976):     at dalvik.system.NativeStart.main(Native Method)04-28 19:46:17.789: INFO/Process(52): Sending signal. PID: 976 SIG: 304-28 19:46:17.799: INFO/dalvikvm(976): threadid=7: reacting to signal 304-28 19:46:17.829: INFO/dalvikvm(976): Wrote stack trace to '/data/anr/traces.txt'</code></pre>","286044","","358328","","2012-07-13 12:33:58","2013-07-05 22:46:36","Cannot understand NullPointerException with custom adapter","<android><adapter>","2","1","2","",""
"2730544","1","2736139","","2010-04-28 14:52:23","1","1333","<p>I'm new in Android. I'm starting with HelloWorld program, but I can't run it on the Emulator. I'm using newest version of Eclipse and Android SDK. I also set up development environment as follows instructions on <a href=""http://developer.android.com/index.html"" rel=""nofollow"">http://developer.android.com/index.html</a>.</p><p>Does anybody have advice for me?</p>","219205","","","","","2010-10-27 21:14:05","Android 2.1: can't run HelloWorld on the Emulator","<android>","5","2","","",""
"2730610","1","2732108","","2010-04-28 14:59:50","4","2945","<p>I am trying to make the Spinner behave different way when the user clicked on an item for a long time. I have spinner with some project and I want two things.</p><ol><li>When the user simple click on an item I want to normal select it.</li><li>When the user have long clicked on an item I want to show dialog, with options like ""Edit item"", ""Delete item"".</li></ol><p>The first step works well (ofcourse), but when I am trying to do the second task I can not make spinner to generate longClicked event.</p><p>Here is my code:</p><pre><code>    this.projectSpinner = (Spinner) this.findViewById(R.id.SpinnerProjects);    this.projectSpinner.setLongClickable(true);    this.projectSpinner.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener(){        public boolean onItemLongClick(AdapterView&lt;?&gt; arg0,                                        View arg1,                                        int arg2,                                        long arg3) {            Toast.makeText(                 AndroidTimeTrackerMainActivity.this,                  ""Long click"",                  Toast.LENGTH_SHORT).show(); // This toast doesn't show up.            return false;        }    });</code></pre>","327960","","","","","2011-12-28 18:27:03","How can I use spinner setOnItemLongClickListener","<android><spinner>","2","0","1","",""
"2730706","1","2938184","","2010-04-28 15:09:34","28","30185","<p>I am developing an application in which there will be a search screenwhere user can search for specific keywords and that keyword should behighlighted. I have found Html.fromHtml method.</p><p>But I will like to know whether its the proper way of doing it ornot.</p><p>Please let me know your views on this.</p>","261566","","1069068","","2013-03-19 14:47:01","2013-03-19 14:47:01","Highlighting Text Color using Html.fromHtml() in Android?","<android><text><highlight><textview>","4","2","18","",""
"2730754","1","7741283","","2010-04-28 15:15:14","1","2895","<p>I have a stream from an icecast server downloading, and I can grab the information in the headers by doing the following:</p><pre><code> URLConnection cn = new URL(mediaUrl).openConnection();       cn.connect();       int pos=1;    String x;    String y;</code></pre><p>while (cn.getHeaderField(pos) != null)        {   x=cn.getHeaderFieldKey(pos);   y = cn.getHeaderField(x);   Log.e("":::::"",""""+x+"" : ""+y);   pos++;        }</p><p>When I do this all of the headers I receive are shown as:</p><p>content-type : audio/mpeg icy-br : 64 ice-audio-info : ice-samplerate=22050;ice-bitrate=64;ice-channels=2 icy-br : 64 icy-description : RadioStation icy-genre : Classical, New Age, Ambient icy-name : RadioStation Example icy-private : 0 icy-pub : 1 icy-url : <a href=""http://exampleradio.com"" rel=""nofollow"">http://exampleradio.com</a> server : Icecast 2.3.2 cache-control : no-cache</p><p>However if I open my stream in mplayer I get:</p><pre><code> ICY Info: StreamTitle='artist - album - trackname' </code></pre><p>and with each time the song is changed, the new track information is sent appearing the same way in mplayer.</p><p>In android when I attempt to read the icy-info all I get returned is null. Also how would I go about retrieving the new information from the headers while I am buffering from the stream? Because even if I try to read the header of something I already know exists whilst buffering such as:</p><pre><code>  Log.e(getClass().getName(),"" ""+cn.getHeaderField(""icy-br""));</code></pre><p>All I get returned is null. </p><p>I hope this makes sense, I can post more code on request.</p>","315998","","315998","","2010-04-29 14:52:39","2011-10-12 14:00:25","Android streaming from icecast server get track information","<android><audio-streaming><shoutcast><icecast>","2","0","1","",""
"2730855","1","2730894","","2010-04-28 15:25:14","103","69493","<p>I have one of my activities which I would like to prevent from rotating because I'm starting an AsyncTask, and screen rotation  makes it restart. So is there any way to tell this activity ""DO NOT ROTATE the screen even if the user is shaking his phone like mad""?</p>","263521","","50776","","2012-07-27 15:06:00","2014-03-01 12:32:45","prevent screen rotation android","<android><rotation><screen>","6","4","24","",""
"2730874","1","","","2010-04-28 15:28:00","0","1143","<p>I'm trying to create a AppWidget that displays a number of items (which can change). I'd like to generate TextViews dynamically, I assume I do this by using:</p><pre><code>RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.id.widgetmain);RemoteViews newView = new RemoteViews(context.getPackageName(), R.id.widgetitem);updateViews.addView(0, newView);</code></pre><p>But this returns a <code>Problem loading widget</code> error. The widgetitem.xml is just a TextView within a LinearLayout. The widgetmain.xml is two TextViews within a LinearLayout.</p><p>What am I doing wrong?</p>","328025","","1043882","","2012-09-19 03:57:33","2012-09-19 03:57:33","RemoteViews addView function returns errors on AppWidget","<android><appwidget>","1","0","","",""
"2730948","1","2731078","","2010-04-28 15:35:32","4","1540","<p>I know the artist and trackname for a song, but I am unsure of what service or how to download album art for the track.</p><p>I believe iTunes and Amazon both offer services but I am unsure of how to integrate these services, any links or suggestions are appreciated.</p>","315998","","","","","2010-04-28 15:52:57","Download album art from internet in an android application","<java><android><albumart>","1","0","2","",""
"2730967","1","4615576","","2010-04-28 15:37:36","0","385","<p>I'm working on an android activity with a RadioGroup containing 10 RadioButtons. For some reason or another sometimes, only sometimes, when you select a RadioButton in the RadioGroup it doesn't highlight as if it's selected but through some tests I've determined that it really IS selected even though it isn't highlighted. Another odd thing that occurs is that when you select any other RadioButton in the RadioGroup and then try selecting your original Radio Button (the one that wouldn't highlight as though it were selected) it does highlight and functions as normal.</p><p>Any idea why this is happening or how to fix it?Thanks!</p>","198116","","","","","2013-08-17 22:15:49","Radio Buttons not highlighting as though they are selected","<android><radio-button><android-layout>","2","3","","",""
"2731564","1","3072339","","2010-04-28 17:01:27","9","12964","<p>Note: As of Jellybean the gallery widget is deprecated. A <a href=""http://developer.android.com/reference/android/support/v4/view/ViewPager.html"" rel=""nofollow"">ViewPager</a> should be used instead.</p><hr><p>I'd like to programmatically move between images in the Gallery widget, with animation.</p><p>I can change the currently displaying image using the <code>setSelection(int position)</code> method, however that does not animate. Then there's <code>setSelection(int position, bool animate)</code> but the extra boolean on the end there doesn't appear to do anything.</p><p>In the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/Gallery.java"" rel=""nofollow"">source of Gallery</a> it appears that it can handle DPAD key-presses, so a work-around I thought of was to fake the key-presses. Eg.</p><pre><code>dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT))</code></pre><p>However I can't get this working for some reason. Anyone tried this?</p><p>I notice three of the widget's methods I'd love to use <code>moveNext()</code>, <code>movePrevious()</code> and <code>scrollToChild()</code> are all private and unusable.</p><p>Does anyone know how I might be able to do this?</p>","172749","","172749","","2012-12-20 17:37:25","2012-12-20 17:37:25","Android: Programmatically animate between images in Gallery widget","<android><image><widget><gallery>","5","0","7","",""
"2731775","1","","","2010-04-28 17:29:29","0","2806","<p>I'm trying to build a gallery where the images within will be pulled from the images URL from a website.  i.e. Instead of doing R.drawable.xxxx.jpg, you use a url to represent the image.</p><p>Is this possible?  If so, can you show me an example in code?</p><p>Thanks</p>","328141","","328141","","2010-04-28 17:45:05","2012-09-20 06:35:52","Android Dev.: How to populate gallery by image URL?","<android><image><url><gallery><photo-gallery>","1","0","1","",""
"2731994","1","","","2010-04-28 18:01:19","0","1139","<p>I am getting this ""java.io.FileNotFoundException: res/drawable-nodpi/background.xml"".But I do have a file in  </p><p>$</p><pre><code> ls -la res/drawable-nodpi/background.xml -rw-r--r--  1 michael  staff  859 Mar  8 09:28 res/drawable-nodpi/background.xmlE/AndroidRuntime(  301): Caused by: java.io.FileNotFoundException: res/drawable-nodpi/background.xmlE/AndroidRuntime(  301):        at android.content.res.AssetManager.openXmlAssetNative(Native Method)E/AndroidRuntime(  301):        at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:469)E/AndroidRuntime(  301):        at android.content.res.Resources.loadXmlResourceParser(Resources.java:1894)</code></pre>","286802","","","","","2013-03-14 11:58:24","res file not found exception","<android>","1","4","","",""
"2732153","1","2740212","","2010-04-28 18:27:41","3","5545","<p>I am trying to use a ViewFlipper and make it act like the home screen(The layout will move with your finger). <a href=""http://stackoverflow.com/questions/2600916/making-a-viewflipper-like-the-home-screen-using-motionevent-action-move/2724927#2724927"">Check out this</a> for an example. I want to do this with a ViewFlipper that only contains two children so the opposite view should be shown on either side of the current view depending on which way the user moves their finger. This code works but only for 1 direction at a time. This is in onTouchEvent. </p><pre><code>case MotionEvent.ACTION_MOVE: leftView.setVisibility(View.VISIBLE);rightView.setVisibility(View.VISIBLE);// move the current view to the left or right.currentView.layout((int) (touchEvent.getX() - oldTouchValue),    currentView.getTop(),    (int) (touchEvent.getX() - oldTouchValue) + 320,    currentView.getBottom());// place this view just left of the currentViewleftView.layout(currentView.getLeft() - 320, leftView.getTop(),    currentView.getLeft(), leftView.getBottom());// place this view just right of the currentViewrightView.layout(currentView.getRight(), rightView.getTop(),     currentView.getRight() + 320, rightView.getBottom());</code></pre><p>Which ever of the bottom two lines I put last that direction will work correctly but the other will not.</p><p>Here is how I set the leftView and rightView:</p><pre><code>final View currentView = myFlipper.getCurrentView();final View leftView, rightView;if (currentView == meView) {    Log.d(""current layout: "", ""me"");    leftView = youView;    rightView = youView;} else if (currentView == youView) {    Log.d(""current layout: "", ""you"");    leftView = meView;    rightView = meView;} else {    leftView = null;    rightView = null;}</code></pre><p>Is it going to be possible to set it up so that the same view is shown on both sides of the current view? </p>","277215","","243203","","2011-10-12 04:56:59","2011-10-12 04:57:11","Android ViewFlipper + homescreen animation","<android><animation><homescreen><viewflipper>","4","1","8","",""
"2732682","1","2732772","","2010-04-28 19:52:08","46","29885","<p>I'm curious about the <code>&lt;merge&gt;</code> and <code>&lt;include&gt;</code> tags in Android XML-layouts. I've read two tutorials, but haven't yet found a simple example usage.</p><p>Would be happy if someone could provide such an example or give a pointer to one.</p>","276052","","","","","2014-04-11 05:05:14","Simple example of <merge> and <include> usage in Android XML-layouts","<xml><android><layout><merge><include>","5","2","12","",""
"2732683","1","2732738","","2010-04-28 19:52:08","6","697","<p>I'm building an alternative Home application (a replacement of the standard launcher).</p><p>There's something I don't know how to make : how do you register your application so that it is called when the user click on the Home hard button ?</p>","263525","","","","","2010-04-28 20:03:44","How to register an application as a Home alternative","<android>","1","0","5","",""
"2732758","1","2732858","","2010-04-28 20:05:50","2","1657","<p>I have a TextView that I created in the main.xml. In my app.java I am dynamically positioning that TextView based on where the user taps the screen. The problem I am having is that when I call myTextView.setPadding(100,100,0,0), it moves the actual Text of the TextView, but does not move the Colored Background of the TextView. </p><p>Ideas?</p>","300129","","","","","2010-06-02 08:28:36","Android TextView's Background Not Moving When TextView.Padding Changes","<android><background><position><textview>","3","0","","",""
"2733255","1","2733263","","2010-04-28 21:26:42","11","19326","<p><br>I want to replace all whitespace characters in a string with a ""+"" and all ""ß"" with ""ss""... it works well for ""ß"", but somehow eclipse won't let me use \s for a whitespace.. I tried ""\t"" instead, but it doesn't work either.. I get the following error:</p><blockquote>  <p>Invalid escape sequence (valid ones  are \b \t \n \f \r \"" \' \ )</p></blockquote><p>this is my code:</p><pre><code>try {                String temp1 = from.getText().toString();                start_from  = temp1.replaceAll(""ß"", ""ss"");                start_from  = start_from.replaceAll(""\s"", ""+"");                }</code></pre><p>why doesn't it work? is it a problem with android, eclipse or what?</p><p>thanks in advance!</p>","323814","","","","","2010-04-28 21:34:23","Java doesn't work with regex \s, says: invalid escape sequence","<java><android><regex><eclipse><whitespace>","4","2","3","",""
"2733297","1","","","2010-04-28 21:34:06","5","2086","<p>While programming on Android, I end up writing a parent activity which is extended by several others. A bit like ListActivity. My parent activity extends Activity. if I intend to use a Map or a List, I can't use my parent activity as superclass - the child activity can only extend one activity obviously. As such I end up writing my parent activities with the same logic for Activity, ListActivity, MapActivity and so forth.</p><p>What am I looking for is some sort of trait functionality/design pattern which would help in this case. Any suggestions?</p>","982506","","18914","","2010-04-28 22:03:41","2010-04-29 07:04:36","Design pattern for extending Android's activities?","<android><design><patterns>","3","0","1","",""
"2733576","1","2733626","","2010-04-28 22:35:05","1","2454","<p>I use the following code to create a folder ""mymir"" and a file "".nomedia"" (in the mymir-folder) on the sdcard of an android unit. However, somehow it fails with the exception that the folder the "".nomedia""-file is to be placed in dosn't exist. Here's the code:</p><pre><code>private String EnsureRootDir() throws IOException{    File sdcard = Environment.getExternalStorageDirectory();    File mymirFolder = new File(sdcard.getAbsolutePath() + ""/mymir/"");    if(!mymirFolder.exists())    {        File noMedia = new File(mymirFolder.getAbsolutePath() + ""/.nomedia"");        noMedia.mkdirs();        noMedia.createNewFile();    }    return mymirFolder.getAbsolutePath();}</code></pre>","213323","","","","","2010-04-28 22:45:13","Android file-creation fails","<java><android><io>","1","1","1","",""
"2733589","1","2733615","","2010-04-28 22:37:03","7","3572","<p>I want to add a Custom field to the ContactsContract content provider. I'm trying to build a Voip application and would like to add a SIP address(name@domain) field to it. What MIME type will I need to associate with it?Also I want to add a group address field which will have a list of group addresses in it (name@domain, name@domain,...). Wich MIME type will I have to associate with this type of field.</p><p>I also want to add custom fields to the Call History like a session ID and SIP address(name@domain) field. How can I customize the call history?</p><p>It'll be great if someone can give me an example.</p>","328302","","328302","","2010-04-28 22:44:13","2010-04-28 22:44:13","How to add new field(s) to the contact?","<android>","1","0","6","",""
"2733630","1","2872357","","2010-04-28 22:47:12","2","150","<p>I retrieve a JSON list of contacts from a social network site. It contains firstname, lastname, displayname, data1, data2, etc...</p><p>What is the efficient way to quickly lookup my local phone contacts database and ""match"" them based on their name. Since there are firstname, lastname and displayname this can vary.<br>What do you think, how can the best match be achieved?</p><p>Also how do I make sure I don't parse for each JSON item the whole database I want to avoide having JSON_COUNT x MOBILE COUNT steps</p><p><strong>Edit</strong></p><p>Still looking for some answers.</p>","243782","","243782","","2010-05-11 09:41:04","2010-05-20 09:11:05","Syncronizing mobile phone contacts with contacts from social networks","<java><android><mobile><synchronization><social-networking>","1","0","2","",""
"2733679","1","","","2010-04-28 22:59:26","0","1219","<p>I'm trying to build an android application that features a graphical display drawn within a RelativeLayout.  I want to place ""+"" and ""-"" buttons next to several of the parameters, which are drawn at various points on the canvas.  The positions are free-form don't seem to conform to any of the standard XML layouts.</p><p>I know how to create the buttons programmatically, but I don't know how to place them over the canvas where I need them to be.  I'm assuming that this would be done in the view thread's doDraw() method, after all the graphics have been drawn, but how?</p>","328364","","","","","2010-11-24 13:22:57","Android button in arbitrary position over RelativeLayout","<android><button>","1","0","","",""
"2733750","1","2733916","","2010-04-28 23:17:00","1","4506","<p><br>I want to create a normal AlertDialog. I used the example provided by the android dev docs. I just changed the DIALOG_PAUSED_ID to DIALOG_DELETEDB. If I execute my code and press the button which in return should create the dialog, I get the following error log:</p><pre><code>04-29 01:01:20.973: WARN/dalvikvm(1168): threadid=3: thread exiting with uncaught exception (group=0x4001b188)04-29 01:01:20.973: ERROR/AndroidRuntime(1168): Uncaught handler: thread main exiting due to uncaught exception04-29 01:01:20.993: ERROR/AndroidRuntime(1168): java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 404-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.app.Activity.createDialog(Activity.java:871)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.app.Activity.showDialog(Activity.java:2483)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at mjb.project.AVV.Favs.onMenuItemSelected(Favs.java:111)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:525)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.view.View.onTouchEvent(View.java:4179)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.widget.TextView.onTouchEvent(TextView.java:6540)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.view.View.dispatchTouchEvent(View.java:3709)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.os.Handler.dispatchMessage(Handler.java:99)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.os.Looper.loop(Looper.java:123)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at android.app.ActivityThread.main(ActivityThread.java:4363)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at java.lang.reflect.Method.invokeNative(Native Method)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at java.lang.reflect.Method.invoke(Method.java:521)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)04-29 01:01:20.993: ERROR/AndroidRuntime(1168):     at dalvik.system.NativeStart.main(Native Method)</code></pre><blockquote>  <p>so here are the ""relevant"" code parts:</p></blockquote><p>define the ID:</p><pre><code>private static final int DELETE_DB_ID   = 3;private Dialog dialog;static final int DIALOG_DELETEDB = 4;</code></pre><p>onCreateDialog(...):</p><pre><code>protected Dialog onCreateDialog(int id) {        switch(id) {        case DIALOG_DELETEDB:            // do the work to define the pause Dialog            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setMessage(""Are you sure you want to exit?"")            .setCancelable(false)            .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                     Favs.this.finish();                }            })            .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                     dialog.cancel();                }            });            AlertDialog alert = builder.create();            alert.show();            break;        default:            dialog = null;        }return dialog;    }</code></pre><p>Here I try to ""create"" the dialog:</p><pre><code>@Override    public boolean onMenuItemSelected(int featureId, MenuItem item) {        switch(item.getItemId()) {        case ADD_ID:            createNote();            return true;        case DELETE_DB_ID:            showDialog(DIALOG_DELETEDB);            return true;        }              return super.onMenuItemSelected(featureId, item);    }</code></pre><p>As I already said, I just copied the code and changed the name. Unfortunately, I don't understand the error log message.. :/ Somehow I think I don't return the created dialog, but I cannot see ""where"" my reference is or where/what I have to return... </p><p>thanks in advance for help.</p>","323814","","323814","","2010-04-28 23:30:00","2010-04-29 01:34:03","AlerDialog is not created - java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id X","<java><android><alertdialog>","1","0","","",""
"2733881","1","","","2010-04-28 23:47:08","2","594","<p>I am trying to run a python script through an application I've written. I found some pages which say that this piece of code is doing it, but I can't figure it out.</p><p><a href=""http://code.google.com/p/android-scripting/source/browse/android/AndroidScriptingEnvironment/src/com/google/ase/locale/LocaleReceiver.java"" rel=""nofollow"">http://code.google.com/p/android-scripting/source/browse/android/AndroidScriptingEnvironment/src/com/google/ase/locale/LocaleReceiver.java</a></p><p>Can someone explain what is going on and how I can edit that to run an arbitrary script file in my project directory?</p>","136458","","","","","2010-04-29 15:16:11","running python from an android app","<java><python><android><android-scripting>","1","0","1","",""
"2733907","1","2733998","","2010-04-28 23:54:00","45","8997","<p>Can anyone explain the question mark means in Android XML attributes?</p><pre><code>&lt;TextView        style=""?android:attr/windowTitleStyle""    More attributes/&gt;</code></pre>","165495","","","","","2012-08-31 10:16:26","Question mark (?) in XML attributes for Android","<xml><android>","1","0","4","",""
"2733971","1","","","2010-04-29 00:07:37","5","1353","<p>I want to install a python package from source on android. Is this possible? I tried in the console to run the py install files, but distutils (.core, ccompiler) isn't being found. Is it possible to still install them?</p>","136458","","136458","","2010-04-29 00:22:59","2010-04-30 05:05:49","installing python packages on android","<java><python><android><android-scripting>","2","1","","",""
"2734270","1","2746708","","2010-04-29 01:41:54","221","106879","<p>I have the following TextView defined: </p><pre><code>&lt;TextView android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""@string/txtCredits""    android:autoLink=""web"" android:id=""@+id/infoTxtCredits""    android:layout_centerInParent=""true""    android:linksClickable=""true""&gt;&lt;/TextView&gt;</code></pre><p>where @string/txtCredits is a string resource that contains <code>&lt;a href=""some site""&gt;Link text&lt;/a&gt;</code>.</p><p>Android is highlighting the links in the TextView, but they do not respond to clicks.  Can someone tell me what I'm doing wrong?  Do I have to set an onClickListener for the TextView in my activity for something as simple as this?</p><p>Looks like it has to do with the way I define my string resource.This does not work:    <code>&lt;string name=""txtCredits""&gt;&lt;a href=""http://www.google.com""&gt;Google&lt;/a&gt;&lt;/string&gt;</code></p><p>But this does:    <code>&lt;string name=""txtCredits""&gt;www.google.com&lt;/string&gt;</code></p><p>Which is a bummer because I would much rather show a text link than show the full URL.  </p>","233202","","804479","","2012-10-05 14:47:24","2014-03-26 13:00:01","How do I make links in a TextView clickable?","<android><hyperlink><android-textview><clickable>","19","2","99","",""
"2734299","1","2827732","","2010-04-29 01:49:32","0","166","<p>As I know Dalvik VM does not support generational GC as default.</p><p>But, I found ""<code>WITH_OBJECT_HEADERS</code>"" compilation flag which could be related with generational GC from <code>HeapInternal.h</code> file.</p><pre><code>typedef struct DvmHeapChunk {#if WITH_OBJECT_HEADERS    u4 header;    const Object *parent;    const Object *parentOld;    const Object *markFinger;    const Object *markFingerOld;    u2 birthGeneration;    u2 markCount;    u2 scanCount;    u2 oldMarkGeneration;    u2 markGeneration;    u2 oldScanGeneration;    u2 scanGeneration;#endif</code></pre><p>Does anyone try to build Dalvik with this option enabled? Do you know anything about generational GC support from Dalvik?</p>","212862","","844882","","2012-03-18 09:25:12","2012-03-18 09:25:12","WITH_OBJECT_HEADERS enabled GC from Dalvik?","<android><garbage-collection><virtual-machine><dalvik>","1","0","","",""
"2734318","1","","","2010-04-29 01:54:29","0","864","<p>I have an event handler that I want to be connected to a button through xml. </p><p>Basically, I want to define it as a string in my xml file, then use the property inspector to select the name of the handler for my button (the ""on Click"" property).</p><p>How do I define a call to the function in the string?</p>","328438","","","","","2010-04-29 03:10:24","How to define function in a string in Android?","<java><xml><android><string>","2","1","","",""
"2734506","1","4942022","","2010-04-29 02:49:31","7","1377","<p>I am about to finish my Android application. I would like to provide lite version and more complete paid pro version. Unfortunately, Google does not allow Australian developers to sell applications and I don't have any friends in US or UK.</p><p>Does anyone know of a person/company who would publish my pro application on my behalf? Google search did not bring up any results.</p><p>Thanks.</p>","290469","","","","","2011-08-26 20:58:41","Application Publisher","<android><google-play>","4","1","1","",""
"2734673","1","","","2010-04-29 03:55:00","0","1159","<p>Android: programmatically - how to open a email received on mail account (example gmail). Like in BlackBerry There is ViewListener interface, which has open() and close() method. Is there any Similar Interface in Android as well. Please advice. </p>","328480","","","","","2010-12-29 10:55:42","Android: programmatically - how to open a email received on mail account (example gmail). Like in BlackBerry There is ViewListener interface, which has open() and close() method","<android><email>","1","2","1","",""
"2734749","1","2734847","","2010-04-29 04:19:50","8","6544","<p>I am designing an app in which i need to open an email client on clicking a button. The email client should be opened with a pre-defined subject and 'to' address. Is there a way to attain this? Please provide me the solution and a code example if possible... </p>","303155","","18601","","2011-12-17 13:08:17","2013-08-14 20:19:19","Opening an email client on clicking a button","<android><email>","2","0","6","",""
"2734776","1","","","2010-04-29 04:29:36","2","750","<p>A table with ~100k rows.</p><pre><code>SELECT word FROM entries WHERE word MATCH '""chicken *""';17 results in 46msSELECT word FROM entries WHERE word MATCH '""chicken f*""';2 results in 5793ms</code></pre><p>Why such a huge drop?</p>","15187","","299599","","2011-09-26 23:31:03","2011-09-26 23:31:03","SQLite FTS3 inconsistent performance","<android><sqlite><fts3>","1","1","","",""
"2734828","1","2734849","","2010-04-29 04:50:04","5","1909","<p>I'm writing a dictionary app and need to do the usual word suggesting while typing.</p><p><code>LIKE somestring%</code> is rather slow (~1300ms on a ~100k row table) so I've turned to FTS3.</p><p>Problem is, I haven't found a sane way to search from the beginning of a string.<br>Now I'm performing a query like  </p><pre><code>SELECT word, offsets(entries) FROM entries WHERE word MATCH '""chicken *""';</code></pre><p>, then parse the offsets string in code.</p><p>Are there any better options?</p>","15187","","35245","","2012-07-05 09:53:26","2012-07-05 09:53:26","SQLite FTS3 simulate LIKE somestring%","<android><sqlite><fts3>","1","0","3","",""
"2734878","1","2739711","","2010-04-29 05:01:27","1","2391","<p>I want to basically intercept a text message that has an image attached, and save that somewhere automatically. Can this work on Android?</p>","210173","","","","","2010-04-29 18:16:52","Can you intercept a MMS SMS message and extract the image on Android?","<android><sms><mms>","1","3","","",""
"2734886","1","2737588","","2010-04-29 05:03:00","3","7923","<p>On Motorola Droid, Firmware 2.1-update1, Kernel 2.9.29-omap1, Build # ESE81</p><p>When attempting to take a picture, mediaserver dies with a segmentation fault.</p><p>I've tried putting <code>takePicture</code> in a timer and running it a few seconds after camera initialization to check for race conditions, but no change. Just calling <code>Camera.open()</code> doesn't cause the crash. Also, calling <code>Camera.open()</code> causes what I think is the autofocus motor to make a sort of ticking sound.</p><p>Code that breaks:</p><pre><code>import android.app.Activity;import android.os.Bundle;public final class ChopperMain extends Activity {    public void onCreate(Bundle savedInstanceState) {    try {        Camera camera = Camera.open();        catch (Exception e) {            e.printStackTrace();        }        camera.takePicture(                new Camera.ShutterCallback() {                    public void onShutter() {                        ;                    }                },                 new Camera.PictureCallback() {                    public void onPictureTaken(byte[] data, Camera camera) {                        ;                    }                },                new Camera.PictureCallback() {                    public void onPictureTaken(byte[] data, Camera camera) {                        ;                    }                },            new PictureCallback() {                public void onPictureTaken(byte[] data, Camera camera) {                    System.out.println(""Ta da."");                }            }        });    }    catch (Exception e) {        e.printStackTrace();    }    }}</code></pre><p>Debug Log:</p><pre><code>D/CameraHal(10158): CameraSettings constructorD/CameraHal(10158): CameraHal constructorD/CameraHal(10158): Model ID: DroidD/CameraHal(10158): Software ID 2.1-update1D/dalvikvm(  988): GC freed 2 objects / 56 bytes in 215msD/ViewFlipper( 1074): updateRunning() mVisible=false, mStarted=true, mUserPresent=false, mRunning=falseI/HPAndroidHAL(10158): Version 2988.  Build Time: Oct 26 2009:11:21:55.D/CameraHal(10158): 19 default parametersD/CameraHal(10158): Immediate Zoom/1:0. Current zoom level/1:0D/CameraHal(10158): CameraHal constructor exited okD/CameraService(10158): Client::Client X (pid 10400)D/CameraService(10158): CameraService::connect XD/CameraService(10158): takePicture (pid 10400)I/DEBUG   (10159): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   (10159): Build fingerprint: 'verizon/voles/sholes/sholes:2.1-update1/ESE81/29593:user/release-keys'I/DEBUG   (10159): pid: 10158, tid: 10158  &gt;&gt;&gt; /system/bin/mediaserver &lt;&lt;&lt;I/DEBUG   (10159): signal 11 (SIGSEGV), fault addr 00000008I/DEBUG   (10159):  r0 00000000  r1 00000000  r2 a969030c  r3 a9d1bfe0I/DEBUG   (10159):  r4 00045eb0  r5 0000eb10  r6 000153a0  r7 a9c89fd2I/DEBUG   (10159):  r8 00000000  r9 00000000  10 00000000  fp 00000000I/DEBUG   (10159):  ip a969085c  sp bec4fba0  lr a9689c65  pc a9d1bfde  cpsr 60000030I/DEBUG   (10159):          #00  pc 0001bfde  /system/lib/libutils.soI/DEBUG   (10159):          #01  pc 00009c62  /system/lib/libcamera.soI/DEBUG   (10159):          #02  pc 00007b0c  /system/lib/libcameraservice.soI/DEBUG   (10159):          #03  pc 00021f98  /system/lib/libui.soI/DEBUG   (10159):          #04  pc 00015514  /system/lib/libbinder.soI/DEBUG   (10159):          #05  pc 00018dd8  /system/lib/libbinder.soI/DEBUG   (10159):          #06  pc 00018fa6  /system/lib/libbinder.soI/DEBUG   (10159):          #07  pc 000087d2  /system/bin/mediaserverI/DEBUG   (10159):          #08  pc 0000c228  /system/lib/libc.soI/DEBUG   (10159): I/DEBUG   (10159): code around pc:I/DEBUG   (10159): a9d1bfcc bd1061e3 f7f3b510 bd10e97e 4d17b570 I/DEBUG   (10159): a9d1bfdc 6886a300 460418ed fff4f7ff d10a4286 I/DEBUG   (10159): a9d1bfec 46234913 20054a13 f06f1869 18aa040a I/DEBUG   (10159): I/DEBUG   (10159): code around lr:I/DEBUG   (10159): a9689c54 e0240412 0204f8d0 050cf104 edf0f7fd I/DEBUG   (10159): a9689c64 f7fd4628 f8d4ecf2 b1533204 f852681a I/DEBUG   (10159): a9689c74 18581c0c 7101f504 ed82f7fd f8c42000 I/DEBUG   (10159): I/DEBUG   (10159): stack:I/DEBUG   (10159):     bec4fb60  4000902c  /dev/binderI/DEBUG   (10159):     bec4fb64  a9d19675  /system/lib/libutils.soI/DEBUG   (10159):     bec4fb68  00002bb4  I/DEBUG   (10159):     bec4fb6c  a9d1b26f  /system/lib/libutils.soI/DEBUG   (10159):     bec4fb70  bec4fbbc  [stack]I/DEBUG   (10159):     bec4fb74  00095080  [heap]I/DEBUG   (10159):     bec4fb78  a9c8c028  /system/lib/libcameraservice.soI/DEBUG   (10159):     bec4fb7c  a9c8c028  /system/lib/libcameraservice.soI/DEBUG   (10159):     bec4fb80  00015390  [heap]I/DEBUG   (10159):     bec4fb84  a9c89fd2  /system/lib/libcameraservice.soI/DEBUG   (10159):     bec4fb88  00045ebc  [heap]I/DEBUG   (10159):     bec4fb8c  afe0f110  /system/lib/libc.soI/DEBUG   (10159):     bec4fb90  00000000  I/DEBUG   (10159):     bec4fb94  afe0f028  /system/lib/libc.soI/DEBUG   (10159):     bec4fb98  df002777  I/DEBUG   (10159):     bec4fb9c  e3a070ad  I/DEBUG   (10159): #00 bec4fba0  00045eb0  [heap]I/DEBUG   (10159):     bec4fba4  00045ebc  [heap]I/DEBUG   (10159):     bec4fba8  000153a0  [heap]I/DEBUG   (10159):     bec4fbac  a9689c65  /system/lib/libcamera.soI/DEBUG   (10159): #01 bec4fbb0  a9c8c028  /system/lib/libcameraservice.soI/DEBUG   (10159):     bec4fbb4  00015390  [heap]I/DEBUG   (10159):     bec4fbb8  000153a0  [heap]I/DEBUG   (10159):     bec4fbbc  a9c87b0f  /system/lib/libcameraservice.soI/DEBUG   (10159): debuggerd committing suicide to free the zombie!I/DEBUG   (10426): debuggerd: Mar 22 2010 17:31:05W/MediaPlayer( 1021): MediaPlayer server died!I/ServiceManager(  984): service 'media.audio_flinger' diedI/ServiceManager(  984): service 'media.player' diedI/ServiceManager(  984): service 'media.camera' diedI/ServiceManager(  984): service 'media.audio_policy' diedW/Camera  (10400): Camera server died!W/Camera  (10400): ICamera diedE/Camera  (10400): Error 100I/System.out(10400): Camera error, code 100W/AudioSystem( 1021): AudioFlinger server died!W/AudioSystem( 1021): AudioPolicyService server died!I/        (10425): ServiceManager: 0xad08E/AudioPostProcessor(10425): E/AudioPostProcessor(10425): AudioMgr Error:Failed to open gains file /data/ap_gain.binE/AudioPostProcessor(10425): E/AudioPostProcessor(10425): AudioMgr Error:Failed to  read gains/coeffs from /data E/AudioPostProcessor(10425): Audio coeffs init success. I/CameraService(10425): CameraService started: pid=10425D/Audio_Unsolicited(10425): in readyToRunD/Audio_Unsolicited(10425): Create socket successful 10 I/AudioFlinger(10425): AudioFlinger's thread 0x11c30 ready to runE/AudioService( 1021): Media server died.E/AudioService( 1021): Media server started.W/AudioPolicyManager(10425): setPhoneState() setting same state 0</code></pre>","328511","","648313","","2011-11-30 15:11:58","2011-11-30 15:11:58","Droid's mediaserver dies on camera.takePicture()","<android><android-camera>","1","0","","",""
"2734892","1","2735059","","2010-04-29 05:06:11","8","12089","<p>I wrote a custom Adapter for a listview ,but when i tried implement click event for list item ,i found that it was not responding ,I will be glad if someone suggest me a solution.</p><pre><code>public class TourList extends ListActivity {....setContentView(R.layout.tourlist);.....getListView().setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {                     //i couldn't reach here             Log.v(TAG,""did u get me"");        }      }); adap = new MyAdapter(TourList.this,mylist);getListView().setAdapter(adap);</code></pre><p>and my custom adapter is</p><pre><code>private class MyAdapter extends BaseAdapter {            ArrayList&lt;HashMap&lt;String,String&gt;&gt; elements;            Context ctx;            public MyAdapter(Context context, ArrayList&lt;HashMap&lt;String,String&gt;&gt; mylist) {                  this.elements=mylist;                  this.ctx=context;             }            public boolean isEnabled(int position){               return true;                      }            @Override            public int getCount() {                return elements.size();                }            @Override            public Object getItem(int position) {                return elements.get(position);                }            @Override            public long getItemId(int position) {                return position;                }                @Override            public View getView(int position, View convertView, ViewGroup parent) {                View v = convertView;                if (convertView == null) {                      LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                      v = vi.inflate(R.layout.rowfor_tourlist, null);                 }                     TextView in = (TextView)v.findViewById(R.id.intro);                    TextView du = (TextView)v.findViewById(R.id.duration);                    TextView pf = (TextView)v.findViewById(R.id.price);                    TextView pn = (TextView)v.findViewById(R.id.product);                    WebView wv=(WebView)v.findViewById(R.id.photo);                      in.setText(Html.fromHtml(mylist.get(position).get(""Intro"")));                    du.setText(mylist.get(position).get(""Duration""));                    pf.setText(mylist.get(position).get(""Price""));                    pn.setText(mylist.get(position).get(""Product""));                    wv.getSettings().setJavaScriptEnabled(true);                    wv.loadUrl(mylist.get(position).get(""ImageURL""));                return v;            }                   }//class</code></pre><p>and my tourlist.xml file looks  like</p><pre><code> &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""            ....        &gt; &lt;ListView android:id=""@id/android:list""           android:layout_width=""fill_parent""            android:layout_height=""fill_parent""           android:background=""@drawable/white""            android:cacheColorHint=""#00000000""           android:layout_weight=""1""           /&gt;&lt;/...&gt;</code></pre>","286044","","","","","2012-05-08 18:25:16","setOnItemClickListener not responding for Custom ListView","<android><listview><adapter>","2","0","1","",""
"2734974","1","2735040","","2010-04-29 05:33:28","1","293","<p>i developed one application that should run on all the android supported devices.can you please suggest me different screen resolution of android os devices </p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2010-04-29 05:52:30","android supported devices","<android>","1","0","","",""
"2735102","1","2740204","","2010-04-29 06:08:09","57","49816","<p>I am running remote audio-file-fetching and audio file playback operations in a background thread using <code>AsyncTask</code>. A <code>Cancellable</code> progress bar is shown for the time the fetch operation runs. </p><p>I want to cancel/abort the <code>AsyncTask</code> run when the user cancels (decides against) the operation. What is the ideal way to handle such a case?</p>","236128","","30568","","2010-04-29 06:32:30","2014-01-07 10:48:20","Ideal way to cancel an executing AsyncTask","<android><android-asynctask>","8","1","38","",""
"2735166","1","2737841","","2010-04-29 06:24:59","2","963","<p>My android application uses an sqlite database and during first run it deletes some rows . The next time it runs it tries to do the same , but because the rows were previously deleted it fails . I use SQLite database browser to inspect the database ,after first run (when the rows are deleted) and I observe that the rows that no longer should exist are still in the database , even if ehwn running the app again those rows are no longer visible !    What is the cause for this behavior ?</p>","304866","","265167","","2011-12-18 11:23:19","2011-12-18 11:23:19","SQLite in android","<android><sqlite>","1","2","","",""
"2735188","1","","","2010-04-29 06:28:58","3","1836","<p>I'm learning Android and I'm trying to connect to Twitter and upload a photo in Android.  How can I do this?</p>","328561","","15168","","2010-04-29 06:48:32","2012-06-10 22:34:00","Android connecting to Twitter","<android><upload><twitter>","1","4","","",""
"2735323","1","2735479","","2010-04-29 07:00:14","8","13788","<p>I cannot read and write extended characters (French accented characters, for example) to a text file using the standard InputStreamReader methods shown in the Android API examples. When I read back the file using:  </p><pre><code>InputStreamReader tmp = new InputStreamReader(in);BufferedReader reader = new BufferedReader(tmp);String str;while ((str = reader.readLine()) != null) {...</code></pre><p>the string read is truncated at the extended characters instead of at the end-of-line. The second half of the string then comes on the next line. I'm assuming that I need to persist my data as UTF-8 but I cannot find any examples of that, and I'm new to Java.</p><p>Can anyone provide me with an example or a link to relevant documentation?</p>","81317","","7581","","2010-04-29 07:16:10","2013-08-05 22:02:53","How to read and write UTF-8 to disk on the Android?","<java><android><utf-8><character-encoding>","4","2","4","",""
"2735380","1","","","2010-04-29 07:11:03","5","3616","<p>I'm currently working on a small update to a project and I'm having an issue with Relative_Layout and fill_parent in a list view. I'm trying to insert a divider between two sections in each row, much like the divider in the call log of the default dialer. I checked out the Android source code to see how they did it, but I encountered a problem when replicating their solution.</p><p>To start, here is my row item layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent""  xmlns:android=""http://schemas.android.com/apk/res/android"" android:padding=""10dip""  android:layout_height=""fill_parent""  android:maxHeight=""64dip""  android:minHeight=""?android:attr/listPreferredItemHeight""&gt; &lt;ImageView android:id=""@+id/infoimage""   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:clickable=""true""  android:src=""@drawable/info_icon_big""   android:layout_alignParentRight=""true""   android:layout_centerVertical=""true""/&gt; &lt;View android:id=""@+id/divider""   android:background=""@drawable/divider_vertical_dark""   android:layout_marginLeft=""11dip""   android:layout_toLeftOf=""@+id/infoimage""   android:layout_width=""1px""   android:layout_height=""fill_parent""  android:layout_marginTop=""5dip""   android:layout_marginBottom=""5dip""   android:layout_marginRight=""4dip""/&gt; &lt;TextView android:id=""@+id/TextView01""   android:textAppearance=""?android:attr/textAppearanceLarge""  android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:layout_centerVertical=""true""   android:layout_toRightOf=""@+id/ImageView01""   android:layout_toLeftOf=""@+id/divider""  android:gravity=""left|center_vertical""   android:layout_marginLeft=""4dip""   android:layout_marginRight=""4dip""/&gt; &lt;ImageView android:id=""@+id/ImageView01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_alignParentLeft=""true""   android:background=""@drawable/bborder""   android:layout_centerVertical=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>The issue I'm facing is that each row has a thumbnail of varying height (ImageView01). If I set the RelativeLayout's layout_height property to fill_parent, the divider does not scale vertically to fill the row (it just remains a 1px dot). If I set layout_height to ""?android:attr/listPreferredItemHeight"", the divider fills the row, but the thumbnails shrink. I've done some debugging in the getView() method of the adapter, and it seems that the divider's height is not being set properly once the row has it's proper height.</p><p>Here is a portion of the getView() method:</p><pre><code>public View getView(int position, View view, ViewGroup parent) {            if (view == null) {                view = inflater.inflate(R.layout.tag_list_item, parent, false);            }</code></pre><p>The rest of the method simply sets the appropriate text and images for the row.</p><p>Also, I create the inflater object in the adapter's constructor with: <code>inflater = LayoutInflater.from(context);</code></p><p>Am I missing something essential? Or does fill_parent just not work with dynamic heights?</p>","230173","","21234","","2010-06-25 13:22:01","2011-08-01 18:45:53","Android RelativeLayout fill_parent unexpected behavior in a ListView with varying row heights","<android><listview><layout><relativelayout>","3","0","1","",""
"2735460","1","","","2010-04-29 07:24:41","4","1971","<p>I have the following code which recording the scroll Y position in my ListView whenever my activity is paused.</p><pre><code>protected void onSaveInstanceState (Bundle outState) { super.onSaveInstanceState(outState);  int scroll = mListView.getScrollY();  System.out.println ("" scrollY"" + scroll);} </code></pre><p>But regardless where I scroll my ListView vertically, the value of getScrollY() always return 0. Can anyone please help me?</p><p>Thank you.</p>","286802","","","","","2013-06-24 17:14:11","Need help in using getScrollY() of ListView","<android>","1","0","","",""
"2735555","1","","","2010-04-29 07:48:18","1","312","<p>The setHint and singleLine settings don't seem to be able to worktogether. If my hint is longer than a single line and I havesingleLine set to true, the editText box automatically spans to 2lines regardless.</p><p>Does anyone have a workaround?</p>","164460","","","","","2011-04-11 11:20:08","Android singleline texthint","<android>","1","1","","",""
"2735571","1","3141300","","2010-04-29 07:50:47","13","15342","<p>I'd like to detect sms incoming and outgoing automatically from my application at background whenever this app is opening or not. how to code?</p>","305732","","","","","2013-01-15 10:22:41","Detecting SMS incoming and outgoing","<android><sms>","2","2","12","",""
"2735835","1","2764725","","2010-04-29 08:35:50","3","2799","<p>I have an application that creates an SQLite database and savesinformation to it over the course of a day. At the end of the day iwant to export this database to a web server.</p><p>Could anyone point me in the right direction for this?</p><p>Should I use httppost or put. I have researched this myself online butthere seems to be so many different ways to explore. The server sidedoes not exist yet either. I have access to an apache server so i amhoping to use that.</p><p>Could anyone advise me the best/most simple way to do this?</p>","328663","","644450","","2012-01-25 08:05:13","2012-01-25 08:05:13","How to transfer SQLite db to web server on android phone","<android><sqlite><webserver>","3","3","","",""
"2735854","1","2739098","","2010-04-29 08:39:36","1","599","<p>i want to know if i can use the data (for exaple a tour from point A to point B) and extract it for example to save the tour infos to an text file or post it somewhere or do whatever i want with it? i want to use maps as a database, so what are the restrictions, what am i allowed to do?</p>","165106","","","","","2010-04-29 16:38:31","can i use google maps data for my own app on android?","<database><android><api><google-maps>","1","3","1","",""
"2735927","1","2737627","","2010-04-29 08:54:10","3","820","<p>iam trying to run an activity from diffrent package from my remote service:this is how i implement the service.java</p><pre><code>  public class CurrencyService extends Service  {    public class CurrencyServiceImpl extends ICurrencyService.Stub    {    int CALL_PUSH_SERVICE_ACTIVITY=10;    @Override    public void callSomeActivity(int activityId) throws RemoteException    {            Intent pushActivity=new Intent(""com.pushservice.PushActivity"");            pushActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            startActivity(pushActivity);     }     .....</code></pre><p>}</p><p>ive also added a line in the manifest of the service:</p><p>the service works fine, but i cant run the activity -> PushActivity which is in diffrent package of diffrent application,this is the error:</p><p>Activity not found Exception: No Activity found to handle Intent {act=com.pushservice.PushServiceActivity flq=0x10...</p><p>thanks.</p>","273550","","273550","","2010-04-29 09:00:23","2010-05-05 14:17:39","Running activity from remote service","<android>","2","0","","",""
"2736173","1","","","2010-04-29 09:33:55","0","1796","<p>I'm programming an application who must send coordinate and request to a WebServices this is my code:</p><pre><code>private String SOAP_ACTION = ""getAllPositions"";private String METHOD_NAME = ""getAllPositions"";private String NAMESPACE = ""http://session/"";private static final String URL =""http://soap.example.com/WSGeoEAR-WSGeoServer/NavFinderBean?WSDL""; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);     SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    request.addProperty(""idUtente"",1);         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    envelope.dotNet = true;     envelope.setOutputSoapObject(request);        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);    androidHttpTransport.setXmlVersionTag(""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;"");     androidHttpTransport.debug = true;    try{        androidHttpTransport.call(SOAP_ACTION, envelope);        SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;        ArrayList&lt;position&gt; resultData = (ArrayList&lt;position&gt;)resultsRequestSOAP.getProperty(""getAllPositionsResponse"");        for(position p : resultData){            ((TextView)findViewById(R.id.lblStatus)).setText(p.getAllInformation());          }            } catch(Exception E) {        ((TextView)findViewById(R.id.lblStatus)).setText(""ERROR:"" + E.getClass().getName() + "": "" + E.getMessage());    }}</code></pre><p>I've also create a class position.</p><p>It doesn't work,can someone help me?Thanks</p>","328701","","188691","","2014-03-05 10:30:39","2014-03-05 10:30:39","How to connect to a SOAP webServices with Android","<android><request><response><soap-client><webservices-client>","0","4","","",""
"2736335","1","2737405","","2010-04-29 09:59:50","0","3196","<p>I have been searching for a way to get the json data from a URl (for example: <a href=""http://search.twitter.com/trends.json"" rel=""nofollow"">http://search.twitter.com/trends.json</a>) and display it in a listview. Couldnt get a perfect example to get it done. Can anyone plz help me out by getting the solution and providing a good example of how to do it...</p>","303155","","","","","2010-10-22 02:48:12","Getting Json data into a list view","<android><json><listview>","2","1","","",""
"2736389","1","2736612","","2010-04-29 10:06:52","171","152095","<p>I am trying to work on sending an object of my <em>customer</em> class from one <code>Activity</code> and display in another <code>Activity</code>.</p><p>The code for the customer class:</p><pre><code>public class Customer {    private String firstName, lastName, Address;    int Age;    public Customer(String fname, String lname, int age, String address) {        firstName = fname;        lastName = lname;        Age = age;        Address = address;    }    public String printValues() {        String data = null;        data = ""First Name :"" + firstName + "" Last Name :"" + lastName        + "" Age : "" + Age + "" Address : "" + Address;        return data;    }}</code></pre><p>I want to send its object from one <code>Activity</code> to another and then display the data on the other <code>Activity</code>.</p><p>How can I achieve that?</p>","328518","","418183","","2011-05-06 13:54:26","2014-02-15 11:49:11","How to pass object from one activity to another in Android","<android><object><android-intent>","21","0","72","",""
"2736404","1","2736535","","2010-04-29 10:09:18","1","3314","<p>I'm using Eclipse with the Android SDK. I installed The SDK platform Android 1.6, API 4 using Android SDK and AVD manager, but I can't find the corresponding documentation in the list of the available packages (there's only the doc for the API 7). Where can I find it?</p><p>thanks</p><p>jul</p>","326849","","","","","2012-08-29 11:42:55","Where is the documentation for Android SDK API 4?","<android><eclipse><documentation>","3","0","1","",""
"2736863","1","","","2010-04-29 11:30:12","0","762","<p>When I run the code bellow in the virtual android (1.5) it works well, TextSwitcher shows first 80 chars from each txt file from /sdcard/documents/ , but when I run it on my Samsung Galaxy i7500 (1.6) there are no contents in TextSwitcher, however in LogCat there are FileNames of txt files.</p><p>My Code:</p><pre><code>      public void getTxtFiles(){ //Scan /sdcard/documents and put .txt files in array File TxtFiles[]    String path = Environment.getExternalStorageDirectory().toString()+""/documents/"";     String files;    File folder = new File(path);    if(folder.exists()==false){if (!folder.mkdirs()) {         Log.e(""TAG"", ""Create dir in sdcard failed"");         return;    }}     else{    File listOfFiles[] = folder.listFiles();     for (int i = 0; i &lt; listOfFiles.length; i++)     {     if (listOfFiles[i].isFile())      {     files = listOfFiles[i].getName();         if (files.endsWith("".txt"") || files.endsWith("".TXT""))         {            if((files.length()-1)&gt;i){resizeArray(TxtFiles, files.length()+10);}             TxtFiles[i]=listOfFiles[i];             System.out.println(TxtFiles[i]);         }          }       }}    } private void updateCounter(int Pozicija) { if(Pozicija&lt;0){Toast.makeText(getApplicationContext(), R.string.LastTxt, 5).show(); mCounter++;} else if(TxtFiles[mCounter]!=null){  TextToShow = getContents(TxtFiles[mCounter]);  if(TextToShow.length()&gt;80)TextToShow=TextToShow.substring(0, 80);  mSwitcher.setText(TextToShow);  System.out.println(Pozicija);  } else mCounter--; }   static public String getContents(File aFile) {    //...checks on aFile are elided    StringBuilder contents = new StringBuilder();    try {      //use buffering, reading one line at a time      //FileReader always assumes default encoding is OK!      BufferedReader input =  new BufferedReader(new FileReader(aFile));      try {        String line = null; //not declared within while loop        /*        * readLine is a bit quirky :        * it returns the content of a line MINUS the newline.        * it returns null only for the END of the stream.        * it returns an empty String if two newlines appear in a row.        */        while (( line = input.readLine()) != null){          contents.append(line);          contents.append(System.getProperty(""line.separator""));        }      }      finally {        input.close();      }    }    catch (IOException ex){      ex.printStackTrace();    }    return contents.toString();  }</code></pre><p>And I am able to write contents of those files though LogCat!</p><p>Any ideas?</p>","315563","","2157240","","2013-03-12 21:22:59","2013-03-12 21:22:59","Android - can't read TXT files from SDcard on real machine?","<android><file><audio><record>","1","2","","",""
"2737198","1","2737268","","2010-04-29 12:23:35","0","355","<p>I have two activities. The first activity display list of the users with short info. And after   select some user I go to the second activity for display full info  about this user. For send event I used <code>startActivityForResult();</code> for receive event in socond activity and added     <code>public void onActivityResult(int requestCode, int resultCode, Intent data)</code>. After start project I send intend from first activity  and I do not receive in the second :(. How I can receive sent event  in second activity?Thank you...</p>","272774","","","","","2010-04-29 12:33:35","Andriond send event from first activity and receive on the second","<java><android>","1","0","","",""
"2737270","1","2799807","","2010-04-29 12:34:04","2","293","<p>I'm using a theme for my app to set some common layout features. </p><p>One of the things I change in this theme is the text style. I change the color and the size of the text in the whole app. Sadly the text in the titlebar is also changed and the result is a somewhat blurry ugly style. I don't know if it is the color or the size of the text</p><p>Is it possible to somehow overwrite the style for the title in the theme? Or exclude the title?</p>","114066","","114066","","2010-05-05 13:35:36","2010-05-10 07:23:22","How to exclude the title from theme applied to the application?","<android><layout><themes><title>","3","0","","",""
"2737445","1","2737671","","2010-04-29 12:59:05","2","5645","<p>Calling <code>setFocus(null)</code> on the <code>ItemizedOverlay</code> does not 'unfocus' current marker. According to the documentation:</p><blockquote>  <p>... If the Item is not found, this is a no-op. You can also pass null to remove focus. </p></blockquote><p>Here's my code:</p><p><em>MapItemizedOverlay</em></p><pre><code>public class MapItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {    private ArrayList&lt;OverlayItem&gt; items = new ArrayList&lt;OverlayItem&gt;();    public MapItemizedOverlay(Drawable defaultMarker) {        super(defaultMarker);    }    public void addOverlay(OverlayItem overlay) {        items.add(overlay);        populate();    }    @Override    protected OverlayItem createItem(int i) {        return items.get(i);    }    @Override    public int size() {        return items.size();    }}</code></pre><p>Creating map overlay and one marker:</p><pre><code>StateListDrawable youIcon = (StateListDrawable)getResources().getDrawable(R.drawable.marker_icon);int width = youIcon.getIntrinsicWidth();int height = youIcon.getIntrinsicHeight();youIcon.setBounds(-13, 0-height, -13+width, 0);GeoPoint location = new GeoPoint(40800816,-74122009);MapItemizedOverlay overlay = new MapItemizedOverlay(youIcon);OverlayItem item = new OverlayItem(location, ""title"", ""snippet"");overlay.addOverlay(item);mapView.getOverlays().add(overlay);</code></pre><p>The <code>R.drawable.marker_icon</code> is defined as follows:</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:drawable=""@drawable/marker_selected"" /&gt;    &lt;item android:state_selected=""true"" android:drawable=""@drawable/marker_selected"" /&gt;    &lt;item android:drawable=""@drawable/marker_normal"" /&gt;&lt;/selector&gt;</code></pre><p>Now, to test the setFocus() behavior I put the button on the activity window, with the following onClick listener:</p><pre><code>Button focusBtn = (Button)findViewById(R.id.focusbtn);focusBtn.setOnClickListener(new OnClickListener() {                 @Override    public void onClick(View v) {        for(Overlay ov : mapView.getOverlays())        {            if(ov.getClass().getSimpleName().equals(""MapItemizedOverlay"") == true)            {                MapItemizedOverlay miv = (MapItemizedOverlay)ov;                if(miv.getFocus() == null)                    miv.setFocus(miv.getItem(0));                else                    miv.setFocus(null);                break;            }        }        mapView.invalidate();    }});</code></pre><p>The expected behavior is: clicking on the button toggles marker selection.</p><p>It works only once - clicking it for the first time selects the marker, clicking it again does not de-select the marker. The most weird thing about it is that after calling setFocus(null), getFocus() also returns null - like the overlay has no focused item (I debugged it). But even after calling mapView.invalidate() the marker is still drawn in 'selected'(focused) state.</p>","306831","","","","","2010-04-29 13:28:19","Android mapView ItemizedOverlay setFocus does not work properly","<android><google-maps><setfocus><itemizedoverlay>","2","0","2","",""
"2737456","1","","","2010-04-29 13:00:03","4","2600","<p>First off, let me say that feel free to recommend me if long lived TCP persistent connections are the way to go or persistent HTTP connections are better. </p><p>I've also pre-read that instead of having a persistent connection, I can have a polling mechanism. </p><p>I'm just asking in the curious interest of how can I create a persistent connection from Android to a server?</p><p>Thanks!</p>","194712","","","","","2010-05-06 16:32:09","How do I create persistent socket connection on Android?","<java><android>","2","0","1","",""
"2737467","1","2739071","","2010-04-29 13:01:16","0","340","<p>As i understoond, if we have local service of some application, as soon as the application goes down, the service goes down as well - is that true?</p><p>and if it is, how can we make an application to run all the time without go down? (without using Alarm manager). i though that the purpose of local service is to answer this situation: "" to make the application everlasting""</p><p>please, if some1 could explain me this better,thanks,</p><p>ray.</p>","260511","","","","","2010-04-29 16:35:32","applicaion and local service lifetime","<android>","2","0","","",""
"2737530","1","2738025","","2010-04-29 13:10:59","2","2206","<p>I have set up my project with different drawable directories (ldpi, mdpi and hdpi). I have a background png with two different resolutions: 320x480 in drawable-mdpi folder, and 480x800 in drawable-hdpi. Both have the same filename. When I try to load the background as a style in the manifest (using android:windowBackground in the style) if I use the emulator for a 1.6 device, I get the correct one loaded(mdpi). However, if I try this on my Nexus, I see that at first the correct background from the hdpi folder is loaded, but it quickly switches to the mdpi one. I have tried also to set up the background in the layout xml file (android:src=...) but in this case only the mdpi one is loaded. If I delete the mdpi version, everything is loaded ok. Any idea on what is the problem? why is it loading the mdpi drawable? </p>","265375","","","","","2010-04-29 14:15:43","Drawable from mdpi loading instead of hdpi","<android><background><drawable>","1","0","1","",""
"2737814","1","2739030","","2010-04-29 13:48:31","0","191","<p>how to implement the <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List13.html"" rel=""nofollow"">slow adapter</a> example in ApiDemos for multiple line list view? i want to do this for the multiple line list view when scrollstatechanged? any idea?? tutorial, sample code are most thankful.</p>","267269","","267269","","2010-04-29 16:21:21","2010-04-29 16:29:46","ListView Problem in Android?","<android><listview>","1","0","","",""
"2738421","1","2739021","","2010-04-29 15:04:43","5","2733","<p>I am trying to make a VoIP application and I wanted to know if it is possible to do the following with the Call Logs content provider -</p><ol><li><p>I want to add new Call Log records for the VoIP call along with the call logs for the regular call. How can I add new records to the existing Call logs content provider?</p></li><li><p>I want to add custom fields to the Call Logs like a session ID and SIP    address(name@domain) field. How can I customize the call logs database?</p></li></ol><p>It'll be great if someone can give me an example. </p>","328302","","881229","","2014-03-18 20:43:55","2014-03-18 20:43:55","How to add new field(s) and records to the call logs(call history) database?","<android>","2","0","5","",""
"2738439","1","2741001","","2010-04-29 15:08:15","0","64","<p>I usually place my keys on an xml and access them with <code>R.string.key_name</code> but someone make me notice that I could have inline strings in the code.</p><p>I feel that I might use that key in different places and if I change its name I would just rename in the xml but perhaps that doesn't make too much sense with keys.</p><p>What do you think?</p>","119895","","","","","2010-04-29 21:46:33","Should keys be placed on a xml to be accessed with R.string.key?","<android>","2","0","","",""
"2738586","1","2743275","","2010-04-29 15:28:20","1","3211","<p>I'm currently learning OpenGL ES programming on Android (2.1). I started with the obligatory rotating cube. It's rotating fine but I can't get the depth buffer to work. The polygons are always displayed in the order the GL commands render them. I do this during initialization of GL:</p><pre><code>gl.glClearColor(.5f, .5f, .5f, 1);gl.glShadeModel(GL10.GL_SMOOTH);gl.glClearDepthf(1f);gl.glEnable(GL10.GL_DEPTH_TEST);gl.glDepthFunc(GL10.GL_LEQUAL);gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);</code></pre><p>On surface-change I do this:</p><pre><code>gl.glViewport(0, 0, width, height);gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();GLU.gluPerspective(gl, 45.0f, (float) width / (float) height, 0.1f, 100f);</code></pre><p>When I enable backface culling then everything looks correct. But backface culling is only a speed-optimization so it should also work with only the depth buffer or not? So what is missing here?</p>","274473","","44729","","2010-04-29 15:50:53","2010-08-24 21:48:20","OpenGL depth buffer on Android","<android><opengl-es>","1","0","","",""
"2738670","1","2764570","","2010-04-29 15:41:07","1","1709","<p>I have the following xml object representing a ImageButton </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ImageButton  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/genreCellItemId"" android:layout_weight=""1""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""center""  android:paddingLeft=""5.0dip"" android:paddingRight=""5.0dip""&gt;&lt;/ImageButton&gt;</code></pre><p>I try to inflate it and add it to a TableRow with the following code :</p><pre><code>LayoutInflater inflater= this.getLayoutInflater();TableLayout grid = (TableLayout)findViewById(R.id.bodyTableLayout);TableRow row = (TableRow)inflater.inflate(R.layout.genre_row, null);View myButton = (View)inflater.inflate(R.layout.genre_cell, null);row.addView(tempButton, new TableRow.LayoutParams());grid.addView(row, new TableLayout.LayoutParams());</code></pre><p>Ok so I noticed that it didn't look as expected, so I fire up the Hierarchy Viewere and noticed that the ImageButton's actually have an layout_width = FILL_PARENT instead of WRAP_CONTENT, also the layout_gravity is NONE and there is no padding to be seen...</p><p>Do, am I inflating it wrongly ? Or is maybe the new TableRow.LayoutParams() part doins omething wrong ?</p>","162147","","","","","2010-05-04 10:45:34","LayoutInflater ignoring parameters?","<android>","2","0","","",""
"2738834","1","2910929","","2010-04-29 16:03:15","9","11847","<p>I have two png image files that I would like my android app to combine programmatically into one png image file and am wondering if it is possible to do so?  if so, what I would like to do is just overlay them on each other to create one file.</p><p>the idea behind this is that I have a handful of png files, some with a portion of the image on the left with the rest transparent and the others with an image on the right and the rest transparent.  and based on user input it will combine the two to make one file to display. (and i cant just display the two images side by side, they need to be one file) </p><p>is this possible to do programmatically in android and how so?</p>","274365","","274365","","2010-04-29 16:36:33","2014-02-02 13:13:57","combining two png files in android","<android><image>","4","1","16","",""
"2739062","1","2739991","","2010-04-29 16:34:18","1","915","<p>The button doesn't show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn't help either. I'm testing it on 1.5 emulator.</p><pre><code> &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/layout_root""          android:orientation=""vertical""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dp"" &gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/neki""          android:orientation=""horizontal""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          &gt;&lt;ImageView android:id=""@+id/image""           android:layout_width=""wrap_content""           android:layout_height=""fill_parent""           android:layout_marginRight=""10dp""           /&gt;&lt;TextView android:id=""@+id/text""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:textColor=""#FFF""          android:text=""Some text ""          /&gt; &lt;/LinearLayout&gt; &lt;Button android:id=""@+id/gumbek""    android:text=""V redu""    android:typeface=""serif"" android:textStyle=""bold""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""              /&gt;   &lt;/LinearLayout&gt;</code></pre>","324417","","","","","2010-04-29 18:59:16","Linear layout and custom dialog","<android><layout>","1","0","","",""
"2739086","1","2739864","","2010-04-29 16:38:00","2","1366","<p>here's a problem that i've run into lately:I have a listview with a custom adapter class, the adapter takes in a listview and populates the listview with elements from it. Now, i'd like to have a button on each row of a listview to remove the item from it. How should i approach this problem? Is there a way to remotely trigger a method in the activity class and call notifydatachanged() method on the adapter to refresh the listview?</p>","289510","","1069068","","2013-03-19 14:46:50","2013-03-19 14:46:50","ListAdapter to modify the datasource (which is an arraylist)","<java><android><listview><listviewitem>","2","0","","",""
"2739186","1","2739245","","2010-04-29 16:52:07","9","8510","<p>I was wondering what is the easiest way to change the height of a ProgressBar in Android?</p><p>Thanks,</p><p>Tomek</p>","29326","","","","","2014-01-31 07:40:10","Android: How do I change the height of a ProgressBar?","<android><layout><user-interface><progress-bar>","2","0","2","",""
"2739200","1","2739685","","2010-04-29 16:54:37","0","79","<p>Im currently creating a tile-based game for android. Using java via dalvik JVM. im fretting over a decision to represent objects in a particular map. should i use an id based map (2 dimensional integer array) and place game logic in a separate function in the game engine, or create an object array (2 dimensional array of game objects) and store game logic within the class methods. i am thinking about the cost of object creation and garbage collection vs extensibility.</p>","209784","","","","","2010-04-29 18:12:38","object array mobile development","<java><android>","1","0","","",""
"2739282","1","2739526","","2010-04-29 17:04:01","0","283","<p>My app works on 1.5 emulator and 1.5 device. When i try to start it on 1.6 emulator, it produces strange exceptions (doesn't even start). I don't have any 1.6 device to try this app if it works on a real device.I get some warnings in Eclipse ( 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.) and get cant rid of them (i think they come from some apache jars that i need to make http multipart posts). Is it possible that this jars are cause for my exceptions in 1.6 or is it something else?</p><p>My logacat:</p><p>04-29 16:14:55.874: ERROR/AndroidRuntime(392): Uncaught handler: thread main exiting due to uncaught exception04-29 16:14:55.894: ERROR/AndroidRuntime(392): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.poslji.gor/com.poslji.gor.FormFiller}: java.lang.NumberFormatException: unable to parse 'null' as integer04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.os.Handler.dispatchMessage(Handler.java:99)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.os.Looper.loop(Looper.java:123)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.main(ActivityThread.java:4203)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invokeNative(Native Method)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invoke(Method.java:521)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at dalvik.system.NativeStart.main(Native Method)04-29 16:14:55.894: ERROR/AndroidRuntime(392): Caused by: java.lang.NumberFormatException: unable to parse 'null' as integer04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at java.lang.Integer.parseInt(Integer.java:358)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at java.lang.Integer.parseInt(Integer.java:333)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at com.poslji.gor.FormFiller.nastavi(FormFiller.java:322)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at com.poslji.gor.FormFiller.onCreate(FormFiller.java:188)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)04-29 16:14:55.894: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)</p>","324417","","","","","2010-04-29 17:53:20","App starts in 1.5 emulator but doesn't in 1.6","<java><android>","2","0","","",""
"2739329","1","","","2010-04-29 17:10:45","3","859","<p>Do you know a Java library to render static SWF file (no animation, just raster and vector images on a canvas) to PNG? I know swfrender (a part of swftools) but I need java, not C.</p>","103410","","","","","2012-10-02 20:49:25","Java library to render static SWF to raster image","<java><android><swf><png>","0","2","4","",""
"2739447","1","2739527","","2010-04-29 17:30:34","3","2468","<p>I need my program to send a request to a server. The problem is, the server only recognizes ös,äs und üs, but JAVA and/or Android don't know them. `How can I send a request with a String like ""Hermann-Löns"" without JAVA/Android ""changing"" the ö.... Oh and btw., ""oe"" isn't recognized by the server too, already tried that...</p><p>thx for help!</p><p>@BalausC:</p><p>I changed your code to:</p><p>I'm not sure if this is how you refer to the right fields...</p><pre><code>String url = ""http://busspur02.aseag.de/bs.exe?SID=473A2&amp;ScreenX=1440&amp;ScreenY=900&amp;CMD=CR&amp;DatumT=30&amp;DatumM=4&amp;DatumJ=2010&amp;AbfAnk=Abf&amp;ZeitH=10&amp;ZeitM=45&amp;Intervall=60&amp;Loeschen=%28N%29eue+Suche"";        String charset = ""CP1252"";        List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();        params.add(new BasicNameValuePair(""HTO"", start_from));        params.add(new BasicNameValuePair(""HT1"", destination));        UrlEncodedFormEntity query = new UrlEncodedFormEntity(params, charset);            HttpPost post = new HttpPost(url);            post.setEntity(query);            InputStream response = new DefaultHttpClient().execute(post).getContent();            // Now do your thing with the facebook response.</code></pre><p>I can't compile because I get an error saying: </p><blockquote>  <p>The method getContent() is undefined  for the type HttpResponse</p></blockquote><p>If I delete getContent() is says:</p><pre><code>Type mismatch: cannot convert from HttpResponse to InputStream</code></pre><p>One more thing: I use htmlparser (http://htmlparser.sourceforge.net/) to parse the resulting website. How do I access the resulting html site to parse it? Because otherwise I would have to rewrite nearly all of my code to get the results..</p>","323814","","323814","","2010-04-29 23:24:14","2010-04-30 16:18:44","I need to use ""ö"",""ä"".""ü"" in my program, but java/android won't let me","<java><android><unicode><special-characters>","1","2","0","",""
"2739550","1","2739568","","2010-04-29 17:48:02","15","18246","<p>So I'm working on a project, and I'm wondering if there is a way I can implement the barcode scanner into my android app? So it would go from my app, open the camera and take the ""picture"", get the info, and go back to my app with that info? </p>","325400","","","","","2014-04-02 23:10:57","Android: Is there a way to implement the barcode scanner into an app?","<android><barcode-scanner>","3","0","7","",""
"2739838","1","","","2010-04-29 18:36:47","3","2361","<p>I know there are a number of frameworks to help make web applications on Mobile Safari/Webkit look and behave like native applications (eg, jQTouch), but are there any more light-weight libraries that help out at a slightly lower-level?</p><p>eg, I might want to add some animations on certain touch events to reproduce an iPhone style swipe.</p><p>I don't want to create an iPhone web application as such, just enhance an existing site with a few special touch events.</p><p>It's not so difficult to create this stuff by directly using the touch events that the device provides, but some of the iPhone animation styles are quite complex to reproduce. eg, the bounce when you get to the end of a scroll bar, etc... Just wondering if anyone has done the work and wrapped it up into an open source library.</p>","46460","","","","","2012-04-09 14:06:10","JavaScript libraries for touch screen devices","<javascript><iphone><android><mobile><webkit>","3","0","1","",""
"2739971","1","2740198","","2010-04-29 18:55:42","44","52905","<p>I am trying to overlay two images in my app, but they seem to crash at my canvas.setbitmap line.  what am I doing wrong?</p><pre><code>     private void test()   {       Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.t);   Bitmap mBitmap2 = BitmapFactory.decodeResource(getResources(), R.drawable.tt);   Bitmap bmOverlay = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), mBitmap.getConfig());   Canvas canvas = new Canvas();   canvas.setBitmap(bmOverlay);   canvas.drawBitmap(mBitmap, new Matrix(), null);   canvas.drawBitmap(mBitmap2, new Matrix(), null);   testimage.setImageBitmap(bmOverlay);   }</code></pre>","274365","","","","","2013-11-14 10:44:55","overlay two images in android to set an imageview","<android><image>","2","1","55","",""
"2740169","1","2740219","","2010-04-29 19:23:57","2","10557","<p>I was writing a simple test application. There are two radio buttons within the app. There id's are ""radio_red"" and ""radio_blue"". I wanted to create an onClickListener event that read the text associated to the button and then returned a basic ""Right"" or ""Wrong"" toast.</p><p>Here is a sample of the code:</p><pre><code>private OnClickListener radio_listener = new OnClickListener() {    public void onClick(View v){        RadioButton rb = (RadioButton) v;        String ans =  rb.getText().toString();        String an1 = """";        if (ans.trim() == ""Yes"") {            ans = ""That's Right."";        }            else if (ans.trim() == ""No"") {                ans = ""thats wrong."";            }            else {                ans = ""none."";            }        Toast.makeText(v.getContext(), ans , Toast.LENGTH_SHORT).show();    }</code></pre><p>So far no joy. Here is my code snippet. I've checked my ""main.xml"" and the text associated to the buttons are referneced correctly. I added trim to make sure of that. However, all that is ever returned in the toast is ""none."" What am I missing? Thanks in advance for any help.</p>","317705","","","","","2012-01-12 06:12:21","Radio Button selection Changes Toast on Android","<android><radio-button>","3","0","1","",""
"2740321","1","2760267","","2010-04-29 19:46:11","5","10349","<p>I am having trouble in creating named pipe in Android and the example below illustrates my dilemma:</p><pre><code>res = mkfifo(""/sdcard/fifo9000"", S_IRWXO);if (res != 0){    LOG(""Error while creating a pipe (return:%d, errno:%d)"", res, errno);}</code></pre><p>The code always prints:</p><pre><code>Error while creating a pipe (return:-1, errno:1)</code></pre><p>I can't figure out exactly why this fails. The application has android.permission.WRITE_EXTERNAL_STORAGE permissions. I can create normal files with exactly the same name in the same location, but pipe creation fails. The pipe in question should be accessible from multiple applications.</p><ol><li>I suspect that noone can create pipes in /sdcard. Where would it be the best location to do so?</li><li>What mode mast should I set (2nd parameter)?</li><li>Does application need any extra permissions?</li></ol>","2877","","54956","","2012-01-17 13:13:24","2012-01-23 13:36:36","How to create named pipe (mkfifo) in Android?","<android><android-ndk><named-pipes>","4","0","9","",""
"2740364","1","2740410","","2010-04-29 19:52:06","1","911","<p>I have an app widget which runs neatly. However, I am unable to highlight a click on a linked item. I've seen it in the standard app widgets like 'Music' and 'Power Control', for instance. Moreover, I've also been studying the Music app widget's source at <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=res/layout-finger/album_appwidget.xml;h=dada13018749e507185108f470cc33b0a468f339;hb=HEAD"" rel=""nofollow"">album_appwidget.xml</a>. The only thing I could think of is the LinearLayout defined at lines 23-35 which states<br><code>android:clickable=""true""</code><br>Unfortunately, this does not work for me. So does anyone have a hint on how to highlight a click on an app widget? I've tried the LinearLayout, TextView and Button. None of them displayed a border as a highlight.</p><p>Thanks in advance,Steff</p>","289849","","","","","2010-04-29 20:02:34","How to highlight clicks in app widget?","<android><click><highlight><appwidget>","1","0","","",""
"2740386","1","","","2010-04-29 19:56:54","0","737","<p>I have written a command line interface program in the C language. This kind of programs (as you know) waits for user commands typed in the terminal and reacts on depend of them. In fact, the program implements a callback function which parses the command and invokes the appropriate function in order to respond to the user. </p><p>Now, I have to make a Java GUI (Graphical user interface) for the desktop (Ubuntu) version of this program and then port the same program to the Android Platform (of course the GUI will respect Android framework), so I'm looking for the best way to do it.</p><p>I have heard about JNI and JNA and I don't known which one will be the best for me. By the way what are the main differences between JNI and JNA. </p><p>And what about the others IPC techniques and middle-ware (like DBUS).</p><p>Any suggestion will be appreciated.</p><p>Thanks in advance. </p>","1832564","","","","","2010-04-29 20:05:46","How to make Java and C programs communicate together","<java><c><android>","1","1","","2012-05-15 11:32:45",""
"2740619","1","","","2010-04-29 20:37:57","1","153","<p>There are some things my application needs to do on first start up(first startup after update) . These actions could be described in a .txt file and then when it is the case read the file and do according to it  ,or on the other hand (I lean to use this option) a sqlite database could be used to store the information . The apk file would be  shipped with an .txt file/prebuild sql db stored in res/raw or res.asset and then copied into proper space and used. This I have figured out how !, though I'm not sure which option  of this two would be the fittest ? One thing that is unclear to me is how could sqlite version mismatch affect me, and if it serious enough to take into consideration ? I 'm using Android api level 4 (Android 1.6) and the future application might be used on several different devices , with different api levels.</p>","284609","","142162","","2010-04-29 20:40:50","2010-08-11 10:24:45","About sqlite use","<android><sqlite>","1","2","","",""
"2740713","1","","","2010-04-29 20:54:03","0","163","<p>I've built an Android app in the past (on a Windows machine using Eclipse), but having downloaded Ubuntu, the Android source and built it successfully (whew), I'm not sure how to tie it all together. How do I load my app into the Android that I've built?</p>","329264","","","","","2011-02-21 14:51:30","I've downloaded and built the Android source... now what?","<android>","2","0","1","",""
"2740975","1","2769551","","2010-04-29 21:40:49","5","16878","<p>All I need to do is download some basic text-based and image files from a web server that has a self-signed SSL certificate.</p><p>I have been trying to figure out how to use HttpClient to do this, but getting the SSL to work is a nightmare that seems to be way too much trouble for such a simple task.</p><p>Is there a better way to perform these file downloads? Perhaps through a WebView or Browser feature?  Reinventing the wheel of making a simple HTTPS GET request is a major pain, and is significantly holding up my development schedule.</p>","325011","","325011","","2010-05-04 23:08:20","2010-05-04 23:08:20","HTTPS with Self-Signed SSL Certificate Issues... Solution or better way?","<android><https><file-download><self-signed>","1","0","9","",""
"2741063","1","2741127","","2010-04-29 21:58:12","1","604","<p>how are static method calls handled by the JVM? does it still allocate memory when a call is made? if yes, how does garbage collection treat this allocation after the method call?</p>","209784","","","","","2010-04-29 22:10:22","android java memory management","<java><android><memory-management>","1","0","","",""
"2741303","1","2741519","","2010-04-29 23:05:08","0","254","<p>There are 2 different constants that have same description (<a href=""http://developer.android.com/intl/de/reference/android/R.attr.html#configChanges"" rel=""nofollow"">http://developer.android.com/intl/de/reference/android/R.attr.html#configChanges</a>)</p><pre><code>orientation  0x0080  The screen orientation has changed, that is the user has rotated the device. screenLayout  0x0100  The screen orientation has changed, that is the user has rotated the device.</code></pre><p>Many sources suggest to specify:</p><pre><code>android:configChanges=""keyboardHidden|orientation""</code></pre><p>But should not it be:</p><pre><code>android:configChanges=""keyboardHidden|orientation|screenLayout""</code></pre>","62192","","62192","","2010-04-30 13:36:59","2011-08-17 08:25:51","Android: What is a difference between 'orientation' and 'screenLayout'?","<android>","2","0","","",""
"2741403","1","2741424","","2010-04-29 23:30:11","40","41050","<p>I want to make a apps that check what's the nearest place from where the user is. I can easily get the location of the user and I have a list of places with latitude and longitude.</p><p>What would be the best way to know the nearest place of the list against the current position. </p><p>I could not find anything in the google APIs.  </p><p>I am worried I need to resort to my calculate and have to do math to calculate it.</p><p>What do you guys think ?</p><p>Cheers and thanks for reading or replying.</p>","145125","","","","","2014-01-29 10:39:10","Get the distance between two geo points","<android><geolocation><maps>","4","0","21","",""
"2741755","1","2741793","","2010-04-30 01:14:23","0","1828","<p>I'm writing an app to check for the bus timetable's. Therefor I need to post some data to a html page, submit it, and parse the resulting page with htmlparser.</p><p>Though it may be asked a lot, can some one help me identify if1) this page does support post/get (I think it does)2) which fields I need to use? 3) How to make the actual request?</p><p>this is my code so far:</p><pre><code>String url = ""http://busspur02.aseag.de/bs.exe?Cmd=RV&amp;Karten=true&amp;DatumT=30&amp;DatumM=4&amp;DatumJ=2010&amp;ZeitH=&amp;ZeitM=&amp;Suchen=%28S%29uchen&amp;GT0=&amp;HT0=&amp;GT1=&amp;HT1="";            String charset = ""CP1252"";            System.out.println(""startFrom: ""+start_from);            System.out.println(""goTo: ""+destination);            //String tag.v            List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();            params.add(new BasicNameValuePair(""HTO"", start_from));            params.add(new BasicNameValuePair(""HT1"", destination));            params.add(new BasicNameValuePair(""GTO"", ""Aachen""));            params.add(new BasicNameValuePair(""GT1"", ""Aachen""));            params.add(new BasicNameValuePair(""DatumT"", day));            params.add(new BasicNameValuePair(""DatumM"", month));            params.add(new BasicNameValuePair(""DatumJ"", year));            params.add(new BasicNameValuePair(""ZeitH"", hour));            params.add(new BasicNameValuePair(""ZeitM"", min));            UrlEncodedFormEntity query = new UrlEncodedFormEntity(params, charset);            HttpPost post = new HttpPost(url);            post.setEntity(query);            InputStream response = new DefaultHttpClient().execute(post).getEntity().getContent();            // Now do your thing with the facebook response.            String source = readText(response,""CP1252"");            Log.d(TAG_AVV,response.toString());            System.out.println(""STREAM ""+source);</code></pre><p>EDIT:<br>This is my new code:</p><pre><code>try {            HttpClient client = new DefaultHttpClient();              String getURL = ""http://busspur02.aseag.de/bs.exe?SID=5FC39&amp;ScreenX=1440&amp;ScreenY=900&amp;CMD=CR&amp;Karten=true&amp;DatumT=""+day+""&amp;DatumM=""+month+""&amp;DatumJ=""+year+""&amp;ZeitH=""+hour+""&amp;ZeitM=""+min+""&amp;Intervall=60&amp;Suchen=(S)uchen&amp;GT0=Aachen&amp;T0=H&amp;HT0=""+start_from+""&amp;GT1=Aachen&amp;T0=H&amp;HT1=""+destination+"""";            HttpGet get = new HttpGet(getURL);            HttpResponse responseGet = client.execute(get);              HttpEntity resEntityGet = responseGet.getEntity();              if (resEntityGet != null) {                  //do something with the response                Log.i(""GET RESPONSE"",EntityUtils.toString(resEntityGet));            }        } catch (Exception e) {            e.printStackTrace();        }   </code></pre><p>But the output file is cut-off. If I do the same request in  a browser I get like 14 different routes. Now the file suddenly stops and I only get 3 routes.... what's wrong?</p><p>I solved the last problem with the cut-off string:<a href=""http://stackoverflow.com/questions/2744110/after-http-get-request-the-resulting-string-is-cut-off-content-has-been-consum/2744559#2744559"">click here to see my solution</a></p>","323814","","323814","","2010-04-30 12:54:35","2010-04-30 12:54:35","HttpClient POST fails to submit the form + resulting string is cut-off (incomplete)","<java><html><android><post><get>","2","0","2","","2010-04-30 12:54:35"
"2741857","1","2743491","","2010-04-30 01:49:52","7","18629","<p>I have activity A in  package one, and I want to run an intent which will up an activity B which is in package two.</p><p>How can I do this? Any samples will be welcome.</p><p>this is what ive done, and the error i get:</p><p>first activity (""MainActivity"") in a package: com.abelski.currencyclientand second activity(""SecondActivity"" in a diffrent package: com.idan.second</p><p>now i wanna call from MainActivity to SecondActivity.</p><p>ive added this line at the manifest of the MainActivity:</p><pre><code> &lt;activity android:name=""com.idan.second.SecondApplicationActivity""&gt;&lt;/activity&gt;</code></pre><p>now in main Activity i got this button which run this line:</p><pre><code>Intent intent = new Intent(MainActivity.this,SecondApplicationActivity.class); </code></pre><p>and this is the rror:</p><pre><code>04-29 09:20:59.197: ERROR/AndroidRuntime(399): Uncaught handler: thread main exiting due to uncaught exception04-29 09:20:59.276: ERROR/AndroidRuntime(399): java.lang.NoClassDefFoundError: com.idan.second.SecondApplicationActivity04-29 09:20:59.276: ERROR/AndroidRuntime(399):     </code></pre><p>...</p><p>thanks for help.</p>","260511","","1012284","","2012-05-21 09:56:34","2013-09-02 13:37:02","launch activities from different package","<android>","4","2","1","",""
"2742210","1","2752040","","2010-04-30 03:58:14","0","2087","<p>I am trying to execute a {public void} method in Service, from scheduled TimerTask which is periodically executing.</p><p>This TimerTask periodically checks a condition. If it's true, it calls method via {className}.{methodName};</p><p>However, as Java requires, the method needs to be {pubic static} method, if I want to use {className} with {.dot}</p><p>The problem is this method is for notification using Toast(Android pop-up notification) and Status BarTo use these notifications, one must use</p><pre><code>Context context = getApplicationContext();</code></pre><p>But for this to work, the method must not have {static} modifier and resides in Service class.</p><p><strong>So, basically, I want background Service to evaluate condition from scheduled TimerTask, and execute a method in Service class.</strong></p><p>Can anyone help me what's <strong>the right way to use Service, invoking a method when certain condition is satisfied while looping evaluation?</strong></p><p>Here are the actually lines of codes: </p><p><em><strong>The TimerTask class (WatchClipboard.java)</strong> :</em></p><pre><code>public class WatchClipboard extends TimerTask {    //DECLARATION    private static GetDefinition getDefinition = new GetDefinition();    @Override    public void run() {        if (WordUp.clipboard.hasText()) {            WordUp.newCopied = WordUp.clipboard.getText().toString().trim().toLowerCase();            if (!(WordUp.currentCopied.equals(WordUp.newCopied))) {                WordUp.currentCopied = WordUp.newCopied;    Log.v(WordUp.TAG, WordUp.currentCopied);                getDefinition.apiCall_Wordnik();                FetchService.instantNotification();   //it requires this method to have {static} modifier, if I want call in this way.            }        }           }}</code></pre><p><em><strong>And the Service class (FetchService.java)</em></strong> : If I change the modifier to static, {Context} related problems occur</p><pre><code>public class FetchService extends Service {    public static final String TAG = ""WordUp"";  //for Logcat filtering    //DECLARATION    private static Timer runningTimer;    private static final boolean THIS_IS_DAEMON = true;    private static WatchClipboard watchClipboard;    private static final long DELAY = 0;    private static final long PERIOD = 100;    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {    Log.v(WordUp.TAG, ""FetchService.onCreate()"");        super.onCreate();        //TESTING SERVICE RUNNING        watchClipboard = new WatchClipboard();        runningTimer = new Timer(""runningTimer"", THIS_IS_DAEMON);        runningTimer.schedule(watchClipboard, DELAY, PERIOD);    }    @Override    public void onDestroy() {        super.onDestroy();        runningTimer.cancel();        stopSelf(); Log.v(WordUp.TAG, ""FetchService.onCreate().stopSelf()"");    }    public void instantNotification() {   //If I change the modifier to static, {Context} related problems occur        Context context = getApplicationContext();  // application Context        //use Toast notification: Need to accept user interaction, and change the duration of show        Toast toast = Toast.makeText(context, WordUp.newCopied+"": ""+WordUp.newDefinition, Toast.LENGTH_LONG);        toast.show();        //use Status notification: need to automatically expand to show lines of definitions        NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);        int icon = R.drawable.icon;        // icon from resources        CharSequence tickerText = WordUp.newCopied; // ticker-text        long when = System.currentTimeMillis(); // notification time        CharSequence contentTitle = WordUp.newCopied;   //expanded message title        CharSequence contentText = WordUp.newDefinition;    //expanded message text        Intent notificationIntent = new Intent(this, WordUp.class);        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);        // the next two lines initialize the Notification, using the configurations above        Notification notification = new Notification(icon, tickerText, when);        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        mNotificationManager.notify(WordUp.WORDUP_STATUS, notification);    }}</code></pre>","259765","","","","","2010-05-02 00:32:49","ANDROID: inside Service class, executing a method for Toast (or Status Bar notification) from scheduled TimerTask","<java><android>","1","0","","",""
"2742236","1","2742419","","2010-04-30 04:07:16","10","11561","<p>I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console.</p><pre><code>[2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET</code></pre><p>I have added android.permission.INTERNET in 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.org.example""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HalloAndroid""                  android:label=""@string/app_name"" android:permission=""android.permission.INTERNET""&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-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>The java code in HalloAndroid.java is as follows</p><pre><code> HttpClient httpclient = new DefaultHttpClient();    HttpGet httpget2 = new HttpGet(""http://google.com/"");        HttpResponse response2 = null;        try {            response2 = httpclient.execute(httpget2);        } catch (ClientProtocolException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        } catch (IOException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        }    HttpEntity entity = response2.getEntity();    if (entity != null) {        long len = entity.getContentLength();        if (len != -1 &amp;&amp; len &lt; 2048) {            try {                    Log.d(TAG, EntityUtils.toString(entity));                } catch (ParseException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }        } else {            // Stream content out        }</code></pre><p>Any help is much appreciated.</p>","323404","","323404","","2010-04-30 05:03:41","2010-04-30 05:16:00","Android: HTTPClient","<android><http><android-manifest>","1","0","1","",""
"2742282","1","4479557","","2010-04-30 04:25:25","1","908","<p>I have an issue with Webview to set the initial scroll position within it when first launched. By default it is left , I want it to scroll and show the view from center. Or is it possible to resize the view to fit the screen width initially, instead of scroll bars.I need this since the left part of the page I am loading is blank making user feel the page is not loaded.</p>","315619","","","","","2010-12-18 18:59:20","How to set webview scroll position within it on initial launch?","<android>","1","1","","",""
"2742480","1","2742805","","2010-04-30 05:32:00","4","2788","<p>I am pretty new to android. I have a use case where I need to detect a shake and show some images in my application. Can I test shake functionality on android emulator ? What are the other alternatives apart from testing it on a real phone ?</p>","248132","","1104926","","2011-12-19 12:58:40","2011-12-19 12:58:40","Android shake detection on emulator","<android>","1","0","2","",""
"2742501","1","2743173","","2010-04-30 05:35:10","2","500","<p>I want to start develop mobile applications and sell it. There are many mobile platforms for which I can begin develop: Windows Mobile , Android, Iphone, Linux based Devices.I want to find out from people who has such experience which platform more comfortable and more profitable for me to use.</p>","251569","","321731","","2014-03-11 19:28:38","2014-03-11 19:32:10","Mobile development recommendation","<android><iphone><mobile><windows-mobile>","4","1","1","",""
"2742666","1","2769519","","2010-04-30 06:22:37","3","841","<p>I have almost completed my Android application so am considering ways of distributing the application. I have seen some applications on Market have free limited/locked version and separate Unlock Key/License Key which unlocks extra functionality. </p><p>How is this done? Has anyone here done this? If so, how well does it work?</p><p>I am thinking maybe this is better then having two versions of the same application (i.e Lite and Pro).</p><p>Thanks.</p>","290469","","","","","2010-05-04 22:58:04","Unlock Key Component","<android><app-store><google-play>","1","0","2","",""
"2742684","1","","","2010-04-30 06:27:39","0","299","<p>Simple question - how is text-zooming implemented on an Android/iPhone device? Do they pre-compute frequently used bitmaps of a font and replace the text as the scale changes? Or do they extract the contours from the font files and render the text as vector graphics?</p>","306545","","","","","2010-04-30 07:13:32","How does an Android/iPhone device implement text-zooming?","<iphone><android><fonts><vector-graphics>","1","0","","",""
"2742778","1","2744003","","2010-04-30 06:48:48","0","3920","<p>I am using the Android calendar. How can I remove a calendar event using code? Is it possible?</p><p>For clarification, I would like to mention that I don't want a sync process or want to remove events using gdata api.</p><p>I only want to remove a local calendar event.</p>","216431","","26428","","2010-07-24 17:33:33","2014-02-16 20:06:38","android calendar delete event","<android><events>","4","0","","",""
"2742838","1","2744300","","2010-04-30 07:04:23","5","1685","<p>In android emulator, I am in landscape mode and double click the text edit panel. the softkeyboard does not show up. However, it works in portrait mode. </p><p>I have check some of posts on line. They said because of hardkeyboard is available in landscape mode. If that so, how can i disable the hardkeyboard. Or is there any setting reason for this problem? </p>","304881","","","","","2010-04-30 11:57:59","softkeyboard in landscape mode does not pop up in android emulator","<android>","1","0","1","",""
"2742938","1","2744112","","2010-04-30 07:28:10","0","816","<p>I am developing a webpage which requires the userlocation for loading some data. The web page is mainly intended for android users. I need to find the geo location of the user when the user opens that page? How can I do that? </p>","221153","","","","","2010-04-30 11:20:28","How to find the geolocation of an android user from webpage","<android><website><geolocation>","2","0","","",""
"2743066","1","2806768","","2010-04-30 07:56:16","3","6185","<p>I am trying to retrieve the values from the following url: <a href=""http://rentopoly.com/ajax.php?query=Bo"" rel=""nofollow"">http://rentopoly.com/ajax.php?query=Bo</a>. I want to get the values of all the suggestions to be displayed in a list view one by one. This is how i want to do...</p><pre><code>    public class AlertsAdd {    public ArrayList&lt;JSONObject&gt; retrieveJSONArray(String urlString) {        String result = queryRESTurl(urlString);        ArrayList&lt;JSONObject&gt; ALERTS = new ArrayList&lt;JSONObject&gt;();        if (result != null) {            try {                JSONObject json = new JSONObject(result);                JSONArray alertsArray = json.getJSONArray(""suggestions"");                for (int a = 0; a &lt; alertsArray.length(); a++) {                    JSONObject alertitem = alertsArray.getJSONObject(a);                    ALERTS.add(alertitem);                }                return ALERTS;            } catch (JSONException e) {                Log.e(""JSON"", ""There was an error parsing the JSON"", e);                            }                   }        JSONObject myObject = new JSONObject();        try {            myObject.put(""suggestions"",myObject.getJSONArray(""suggestions""));            ALERTS.add(myObject);        } catch (JSONException e1) {            Log.e(""JSON"", ""There was an error creating the JSONObject"", e1);        }        return ALERTS;    }    private String queryRESTurl(String url) {        // URLConnection connection;        HttpClient httpclient = new DefaultHttpClient();        HttpGet httpget = new HttpGet(url);        HttpResponse response;        try {                       response = httpclient.execute(httpget);            HttpEntity entity = response.getEntity();        if (entity != null) {                InputStream instream = entity.getContent();                String result = convertStreamToString(instream);                instream.close();                return result;            }        } catch (ClientProtocolException e) {            Log.e(""REST"", ""There was a protocol based error"", e);        } catch (IOException e) {            Log.e(""REST"", ""There was an IO Stream related error"", e);                   }        return null;    }    /**     * To convert the InputStream to String we use the     * BufferedReader.readLine() method. We iterate until the BufferedReader     * return null which means there's no more data to read. Each line will     * appended to a StringBuilder and returned as String.     */    private String convertStreamToString(InputStream is) {        BufferedReader reader = new BufferedReader(new InputStreamReader(is));        StringBuilder sb = new StringBuilder();        String line = null;        try {            while ((line = reader.readLine()) != null) {                sb.append(line + ""\n"");            }        } catch (IOException e) {            e.printStackTrace();        } finally {            try {                is.close();            } catch (IOException e) {                e.printStackTrace();            }        }        return sb.toString();    }}</code></pre><p>Here's the adapter code...</p><pre><code>    public class AlertsAdapter extends ArrayAdapter&lt;JSONObject&gt; {    public AlertsAdapter(Activity activity, List&lt;JSONObject&gt; alerts) {        super(activity, 0, alerts);    }     @Override        public View getView(int position, View convertView, ViewGroup parent) {            Activity activity = (Activity) getContext();            LayoutInflater inflater = activity.getLayoutInflater();            View rowView = inflater.inflate(R.layout.list_text, null);            JSONObject imageAndText = getItem(position);            TextView textView = (TextView) rowView.findViewById(R.id.last_build_stat);            try {                textView.setText((String)imageAndText.get(""suggestions""));            } catch (JSONException e) {                textView.setText(""JSON Exception"");            }            return rowView;        }}</code></pre><p>Here's the logcat...</p><pre><code>    04-30 13:09:46.656: INFO/ActivityManager(584): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.WorldToyota/.Alerts }04-30 13:09:50.417: ERROR/JSON(924): There was an error parsing the JSON04-30 13:09:50.417: ERROR/JSON(924): org.json.JSONException: JSONArray[0] is not a JSONObject.04-30 13:09:50.417: ERROR/JSON(924):     at org.json.JSONArray.getJSONObject(JSONArray.java:268)04-30 13:09:50.417: ERROR/JSON(924):     at com.WorldToyota.AlertsAdd.retrieveJSONArray(AlertsAdd.java:30)04-30 13:09:50.417: ERROR/JSON(924):     at com.WorldToyota.Alerts.onCreate(Alerts.java:20)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)04-30 13:09:50.417: ERROR/JSON(924):     at android.os.Handler.dispatchMessage(Handler.java:99)04-30 13:09:50.417: ERROR/JSON(924):     at android.os.Looper.loop(Looper.java:123)04-30 13:09:50.417: ERROR/JSON(924):     at android.app.ActivityThread.main(ActivityThread.java:4203)04-30 13:09:50.417: ERROR/JSON(924):     at java.lang.reflect.Method.invokeNative(Native Method)04-30 13:09:50.417: ERROR/JSON(924):     at java.lang.reflect.Method.invoke(Method.java:521)04-30 13:09:50.417: ERROR/JSON(924):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)04-30 13:09:50.417: ERROR/JSON(924):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)04-30 13:09:50.417: ERROR/JSON(924):     at dalvik.system.NativeStart.main(Native Method)04-30 13:09:50.688: ERROR/JSON(924): There was an error creating the JSONObject04-30 13:09:50.688: ERROR/JSON(924): org.json.JSONException: JSONObject[""suggestions""] not found.04-30 13:09:50.688: ERROR/JSON(924):     at org.json.JSONObject.get(JSONObject.java:287)04-30 13:09:50.688: ERROR/JSON(924):     at org.json.JSONObject.getJSONArray(JSONObject.java:362)04-30 13:09:50.688: ERROR/JSON(924):     at com.WorldToyota.AlertsAdd.retrieveJSONArray(AlertsAdd.java:41)04-30 13:09:50.688: ERROR/JSON(924):     at com.WorldToyota.Alerts.onCreate(Alerts.java:20)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)04-30 13:09:50.688: ERROR/JSON(924):     at android.os.Handler.dispatchMessage(Handler.java:99)04-30 13:09:50.688: ERROR/JSON(924):     at android.os.Looper.loop(Looper.java:123)04-30 13:09:50.688: ERROR/JSON(924):     at android.app.ActivityThread.main(ActivityThread.java:4203)04-30 13:09:50.688: ERROR/JSON(924):     at java.lang.reflect.Method.invokeNative(Native Method)04-30 13:09:50.688: ERROR/JSON(924):     at java.lang.reflect.Method.invoke(Method.java:521)04-30 13:09:50.688: ERROR/JSON(924):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)04-30 13:09:50.688: ERROR/JSON(924):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)04-30 13:09:50.688: ERROR/JSON(924):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Plz help me parsing this script and displaying the values in list format....</p>","303155","","948041","","2012-12-12 06:28:13","2012-12-12 06:28:13","Retrieving Json Array","<android><json>","4","2","3","",""
"2743100","1","2743348","","2010-04-30 08:03:01","2","278","<p>Can one service be bound to n activities?</p>","283494","","","","","2010-04-30 08:56:08","Service binding relation","<android>","1","0","","",""
"2743167","1","","","2010-04-30 08:18:01","0","461","<p>I want to extract android 1.6 calendar fields and put them into a vcalendar filemy problem is that i can't find some fields in the database like: DTSTAMP UID LAST-MODIFIED SEQUENCE</p><p>does anyone have a clue on how to find them?</p><p>thanks!</p>","445548","","","","","2010-04-30 11:00:38","extract android 1.6 calendar fields to vcal","<java><database><android><sqlite><calendar>","1","0","","",""
"2743559","1","2743844","","2010-04-30 09:31:37","40","46049","<p>In my android application it automatically focuses the first Button I have in my layout, giving it an orange outline. How can I set the initial focus preferably in XML, and can this be set to nothing?</p>","315998","","","","","2013-07-31 14:59:19","Set initial focus in an android application","<android><focus>","7","0","4","",""
"2743661","1","2744026","","2010-04-30 09:55:10","2","1036","<p>I tried to invoke another activity from my main acitivty which is located in a jar file. </p><blockquote>  <p>Class clazz =  Class.forName(getPackageName() + ""."" +  getActivityName()); startActivity(new  Intent(this, clazz));</p></blockquote><p>I'm doing it this way because I only know the name of the class. This works fine, but unfortunately, all resource files can't be found while loading the activity from the jar file. At the first occurence of loading a res file there is a <code>ResourceNotFoundException</code>:</p><blockquote>  <p>04-30 11:18:46.944:  ERROR/AndroidRuntime(1749): Caused by:  android.content.res.Resources$NotFoundException:  Resource ID #0x7f040006</p></blockquote><p>Any hints for that? </p>","","anon","469983","","2011-11-21 10:34:49","2012-05-17 07:44:53","Invoking activity that is located in a jar","<android>","1","2","2","",""
"2743741","1","2744702","","2010-04-30 10:10:39","4","4036","<p>I want to lock files that is on the sdcard of android.I need to lock them so no one except my software can delete copy move or send them over bluetooth or any other way.How can I do it? </p>","309166","","20402","","2010-04-30 10:21:23","2010-04-30 13:13:28","How can I lock files in android using java code?","<java><android><file><locking>","3","0","1","",""
"2743872","1","2744516","","2010-04-30 10:38:53","1","820","<p>i would need to know the past 7 days record. i want to wrote a query for that in where condition. i have very basic knowledge in sqlite. Please help me for this query.</p>","267269","","135152","","2011-05-25 03:14:06","2011-05-25 03:14:06","to find the last 7 days Records in sqlite?","<java><android><sqlite>","2","0","","",""
"2744128","1","","","2010-04-30 11:23:40","0","875","<p>I want to retrieve an image from my data/data/com.apps.myapp/images folder and display it in an ImageView. Any clue?</p>","2355649","","114066","","2010-04-30 11:33:57","2010-04-30 11:44:20","Is it possible to retrieve an image from the data folder in an android app?","<android>","2","2","","",""
"2744285","1","","","2010-04-30 11:55:33","0","694","<p>I want to add files to java app in android so I'll know their path and can access them.How can I do it? (It doesn't matter where they will be the most important is that I can access them and I'll know the relative path of the them)</p>","309166","","","","","2010-05-01 10:36:37","How can I add files to java app in android so I can get it path?","<java><android>","2","1","","",""
"2744443","1","2756957","","2010-04-30 12:25:49","0","1157","<p>I'm ok using monkey command on the emulator but is it possible to launch it on a phone i'm using for debug?</p>","263521","","","","","2010-05-03 08:45:37","Monkey command on android phone?","<android><monkey>","1","2","","",""
"2744617","1","","","2010-04-30 12:58:06","3","9096","<p>if I want to use the following Web service (help.be is just an example, let's say it does exist): <a href=""http://www.help.be/webservice/webservice_help.php"" rel=""nofollow"">http://www.help.be/webservice/webservice_help.php</a> (it's written in PHP=client's choice, not .NET) with the following WSDL :</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;definitions xmlns=""http://schemas.xmlsoap.org/wsdl/"" name=""webservice_help"" targetNamespace=""http://www.help.be/webservice/webservice_help.php"" xmlns:tns=""http://www.help.be/webservice/webservice_help.php"" xmlns:impl=""http://www.help.be/webservice/webservice_help.php"" xmlns:xsd1=""http://www.help.be/webservice/webservice_help.php"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/"" xmlns:soap=""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/""&gt;  &lt;portType name=""webservice_helpPortType""&gt;    &lt;operation name=""webservice_help""&gt;      &lt;input message=""tns:Webservice_helpRequest""/&gt;    &lt;/operation&gt;    &lt;operation name=""getLocation"" parameterOrder=""input""&gt;      &lt;input message=""tns:GetLocationRequest""/&gt;      &lt;output message=""tns:GetLocationResponse""/&gt;    &lt;/operation&gt;</code></pre><p>                                                                        </p><pre><code>    &lt;operation name=""getStationDetail"" parameterOrder=""input""&gt;      &lt;input message=""tns:GetStationDetailRequest""/&gt;      &lt;output message=""tns:GetStationDetailResponse""/&gt;    &lt;/operation&gt;    &lt;operation name=""getStationList"" parameterOrder=""input""&gt;      &lt;input message=""tns:GetStationListRequest""/&gt;      &lt;output message=""tns:GetStationListResponse""/&gt;    &lt;/operation&gt;  &lt;/portType&gt;  &lt;binding name=""webservice_helpBinding"" type=""tns:webservice_helpPortType""&gt;    &lt;soap:binding style=""rpc"" transport=""http://schemas.xmlsoap.org/soap/http""/&gt;    &lt;operation name=""webservice_help""&gt;      &lt;soap:operation soapAction=""urn:webservice_help#webservice_helpServer#webservice_help""/&gt;      &lt;input&gt;        &lt;soap:body use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/input&gt;    &lt;/operation&gt;    &lt;operation name=""getLocation""&gt;      &lt;soap:operation soapAction=""urn:webservice_help#webservice_helpServer#getLocation""/&gt;      &lt;input&gt;        &lt;soap:body parts=""input"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/input&gt;      &lt;output&gt;        &lt;soap:body parts=""return"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/output&gt;    &lt;/operation&gt;    &lt;operation name=""getStationDetail""&gt;      &lt;soap:operation soapAction=""urn:webservice_help#webservice_helpServer#getStationDetail""/&gt;      &lt;input&gt;        &lt;soap:body parts=""input"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/input&gt;      &lt;output&gt;        &lt;soap:body parts=""return"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/output&gt;    &lt;/operation&gt;    &lt;operation name=""getStationList""&gt;      &lt;soap:operation soapAction=""urn:webservice_help#webservice_helpServer#getStationList""/&gt;      &lt;input&gt;        &lt;soap:body parts=""input"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/input&gt;      &lt;output&gt;        &lt;soap:body parts=""return"" use=""encoded"" namespace=""http://www.help.be/webservice/webservice_help.php"" encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""/&gt;      &lt;/output&gt;    &lt;/operation&gt;  &lt;/binding&gt;  &lt;message name=""Webservice_helpRequest""/&gt;  &lt;message name=""GetLocationRequest""&gt;    &lt;part name=""input"" type=""xsd:array""/&gt;  &lt;/message&gt;  &lt;message name=""GetLocationResponse""&gt;    &lt;part name=""return"" type=""xsd:array""/&gt;  &lt;/message&gt;  &lt;message name=""GetStationDetailRequest""&gt;    &lt;part name=""input"" type=""xsd:array""/&gt;  &lt;/message&gt;  &lt;message name=""GetStationDetailResponse""&gt;    &lt;part name=""return"" type=""xsd:string""/&gt;  &lt;/message&gt;  &lt;message name=""GetStationListRequest""&gt;    &lt;part name=""input"" type=""xsd:array""/&gt;  &lt;/message&gt;  &lt;message name=""GetStationListResponse""&gt;    &lt;part name=""return"" type=""xsd:string""/&gt;  &lt;/message&gt;  &lt;service name=""webservice_helpService""&gt;    &lt;port name=""webservice_helpPort"" binding=""tns:webservice_helpBinding""&gt;      &lt;soap:address location=""http://www.help.be/webservice/webservice_help.php""/&gt;    &lt;/port&gt;  &lt;/service&gt;&lt;/definitions&gt;</code></pre><p>What is the correct SOAP_ACTION, METHOD_NAME, NAMESPACE, URL I should use below ?</p><p>I've tried with this :</p><pre><code>public class Main extends Activity {/** Called when the activity is first created. */private static final String SOAP_ACTION_GETLOCATION = ""getLocation"";private static final String METHOD_NAME_GETLOCATION = ""getLocation"";            private static final String NAMESPACE = ""http://www.help.be/webservice/"";private static final String URL = ""http://www.help.be/webservice/webservice_help.php"";TextView tv;@SuppressWarnings(""unchecked"")@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv = (TextView)findViewById(R.id.TextView01);    // --------------------------------------------------------------------------------------    SoapObject request_location = new SoapObject(NAMESPACE, METHOD_NAME_GETLOCATION);           request_location.addProperty(""login"", ""login"");         // -&gt; string required     request_location.addProperty(""password"", ""password"");   // -&gt; string required    request_location.addProperty(""serial"", ""serial"");       // -&gt; string required    request_location.addProperty(""language"", ""fr"");         // -&gt; string required (available « fr,nl,uk,de »)     request_location.addProperty(""keyword"", ""Braine"");      // -&gt; string required    // --------------------------------------------------------------------------------------    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    //soapEnvelope.dotNet = true;                           // don't forget it for .NET WebServices !    soapEnvelope.setOutputSoapObject(request_location);    AndroidHttpTransport aht = new AndroidHttpTransport(URL);    try {         aht.call(SOAP_ACTION_GETLOCATION, soapEnvelope);         // Get the SAOP Envelope back and then extract the body         SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;         Vector XXXX = (Vector) resultsRequestSOAP.getProperty(""GetLocationResponse"");         int vector_size = XXXX.size();         Log.i(""Hub"", ""testat=""+vector_size);        tv.setText(""OK"");      } catch(Exception E) {         tv.setText(""ERROR:"" + E.getClass().getName() + "": "" + E.getMessage());        Log.i(""Hub"", ""Exception E"");        Log.i(""Hub"", ""E.getClass().getName()=""+E.getClass().getName());         Log.i(""Hub"", ""E.getMessage()=""+E.getMessage());     }     // --------------------------------------------------------------------------------------}</code></pre><p>}</p><p>I'm not sure of the SOAP_ACTION, METHOD_NAME, NAMESPACE, URL I have to use? because soapAction is pointing to a URN instead of a traditional URL and it's PHP and not .NET ...</p><p>also, I'm not sure if I have to use  <code>request_location.addProperty(""login"", ""login"");</code><br>of <code>request_location.addAttribute(""login"", ""login"");</code> ?</p><p>=> </p><pre><code>&lt;message name=""GetLocationRequest""&gt;&lt;part name=""input"" type=""xsd:array""/&gt;</code></pre><p></p><p>What would you say ?</p><p>Txs for your help.</p><p>H.</p><p>EDIT : Here is some code working in PHP - I simply want to have the same but in Android/JAVA :</p><pre><code>&lt;?phpini_set(""soap.wsdl_cache_enabled"", ""0""); // disabling WSDL cache $request['login'] = 'login';$request['password'] = 'password';$request['serial'] = 'serial';$request['language'] = 'fr';  $client= new SoapClient(""http://www.test.be/webservice/webservice_test.wsdl"");    print_r( $client-&gt;__getFunctions());?&gt;&lt;hr&gt;&lt;h1&gt;getLocation&lt;/h1&gt;&lt;h2&gt;Input:&lt;/h2&gt;&lt;?$request['keyword'] = 'Bruxelles';print_r($request);?&gt;&lt;h2&gt;Result&lt;/h2&gt;&lt;? $result = $client-&gt;getLocation($request); print_r($result);?&gt;</code></pre>","116573","","116573","","2010-05-02 18:49:46","2011-10-09 16:30:43","Android Client : Web service - what's the correct SOAP_ACTION, METHOD_NAME, NAMESPACE, URL I should use?","<php><android><web-services><soap>","1","6","1","",""
"2744704","1","","","2010-04-30 13:13:37","0","62","<p>I have a problem. I have to access to the data folder ofother applications from my applicationto read configuration's file and so on but it seems it's possible onlyto read data from the sdcard and my application's data folder.Can you suggest me how to solve this problem?</p>","329773","","","","","2010-04-30 13:20:57","troubles reading other apps config files","<java><android><file>","1","0","","",""
"2744729","1","4256571","","2010-04-30 13:17:44","6","2565","<p>I have an application where I would like to warn the user if they are not using the default Android softkeyboard. (i.e. they are using Swype or some thing else).</p><p>How can I check which input method they currently have selected?</p>","329776","","244296","","2011-01-11 04:43:05","2011-01-11 04:43:05","How to determine the current IME in Android?","<android><keyboard><ime><android-input-method>","2","0","1","",""
"2744752","1","2744829","","2010-04-30 13:21:54","6","5037","<p>Some Android programs trigger the ""media volume"" slider when the hardware volume up/down buttons are pressed. My application seems to set the ringer volume when the hardware buttons are pressed.</p><p>How would I enable the media volume slider? </p><p>I would hate for users to have to go into their settings to change the media volume when they use my application.</p>","300972","","","","","2011-03-27 00:23:04","Enable Media Volume Slider in Android application","<android>","2","1","4","",""
"2744814","1","","","2010-04-30 13:31:46","1","244","<p>In my JS i'm using this code</p><pre><code>    try{var xhrArgs = {                url: ""/mum/proxy/http/localhost:8080/com.error.android.mashup/xmlContentReader"",                postData: tmp,                handleAs: ""text"",                load: function(data) {                  //  alert(""data:""+data);                },                error: function(error) {                    //We'll 404 in the demo, but that's okay.  We don't have a 'postIt' service on the                    //docs server.                   alert(error);                }            };var ret = dojo.xhrPost(xhrArgs);}catch(ex){alert("":::""+ex);}`</code></pre><p>when I run the app which contains this code in firefox browser server is getting the request  and i'm able to get the value present in the tmp variable...</p><p>but when trying from android browser request is not received at server side....</p>","323876","","","","","2010-04-30 13:31:46","DOJO.xhrPOST not working in android","<android><dojo><javascript>","0","2","","",""
"2744877","1","2745227","","2010-04-30 13:40:02","0","1110","<p>I defined a remote service over a AIDL file. Now i want to access this service in a different application. But how can I do that? The AIDL file is not accessible in my second application, and if i just copy the AIDL file, then the service can^^t be found.</p><p>Any hints for that problem??</p><p>Thanks Sebi</p>","","anon","","","","2010-04-30 14:35:20","Access remote service in different application","<android>","1","0","2","",""
"2745061","1","","","2010-04-30 14:15:23","76","43845","<p>I have an activity that starts AsyncTask and shows progress dialog for the duration of operation. The activity is declared NOT be recreated by rotation or keyboard slide.</p><pre><code>    &lt;activity android:name="".MyActivity""               android:label=""@string/app_name""              android:configChanges=""keyboardHidden|orientation""              &gt;        &lt;intent-filter&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>Once task completed, I dissmiss dialog, but on some phones (framework: 1.5, 1.6) such error is thrown:</p><pre><code>java.lang.IllegalArgumentException: View not attached to window manager    at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356)    at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201)    at android.view.Window$LocalWindowManager.removeView(Window.java:400)    at android.app.Dialog.dismissDialog(Dialog.java:268)    at android.app.Dialog.access$000(Dialog.java:69)    at android.app.Dialog$1.run(Dialog.java:103)    at android.app.Dialog.dismiss(Dialog.java:252)    at xxx.onPostExecute(xxx$1.java:xxx)</code></pre><p>My code is:</p><pre><code>final Dialog dialog = new AlertDialog.Builder(context)    .setTitle(""Processing..."")    .setCancelable(true)    .create();final AsyncTask&lt;MyParams, Object, MyResult&gt; task = new AsyncTask&lt;MyParams, Object, MyResult&gt;() {    @Override    protected MyResult doInBackground(MyParams... params) {        // Long operation goes here    }    @Override    protected void onPostExecute(MyResult result) {        dialog.dismiss();        onCompletion(result);    }};task.execute(...);dialog.setOnCancelListener(new OnCancelListener() {    @Override    public void onCancel(DialogInterface arg0) {        task.cancel(false);    }});dialog.show();</code></pre><p>From what I have read (<a href=""http://bend-ing.blogspot.com/2008/11/properly-handle-progress-dialog-in.html"">http://bend-ing.blogspot.com/2008/11/properly-handle-progress-dialog-in.html</a>) and seen in Android sources, it looks like the only possible situation to get that exception is when activity was destroyed. But as I have mentioned, I forbid activity recreation for basic events.</p><p>So any suggestions are very appreciated.</p>","62192","","","","","2013-09-24 13:43:04","java.lang.IllegalArgumentException: View not attached to window manager","<android>","9","0","30","",""
"2745168","1","","","2010-04-30 14:29:17","0","1407","<p>I've released an android app with the property </p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4""/&gt;</code></pre><p>now my app seems to crash on android 1.5 devices (i guess because i use drawable-mdpi/hdpi,...)</p><p>so thought it would be good to release the same app just for 1.5 devices (not using the mdpi/hdpi-directories). but when i use</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3""       android:targetSdkVersion=""3""      android:maxSdkVersion=""3"" /&gt;</code></pre><p>it doesn't compile for 1.5 (it states that target and maxsdkversion are unknown properties). (if i set the jar-sdk to 1.6 it works fine).</p><p>So what is the best way to solve my problem? Is the app runable if I compile with 1.6 sdk but restrict it to sdk 3 (1.5) ? Or would this also crash since the sdk3 doesn't know the manifest-attributes ""target/maxSdkVersion""?</p><p>Any other ideas how to solve this?</p>","309871","","","","","2010-04-30 18:05:16","Android: Setting maxSDK version for Android 1.5 app","<android><sdk><version><max><min>","1","2","","",""
"2745466","1","","","2010-04-30 15:04:35","0","99","<p>I'm creating a custom keyboard layout.  The SDK allows changing the width of keys in a row (as in ThickButtons), but ideally I'd like to be able to vary both the height and width of keys within a row (and still have the keys occupy all the available space.)</p><p>Another way of looking at this is that I want to allow some keys to be in more than one contiguous row.  Any ideas would help.  Thank you.</p>","329853","","","","","2010-05-05 21:41:16","How can I vary the height of some keys within a row?","<android><android-keypad>","1","0","","",""
"2745518","1","","","2010-04-30 15:09:56","1","969","<p>I added some audio files to the res file.first I created a raw dir and then I added the folder with the audio files.</p><p>How can I get each file path? (I want to use the path to play this audio files)</p><p>I found that I need to use </p><pre><code>classLoader.getResource</code></pre><p>but I don't understand how. what is the argument for this function?</p>","309166","","","","","2010-04-30 18:24:25","Using java with android how can I get the path of my resources files?","<android><resources>","1","0","","",""
"2746268","1","2746492","","2010-04-30 16:58:35","3","779","<p>i have go through the three methods in Adapters classes. </p><ol><li>getView()</li><li>newView()</li><li>bindView()</li></ol><p>what are the difference between those methods? please share some tutorial, sample code or logics to understand this. Thanks. i have to create a listview with the progressive icons. which adapter you suggest me to do that?</p>","267269","","267269","","2010-04-30 17:12:01","2010-04-30 17:37:38","Adapter Methods in Android?","<android><listview><adapter>","1","0","1","",""
"2746407","1","2746551","","2010-04-30 17:24:32","14","16478","<p>I try to search for it but I just cant. I am running Windows 7 on Lenovo G460 laptop. I tried to install Ubuntu on it but I cannot use Wireless to connect to the internet for some reason.</p><p>Is there anyway for me to get a look at Android source code or at least just the Calendar part of it?</p>","271736","","648313","","2011-07-13 11:24:30","2014-02-02 13:54:46","How can I check out Android source code in Windows OS?","<android><android-source>","7","2","10","",""
"2746661","1","","","2010-04-30 18:09:48","6","1880","<p>I've created a class that extends drawable that I'd like to reference inside a resource xml.  I happen to need it in a selector, like so:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_window_focused=""false"" android:state_pressed=""false"" android:drawable=""com.sample.android.contacts.TopBarCollapsed""/&gt;&lt;item android:state_window_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/top_switcher_collapsed_selected"" /&gt;&lt;item android:state_focused=""true"" android:drawable=""@drawable/top_switcher_collapsed_focused"" /&gt;</code></pre><p></p><p>com.sample.android.contacts.TopBarCollapsed is the class that extends drawable. </p>","303769","","","","","2010-05-01 17:46:02","How can I reference a drawable class in Android XML","<android>","1","3","3","",""
"2746936","1","","","2010-04-30 18:56:48","0","734","<p>I would like to create a simple drawing (lines, circles, squares, etc...) but I'm having difficulty figuring out the best way to do this.  The drawing would need to be scaled to fit the display since the size is indirectly specified by the user (like in a CAD application).  Also, I don't want to take up the entire display, leaving room for some controls (buttons, etc).  I would pass the data to describe the drawing.  Here's how I imagine it would work.</p><p>I create an XML layout that contains something that holds the drawing (ImageView, BitmapDrawable, ShapeDrawable, ...??? not sure exactly what).  Then in my Activity I would load the main XML and obtain the resource for the control that holds the drawing.  I would then draw to a bitmap.  Once the bitmap was completed I would load it into the control that is to hold the drawing.  Somewhere along this path it would be scaled to fill the entire area allocated for the drawing in the XML layout.  </p><p>I don't know if my approach is the way to do this or what classes to use.  I read the <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html"" rel=""nofollow"">http://developer.android.com/guide/topics/graphics/2d-graphics.html</a> documentation, but it's not helping me with an example.  The examples I do find leave me with hints, but nothing concrete enough to do what I want, especially when it comes to scaling, using XML and/or having other controls.  Also, there seems to be no good documentation on the design of the 2D drawing system in a more conceptual manner, so it makes what I read difficult to put into any useful context.  </p><p>Any hints on what classes would be useful and/or a good example any other reading materials?  </p><p>Thanks</p>","329999","","","","","2010-09-09 11:39:46","Use XML Layout to contain a simple drawing","<android><image><layout><drawing>","2","0","","",""
"2747004","1","2747046","","2010-04-30 19:11:07","3","5713","<p>I'm building an open source 2D game engine called YoghurtGum. Right now I'm working on the Android port, using the NDK provided by Google. </p><p>I was going mad because of the errors I was getting in my application, so I made a simple test program:</p><pre><code>class Base{public:    Base() { }    virtual ~Base() { }}; // class Baseclass Vehicle : virtual public Base{public:    Vehicle() : Base() { }    ~Vehicle() { }}; // class Vehicleclass Car : public Vehicle{public:    Car() : Base(), Vehicle() { }    ~Car() { }}; // class Carint main(int a_Data, char** argv){    Car* stupid = new Car();    return 0;}</code></pre><p>Seems easy enough, right? Here's how I compile it, which is the same way I compile the rest of my code:</p><pre><code>/home/oem/android-ndk-r3/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-g++-g -std=c99 -Wall -Werror -O2 -w -shared -fshort-enums -I ../../YoghurtGum/src/GLES -I ../../YoghurtGum/src -I /home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/include -c src/Inheritance.cpp -o intermediate/Inheritance.o</code></pre><p>(Line breaks are added for clarity). This compiles fine. But then we get to the linker:</p><pre><code>/home/oem/android-ndk-r3/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc-lstdc++ -Wl,--entry=main,-rpath-link=/system/lib,-rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib,-dynamic-linker=/system/bin/linker,-L/home/oem/android-ndk-r3/build/prebuilt/linux-x86/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0,-L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib,-rpath=../../YoghurtGum/lib/GLES -nostdlib -lm -lc -lGLESv1_CM  -z /home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib/crtbegin_dynamic.o /home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib/crtend_android.ointermediate/Inheritance.o ../../YoghurtGum/bin/YoghurtGum.a -o bin/Galaxians.android</code></pre><p>As you can probably tell, there's a lot of cruft in there that isn't really needed. That's because it doesn't work. It fails with the following errors:</p><pre><code>intermediate/Inheritance.o:(.rodata._ZTI3Car[typeinfo for Car]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Inheritance.o:(.rodata._ZTI7Vehicle[typeinfo for Vehicle]+0x0): undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'intermediate/Inheritance.o:(.rodata._ZTI4Base[typeinfo for Base]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'collect2: ld returned 1 exit statusmake: *** [bin/Galaxians.android] Fout 1</code></pre><p>These are the same errors I get from my actual application.</p><p>If someone could explain to me where I went wrong in my test or what option or I forgot in my linker, I would be very, extremely grateful.</p><p>Thanks in advance.</p><p><strong>UPDATE:</strong></p><p>When I make my destructors non-inlined, I get new and more exciting link errors:</p><pre><code>intermediate/Inheritance.o:(.rodata+0x78): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'intermediate/Inheritance.o:(.rodata+0x90): undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'intermediate/Inheritance.o:(.rodata+0xb0): undefined reference to `vtable for __cxxabiv1::__class_type_info'collect2: ld returned 1 exit statusmake: *** [bin/Galaxians.android] Fout 1</code></pre>","141057","","141057","","2010-04-30 19:35:45","2011-11-23 15:52:59","GCC: Simple inheritance test fails","<c++><android><gcc><linker><android-ndk>","3","1","","",""
"2747146","1","2747250","","2010-04-30 19:34:58","0","1503","<p>I get a NullPointerException calling a Superclass Method in Subclass Inner Class Constructor... What's the Deal?</p><hr><p>In my application's main class (subclass of Application), I have a public inner class that simply contains 3 public string objects. In the parent class I declare an object of that inner class.</p><pre><code>public class MainApplication extends Application {    public class Data {        public String x;        public String y;        public String z;    }    private Data data;    MainApplication() {        data = new Data()        data.x = SuperClassMethod();    }}</code></pre><p>After I instantiate the object in the constructor, I get a runtime error when I try to assign a value in the inner class with a superclass method.</p><p>Any idea what's up here?? Can you not call superclass methods in the subclass constructor?</p><p>** Edit ** Original question was about inner class member assignment in outer class constructor. Turned out the issue was with calling a superclass method in the class's constructor. It was giving me a null pointer exception. Thus, the question has changed.</p>","325011","","325011","","2010-05-08 06:12:29","2010-05-08 06:12:29","Issue calling superclass method in subclass constructor","<java><android><constructor>","3","6","","",""
"2747259","1","2747309","","2010-04-30 19:51:23","3","930","<p>I noticed a lot of Android functions have a parameter that you can pass in that's a bitmask, for different options, like on PendingIntent, you can pass in things like you can call getActivity() with <code>PendingIntent.FLAG_CANCEL_CURRENT|PendingIntent.FLAG_NO_CREATE</code>.</p><p>I'm wondering how I can create a function that has a parameter like this?</p>","238849","","","","","2010-04-30 20:01:28","Creating a bitmask parameter for a function or method","<java><android>","2","0","","",""
"2747350","1","2747459","","2010-04-30 20:08:18","0","1001","<p>i cant seem to figure out how to add the admob widget into my application. i want to add the widget to a linearlayout that is the child of a relative layout. the linerlayout was created just for the ad. </p><p>and have it update/refresh the ad each time a button is pressed. i have already imported the JAR,edited my manifest to include the permissions and publisher id. but i cant seem to exactly figure out how to add integrate the admob code. </p><p>/facepalm. im an idiot problem solved.</p>","326423","","326423","","2010-04-30 21:35:43","2010-04-30 21:35:43","adding admob widget","<android><admob>","1","0","","",""
"2747402","1","2747535","","2010-04-30 20:17:56","0","1372","<p>In reviewing this post <a href=""http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it"">http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it</a>, the highest rated answer says you should unregister and reregister the listener for the accelerometer onStop and onResume to conserve battery life.</p><p>My question is how do we know which listeners we need to stop/resume to minimize our applications footprint on battery life? Things like do OnClickListener, TextWatcher() etc - do they need to be changed?</p><p>and if anyone knows, what about adMob's SimpleAdListener?</p><p>I sort of assumed that the UI listeners don't consume battery if the Activity doesn't have focus.  As for the SimpleAdListener I have no idea....</p>","329776","","","","","2010-04-30 20:38:44","Android registerListener and battery life","<android><listener><addeventlistener><battery><event-listeners>","1","0","","",""
"2747416","1","2749351","","2010-04-30 20:19:31","0","494","<p>Is there a way to lookup the line number that a given element is at in an xml file via the w3c dom api?</p><p>My use case for this is that we have 30,000+ maps in kml/xml format.  I wrote a unit test that iterates over each file found on the hard drive (about 17GB worth) and tests that it is parseable by our application.  When it fails I throw an exception that contains the element instance that was considered ""invalid"".  In order for our mapping department (nobody here knows how to program) to easily track down the typo we would like to log the line number of the element that caused the exception.</p><p>Can anybody suggest a way to do this?  Please note we are using the W3C dom api included in the Android 1.6 SDK.</p>","97901","","","","","2014-02-26 12:18:57","How to get the line number an xml element is on via the Java w3c dom api","<java><android><dom><w3c><kml>","3","0","1","",""
"2747491","1","8548114","","2010-04-30 20:29:36","9","3811","<p>I have <strong>two</strong> AutocompleTextViews and I want to switch to the next if the user presses ""NEXT"", and make the virtual keyboard disappear when he hits ""DONE"" at the second AutocompleTextView.  So far, the buttons ""NEXT""/""DONE"" do nothing at all.... Unfortunately I found no resources addressing this problem.  </p><p>Any suggestions?thx</p>","323814","","","","","2011-12-17 21:41:30","AutocompleteTextView: on ""NEXT"" highlight next TextView, on ""DONE"", make keyboard disappear","<android><autocomplete><keyboard><highlight>","3","1","1","",""
"2747630","1","2750161","","2010-04-30 20:55:41","2","868","<p>I am creating a library for Android that others can include in their own project. So far I have been working on it as a normal Java project with JDK 1.6 setup as system library. This works just fine in Eclipse when I add the android.jar.</p><p>The issue comes when I try to my build script. I am running Gradle and doing a normal compile and test build cycle. My thoughts were that it does not matter if I compile it with a normal JDK, since this is not a standalone application. The benefits by creating a normal Java project is that Gradle does support this much better. My project also does not contain any UI at all. However, the problem is that of course android.jar and the JDK contains lots of the same classes and I think that this is what messes up my build script. Everything crashes when running the tests (the tests are in the same project under src/test/java).</p><p>My question is, how should I create this project that is meant to be included in Android projects as a third party library? Should I create it as an Android project in Eclipse even though I am only creating a library that does not use any of the UI features? Also, should the tests be in a separate project?</p><p>Thanks for all responses!</p>","310630","","310630","","2010-05-01 09:54:20","2010-05-12 14:19:39","Project setup for creating third party libraries for Android","<java><android>","2","0","1","",""
"2747830","1","3309680","","2010-04-30 21:33:09","2","471","<p>I am planning to start a computer vision based project on a smart phone platform. </p><p>I know iPhone ( <a href=""http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en"" rel=""nofollow"">http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en</a> ) and Andriod ( <a href=""http://github.com/billmccord/OpenCV-Android"" rel=""nofollow"">http://github.com/billmccord/OpenCV-Android</a> ) have openCV support. I am interested in knowing how was your experience with the level of integration, support and ease of building good apps on either platform. </p><p>Also I do want to consider windows phone 7 ( and Zune) as a platform, Are there any Computer Vision libraries for that platform or any good development tools( does Aforgenet work or any other good suggestion) ?</p><p>Also can you suggest some popular augmented reality apps which uses cutting edge technology ( I am aware of <a href=""http://www.pranavmistry.com/projects/sixthsense/"" rel=""nofollow"">http://www.pranavmistry.com/projects/sixthsense/</a> )</p><p>Thnx in advance!</p>","220669","","","","","2012-04-17 23:17:37","Embedded computer vision platforms","<iphone><android><computer-vision><windows-phone-7>","2","1","3","",""
"2748268","1","2748329","","2010-04-30 23:45:26","5","5665","<p>I seem to be having trouble reading preferences from my AppWidgetProvider class. My code works in an Activity, but it does not in an AppWidgetProvider. Here is the code I am using to read back a boolean:</p><pre><code>SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);boolean autoreplyon = settings.getBoolean(""autoreplyon"", false);</code></pre><p>However, I get the ""The method getSharedPreferences(String, int) is undefined for the type widget"" error (widget is the name of my AppWidgetProvider class).</p><p>Thanks in advance for any suggestions!</p>","253567","","","","","2012-09-25 21:52:32","Get preferences in AppWidget Provider","<android><android-widget><preferences><android-preferences>","2","0","6","",""
"2748414","1","2748435","","2010-05-01 00:41:31","4","14402","<p>So this is related to a question I asked earlier. I am trying to display an alert using a specified layout. My layout is:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:id=""@+id/layout_root""              android:orientation=""horizontal""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:padding=""10dp""&gt;    &lt;TextView android:id=""@+id/text""              android:layout_width=""wrap_content""              android:layout_height=""fill_parent""              android:textColor=""#FFF"" /&gt;   &lt;/LinearLayout&gt;</code></pre><p>And the code to call and show the alert dialog is:</p><pre><code>    Context mContext = getApplicationContext();    AlertDialog.Builder builder = new AlertDialog.Builder(mContext);    // use a custom View defined in xml    View view = LayoutInflater.from(mContext).inflate(R.layout.sell_dialog,      (ViewGroup) findViewById(R.id.layout_root));    builder.setView(view);    builder.setPositiveButton(android.R.string.ok, new OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            // do whatever you want with the input        }    });    AlertDialog alertDialog = builder.create();    alertDialog.show();</code></pre><p>When I run it I get an error saying:</p><p>Uncaught handler: thread main exiting due to uncaught exceptionandroid.view.WindowManager$NadTokenException: Unable to add window -- token null is not for an application</p><p>I've looked through the android development site and can't figure it out. I think I'm just missing something obvious but the fix isn't jumping out at me. How can I get this alert dialog to display?</p>","327372","","4","","2012-01-03 22:53:13","2012-01-03 22:53:13","Alert Dialog with custom layout failing","<android>","1","0","1","",""
"2748590","1","2748723","","2010-05-01 01:58:30","35","25991","<p>The developer documentation has seemed to have failed me here.  I can create a static widget without thinking, I can even create a widget like the analogue clock widget that will update itself, however, I can not for the life of me figure out how to create a widget that reacts to when a user clicks on it.  Here is the best code sample that the developer documentation gives to what a widget activity should contain (the only other hint being the API demos, which only creates a static widget):</p><pre><code>public class ExampleAppWidgetProvider extends AppWidgetProvider {    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        final int N = appWidgetIds.length;        // Perform this loop procedure for each App Widget that belongs to this provider        for (int i=0; i&lt;N; i++) {            int appWidgetId = appWidgetIds[i];            // Create an Intent to launch ExampleActivity            Intent intent = new Intent(context, ExampleActivity.class);            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);            // Get the layout for the App Widget and attach an on-click listener to the button            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_layout);            views.setOnClickPendingIntent(R.id.button, pendingIntent);            // Tell the AppWidgetManager to perform an update on the current App Widget            appWidgetManager.updateAppWidget(appWidgetId, views);        }    }}</code></pre><p>from: <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"">The Android Developer Documentation's Widget Page</a></p><p>So, it looks like pending intent is called when the widget is clicked, which is based off of an intent (I'm not quite sure what the difference between an intent and a pending intent is), and the intent is for the ExampleActivity class.  So I made my sample activity class a simple activity that when created, would create a mediaplayer object, and start it (it wouldn't ever release the object, so it would eventually crash, here is it's code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.sound);    mp.start();}</code></pre><p>However, when I added the widget to the home screen, and clicked on it, nothing played, in fact, nothing played when I set the update timer to just a few hundred milliseconds (in the appwidget provider xml file).  Furthermore, I set break points and found out that not only was it never reaching the activity, but no break points I set would ever get triggered.  (I still haven't figured out why that is), however, logcat seemed to indicate that the activity class file was being run.</p><p>So, is there anything I can do to get an appwidget to respond to a click?  As the onClickPendingIntent() method is the closest I have found to a onClick type of method.</p><p>Thank you very much.</p>","288439","","","","","2014-01-08 20:41:59","Clickable widgets in android","<java><android><onclick><android-widget>","2","1","18","",""
"2748613","1","2748746","","2010-05-01 02:13:01","10","12512","<p>I respond to a button press on my appwidget in the onreceive method. When the button I pressed, I want to force the widget to call the onupdate method. How do I accomplish this? </p><p>Thanks in advance!</p>","253567","","","","","2013-10-29 13:33:28","Force Android widget to update","<android><android-widget><appwidget><onupdate>","2","2","6","",""
"2748770","1","","","2010-05-01 03:24:35","-3","1052","<p>I want users to be able to control the birghtness with a slider. Please answer in the simplest way because im a noob when it comes to android. </p>","330210","","","","","2010-06-05 11:00:13","How to control screen birghtness with slider in android","<android>","1","0","","",""
"2748813","1","2756651","","2010-05-01 03:50:07","2","928","<p>I am developing an android application where I need to manipulate the background image of the rows in listview on certain conditions. Initially when the listview is loaded all works properly. But when I scroll down to the listview and come up again the background image changes. Can someone tell me the reason why its happening so?</p><p>Hope to get the reply soon.</p>","261566","","1069068","","2013-03-19 14:45:57","2013-03-19 14:45:57","Row image changes in listview in android?","<android><image><listview><background>","1","1","","",""
"2748830","1","2749027","","2010-05-01 03:57:22","77","227848","<p>I want to  be able to change the background color to white in my android app in the simplest way possible. </p>","330210","","","","","2014-01-16 16:09:53","How to change background color in android app","<android><sdk>","4","0","14","",""
"2748901","1","","","2010-05-01 04:34:01","1","989","<p>I want to dispaly the current location in my application not in map.    I want the current palce using current lattitude and longitude .For Ex some 'x' person i want to know his location.but i want to know his location using his current lattitude and longitude.When i use the below code it`Context context;</p><pre><code>                    Geocoder geoCoder = new Geocoder(                            getBaseContext(), Locale.getDefault());                    List&lt;android.location.Address&gt; addresses = geoCoder.getFromLocation(17.385044,78.486671, 1);                    String addr = """";                    if (addresses.size() &gt; 0)                     {                        for (int k=0; i&lt;addresses.get(0).getMaxAddressLineIndex();                              k++)                           addr += addresses.get(0).getAddressLine(i) + ""\n"";                    }                    Toast.makeText(getBaseContext(), addr, Toast.LENGTH_SHORT).show();                    Log.v(""People"",""##############""+addr);</code></pre><p>The ""addr"" does not getting any value.why it is happened here my Activity is extended by MapActivity and also tell me without extending activity (simply in class) how do you find the current location using current lattitude and longitude ?</p><p>please give me the code suggestions for this.Thanks in advance</p>","454808","","454808","","2010-05-08 11:09:59","2010-05-08 11:09:59","find out the current location","<android>","2","0","","",""
"2749139","1","2749143","","2010-05-01 06:55:21","1","1206","<p>After I add the sound file ""do.mp3"" to res/raw I get this error: </p><blockquote>  <p>res\raw\do.mp3:0: error: invalid  symbol: 'do'</p></blockquote><p>And their isn't reference to it in the R class. How do I fix it?</p>","309166","","","","","2010-05-01 06:58:29","After I add a spesific sound file to res/raw I get error (java - android), Why is that?","<java><android><audio>","1","0","","",""
"2749171","1","2749573","","2010-05-01 07:13:20","0","464","<p>i am implementing  one application some fields are edittext  in edittext clicking open mobile keyboard  how can implemented this keyboard do not open </p>","275791","","","","","2010-05-01 10:28:58","in clicking edittext box then dont open mobile keyboard this senario how can implemented","<android>","1","2","1","",""
"2749210","1","","","2010-05-01 07:37:37","12","12045","<p>Eclipse (3.5) -->Window-->Android SDK and AVD Manager-->&lt;>When Adding SDK Components, there is the following error message:</p><p>Downloading Documentation for Android SDK, API 7, revision 1Installing Documentation for Android SDK, API 7, revision 1Unzip failed: C:\Program Files\Android_SDK\temp\DocPackage.new01\navtree_data.js (Access is denied).</p><p>This is followed by another message: -Nothing is installed-I use Windows 7 64-bit system.Could anyone please help to get around this? Thank you in advance.vmitsura</p>","330263","","","","","2012-12-18 09:56:38","-Unzip failed...Access is denied- error while adding Android SDK components to Eclipse","<android>","6","0","3","",""
"2749236","1","2752367","","2010-05-01 07:56:24","9","10852","<p>For my app, I need to record audio from MIC on an Android phone, and send it over TCP to the other android phone, where it needs to be played.</p><p>I am using <code>AudioRecord</code> and <code>AudioTrack</code> class. This works great with a file - write audio to the file using <code>DataOutputStream</code>, and read from it using <code>DataInputStream</code>.</p><p>However, if I obtain the same stream from a socket instead of a File, and try writing to it, I get an exception.</p><p>I am at a loss to understand what could possibly be going wrong. Any help would be greatly appreciated.</p><p>EDIT: The problem is same even if I try with larger buffer sizes (65535 bytes, 160000 bytes).</p><p>This is the code:</p><p>Recorder:</p><pre><code>int bufferSize = AudioRecord.getMinBufferSize(11025, , AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); AudioRecord recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);byte[] tempBuffer = new byte[bufferSize];recordInstance.startRecording();while (/*isRecording*/) {      bufferRead = recordInstance.read(tempBuffer, 0, bufferSize);      dataOutputStreamInstance.write(tempBuffer);}</code></pre><p>The DataOutputStream above is obtained as:</p><pre><code>BufferedOutputStream buff = new BufferedOutputStream(out1); //out1 is the socket's outputStreamDataOutputStream dataOutputStreamInstance = new DataOutputStream (buff);</code></pre><p>Could you please have a look, and let me know what is it that I could be doing wrong here?</p><p>Thanks,</p>","299988","","299988","","2010-05-01 08:29:32","2012-01-04 17:14:54","Android: Streaming audio over TCP Sockets","<java><android><sockets><dataoutputstream>","2","2","10","",""
"2749551","1","","","2010-05-01 10:21:08","4","2567","<p>I have a listview in which there should be different divider heightbetween different rows. So, how can we set the divider heightdynamically?</p><p>Suppose, I have 10 rows and there should be a divider height of 5between first 2 rows and then there should be a divider height of 1between next 5 rows and so on.</p><p>Can someone let me know the way of doing this?</p>","261566","","1069068","","2013-03-19 14:45:43","2013-03-19 14:45:43","How to change the divider height of listview dynamically?","<android><listview><height><dynamic><divider>","1","0","3","",""
"2749791","1","2751181","","2010-05-01 11:53:09","1","721","<p>I would like to create my own LiveWallpaperPreview, i.e. to show the user a fullscreen preview of what the selected Live Wallpaper looks like (without the ""Set Wallpaper"" and ""Settings"" button that the stock-OS preview has).</p><p>Rebuilding the LivePicker-Class from 2.1 (<a href=""http://android.git.kernel.org/?p=platform/packages/wallpapers/LivePicker.git;a=tree;f=src/com/android/wallpaper/livepicker;h=1557e0ae77aa8b0f8191472a204b5a7b4add31a4;hb=master"" rel=""nofollow"">android.git.kernel.org</a>) works great, so I am able to let the user select a wallpaper to be previewed, but the actual LiveWallpaperPreview-Class tries to import the following private Interfaces/Classes:</p><p><code>import android.service.wallpaper.IWallpaperConnection;<br>import android.service.wallpaper.IWallpaperService;<br>import android.service.wallpaper.IWallpaperEngine;<br>import android.service.wallpaper.WallpaperSettingsActivity;</code>  </p><p>Is there any way to display a LiveWallpaper in my app without resorting to using the private APIs (which I obviously don't want to do)?</p><p>Thanks!</p><p>Nick</p>","241189","","241189","","2010-05-01 17:15:04","2011-08-18 08:24:45","Creating own LiveWallpaperPreview?","<android>","2","0","1","",""
"2749893","1","2749924","","2010-05-01 12:26:49","1","19845","<p>I have here two applications in two different projects in eclipse. One application (A) defines an activity (A1) which is started first. Then i start from this activity the second activity (B1) in the second project (B). This works fine.</p><p>I start it the following way:</p><pre><code>Intent intent = new Intent(""pacman.intent.action.Launch"");intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);startActivity(intent);</code></pre><p>Now i want to send intents bewtween the two activities by using broadcast receivers. In activity A1 i send the intents the following way:</p><pre><code>Intent intent = new Intent(""pacman.intent.action.BROADCAST"");intent.putExtra(""message"",""Wake up."");sendBroadcast(intent);</code></pre><p>The part of the manifest file in activity A1 that is responsible for this broadcast is the following:</p><pre><code>&lt;activity android:name=""ch.ifi.csg.games4blue.games.pacman.controller.PacmanGame"" 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.BROADCAST"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>In the receiving activity, I define the receiver the following way in the manifest file:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".PacmanGame""                  android:label=""@string/app_name""                  android:screenOrientation=""portrait""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""pacman.intent.action.Launch"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;            &lt;receiver android:name=""ch.ifi.csg.games4blue.games.pacman.controller.MsgListener"" /&gt;        &lt;/activity&gt;    &lt;/application&gt;</code></pre><p>The class message listener is implemented this way:</p><pre><code>public class MsgListener extends BroadcastReceiver {    /* (non-Javadoc)     * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)     */    @Override    public void onReceive(Context context, Intent intent) {        System.out.println(""Message at Pacman received!"");    }}</code></pre><p>Unfortunately, the message is never received. Although the method in activity A1 is called, i never receive an intent in B1.</p><p>Any hints how to solve this?Thanks a lot!</p>","","anon","19750","","2012-03-28 18:55:41","2012-03-28 18:55:41","How to use Broadcast Receiver in different Applications in Android?","<android><broadcastreceiver>","3","2","4","",""
"2749964","1","","","2010-05-01 12:48:32","3","1313","<p>I am currently trying to develop a fullscreen input method for Android, but I have a hard time finding any hints on this. The only examples and tutorials to be found are for non-fullscreen IMEs and mention fullscreen mode only very briefly.</p><p>Also every tutorial about input methods seems to assume that the input method has given size which does not change, but my implementations size does depend on the screen size.</p><p>So my question is, are there any resources like tutorials or examples of fullscreen IMEs in Android?</p>","188461","","49246","","2010-11-13 10:37:27","2010-12-12 13:00:43","Looking for tutorials/examples on creating fullscreen IME in Android","<android><ime><android-input-method>","1","2","9","",""
"2750097","1","2750203","","2010-05-01 13:30:32","3","1422","<p>I am calling a PreferenceActivity from another activity and then updating the application state (ie: changing the font size) on onActivityResult, based on the preference changes.</p><p>I was thinking it would be better to put the state update logic in the PreferenceActivity. That way I don't have the duplicate the logic in each activity that calls the PreferenceActivity.</p><p>What's the best or correct way to do this?</p>","143378","","","","","2010-08-19 06:21:29","Responding to preference updates in Android","<android><activity><preferences><preferenceactivity>","2","0","2","",""
"2750107","1","","","2010-05-01 13:34:08","1","371","<p>Team,</p><p>Could you please help me debug the issue?</p><p>ActivityAdapter activityAdapter = new ActivityAdapter(this,activityList);        Log.d(""list"", ""List Display - 1"");</p><pre><code>    setListAdapter( activityAdapter );    Log.d(""List"", ""list done"");</code></pre><p>It's throwing exception at the time of setListAdapter,</p><p>05-01 16:59:15.996: WARN/dalvikvm(251): threadid=3: thread exiting with uncaught exception (group=0x4001b188)05-01 16:59:15.996: ERROR/AndroidRuntime(251): Uncaught handler: thread main exiting due to uncaught exception05-01 16:59:16.204: ERROR/AndroidRuntime(251): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.antennasoftware.xml/com.antennasoftware.xml.XMLParsing}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.os.Handler.dispatchMessage(Handler.java:99)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.os.Looper.loop(Looper.java:123)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread.main(ActivityThread.java:4310)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at java.lang.reflect.Method.invokeNative(Native Method)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at java.lang.reflect.Method.invoke(Method.java:521)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at dalvik.system.NativeStart.main(Native Method)05-01 16:59:16.204: ERROR/AndroidRuntime(251): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ListActivity.onContentChanged(ListActivity.java:236)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.Activity.setContentView(Activity.java:1622)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at com.antennasoftware.xml.XMLParsing.onCreate(XMLParsing.java:36)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)05-01 16:59:16.204: ERROR/AndroidRuntime(251):     ... 11 more</p><p>class ActivityList extends LinearLayout {</p><pre><code>public ActivityList(Context context, ActivityBean activityBean) {    super(context);    this.setOrientation(HORIZONTAL);    ListView listView = new ListView(context);    LinearLayout.LayoutParams idParams =         new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT);    //cityParams.setMargins(10, 10, 10, 10);    TextView idColumn = new TextView( context );    idColumn.setText( activityBean.getActivityId() );    idColumn.setTextSize(14f);    idColumn.setTextColor(Color.WHITE);    listView.addView( idColumn, idParams);           LinearLayout.LayoutParams accountNameParams =         new LinearLayout.LayoutParams(20, LayoutParams.WRAP_CONTENT);    TextView accountNameView = new TextView(context);    accountNameView.setText( activityBean.getAccountName() );    accountNameView.setTextSize( 14f );    accountNameView.setTextColor(Color.WHITE);    listView.addView( accountNameView, accountNameParams);                LinearLayout.LayoutParams typeParams =         new LinearLayout.LayoutParams(25, LayoutParams.WRAP_CONTENT);    //ImageView skyControl = new ImageView( context );    TextView typeView = new TextView(context);    typeView .setText( activityBean.getAccountName() );    typeView.setTextSize( 14f );    typeView .setTextColor(Color.WHITE);    listView.addView( typeView, typeParams );    addView(listView);}</code></pre><p>}</p><p>public class ActivityAdapter extends BaseAdapter{</p><pre><code>public ActivityAdapter(Context context, List activityList) {    this.context = context;    this.activityList = activityList;}private Context context;private List activityList;@Overridepublic int getCount() {    // TODO Auto-generated method stub    return activityList.size();}@Overridepublic Object getItem(int arg0) {    // TODO Auto-generated method stub    return null;}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ActivityBean activity = (ActivityBean) activityList.get(position);    return new ActivityList(this.context, activity );}</code></pre><p>}</p><p>Thanks in advance,</p>","330266","","330266","","2010-05-02 15:19:32","2010-05-02 15:19:32","android : customer List Adatper + ArrayList","<android>","2","0","","",""
"2750142","1","2751014","","2010-05-01 13:43:36","1","820","<p>I am trying to port my usage meter from a JavaScript Gadget (win) / Widget (OSX) to Android. Total newbie when comes to JAVA + Eclipse + Android 2.1 SDK. Essentially what I want to do is load a page, pass through a username and password and load the resulting page into a array that I can then run some regular expressions through.</p><p>My code from JavaScript (I've replace the actual URL with a dummy one) is:</p><pre><code>xmlhttp.open(""post"",""https://acme.com.au/your_account/index.php?function=login"",false);xmlhttp.setRequestHeader(""If-Modified-Since"", ""Sat, 1 Jan 2000 00:00:00 GMT"");xmlhttp.setRequestHeader(""Content-Type"", ""application/x-www-form-urlencoded"");xmlhttp.send(""check_username="" + username + ""&amp;password="" + password);</code></pre><p>I need to know the Android equivalent to the above please. I've played around with WebView but that loads the page in a web browser which isn't what I want.</p>","330368","","","","","2010-05-12 01:34:54","How do I load URL that requires login into variable?","<java><android><eclipse>","2","0","","",""
"2750395","1","2750621","","2010-05-01 14:56:40","7","5980","<p>I want to search for files on the users mobile with specific extensions. </p><p>I tried searching but could not find any direct API's. </p><p>Is there a specific API's or is there tedious way of achieving the same.Or is there a mechanism to call linux calls for find or something similar</p><p>Thanks</p>","285550","","","","","2013-08-12 04:27:01","How to search for files on phone sdcard or else where","<android><search><file><filesystems><file-extension>","2","0","3","",""
"2750664","1","2776105","","2010-05-01 16:19:47","10","15317","<p>Everything is in the title.</p><p>On the official documentations it is stated that <code>Note that services, like other application objects, run in the main thread of their hosting process</code> and AsyncTask only works if it is executed in the UIThread.</p><p>So is it possible to use AsyncTask in a Service class?</p><p>I am trying to do so but I'm always getting the same error </p><pre><code>05-01 18:09:25.487: ERROR/JavaBinder(270): java.lang.ExceptionInInitializerError</code></pre><p>...</p><pre><code>05-01 18:09:25.487: ERROR/JavaBinder(270): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>Am I doing something wrong or is this just impossible ?</p><p>Here is the code of my Service class</p><pre><code>package com.eip.core;import android.app.Service;import android.content.Intent;import android.os.AsyncTask;import android.os.IBinder;import android.os.RemoteException;import android.util.Log;public class NetworkService extends Service {    private final INetwork.Stub mBinder = new INetwork.Stub() {        @Override        public int doConnect(String addr, int port) throws RemoteException {            new ConnectTask().execute(""test42"");            return 0;        }    };    @Override    public IBinder onBind(Intent arg0) {        return mBinder;    }    private class ConnectTask extends AsyncTask&lt;String, Void, Void&gt; {        @Override        protected void onPreExecute() {            super.onPreExecute();            Log.i(""OnPreExecute()"", """");        }        @Override        protected Void doInBackground(String... arg0) {            Log.i(""doInBackground()"", """");            return null;        }        @Override        protected void onPostExecute(Void result) {            super.onPostExecute(result);            Log.i(""OnPostExecute()"", """");        }    }}</code></pre>","290613","","290613","","2010-05-01 16:32:01","2011-11-18 15:35:19","Is it possible to use AsyncTask in a Service class?","<android><multithreading><android-asynctask><ui-thread>","3","0","4","",""
"2750762","1","","","2010-05-01 16:52:29","1","1381","<p>I have successfully gotten JmDNS working on Android 2.1 testing on a Motorola Droid by using MulticastLock, but recently got an HTC Incredible as second test device, and JmDNS discovery doesn't work at all.  I should mention that broadcasting a service still works and everything appears to run normally, but serviceAdded() never gets called.  Does anyone have thoughts on why this might be?  I was thinking it might be a permission issue, but I don't get any exceptions...</p>","323559","","","","","2010-09-22 00:52:18","Why would JmDNS service discovery work on a Motorola Droid running Android 2.1-update1 and not on an HTC Incredible running the same version of Android?","<android><htc><android-sdk-2.1><motorola-droid><jmdns>","1","0","1","",""
"2750798","1","","","2010-05-01 17:02:28","7","28300","<p>I want to align my text at the bottom left in android.</p>","330210","","238849","","2010-05-02 05:40:26","2011-11-11 21:42:57","How to align text in android","<android>","2","2","3","",""
"2750814","1","2751153","","2010-05-01 17:05:29","3","1691","<p>I'm using SurfaceView to draw some stuff using canvas. The problem is that I want to show everything horizontally by default and keep it that way regardless the position of the device. I'm not using any layout XML file to show the SurfaceView; instead I just have a class that extends SurfaceView and I do <code>setContentView(new Panel(this));</code> to show it.</p><p>Thanks for your help.</p>","244296","","","","","2011-01-02 05:17:19","How to make a SurfaceView always horizontal?","<android><position><surfaceview>","1","0","2","",""
"2750835","1","2751088","","2010-05-01 17:11:56","4","5802","<p>Is there a way to get an onButtonDown or onButtonUp event for a soft button (i.e. not a physical hardware button, but a button on the screen)?  I have a button on the screen that I want the user to hold down for X seconds.  To do this I need to capture the buttonDown and buttonUp events separately.</p><p>Thanks,</p><p>Bret</p>","330469","","","","","2010-05-01 18:29:38","ButtonDown and ButtonUp events for Android screen buttons?","<android>","1","0","","",""
"2751117","1","2751438","","2010-05-01 18:37:56","0","130","<p>I have a ListView in my android application.If I flick up/down the ListView, which method will return my 'selected' element in my list View?  How about if I use the track ball to navigate up/down my list view, which method will return the index of my selected element?</p><p>Thank you.</p>","286802","","","","","2010-05-01 20:26:41","android ListView question","<android>","1","0","","",""
"2751309","1","2752136","","2010-05-01 19:28:51","2","2883","<p>I would like to know if somebody knows a library to changing the playback rate of a track in real time. My idea is to load a track and change its playback rate to half or double. Firstly, I tried with MusicPlayer but is was not possible at all and then I tried with SoundPool. The problem is that with SoundPool I can´t change the rate once the track is loaded. Here is the code I am using (proof of concept):</p><pre><code>float j = 1;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button b = (Button)findViewById(R.id.Button01);    b.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            j = (float) (j +.5);        }    });    AssetFileDescriptor afd;    try {        SoundPool sp = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);        afd = getAssets().openFd(""wav/sample.wav"");        int id = sp.load(afd, 1);        sp.play(id, 1, 1, 1, 0, j);    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}</code></pre><p>When I press the button, the playback rate should increase but it does not happen. Any idea of how change the rate in real time?</p><p>Thanks in advance.</p>","241911","","164901","","2010-05-01 19:43:54","2011-12-13 14:31:46","Change the playback rate of a track in real time on Android","<android><signal-processing><playback><sampling>","1","0","1","",""
"2751420","1","","","2010-05-01 20:20:33","2","8685","<p>Has anyone come across a strange behaviour with the Camera API when used on Sony-Ericsson X10 or Droid?</p><p>For example the following code doesn't work on those devices. As a result I'm getting a lot of negative feedback on the Market translating into many cancelled orders...</p><pre><code>mParameters.set(""rotation"", orientation);mParameters.set(""jpeg-quality"", img_quality);mParameters.set(""picture-size"", ""1024x768"");mCamera.setParameters(mParameters);</code></pre><p>Could you suggest an alternative way of achieving the same? Thanks.</p>","224956","","224956","","2010-05-01 21:58:51","2013-08-16 18:07:02","Why Camera.setParameters(Camera.Parameters) does not work on Sony-Ericsson X10 and Droid?","<android><camera>","2","0","1","",""
"2751523","1","2751544","","2010-05-01 21:00:26","6","5751","<p>I have Listpreferences in my app. They don't appear to be setting to their defaults right after installation - they appear to be null. I'm trying to figure out why my default preferences are not being set right after installation. In my main code I have:</p><pre><code>      SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);      InUnits = sp.getString(""List1"", ""defValue"");       InAngs = sp.getString(""List2"", ""defValue"");       OutUnits = sp.getString(""List3"", ""defValue"");       OutAngs = sp.getString(""List4"", ""defValue"");</code></pre><p>Right after the above code executes, each variable contains ""defValue"" instead of the actual values I have assigned in my ListPreference below.</p><p>My preference xml file is called, ""settings.xml"". Here's what one of the ListPreferences there looks like:</p><pre><code>       &lt;ListPreference       android:key=""List1""       android:title=""Input: Alph""       android:summary=""Choose Alph or Ralph""       android:entries=""@array/inputAlph""       android:entryValues=""@array/input_Alph_codes""       android:dialogTitle=""Input Alph""       android:defaultValue=""ININ""/&gt;           </code></pre><p>Here's what some of my strings.xml file looks like:</p><pre><code>&lt;string-array name=""inputUnits""&gt;    &lt;item&gt;Alph&lt;/item&gt;    &lt;item&gt;Ralph&lt;/item&gt;      &lt;/string-array&gt;       &lt;string-array name=""input_Alph_codes""&gt;    &lt;item&gt;ININ&lt;/item&gt;    &lt;item&gt;INMM&lt;/item&gt;    &lt;/string-array&gt;</code></pre><p>When I go to menu, and then settings, I can see my defaults checked (radiobuttoned). Then when I go back from the settings menu to my main screen - all is well - for life! ...then each var above is assigned the proper default value.</p><p>This only happens when I first install my app on the phone. After I go to the settings screen once and then right out of it, the app is fine and accepts any setting changes.</p><p>By the way, as you can see, ""List1"" is the android:key within a file called settings.xml in my res/xml folder.</p>","237863","","","","","2013-09-15 20:07:02","Android: SharedPreference: Defaults not set at startup","<android><android-preferences>","3","2","","",""
"2751732","1","2751754","","2010-05-01 22:14:23","1","3634","<p>I have downloaded Android source code but I don't find the ""Kernel Directory""  in the top level directory of the source code tree. Is it normal ???? or is it missing ???</p><pre><code>/mydroid$ find . -name kernel./bionic/libc/kernel./vendor/htc/sapphire-open/kernel./vendor/htc/dream-open/kernel./dalvik/libcore/luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel./dalvik/libcore/luni-kernel/src/main/java/org/apache/harmony/kernel./prebuilt/android-arm/kernel./prebuilt/android-x86/kernel./device/htc/passion/kernel</code></pre>","1832564","","648313","","2011-07-13 20:59:58","2011-07-13 20:59:58","Android Source Code Tree Structure","<android><android-source>","1","0","2","",""
"2751804","1","2752740","","2010-05-01 22:50:49","0","820","<p>I have the following drawable which draw a rectangle. Can you please tell me how can I add a 9patch image as the background of this drawable?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;stroke android:width=""1dp"" android:color=""#FFFFFFFF"" /&gt; &lt;solid android:color=""@android:color/transparent""/&gt;&lt;/shape&gt;</code></pre><p>Thank you.</p>","286802","","","","","2010-05-02 07:15:05","How to add a 9patch image to a xml drawable","<android>","1","0","1","",""
"2751825","1","2751932","","2010-05-01 23:00:15","8","5498","<p>I have a (hopefully) a relatively simple question. How do I tell Android which layout to use for portrait and which layout to use for landscape orientation on my AppWidget?</p><p>Thanks in advance!</p>","253567","","","","","2011-08-10 09:10:30","Android widget different portrait and landscape orientation","<android><widget><android-widget><screen-orientation>","2","0","","",""
"2751895","1","2752010","","2010-05-01 23:25:45","1","2029","<p>Are content observers persistent in Android?  If I create a content observer in an activity, will that observer continue to run until I remove the observer.  </p><p>Basically I am creating a service for SMS, where on receive and on send I post the SMS out to a web service, so I can check my messages with out having my phone. </p><p>If the content observer is tied to the Activity's life, how can I create a ContentObserver that will always receive notifications on content:/sms/</p>","330599","","","","","2010-05-02 00:13:29","Android Persistent ContentObserver","<android>","1","0","4","",""
"2751958","1","2754251","","2010-05-01 23:45:04","3","4346","<p>I manage media (images, sound) of my app directly, reading and saving to the SD card. Should I be using the MediaStore instead? I'm not quite sure what the MediaStore is for, and the javadoc is not very helpful.</p><p>When should an app use the MediaStore? A brief overview of the pros and cons of the MediaStore will be much appreciated.</p>","143378","","143378","","2010-05-09 18:24:36","2010-05-17 02:26:56","Managing media using the Android MediaStore","<android><media><mediastore>","2","0","1","",""
"2752091","1","","","2010-05-02 00:55:43","2","223","<p>I'm using imagebuttons that play sounds using SoundPool. Here is example code of one of the imagebuttons:</p><p>ImageButton Button1 = (ImageButton)findViewById(R.id.sound);        Button1.setOnTouchListener(new OnTouchListener() {</p><pre><code>        public boolean onTouch(View v, MotionEvent event) {            if (event.getAction() == MotionEvent.ACTION_DOWN ) {                mSoundManager.playSound(1);                return false;            }            return false;        }    });</code></pre><p>For some reason, it doesn't allow you to click multiple buttons at the same time. Is it because I'm building for 1.6 SDK?</p><p>Thanks!</p>","313717","","","","","2010-12-11 18:27:49","Why isn't multi-touch working for my imagebuttons?","<android>","1","1","1","",""
"2752094","1","2752190","","2010-05-02 00:56:09","2","1289","<p>I've started working on some Android applications and have a question regarding how people normally deal with situations where you have a static data set and have an application where that data is needed in memory as one of the standard java collections or as an array.</p><p>In my current specific issue i have a spreadsheet with some pre-calculated data.  It consists of ~100 rows and 3 columns.  1 Column is a string, 1 column is a float, 1 column is an integer.  I need access to this data as an array in java.</p><p>It seems like i could:</p><p>1) Encode in XML - This would be cpu intensive to decode in my experience.</p><p>2) build into SQLite database - seems like a lot of overhead for static access to data i only need array style access to in ram.</p><p>3) Build into binary blob and read in.  (never done this in java, i miss void *)</p><p>4) Build a python script to take the CSV version of my data and spit out a java function that adds the values to my desired structure with hard coded values.</p><p>5) Store a string array via androids resource mechanism and compute the other 2 columns on application load.  In my case the computation would require a lot of calls to Math.log, Math.pow and Math.floor which i'd rather not have to do for load time and battery usage reasons.</p><p>I mostly work in low power embedded applications in C and as such #4 is what i'm used to doing in these situations.</p><p>It just seems like it should be far easier to gain access to static data structures in java/android.  </p><p>Perhaps I'm just being too battery usage conscious and in my single case i imagine the answer is that it doesn't matter much, but if every application took that stance it could begin to matter. </p><p>What approaches do people usually take in this situation? Anything I missed?</p>","113892","","","","","2010-05-02 18:19:18","Static Data Structures on Embedded Devices (Android in particular)","<java><android><data-structures><static>","3","0","2","",""
"2752319","1","2752749","","2010-05-02 03:13:18","13","6825","<p>I know calling finish() in activity will produce same result as if user clicked on Back button; is there a similar thing for Home button? (would like to automatically show Home screen after certain action).</p><p>EDIT: Also, I would appreciate same thing for Menu &amp; Search buttons.</p><p>Thanks!</p>","237858","","237858","","2010-05-05 21:22:41","2012-07-02 22:10:42","Android - Simulate Home click","<android>","3","0","4","",""
"2752472","1","","","2010-05-02 04:43:24","66","98209","<p>I wanted to print the value of a variable on the console for my debugging purpose but system.out.println doesnt work. Please help</p>","330674","","1234563","","2012-09-10 07:54:22","2014-01-05 04:15:45","Android: How can i print a variable on eclipse console","<android><android-logcat>","9","2","18","",""
"2752555","1","2752627","","2010-05-02 05:40:35","0","578","<p>I am trying to build a layout dynamically which display some text and image for the most part, but has a series of buttons placed next to each other in the bottom. </p><p>I have a linear layout that carries the text, another linear layout that carries the image. And yet another linear layout that carries the buttons that get created in a for loop. I have a main layout aligned vertical that adds the text, image and buttons layout, in that order. To finally generate something like this:</p><p>Text ....Image ...Button1 Button2 Button3....</p><p>The problem is the number of buttons get decided at runtime, so if there are more than 4 buttons, the 5th button gets displayed really tiny. Also, when I tilt the phone, I get only the text and image showing, but no buttons coz the image covers the entire screen. </p><p>Layoutting seems to be pretty complicated to me, any help is appreciated!</p><p>ThanksGeorge</p>","321927","","","","","2010-05-02 06:15:30","Linear Layout Issue at Runtime","<android><dynamic><layout><runtime><linear>","1","2","","",""
"2752707","1","2753074","","2010-05-02 06:57:27","2","8802","<p>I want to set up some menu-like navigator for my app. </p><p>There is a listView in the main page and it contains two items, click each one will show its child view with ViewFlipper, and if user clicked the back button, he will return to the homepage again.</p><p>The question is how to make it, I can only use ViewFlipper to flip to next screen or prev screen, how to manage these child views here? How to put them in my layout xml file?</p>","238061","","","","","2013-01-16 11:44:25","How to use a ListView and a ViewFlipper to navigate user in an Android app?","<android><layout><menu><navigation><viewflipper>","1","0","2","",""
"2752924","1","","","2010-05-02 08:59:20","9","24253","<p>I have been working on creating a Grid View of images, with images being present in the Assets folder. <a href=""http://stackoverflow.com/questions/1933015/opening-an-image-file-inside-the-assets-folder"">http://stackoverflow.com/questions/1933015/opening-an-image-file-inside-the-assets-folder</a> link helped me with using the bitmap to read it. The code am currently having is:</p><pre><code> public View getView(final int position, View convertView, ViewGroup parent) {  try     {     AssetManager am = mContext.getAssets();     String list[] = am.list("""");     int count_files = imagelist.length;     for(int i= 0;i&lt;=count_files; i++)     {      BufferedInputStream buf = new BufferedInputStream(am.open(list[i]));      Bitmap bitmap = BitmapFactory.decodeStream(buf);      imageView.setImageBitmap(bitmap);      buf.close();     }   }      catch (IOException e)    {   e.printStackTrace();   }  }</code></pre><p>My application does read the image from the Assets folder, but it is not iterating through the cells in the grid view. All the cells of the grid view have a same image picked from the set of images. Can anyone tell me how to iterate through the cells and still have different images ?</p><p>I have the above code in an ImageAdapter Class which extends the BaseAdapter class, and in my main class I am linking that with my gridview by:</p><pre><code>    GridView  gv =(GridView)findViewById(R.id.gridview);    gv.setAdapter(new ImageAdapter(this, assetlist));       </code></pre><p>Thanks a lot for any help in advance,Saran</p>","330712","","1023248","","2012-08-04 10:47:58","2012-12-17 17:22:11","Android - Images from Assets folder in a GridView","<android><image><android-gridview>","2","2","5","",""
"2753192","1","2765816","","2010-05-02 10:49:13","0","597","<p>I've configured a local service under an app.</p><p>I want to know how I could invoke methods on the activity, through the service, in a synchronous way.</p><p>For example, the service invokes a method in the activity and waits for a result (synchronously) from it.</p>","260511","","496830","","2011-03-09 02:23:16","2011-03-09 02:40:13","How can a local service invoke a synchronous method on its main activity?","<android>","2","1","","",""
"2753412","1","2753547","","2010-05-02 12:14:16","7","16707","<p>I'm new to Android development and working on an Android application that requires the phone to be connected to the internet, through either Wifi, EDGE or 3G.</p><p>This is the code that I'm using to check whether an internet connection is available</p><pre><code>public static boolean isConnected(){    ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);    return cm.getActiveNetworkInfo().isConnectedOrConnecting();}</code></pre><p>I've also set these 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_NETWORK_STATE"" /&gt;</code></pre><p>This works fine in the emulator running version 1.5 of Android when 3G is enabled, but it crashes when I disable the 3G connection. My application throws a null pointer exception when I call isConnectedOrConnecting(). The same thing also happens on my HTC Desire running Android 2.1.</p><p>Hope that anyone knows the solution to this. </p><p>Thanks in advance!</p>","109097","","109097","","2010-05-02 13:05:20","2012-12-21 13:08:50","Android internet connectivity check problem","<android><internet>","5","0","2","",""
"2753466","1","4439973","","2010-05-02 12:41:01","1","735","<p>I have a basic soap service running on glassfish, that returns <code>List&lt;String&gt;</code> like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;S:Envelope xmlns:S=""http://schemas.xmlsoap.org/soap/envelope/""&gt;    &lt;S:Body&gt;        &lt;ns2:getNamesResponse xmlns:ns2=""http://namespace/""&gt;            &lt;return&gt;Name1&lt;/return&gt;            &lt;return&gt;Name2&lt;/return&gt;        &lt;/ns2:getNamesResponse&gt;    &lt;/S:Body&gt;&lt;/S:Envelope&gt;</code></pre><p>now in ksoap2 (android) I have to iterate the soap-object properties to get my list back:</p><pre><code>SoapObject result = (SoapObject) envelope.bodyIn;for(int i=0;i&lt;result.getPropertyCount();i++){    list.add(result.getProperty(i));}</code></pre><p>is there a better way? I couldn't find any class mapper in my implementation.</p><p>thanks in advance</p>","178341","","","","","2010-12-14 14:05:01","KSoap2 list handling - is this the correct way?","<android><ksoap2>","1","0","","",""
"2753566","1","","","2010-05-02 13:18:10","0","2600","<p>I'm trying the <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">Hello MapView Tutorial</a> at the moment. Whe I launch the program in the emulator, I get a huge number of errors (none of the exceptions seems to be related with lines in my code). The emulator window tells the program ""stopped unexpectedly"". Can anybody tell me which is the key line in the error output? What do I have to change?</p><pre><code>05-02 15:04:57.195: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)05-02 15:04:57.195: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)05-02 15:04:57.195: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)05-02 15:04:57.195: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)05-02 15:05:10.659: ERROR/MemoryHeapBase(51): error opening /dev/pmem: No such file or directory05-02 15:05:10.659: ERROR/SurfaceFlinger(51): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake05-02 15:05:10.699: ERROR/libEGL(51): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)05-02 15:05:11.403: ERROR/libEGL(62): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/usb/online'05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/battery/batt_vol'05-02 15:05:14.775: ERROR/BatteryService(51): Could not open '/sys/class/power_supply/battery/batt_temp'05-02 15:05:15.148: ERROR/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter05-02 15:05:15.148: ERROR/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter05-02 15:05:15.282: ERROR/System(51): Failure starting core service05-02 15:05:15.282: ERROR/System(51): java.lang.SecurityException05-02 15:05:15.282: ERROR/System(51):     at android.os.BinderProxy.transact(Native Method)05-02 15:05:15.282: ERROR/System(51):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)05-02 15:05:15.282: ERROR/System(51):     at android.os.ServiceManager.addService(ServiceManager.java:72)05-02 15:05:15.282: ERROR/System(51):     at com.android.server.ServerThread.run(SystemServer.java:162)05-02 15:05:15.302: ERROR/AndroidRuntime(51): Crash logging skipped, no checkin service05-02 15:05:17.012: ERROR/LockPatternKeyguardView(51): Failed to bind to GLS while checking for account05-02 15:05:21.795: ERROR/ActivityThread(100): Failed to find provider info for com.google.settings05-02 15:05:21.819: ERROR/ActivityThread(100): Failed to find provider info for com.google.settings05-02 15:05:25.872: ERROR/ApplicationContext(51): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml05-02 15:05:28.923: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)05-02 15:05:26.879: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin05-02 15:05:30.211: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin05-02 15:05:30.430: ERROR/ActivityThread(97): Failed to find provider info for android.server.checkin05-02 15:05:32.463: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound05-02 15:05:32.489: ERROR/MediaPlayer(51): Unable to to create media player05-02 15:05:34.783: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings05-02 15:05:34.783: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings05-02 15:05:35.359: ERROR/AndroidRuntime(201): Uncaught handler: thread main exiting due to uncaught exception05-02 15:05:35.395: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to instantiate activity     ComponentInfo{org.diretto.client.smartphone.android/org.diretto.client.smartphone.android.ShowMap}: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af9005-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.os.Handler.dispatchMessage(Handler.java:99)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.os.Looper.loop(Looper.java:123)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.main(ActivityThread.java:4203)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at java.lang.reflect.Method.invokeNative(Native Method)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at java.lang.reflect.Method.invoke(Method.java:521)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at dalvik.system.NativeStart.main(Native Method)05-02 15:05:35.395: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassNotFoundException: org.diretto.client.smartphone.android.ShowMap in loader dalvik.system.PathClassLoader@4376af9005-02 15:05:35.395: ERROR/AndroidRuntime(201):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)05-02 15:05:35.395: ERROR/AndroidRuntime(201):     ... 11 more05-02 15:05:35.527: ERROR/dalvikvm(201): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre>","330816","","","","","2010-05-02 14:15:17","Android ""application stopped unexpectedly"" - google Hello MapView Tutoria","<java><android>","1","0","","",""
"2753659","1","","","2010-05-02 13:49:48","1","3131","<p>I have two buttons that both have onTouchListeners and perform an action when pressed down. Why do they not work if you try to click both at the same time? I'm building for Android 1.6. I don't have a real device to test on, and you can't test clicking two things at the same time in the emulator. Thanks for any help.</p>","313717","","","","","2012-03-04 23:08:32","Click two buttons at the same time in Android","<android>","3","0","","",""
"2753929","1","","","2010-05-02 15:26:39","0","1156","<pre><code>    HttpClient client = new DefaultHttpClient();    String data = ""valid SOAP REquest"";     </code></pre><p>HttpPost httpPost = new HttpPost(""valid url"");        Log.d(""inside"", ""created http post"");        try {              ByteArrayInputStream baos = new ByteArrayInputStream(data.getBytes());</p><pre><code>        Log.d(""inside"", ""firing request..."");        HttpResponse httpResponse = client.execute(httpPost);        Log.d(""inside"", ""request sent"" + httpResponse.getStatusLine().getStatusCode());</code></pre><p>Always, I get the status code as 405. I tried request queue as well.. sneding the byte array as part of the request queue, still the same issue.</p>","330266","","","","","2010-05-02 16:03:50","Android : HTTP Post Issue","<android>","1","2","","",""
"2753943","1","","","2010-05-02 15:30:55","4","23724","<p>I'm trying to play a sound file when a button is clicked but keeps getting an error.</p><p>The error is:</p><pre><code> ""The method create(Context, int) in the type MediaPlayer is not applicable for the arguments (new View.OnClickListener(){}, int)""</code></pre><p>Here's my code:</p><pre><code>@Overridepublic void onClick(View v) {    // TODO Auto-generated method stub    Button zero = (Button)this.findViewById(R.id.btnZero);    zero.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            mp = MediaPlayer.create(this, R.raw.mamacita_zero);        }    });}</code></pre><p>Any help or tips would be appreciated.Thnx!</p>","294118","","1722596","","2013-06-12 10:36:30","2013-12-21 19:01:31","How to Play sound when button is clicked in Android?","<android>","4","0","4","",""
"2754052","1","","","2010-05-02 16:08:15","1","795","<p>I am currently developing an android app in eclipse using:</p><ul><li>One project for the app</li><li>One project for the tests (Instrumentation and Pojo tests)</li></ul><p>In the test project, I am importing the mockito library for standard POJO testing.However, when I import the library, the compilation time skyrockets from 1 second to about 30 seconds in eclipse. The cause seems to be that the whole library is converted each time. So basically, each time a make a modification that I want to test, I have to wait 30 seconds.</p><p>The only workarounds that I have found so far would be:</p><ul><li>Disable ""Build Automatically""</li><li>Create a project that includes only pojo tests and put mockito only there.</li><li>Use another library that compiles faster (e.g. easymock)</li></ul><p>Any other suggestion?</p>","2011","","","","","2010-12-17 10:42:12","Speed up compilation with mockito on Android","<java><android><eclipse><mockito><dalvik>","1","0","1","",""
"2754124","1","","","2010-05-02 16:35:58","1","2918","<p>Team, </p><p>I would like to know how to display a List View or SPinner using key and value pairs in Android platform. For example take Contacts Contact has id, First Name, LastName, i would like to display First Name and Last Name in the list view or  in the spinner, </p><p>id1, lastname1, firstname1id2, lastname2, firstname2id3, lastname3, firstname3</p><p>Once the user selected any value in the List view or spin list, I need to get the key value from the List view or spinner. </p><p>How to do it? </p><p>Any help or examples is greatly appreciated.</p><p>Thanks, Ramesh</p>","330266","","","","","2011-11-05 12:32:28","Android : List View or SPinner","<android>","1","0","","",""
"2754204","1","2754393","","2010-05-02 17:02:46","1","910","<p>I am creating a replacement Car Home app for Android 2.0+ devices. The app needs to launch when the phone is inserted into the car dock, as well as terminate when it is removed from the dock. It also needs to be able to be launched from the app drawer. </p><p>I'm having a problem right now where once the phone is inserted and removed from the dock, I can no longer launch the app from the app drawer because every time I launch the app my BroadcastReceiver picks up a DOCK_EVENT action for some reason. I created a test project that only registers my BroadcastReceiver, and the same thing happens. </p><p>Here's the code for the BroadcastReceiver:</p><pre><code>public class CarDockBroadcastReceiver extends BroadcastReceiver {/** * @see android.content.BroadcastReceiver#onReceive(Context,Intent) */@Overridepublic void onReceive(Context context, Intent intent) {    // TODO Put your code here    if(intent.getExtras().containsKey(""android.intent.extra.DOCK_STATE"")){        int state = intent.getExtras().getInt(""android.intent.extra.DOCK_STATE"",1);        if(state == 0){            Log.i(""Dock"", ""Removed from dock!"");                ((Activity)context).finish();        }    }}</code></pre><p>}</p><p>My main Activity is as follows:</p><pre><code>public class MainActivity extends Activity {/** Called when the activity is first created. */CarDockBroadcastReceiver receiver;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    IntentFilter filter = new IntentFilter(""android.intent.action.DOCK_EVENT"");    receiver = new CarDockBroadcastReceiver();    registerReceiver(receiver, filter);}@Overrideprotected void onDestroy() {    // TODO Auto-generated method stub    unregisterReceiver(receiver);    super.onDestroy();}</code></pre><p>}</p><p>The main Activity has an intent filter for action.MAIN, category.LAUNCHER, category.DEFAULT, and category.CAR_DOCK. Any ideas on why this is happening?</p>","316836","","","","","2011-05-30 09:29:03","App will not launch from drawer after phone is removed from car dock","<android><dock><intentfilter>","1","0","","",""
"2754362","1","","","2010-05-02 17:50:42","0","426","<p>I am a new android developer, just tried something with Android Tablayout.</p><p>There are two tabs and one tab has a GridView and the other one has a DatePicker. I created an activity and layout for each tab.</p><p>The problem is that when I switch to the gridView, the background is not refreshed, and the images are just drawn over the DatePicker, so through images, the DatePicker still can be seen. It really bothers me.</p><p>What should I do to have a clean background for imageView?</p><p>Steve</p>","330915","","276052","","2010-05-02 18:19:04","2010-05-02 20:45:40","Issue with android tablayout switch tab","<android>","1","0","","",""
"2754596","1","2767885","","2010-05-02 19:04:02","2","569","<p>I was checking out the Google Maps Data API and I was wondering if I can follow their <a href=""http://code.google.com/apis/maps/documentation/mapsdata/developers_guide_java.html"" rel=""nofollow"">Java Development guide</a> to use it on the Android platform? I want to display routes that I have created on Google Maps on the phone.</p><p>Ideally this would be through a MapView but if I need to do it a different way I could. </p><p>Thanks,Rob</p><p>EDIT: I feel that my question is probably a little too open ended. I don't completely understand how the Google Data API works with Google Maps. Hopefully someone can point me in the right direction but if anyone thinks that this is a bad question let me know so I can delete it. </p>","289153","","289153","","2010-05-02 21:16:53","2010-05-04 18:18:07","Using Google Map Data API on the Android platform","<android><google-maps><google-api><google-data-api>","1","0","","",""
"2754847","1","2755063","","2010-05-02 20:27:41","3","3322","<p>I defined a local Service:</p><pre><code>public class ComService extends Service implements IComService {    private IBinder binder = new ComServiceBinder();    public class ComServiceBinder extends Binder implements IComService.IServiceBinder {        public IComService getService() {            return ComService.this;        }    }    public void test(String msg) {        System.out.println(msg);    }    @Override    public IBinder onBind(Intent intent) {        return binder;    }    }</code></pre><p>The corresponding interface:</p><pre><code>public interface IComService {    public void test(String msg);    public interface IServiceBinder {        IComService getService();    }}</code></pre><p>Then i try to bind the service in another activity in another application, where the same interface is available:</p><pre><code>bindService(new Intent(""ch.ifi.csg.games4blue.gamebase.api.ComService""), conn, Context.BIND_AUTO_CREATE);</code></pre><p>and </p><pre><code>private ServiceConnection conn = new ServiceConnection() {    @Override    public void onServiceConnected(ComponentName name, IBinder service) {        Log.i(""INFO"", ""Service bound "" + name);        comService = ((IComService.IServiceBinder)service).getService();        serviceHandler.sendEmptyMessage(0);    }    @Override    public void onServiceDisconnected(ComponentName arg0) {        Log.i(""INFO"", ""Service Unbound "");    }};</code></pre><p>but the line</p><pre><code>comService = ((IComService.IServiceBinder)service).getService();</code></pre><p>always throws a </p><pre><code>05-02 22:12:55.922: ERROR/AndroidRuntime(622): java.lang.ClassCastException: android.os.BinderProxy</code></pre><p>I can't explain why, I followed the app sample on <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html</a></p><p>Any hints would be nice!</p>","","anon","157882","","2010-05-02 20:31:28","2010-05-02 21:25:30","ClassCastException while using service","<java><android>","1","0","","",""
"2754890","1","2755166","","2010-05-02 20:42:13","0","496","<p>I really like the look and feel of the Preference UI items and want to replicate that in my application.  Basically I've got an Activity with a couple LinearLayouts set to be focusable.  When they are focused, I want them to turn green (like Preferences do).  Any idea how to apply that style to my LinearLayouts?</p><p>Note: The LinearLayouts are essentially going to be clickable 'buttons' to launch a separate activity.  They are NOT actual preferences or buttons, although they need to look/act similar to them.)</p>","158766","","","","","2010-05-02 21:57:05","Emulating Preference look/feel with LinearLayout","<android><views><android-widget><android-preferences>","1","0","","",""
"2755005","1","3505068","","2010-05-02 21:11:17","8","2220","<p>I have a preference screen for my application and in the manifest I have given it a theme using:</p><pre><code>android:theme=""@android:style/Theme.Light.WallpaperSettings""</code></pre><p>However when I nest another preference screen inside this one such as:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""    android:title=""@string/setting_title""    android:key=""...""&gt;    &lt;PreferenceCategory    android:title=""@string/title_themes""    &gt;    &lt;PreferenceScreen    android:title=""@string/title_themes_opt""    &gt;        &lt;ListPreference    android:key=""Setting_BG""    android:title=""@string/setting_bg""    android:summary=""@string/setting_bg_summary""    android:entries=""@array/bg_titles""    android:defaultValue=""0""    android:entryValues=""@array/bg_values"" /&gt;    &lt;/PreferenceScreen&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>The nested preference screen loses the theme of the parent. How can this be prevented? Thanks in advance.</p>","315998","","","","","2010-09-29 22:23:57","Nested preference screens lose theming","<android><preferences><preferencescreen>","2","0","1","",""
"2755064","1","2755198","","2010-05-02 21:26:13","0","1942","<p>I am trying to create a drawable in code and change the color based on some criteria. When I try and set the Drawable as the background of the ImageView it displays but won't let me set any padding. I realized I need to set the ImageView image via the setImageDrawable() function in order to be able to set the padding. </p><p>The problem I am running into is that when I set it via the setImageDrawable() function nothing is displayed. </p><p>Here is what I have written:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><p></p><p></p><p></p><pre><code>            ImageView icon = (ImageView) row.findViewById(R.id.icon);  ShapeDrawable mDrawable;  int x = 0;     int y = 0;     int width = 50;     int height = 50;     float[] outerR = new float[] { 12, 12, 12, 12, 12, 12, 12, 12 };     mDrawable = new ShapeDrawable(new RoundRectShape(outerR, null, null));     mDrawable.setBounds(x, y+height, x + width, y);  switch(position){  case 0:   mDrawable.getPaint().setColor(0xffff0000);  //Red   break;  case 1:   mDrawable.getPaint().setColor(0xffff0000);  //Red   break;  case 2:   mDrawable.getPaint().setColor(0xff00c000);  //Green   break;  case 3:   mDrawable.getPaint().setColor(0xff00c000);  //Green   break;  case 4:   mDrawable.getPaint().setColor(0xff0000ff);  //Blue   break;  case 5:   mDrawable.getPaint().setColor(0xff0000ff);  //Blue   break;  case 6:   mDrawable.getPaint().setColor(0xff696969);  //Gray   break;  case 7:   mDrawable.getPaint().setColor(0xff696969);  //Gray   break;  case 8:   mDrawable.getPaint().setColor(0xffffff00);  //Yellow   break;  case 9:   mDrawable.getPaint().setColor(0xff8b4513);  //Brown   break;  case 10:   mDrawable.getPaint().setColor(0xff8b4513);  //Brown   break;  case 11:   mDrawable.getPaint().setColor(0xff8b4513);  //Brown   break;  case 12:   mDrawable.getPaint().setColor(0xffa020f0);  //Purple   break;  case 13:   mDrawable.getPaint().setColor(0xffff0000);  //Red   break;  case 14:   mDrawable.getPaint().setColor(0xffffd700);  //Gold   break;  case 15:   mDrawable.getPaint().setColor(0xffff6600);  //Orange   break;  }     icon.setImageDrawable(mDrawable);     icon.setPadding(5, 5, 5, 5);</code></pre><p>This results in a space for the ImageView but no image. </p><p>Thanks, Rob</p>","289153","","","","","2010-05-02 22:06:02","Setting an ImageView resource as a Drawable","<android><android-layout><android-image>","1","0","","",""
"2755076","1","2755324","","2010-05-02 21:29:57","0","1660","<p>Inside </p><pre><code>public class IAmHere extends Activity implements LocationListener {</code></pre><p>i have</p><pre><code>@Overridepublic void onLocationChanged(Location location) {    // TODO Auto-generated method stub}@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>and</p><p>inside </p><pre><code> public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.iamhere);</code></pre><p>i have</p><pre><code>LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        List&lt;String&gt; providers = lm.getProviders(true);      /* Loop over the array backwards, and if you get an accurate location, then break out the loop*/       Location l = null;      for (int i=providers.size()-1; i&gt;=0; i--) {              l = lm.getLastKnownLocation(providers.get(i));              if (l != null) break;          }        double[] gps = new double[2];        if (l != null) {            gps[0] = l.getLatitude();            gps[1] = l.getLongitude();        }        gpsString = (TextView)findViewById(R.id.gpsString);  String Data = """";   String koordinata1 = Double.toString(gps[0]);  String koordinata2 = Double.toString(gps[1]);  Data = Data + koordinata1 + "" | "" + koordinata2 + ""\n"";  gpsString.setText(String.valueOf(Data));</code></pre><p>but seems it's not working? Why? I mean even emulator doesn't want to send GPS data - When I click ""send"" via UI or console, nothing happens...?</p><p>Thank you.</p>","455268","","","","","2010-05-02 22:48:34","Getting GPS data?","<android><gps>","1","0","1","",""
"2755096","1","2755114","","2010-05-02 21:36:01","2","1215","<p>I'm just wondering if it would be possible (and legal) to port an Android app to desktop?I'm creating an android game that would work well on PC too (even with the cellphone like layout) and was thinking that maybe I could 'embed' an android emulator with an installer or would that process be a bit hard for a novice Java coder?</p>","152986","","","","","2012-01-12 14:02:25","Port Android App to Desktop?","<android>","2","1","","",""
"2755277","1","","","2010-05-02 22:32:04","20","13821","<p>I have a problem, how do I disable all toast messages being process currently?</p><p>In my App, there is a list, when a user clicks on an item, a toast message is being displayed,10 items - 10 toast messages,</p><p>so if the user clicks 10 times, then presses the menu button... he has to wait for some seconds, until he's able to read the menu option text.</p><p>shouldn't be like that :)</p>","331015","","1226310","","2012-05-01 21:35:45","2013-07-31 12:35:52","Android - Hide all showed Toast Messages","<android><hide><messages><toast>","8","0","8","",""
"2755290","1","2755474","","2010-05-02 22:37:06","2","523","<p>I have an Activity with a list that is bound to a ListAdapter reading data into a ArrayList from a database. All is well when the data is first loaded. While the Activity is open and the list is being displayed it is possible and likely that the data in the database will be updated by a service but the list does not reflect the changes because the ArrayList does not know about the changes. If the Activity is no longer in the foreground as would be the case if the user goes to the home screen and then is brought back to the foreground I would like for the Activity to not display what it did prior but rather reload the data using the ListAdapter the view is bound to. I think something needs to call finish() but I am not sure what. This is what I have in the Activity.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);setUpViews();app = (MyApplication) getApplication();adapter = new MyListAdapter(this, app.getMyEvents());setListAdapter(adapter);}@Overrideprotected void onResume() {super.onResume();adapter.forceReload();}</code></pre>","312443","","","","","2010-05-02 23:42:51","Prevent Activity from saving state when user selects back button","<android><activity>","1","0","0","",""
"2755344","1","","","2010-05-02 22:56:55","0","383","<p>I have downloaded the Android source code on my computer using the repo sync command. Since I have no experience with git and repo , I would like to know if it is possible to copy the mydroid directory (which contains Android source code) to an other computer by just burning it on a DVD and then processing the build without problems.</p><p>Thanks in advance and sorry if my question is stupid</p>","1832564","","","","","2010-05-02 23:00:04","Copying Android source code directory from one computer to an other one","<android><git>","2","0","","",""
"2755358","1","","","2010-05-02 23:01:01","2","405","<p>I'm testing some Java code that uses an android Bundle, and am getting a runtime exception whenever I create a Bundle in the unit test. The error I'm getting is java.lang.runtimeException at android.os.Bundle when I create the Bundle. It is running with the android SDK in the run configuration.Has anyone run into this problem before?Thanks!</p>","63477","","","","","2010-05-02 23:01:01","Runtime exception when creating Bundle in JUnit test","<java><android><junit>","0","1","","",""
"2755446","1","","","2010-05-02 23:31:49","19","41992","<p>I'm working with my friend on our first Android game. Basic idea is that every frame of the game the whole surface is redrawn (1 large bitmap) in 2 steps:</p><ol><li>Background with some static image (PNG) wipes out previous frame</li><li>Then it is sprinkled all over with large number of particles which produces effect of soapy bubbles where there's a pool of about 20 bitmaps which randomly gets picked to produce illusion that all bubbles (between 200 - 300) are all different. Bubbles positions updated on each frame (~50ms) producing effect of moving bubbles.</li></ol><p>The math engine is in C (JNI) and currently all drawing is done using android.graphics package very similar (since that was the example I was using) to Lunar Lander.It works but animation is somewhat jerky and I can feel by temperature of my phone that it is very busy. Will we benefit from switching to OpenGL? And as a bonus question: what would be a good way to optimize the drawing mechanism (Lunar Lander like) we have now? </p>","135946","","135946","","2010-05-03 01:15:33","2013-09-19 15:47:47","Android: 2D. OpenGl or android.graphics?","<android><animation><opengl-es><2d>","2","0","19","",""
"2755470","1","2755661","","2010-05-02 23:42:18","2","569","<p>I'm trying to develop an external library (not sure if that's the right term) to provide prepackaged functionality in Android projects. Working in Eclipse, I've added the appropriate android.jar file to the build path, and everything is happy both while editing and upon compilation.</p><p>However, when I use Android's Handler and Message classes (android.os.Handler, android.os.Message) for inter-thread communication, I get exceptions unless I'm running within an Android app, on the emulator or a device. I can no longer test my library in a ""standalone"" way without having to go through a running Android target.</p><p>Is there any way for me to include these two Android classes and still be able to test my library standalone? Do I need to have the Android source available? Or would it require some sort of conditional compilation hand-waving?</p>","263607","","","","","2014-02-26 11:40:55","Can I use android.os.* libraries in a standalone project?","<java><android><android-emulator><android-source>","2","0","","",""
"2755598","1","2759544","","2010-05-03 00:28:57","5","804","<p>Can somebody explain to me the difference between the project target and the minimum SDK? I want my app to run on Donut devices, and the APK I built with a target of 7 worked just fine. When I set an explicit minimum SDK in the Android manifest of 4 (1.6) the compiler bitched at me that the target exceeded the minimum. I reset the target to 4 only to see what would happen, and now I've got compiler errors. An example is the START_NOT_STICKY constant in android.app.Service. It doesn't exist in API level 4, but does exist in API level 7. This is also the case with Service.onStartCommand(). In API level 7 you need to explicity override this method, whereas in API level 4 you don't.</p><p>So why does the app work in 1.6 despite all this? How could 1.6 know how to use SERVICE_NOT_STICKY when the associated API level doesn't know about it?</p>","110539","","","","","2010-05-03 16:28:10","What is the purpose of both target API and minSDK","<android>","1","0","3","",""
"2755787","1","","","2010-05-03 02:02:39","3","929","<p>I have an app fetch data from internet, for better performance and bandwidth, I need to implement a cache layer.</p><p>There are two different data coming from the internet, one is changing every one hour and another one does not change basically. So for the first type of data, I need to implement an expire policy to make it self deleted after it was created for 1 hour, and when user request that data, I will check the storage first and then goto internet if nothing found.</p><p>I thought about using a SharedPrefrence or SQLDatabase to store the json data or serialized object string. </p><p>My question is:</p><p>1) What should I use, SharedPrefrence  or SQLDatabase or anything else, a piece of data is not big but there are maybe many instances of that data.</p><p>2) How to implement that expire system.</p>","238061","","","","","2010-05-03 03:27:18","How to cache and store objects and set an expire policy in android?","<android><performance><caching><storage>","2","0","3","",""
"2756097","1","","","2010-05-03 04:22:13","2","956","<p>In Android, when an alert appears, the background is dimmed. I would like a similar effect for when the menu is opened. I tried the following code, but it didn't work:</p><pre><code>@Overridepublic boolean onMenuOpened(int featureId, Menu m) {    boolean ret=super.onMenuOpened(featureId,m);    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);    return ret;}</code></pre><p>Does anyone know how to achieve this?</p>","165495","","","","","2010-06-29 22:23:05","Dim Window when Menu opened in Android","<android>","1","0","","",""
"2756122","1","","","2010-05-03 04:34:03","0","1056","<p>I am trying to get this code to run, but I get an IllegalStateException when I run this code saying that the content of the listview wasn't notified, yet I have a notification upon updating the data.  This is a custom listview adapter.  Here is the relevant part of my code:</p><pre><code>class LoadingThread extends Thread {    public void run() {        int itemsOriginallyLoaded = 0;        synchronized( items ) {            itemsOriginallyLoaded = items.size();        }        for( int i = itemsOriginallyLoaded ; i &lt; itemsToLoad ; ++i ) {            Log.d( LOG_TAG, ""Loading item #""+i );            //String item = ""FAIL"";            //try {            String item = ""FAIL"";            try {                item = stockGrabber.getStockString(dataSource.get(i));            } catch (ApiException e) {                Log.e(LOG_TAG, ""Problem making API request"", e);            } catch (ParseException e) {                Log.e(LOG_TAG, ""Problem parsing API request"", e);            }            //} catch (ApiException e) {            //  Log.e(TAG, ""Problem making API request"", e);            //} catch (ParseException e) {            //  Log.e(TAG, ""Problem parsing API request"", e);            //}            synchronized( items ) {                items.add( item );            }            itemsLoaded = i+1;            uiHandler.post( updateTask );            Log.d( LOG_TAG, ""Published item #""+i );        }        if( itemsLoaded &gt;= ( dataSource.size() - 1 ) )            allItemsLoaded = true;        synchronized( loading ) {            loading = Boolean.FALSE;        }    }}class UIUpdateTask implements Runnable {    public void run() {        Log.d( LOG_TAG, ""Publishing progress"" );        notifyDataSetChanged();    }}</code></pre>","331121","","","","","2011-03-09 02:04:56","How to fix IllegalStateException error when trying to update a listview?","<java><android>","3","0","","",""
"2756282","1","","","2010-05-03 05:31:38","1","591","<p>I want to create panorama view with opengl in Android. Is it possible using spherical view and centering viewpoint at the sphere center to show bounded image on screen? Will this be a good aproach? I haven't used opengl but want to achive this effect in Android. Am I going in right direction? Any pointers for this will be great help.</p><p>Thanks in advance.</p>","331144","","235654","","2010-05-03 15:27:21","2010-05-03 15:27:21","How to center viewport at center of the sphere","<android><opengl-es><panoramic>","0","3","1","",""
"2756375","1","","","2010-05-03 06:07:35","0","677","<p>I have an android app that periodically, say once a week downloads content from a server in XML. The content is used by the app, different Acitivities use different parts of the content.</p><p>My question is a design one, should I save the data in SQlite or just keep it as an XML file, which one would be faster to read? </p><p>The app can only use one content piece at a time, which means subsequent XML content downloads replace the old one.</p>","100666","","","","","2010-05-03 08:59:57","Help me choose between XML or SQL Lite on android","<xml><android><performance><sqlite>","1","0","","",""
"2756409","1","2756820","","2010-05-03 06:17:09","0","16244","<p>After implementing some Android Apps, including several Map activities, I try to refresh the activity when the GPS listener's onLocationChanged() method is called.</p><p>I have no idea how to tell the map activity to refresh on its own and display the new coords...</p><p>The coords to store will have to be in global values, so that the location listener will have access to it.</p><p>In my sample GPS-class (see code below) I just changed the text of a text view....but how to do that in map view?</p><pre><code>private class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        final TextView tv = (TextView) findViewById(R.id.myTextView);        if (loc != null) {            tv.setText(""Location changed : Lat: "" + loc.getLatitude()                            + "" Lng: "" + loc.getLongitude());        }    }</code></pre><p>I think the solution of this Problem won't be very difficult, but I just need the beginning ;-)</p><p>This whole app shall work like a really simple navigation system.</p><p>It would be great if someone could help me a little bit further :)</p>","317301","","759866","","2013-11-08 09:54:06","2013-11-08 09:54:06","How to refresh an activity? Map View refresh fails","<java><android><map><activity>","2","0","2","",""
"2756475","1","","","2010-05-03 06:38:46","0","1696","<p>I managed to get oauth token and Token secret from google, after the user login and grant access to the web site. </p><p>after that I want the user's ID, first name, last name, and other available information about login user's.</p><p>How can I achieve it.</p><p>Thanks in advance.</p>","331175","","","","","2011-02-02 12:13:59","Android: How can I get the google account userid, first name and last name after successfully login","<android><oauth>","1","1","","",""
"2756613","1","","","2010-05-03 07:14:11","0","446","<p>is there any build-in mechanism in Android, which could create a service or app that actully listens to some server from the out side.. something that will ""Wake up"" the phone and makes him receaving a message from an outside server (i am asking this coz most of the appz are working the way aroound, when the phone sending requests to an outside server to recieve data)</p><p>is it possible any how ?</p><p>thanks.</p>","260511","","","","","2010-06-25 09:19:56","create a listener that will listen to an external push server","<android>","2","0","","",""
"2756730","1","","","2010-05-03 07:40:30","0","1120","<p>I am using AIDL to pass objects from an Activity to a Service and am getting some strange behavior.  To my understanding, the idea behind AIDL is to create an interface in a .aidl file, which android will then implement (partially) in a dynamically generated class.  Android will create an abstract class called Stub, which you then need to instantiate and add the implementation of the methods which you defined in your .aidl interface.  Once all of that is in place, the remote service can be instantiated, and the methods declared in the .aidl interface file (and defined in your instantiation of the Stub class) can be called.  </p><p>That is my impression of how this mechanism works, however when I tried implementing it, I notice that the definitions for the methods I declared in the Stub class are not being run;  instead what is being run is IBinder.transct()</p><p>Here is a snippet of what I'm trying to do:</p><p>This is implemented in my Service:</p><pre><code>public final INetService.Stub mBinder = new INetService.Stub() {        public void sendInteger(String ID, int data) throws RemoteException {        // TODO Auto-generated method stub    }    public void sendString(String ID, String data) throws RemoteException {        ServiceConnectionHandler connHandler = new     ServiceConnectionHandler(ID, data);    }    public void sendObject(String ID, NetMessage data) throws RemoteException {        ServiceConnectionHandler connHandler = new ServiceConnectionHandler(ID, data.getData());    }};</code></pre><p>And this is inside my Activity, which tries to use and talk to the service:</p><pre><code>private INetService mService = null;private NetServiceConnection conn = null;class NetServiceConnection implements ServiceConnection{    public void onServiceConnected(ComponentName name, IBinder service) {         mService = INetService.Stub.asInterface(service);          Log.d( ""ADDERSERVICECLIENT"",""onServiceConnected"" );    }    @Override    public void onServiceDisconnected(ComponentName name) {        mService = null;        Log.d( ""ADDERSERVICECLIENT"",""onServiceDisconnected"" );    }}; private void initService(){    conn = new NetServiceConnection();    Intent i = new Intent();    i.setClassName( ""framework.network"", ""framework.network.NetService"" );    if (!bindService( i, conn, Context.BIND_AUTO_CREATE))    {        Toast.makeText(this, ""bindService fails.."", Toast.LENGTH_LONG).show();    }}....mService.sendString((char)0, finalMessage);</code></pre><p>The methods defined in INetService.Stub, like sendString, appear never to be called; clearly I'm missing something;  any thoughts?</p><p>Thanks a lot!</p><p>Iva</p>","250493","","","","","2012-06-14 12:56:14","AIDL: Stub class methods not being called","<android><aidl>","2","0","","",""
"2756780","1","2762900","","2010-05-03 07:51:04","4","12587","<p>I am trying to display the text from json in a list view. I got help for retrieving the json text from the following...<a href=""http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/comment-page-1/#comment-498"" rel=""nofollow"">http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/comment-page-1/#comment-498</a>....</p><p>But my problem is that i cant figure out how to display them in list view. I also want to get only some of the text from url(for example, alerttext and date). Can anyone help me in declaring the list adapter and list view in order to display the data in the way i want...Plzzzz...</p>","303155","","","","","2010-05-04 04:57:35","List view and list adapters for displaying json","<android><listview><listadapter>","1","0","1","",""
"2756842","1","","","2010-05-03 08:12:36","1","262","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2384461/bluetooth-support-on-android-emulator"">Bluetooth support on Android Emulator</a>  </p></blockquote><p>Is it possible to use Bluetooth in emulation mode on google android? What is the current implementation of Bluetooth? Is it 2.1 +EDR?</p>","331163","","844882","","2012-03-17 20:11:21","2012-03-17 20:11:21","Bluetooth on Google Android","<android><bluetooth>","1","0","0","2011-12-16 20:11:10",""
"2756888","1","2756941","","2010-05-03 08:27:43","2","346","<p>I just published my first application to the market, but i just found out that android.telephony.gsm.smsmanager was depreciated as of Android 1.6. My application depends on sending SMS messages, so it cannot not work in 1.6 or newer. </p><p>I built the project against 1.5, but I only have a device with 1.5 to test on. Since I built on 1.5, am I fine in terms of newer OSes, or will users get force closes?</p><p>Thanks in advance!</p><p>P.S. Is there a way to send/receive SMS messages in the emulator? That would be helpful. </p>","253567","","","","","2010-05-03 08:41:01","Android forwards compatibility","<android><compatibility><forward>","1","0","","",""
"2756956","1","","","2010-05-03 08:45:24","0","387","<p>I need to split a date string into pieces and I'm doing it using the </p><pre><code>public final StringBuffer   format  (Object object, StringBuffer buffer, FieldPosition field)</code></pre><p>from the java.text.DateFormat class. However, the implementation of this function is really slow, hence Android has an own implementation in android.text.format.DateFormat.</p><p>BUT, in my case, I want to extract the different pieces of the date string (year, minute and so on). Since I need to be locale independent, I can not use SimpleDateFormat and custom strings. I do it as follows:</p><pre><code>    Calendar c = ...    // find out what field to extract    int field = getField();    // Create a date string    Field calendarField = DateFormat.Field.ofCalendarField(field);    FieldPosition fieldPosition = new FieldPosition(calendarField);    StringBuffer label = new StringBuffer();    label = getDateFormat().format(c.getTime(), label, fieldPosition);    // Find the piece that we are looking for    int beginIndex = fieldPosition.getBeginIndex();    int endIndex = fieldPosition.getEndIndex();    String asString = label.substring(beginIndex, endIndex);</code></pre><p>For some reason, the format() overload with the FieldPosition argument is not included in the android platform. Any ideas of how to do this in another way? Is there any easy way to tokenize the pattern string? Any other ideas?</p>","331244","","179850","","2011-02-21 19:12:54","2011-05-10 03:30:53","Android's DateFormat replacement - missing the format() with FieldPosition","<android><date-format>","1","0","","",""
"2756979","1","2758206","","2010-05-03 08:50:06","3","1697","<p>I don't know if it's very clear, but i'm trying to do something when the ""next"" (bottom right corner of the keyboard) is pressed, and i can't find its keycode. I have tried to look for ""next"" or ""enter"" in the keycodes but nothing really relevant...does anyone know?</p><p>(actually, i've found the enter keycode to be precise, but it does not do anything)</p>","263521","","","","","2010-05-03 13:08:57","Access the next button event android","<android><key><next>","1","0","0","",""
"2757038","1","2758472","","2010-05-03 09:06:44","1","699","<p>Is it possible to receive SMS message on appWidget?</p><p>I saw android sample source(API Demos).</p><p>In API Demos, <strong><em>ExampleAppWidgetProvider</em></strong> class extends <strong><em>AppWidgetProvider</em></strong>, not <strong><em>Activity</em></strong>.</p><p>So, I guess it is impossible to regist SMS Receiver like this,</p><pre><code>rcvIncoming = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        Log.i(""telephony"", ""SMS received"");        Bundle data = intent.getExtras();        if (data != null) {            // SMS uses a data format known as a PDU            Object pdus[] = (Object[]) data.get(""pdus"");            String message = ""New message:\n"";            String sender = null;            for (Object pdu : pdus) {                SmsMessage part = SmsMessage.createFromPdu((byte[])pdu);                message += part.getDisplayMessageBody();                if (sender == null) {                    sender = part.getDisplayOriginatingAddress();                }            }            Log.i(sender, message);        }    }};registerReceiver(rcvIncoming, new IntentFilter(""android.provider.Telephony.SMS_RECEIVED""));</code></pre><p>My goal is to receive SMS message on my custom appWidget.</p><p>Any help would be appreciated!!</p>","255549","","235654","","2010-05-03 15:24:30","2010-05-03 15:24:30","Is it possible to receive SMS message on appWidget?","<android><sms><android-widget>","1","0","","",""
"2757067","1","5795540","","2010-05-03 09:12:03","1","2223","<p>i have written a object selection algorithm which picks the objects by their color. i give every object an unique color and then i just have to use the glReadPixels method to check which object was selected</p><p>this works fine and is really fast but the problem is that the frame is displayed on the screen with all the picking-colors so the screen flashes every time you select something.</p><p>so my question is: how do i write everything in the correct display buffer but dont display it on the screen to avoid these flashes? </p>","165106","","165106","","2010-08-16 18:21:34","2011-04-26 19:39:51","opengl es color picking on android without screen flashing","<android><opengl-es><rendering><color-picker>","2","0","1","",""
"2757107","1","2757131","","2010-05-03 09:23:33","166","196242","<p>I've found out that my R.java is never updated, so it doesn't contain info about my new resources, so I decided to delete it and thought that Eclipse will generate a new one. But that didn't happen and I don't have R.java now. How can I generate one?I'm using Win7, if that changes anything.</p><p>From one of the comments: ""Doing Project->Clean is what caused the problem for me. Cleaning deletes R.java...and for whatever reason the plugin is not regenerating the file.""</p>","378377","","316041","","2013-05-16 15:00:32","2014-03-26 17:39:25","Developing for Android in Eclipse: R.java not generating","<android><eclipse><r.java-file>","59","0","48","","2012-06-29 20:30:42"
"2757121","1","2759056","","2010-05-03 09:26:23","5","4095","<p>I've got a ListView with a custom BaseAdapter. The list items contain CheckBoxes that need to represent a property from a database.</p><p>I use CheckBox.setOnCheckedChangeListener with a new OnCheckedChangeListener to detect changes, so I can change the database based on the current state of the CheckBox. Pretty straightforward stuff so far.</p><p>However, when scrolling further down the list, previously checked CheckBoxes get unchecked. I suspect this happens as soon as the views are recycled (I'm using the convertView/ViewHolder technique).</p><p>How can I stop this? What's going wrong?</p><p>Thanks in advance.</p><hr><p>Edit: To make things a bit clearer, the problem is that recycling views somehow calls OnCheckedChangeListener#onCheckedChanged(buttonView, isChecked) with isChecked == false.</p>","279363","","279363","","2010-05-03 09:59:00","2010-10-20 20:11:30","Android ListView with Checkbox: automatically unchecks","<android><listview><checkbox><listadapter>","1","0","1","",""
"2757219","1","","","2010-05-03 09:48:49","1","2627","<p>I'm just setting out in android development. I want to make a kind of card based game. I'm just looking for suggestions really on how I might start it.</p><p>I know I have to make the menu layout and view, then use an Intent from that to get to the main game view. My sticking points are:</p><ul><li><p>There's going to be a deck of cards. It's going to be a set number so I was thinking I could just have each card defined as a button in the layout. I don't know if that is the right way to do it though.</p></li><li><p>Storage of card details. I'm thinking of using an xml file to store these.</p></li></ul>","331296","","211160","","2012-10-08 04:22:42","2012-10-08 04:22:42","Android card based game, need help to start","<android><xml><button><playing-cards>","1","0","4","",""
"2757467","1","3697422","","2010-05-03 10:44:23","3","935","<p>I'm working my way through the NotePad tutorial, and that's all fine - I'm not a Java programmer but it's close enough to C# (or vice versa) to make it easy to pick up. I'm surprised that there aren't any RAD tools for Android apart from Mobiforms. Is there anyone out there with experience of Mobiforms ? </p>","205546","","","","","2010-09-13 01:27:48","Is MobiForms for Android worth investigating?","<java><android><rad>","1","0","1","","2010-05-03 10:44:23"
"2757476","1","","","2010-05-03 10:46:01","2","939","<p>Anyone knows how to change cursor size in Edittext in Anroid???</p><p>I'm trying to implement SMS function. I used EditText and tried to put background image. The background image has lines so I need to put extra space between lines so that the background image and the lines fit nicely.But... if I use linespacingextra, it increase cursor as well. That means the fontsize will be smaller than the cursor size.</p><p>Any idea??</p>","331337","","21234","","2010-05-03 10:46:36","2010-05-03 10:46:36","Android Cursor size","<android>","0","0","","",""
"2757517","1","2757646","","2010-05-03 10:55:34","6","1102","<p>HiIs it possible to reference other strings inside of strings.xml ? </p><p>Something of the form:</p><pre><code>&lt;string name=""string_one""&gt;My string&lt;/string&gt;&lt;string name=""string_two""&gt;Here it is: android:id=""@string/string_one"" &lt;/string&gt;</code></pre><p>(If it did exist, there would of course be problems of circular, infinite definitions, etc. to beware of).</p><p>Thanks.</p>","299080","","","","","2010-05-03 11:19:57","References to other strings in strings.xml?","<android><reference><string>","1","1","3","",""
"2757583","1","","","2010-05-03 11:08:20","1","741","<p>i want to improve the list view's performance.</p><p>this is the code for my getView method in my Adapter?</p><pre><code>public View getView(int arg0, View text_view_name, ViewGroup parent) {    try {        if (text_view_name == null) {            text_view_name = mInflater.inflate(                    R.layout.bs_content_list_item1, null);            text_view_name.setTag(R.id.text1_detail1, text_view_name                    .findViewById(R.id.text1_detail1));            text_view_name.setTag(R.id.text3_detail1, text_view_name                    .findViewById(R.id.text3_detail1));            text_view_name.setTag(R.id.eve_img_detail1, text_view_name                    .findViewById(R.id.eve_img_detail1));        }        text1 = (TextView) text_view_name.getTag(R.id.text1_detail1);        // text2 = (TextView) text_view_name.getTag(R.id.text2);        text3 = (TextView) text_view_name.getTag(R.id.text3_detail1);        img = (ImageView) text_view_name.getTag(R.id.eve_img_detail1);        text1.setText(VAL1[arg0]);        text3.setText(VAL3[arg0]);        if (!mBusy) {            img_value = new URL(VAL4[arg0]);            mIcon11 =   BitmapFactory.decodeStream(img_value.openConnection()                    .getInputStream());            img.setImageBitmap(mIcon11);            text_view_name.setTag(R.id.eve_img_detail1, null);        } else {            img.setImageResource(R.drawable.icon);            text_view_name.setTag(R.id.eve_img_detail1, text_view_name                    .findViewById(R.id.eve_img_detail1));        }    } catch (Exception e) {        name = ""Exception in MultiLine_bar_details1 getView"";        Log.v(TAG, name + e);    }    return text_view_name;}</code></pre><p>this is the code for scrollstatechanged method:</p><pre><code>public void onScrollStateChanged(AbsListView view, int scrollState) {    switch (scrollState) {    case OnScrollListener.SCROLL_STATE_IDLE:        try {            MultiLine_bar_details1.mBusy = false;            int first = view.getFirstVisiblePosition();            int count = view.getCount();            for (int i = 0; i &lt; count; i++) {                ImageView t = (ImageView) view.getChildAt(i);// here getting the ClassCastException                if (t.getTag(R.id.eve_img_detail1) != null) {                    MultiLine_bar_details1.img_value = new URL(                            MultiLine_bar_details1.VAL4[first + i]);                    MultiLine_bar_details1.mIcon11 = BitmapFactory                            .decodeStream(MultiLine_bar_details1.img_value                                    .openConnection().getInputStream());                    MultiLine_bar_details1.img.setImageBitmap(MultiLine_bar_details1.mIcon11);                    t.setTag(R.id.eve_img_detail1, null);                }            }        } catch (Exception e) {            Log.v(TAG, ""Idle"" + e);        }        // mStatus.setText(""Idle"");        break;    case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:        MultiLine_bar_details1.mBusy = true;        break;    case OnScrollListener.SCROLL_STATE_FLING:        MultiLine_bar_details1.mBusy = true;        break;    }}</code></pre><p>getting the Exception in Idle state:</p><pre><code>05-03 16:47:15.201: VERBOSE/BS_Bars(258): Idlejava.lang.ClassCastException: android.widget.LinearLayout</code></pre><p>this is very complicated for me to get the output properly. actually i have the listview with custom adapter. that icons makes the listview scroll very slow.i am getting the images for icons from the image urls. upto this(above code) i can improve the scroll performance of my list view. but the image icons are not proper in the corresponding order. its dynamically changing when i scroll the listview..</p><p>i refered the <a href=""http://commonsware.com/Android/excerpt.pdf"" rel=""nofollow"">commonsware busy coder guide</a> and <a href=""http://blog.jteam.nl/2009/09/17/exploring-the-world-of-android-part-2/"" rel=""nofollow"">this blog</a>.</p><p><strong>EDIT:My very Big question is ""How can we access the image view in scrollstatechanged using the  parameter AbsListView? ""</strong></p><p>what is the problem in it? how to do it better? Any Idea?  </p>","267269","","267269","","2010-05-03 19:11:25","2010-05-03 19:11:25","CustomListAdapter Problem in Android? Getting ClassCast Exception? How?","<android><listview><adapter>","1","0","","",""
"2757684","1","2791604","","2010-05-03 11:28:20","5","306","<p>I have an issue related publishing the paid app to android market. (My application is internet connection based app.)</p><p>If I've put the app to the android market, can user who bought the app pass to anyone ?</p><p>How is its security (I mean safe of .apk file) ?</p><p>Also, what is payment tool of android market ?</p><p>My main point is choosing the best way to link paid user to our system. Actually I don't know how to link paid user account to my system(by email address or device unique id ?... what is better way ?).</p><p>Can you suggest me on this part ?</p><p>I really appreciate for help.</p><p>Thanks in advance.</p>","164589","","21234","","2010-05-03 11:29:42","2012-02-02 05:34:06","How to link paid app user account to the system?","<android><google-play>","1","2","0","",""
"2757707","1","2758622","","2010-05-03 11:34:06","7","14033","<p>I have the following code:</p><pre><code>   &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""   android:shape=""line""&gt;   &lt;stroke android:width=""1dp""/&gt;   &lt;size android:height=""1dp"" /&gt;   &lt;solid  android:color=""#FFF""/&gt;   &lt;/shape&gt;   &lt;LinearLayout     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:background =""@drawable/line""/&gt;</code></pre><p>I have two questions:</p><ol><li>Why the line is black instead white? I have tried putting it inside a ImageView but the result is the same.</li><li>How can i set the opacity of the shape?</li></ol>","258863","","114066","","2010-07-06 09:32:53","2010-07-06 09:32:53","Android Shape Line","<android><shape>","1","0","1","",""
"2758006","1","","","2010-05-03 12:36:33","2","2764","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2948617/customizing-android-lock-screen-functionality"">Customizing Android Lock Screen functionality?</a>  </p></blockquote><p>I'm planning to explore the possibilities on how to make a screen lock better (like pattern based). It will be great help if someone points out the difficulty level or where to actually start digging. This is going to be my project idea for minor research paper. What do u guys think or if anyone has more ideas worth exploring, I would like to consider it.reagrds</p>","331406","","","","","2010-08-12 06:39:18","Screen lock customization for android","<android>","1","0","2","2012-05-29 06:22:52",""
"2758200","1","2758276","","2010-05-03 13:08:15","0","156","<p>im developing a game in android, and i've been thinking about subdividing many of the elements of the game (e.g. game objects) into separate classes and sub-classes. but i know that method calls to these objects will cause some overhead. would it be better to improve performance or to improve extensibility?</p>","209784","","","","","2010-05-03 13:24:07","android mobile development performance vs extensibility","<android><performance><oop><extensibility>","3","0","","",""
"2758222","1","2762003","","2010-05-03 13:11:34","2","9945","<p>Is there a significant difference in time needed for sending data over a service or by using an intent?</p><p>Are there general advices when to use service and when to use intents?</p>","","anon","","anon","2010-05-03 14:34:34","2012-09-26 02:34:04","Communication between Activities: Intent or Service: what is faster?","<android>","4","0","1","",""
"2758255","1","2760419","","2010-05-03 13:16:15","5","4180","<p>The problem is: Android doesn't implement <code>javax.sound.midi</code>.</p><p>I need a simple free library that allows me to create simple 1-track midi files.I searched the net for it, but can't really find anything, since everything uses javax.sound.midi . </p><p>The license needs to be one where I don't need to opensource my linked app.</p><p>Any ideas?</p><p>I also looked into the fileformat itself. However, I am totally not familiar with working with bytes, hexidecimal stuff etc.</p><p>So, other option is: are there any simple midi implementations that I can use as reference?</p>","107029","","","","","2012-01-28 23:14:11","A simple free MIDI implementation in Java besides javax.sound.midi: Are there any?","<java><android><midi>","3","0","3","",""
"2758335","1","","","2010-05-03 13:26:36","5","2626","<p>how can i set custom thumb for fast scroll in listview.</p>","184601","","","","","2014-03-17 14:03:55","fast scroll custom thumb","<android><scrolling><performance>","4","0","1","",""
"2758408","1","","","2010-05-03 13:38:42","3","3077","<p><em><strong>""How do you hang up incoming calls (in Android of course)?""</em></strong></p><p>First, I know this question has been asked and answered several times, and the response is always ""you can't"". But if we look in the market we get a few applications (all private software, no access to the source code... :-( ) that do this action, such as <a href=""http://uk.androlib.com/android.application.jp-co-telemarks-callfilter2-zApj.aspx"" rel=""nofollow"">CallFilter</a>, Panda firewall and others...</p><p>So... does somebody know how these apps do the hang up action, (or terminate, or disconnect or whatever you call it..)?</p><p>And other question, if the first don't get a response.. does somebody know how send an incoming call to the voice mail? </p><p>Of course, all questions are about how to do it <strong>programmatically</strong>. So with the voicemail question I know there's a flag in contacts that is used for that, but like I said, I'd like to know the programmatical way.</p><p>Thanks all!</p><p><em><strong>Edit 1:</em></strong></p><p>I have been seeing the LogCat traces using the application CallFilter and one trace seems to be interest, when it receives an incoming call, the PHONE_STATE is CALL_STATE_RINGING and fast appears one trace: </p><p><code>""05-03 19:32:34.416: INFO/UsageStats(78): Something wrong here, didn't expect com.android.phone to be paused""</code> </p><p>and when CallFilter have done whatever do new trace ""05-03 19:32:34.486: </p><p><code>INFO/UsageStats(78): Unexpected resume of com.android.phone while already resumed in com.android.phone""</code> </p><p>appear, so i think CallFilter do something in one object com.android.phone, but i don't know how access to this.. any idea??</p><p><strong>Edit 2:</strong></p><p>I have performed at other times, and i don't see anymore the log traces above, so can be that the above may be that this does not mean anything.. i'm not sure.. the CallFilter application simply show one sec the incoming call, and then hang up.. how they do!!!???</p>","315993","","315993","","2010-05-04 07:44:28","2012-02-26 18:40:44","How to hang up (disconnect, terminate,..) incomings call?","<android>","2","1","2","",""
"2758708","1","2759387","","2010-05-03 14:25:35","2","353","<p>I am having problems trying to use the regular expression that I used in JavaScript. On a web page, you may have: </p><pre><code>&lt;b&gt;Renewal Date:&lt;/b&gt; 03 May 2010&lt;/td&gt;</code></pre><p>I just want to be able to pull out the 03 May 2010, remembering that a webpage has more than just the above content. The way I currently perform this using JavaScript is:</p><pre><code>DateStr = /&lt;b&gt;Renewal Date:&lt;\/b&gt;(.+?)&lt;\/td&gt;/.exec(returnedHTMLPage);</code></pre><p>I tried to follow some tutorials on <code>java.util.regex.Pattern</code> and <code>java.util.regex.Matcher</code> with no luck. I can't seem to be able to translate <strong>(.+?)</strong> into something they can understand??</p><p>thanks,</p><p>Noeneel</p>","330368","","1288","","2010-05-03 14:33:52","2010-05-05 04:44:02","Using Regular Expressions","<java><android><regex>","5","0","1","",""
"2758786","1","2759064","","2010-05-03 14:36:34","1","13897","<p>I am sure this will have been answered but I proved unable to find it. So please excuse my redundancy.  </p><p>What I am trying to do is emulating the ""Home"" button which takes one back to Android's homescreen. So here is what causes me problems:  </p><ul><li>I have 3 launcher activities. The first one (which is connected to the homescreen icon) is just a (password protected) configuration activity. It will not be used by the user (just admin)</li><li>One of the other 2 (both accessed via an app widget) is a questionnaire app. I'm allowing to jump back between questions via the Back button or a GUI back button as well. When the questionnaire is finished I sum up the answers given and provide a ""Finish"" button which should take the user back to the home screen. </li></ul><p>For the questionnaire app I use a single activity (called ItemActivity) which calls itself (is that recursion as well when using intents?) to jump from one question to another:</p><pre><code>Questionnaire.serializeToXML();  Intent i = new Intent().setClass(c, ItemActivity.class);  if(Questionnaire.instance.getCurrentItemNo() == Questionnaire.instance.getAmountOfItems()) {      Questionnaire.instance.setCompleted(true);  } else Questionnaire.instance.nextItem();  startActivity(i);</code></pre><p>The final screen shows something like ""Thank you for participating"" as well as the formerly described button which should take one back to the homescreen. But I don't really get how to exit the Activity properly. I've e.g. used <code>this.finish();</code> but this strangely brings up the ""Thank you"" screen again. So how can I just exit by jumping back to the homescreen??</p><p>Sorry for the inconvinience.<br>Regards,<br>Steff</p>","289849","","","","","2011-01-12 00:28:05","How to exit current activity to homescreen (without using ""Home"" button)?","<android><activity><exit><homescreen>","1","0","1","",""
"2759071","1","","","2010-05-03 15:18:35","1","1293","<p>I am adding a bmp file to the media store using the line below </p><pre><code>ContentResolver cr = getContentResolver();Uri uri = Uri.parse(MediaStore.Images.Media.insertImage(cr, bmp, ""name"", ""now""));</code></pre><p>I then go to the gallery application and it shows the image, but shows it under ""Camera Pictures"".</p><p>Is there a way to change this to its own group, perhaps to its own group?  Do I need a custom content provider for this?</p><p>Thanks.</p>","324485","","60261","","2010-05-03 15:32:49","2010-10-06 20:43:56","Android insertImage and the Gallery Application","<android>","0","0","","",""
"2759274","1","2759307","","2010-05-03 15:49:19","1","545","<p>Is there a way to programatically get the path to the databases/files an application uses instead of hardcoding ""data/data/mypackage.com/database.db"" ?</p>","284609","","","","","2010-05-03 15:54:11","Android application files","<android>","1","0","","",""
"2759290","1","","","2010-05-03 15:51:49","11","11053","<p>I have following main layout:</p><pre><code>&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"" android:orientation=""vertical""&gt; &lt;ViewFlipper android:id=""@+id/viewstack""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;        &lt;!-- Here I want to add my views which are located in separated xml files. --&gt;        &lt;/ViewFlipper&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is example of my view:</p><p>view_url.xml</p><pre><code>&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"" android:orientation=""vertical"" android:gravity=""center""&gt; &lt;EditText android:text=""@+id/EditText01""   android:id=""@+id/EditText01""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt; &lt;Button android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:id=""@+id/btnGenerate""                 android:text=""Generate""/&gt;&lt;/LinearLayout&gt;</code></pre><p>view_text.xml</p><pre><code>&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"" android:orientation=""vertical""&gt; &lt;EditText android:text=""@+id/EditText01""   android:id=""@+id/EditText01""   android:layout_height=""wrap_content""   android:contentDescription=""Enter your text here""   android:layout_width=""fill_parent""   android:height=""200dp""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I am trying to add views:</p><pre><code>viewstack = (ViewFlipper) findViewById(R.id.viewstack);));View viewText = (View) findViewById(R.layout.view_text);viewstack.addView(viewText); &lt; -- Emulator is crashing at this lineView viewUrl = (View) findViewById(R.layout.view_url);viewstack.addView(viewUrl);</code></pre><p>I dont have any idea what is wrong with my code. I decided to put all my views in one file, but I still want to know how to fix my initial code.</p>","331565","","73488","","2011-05-06 23:35:56","2013-12-30 00:15:04","How to programmatically add view in ViewFlipper","<android><viewflipper>","4","0","1","",""
"2759313","1","","","2010-05-03 15:54:52","0","1169","<p>I'm using ""ExpandableListView"" in my application to display some options that . I need a way to build automatically the information to show when a group is expanded as the information might be different each time the group is expanded. </p>","284609","","60261","","2010-05-03 16:16:54","2010-05-03 18:51:06","Dynamically build data for ExpandableListView","<android>","1","0","","",""
"2759471","1","","","2010-05-03 16:16:33","1","884","<p>I have a shared preference that is being accesed via an EditTextPreference.  I am in the process of porting this application to a device that does not have a hardware keyboard for text entry.</p><p>When the time comes to modify the EditTextPreference, there is no soft keyboard that becomes available, and I am at a loss as to how to invoke the soft keyboard for text input to edit this preference.</p><p>Thanks</p>","313135","","","","","2010-06-09 20:00:08","Getting a Soft Keyboard for a EditTextPreference","<android><edittext><preference>","1","0","1","",""
"2759604","1","","","2010-05-03 16:38:38","0","402","<p>I have an application that uses a WebView and a html-page with javascript functions. Randomly the JavaScript functions doesn't seem to be called. It works up to a random point (I have looked at this bug all day) can only be produced on hardware (HTC Legend) not on emulator.</p><p>Basicly I'm using callback to javaScript whenever the user presses a button, these callbacks tell the html to redraw using javaScript functions.</p><p><code>mHandler.post(new Runnable() {          public void run() {             mWebView.loadUrl(""javascript:getDataLine()"");         }});</code></p><p>The first line in this javaScript code is an alert that says that it has started, so that I can see that it's working.</p><p>Settings alerts or console.log's everywhere won't help as it seems the problem is in the webview or in Android itself. I need a way to see what's going on in the background. Maybe see if a previous call failed and stalled the thread or something.</p>","301746","","","","","2010-05-03 22:12:25","JavaScript on Android randomly stops working","<javascript><android><debugging><webview>","2","0","1","",""
"2759654","1","","","2010-05-03 16:46:34","3","1833","<p>when adding gson 1.4 to the java build path of my Android project I get the error shown below.</p><p>Anybody can help?</p><p>thanks</p><pre><code> [2010-05-03 18:42:07 - Atable]  UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lcom/google/gson/annotations/Expose; [2010-05-03 18:42:07 - Atable]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [2010-05-03 18:42:07 - Atable]     at com.android.dx.dex.file.DexFile.add(DexFile.java:143) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.processClass(Main.java:299) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.access$100(Main.java:56) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228) [2010-05-03 18:42:07 - Atable]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245) [2010-05-03 18:42:07 - Atable]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130) [2010-05-03 18:42:07 - Atable]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.processOne(Main.java:245) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183) [2010-05-03 18:42:07 - Atable]     at com.android.dx.command.dexer.Main.run(Main.java:139) [2010-05-03 18:42:07 - Atable]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [2010-05-03 18:42:07 - Atable]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [2010-05-03 18:42:07 - Atable]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [2010-05-03 18:42:07 - Atable]     at java.lang.reflect.Method.invoke(Method.java:597) [2010-05-03 18:42:07 - Atable]     at com.android.ide.eclipse.adt.internal.sdk.DexWrapper.run(Unknown Source) [2010-05-03 18:42:07 - Atable]     at com.android.ide.eclipse.adt.internal.build.ApkBuilder.executeDx(Unknown Source) [2010-05-03 18:42:07 - Atable]     at com.android.ide.eclipse.adt.internal.build.ApkBuilder.build(Unknown Source) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) [2010-05-03 18:42:07 - Atable]     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) [2010-05-03 18:42:07 - Atable] 1 error; aborting [2010-05-03 18:42:07 - Atable] Conversion to Dalvik format failed with error 1</code></pre>","326849","","","","","2012-01-07 23:48:13","Issue using gson with Android in Eclipse","<android><eclipse><gson>","1","3","","",""
"2759734","1","3049869","","2010-05-03 16:59:59","7","1897","<p>The GLSurfaceView.Renderer interface of the Android SDK gives me a GL interface as parameter which has the type GL10. This interface is implemented by some private internal jni wrapper class. But there is also the class GLES10 where all the GL methods are available as static methods. Is there an important difference between them? So what if I ignore the gl parameter of onDrawFrame and instead use the static methods of GLES10 everywhere?</p><p>Here is an example. Instead of doing this:</p><pre><code>void onDrawFrame(GL10 gl){    drawSomething(gl);}void drawSomething(GL10 gl){    gl.glLoadIdentity();    ...}</code></pre><p>I could do this:</p><pre><code>void onDrawFrame(GL10 gl){    drawSomething();}void drawSomething(){    GLES10.glLoadIdentity();    ...}</code></pre><p>The advantage is that I don't have to pass the GL context to all called methods. But even it it works (And it works, I tried it) I wonder if there are any disadvantages and reasons to NOT do it like that.</p>","274473","","44729","","2010-05-03 17:51:46","2011-02-14 08:27:14","Difference between GL10 and GLES10 on Android","<android><opengl-es>","1","0","","",""
"2759793","1","","","2010-05-03 17:09:57","13","18011","<p>I am building an app on android and running into an error and while searching on net, came across your posting on this and changed the eclipse.ini to increase Xms and Xmx params but still this error does not go away. </p><p>I am using Eclipse IDE for Java with Android SDK 2.1 on Mac OS. Please help or please point me to someone who might know.</p><p>Btw, this error only happens when i add external jar files (which i need for my project). Here are the list of external jar files that i have in my classpath.)</p><ul><li>httpclient-4.0.1.jar from apache</li><li>httpcore -4.0.1.jarfrom apache</li><li>commons-codec-1.3.jar from apache</li><li>commons-logging-1.1.1.jar from apache</li><li>json_simple-1.1.jar from google</li></ul><p>Here is the complete error:</p><pre><code>UNEXPECTED TOP-LEVEL EXCEPTION:java.lang.IllegalArgumentException: already added: Lorg/apache/commons/logging/impl/AvalonLogger;[2010-05-02 21:57:05 - MyApp]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.dex.file.DexFile.add(DexFile.java:143)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.processClass(Main.java:301)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:278)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.access$100(Main.java:56)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:229)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.cf &lt;http://com.android.dx.cf.direct.ClassPathOpener.pro&gt; .direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.processOne(Main.java:247)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)[2010-05-02 21:57:05 - MyApp]     at com.android.dx.command.dexer.Main.run(Main.java:139)[2010-05-02 21:57:05 - MyApp]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[2010-05-02 21:57:05 - MyApp]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[2010-05-02 21:57:05 - MyApp]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[2010-05-02 21:57:05 - MyApp]     at java.lang.reflect.Method.invoke(Method.java:592)[2010-05-02 21:57:05 - MyApp]     at com.android.ide.eclipse.adt.internal.sdk.DexWrapper.run(Unknown Source)[2010-05-02 21:57:05 - MyApp]     at com.android.ide.eclipse.adt.internal.build.ApkBuilder.executeDx(Unknown Source)[2010-05-02 21:57:05 - MyApp]     at com.android.ide.eclipse.adt.internal.build.ApkBuilder.build(Unknown Source)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)[2010-05-02 21:57:05 - MyApp]     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)[2010-05-02 21:57:05 - MyApp] 4 errors; aborting[2010-05-02 21:57:05 - MyApp] Conversion to Dalvik format failed with error 1</code></pre>","331630","","571189","","2011-10-21 04:51:38","2013-05-24 15:53:45","Android: Getting Error: Conversion to Dalvik format failed","<android>","11","2","2","",""
"2759877","1","2772178","","2010-05-03 17:22:56","1","1790","<p>I am trying to have a tablelayout contains several tablerows. One of the rows contains 4 buttons, while the second row contains a very long text. However, the width of the button stretches with the text in the second row. Is there anyway to prevent this?</p><p><img src=""http://i40.tinypic.com/34srli0.jpg"" alt=""alt text""> <img src=""http://i44.tinypic.com/2505dmf.jpg"" alt=""alt text""></p><p><a href=""http://img684.imageshack.us/i/tableview1.jpg/"" rel=""nofollow"">http://img684.imageshack.us/i/tableview1.jpg/</a></p><p><a href=""http://img521.imageshack.us/i/tableview2.jpg/"" rel=""nofollow"">http://img521.imageshack.us/i/tableview2.jpg/</a></p><p>Here is my xml file: (somehow this website is not friendly to xml file)</p><p>AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""></p><p>TableLayoutandroid:id=""@+id/widget28""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""vertical""android:layout_x=""0px""android:layout_y=""10px""></p><p>TableRowandroid:id=""@+id/widget29""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""></p><p>Buttonandroid:id=""@+id/widget30""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Button""></p><p>Buttonandroid:id=""@+id/widget31""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Button""></p><p>Buttonandroid:id=""@+id/widget32""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Button""></p><p>Buttonandroid:id=""@+id/widget33""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Button""></p><p>TableRowandroid:id=""@+id/widget35""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""></p><p>TextViewandroid:id=""@+id/widget40""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""TextViewTextViewTextViewTextViewTextViewTextView""></p><p></p>","253800","","253800","","2010-05-04 05:30:42","2010-05-05 10:15:01","android: tablerow mixed with columns and multiline text","<android><views><tablelayout><tablerow>","1","1","","",""
"2759899","1","2769635","","2010-05-03 17:26:47","0","439","<p>I'm new to parsing XML and am having an issue with entities. (Am doing this on Android, if it makes a difference).</p><p>Is there a way to have it turn an entity into the character it represents? I have this in the child of an element: ""<code>isn&amp;#39;t</code>"" (minus quotes).  I would prefer it parse it and the end result be a single text node. However, right now this is turned in to TEXT, ENTITY, TEXT.</p><p>Is there a way to automatically have it parse the entity into text, or a manual way to do it?</p>","325011","","325011","","2010-05-04 23:18:26","2010-05-04 23:25:51","DocumentBuilder.parse() / Parsing Entities","<java><xml><android><dom>","1","0","","",""
"2760110","1","2760873","","2010-05-03 18:00:45","3","2109","<p>I'm considering creating a singleton wrapper for a Context so my model objects, if necessary, can open and read from a database connection. My model objects do not have access to a <code>Context</code>, and I'd like to avoid needing to pass a reference to a <code>Context</code> from object to object.</p><p>I was planning to place into this singleton a reference to the <code>Context</code> returned by <code>Application.getApplicationContext()</code>. This singleton object would be initialized in my custom <code>Application</code> instance before anything else would need to or have a chance to use it.</p><p>Can anyone think of a reason to <em>not</em> do this?</p>","300368","","","","","2010-05-03 20:51:31","Singleton wrapper for Context","<android>","3","0","0","",""
"2760120","1","","","2010-05-03 18:03:00","2","11306","<p><strong>Projects do not run, on screen emulator only ""ANDROID""</strong> </p><p>WinXP pro SP3/Eclipse Galileo</p><p>java version ""1.6.0_20""Java(TM) SE Runtime Environment (build 1.6.0_20-b02)Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)</p><p><strong>My actions:</strong></p><p>1.Start the emulator(Platform:2.1 API Level:7), wait until the window DDMS status will change to ONLINE</p><p>2.Launches helloandroid from examples -> Run as Android Application</p><p>Console:</p><pre><code>Android Launch![2010-05-03 21:44:34 - HelloAndroid] adb is running normally.[2010-05-03 21:44:34 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch[2010-05-03 21:44:34 - HelloAndroid] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'my_vm'[2010-05-03 21:44:34 - HelloAndroid] WARNING: Application does not specify an API level requirement![2010-05-03 21:44:34 - HelloAndroid] Device API version is 7 (Android 2.1)[2010-05-03 21:44:34 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'[2010-05-03 21:44:35 - HelloAndroid] Installing HelloAndroid.apk...[2010-05-03 21:45:07 - HelloAndroid] Success![2010-05-03 21:45:08 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-05-03 21:45:28 - HelloAndroid] ActivityManager: DDM dispatch reg wait timeout[2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 52454151: no handler defined[2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 48454c4f: no handler defined[2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-05-03 21:45:28 - HelloAndroid] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-05-03 21:45:52 - HelloAndroid] Device not ready. Waiting 3 seconds before next attempt.[2010-05-03 21:45:52 - HelloAndroid] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?[2010-05-03 21:45:55 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-05-03 21:46:11 - HelloAndroid] ActivityManager: DDM dispatch reg wait timeout......</code></pre><p>DDMS console (only errors and warnings)</p><pre><code>05-03 17:43:52.437: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)05-03 17:43:52.437: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)05-03 17:43:52.437: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)05-03 17:43:52.437: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)05-03 17:48:34.036: WARN/Zygote(29): Preloaded drawable resource #0x1080093 (res/drawable-mdpi/sym_def_app_icon.png) that varies with configuration!!05-03 17:48:34.406: WARN/Zygote(29): Preloaded drawable resource #0x1080002 (res/drawable-mdpi/arrow_down_float.png) that varies with configuration!!05-03 17:48:35.836: WARN/Zygote(29): Preloaded drawable resource #0x10800b4 (res/drawable/btn_check.xml) that varies with configuration!!05-03 17:48:36.076: WARN/Zygote(29): Preloaded drawable resource #0x10800b7 (res/drawable-mdpi/btn_check_label_background.9.png) that varies with configuration!!05-03 17:48:36.106: WARN/Zygote(29): Preloaded drawable resource #0x10800b8 (res/drawable-mdpi/btn_check_off.png) that varies with configuration!!05-03 17:48:36.147: WARN/Zygote(29): Preloaded drawable resource #0x10800bd (res/drawable-mdpi/btn_check_on.png) that varies with configuration!!05-03 17:48:36.437: WARN/Zygote(29): Preloaded drawable resource #0x1080004 (res/drawable/btn_default.xml) that varies with configuration!!05-03 17:48:36.716: WARN/Zygote(29): Preloaded drawable resource #0x1080005 (res/drawable/btn_default_small.xml) that varies with configuration!!05-03 17:48:36.966: WARN/Zygote(29): Preloaded drawable resource #0x1080006 (res/drawable/btn_dropdown.xml) that varies with configuration!!05-03 17:48:37.326: WARN/Zygote(29): Preloaded drawable resource #0x1080008 (res/drawable/btn_plus.xml) that varies with configuration!!05-03 17:48:37.707: WARN/Zygote(29): Preloaded drawable resource #0x1080007 (res/drawable/btn_minus.xml) that varies with configuration!!05-03 17:48:38.057: WARN/Zygote(29): Preloaded drawable resource #0x1080009 (res/drawable/btn_radio.xml) that varies with configuration!!05-03 17:48:38.776: WARN/Zygote(29): Preloaded drawable resource #0x108000a (res/drawable/btn_star.xml) that varies with configuration!!05-03 17:48:39.327: WARN/Zygote(29): Preloaded drawable resource #0x1080125 (res/drawable/btn_toggle.xml) that varies with configuration!!05-03 17:48:39.416: WARN/Zygote(29): Preloaded drawable resource #0x1080187 (res/drawable-mdpi/ic_emergency.png) that varies with configuration!!05-03 17:48:39.506: WARN/Zygote(29): Preloaded drawable resource #0x1080012 (res/drawable-mdpi/divider_horizontal_bright.9.png) that varies with configuration!!05-03 17:48:39.576: WARN/Zygote(29): Preloaded drawable resource #0x1080014 (res/drawable-mdpi/divider_horizontal_dark.9.png) that varies with configuration!!05-03 17:48:40.126: WARN/Zygote(29): Preloaded drawable resource #0x1080016 (res/drawable/edit_text.xml) that varies with configuration!!05-03 17:48:40.507: WARN/Zygote(29): Preloaded drawable resource #0x1080161 (res/drawable/expander_group.xml) that varies with configuration!!05-03 17:48:41.036: WARN/Zygote(29): Preloaded drawable resource #0x1080062 (res/drawable/list_selector_background.xml) that varies with configuration!!05-03 17:48:41.177: WARN/Zygote(29): Preloaded drawable resource #0x1080217 (res/drawable-mdpi/menu_background.9.png) that varies with configuration!!05-03 17:48:41.256: WARN/Zygote(29): Preloaded drawable resource #0x1080218 (res/drawable-mdpi/menu_background_fill_parent_width.9.png) that varies with configuration!!05-03 17:48:41.567: WARN/Zygote(29): Preloaded drawable resource #0x1080219 (res/drawable/menu_selector.xml) that varies with configuration!!05-03 17:48:41.706: WARN/Zygote(29): Preloaded drawable resource #0x1080224 (res/drawable-mdpi/panel_background.9.png) that varies with configuration!!05-03 17:48:41.849: WARN/Zygote(29): Preloaded drawable resource #0x108022e (res/drawable-mdpi/popup_bottom_bright.9.png) that varies with configuration!!05-03 17:48:42.026: WARN/Zygote(29): Preloaded drawable resource #0x108022f (res/drawable-mdpi/popup_bottom_dark.9.png) that varies with configuration!!05-03 17:48:42.156: WARN/Zygote(29): Preloaded drawable resource #0x1080230 (res/drawable-mdpi/popup_bottom_medium.9.png) that varies with configuration!!05-03 17:48:42.276: WARN/Zygote(29): Preloaded drawable resource #0x1080231 (res/drawable-mdpi/popup_center_bright.9.png) that varies with configuration!!05-03 17:48:42.376: WARN/Zygote(29): Preloaded drawable resource #0x1080232 (res/drawable-mdpi/popup_center_dark.9.png) that varies with configuration!!05-03 17:48:42.507: WARN/Zygote(29): Preloaded drawable resource #0x1080235 (res/drawable-mdpi/popup_full_dark.9.png) that varies with configuration!!05-03 17:48:42.606: WARN/Zygote(29): Preloaded drawable resource #0x1080238 (res/drawable-mdpi/popup_top_bright.9.png) that varies with configuration!!05-03 17:48:42.696: WARN/Zygote(29): Preloaded drawable resource #0x1080239 (res/drawable-mdpi/popup_top_dark.9.png) that varies with configuration!!05-03 17:48:42.946: WARN/Zygote(29): Preloaded drawable resource #0x108006d (res/drawable/progress_indeterminate_horizontal.xml) that varies with configuration!!05-03 17:48:43.076: WARN/Zygote(29): Preloaded drawable resource #0x108023f (res/drawable/progress_small.xml) that varies with configuration!!05-03 17:48:43.456: WARN/Zygote(29): Preloaded drawable resource #0x1080240 (res/drawable/progress_small_titlebar.xml) that varies with configuration!!05-03 17:48:43.957: WARN/Zygote(29): Preloaded drawable resource #0x1080262 (res/drawable-mdpi/scrollbar_handle_horizontal.9.png) that varies with configuration!!05-03 17:48:44.036: WARN/Zygote(29): Preloaded drawable resource #0x1080263 (res/drawable-mdpi/scrollbar_handle_vertical.9.png) that varies with configuration!!05-03 17:48:44.176: WARN/Zygote(29): Preloaded drawable resource #0x1080071 (res/drawable/spinner_dropdown_background.xml) that varies with configuration!!05-03 17:48:44.317: WARN/Zygote(29): Preloaded drawable resource #0x1080326 (res/drawable-mdpi/title_bar_shadow.9.png) that varies with configuration!!05-03 17:48:44.496: WARN/Zygote(29): Preloaded drawable resource #0x10801c6 (res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png) that varies with configuration!!05-03 17:48:44.607: WARN/Zygote(29): Preloaded drawable resource #0x10801c7 (res/drawable-mdpi/indicator_code_lock_drag_direction_red_up.png) that varies with configuration!!05-03 17:48:45.956: WARN/Zygote(29): Preloaded drawable resource #0x10801c8 (res/drawable-mdpi/indicator_code_lock_point_area_default.png) that varies with configuration!!05-03 17:48:46.407: WARN/Zygote(29): Preloaded drawable resource #0x10801c9 (res/drawable-mdpi/indicator_code_lock_point_area_green.png) that varies with configuration!!05-03 17:48:46.696: WARN/Zygote(29): Preloaded drawable resource #0x10801ca (res/drawable-mdpi/indicator_code_lock_point_area_red.png) that varies with configuration!!05-03 17:48:56.307: ERROR/BatteryService(170): usbOnlinePath not found05-03 17:48:56.336: ERROR/BatteryService(170): batteryVoltagePath not found05-03 17:48:56.350: ERROR/BatteryService(170): batteryTemperaturePath not found05-03 17:48:56.696: ERROR/SurfaceFlinger(170): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake05-03 17:48:57.847: WARN/SurfaceFlinger(170): ro.sf.lcd_density not defined, using 160 dpi by default.05-03 17:49:02.116: WARN/UsageStats(170): Usage stats version changed; dropping05-03 17:49:05.036: WARN/zipro(182): Unable to open zip '/data/local/bootanimation.zip': No such file or directory05-03 17:49:06.297: WARN/zipro(182): Unable to open zip '/system/media/bootanimation.zip': No such file or directory05-03 17:49:50.637: WARN/PackageManager(170): Running ENG build: no pre-dexopt!05-03 17:53:59.196: WARN/PackageManager(170): Unknown permission com.google.android.providers.gmail.permission.WRITE_GMAIL in package com.android.settings05-03 17:53:59.238: WARN/PackageManager(170): Unknown permission com.google.android.providers.gmail.permission.READ_GMAIL in package com.android.settings05-03 17:53:59.286: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings05-03 17:53:59.517: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts05-03 17:53:59.656: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts05-03 17:53:59.717: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts05-03 17:53:59.796: WARN/PackageManager(170): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone05-03 17:54:00.126: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development05-03 17:54:00.206: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development05-03 17:54:00.206: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development05-03 17:54:00.237: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development05-03 17:54:00.258: WARN/PackageManager(170): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.browser05-03 17:54:25.456: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f0700e505-03 17:54:25.486: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f02003105-03 17:54:25.536: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f02003005-03 17:54:25.576: WARN/ResourceType(170): Resources don't contain package for resource number 0x7f05000005-03 17:54:38.708: WARN/SharedBufferStack(182): waitForCondition(LockCondition) timed out (identity=0, status=0). CPU may be pegged. trying again.</code></pre>","143598","","","","","2013-08-13 04:16:46","Problem with Android emulator","<android><android-emulator>","2","1","","",""
"2760266","1","","","2010-05-03 18:28:27","0","511","<p>I am using SQLite to store school classes.  I want to fill in a Spinner with the classes that get stored in the database.  How would I grab all the classes in the DB and load them into a spinner?</p>","331688","","","","","2010-05-03 22:06:19","XML array from SQLite database","<android>","1","4","","",""
"2760288","1","2760357","","2010-05-03 18:31:56","2","424","<p>I apologize in advance for the ""newbie"" nature of this question.</p><p>Here is my predicament: I'm brand new to android and developing in general. I'm using android's SDK with eclipse Galileo. I've followed several tutorials to create different layouts. I've even learned recently how to use radio buttons and verify which ones were selected. Now I need to create a service that downloads and updates an xml file within the application. I've tried to locate a simple tutorial for services on Google's developer site but so far, so bad. If they exist could somebody point me in the right direction?</p><p>On the other hand, I've been told Google's tutorials are a little out dated. Is that true? If so, are there any other tutorials that would hand-hold (and possibly over-explain) how to use a service to a true newbie for free (like google)?</p><p>Any suggestions would be appreciated.</p>","317705","","1228","","2013-08-16 15:34:56","2013-08-16 15:34:56","Does Google provide any Android tutorials that teach how to implement a Service?","<android>","3","0","2","2013-08-16 17:37:47",""
"2760817","1","2761171","","2010-05-03 19:59:51","1","733","<p>i'm trying to include a maven java project into my android project.  the maven project is the greader-unofficial project which allows developers access to google reader accounts, and handles all of the http transactions and URI/URL building, making grabbing feeds and items from google reader transparent to the developer.  the project is available here:</p><p><a href=""http://code.google.com/p/greader-unofficial/"" rel=""nofollow"">http://code.google.com/p/greader-unofficial/</a></p><p>the code is originally written for the standard jdk and uses classes from java.net that are not a part of the standard Android SDK.  i actually tried to manually resolve all dependencies and ran into a problem when i got as far as including com.sun.syndication pieces required by the class be.lechtitseb.google.reader.api.util.AtomUtil.java...  some of the classes in java.net that are in the standard jdk (i'm using 1.6) are not in the Android SDK.  in addition, resolving all of these dependencies manually is just ridiculous when i'm compiling a maven project that should be pretty simple.</p><p>however, i can use maven to compile the sources with no issue.  how can i include this maven project, which is dependent on the complete jdk, into my android project in such a way that it will compile so that i can access the GoogleReader class from my android project?  and for the record, i don't have the expertise to rewrite this entire api to work with the standard Android SDK.</p>","329993","","","","","2010-12-07 12:00:53","including pre-built java classes into an android project","<java><android><eclipse><maven><jdk>","3","0","","",""
"2761425","1","","","2010-05-03 21:42:52","2","8678","<p>I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code.</p><p>Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions.</p><p>But now, in the ""drawFrame"" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error on the Logs:</p><p>drawtex.c:89: DrawTexture: No textures enabled</p><p>I'm already doing glEnable(GL_TEXTURE_2D), is there anything else I should do?</p><p>Is there a complete example showing GLSurfaceView with native code using textures?</p><p>Thanks in advance!</p>","287597","","","","","2010-11-11 20:53:03","Android GLSurfaceView glTexImage2D glDrawTexiOES","<android><opengl-es><textures><android-ndk><texture2d>","4","0","2","",""
"2761426","1","","","2010-05-03 21:42:56","1","2379","<p>I'd like to write a simple widget that toggles GPS and network location on and off. I've read that it's not possible to do that normally, but presumably on a rooted phone it must be doable. Does anyone know what the code would be? (I only need the code to toggle the location providers, I know how to make the widget.) It doesn't matter that this isn't a 'good' solution, I don't plan to distribute the widget. If it matters, this would be on an HTC Hero, still running v1.5.</p>","235654","","","","","2010-05-03 22:19:27","Enable GPS and network location programmatically on rooted phone?","<android><android-widget><android-location>","1","2","","",""
"2761443","1","2767564","","2010-05-03 21:46:28","14","1685","<p>The definitive reference for using Scala on android seems to be here: <a href=""http://www.scala-lang.org/node/160"" rel=""nofollow"">http://www.scala-lang.org/node/160</a></p><p>Unfortunately, all the references on using scala with android are based around Scala 2.7 and refer to a custom build android-library.jar, with a couple of cryptic references suggesting that this custom build isn't needed for later versions of android (I'm using 2.1 / API v7)</p><p>So... What are the steps needed to use Scala 2.8 in an android project? Preferably using eclipse and the Android tools that Google supplies for that IDE.</p>","165009","","","","","2012-03-03 01:15:14","Targeting Android with Scala 2.8 Trunk builds","<android><scala><scala-2.8>","5","1","3","",""
"2761577","1","2761986","","2010-05-03 22:14:28","2","6361","<p>I have a main activity with this layout 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:layout_height=""fill_parent""  android:layout_width=""fill_parent""  android:orientation=""vertical""  android:id=""@+id/container""  &gt;    &lt;LinearLayout        android:layout_height=""wrap_content""        android:id=""@+id/header""         android:background=""@drawable/logo_bk""        android:layout_width=""fill_parent""    &gt;    &lt;Button         android:id=""@+id/btn_reload""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Reload""      /&gt;     &lt;LinearLayout         android:id=""@+id/LinearLayout01""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:gravity=""center_vertical|center_horizontal""     &gt;        &lt;ImageView             android:id=""@+id/ImageView01""             android:src=""@drawable/logo_head""             android:scaleType=""fitStart""             android:adjustViewBounds=""true""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content"" /&gt;     &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;    &lt;FrameLayout         android:id=""@+id/center""         android:layout_height=""fill_parent""         android:layout_width=""fill_parent""         android:layout_weight=""1""&gt;    &lt;/FrameLayout&gt;    &lt;LinearLayout         android:layout_height=""fill_parent""         android:layout_width=""fill_parent""         android:gravity=""center""         android:id=""@+id/footer""        android:layout_weight=""2.6""        android:background=""#ffffff""&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Basically it is composed of a header, a central part (android:id=""@+id/center"") and a footer.The footer contains four dynamically created buttons. At the end it looks like a TabWidget with the tabs at the bottom.</p><p>Each footer's buttons holds an intent/activity.</p><p>The question is: How can I start my activity into the FrameLayout?For instance TabHost does this:</p><pre><code>spec = tabHost        .newTabSpec(tabTitle.toLowerCase())        .setIndicator(tabTitle,res.getDrawable(R.drawable.tab_spec))        .setContent(intent);        tabHost.addTab(spec);</code></pre>","329692","","77914","","2011-03-14 23:31:41","2011-03-14 23:31:41","Android: start an intent into a framelayout","<android><layout><android-intent>","1","0","2","",""
"2761673","1","4541196","","2010-05-03 22:37:16","2","812","<p>I have a widget that is supposed to start and stop a service (start it when it's not running, stop it when it is). This is working fine, however, each time the service is started, my app's main activity is also launched, which I don't want.If I remove the MAIN-intent-filter ( <code>&lt;action android:name=""android.intent.action.MAIN"" /&gt;<br>  &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;</code>) from the app's manifest, it works as I want it to (without launching the main-activity, just the service), but then I obviously don't have a main activity anymore...</p><p>This is how I start the service (I would assume this is the normal way, and I can't see any reference to what might cause the MAIN intent to fire):</p><pre><code>Intent svc = new Intent(this, OnOffService.class);startService(svc);</code></pre><p>Thanks,<br>Nick</p>","241189","","241189","","2010-05-03 23:05:41","2013-08-04 11:58:45","Widget starting a service also starts main activity","<android>","3","1","","",""
"2761761","1","","","2010-05-03 22:56:47","1","530","<p>if i wanted to perform an iris scan, would i need any additional api's or can i just use whats readily available?</p>","331447","","","","","2010-08-20 20:28:17","if i wanted to perform an iris scan, would i need any additional api's or can i just use whats readily available?","<android><api><fingerprint><biometrics>","2","0","","",""
"2761958","1","2785830","","2010-05-03 23:49:52","0","344","<p>I am using three buttons along with the list view.These three buttons are added to the layout using the <code>TableLayout</code> and <code>TableRow</code>.The first button takes more space on content, so the other two becomes smaller in size than first one. When the application runs, it doesn't even show the two other buttons.</p><p>How can I make the size of three buttons equal and display all of them when application runs?Give me some example please.</p><p>Thanks</p>","257580","","257580","","2010-05-08 23:59:30","2010-05-08 23:59:30","How to set the size of multiple buttons on content","<android><button><size>","1","2","","",""
"2762052","1","4833106","","2010-05-04 00:20:22","4","1365","<p>I've developed an android-application that I'dd like to put up on the marketplace. However, I want to split it into two separate applications, one free (with ads), and one paid (logically without ads). How would I go about doing that? I'm not wondering about adding ads (I've alreaddy managed that), but how to take one existing android-application (eclipse-project) and split it into two without having to create a new project and just copy-paste every file one by one (or in batch for that matter). Is that possible?</p><p>Btw, I use GIT for SCM, so I've made two separate branches, one master and one free, but I need to set some cind of config-value that makes shure that the market separates them as two different applications.</p><p>Also, when a user 'upgrades', is it possible to copy the db from the free app to the paid one?</p>","213323","","","","","2014-01-28 15:53:50","Splitting android application in to two 'branches', free and paid","<android><google-play>","4","0","2","",""
"2762243","1","","","2010-05-04 01:23:59","14","8429","<p>I have an <code>ImageView</code> with max height and max width both set to <code>100</code>. The figure below is clearly not a square, but you can use your imagination ;)</p><p>Figure 1:</p><pre><code>+----------------------------------------------+¦ ImageView    +--------------+                ¦¦              ¦              ¦                ¦¦              ¦ Actual image ¦                ¦¦              ¦              ¦                ¦¦              ¦              ¦                ¦¦              ¦              ¦                ¦¦              +--------------+                ¦+----------------------------------------------+</code></pre><p>Anyway, If I try to set a <code>BitMap</code> to the <code>ImageView</code> that does not have a ratio of 1:1, the image is positioned like pictured in Figure 1. What I want is for the picture to be placed to the left inside the <code>ImageView</code> like pictured in Figure 2 below.</p><p>Figure 2:</p><pre><code>+----------------------------------------------+¦--------------+                               ¦¦              ¦                               ¦¦ Actual image ¦                               ¦¦              ¦                               ¦¦              ¦                               ¦¦              ¦                               ¦¦--------------+                               ¦+----------------------------------------------+</code></pre><p>You can see my ImageView in XML below. <code>maxHeight</code>, <code>maxWidth</code> and <code>adjustViewBounds</code> are set during runtime.</p><pre><code>&lt;ImageView android:id=""@+id/someImage""    android:layout_alignParentLeft=""true""    android:layout_below=""@+id/textName""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:paddingRight=""4dp""    /&gt;</code></pre><p>This is in a <code>RelativeLayout</code> if it makes any difference.</p>","230094","","230094","","2010-05-04 01:35:22","2012-10-04 18:32:02","Positioning an image inside an ImageView with max height and max width set","<android><imageview>","7","1","3","",""
"2762406","1","","","2010-05-04 02:14:58","0","615","<p>I am playing with the Demo SoftKeyboard the comes with the Android SDK.</p><p>In portrait mode when the candidate view is shown, it doesn't move the app up as the default android keyboard does. Hence it covers part of the application view.</p><p>What should be changed in order to make the candidate view in the demo softkeyboard behave as the default android keyboard does?</p><p>I've also looked at the source of the android keyboard from git but found nothing related to this behavior.</p>","","Cedric","","Cedric","2010-05-05 09:28:19","2010-05-05 09:28:19","How to make softkeyboard candidate view not block application view?","<android><keyboard><candidate>","0","3","","",""
"2762452","1","2762454","","2010-05-04 02:27:14","1","3031","<p>How do I use obtain a drawable from a <code>Shader</code> (such as <code>LinearGradient</code>) so that I can use it as a background in my UI?</p>","165495","","165495","","2010-05-06 03:53:13","2013-01-18 05:32:57","Shader as a drawable (Android)","<android>","1","0","3","",""
"2762665","1","","","2010-05-04 03:39:15","16","17233","<p>Im new to EMMA, i dont know how to use this for android system.Can anyone please give a sample for using this with android.Thanks a lot.</p>","331996","","120163","","2010-05-04 05:08:45","2012-05-23 12:24:02","How to use EMMA code coverage in android","<android><testing><code-coverage><metrics>","3","0","7","",""
"2762701","1","2873205","","2010-05-04 03:50:42","2","3096","<p>I'm trying to parse a SOAP response that contains nested <code>ComplexType</code>s using the kSOAP library on Android 2.1. </p><pre><code>&lt;event att1=""value1"" att2=""value2"" att3=""value3""&gt;    &lt;tag2&gt; ... &lt;/tag2&gt;   &lt;tag3&gt; ... &lt;/tag3&gt;&lt;/event&gt;</code></pre><p>I've implemented my own class <code>Event</code> that implements <code>org.ksoap2.serialization.KvmSerializable</code> to parse this response.  </p><p>It is not clear to me if and how I can parse/deserialize the attributes (<code>att1</code>, <code>att2</code> and <code>att3</code>) of the <code>event</code> node. Is it even possible with the current kSOAP implementation? </p><p>Thanks. </p>","306346","","306346","","2010-05-04 03:58:31","2012-03-15 13:17:21","XML/SOAP attributes for a complextype in kSOAP","<xml><android><soap><ksoap><complextype>","2","0","2","",""
"2762745","1","","","2010-05-04 04:04:12","1","3943","<p>i need to create a list view that display same functionality as Contact App. I need to have a scroller through which i can traverse the list alphabetically. To achieve this i am following an example from API demos ""<strong>com.example.android.apis.view.List1.java</strong>"". When i implement this functionality on a static list view => it is working fine. But when i try this on a dynamic listview=> it is not working.</p><p>Plz help...</p>","152867","","","","","2010-05-17 14:15:53","Apply Alphabetical Filters on listView on Android os","<android>","0","1","0","",""
"2762793","1","2762921","","2010-05-04 04:19:18","0","462","<p>I have a ListActivity that should display quite a lot of items and where each list item should contain a text and and an image. The images are gotten from a remote server. How can I display the remote image on the list item. Thanks in advance</p>","116477","","","","","2010-05-04 05:04:30","ListActivity Item with remote image","<android><listactivity>","1","0","","",""
"2762861","1","2763047","","2010-05-04 04:44:52","13","15752","<p>I want to go to a web page on the click of a button in my Android app. So say, I have a button called ""Google"", when the user clicks on that button I want google.com to open up on the screen. How is this achieved? </p><p>Also, is there a way I can gain control back to my app once the user is finished with Google?</p>","321927","","56285","","2013-10-17 15:01:25","2013-10-17 15:01:25","Android: Goto HTTP Url on Button Click","<android><http><url><android-activity><android-button>","1","1","3","",""
"2762914","1","2810867","","2010-05-04 05:02:58","1","4893","<p>The title explains all... I have this snippet of code in my application:</p><pre><code>String url = createTelUrl(""3112007315"");Intent intent = new Intent(Intent.ACTION_CALL);intent.setData(Uri.parse(url));context.startActivity(intent);</code></pre><p>It does make a call, but once the call ends, my application crashes. I'd like to return to my application once the call has finished, but I read <a href=""http://stackoverflow.com/questions/1556987/how-to-make-a-phone-call-in-android-and-comes-back-to-my-activity-when-call-is-do"">this post</a> and it seems not to be possible. So... is there anyway to at least pause my application and resume it once the call has finished?</p><p><strong>EDIT:</strong></p><p>Thanks for the two answers I received, I feel I'm really close to my goal... I had already done some of the things you guys suggested. But, maybe I didn't explain some details of the application... I'm developing <em>Who Wants To Be A Millonarie</em> game, so I need to implement calls (I don't know how it's called in USA or other countrys, but here we call it ""call to a friend"").</p><p>Anyway... I've done too many changes to this app and now it's not crashing. But, the Canvas where I draw the UI is not been showed once the called has ended.</p><p>I have a <code>SurfaceView</code> that holds the UI. For that <code>SurfaceView</code> I created a thread that is meant to refresh the UI... this is basically what the thread does:</p><pre><code>@Overridepublic void run() {    Canvas c;    while (_run) {        c = null;        try {            c = _surfaceHolder.lockCanvas(null);            // Check if should wait            synchronized (_surfaceHolder) {                _panel.onDraw(c);            }        } finally {            // do this in a finally so that if an exception is thrown            // during the above, we don't leave the Surface in an            // inconsistent state            if (c != null) {                _surfaceHolder.unlockCanvasAndPost(c);            }        }    }}</code></pre><p>But, once the call has ended I get a black screen. The surface is there (I know it because it still can receive some touch events), but it's not showing anything. Another thing to take in account is how I'm starting the Thread from the <code>SurfaceView</code> class:</p><pre><code>public void surfaceCreated(SurfaceHolder holder) {    hilo.setRunning(true);    try{        hilo.start();    }catch(IllegalThreadStateException ite){        Log.e(""wwtbam"", ""god dammed"");    }}</code></pre><p>This worked nice before I start implementing phone-calls. The problem here is that once the call has ended and it executes again the start method which throws a <code>IllegalThreadStateException</code> because the thread has already been started. I've tried using some 'technics' to pause the UI thread while calling but I haven't been able to solve this problem. I tried doing something like:</p><pre><code>// this in the UI thread classif(haveToWait)    wait();....// this in the surface view classif(callEnded)    hilo.notify();</code></pre><p>But that didn't work. I also have tried some other 'tricks' like using <code>sleep(50);</code> instead of <code>wait();</code> but it does not work either.</p><p>With all that information I provided... what could you suggest to me?</p>","244296","","244296","","2010-09-20 03:53:49","2010-09-20 03:53:49","After making a call programatically, my android app crashes","<java><android><call><phone>","3","0","3","",""
"2762924","1","2767159","","2010-05-04 05:05:34","9","10899","<p>When you get an error like the one below (Android 1.5), is it because there are too many nested ViewGroups, or because the total number of Views is too great?  Are there any tricks to get around it while still keeping the same look to your app?</p><pre><code>java.lang.StackOverflowError   at android.text.Styled.measureText(Styled.java:371)   at android.text.Layout.measureText(Layout.java:1600)   at android.text.Layout.getLineMax(Layout.java:654)   at android.text.Layout.draw(Layout.java:310)   at android.text.BoringLayout.draw(BoringLayout.java:356)   at android.widget.TextView.onDraw(TextView.java:3921)   at android.view.View.draw(View.java:5838)   at android.view.ViewGroup.drawChild(ViewGroup.java:1486)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)   at android.view.ViewGroup.drawChild(ViewGroup.java:1484)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)   at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319)   at android.widget.ListView.dispatchDraw(ListView.java:2820)   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.ViewGroup.drawChild(ViewGroup.java:1484)   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.ViewGroup.drawChild(ViewGroup.java:1484)   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.view.ViewGroup.drawChild(ViewGroup.java:1486)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)   at android.view.View.draw(View.java:5841)   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.ViewGroup.drawChild(ViewGroup.java:1484)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)   at android.view.ViewGroup.drawChild(ViewGroup.java:1484)   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>","238849","","","","","2014-01-01 17:14:34","java.lang.StackOverFlow error. Suspected too many views?","<android>","4","2","1","",""
"2762936","1","2834639","","2010-05-04 05:08:00","2","1913","<p>I'm pretty new to Android and Java, though I've really been excited about what I've learned so far. I'm a little uncertain though on how to implement the Model layer.</p><p>I come from a background in PHP web applications with Zend Framework and the like. I'm used to having an ORM component, through which the Model maps to a database. I haven't really seen anything like this yet for Android, although it's possible I've just not looked hard enough.</p><p>Are there any good tutorials, articles, 3rd party libraries, etc. that specifically address setting up your Model layer for Android apps?</p><p>Thanks!</p>","124732","","","","","2013-07-24 19:32:22","How best to implement a cohesive Model layer for Android MVC apps?","<java><android><model-view-controller><orm><model>","3","1","1","",""
"2762973","1","","","2010-05-04 05:18:37","7","946","<p>Does Android support visually impaired users in the same way as HTML alt tags are used to provide input for screen readers on the web?</p><p>If so, what is the best practice to code Buttons and ImageViews etc so they can be read by a screen reader?</p>","268648","","102703","","2010-05-04 07:28:41","2011-10-01 02:20:34","How to code Android for the visually impaired?","<android><accessibility>","3","0","4","",""
"2763022","1","2855950","","2010-05-04 05:35:11","58","77997","<p>I need to do form input validation on a series of EditTexts. I'm using OnFocusChangeListeners to trigger the validation after the user types into each one, but this doesn't behave as desired for the last EditText.</p><p>If I click on the ""Done"" button while typing into the final EditText then the InputMethod is disconnected, but technically focus is never lost on the EditText (and so validation never occurs).</p><p>What's the best solution?</p><p>Should I be monitoring when the InputMethod unbinds from each EditText rather than when focus changes? If so, how?</p>","332039","","","","","2014-04-07 06:02:58","Android: How can I validate EditText input?","<android><edittext>","13","2","21","",""
"2763060","1","","","2010-05-04 05:44:04","2","428","<p>From my records it seems that SensorEventListener.onSensorChanged callback is called by the same thread that registered the callback. I.e there must be some message-queue synchronization going on in the background which allows the activitys UI-Thread to handle the callbacks. </p><p>That leads to my question: Is there a need to synchronize SensorEventListener.onSensorChanged with the activitys UI-thread, assuming that the activitys UI-thread registered the SensorEventListener?</p><p>I cannot find any documentation references, but can see various examples calling invalidate() unsychronized or synchronize the entire callback.</p><p>I used something along the lines of </p><pre><code>Log.i(TAG, """" + Thread.currentThread().getId()); </code></pre><p>to retrieve threading information. </p><p>I'm running android 2.1 update1. </p><p>Best regards, Christoph </p>","242594","","","","","2010-05-04 05:44:04","Which thread invokes SensorEventListener.onSensorChanged","<java><android>","0","0","","",""
"2763222","1","2763565","","2010-05-04 06:22:53","2","5839","<p>I'm attempting to make a custom ContentProvider so that more than one application (activity?) has access to it. I have several questions about how to do this,</p><p>How do I declare in the code that it is a ContentProvider?How do other applications (activities?) use or import the ContentProvider?</p>","211983","","","","","2012-01-18 14:44:49","custom content providers in android","<android><android-contentprovider>","3","0","2","",""
"2763299","1","","","2010-05-04 06:40:14","-1","216","<p>I bought a umpc on ebay, A Ipad touchscreen like device. I had been looking at a particular hardware model that many sellers had, on which was running Android (1.6). I based my choice on the one that offered ""free"" shipping via UPS (3-5 day) delivery. after the purchase I noticed that the one I bought has Windows CE, not android (!<em>#$</em>^%!!!). Now I want to know if I can get a copy of Android 1.6 or higher and put it on this device. I have looked on google, Torrent sites and ebay, but cannot find a copy of Android OS</p>","332072","","491044","","2011-03-09 10:07:14","2011-03-09 10:07:14","Can I get Android OS?","<android><operating-system><touchpad>","2","4","","2013-02-18 15:56:55",""
"2763354","1","","","2010-05-04 06:52:05","8","3515","<p>I would be obliged if someone could provide me a solution as to which component to be used so that I can display a fairly good looking calendar in my Android application.</p><p>I kept browsing for a solution for the past two days, but unfortunately could not find a solution. Since this is a very basic requisite, I am sure that there will be a perfect solution for this.</p><p>Please help with suggestions, comments and solutions.</p><p>Any help in this regard is well appreciated.</p><p>Looking forward,Regards,Rony</p>","332079","","26428","","2010-07-24 17:31:03","2014-03-03 16:19:25","Displaying Calendar in an Android App","<android><calendar>","5","0","3","",""
"2763395","1","","","2010-05-04 06:58:46","5","16897","<p>I am brand new to Eclipse and Android, but somewhat familiar with Java.  That having been said, I tried to follow the 'Hello Android' tutorial from the developer site using the latest Eclipse (Galieo) and the 2.1 Android SDK,  I am on a Macintosh running Snow Leopard (OS X 10.6).  I have a default virtual device (though my target is actually for phones like my own HTC Incredible which has the snapdragon processor and of course all the latest accoutrement in smart phones).</p><p>Everything seemed to go okay until I went to <code>RUN&gt;RUN</code> and then selected 'Android Application'.  My computer spins its wheels for a while and then I see two errors.  I have pasted the output from Eclipse below:</p><pre><code>[2010-05-04 01:53:46 - HelloAndroid] ------------------------------[2010-05-04 01:53:46 - HelloAndroid] Android Launch![2010-05-04 01:53:46 - HelloAndroid] adb is running normally.[2010-05-04 01:53:46 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch[2010-05-04 01:53:46 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAVD'[2010-05-04 01:53:46 - HelloAndroid] Launching a new emulator with Virtual Device 'myAVD'[2010-05-04 01:53:58 - HelloAndroid] New emulator found: emulator-5554[2010-05-04 01:53:58 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...[2010-05-04 01:53:59 - Emulator] 2010-05-04 01:53:59.501 emulator[10398: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-05-04 01:54:23 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!</code></pre><p>I never do see the text in the emulator and the emulator crashes with a message about it quitting unexpectedly.</p><p>The crash report states:</p><pre><code>Process:         emulator [10472]Path:            /Applications/android-sdk-mac_86/tools/emulatorIdentifier:      emulatorVersion:         ??? (???)Code Type:       X86 (Native)Parent Process:  eclipse [10468]Date/Time:       2010-05-04 02:25:41.153 -0500OS Version:      Mac OS X 10.6.3 (10D573)Report Version:  6Interval Since Last Report:          2558914 secCrashes Since Last Report:           4Per-App Crashes Since Last Report:   2Anonymous UUID:                      C5F178C1-5290-4CA9-AD6E-E9C4F5582754Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x000000001fd2f000Crashed Thread:  3</code></pre><p>NOTE:  Running the emulator from the command line with:</p><pre><code>iainnitro-Mac:tools iainnitro$ ./emulator -avd myAVD2010-05-04 02:49:23.011 emulator[10556:903] Warning once: This application, or a library ituses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.Segmentation faultiainnitro-Mac:tools iainnitro$</code></pre><p>yields a segmentation fault(as noted above from the terminal output).  So the emulator is dying on its own before anything can be shown.</p><p>I have tried restarting the ADB processes.</p><p>The actual code is line by line from the tutorial and I have never been able to get to the XML part yet.</p><p>I am not sure what is wrong with my environment setup or if it is just an incompatibility with Snow Leopard?  I would REALLY appreciate any help in resolving this as I am very interested in developing on this platform.</p><p>Thank-you,</p><p>Mike N Lawrence, Kansas</p>","332084","","82118","","2010-12-21 19:08:00","2013-09-05 05:41:33","Issue with 'Hello Android' tutorial","<android><eclipse><hello-world>","7","1","2","",""
"2763422","1","2763513","","2010-05-04 07:04:27","15","1131","<p>I need to include about 1 MByte of data in a Java application, for very fast and easy access in the rest of the source code. My main background is not Java, so my initial idea was to convert the data directly to Java source code, defining 1MByte of constant arrays, classes (instead of C++ struct) etc., something like this:</p><pre><code>public final/immutable/const MyClass MyList[] = {   { 23012, 22, ""Hamburger""} ,   { 28375, 123, ""Kieler""}};</code></pre><p>However, it seems that Java does not support such constructs. Is this correct? If yes, what is  the best solution to this problem?</p><p>NOTE: The data consists of 2 tables with each about 50000 records of data, which is to be searched in various ways. This may require some indexes later, with significant more records, maybe 1 million records, saved this way. I expect the application to start up very fast, without iterating through these records.</p>","1507543","","1507543","","2010-05-09 15:24:44","2012-09-06 06:48:01","Large amount of constants in Java","<java><android>","11","0","3","",""
"2763460","1","","","2010-05-04 07:12:01","0","908","<p>i need to share data between a local service and his hosting activity,i`am using sendBroadcast in order to send data to the hosting activity from the service,but if i want to send data back to the service from the hosting activity?</p><p>so i though to create static method on the service, and call from the activity, and through it send the parameter, but then i cant do operations like toast inside that static method(which is inside the service)..</p><p>coz you cant use ""myclass.this"" inside a static method, i guess there r more limits..</p><p>mybe another solution? mybe there is a proper way for this task?</p><p>thanks,</p><p>moshik.</p>","273550","","","","","2011-02-03 20:00:03","Share data between local service and the hosting activity","<android>","2","0","","",""
"2763572","1","2769777","","2010-05-04 07:33:58","5","16957","<p>How can I override <code>onDraw</code> so that I take what would have been drawn (as a bitmap) and transform it?</p><p>The method below works, but it unfortunately, this method involves creating a bitmap the size of the entire screen - not just the area that is drawn to. If I use this to draw UI elements, it is redrawn <em>for each UI element</em>. Can this be done more efficiently?</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    //TODO: Reduce the burden from multiple drawing    Bitmap bitmap=Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Config.ARGB_8888);    Canvas offscreen=new Canvas(bitmap);    super.onDraw(offscreen);    //Then draw onscreen    Paint p=new Paint();    p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DARKEN));    canvas.drawBitmap(bitmap, 0, 0, p);}</code></pre>","165495","","82118","","2010-06-05 16:11:50","2013-10-28 10:33:05","Override onDraw to change how the drawing occurs (Android)","<android>","3","0","1","",""
"2763677","1","2800635","","2010-05-04 07:56:27","0","2834","<p>i want to use Android spinner with following data.Spinner will display only text data not code.</p><p>code , text</p><pre><code>1 , a2, b3,c</code></pre><p>...etc</p><p>i have stored above comma seperated data in same activity class (Hard coded form) now if user selects ""a"" from the dropdown then it should get its code rather then text.</p><p>can any one guide me how to achieve this?</p><p>any help would be appriciated.</p>","249991","","","","","2010-05-10 06:07:21","how to use Android Spinner with text and value?","<android><activity>","1","0","","",""
"2763793","1","3889311","","2010-05-04 08:21:39","1","2049","<p>I've noticed that layout_alignBaseline of TextVew control doesn't work with Spinner control.I'm trying to place a text to the left of spinner, but it goes to the top of the parent control.  </p><pre><code>&lt;Spinner  android:id=""@+id/locations""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_below=""@id/userCode""  android:layout_alignLeft=""@id/userCode""  android:layout_marginTop=""15dip""    /&gt;&lt;TextView  android:id=""@+id/locationsLbl""          android:layout_width=""wrap_content""           android:layout_height=""wrap_content""          android:text=""Region""          android:layout_alignBaseline=""@id/locations""      /&gt;  </code></pre><p>Is it a bug or I do something wrong? The same technique works fine with EditText controls.</p>","323128","","323128","","2010-05-07 08:38:36","2013-04-02 08:33:33","Use layout_alignBaseline with Spinner","<android><layout>","3","0","","",""
"2763862","1","2955048","","2010-05-04 08:37:13","2","7237","<p>I am using google map, displaying overlayitems on the google map.</p><p>To create balloon effect, i am using customize view and using geopoints with MapView.LayoutParams to display it at particular location.</p><p>overlayitem's icon and baloon both having same geopoint thats why they both are overriding eatch other.</p><p>I want to display baloon over the overlayitem icon look like it should point to the icon.</p><p>Follwing is my code</p><pre><code>MapView.LayoutParams mapParams = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT, mapEvent.getGeoPoint(), MapView.LayoutParams.BOTTOM_CENTER);</code></pre><p><img src=""http://www.freeimagehosting.net/uploads/01248155f9.jpg"" alt=""alt text""></p><p>I want to display baloon like following please tell me should i decrease lat long to make it top ? or should i change the layout param.Bottom or what i tried different variation not working like following</p><p><img src=""http://www.freeimagehosting.net/uploads/ce73ea432a.jpg"" alt=""alt text""></p>","216431","","","","","2010-10-06 17:50:38","Android Google map balloon over overlayitem","<android><google-maps><balloon><overlays>","1","1","1","",""
"2763881","1","","","2010-05-04 08:42:23","2","851","<p>I have a GridView displaying thumbnails using ImageViews. I am displaying a default image while the thumbnail images are being downloaded from the background(inspired from native applications) i.e. the getView() of my adapter class returns a default Bitmap first and then runs a background thread and replaces the default with actual later.  </p><p>GridViews in iPhone application display a spinner (Animated GIF) instead of default image.   </p><p>How can a similar thing be achieved in Android? </p>","332156","","","","","2011-03-11 00:22:28","ImageView with Spinner","<android><spinner><imageview>","1","1","2","",""
"2763898","1","","","2010-05-04 08:45:33","1","593","<p>I am working on creating multiple displays on a single screen, i.e., I want to run two different activities simultaneously.<br>I came to know that, to achieve this requirement we need to change the surfaceflinger code and some hardware properties in the android source. Can anybody help me in finding the exact procedure in modifying the surfaceflinger and other parts of the android source in order to get two displays </p><p>Thanks in advance.</p>","332158","","","","","2012-08-30 12:20:14","Multiple frame buffer in android","<android>","1","0","1","",""
"2763934","1","2790012","","2010-05-04 08:51:36","0","1899","<p>i have an database with the values of latitude and longitude. i would need to search those values depends on the user input. does the quick search box can search only the database value with the type-to-search feature. Else i want to put a separate EditText and then do the the search process.. if QSB is possible then how to do that? i want to search and drop a pin on the map.. please make a note of it. Any Idea, tutorial and sample codes are most thankful? </p>","267269","","","","","2010-05-07 16:16:27","Does the Quick Search Box search the database in Android? how?","<database><android><sqlite><android-mapview><android-searchmanager>","1","0","","",""
"2764019","1","","","2010-05-04 09:03:51","2","2135","<p>I want to make paging with android <code>GridView</code>, but first I want to know if anyone has an idea of how to do that.</p>","332171","","119895","","2010-09-01 18:49:23","2013-03-19 19:55:36","Android gridview and paging","<android>","1","0","1","",""
"2764248","1","2771371","","2010-05-04 09:49:17","1","3962","<p>I want to display total amount of seconds that was spent each day on a project.</p><p>I want to use SQLiteDatabase to fetch rows using the query below and then use SimpleCursorAdapter to fill a ListView.</p><pre><code>SELECT projectId, date, sum(endedAt-startedAt) as hoursFROM project_reportsWHERE startedAt &gt;= 1270098000AND endedAt &lt;= 1272776399GROUP BY date, projectId</code></pre>","70386","","","","","2010-05-05 07:45:45","Using GROUP BY to fetch rows from SQLiteDatabase and then render them using SimpleCursorAdapter","<android><sqlite><group-by><adapter><adt>","1","1","1","",""
"2764371","1","","","2010-05-04 10:08:47","1","788","<p>I have a custom view that represents something like a photo-collage.</p><p>I need to support the following:</p><ol><li>Fling  </li><li>Zoom In  </li><li>Zoom Out  </li></ol><p>Here's what I currently do:</p><p><code>onDraw:</code></p><ol><li>Look out for the number of images to be drawn.  </li><li>Look out for the images to be drawn and their locations and angles  </li><li>If the image had been downloaded (from the server), draw it. Otherwise, draw some default image.</li></ol><p><code>onTouch:</code>  </p><ol><li><code>action = DOWN: Record X,Y</code>  </li><li><code>action = MOVE: Record X,Y;</code> get the delta; record ""new origins"" and invalidate the UI.</li></ol><p>This will result in redrawing the UI with latest images and coordinates.</p><p>However, this has serious performance problems when the images are still not downloaded the user stars flinging.</p><p>Is it possible to take a ""snapshot"" of the ""view"" and ""pan"" the ""recorded image"" during fling? And when the fling is complete, just update the UI with latest images?</p>","332210","","16587","","2010-05-06 17:47:48","2010-05-06 17:47:48","Android Custom View - Optimizing Redrawing while Fling","<android><canvas><gesture><zooming><smooth-scrolling>","0","0","0","",""
"2764394","1","2768977","","2010-05-04 10:12:52","50","18648","<p>I want to set a global uncaught exception handler for all the threads in my Android application. So, in my <code>Application</code> subclass I set an implementation of <code>Thread.UncaughtExceptionHandler</code> as default handler for uncaught exceptions.</p><pre><code>Thread.setDefaultUncaughtExceptionHandler(                new DefaultExceptionHandler(this));</code></pre><p>In my implementation, I am trying to display an <code>AlertDialog</code> displaying appropriate exception message.</p><p>However, this doesn't seem to work. Whenever, an exception is thrown for any thread which goes un-handled, I get the stock, OS-default dialog (""Sorry!-Application-has-stopped-unexpectedly dialog"").</p><p>What is the correct and ideal way to set a default handler for uncaught exceptions?</p>","236128","","648313","","2012-05-07 14:42:19","2014-02-26 08:53:17","Ideal way to set global uncaught exception Handler in Android","<android><exception-handling><uncaught-exception>","4","3","11","",""
"2764419","1","","","2010-05-04 10:17:46","0","311","<p>Does android phones support CDMA? And do they have an separate MSISDN number?</p>","332225","","46425","","2011-04-29 14:23:04","2011-04-29 14:23:04","Does android phones support CDMA?And do they have an separate MSISDN number?","<android>","1","0","","",""
"2764476","1","2854698","","2010-05-04 10:29:31","1","491","<p>I have a complex custom view - photo collage.</p><p>What is observed is whenever any UI interaction happens, the view is redrawn.</p><p>How can I avoid complete redrawing (for example, use a cached UI) of the view specially when I click the ""back"" button to go back to previous activity because that also causes redrawing of the view.</p><p>While exploring the API and web, I found a method - <code>getDrawingCache()</code> - but don't know how to use it effectively.</p><p>How do I use it effectively?</p><p>I've had other issues with Custom Views that I outline <a href=""http://stackoverflow.com/questions/2764371/android-custom-view-optimizing-redrawing-while-fling"">here</a>.</p>","332210","","16587","","2010-05-06 17:49:47","2010-05-18 05:14:43","Custom View - Avoid redrawing when non-interactive","<android><optimization><rendering>","2","0","","",""
"2764694","1","","","2010-05-04 11:08:05","1","771","<p>Does android support MSISDN number</p>","323422","","","","","2011-03-19 00:13:38","Does android support MSISDN number","<android>","1","0","","",""
"2764733","1","2764853","","2010-05-04 11:14:39","9","4611","<p>How can I check if headphones are currently plugged in. I don't want a broadcastreceiver which informs me when they have been connected to the device. I need something like:</p><pre><code>if(/*headphone is connected*/) ...</code></pre>","283494","","","","","2013-03-05 12:10:30","Android: Checking if headphones are plugged in","<android>","3","0","4","",""
"2764877","1","","","2010-05-04 11:35:03","0","1236","<p>My phone(htc desire) loses connection with HTC Sync, version: 2.0.33 on my laptop when I start eclipse galileo. I have windows 7 32 bit.</p><p>The followings are what I have done to solve this problem but with no luck:</p><ol><li>unplug and replug the usb cable.</li><li>installed the old version of HTC sync</li><li>uninstalled the old version and installed the newst version of HTC sync.</li></ol><p>I'v to log off or restart my laptop to be able to connect the phone with htc sync again but when I start eclipse the connection is lost again!!</p><p>any idea what would the problem be?</p><p>Thank you.</p>","263481","","263481","","2010-05-04 11:37:09","2010-05-05 13:58:57","after starting eclipse my phone (htc desire) disconnects form my pc","<android><eclipse><sync><htc>","1","4","","",""
"2764967","1","","","2010-05-04 11:47:29","0","7634","<p>HI</p><p>i new to android. i want to use ksoap to connect to web service. i have seen a lot of example. but the bet which i am not able to figure out is how to install ksoap in eclips</p><p>so that i can import the ksoap libs</p><p>import org.ksoap2;</p>","332268","","236247","","2011-06-29 04:25:07","2013-01-04 13:45:27","Ksoap in Eclipse","<android><ksoap>","2","0","","",""
"2765137","1","","","2010-05-04 12:18:11","0","186","<p>I'm developing an application in Android. Is there anyway that I can send SMS to destination number, saying my installation is successful - without opening the application or clicking any buttons - immediately after the installation.</p>","332335","","","","","2013-03-14 11:55:02","How to do a task immediately after installation of Android applucation..?","<android>","1","4","","",""
"2765180","1","","","2010-05-04 12:25:55","4","3198","<p>I want to make an Android application using huge third party native libraries which use the Gnu build tools (gnu makefile).</p><p>My question is how to write the ""Android.mk"" files for these libraries in order to build them using the Android build system or the Android NDK.</p><p>Thanks in advance</p>","1832564","","","","","2013-02-21 20:22:53","How to write Android.mk for library using Gnu makefile","<android><android-ndk><gnu-make>","4","0","","",""
"2765183","1","4597314","","2010-05-04 12:26:09","2","2207","<p>I'm having this problem only on Motorola Milestone. Code:</p><pre><code>// init recorderrecordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC,    8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,    AudioFormat.ENCODING_PCM_16BIT, 8000);recordInstance.startRecording();//more code hererecordInstance.stop();</code></pre><p>The errorinformation I have (can't find more for the moment since I don't have a milestone myself for debugging):</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.IllegalStateException: stop() called on an uninitialized AudioRecord.at android.media.AudioRecord.stop(AudioRecord.java:51 6)</code></pre><p>Apparantly I'm not the only one with this problem. Some very similar threads I found (without solution):</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/6dd24aeb484b2e40"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/6dd24aeb484b2e40</a><a href=""http://androidcommunity.com/forums/f2/problem-using-audiorecord-in-motorola-milestone-30935/"" rel=""nofollow"">http://androidcommunity.com/forums/f2/problem-using-audiorecord-in-motorola-milestone-30935/</a><a href=""http://community.developer.motorola.com/t5/Android-App-Development-for/Problem-using-AudioRecord-on-Milestone-device/m-p/3889"" rel=""nofollow"">http://community.developer.motorola.com/t5/Android-App-Development-for/Problem-using-AudioRecord-on-Milestone-device/m-p/3889</a><a href=""http://www.fring.com/forums/showthread.php?t=16194"" rel=""nofollow"">http://www.fring.com/forums/showthread.php?t=16194</a><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/63be273ba59c635e/1c4a010fd470d328"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/63be273ba59c635e/1c4a010fd470d328</a></p>","312743","","1534123","","2012-10-26 15:42:51","2012-10-26 15:42:51","AudioRecord doesn't work for Motorola Milestone","<android><android-audiorecord>","3","0","2","",""
"2765328","1","","","2010-05-04 12:45:38","1","134","<p>By looking at the link <a href=""http://stackoverflow.com/questions/2001254/downloading-sent-mails-from-yahoo-gmail-and-hotmail"">http://stackoverflow.com/questions/2001254/downloading-sent-mails-from-yahoo-gmail-and-hotmail</a>is it possible to invoke or call Gmail and open a message programmatically</p>","328480","","1109425","","2012-01-08 18:49:15","2012-01-08 18:49:15","Android Email Application: Open a Message directly","<android>","1","0","","",""
"2765332","1","2767142","","2010-05-04 12:46:08","3","6910","<p>So, why does this code:</p><pre><code>package org.popoffka.apicross;import android.app.Activity;import android.os.Bundle;import android.widget.Button;public class Game extends Activity { @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     Button testButton = new Button(this);     testButton.setBackgroundResource(R.drawable.cell);     testButton.setWidth(20);     testButton.setHeight(20);     setContentView(testButton); }}</code></pre><p>...produce this thing:<a href=""http://i42.tinypic.com/2hgdzme.png"" rel=""nofollow"">http://i42.tinypic.com/2hgdzme.png</a> even though there's a setWidth(20) and setHeight(20) in the code?(R.drawable.cell is actually a 20x20 PNG image containing a white cell with a silver border)</p>","378377","","378377","","2010-05-04 13:07:17","2011-11-20 15:11:21","Android ignoring my setWidth() and setHeight()","<android><design><button><view>","2","0","1","",""
"2765383","1","2765449","","2010-05-04 12:53:40","2","873","<p>I have been placing several ImageButtons programmatically in a TableLayout, every ImageButton has it's own Drawable resource as a Background.I use an XML description for the layout of the ImageButton itself and afterwards use the LayoutInflater to retrieve such an ImageButton (called genre_cell.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ImageButtonxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/genreCellItemId"" android:layout_weight=""1""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""center_horizontal""android:paddingLeft=""5dip"" android:paddingRight=""5dip""&gt;&lt;/ImageButton&gt;</code></pre><p>And in my class I do :</p><pre><code>myButton = (ImageButton) inflater.inflate(R.layout.genre_cell, row, false);</code></pre><p>I have actually attached an onClickListener on every ImageButton, but now I'd like to uniquely identify which ImageButton has been clicked...I thought that maybe I could somehow retrieve the Drawable's ID used for the background and check that one with the available Drawable's int values ?Is this an option and if so how should it be implemented ?Also are there any other options ?</p>","162147","","","","","2010-05-04 13:47:09","Uniquely Identify ImageButtons placed Programmatically","<android><imagebutton>","2","2","","",""
"2765515","1","2766058","","2010-05-04 13:09:18","0","2434","<p><p>I have the following problem:<p>I would like to change value of ExpandableListView's cell on click. How should I do that?</p><p>Here is what I'm using:</p><pre><code>    public class TemplateActivity extends ExpandableListActivity {     private SimpleExpandableListAdapter expListAdapter = null;     protected void onCreate(Bundle savedInstanceState) {  setContentView(R.layout.template_create);     expListAdapter = new SimpleExpandableListAdapter(    this, createGroupList(),     R.layout.template_create_group_row,     new String[] { KEY_GROUP },     new int[] { R.id.create_template_groupname },     createChildList(),     R.layout.flower_template_create_child_row,     new String[] { KEY_ATTRIBUTE_VALUE },     new int[] { R.id.flowerx_text_attr }  );  setListAdapter(expListAdapter);     } private List&lt;HashMap&lt;String, String&gt;&gt; createGroupList() {  ArrayList&lt;HashMap&lt;String, String&gt;&gt; result = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();  for (String entryKey: &lt;ArrayOfGroupTitles&gt;) {   HashMap&lt;String, String&gt; m = new HashMap&lt;String, String&gt;();   m.put(KEY_GROUP, entryKey);   result.add(m);  }  return result; } private List&lt;ArrayList&lt;HashMap&lt;String, Object&gt;&gt;&gt; createChildList() {  ArrayList&lt;ArrayList&lt;HashMap&lt;String, Object&gt;&gt;&gt; result = new ArrayList&lt;ArrayList&lt;HashMap&lt;String, Object&gt;&gt;&gt;();  for (String entryKey: fieldsInList.keySet()) {   ArrayList&lt;HashMap&lt;String, Object&gt;&gt; secList = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();   HashMap&lt;String, Object&gt; attrVal = new HashMap&lt;String, Object&gt;();   attrVal.put(KEY_ATTRIBUTE_VALUE, String.valueOf(fieldsInList.get(entryKey).getFieldValue()));   secList.add(attrVal);   result.add(secList);  }  return result; }</code></pre><p>Application is in progress stage, so attrVal will contain several attributes ( which can be put or not depend on some logic), so I'm using this type of adapter and this way of filling cells' data.</p><p>fieldsInList - external variable of LinkedHashMap type. </p><p>I have a function which can change one of the member's of fieldsInList variable. How should I notify my expListAdapter or ExpanableListView to be refreshed?</p>","332311","","","","","2010-05-04 15:02:59","Android. update ExpandableListView","<android><listview>","2","0","","",""
"2765636","1","","","2010-05-04 13:24:10","4","4252","<p>I am facing a probleme with threads and sockets I cant figure it out, if someone can help me please i would really appreciate.</p><p><strong>There are the facts</strong> :</p><p>I have a service class NetworkService, inside this class I have a Socket attribute.I would like it be at the state of connected for the whole lifecycle of the service. </p><p>To connect the socket I do it in a thread, so if the server has to timeout, it would not block my UI thread.</p><p>Problem is, into the thread where I connect my socket everything is fine, it is connected and I can talk to my server, once this thread is over and I try to reuse the socket, in another thread, I have the error message <code>Socket is not connected</code>.</p><p>Questions are :     - Is the socket automatically disconnected at the end of the thread?     - Is their anyway we can pass back a value from a called thread to the caller ?</p><p>Thanks a lot,</p><p><strong>Here is my code</strong></p><pre><code>  public class NetworkService extends Service {        private Socket  mSocket = new Socket();  private void _connectSocket(String addr, int port) {        Runnable connect = new connectSocket(this.mSocket, addr, port);        new Thread(connect).start();  }  private void _authentification() {        Runnable auth = new authentification();        new Thread(auth).start();  }  private INetwork.Stub mBinder = new INetwork.Stub() {        @Override        public int doConnect(String addr, int port) throws RemoteException {            _connectSocket(addr, port);            _authentification();            return 0;        }    };class connectSocket implements Runnable {        String  addrSocket;        int portSocket;        int TIMEOUT=5000;        public connectSocket(String addr, int port) {            addrSocket = addr;            portSocket = port;        }        @Override        public void run() {            SocketAddress socketAddress = new InetSocketAddress(addrSocket, portSocket);            try {                mSocket.connect(socketAddress, TIMEOUT);                PrintWriter out = new PrintWriter(mSocket.getOutputStream(), true);                out.println(""test42"");                            Log.i(""connectSocket()"", ""Connection Succesful"");            } catch (IOException e) {                Log.e(""connectSocket()"", e.getMessage());                e.printStackTrace();            }               }    }    class authentification implements Runnable {        private String constructFirstConnectQuery() {            String query = ""toto"";            return query;        }        @Override        public void run() {            BufferedReader  in;            PrintWriter out;            String      line = """";            try {                in = new BufferedReader(new InputStreamReader(mSocket.getInputStream()));                out = new PrintWriter(mSocket.getOutputStream(), true);                out.println(constructFirstConnectQuery());                while (mSocket.isConnected()) {                    line = in.readLine();                    Log.e(""LINE"", ""[Current]- "" + line);                }            }             catch (IOException e) {e.printStackTrace();}        }    }</code></pre>","290613","","","","","2010-05-04 16:05:09","Sockets, Threads and Services in android, how to make them work together?","<java><android><sockets><multithreading><runnable>","1","1","2","",""
"2765672","1","","","2010-05-04 13:28:40","2","292","<p>I have a question regarding the creation of an <code>IntentFilter</code>. I'm currently writing JUnit-tests for an Android application and want to make use of <code>ActivityMonitors</code>. To be more specific: I want to  create an <code>ActivityMonitor</code> which listens for calls to the address book as our Application requests the user to choose a contact from the address book. So I want to mock this by using an <code>ActivityMonitor</code>. This is what I have done so far:</p><pre><code>ActivityMonitor addressBookMonitor = null;try {        addressBookMonitor = getInstrumentation().addMonitor(new IntentFilter(Intent.ACTION_PICK,""content://contacts/people/""), null, false);    } catch (MalformedMimeTypeException e) {        e.printStackTrace();    }//code to open the address bookActivity addressBook = getInstrumentation().waitForMonitorWithTimeout(addressBookMonitor, 250);assertNotNull(addressBook);</code></pre><p>The problem is, that the assertion always fails although I can see the address book opening in front of our application. Even increasing the timeout value doesn't help. This leads me to the assumption, that my <code>ActivityMonitor</code>/<code>IntentFilter</code> is set up with wrong values.</p><p>Maybe someone can help?</p>","304266","","1748142","","2012-10-26 06:26:36","2012-10-26 06:26:36","IntentFilter for address book","<android><unit-testing>","0","0","","",""
"2765891","1","2765957","","2010-05-04 13:55:37","1","367","<p>Edit: This was user error (sorry). I have answered it below.</p><p>I am developing an application that needs to access data on the sd card. When I run on my development device (an odroid with Android 2.1) I have root access and can construct the path using:</p><pre><code>File sdcard = Environment.getExternalStorageDirectory();String path = sdcard.getAbsolutePath() + File.separator + ""mydata""File data = new File(path);File[] files = data.listFiles(new FilenameFilter() {    @Override    public boolean accept(File dir, String filename) {        return filename.toLowerCase().endsWith("".xyz"");    }});</code></pre><p>However, when I install this on a phone (2.1) where I do not have root access I get files == null. I assume this is because I do not have the right permissions to read the data from the sd card. I also get files == null when just trying to list files on /sdcard. So the same applies without my constructed path.</p><p>Also, this app is not intended to be distributed through the app store and is needs to use data copied separately to the sd card so this is a real use-case. It is too much data to put in res/raw (I have tried, it did not work).</p><p>I have also tried adding:</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></pre><p>to the manifest, even though I only want to read the sd card, but it did not help. I have not found a permission type for reading the storage.</p><p>There is probably a correct way to do this, but I haven't been able to find it. Any hints would be useful.</p>","128800","","1178337","","2014-02-14 14:05:29","2014-02-14 14:05:29","Is it possible to read data that has been separately copied to the Android sd card without having root permissions?","<android><permissions><storage><android-sdcard>","1","0","0","",""
"2765980","1","2868611","","2010-05-04 14:07:58","15","21595","<p>I know this has been asked before, but at this time the answer of the post is not true.<a href=""http://stackoverflow.com/questions/2610587/how-to-programmatically-answer-a-call"">http://stackoverflow.com/questions/2610587/how-to-programmatically-answer-a-call</a></p><p>Vringo and other apps does answer the phone by pressing a button on their app, so there must be a way to do it.</p><p>Anyone has a suggestion?</p>","332432","","114066","","2010-08-11 15:16:03","2013-01-16 00:04:50","Android - How to programmatically answer a call","<android><call>","1","0","17","",""
"2766013","1","2766092","","2010-05-04 14:12:47","0","415","<p>I have an app with a widget that loads an activity to perform an action.  It works great almost always, but every so often it will be unresponsive and I will have to start the app again to get it to start working again.  Does anyone have an idea as to why this is happening?</p>","274365","","","","","2010-05-04 14:26:24","android widget stop working","<android><widget>","1","1","","",""
"2766252","1","2769259","","2010-05-04 14:41:13","0","3411","<p>i have the following problem. </p><p>I am working with a library of maps which paints the icons on the map using drawables and canvas. </p><p>Now, i'm trying to modify it in order to the user can click on icons. So i want to attach drawables into different ImageView with a onClickListener. </p><p>However, i don't know how i can paint the ImageView using canvas from method onDraw. </p><p>I've tried with:</p><pre><code>ImageView iv = new ImageView(context);iv.setDrawableResource(drawable);iv.draw(c)</code></pre><p>But it doesn't appears in screen.</p><p>Any idea? Thanks</p>","258863","","","","","2010-05-04 21:59:19","Android ImageView draw","<android><canvas>","1","0","1","",""
"2766648","1","","","2010-05-04 15:27:40","1","3798","<p>I have developed an application which has several packages within it's project...A class in one of those packages is called right away in the first line of code, which throws the dreaded java.lang.NoClassDefFoundError error...I don't get it, the package simply is within the project, and it works fine on my Android 1.6 device, but won't work with my 1.5 device...I do have to say that the project was originally set for 1.6, but then I changed the  within the manifest from 4 to 3...Is that bad practice ? Or maybe it has nothing to do with the platform version ?</p><p>Also I do get these lines as wel from the DDMS : </p><pre><code>05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build;05-04 17:24:59.921: WARN/dalvikvm(2041): VFY:  rejecting opcode 0x62 at 0x003405-04 17:24:59.921: WARN/dalvikvm(2041): VFY:  rejected ***/android/managementModule/Management;.getDeviceSpecifics ()V05-04 17:24:59.921: WARN/dalvikvm(2041): Verifier rejected class ***/android/managementModule/Management;</code></pre><p>Thats the ManagementModule which also tries to retrieve several info-fields of the device itself...Again, this works just fine on the 1.6 device, even though thats a development device whilst my 1.5 device is a non-development device...</p>","162147","","162147","","2010-05-05 07:26:22","2010-05-05 07:26:22","java.lang.NoClassDefFoundError thrown with my own packages in Android 1.5","<android><package><noclassdeffounderror>","1","1","","",""
"2766711","1","","","2010-05-04 15:35:31","5","2970","<p>It seems that this question has been asked before, I just would like to know whether there is an update in Android.</p><p>I plan to write an audio application involving low delay audio I/O (appr. &lt; 10 ms). It seems not to be possible based on the methods proposed by the SDK, hence is there - in the meantime - a way to achieve this goal using the NDK?</p>","332530","","143804","","2010-05-04 16:12:21","2013-02-18 12:46:20","Low delay audio on Android via NDK","<android><audio><android-ndk>","2","0","1","",""
"2766713","1","2836585","","2010-05-04 15:35:37","92","104323","<p>Is it possible to download the Android SDK components for offline install without using the SDK Manager?The problem is I am behind a firewall which I have no control over and both sites download URLs seem to be blocked (throws a connection refused exception)</p><p><a href=""https://dl-ssl.google.com/android/repository/repository.xml"">https://dl-ssl.google.com/android/repository/repository.xml</a></p><p><a href=""http://dl-ssl.google.com/android/repository/repository.xml"">http://dl-ssl.google.com/android/repository/repository.xml</a></p><pre><code>Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Connection refused: connect</code></pre><p><strong>EDIT:</strong> I am using Windows XP</p>","61525","","61525","","2010-05-04 15:59:35","2014-02-16 23:45:01","Android: Download the Android SDK components for offline install","<android>","10","3","28","",""
"2766825","1","2766849","","2010-05-04 15:50:41","0","2208","<p>I've created an SQLiteDatabase in my app and populated it with some data.  I can connect to my AVD with a terminal and when I issue select * from articles; I get a list of all the rows in my table and everything looks fine.  However, in my code when I query my table, I get a cursor back that has my tables columns, but zero rows of data.  Here is my code..</p><pre><code> mDbHelper.open();    Cursor articles = mDbHelper.fetchAllArticles();    startManagingCursor(articles);    Cursor feeds = mDbHelper.fetchAllFeeds();    startManagingCursor(feeds);    mDbHelper.close();    int titleColumn = articles.getColumnIndex(""title"");     int feedIdColumn = articles.getColumnIndex(""feed_id"");     int feedTitleColumn = feeds.getColumnIndex(""title"");    /* Check if our result was valid. */    if (articles != null) {     int count = articles.getCount();         /* Check if at least one Result was returned. */         if (articles.moveToFirst()) {</code></pre><p>In the above code, my Cursor articles returns with my 4 columns, but when I call getCount() it returns zero, even though I can see hundreds of rows of data in that table from command line.  Any idea what I might be doing wrong here?</p><p>Also.. here is my code for fetchAllArticles..</p><pre><code>public Cursor fetchAllArticles() {    return mDb.query(ARTICLES_TABLE, new String[] {ARTICLE_KEY_ROWID, ARTICLE_KEY_FEED_ID, ARTICLE_KEY_TITLE,            ARTICLE_KEY_URL}, null, null, null, null, null);}</code></pre>","326430","","468793","","2012-05-05 12:15:47","2012-05-05 12:15:47","Cursor returns zero rows from query to table","<android><database><sqlite><cursor>","1","1","","",""
"2767354","1","8770325","","2010-05-04 17:07:06","15","10607","<p>How do you get the default value of an Android preference defined in XML?</p><p>Context: I don't want to repeat the definition of the default value in both the code and the preferences XML.</p>","143378","","143378","","2010-05-04 17:28:39","2013-08-02 23:53:39","Default value of Android preference","<android><preferences><android-preferences>","3","1","2","",""
"2767407","1","2768001","","2010-05-04 17:15:29","5","11437","<p>I have matrix. This matrix represents array x and y coordinates. For example </p><pre><code>float[] src = {7,1,7,2,7,3,7,4};</code></pre><p>I need to rotate this coordinates to 90 degrees.I use  <code>android.graphics.Matrix</code> like this:</p><pre><code>    float[] src = {7,1,7,2,7,3,7,4};    float[] dist = new float[8];    Matrix matrix = new Matrix();    matrix.preRotate(90.0f);    matrix.mapPoints(dist,src);</code></pre><p>after operation rotate I have array with next values</p><pre><code>-1.0    7.0     -2.0    7.0     -3.0    7.0     -4.0    7.0</code></pre><p>Its is good for area with 360 degrees. And how do rotate in area from 0 to 90? I need set up center of circle in this area but how ?<br>Thanks.</p>","272774","","","","","2010-12-27 18:46:32","Android Rotate Matrix","<java><android>","3","0","2","",""
"2767442","1","2767506","","2010-05-04 17:20:04","1","1340","<p>what are the best practices parsing XML from an HTTP resource in Android? I've been using HttpURLConnection to retrieve an InputStream, wrapping it with a BufferedInputStream, and then using SAX to parse the buffered stream. For the most part it works, though I do receive error reports of SocketTimeoutException: The operation timed out or general parsing error. I believe it's due to the InputStream.</p><ol><li>Would using HttpClient instead of HttpURLConnection help? If yes, why?</li><li>Should the stream be output to a file, having the file parsed instead of the stream?</li></ol><p>Any input or direction would be greatly appreciated. Thanks for your time.</p>","264734","","264734","","2010-05-04 17:35:25","2011-04-08 10:24:37","Best practices retrieving XML/stream from HTTP in Android","<java><xml><android><http><parsing>","1","2","1","",""
"2767571","1","2767613","","2010-05-04 17:36:42","11","12066","<p>Can I create index on a column in the create table command in sqlite?</p><p>I tried this command below in sqlite3 in Android shell. It seems to work.</p><pre><code>sqlite&gt; create table mytest (id integer indexed);sqlite&gt; .schemaCREATE TABLE mytest (id integer indexed);</code></pre><p>But, in sqlite's query language specification, specifying a column to be indexed is not supported:</p><p><a href=""http://www.sqlite.org/lang_createtable.html"">http://www.sqlite.org/lang_createtable.html</a></p><p>Did I miss something?</p><p>Thanks.</p>","256239","","","","","2012-04-05 18:11:35","create a indexed column in sqlite","<android><sqlite><sqlite3>","1","0","5","",""
"2767643","1","2768055","","2010-05-04 17:45:37","3","3046","<p>Ok, I am trying to create a custom view called <code>CheckedRelativeLayout</code>.</p><p>It's purpose is the same as a <code>CheckedTextView</code>, to be able to use it in a list of items you want selected or in a <code>Spinner</code>.</p><p>It's all working fine now, I extended <code>RelativeLayout</code> and implemented <code>Checkable</code> interface.</p><p>However, I am stuck on a quite simple problem: Where can I find the <code>Drawable</code> that <code>CheckedTextView</code> and <code>RadioButton</code> use?</p><p>I looked at the sourcecode of both, and they seem to use <code>com.android.internal.R</code>. Well... that's internal stuff. So I can't access it.</p><p>Any way to get these Drawables or solve the problem somehow?</p>","107029","","107029","","2010-05-04 18:16:12","2010-05-07 17:34:35","Android: Where to find the RadioButton Drawable?","<android><radio-button><drawable>","3","0","0","",""
"2767660","1","2768039","","2010-05-04 17:48:35","2","417","<p>Hi I'm developing an Android app and trying to incorporate maps into one of my sub-activities.  Having followed all of the instructions from Android, my java file will not recognize the ""MapActivity"" or the import statements to include the needed api.  Here is my XML manifest and my class file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>  &lt;uses-permission android:name=""android.permissions.INTERNET""/&gt;  &lt;uses-permission android:name=""android.permissions.ACCESS_FINE_LOCATION""/&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt; &lt;uses-library android:name=""com.google.android.maps"" /&gt;      &lt;activity android:name="".CadetCommand""              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=""RedLight""&gt;&lt;/activity&gt;    &lt;activity android:name=""PTCalculator""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7""/&gt;</code></pre><p> </p><p>here is my java file:</p><pre><code>    package edu.elon.cs.mobile;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import android.os.Bundle;public class LandNav extends MapActivity{}</code></pre><p>Any suggestion would help.</p>","180825","","","","","2010-05-04 18:42:43","Get Eclipse to recognize the maps api","<java><xml><android>","2","0","","",""
"2767770","1","4764960","","2010-05-04 18:01:31","8","3149","<p>Is it possible to set the priority attribute of a BroadcastReceiver programmatically or can it only be done in XML?Relevant documents include:</p><p><a href=""http://developer.android.com/reference/android/content/BroadcastReceiver.html"">http://developer.android.com/reference/android/content/BroadcastReceiver.html</a></p><p><a href=""http://developer.android.com/reference/android/R.styleable.html"">http://developer.android.com/reference/android/R.styleable.html</a></p><p>It doesn't seem so, but I don't fully understand the relationship of android.R.styleable to a given application and its activities...</p>","299080","","","","","2011-01-21 23:32:18","Possible to set BroadcastReceiver priority programmatically?","<android><broadcast><priority><broadcastreceiver>","1","0","3","",""
"2767869","1","","","2010-05-04 18:16:05","0","12688","<p>In my app, I start an activity and then on button click, display an http url (using Intent - VIEW_ACTION)</p><p>So when in the middle of the activity, if the user clicks the button called ""Google"", it opens up google.com in the browser. </p><p>When I hit the back button, it comes back to my original activity screen. How can I get my activity to resume from where it left of?</p><p>ThanksGeorge</p>","324632","","","","","2010-12-14 23:38:59","Android Resume Activity","<android><activity><resume>","1","1","","",""
"2768101","1","","","2010-05-04 18:50:18","2","269","<p>I want my Android app to have maximum reach, and hence want to support all versions V1.5 onwards. I find some features lacking in V1.5 that are available in V2.0 or V2.1. Could I compile on V2.1, and then set minSDK for the app to run on 1.5?</p><p>Plain logic says 2.1 specific features would not work, but let me know your thoughts.</p><p>Also, what are some other workarounds? What would ""you"" normally do in such a situation?</p>","325158","","","","","2010-05-04 19:45:24","Can I compile an Android App on 2.1 and have support for all versions 1.5 onwards?","<android><mobile>","2","1","","",""
"2768179","1","","","2010-05-04 19:01:45","1","1063","<p>I want to develop an gps application that can navigate to some predermined locations in a database.</p><p>I have created a mapview wich is working just fine, I also have a MyLocationOverlay to show my position and I have a ItemzedOverlay to show the locations to which I want to navigate. This is no problem. the problem is the creation of a route from the phones location to a predermined location.</p><p>If anyone knows anything I will be happy for your answers!</p><p>//</p>","332710","","1869904","","2012-12-24 08:27:21","2012-12-24 08:27:21","google maps navigation","<android><google-maps>","1","1","1","",""
"2768274","1","2839862","","2010-05-04 19:14:58","7","1315","<p>my app does something when the screen goes black, but I want it to only carry out that task if the screen was turned off ""by itself"", through a screen timeout - NOT when the user presses the power-button. Is there any way to distinguish between these two events?</p><p><code>ACTION_SCREEN_OFF</code> obviously fires in both cases, and I haven't found any other intents that might match what I'm looking for. </p><p>Thanks for your help,Nick</p>","241189","","241189","","2010-05-04 22:26:00","2013-05-22 20:53:18","Distinguish between screen timeout and power-button-press?","<android><android-intent>","4","5","2","",""
"2768297","1","","","2010-05-04 19:18:12","1","160","<p>How do you get a reference to the window from outside of an Activity or from the context?</p><p>Is it possible to access the window without having a reference to an activity?</p>","143378","","143378","","2010-08-12 20:44:01","2010-08-12 20:44:01","Reference to Window in Android","<android><window><context>","1","0","","",""
"2768512","1","2785705","","2010-05-04 19:51:08","1","940","<p>When looking at the Contact Groups on Google Contacts or in the People application of my HTC Legend phone, I get the groups names ok eg: Friends, Family, VIP, Favorite etc...</p><p>But in my application I get really wrong names such as<br>""Family"" became ""<strong>System Group: Family</strong>""<br>""Friends"" became ""<strong>System Group: Friends</strong>""<br>""Favorite"" became ""<strong>Favorite_5656100000000_3245664334564</strong>""  </p><p>I use the below code to read these values:</p><pre><code>public Cursor getFromSystem() {        // Get the base URI for the People table in the Contacts content        // provider.        Uri contacts = ContactsContract.Groups.CONTENT_URI;        // Make the query.        ContentResolver cr = ctx.getContentResolver();        // Form an array specifying which columns to return.        String[] projection = new String[] {                ContactsContract.Groups._ID, ContactsContract.Groups.TITLE,                ContactsContract.Groups.NOTES        };        Cursor managedCursor = cr.query(contacts, projection, ContactsContract.Groups.DELETED                + ""=0"", null, ContactsContract.Groups.TITLE + "" COLLATE LOCALIZED ASC"");        return managedCursor;    }</code></pre><p>What I am missing?</p>","243782","","","","","2010-05-07 01:54:21","Getting really weird long Contact Group names","<android><android-sdk-2.1><contactgroups>","1","0","1","",""
"2768686","1","","","2010-05-04 20:19:30","0","175","<p>Im trying to create an rss feed that my droid app reads but i have some holes that i can figure how to fix the json link page is <a href=""http://www.mandarich.com/mandarichServer/mlb/indexbaseball.php"" rel=""nofollow"">http://www.mandarich.com/mandarichServer/mlb/indexbaseball.php</a> when reading the json i can see where the icon is missing on some and cant figure out why. mainly only for citys like ney york and chicago(cities with two names)and the code i have for the php is as follows: </p><pre><code>&lt;?php$teams[""boston""] = ""bostonredsox.gif"";$teams[""nyyankees""] = ""nyyankees.gif"";$teams[""baltimore""] = ""baltimoreorioles.gif"";$teams[""tampa""] = ""tampabayrays.gif"";$teams[""toronto""] = ""torontobluejays.gif"";$teams[""atlanta""] = ""atlantabraves.gif"";$teams[""florida""] = ""floridamarlins.gif"";$teams[""nymets""] = ""newyorkmets.gif"";$teams[""philadelphia""] = ""philadelphiaphillies.gif"";$teams[""washington""] = ""washingtonnationals.gif"";$teams[""chicagosox""] = ""chicagowhitesox.gif"";$teams[""cleveland""] = ""clevelandindians.gif"";   $teams[""detroit""] = ""detroittigers.gif"";$teams[""kansas""] = ""kansascityroyals.gif"";$teams[""minnesota""] = ""minnesotatwins.gif"";$teams[""chicagocubs""] = ""chicagocubs.gif"";$teams[""cincinnati""] = ""cinncinatireds.gif"";$teams[""houston""] = ""houstonastros.gif"";$teams[""milwaukee""] = ""milwaukeebrewers.gif"";$teams[""pittsburgh""] = ""pitsburghpirates.gif"";$teams[""St.Louis""] = ""stlouiscardinals.gif"";$teams[""LaAngels""] = ""losangelesangels.gif"";$teams[""oakland""] = ""oaklandathletics.gif"";$teams[""seattle""] = ""seattlemariners.gif"";$teams[""texas""] = ""texasrangers.gif"";$teams[""arizona""] = ""arizonadiamondbacks.gif"";$teams[""colorado""] = ""coloradorockies.gif"";$teams[""ladodgers""] = ""losangelesdodgers.gif"";$teams[""sandiego""] = ""sandiegopadres.gif"";$teams[""sanfrancisco""] = ""sanfranciscogiants.gif"";$abbr[""arizona""] = ""ARI"";$abbr[""oakland""] = ""OAK"";$abbr[""baltimore""] = ""BAL"";$abbr[""tampa""] = ""TAM"";$abbr[""boston""] = ""BOS"";$abbr[""nyyankees""] = ""NYY"";$abbr[""texas""] = ""TEX"";$abbr[""toronto""] = ""TOR"";$abbr[""LaAngels""] = ""LAA"";$abbr[""atlanta""] = ""ALT"";$abbr[""colorado""] = ""COL"";$abbr[""philadelphia""] = ""PHI"";  $abbr[""florida""] = ""FLA"";$abbr[""milwaukee""] = ""MIL"";$abbr[""washington""] = ""WAS"";$abbr[""chicagosox""] = ""CHW"";$abbr[""cleveland""] = ""CLE"";$abbr[""detroit""] = ""DET"";$abbr[""seattle""] = ""SEA"";$abbr[""sanfrancisco""] = ""SFO"";$abbr[""St.Louis""] = ""STL"";$abbr[""chicagocubs""] = ""CHC"";$abbr[""houston""] = ""HOU"";$abbr[""nymets""] = ""NYM"";$abbr[""cincinnati""] = ""CIN"";$abbr[""sandiego""] = ""SDG"";$abbr[""ladodgers""] = ""LAD"";$abbr[""pittsburgh""] = ""PIT"";$abbr[""minnesota""] = ""MIN"";$abbr[""kansas""] = ""KAN"";?&gt;</code></pre>","305307","","305307","","2010-05-05 16:49:56","2010-12-13 14:36:46","Not sure how to link json 100% in php","<php><android><json><hyperlink>","1","6","","",""
"2768709","1","2768739","","2010-05-04 20:23:40","0","583","<p>Say I have multiple EditTexts in an application. When I click a Button, I want to test what EditTexts are empty and what EditTexts have content. I also want the id of the EditText whose content is NOT empty. How would I do that? Could someone write the code for the Button click handler. My six EditText's ids are FirstString, SecondString, ThirdString, ... The Button's id is button.</p>","200477","","200477","","2010-05-04 20:45:13","2010-05-05 20:07:05","Test if Multiple EditTexts are empty","<java><android><events><edittext>","2","0","","",""
"2768806","1","2768820","","2010-05-04 20:37:27","39","18738","<p>How can I find out which API level my device is using? </p><p>The firmware version is 1.6.  Does that mean it uses API Level 4?</p>","283494","","85950","","2013-01-24 20:25:04","2014-01-07 14:41:13","Programmatically obtain the Android API level of a device?","<android>","2","0","7","",""
"2768860","1","2769016","","2010-05-04 20:44:14","0","587","<p>In android, is there such a thing for listening if a View is pressed?In background drawable, i can set assert depends on the view is pressed or not.</p><p>Is it possible for me to add a Listener for a View when I pressed it?</p><p>Thank you.</p>","286802","","","","","2010-05-04 21:11:58","Pressed Listener for a View","<android>","2","0","","",""
"2769020","1","","","2010-05-04 21:12:45","0","934","<p>I'm trying to complete the Android MapView tutorial @ www.developer.android.com/resources/tutorials/views/hello-mapview.html</p><p>I think I've done the entire thing correctly but I'm getting an error message in Eclipse. I'm sure why. The problematic line of code is </p><pre><code>private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();</code></pre><p>I'm relatively new to Java but I've gone through the forums of different things and I really have no idea on this one. I've [attached][2] a screen shot of the development environment - hopefully it wont be anything too obvious or hard to fix either!</p><p><a href=""http://www.limedomains.com/files/download/34780?dirname=&amp;file_name=hellogooglemaps.jpg"" rel=""nofollow"">http://www.limedomains.com/files/download/34780?dirname=&amp;file_name=hellogooglemaps.jpg</a></p><p>Cheers</p><p>Tom :)</p><p>** As requested heres the source code and the screenshot link is updated to something that works**</p><pre><code>package com.example.hellogooglemaps;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.drawable.Drawable;import com.google.android.maps.GeoPoint;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();public class HelloItemizedOverlay extends ItemizedOverlay{    public HelloItemizedOverlay(Drawable defaultMarker) {          super(boundCenterBottom(defaultMarker));        }    @Override    protected OverlayItem createItem(int i) {      return mOverlays.get(i);    }    public void addOverlay(OverlayItem overlay) {        mOverlays.add(overlay);        populate();    }    @Override    public int size() {      return mOverlays.size();    }    public HelloItemizedOverlay(Drawable defaultMarker, Context context) {          super(defaultMarker);          mContext = context;        }    @Override    protected boolean onTap(int index) {      OverlayItem item = mOverlays.get(index);      AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);      dialog.setTitle(item.getTitle());      dialog.setMessage(item.getSnippet());      dialog.show();      return true;    }}</code></pre>","332834","","1228","","2013-08-16 15:34:56","2013-08-16 15:34:56","Android : Hello, Views > Google Map View Tuorial","<java><android><eclipse>","2","2","","",""
"2769257","1","2769263","","2010-05-04 21:58:36","1","984","<p>I have a tab widget where one of the tabs is a chat-type feature. I want to update the chat data at an interval (variable depending on whether the chat tab is active or not).</p><p>The best approach seemed to be using an AsyncTask in my main TabActivity class, as that would avoid any issues of the chat activity being destroyed while in the background, while an AsyncTask was running. I wanted to ensure that the Activity isn't destroyed and recreated, thus causing my AsyncTask to be unable to modify the actual active Activity's data.</p><p>However, now that my AsyncTask is in the TabActivity activity, I don't have a direct way to call my Chat's ListAdapter <code>notifyDataSetChanged()</code> from my <code>onPostExecute()</code> method anymore.  Is there a way to get a reference to a given Tab's current Activity from the TabHost/TabActivity?</p><p>Or, alternatively, can I assume my chat activity will never be destroyed as a child activity of the TabActivity activity (well, never destroyed while the TabActivity is active at least), and then just put the AsyncTask in the Chat Activity?</p>","325011","","","","","2010-05-04 22:09:02","Updating Activity UI from Different Activity Method?","<android><tabs><activity><android-asynctask>","2","0","2","",""
"2769297","1","","","2010-05-04 22:09:42","1","3224","<p>I'm trying to create a simple multiplayer game. There's a <code>WorkerService</code> which is supposed to handle all network communication and all interaction between this service and my Activities is done with AIDL. I think this is a standard approach - to enable two way interaction I use also an <code>IWorkerCallback</code> interface (also AIDL).</p><p>The problem is that callbacks have to change things in UI which may be done only in UI thread. I've created a <code>Handler</code> (in UI thread) and believed that this is an obvious solution. But, surprisingly, it's not working.</p><p>My <code>LoungeActivity</code> calls <code>startServer()</code> method of <code>IWorker</code> interface. Corresponding method of my <code>WorkerService</code> does some job and makes a callback - this works fine. Then <code>WorkerService</code> spawns a new thread and callback from this thread results in a bad Exception being thrown:</p><p><code>Can't create handler inside thread that has not called Looper.prepare()</code></p><p>Here's some code to make it clear:</p><p><code>startServer()</code> implementation:</p><pre><code>private void startServerImpl(String name, float latStart, float latEnd,float lonStart, float lonEnd){    // some instructions here    // this works fine:    callback.notifySocketCreated();    // my naughty thread:    new ServerThread().start();    // some instructions here}</code></pre><p><code>ServerThread</code> code:</p><pre><code>private class ServerThread extends Thread {    @Override    public void run()    {        //some instructions here        // this call will cause an error        callback.notifyGameRegistered();    }}</code></pre><p>Every method from <code>callback</code> looks like that:</p><pre><code>public void notifyGameRegistered() throws RemoteException{    handler.dispatchMessage(handler.obtainMessage(CALLBACK_GAME_REGISTERED));}</code></pre><p>In Handler's <code>handleMessage()</code> method I'm doing a simple <code>switch(msg.what)</code> and in every case there's a simple UI modification (showing a Toast, changing Text, etc.).</p><p>I have no idea why is this Exception thrown.. I've managed to fix it by packing code into a <code>Runnable</code> and calling <code>runOnUiThread()</code> but it still makes me curious - shouldn't a Handler always run in thread that created it? Or maybe I'm doing something wrong?</p>","253399","","","","","2013-03-15 07:28:47","Callback from another thread causes an exception","<android><multithreading><service><aidl>","3","0","","",""
"2769305","1","2769321","","2010-05-04 22:11:48","0","1265","<p>Here's the situation.  I have a bunch of objects that implement <code>Serializable</code> that I want to store in a SQL database.  I have two questions</p><ol><li>Is there a way to serialize the object directly into the database</li><li>Is that the best way to do it or should I <ol><li>Write the object out to a formatting <code>String</code> and put it in the database that way and then parse it back out</li><li>Write each member to the database with a field that is unique to each object</li></ol></li></ol>","236136","","","","","2010-05-04 23:15:33","Putting Serializable Classes into SQL?","<android><sqlite><serializable>","3","0","1","",""
"2769443","1","2770920","","2010-05-04 22:43:30","0","1159","<p>I'm trying to simplify my views and get rid of some of the nested layouts, and I noticed while looking at the hierarchyviewer that embedded Activities in a TabHost have a PhoneWindow$DecorView.  Is there a way I can get rid of this?</p><p>An example is here:</p><p><a href=""http://www.vimtips.org/media/hv.png"" rel=""nofollow"">http://www.vimtips.org/media/hv.png</a></p>","238849","","","","","2010-05-05 05:59:24","Eliminate PhoneWindow$DecorView from embedded intents in an ActivityGroup (TabHost)","<android>","1","0","","",""
"2769484","1","3035986","","2010-05-04 22:51:05","5","3311","<p>I need to build compass for my application. </p><p>From reading the documentation it seems there are two reasonable ways of doing this:</p><ul><li>Sensor.TYPE_ORIENTATION method: This is the easy way of doing it. The problem with this is it is not accurate. When I compare my reading with Snaptic Compass it is about 10-15 degress off which for my purposes is unacceptable. </li><li>Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD and getRotationMatrix() in conjunction with remapCoordinateSystem() and getOrientation() method: The documentation says this ""is usually more accurate"". The problem is regardless of the delay I register with listener the compass goes crazy even when the device is stationary on flat surface. </li></ul><p>Any suggestions for solving this problem will be greatly appreciated.</p>","290469","","","","","2010-06-14 08:58:37","Compass accuracy dilemma","<android><compass-geolocation><digital-compass>","2","0","5","",""
"2769550","1","2769631","","2010-05-04 23:06:54","0","151","<p>Here's a screenshot of the layout I'm looking for:</p><p><a href=""http://www.vimtips.org/media/ll.png"" rel=""nofollow"">http://www.vimtips.org/media/ll.png</a></p><p>Can this all be done with one RelativeLayout?</p>","238849","","","","","2010-05-04 23:24:56","Can I do this entire layout with RelativeLayout?","<android>","1","0","","",""
"2769703","1","3381373","","2010-05-04 23:46:42","2","2145","<p>I'm working on an app that needs to have the user select an image or video.  On pre-2.1 devices, using ACTION_GET_CONTENT seems to work fine with multiple MIME types:</p><pre><code>new Intent(Intent.ACTION_GET_CONTENT).setType(""video/*, image/*"")</code></pre><p>However, on a Droid running 2.1, this gives a ""There are no items in your collection"".  Using the same code with either ""video/<em>"" or ""image/</em>"" gives the desired result.  Is there a way to get my 2.1 device to allow the user to select both types of content within a single Intent?</p>","104918","","","","","2010-08-01 08:50:29","Picking images and videos on Android on 2.1 using ACTION_GET_CONTENT","<android><camera><android-intent><image-gallery>","1","0","1","",""
"2769719","1","2769892","","2010-05-04 23:50:47","0","601","<p>What is the best way to download an mp3 file in java (on Android sdk)?<a href=""http://developer.android.com/reference/java/net/package-summary.html"" rel=""nofollow"">http://developer.android.com/reference/java/net/package-summary.html</a></p><p>Should I be using sockets? If so - what kind of ""Stream"" reader should I use?I have also read something about ""intents"" - is this something that is applicable here?</p><p>I am also curious as to what should one do if connection gets interrupted - can I resume the download somehow or restart it?</p><p>Any tips?</p>","74865","","","","","2010-05-05 00:42:23","Downloading mp3 files in java on Android","<java><android><file-download>","1","0","0","",""
"2769994","1","2770008","","2010-05-05 01:15:20","4","503","<p>Any software simulator that can help to develop Android app without an actual phone?</p>","315427","","80425","","2011-12-17 13:22:19","2012-12-18 19:12:26","How to develop an Android application without having an Android device?","<android>","5","0","1","",""
"2770106","1","2770414","","2010-05-05 01:43:54","0","738","<p>Well, I'm trying to follow the tutorial from <a href=""http://rapidandroid.org/wiki/Graphing"" rel=""nofollow"">http://rapidandroid.org/wiki/Graphing</a>. But I found a problem just in the first part of it. I'll describe the problem here, I just cannot understand how this could be wrong, it's pretty simple stuff. What am I doing wrong here? </p><p>First I created a xml file called statistics.xml, in it among other things I put this code:</p><pre><code>&lt;WebView android:id=""@+id/webview"" android:layout_height=""fill_parent""    android:layout_width=""fill_parent""/&gt;</code></pre><p>Now in the activity that is supposed to display this webview I'm doing this:</p><pre><code>public class DisplayStatistics extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                WebView wv = (WebView) findViewById(R.id.webview);</code></pre><p>The problem arises here, as I seem to be getting null for <strong>wv</strong> whenever I test for it. Which means of course that <strong>findViewById(R.id.webview)</strong> couldn't find the view. But again, what am I doing wrong??</p><p>Of course I know I could also instantiate the webview directly from code without the need to specify it from the xml, but I was just wondering what was wrong about this way of doing it.</p><p>Just in case I also added the following line in my android manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>I'm not really sure if it's necessary for displaying the webview (I think not) but I just put it there to see if that was the problem, and it turned out it isn't.</p><p>Thanks</p><p>Nelson</p>","274434","","","","","2010-05-05 03:28:29","Can't seem to load a webview from xml, why?","<xml><android><webview>","1","0","","",""
"2770443","1","2770624","","2010-05-05 03:37:41","0","958","<p>// Particle Stuct Instance    private Sprite[] mParticles = new Sprite[10];</p><pre><code>/// Particle emitter Propertiesprivate Context mContext;private int mPositionX, mPositionY, mWidth, mHeight, mNumParticles;private Rect srcRect, dstRect;/*** Constructor ! ***/public ParticleEmitter(Context c, Sprite spriteImage, int num_particles) {    super(c);    mContext = c;    Sprite[] Particles = new Sprite[10];    Particles[0] = new Sprite(mContext, R.drawable.icon);//  mParticles = spriteImage;    //mParticles[num_particles].InitAttributes(c, R.drawable.icon);    // Allocate Particles instances and copy into mParticle member    //mParticles = new Sprite[num_particles]; //   Sprite sprite1 =  new Sprite(mContext, R.drawable.icon);//    Sprite sprite2 =  new Sprite(mContext, R.drawable.icon);  //  mParticles[0] = spriteImage;   // mParticles[1] =  sprite2;/*  for(int i = 0; i &lt; num_particles; i++)    {       mParticles[i].InitAttributes(mContext, R.drawable.icon);       mParticles[i].setXPosition(i);    }  *///   mParticles[0].InitAttributes(mContext, R.drawable.icon);    // nullify our positioning attributes    mPositionX = mPositionY = 0;}</code></pre>","333031","","","","","2010-05-05 04:29:30","Sprite array list never works! Need help understanding how to create arrays of class instances in JAVA","<java><android><arrays><graphics><sprites>","1","1","","",""
"2770689","1","2774780","","2010-05-05 04:49:39","3","4508","<p>Why changing Color of Default Button makes it look RECTANGLE shape ? I do not want to use custom background images for this.I want to do this programmatically for few conditions on which I change the colors of many small buttons on screen. Can anyone give a solution ?</p><p>P.S. ==> It seems there is no workaround by reading this <a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/e1313e2c98e9c52b"" rel=""nofollow"">http://groups.google.com/group/android-beginners/browse_thread/thread/e1313e2c98e9c52b</a></p><p>or is there any ?</p>","315619","","315619","","2010-05-05 05:05:20","2010-09-21 13:47:09","Why changing Color of Default Button makes it look RECTANGLE in Android?","<android>","2","1","2","",""
"2770757","1","","","2010-05-05 05:10:25","0","1352","<p>I am using ContentObserver on contacts. But here my problem is atleast once i have to launch my application other wise i am unable to get notification chages. My code like this</p><p>ContactsContentObserver cco = new  ContactsContentObserver(handler);</p><pre><code>    ContentResolver contentResolver = getContentResolver();    contentResolver.registerContentObserver(RawContacts.CONTENT_URI,    true, cco);            }private class ContactsContentObserver extends ContentObserver { public ContactsContentObserver(Handler h)  {      super(h);    }    public void onChange(boolean selfChange)     {       System.out.println(""##########SOMEBODAY CHANGED ANYTHING AT THE CONTACTS"");       Toast.makeText(getApplication(),""####Updated####"",Toast.LENGTH_LONG).show();       }</code></pre><p>....Adv thanks. </p>","551936","","184046","","2010-11-19 03:15:13","2010-11-19 03:15:13","Reg : Contact changes in Android","<android><content><observer-pattern><contact>","2","0","","",""
"2770777","1","","","2010-05-05 05:14:00","0","956","<p>I want to display images on Android screen. The images should be scrolled vertically. How should I do this? Please help me.</p>","285236","","1128737","","2012-01-13 15:03:13","2012-01-13 15:03:13","Displaying number of images in Android application with scroll view. I think the images should be kept in list view","<android><image>","1","0","","",""
"2771145","1","2771162","","2010-05-05 06:55:10","1","310","<p>I am writing a android application where I want to register my application to remoter server when application is first launched on installation. Application will register to remoter server itself without taking any user input. How Can I track whether this is a first application launch after installation ?</p>","248132","","","","","2010-05-05 06:59:41","Android register to remote server on first application uses","<android>","1","0","","",""
"2771190","1","2961851","","2010-05-05 07:06:46","2","2936","<p>I am trying to add an HTML content to a web view. If the words in the HTML content are without spaces then webview keeps that particular word on the same line.I want that content to be wrapped and be on the next line.Is it possible to do that.I am attaching a sample code that can reproduce the issue.</p><pre><code>  String temp=""&lt;p&gt;WebViewallowsyoutocreateyourownwindowforviewingwebpages(orevendevelopacompletebrowser).Inthistutorial,youcreateasimpleActivitythatcanviewandnavigatewebpages.1.CreateanewprojectnamedHelloWebView.&lt;/p&gt;"";             WebView wb=new WebView(this);             wb.loadDataWithBaseURL("""", temp, ""text/html"", Encoding.UTF_8.toString(),"""");              setContentView(wb);</code></pre>","302328","","","","","2010-06-02 21:46:18","Android adding HTML content on a webview without space","<android><webview><android-webview>","1","0","","",""
"2771517","1","2998019","","2010-05-05 08:14:38","12","4800","<p>Since yesterday everytime I open my layout Editor in Eclipse for the Android UI I get the following exception: </p><p>Unhandled event loop exception</p><pre><code>    java.lang.StackOverflowError    at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source)    at     com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source)    at... </code></pre><p>the last part goes on and on as expected if an Stackoverflow Exception occurs. </p><p>Anybody else experiencing this and found a solution?I'm working with the latests android sdk on Mac OS X with Eclipse 3.5.2</p><p>I just installed the Carbon Version of eclipse and I get this error even in this fresh copy of eclipse. </p><p>Very strange that I'm the only one experiencing this error. Maybe it is not an Eclipse problem but an problem of my project setup...</p>","114066","","114066","","2010-05-14 07:31:14","2012-03-20 10:05:38","Error while opening the Eclipse Android Layout Editor","<android><eclipse><stackoverflowexception>","2","1","2","",""
"2771648","1","","","2010-05-05 08:44:32","4","3533","<p>I want to display one dialog box after incoming call, so that I can run my application in background while receiving call.</p><p>How to catch that incoming call in android application???</p>","323062","","","","","2013-02-12 14:06:58","How to show incoming call notification in android application","<android>","2","0","3","",""
"2771723","1","6816546","","2010-05-05 08:55:23","4","4294","<p>The Android SDK includes the Android NDK, which in turn contains a customised GCC based tool chain for Android on ARM processors; The question is how to build the NDK tool chain to run on Windows to target x86 Android?</p><p>The tool chain is already setup to build on Windows (cygwin) targeting ARM;There are also existing <a href=""http://www.android-x86.org/download"" rel=""nofollow"">pre-built (unofficial) NDKs</a> for targeting x86, but these contain pre-built tools for x86 Linux, not Windows.</p><p>The NDK contains a build-toolchain.sh script to rebuild its tool chain; the question is, what specifically needs done to get that to build a tool chain targeting Android x86?</p>","8516","","","","","2011-07-25 13:02:09","Building Android NDK Toolchain for x86 Android on Windows via Cygwin","<android><gcc><cygwin><x86><android-ndk>","1","1","2","",""
"2771811","1","2772015","","2010-05-05 09:09:26","5","3767","<p>I have found two ways on keeping the screen on:</p><p>First one is simpler:</p><pre><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</code></pre><p>Second one is using a wakelock and requiring an extra permission:</p><pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);  wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, ""DoNotDimScreen"");</code></pre><p>Is there any real difference between this two methods apart from the second one being more complicated to implement and requiring an extra permission? Will the end result be always the same?</p>","265375","","","","","2012-10-03 10:46:11","Keeping screen on, which way?","<android><screen>","1","2","1","",""
"2771907","1","","","2010-05-05 09:23:40","0","866","<p>i have created 3 tabs using the TabActivity. The class declaration is like this.</p><p><em><strong>public class ABTM extends TabActivity</em></strong> {</p><p>........ some code ..........</p><p>}</p><p>now i want to create a Menu with three menu items. but the problem is that the </p><p>**@Override public boolean OnCreateOptionsMenu(Menu menu){</p><p>}** </p><p>gives error. It says that i should remove the @Override. When i remove the @Override the error is gone and the application runs fine but pressing the menu button does nothing.</p><p>What am i doing wrong here? </p>","333252","","","","","2011-03-31 00:10:17","Android: TabActivity, Creating Menu","<android>","2","1","","",""
"2771935","1","","","2010-05-05 09:27:39","1","2029","<p>I have an activity that uses <code>VideoView</code> and <code>MediaController</code>.</p><p>I have a .mp4 file.</p><ol><li><p>When I put the file in <code>res/raw</code> folder, I can play the video using <code>Uri.parse(""android.resource://&amp;lt;package&amp;gt;/"" + R.raw.id_video)</code></p></li><li><p>However, when I put the same file in the filesystem, it plays properly.I use <code>videoView.setVideoPath(""/sdcard/myfile.mp4"");</code></p></li></ol><p>What is the problem?</p>","332210","","16587","","2010-05-06 17:45:35","2010-07-01 13:27:48","Android Video View - Fails to Load file from SD Card","<android><video><videoview>","1","0","","",""
"2771973","1","2776270","","2010-05-05 09:32:40","3","1804","<p>I am doing an App which access the gprs .I am facing problem when the user starts another application who uses gprs also like google maps .It takes it own heap memory ,after doing some operation on Maps app it calls OnLowMemory of my service .and my ui is also killed in background.I am not getting any proper tutorial haw can i start my app when it is getting killed during onLowMemory ,or is there any other way to handle it .</p><p>Thanks in advance.</p>","95877","","","","","2010-05-05 19:45:14","OnLowMemory getting called","<java><android>","1","1","","",""
"2771998","1","2776890","","2010-05-05 09:35:55","0","1240","<p>I'm just starting with Android and can't find how to display a list in my activity.The activity and the layout main.xml are shown below.How can I display the country array in the ListView 'list' of my layout?</p><p>thank you</p><p>Jul</p><pre><code>public class Atable extends ListActivity {          public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    String[] COUNTRIES = new String[] { ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra""};    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.main, COUNTRIES)); //I tried this but it does not work    }</code></pre><p>main.xml        </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:text=""@string/search"" /&gt;        &lt;EditText android:id=""@+id/search""           android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""vertical""      android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;ListView android:id=""@id/android:list""              android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;        &lt;TextView android:id=""@id/android:empty""              android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""@string/noresults""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","326849","","326849","","2010-05-06 08:02:03","2011-03-25 16:36:47","Help with listView in Android","<android><listview>","4","0","","",""
"2772393","1","2936452","","2010-05-05 10:35:07","3","2934","<p>Does anybody know what data structures are used to the store messages in an SMS client app, and whether there is an existing API for this.</p><p>I was perhaps looking at implementing a link list for the purpose but if the work has already been done in an API then perhaps it would be unnecessary to commit time to the task that could be spent programming other parts.</p><p>Many thanks</p>","300037","","47589","","2010-05-05 14:25:59","2013-07-18 08:30:21","Data Structure Used For SMS Messages In Android","<android><data-structures><sms>","3","0","1","",""
"2772565","1","2772906","","2010-05-05 11:06:25","0","989","<p>am i allowed (legally) to use graphics/icons from the android source for a commercial application, in order to blend in nicely with the android look&amp;feel?i am talking specifically about the plus/minus buttons from the edit_contacts activity in the contacts application.OR: is there a way to let a button look like (ie with a style) these buttons without copying the .png - files?</p><p>trying to use <code>android:background=""@android:drawable/btn_circle""</code> gives me <code>Error: Resource is not public.</code>Does this answer my question?</p>","333350","","333350","","2010-05-05 11:26:37","2010-05-05 11:54:13","Using android native button icons","<android>","1","0","","",""
"2772792","1","3051848","","2010-05-05 11:40:44","1","830","<p>Can anyone tell me how to include tab implementation in AnDroidDraw code?<br> I have downloaded the AnDroidDraw code from <a href=""http://code.google.com/p/droiddraw/source/browse/#svn/trunk"" rel=""nofollow"">http://code.google.com/p/droiddraw/source/browse/#svn/trunk</a>, but does not provide <code>TabHost</code> and <code>TabWidget</code> implementation.</p><p>Thanks.</p>","307585","","469983","","2011-07-18 10:23:31","2011-07-18 10:23:31","DroidDraw does not support Tab implementation","<android>","2","1","","",""
"2772927","1","2772988","","2010-05-05 11:57:41","0","2171","<p>I am looking generally in to Android development.</p><p>I keep seeing information on <a href=""http://android-dls.com/wiki/index.php?title=Why_Root"" rel=""nofollow"">root</a> however I am unclear how this relates to general android app development.</p><p>I understand that there is an emulator however when I get to actually test the software on a phone does that phone have to be a rooted device or is this only required if you wish to edit the core features of the os?</p><p>Finally are there are any development disadvantages to rooting the device such as that is no longer behaves like other android phones I may deploy too?</p><p>Thank you</p>","33","","","","","2011-01-21 03:34:45","Does Developing Android Applications require a Rooted Device?","<android><root><rooted-device>","3","0","1","",""
"2772985","1","7830643","","2010-05-05 12:05:12","2","272","<p>Team,</p><p>I would like to know, whether we can add custom configurations in Manifest or deploy properties? If yes, please provide examples.</p><p>thanks,Ramesh</p>","330266","","","","","2011-10-20 03:01:30","Android : retrieve Custom properties from Deploy.properties or manifest.xml","<android>","1","0","1","",""
"2773265","1","4632119","","2010-05-05 12:47:29","4","2311","<p>How could I programmatically set data roaming on/off in my android application ?</p>","304866","","","","","2011-01-10 17:13:51","Set Data roaming on/off","<android>","2","1","","",""
"2773337","1","2773848","","2010-05-05 12:54:47","3","1086","<p>Im trying to define a LinearLayout which contains another LinearLayout which should always be desplayed in the horizontal and vertical center. An ImageView should be placed always vertically centered on the right side of the parent Layout:</p><blockquote><pre><code>                                 A                                           B</code></pre></blockquote><p>I defined it the following:</p><pre><code>&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""60px""&gt;     &lt;LinearLayout android:id=""@+id/footer"" android:orientation=""horizontal"" android:layout_height=""50px"" android:paddingTop=""5px"" android:layout_width=""wrap_content"" android:background=""@drawable/footer_border"" android:paddingRight=""5px"" android:paddingLeft=""5px"" android:layout_gravity=""center_horizontal""&gt;        &lt;ImageButton android:id=""@+id/libraryButton"" android:layout_height=""wrap_content"" android:src=""@drawable/library_button"" android:background=""#000000"" android:layout_width=""wrap_content""/&gt;        &lt;ImageButton android:id=""@+id/bookButton"" android:layout_height=""wrap_content"" android:src=""@drawable/book_button"" android:background=""#000000"" android:layout_width=""wrap_content"" android:paddingLeft=""15px"" android:paddingRight=""15px""/&gt;        &lt;ImageButton android:id=""@+id/workspaceButton"" android:layout_height=""wrap_content"" android:src=""@drawable/workspace_button"" android:background=""#000000"" android:layout_width=""wrap_content""/&gt;     &lt;/LinearLayout&gt;     &lt;ImageView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_gravity=""right""     android:id=""@+id/loading""&gt;     &lt;/ImageView&gt;     &lt;/LinearLayout&gt; </code></pre><p>But unfornatuley its not working... The LinearLayout (A) and the ImageView (B) is on the left side.... But i set gravity to center and right?? Why?</p>","","anon","","","","2010-05-05 14:36:27","Whats wrong with this simple Layout?","<android>","2","0","","",""
"2773502","1","2774968","","2010-05-05 13:17:14","11","33605","<p>I'm trying to get a completely custom Dialog or PopupWindow, without any of the default Android UI controls (title, background, buttons, whatever).</p><p>Is this possible at all? I've spent hours searching for this, but no luck... It seems like this should be easily possible, but I can't find it.</p><p>Preferably this would be by inflating a View from XML, but at this point anything that would just work would be nice.</p><p>Thanks.</p>","279363","","279363","","2010-05-05 16:29:48","2012-03-01 08:45:13","Android Custom PopupWindow/Dialog","<android><dialog><skinning><popupwindow>","2","1","14","",""
"2773542","1","2784129","","2010-05-05 13:23:24","1","161","<p>I have a written a game that works fine on the 'normal' 320x480 screen of my G1.I tried it on a friends Xperia x10 and it leaves a large blank section on the right hand side of the screen.How do I fix this? I've read that I need to include an extra directory in res/drawable for different densities. How do I do this?</p><p>Thanks for any help</p><p>Caroline</p>","327828","","","","","2010-05-06 20:10:55","What steps do I need to do to get my game working on multiple resolutions?","<android>","1","4","2","",""
"2773553","1","2829898","","2010-05-05 13:25:10","1","243","<p>I have created an apk which has activities. I have included tabs in my program through which the user can select the required activity. But my main problem is that i couldnt find a way to display the tabs throughout the application. For example, on clicking a tab the corresponding tab opens. But when i click on a button the activity is displayed but the tabs are not getting displayed.</p><p>I have included a tabHost in the program to display the tabs for various activities...</p>","303155","","","","","2010-05-13 20:00:52","Consistent tabs through out the application","<android><tabs>","1","0","","",""
"2773639","1","","","2010-05-05 13:35:15","1","3512","<p>How one could the programmatically change the APN settings , so they are invalidated ? </p>","304866","","","","","2011-04-18 10:24:41","APN settings change","<android>","1","0","","",""
"2773650","1","2774138","","2010-05-05 13:37:11","28","39991","<p>Can I do Android programming in C++, C? If the answer is ""yes"" then please tell how? And what's the procedure to set up?</p><p>I don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released by Google.</p><p>Please do not tell about NVDIA SDK it's not fully developed :)</p>","333472","","1400768","","2012-08-25 15:03:28","2014-03-16 03:48:17","Can I do Android Programming in C++, C?","<c++><android>","5","0","7","",""
"2773656","1","","","2010-05-05 13:37:52","0","3008","<p>hai, I am new to android.</p><p>I have problem. </p><p>This is my code but it will not work, the problem is in view binder.</p><p>Please correct it. </p><pre><code>// this is my activity package com.android.Fruits2;import java.util.ArrayList;import java.util.HashMap;import android.app.ListActivity;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.widget.SimpleAdapter;import android.widget.SimpleCursorAdapter;import android.widget.SimpleAdapter.ViewBinder;public class Fruits2 extends ListActivity {    private DBhelper mDB;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState); //       setContentView(R.layout.main);        mDB = new DBhelper(this);           mDB.Reset();            Bitmap img = BitmapFactory.decodeResource(getResources(), R.drawable.icon);            mDB.createPersonEntry(new PersonData(img, ""Harsha"", 24,""mca""));            String[] columns = {mDB.KEY_ID, mDB.KEY_IMG, mDB.KEY_NAME, mDB.KEY_AGE, mDB.KEY_STUDY};            String   table   = mDB.PERSON_TABLE;            Cursor c = mDB.getHandle().query(table, columns, null, null, null, null, null);            startManagingCursor(c);            SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,                    R.layout.data,                    c,                    new String[] {mDB.KEY_IMG, mDB.KEY_NAME, mDB.KEY_AGE, mDB.KEY_STUDY},                    new int[] {R.id.img, R.id.name, R.id.age,R.id.study});               adapter.setViewBinder( new MyViewBinder());            setListAdapter(adapter);    }}//my viewbinder  package com.android.Fruits2;import android.database.Cursor;import android.graphics.BitmapFactory;import android.view.View;import android.widget.ImageView;import android.widget.SimpleCursorAdapter;public class MyViewBinder implements SimpleCursorAdapter.ViewBinder {    public boolean setViewValue(View view, Cursor cursor, int columnIndex) {           if( (view instanceof ImageView)  ) {                 ImageView iv = (ImageView) view;                 byte[] img = cursor.getBlob(columnIndex);                 iv.setImageBitmap(BitmapFactory.decodeByteArray(img, 0, img.length));                 return true;            }        return false;    }}  // data package com.android.Fruits2;import android.graphics.Bitmap;public class PersonData {       private Bitmap bmp;        private String name;        private int age;        private String study;        public PersonData(Bitmap b, String n, int k, String v) {            bmp = b;            name = n;            age = k;            study = v;        }        public Bitmap getBitmap() { return bmp; }        public String getName() { return name; }        public int getAge() { return age; }        public String getStudy() { return study; }}//dbhelper package com.android.Fruits2;import java.io.ByteArrayOutputStream;import android.content.ContentValues;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.graphics.Bitmap;import android.provider.BaseColumns;public class DBhelper {    public static final String KEY_ID = BaseColumns._ID;    public static final String KEY_NAME = ""name"";    public static final String KEY_AGE = ""age"";    public static final String KEY_STUDY = ""study"";    public static final String KEY_IMG = ""image"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;      private static final String DATABASE_NAME = ""PersonalDB"";    private static final int DATABASE_VERSION = 1;    public static final String PERSON_TABLE = ""Person"";    private static final String CREATE_PERSON_TABLE = ""create table ""+PERSON_TABLE+"" (""                                         +KEY_ID+"" integer primary key autoincrement, ""                                         +KEY_IMG+"" blob not null, ""                                         +KEY_NAME+"" text not null , ""                                         +KEY_AGE+"" integer not null, ""                                         +KEY_STUDY+"" text not null);"";    private final Context mCtx;    private boolean opened = false;    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        public void onCreate(SQLiteDatabase db) {            db.execSQL(CREATE_PERSON_TABLE);        }        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            db.execSQL(""DROP TABLE IF EXISTS ""+PERSON_TABLE);            onCreate(db);        }    }    public void Reset() {     openDB();     mDbHelper.onUpgrade(this.mDb, 1, 1);     closeDB();    }    public DBhelper(Context ctx) {        mCtx = ctx;        mDbHelper = new DatabaseHelper(mCtx);    }    private SQLiteDatabase openDB() {        if(!opened)            mDb = mDbHelper.getWritableDatabase();        opened = true;        return mDb;    }    public SQLiteDatabase getHandle() { return openDB(); }    private void closeDB() {        if(opened)            mDbHelper.close();        opened = false;    }    public void createPersonEntry(PersonData about) {     openDB();        ByteArrayOutputStream out = new ByteArrayOutputStream();        about.getBitmap().compress(Bitmap.CompressFormat.PNG, 100, out);        ContentValues cv = new ContentValues();        cv.put(KEY_IMG, out.toByteArray());                    cv.put(KEY_NAME, about.getName());        cv.put(KEY_AGE, about.getAge());        cv.put(KEY_STUDY, about.getStudy());        mDb.insert(PERSON_TABLE, null, cv);        closeDB();    }}//data.xml&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;ImageView        android:id = ""@+id/img""        android:layout_width = ""wrap_content""        android:layout_height = ""wrap_content""       &gt;    &lt;/ImageView&gt;    &lt;TextView        android:id = ""@+id/name""        android:layout_width = ""wrap_content""        android:layout_height = ""wrap_content""        android:textSize=""15dp""        android:textColor=""#ff0000""       &gt;    &lt;/TextView&gt;    &lt;TextView        android:id = ""@+id/age""        android:layout_width = ""wrap_content""        android:layout_height = ""wrap_content""        android:textSize=""15dp""        android:textColor=""#ff0000""         /&gt;    &lt;TextView        android:id = ""@+id/study""        android:layout_width = ""wrap_content""        android:layout_height = ""wrap_content""        android:textSize=""15dp""        android:textColor=""#ff0000""  /&gt;&lt;/LinearLayout&gt;</code></pre><p>When I run this in android 1.6 and 2.1, it works.</p><p>But when I run in android 1.5, not work.</p><p>My application is android 1.5.</p><p>Please correct and send code to me.</p><p>Thank you.</p>","333463","","234976","","2011-12-01 07:46:49","2013-02-04 07:07:37","png image store in database and retrieve in android 1.5","<android>","1","1","2","",""
"2773668","1","","","2010-05-05 13:38:46","0","1172","<p>I would like to know if there are some libraries/algorithms/techniques (python, if at all possible) that help to extract features from accelerometer data (extracted from and android phone, btw), like periodicity of movements, energy of acceleration and the like. Has anyone done this kind of task before?</p><p>Thank you very much in advance :)</p>","280509","","","","","2010-05-05 13:56:12","Accelerometer data analysis","<python><android><accelerometer><data-analysis>","1","0","","",""
"2774243","1","2774342","","2010-05-05 14:45:10","45","54423","<p>To make a phone call via HTML on an iPhone I create an <code>&lt;A/&gt;</code> tag with an href formatted as: <code>&lt;a href='tel:123-555-1212'&gt;Dial Me&lt;/a&gt;</code>.</p><p>Is there an equivelant for HTML on Android?</p><p>CLARIFICATION - using the format href='tele:123-555-1212' does indeed work on on android.  I was testing the app within a native Java wrapper on the device.  It does not appear as if we can make a call from a web application hosted in a Native Wrapper.</p>","2723","","2723","","2010-05-05 15:15:17","2013-07-16 07:00:38","Can I make a phone call from HTML on Android?","<html><android>","3","0","16","",""
"2774282","1","2774371","","2010-05-05 14:49:12","6","1253","<p>I have a couple of questions about connectivity on Android, if anyonehas any insight it would be great.</p><p><strong>1)</strong> What is the default when an application wants to wirelessly connect?Is it wlan? And if wlan is switched off or there is no access pointsaround is it 3g or gprs?</p><p><strong>2)</strong> Is a device always ip connected? Or when its disabled from wlan or 3gdoes it lose its ip address?</p><p><strong>3)</strong> Is an application, for example the browser only ever connected to oneip address? Or can it be connected to multiple addresses for eachradio such as gprs or wifi (wlan)?</p><p><strong>4)</strong> Can an application decide which connection to open a socket to? Forexample can I create an application and decide whether to connect thesocket to the wlan or gprs? Or does the OS decide?</p><p><strong>5)</strong> Finally how do native applications handle connectivity? In the samemanner?</p>","243999","","243999","","2010-05-06 08:17:26","2010-05-06 08:17:26","Android - Connectivity Questions","<android><wifi><gprs><connectivity><3g>","1","1","2","",""
"2774446","1","2797034","","2010-05-05 15:11:21","1","1270","<p>I have a custom dialog in my android application. I want to have in this dialog a field for choosing a phone number from contacts.<a href=""http://www.androidsnippets.org/snippets/61/"" rel=""nofollow"">This example</a> describes such snippet. However for this example contact picker is created inside an activity and I do not know how to do this if I do not have activity (in case of dialog)</p>","120574","","","","","2010-05-09 08:08:27","Contact picker in a dialog","<java><android><dialog><contacts>","1","0","1","",""
"2774645","1","","","2010-05-05 15:36:08","4","8249","<p>So I am making a basic chess app to play around with some various elements of android programming and so far I am learning a lot, but this time I am lost.</p><p>When the orientation of the emulator changes the activity gets reset. Based on my research the same thing will happen anytime the application is paused/interrupted, ie. keyboard change, phone call, hitting the home key etc.</p><p>Obviously, it is not viable to have a chess game constantly reset, so once again I find myself needing to learn how to fix this problem.</p><p>My research brings up a few main things, overriding the onPaused method in my Activity, listening for Orientation, Keyboard changes in my manifest (via android:configChanges), using Parcelables, or Serialization.</p><p>I have looked up a lot of sample code using Pacelables, but to be honest it is too confusing. Maybe coming back tomorrow with fresh eyes will be beneficial, but right now the more I look at Parcelables the less sense it makes.</p><p>My application utilizes a Board object, which has 64 Cell Objects(in an 8x8 2D array), and each cell has a Piece Object, either an actual piece or null if the space is empty. Assuming that I use either Parcelable or Serialization I am assuming that I would have to Parcelize or Serialize each class, Board, Cell, and Piece.</p><p>First and foremost, is Parcelable or Serialization even the right thing to be looking at for this problem? If so is either Parcelable or Serializable preferred for this? And am I correct in assuming that each of the three objects would have to be Parceled/Serialized? Finally, does anybody have a link to a simple to understand Parcelable tutorial? Anything to help me understand, and stop further headaches down the road when my application expands even further.</p><p>Any help would be appreciated.</p>","333611","","","","","2011-04-27 05:07:02","Android app resets on orientation change, best way to handle?","<android><serialization><orientation><parcelable>","5","0","4","",""
"2774710","1","","","2010-05-05 15:44:17","0","1199","<p>I'm just looking for some insight into what would be the best way for me to store images as part of my app.</p><p>I have an activity that represents a 'Job' which has a couple of edittext's and underneath was planning on using the Gallery component to show images relevant to this job.</p><p>The job data is stored in a database (on the sdcard) so was also thinking of creating a table to store 'JobImages' and having each image stored as a byte array.</p><p>But I'm not sure if it would be better to store the images directly on sdcard under a folder structure specific to my application and the job. E.g. using the job ID number as a folder name.</p><p>Depending on which method I use will greatly determine the code that goes into an 'adapter' that allows me to bind to the gallery component so before I begin I was wondering if anyone has had the same design problem and what option they chose.</p><p>Thanks,</p><p>Dave</p>","333276","","","","","2010-05-05 19:39:51","Best way to store application images taken via camera","<android><image><storage><gallery>","1","0","1","",""
"2774726","1","2840846","","2010-05-05 15:45:22","7","9458","<p>This link describes my problem exactly: <a href=""http://old.nabble.com/Android-database-corruption-td28044218.html#a28044218"" rel=""nofollow"">http://old.nabble.com/Android-database-corruption-td28044218.html#a28044218</a></p><p>There are about 300 people using my Android App right now and every once and while I get a crash report to the server with this stack trace:</p><pre><code>android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)    at android.app.ActivityThread.access$2200(ActivityThread.java:126)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4595)    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) Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed    at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)    at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)    at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:295)    at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:276)    at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)    at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)</code></pre><p>The result is the app crashing and all the data in the DB being lost.</p><p>One thing to note is that every time I read or write to the database I get a new SQLiteDatabase and close it as soon as I'm done.  I did this in an attempt to prevent these kind of corruption errors.</p><p>I also tried synchronizing all DB reads and writes using a single static object and that didn't seem to help.</p><p>Is it possible this is just a SQLite bug?</p><p>I found a similar bug with the built-in email app here: <a href=""http://code.google.com/p/android/issues/detail?id=5610"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=5610</a>.</p><p>Here is my code:</p><pre><code>public class KeyValueTableAdapter extends BaseTableAdapter {    private String tableName;    private String keyColumnName;    private String valueColumnName;    public KeyValueTableAdapter(Context context, String tableName, String keyColumnName, String valueColumnName) {        super(context);        this.tableName = tableName;        this.keyColumnName = keyColumnName;        this.valueColumnName = valueColumnName;    }    protected String getStringValue(int key) {        Cursor cursor = null;        SQLiteDatabase db = null;        String value;        try {            db = dbOpenHelper.getReadableDatabase();            cursor = db.query(true, tableName, new String[] { valueColumnName }, keyColumnName + ""="" + key, null, null, null, null, null);            if ((cursor.getCount() == 0) || !cursor.moveToFirst()) {                value = null;            } else {                value = cursor.getString(0);            }        } finally {            if (cursor != null) cursor.close();            if (db != null) db.close();            dbOpenHelper.close();        }        return value;    }}public abstract class BaseTableAdapter {    protected DbOpenHelper dbOpenHelper;    public BaseTableAdapter(Context context) {        this.dbOpenHelper = new DbOpenHelper(context, DatabaseSettings.DATABASE_NAME, null, DatabaseSettings.DATABASE_VERSION);    }}</code></pre>","135199","","135199","","2010-05-17 21:11:58","2010-05-18 07:11:11","Android SQLite database gets corrupted","<android><sqlite>","5","5","4","",""
"2774906","1","","","2010-05-05 16:06:39","1","163","<p>This is simple enough on every other version of Android, including SenseUI 1.5.</p><pre><code>//For ContactsIntent pickIntent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);this.startActivityForResult(pickIntent, RESULT);//For PhonesIntent pickIntent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI);this.startActivityForResult(pickIntent, RESULT);</code></pre><p>On SenseUI 2.1 (HTC Incredible) this shows a list of numbers (the URI number).  So you get a list of 1-200 if you have 200 contacts.  Selecting one of the contacts you can then gather all of the information needed.</p><p>Is there any good work around known?</p>","242904","","","","","2010-05-06 06:29:10","Getting a list of Contacts on SenseUI 2.1?","<android>","1","0","0","",""
"2774923","1","3927209","","2010-05-05 16:10:07","1","1575","<p>I'm got a custom webview setup which is working pretty well, but I'd like to be able to either:</p><p>1, change the url hash without the webview reloading the page (it would lose the state of my js app)</p><p>2, call some js that sits within my web page from within android.  I can't change any JS within the site, unfortunately, so can't custom write any js to put on the site especially for the job, the only stuff I have control over is the Android app.</p><p>Can anyone think of a way of doing either of these?  </p><p>Thanks in advance.</p><p>M</p>","264276","","","","","2013-08-27 09:35:43","Changing the Android Webview hash without reloading page","<javascript><android><hash><webview>","2","0","","",""
"2775401","1","2777068","","2010-05-05 17:27:02","0","907","<p>I've doubled checked my API key is right and that is right I doubled checked that it was correct.  Here is my source and XML could anyone check to see what is wrong.  Also I make sure I have internet.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>  &lt;uses-permission android:name=""android.permissions.INTERNET""/&gt;  &lt;uses-permission android:name=""android.permissions.ACCESS_FINE_LOCATION""/&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt; &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;activity android:name="".CadetCommand""              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=""RedLight""&gt;&lt;/activity&gt;    &lt;activity android:name=""PTCalculator""&gt;&lt;/activity&gt;    &lt;activity android:name=""LandNav""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4""/&gt;</code></pre><p> </p><pre><code>package edu.elon.cs.mobile;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import android.os.Bundle;public class LandNav extends MapActivity{ public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.landnav); } @Override protected boolean isRouteDisplayed() {  return false; }}</code></pre>","180825","","","","","2010-05-05 21:53:46","Does anyone know why my maps only show grid","<java><xml><android>","1","2","","",""
"2775628","1","2775881","","2010-05-05 18:02:05","24","22210","<p>I am running a Web service that allows users to record their trips (kind of like Google's MyTracks) as part of a larger app. The thing is that it is easy to pass data, including coords and other items, to the server when a user starts a trip or ends it. Being a newbie, I am not sure how to set up a background service that sends the location updates once every (pre-determined) period (min 3 minutes, max 1 hr) until the user flags the end of the trip, or until a preset amount of time elapses.</p><p>Once the trip is started from the phone, the server responds with a polling period for the phone to use as the interval between updates. This part works, in that I can display the response on the phone, and my server registers the user's action. Similarly, the trip is closed server-side upon the close trip request.</p><p>However, when I tried starting a periodic tracking method from inside the StartTrack Activity, using requestLocationUpdates(String  provider, long minTime, float minDistance, LocationListener  listener) where minTime is the poll period from the server, it just did not work, and I'm not getting any errors. So it means I'm clueless at this point, never having used Android before.</p><p>I have seen many posts here on using background services with handlers, pending intents, and other things to do similar stuff, but I really don't understand how to do it. I would like the user to do other stuff on the phone while the updates are going on, so if you guys could point me to a tutorial that shows how to actually write background services (maybe these run as separate classes?) or other ways of doing this, that would be great.</p><p>Thanks!</p>","333721","","","","","2014-02-04 15:31:18","Android: How to periodically send location to a server","<android>","3","0","35","",""
"2775771","1","","","2010-05-05 18:25:59","1","1757","<p>In my android application I need to turn data roaming off. Because data roaming is a system preference that can only be read, not written (it belongs to Settings.Secure) , I'm thinking to get the Access Point Names of the phone and change/invalidate them so a data service won't be available when I detect the phone is roaming. I'm thinking it's a good idea and I could obtain the desired behavior but in order to be able to do this I need to know a couple of things first:</p><p>1.How to modify an APN ?</p><p>2.What field of the APN should be geven a empty value like """", in order to make it unusefull: name ?, proxy? , server ?, APN ?...</p><p>3.Which APN should be modified , or all of them should be treated the same way ?.</p><p>Thanks</p>","284609","","","","","2010-05-05 22:49:38","Access point name manipulation in android","<android>","1","0","1","",""
"2775859","1","2776022","","2010-05-05 18:38:22","3","19027","<p>I started learning Java and how to program for Android last night :)</p><p>So far I'm on this tutorial: developer.android.com/resources/tutorials/views/hello-tabwidget.html</p><p>Clearly these tutorials have been designed for people that already have experience with Java. </p><p>Despite the tutorial lacking all the required steps (for an absolute beginner with Java) and even having a typo, it seems I've figured everything out (which I'm really proud of :p). Except I cannot figure out how to fix <code>TabHost tabHost = getTabHost();</code> which apparently is undefined.</p><p>I have one other error shown in the linked image below, but I don't see why.</p><p>Here is the <a href=""http://imgur.com/Ifw6w.png"" rel=""nofollow"">linked image</a>.</p><p>Thanks, Gareth</p>","333733","","","","","2013-02-09 09:02:14","Android - getTabHost() is undefined","<java><android>","3","0","","",""
"2775991","1","2778535","","2010-05-05 18:58:06","2","262","<p>how to do this effect? :)</p><p>prompt, enter the value judgments EditText correct</p><p>thanks</p><p>link : <a href=""http://nikonizer.yfrog.com/Himg714/scaled.php?tn=0&amp;server=714&amp;filename=devicez.png&amp;xsize=640&amp;ysize=640"" rel=""nofollow"">effect image</a></p>","285654","","285654","","2010-05-06 11:47:36","2010-05-06 11:47:36","EditText Problem","<android>","1","2","2","",""
"2776114","1","","","2010-05-05 19:19:34","2","2902","<p>I just got a Droid, and after having used it for a while, I felt like I wanted to make a program for it.  The program that I am trying to make calculates the actual storage capacity of secondary storage mediums.  The user select from a list of units that ranges from KB to YB and the size the entered gets put into a formula depending on the chosen unit.  However, there is a bit of a problem with the program.  From my testing, I have narrowed it down to the fact that the user's selection is not really being obtained from the spinner.  Everything I look up seems to point me to a method quite similar to how it works in J2SE, but it does nothing.  How am I actually supposed to get that data?</p><p>Here is the Java source code for the app:</p><pre><code>package com.Actual.android;import android.app.Activity;import android.os.Bundle;import android.widget.*;import android.view.*;public class ActualStorageActivity extends Activity{ Spinner selection; /* declare variable, in order to control spinner (ComboBox) */ ArrayAdapter adapter; /* declare an array adapter object, in order for spinner to work */ EditText size; /* declare variable to control textfield */ EditText result; /* declare variable to control textfield */ Button calculate; /* declare variable to control button */ Storage capacity = new Storage(); /* import custom class for formulas */    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main); // load content from XML selection = (Spinner)findViewById(R.id.spinner); adapter = ArrayAdapter.createFromResource(this, R.array.choices_array, android.R.layout.simple_spinner_dropdown_item); size = (EditText)findViewById(R.id.size); result = (EditText)findViewById(R.id.result); calculate = (Button)findViewById(R.id.submit); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); /* set resource for dropdown */ selection.setAdapter(adapter); // attach adapter to spinner result.setEnabled(false); // make read-only result.setText(""usable storage""); } public void calcAction(View view) {   String initial = size.getText().toString();   String unit = selection.getSelectedItem().toString();   String end = ""Nothing"";   double convert = Double.parseDouble(initial);   capacity.setStorage(convert);   if (unit == ""KB"")   {    end = Double.toString(capacity.getKB());   }   else if (unit == ""MB"")   {    end = Double.toString(capacity.getMB());   }   else if (unit == ""GB"")   {    end = Double.toString(capacity.getGB());   }   else if (unit == ""TB"")   {    end = Double.toString(capacity.getTB());   }   else if (unit == ""PB"")   {    end = Double.toString(capacity.getPB());   }   else if (unit == ""EB"")   {    end = Double.toString(capacity.getEB());   }   else if (unit == ""ZB"")   {    end = Double.toString(capacity.getZB());   }   else if (unit == ""YB"")   {    end = Double.toString(capacity.getYB());   }   else;   result.setText(end);  }}</code></pre>","333780","","6744","","2010-05-05 19:32:30","2012-06-06 23:24:36","get user selection and convert it to a String [Android]","<android><spinner>","2","2","","",""
"2776116","1","2776180","","2010-05-05 19:19:45","14","2959","<p>I am writing an app that requires you to be logged in to a service before using it.  From my understanding of android so far, you have to choose which activity to launch when you open from the launcher in the manifest.  I don't know which activity i want to launch at compile time.  I want the user to click the icon, then I check and see if they're logged in, then decide based on that whether to launch the login activity, or the main app activity.  Is there a way to do this? </p>","234339","","","","","2010-05-05 19:29:29","How do i dynamically choose which activity to launch when opening an app","<android><android-manifest>","1","0","5","",""
"2776340","1","3826745","","2010-05-05 19:57:15","1","2182","<p>Just started working with android and ran into a small problem. I am have a TabActivity that is loading 3 other Activity classes. This works great. I then have a button on the other Activity classes that I would like to launch a MapActivity. When I do that I keep getting a Force Close. </p><p>I googled but I cannot figure out if it is the manifest file or something else. The idea is the tabs are showing location information and you click a button to plot it on the map and get directions. </p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.location_tab); </code></pre><p>...         Button btnMap = (Button) findViewById(R.id.btnLaunchMap);         btnMap.setOnClickListener(mMapListener); } </p><p>private OnClickListener mMapListener = new OnClickListener() {         public void onClick(View v) {           Intent mapIntent = new Intent(getApplicationContext(),LocationMap.class);           startActivity(mapIntent);<br>        }     }; </p><p>If I launch any other activity it works but not launching the mapactivity. If I take the mapactivity class and put it in a new project it works. </p><p>My manifest </p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt; &lt;application android:icon=""@drawable/icon""    android:label=""@string/app_name""&gt;  &lt;activity android:name="".Splash""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&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="".Locations""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;&lt;/activity&gt;     &lt;activity android:name="".LocationNewYork""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;               &lt;/activity&gt;        &lt;activity android:name="".LocationChicago""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;&lt;/activity&gt;     &lt;activity android:name="".LocationSeattle""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;&lt;/activity&gt;  &lt;activity android:name="".LocationMap""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;       &lt;/activity&gt;     &lt;uses-library android:name=""com.google.android.maps""/&gt; &lt;/application&gt; </code></pre><p>thougths?</p>","74743","","","","","2010-09-29 23:58:06","MapActivity launching from OnClickListener","<android><google-maps>","2","2","","",""
"2776830","1","2776875","","2010-05-05 21:14:17","13","11218","<p>I am writing a application where I am dealing with 4 activities, let's say A, B, C &amp; D. Activity A invokes B, B invokes C, C invokes D. On each of the activity, I have a button called ""home"" button. When user clicks on home button in any of the B, C, D activities, application should go back to A activity screen ?</p><p>How to simulate ""home"" button in this case ?</p>","248132","","","","","2013-08-28 12:46:42","Android moving back to first activity on button click","<android>","2","1","5","",""
"2776939","1","","","2010-05-05 21:31:28","2","374","<p><a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQueryWithFactory%28android.database.sqlite.SQLiteDatabase.CursorFactory,%20java.lang.String,%20java.lang.String%5B%5D,%20java.lang.String%29"" rel=""nofollow"" title=""QLiteDatabase.rawQueryWithFactory"">SQLiteDatabase.rawQueryWithFactory</a> has one parameter <code>editTable</code> which I don't really understand. I looked at the source and found out that I'll probably be fine by using <code>findEditTables( tableName )</code> as the value (because that's the value which is used when <code>queryWithFactory</code> is called), and as <code>findEditTables</code> will just get the first table out of that string list, I guess simply passing one of the table names I am quering as the parameter will work out fine.</p><p>However that still doesn't help me to understand what the parameter is used for, so if you know it would be nice if you could explain :)</p>","216074","","","","","2012-10-03 21:48:00","Android SQLiteDatabase.rawQueryWithFactory, editTable parameter","<android>","1","0","1","",""
"2777042","1","2777739","","2010-05-05 21:49:23","0","1126","<p>None of my apps work in the emulator. I am running Ubuntu 9.10 and everytime I try to access my UI, the app crashes. All I get is an ""Sorry! The application ... has stopped unexpectedly"". For EVERY app this happens. </p><pre><code>package com.mohit.helloandroid;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class HelloAndroid extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        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 tab spec         Intent intent;        intent = new Intent().setClass(this, HelloAndroid.class);        spec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"", res            .getDrawable(R.drawable.tab_artists))                .setContent(intent);        tabHost.addTab(spec);    }}</code></pre><p>I don't know how this code could possibly throw a message like that.</p>","200477","","","","","2010-05-06 00:53:09","Android Apps not working in emulator","<java><android><android-emulator>","1","3","","",""
"2777098","1","2778145","","2010-05-05 22:01:13","8","6012","<p>Is there any other way to call openOptionsMenu after activity is displayed without using something like this:</p><pre>new Handler().postDelayed(new Runnable() {            public void run() {                openOptionsMenu();            }        }, 1000); </pre><p>Reference:<a href=""http://groups.google.com/group/android-beginners/browse_frm/thread/b10a8ea840c07725/1ce48bb147a3ed1a?#1ce48bb147a3ed1a"">http://groups.google.com/group/android-beginners/browse_frm/thread/b10a8ea840c07725/1ce48bb147a3ed1a?#1ce48bb147a3ed1a</a></p><p>EDIT: I would appreciate example like this:</p><pre>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Now I guess something like Window.Callback.onAttachedToWindow(...) should be done?}</pre>","237858","","237858","","2010-05-18 15:38:14","2011-02-10 06:27:11","Android - openOptionsMenu doesn't work in onCreate","<android>","2","1","3","",""
"2777158","1","","","2010-05-05 22:14:29","5","5894","<p>I used IntentService in my code instead of Service because IntentService creates a thread for me in onHandleIntent(Intent intent), so I don't have to create a Thead myself in the code of my service. </p><p>I expected that two intents to the same IntentSerivce will execute in parallel because a thread is generated in IntentService for each invent. But my code turned out that the two intents executed in sequential way.</p><p>This is my IntentService code:</p><pre><code>public class UpdateService extends IntentService {    public static final String TAG = ""HelloTestIntentService"";    public UpdateService() {        super(""News UpdateService"");    }    protected void onHandleIntent(Intent intent) {        String userAction = intent        .getStringExtra(""userAction"");        Log.v(TAG, """" + new Date() + "", In onHandleIntent for userAction = "" + userAction + "", thread id = "" + Thread.currentThread().getId());        if (""1"".equals(userAction)) {            try {                Thread.sleep(20 * 1000);            } catch (InterruptedException e) {                Log.e(TAG, ""error"", e);            }            Log.v(TAG, """" + new Date() + "", This thread is waked up."");        }    }}</code></pre><p>And the code call the service is below:</p><pre><code>public class HelloTest extends Activity {    //@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent selectIntent = new Intent(this, UpdateService.class);        selectIntent.putExtra(""userAction"",                ""1"");        this.startService(selectIntent);        selectIntent = new Intent(this, UpdateService.class);        selectIntent.putExtra(""userAction"",                ""2"");        this.startService(selectIntent);    }}</code></pre><p>I saw this log message in the log:</p><pre><code>V/HelloTestIntentService(  848): Wed May 05 14:59:37 PDT 2010, In onHandleIntent for userAction = 1, thread id = 8D/dalvikvm(  609): GC freed 941 objects / 55672 bytes in 99msV/HelloTestIntentService(  848): Wed May 05 15:00:00 PDT 2010, This thread is waked up.V/HelloTestIntentService(  848): Wed May 05 15:00:00 PDT 2010, In onHandleIntent for userAction = 2, thread id = 8I/ActivityManager(  568): Stopping service: com.example.android/.UpdateService</code></pre><p>The log shows that the second intent waited the first intent to finish and they are in the same thread.</p><p>It there anything I misunderstood of IntentService. To make two service intents execute in parallel, do I have to replace IntentService with service and start a thread myself in the service code?</p><p>Thanks.</p>","256239","","","","","2013-03-04 04:31:57","Unexpected behavior of IntentService","<android>","5","0","","",""
"2777394","1","","","2010-05-05 23:12:14","0","1471","<p>I have an Android application that displays VGA (640x480) frames using OpenGL ES.  The application reads each frame from a movie file and updates the texture accordingly.</p><p>My problem is that, it is taking almost 30 ms. to draw each frame using OpenGL.   Similar test using the Canvas/drawBitmap was around 6 ms on the same device.</p><p>I'm following the same OpenGL calls that VLC Media Player is using, so I'm assuming that those are optimized for this purpose.</p><p>I just wanted to hear your thoughts and ideas about it?</p>","287597","","","","","2012-03-20 16:33:11","Why OpenGL ES texture mapping is very slow?","<android><opengl-es>","2","1","","",""
"2777515","1","","","2010-05-05 23:49:07","1","887","<p>I have a TableLayout on one Android Activity UI. It has two columns. Now I need to add a new row, and put an EditText box in second column of that new row. And also, I want that EditText full fill the whole cell. I have some code like this:</p><pre><code>TableRow tr = new TableRow(context);EditText et = new EditText(context);et.SetMaxLines(4);etText.setLayoutParams(new TableRow.LayoutParams(1));  //set it to the second coloumntr.addView(et);tl.addView(tr);   //tl is the tableLayout</code></pre><p>It puts the EditText in the second column fine, but the EditText is too small. I tried to use etText.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));  but that seems to disabled the TableRow.LayoutParams setting. I guess each control can only have one LayoutParamas setting. So, how to make the EditText as a 4 lines text editor and also make sure it is in the second column of that row? </p><p>Thanks.</p>","333963","","","","","2011-12-30 21:34:33","How to set a EditText in a certain column of a TableLayout?","<android><tablelayout><editbox>","2","0","","",""
"2778080","1","","","2010-05-06 02:31:56","3","4115","<p>I want to know how to do method tracing for Android applications. I mean, a sequence of calls on each object, not a stack trace.</p><p>It's very similar to <a href=""http://stackoverflow.com/questions/1025681/call-trace-in-java"">this question (Call trace in java)</a>, but on different platforms (jvm-PC vs dvm-Android). I have no control over the start arguments of dalvik, thus I cannot specify a java agent (or am I wrong here?). Is there another way to do method tracing?</p><p>Thanks!</p>","334019","","","","","2010-05-06 05:34:23","Call trace in Android","<android>","1","0","1","",""
"2778098","1","2778136","","2010-05-06 02:39:38","2","7613","<p>I'm trying to create a ""scrollable"" layout in Android.  Even using developers.android.com, though, I feel a little bit lost at the moment.  I'm somewhat new to Java, but not so much that I feel I should be having these issues--being new to Android is the bigger problem right now.</p><p>The layout I'm trying to create should scroll in a sort of a ""grid"".  I THINK what I'm looking for is the Gallery view, but I'm really lost as to how to implement it at the moment.  I want it to ""snap"" to center the frame, like in the actual Gallery application.</p><p>Essentially, if I had a photo gallery of 9 pictures, the idea is to scroll between them up/down AND side to side, in a 3x3 manner.  Doesn't need to dynamically adjust, or anything like that, I just want a grid I can scroll through.</p><p>I'm also not asking for anyone to give me explicit code for it--I'm trying to learn, more than anything.  But pointing me in the right direction for helpful layout programming resources would be greatly appreciated, and confirming if it's a Gallery view I'm looking for would also be really helpful.</p><p>EDIT: To clarify, the goal is to have ONE item on screen at a time.  If you scroll between one item and the next, the previous one leaves the screen, and the new one snaps into place.  So if it were a photo gallery, each spot on the grid would take up the entire screen size, approximately, and would be flung out of the viewable area when you slide across to the next photo, in either direction.  (Photos are just an example for illustration purposes)</p>","313141","","313141","","2010-05-06 21:26:32","2011-11-03 12:53:09","Android: Creating a Scrollable Layout","<java><android><layout><scrolling><gallery>","3","1","0","",""
"2778215","1","","","2010-05-06 03:21:19","9","11885","<p>When I start my AVD emulator, the emulator just shows blank screen with 'android' written at the center. I waited for half an hour but nothing changed.</p><p>I am using Android SDK 2.1 and Eclipse 3.5</p>","334051","","984393","","2012-08-14 20:05:08","2014-01-20 15:04:31","Android AVD on Eclipse shows 'Blank Screen' with no activity","<android><android-emulator>","2","2","","",""
"2778218","1","2779872","","2010-05-06 03:21:51","1","2551","<p>I have a View that extends Activity. A ListView will display a number of listitems. When the user long clicks I would like to present them with a contextmenu allowing them to select edit, delete etc... and then identify the listitem that was selected as the item to perform the action on.</p><p>In onCreate I have:</p><pre><code>listView.setAdapter(adapter);listView.setOnItemClickListener(onListClick);listView.setOnItemLongClickListener(onListLongClick);registerForContextMenu(listView);</code></pre><p>I have a method onCreateContextMenu</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {super.onCreateContextMenu(menu, v, menuInfo);    menu.setHeaderTitle(""Context Menu"");    menu.add(0, v.getId(), 0, ""Edit"");    menu.add(0, v.getId(), 0, ""Delete"");}</code></pre><p>and also onContextItemSelected</p><pre><code>@Overridepublic boolean onContextItemSelected(MenuItem item) {    if (item.getTitle() == ""Edit"") {        // edit action    } else if (item.getTitle() == ""Delete"") {        // delete action    } else {        return false;    }    return true;}</code></pre><p>I am not sure where to go from here to get the correct row/listitem.</p>","312443","","","","","2013-05-28 06:42:44","identifying id of listitem for contextmenu","<android><contextmenu><listitem>","1","0","2","",""
"2778316","1","2778356","","2010-05-06 03:47:21","1","4791","<p>I get this weird exception when i run my app on both the emulator and a USB connected device.  i can see the table inside the shell, but when I try to insert a record from the Activity acton I get this exception:</p><p><em><strong>android.database.sqlite.SQLiteException: table audios has no column named downloaded</em></strong></p><p>I am mostly running on an emulator with Android 1.5. The predominant part of my code is linked to this tutorial - <a href=""http://www.devx.com/wireless/Article/40842/1954"" rel=""nofollow"">http://www.devx.com/wireless/Article/40842/1954</a>.</p><p>This is the create statement I use:</p><pre><code> private static final String DATABASE_CREATE =  ""create table audios ( _id integer primary key autoincrement, ""  + ""user_name text not null, title text not null, file_path text not null, download integer not null, ""   + ""created_at integer not null, downloaded_at integer not null );"";</code></pre><p>This is the insert code I use:</p><pre><code>//--- insert a title into the database --- public long insertTitle(String user_name, String title, String file_path, Integer downloaded, long created_at, String downloaded_at ) {  ContentValues initialValues = new ContentValues();  initialValues.put(KEY_USER_NAME, user_name);  initialValues.put(KEY_TITLE, title);  initialValues.put(KEY_FILE, file_path);  initialValues.put(KEY_DOWNLOADED, downloaded);  initialValues.put(KEY_CREATED_AT, created_at);  initialValues.put(KEY_DOWNLOADED_AT, downloaded_at);  return db.insert(DATABASE_TABLE, null, initialValues); }</code></pre>","334064","","267","","2010-05-06 04:25:46","2013-06-06 11:05:46","Android & SQLite: ""Table audios has no column named downloaded""","<android><exception><sqlite3>","3","3","","",""
"2778539","1","","","2010-05-06 04:55:33","1","990","<p>Team,</p><p>I am facing some issue at the time of parsing the XML, but the same works in Java program... When I run the same code through android prgming its failing to parse...</p><pre><code>InputStream byteArrayInputStream = new ByteArrayInputStream(    response.toString().getBytes());   SAXParser parser = SAXParserFactory.newInstance().newSAXParser();   parser.parse(byteArrayInputStream, xmlHandler);</code></pre><p>Facing the following error</p><p>DTD handlers aren't supported</p><p>Any help is greatly appreciated.</p><p>Thanks,Ramesh</p>","330266","","66475","","2011-12-06 18:23:19","2011-12-06 18:23:19","android : sax Xml parsing","<android>","1","0","","",""
"2778740","1","","","2010-05-06 05:50:31","4","1770","<p>I intend to write tests related to the Phone and Direct SIM write.</p><p>What are the alternatives in case the required APIs aren't exposed in TelephonyManager but exist as private APIs in <code>PhoneBase.java</code>, <code>PhoneFactory.java</code> or <code>CommandInterface.java</code>?</p><p>Specifically, my questions are:</p><ol><li>What is the ""replacement"" for: <code>PhoneFactory.getDefaultPhone()</code>?</li><li>What is the alternative in order to access the <code>CommandsInterface</code> (e.g.: <code>CommandsInterface mCmdIf = ((PhoneBase)mPhone).mCM</code>)?</li></ol><p>Thanks in advance,<br>Micha</p>","334113","","154306","","2011-01-26 12:28:35","2011-08-26 06:49:48","How can I access Android private API's which doesn't exposed in TelephonyManager?","<android><telephony><telephonymanager>","1","1","2","",""
"2778745","1","","","2010-05-06 05:51:57","2","1868","<p>I'm trying to add a new account in android 2.1 emulator. When I'm entering my password, I found it's impossible to input some symbols, such as #,$,&amp;,*, except @. For example, while I press shift+7, only 7 is shown in the password textview. </p><p>Any suggestion? </p>","324214","","","","","2012-08-19 19:57:10","How to input ampersand(&), asterisk(*) and other characters in android 2.1 emulator?","<android>","4","0","","",""
"2778906","1","","","2010-05-06 06:24:50","0","665","<p>Suppose one application is running which is using GPRS connection. If in between that if call comes what will happened with that GPRS connection?? It still persist or it is get disconnected??</p><p>Thanks </p>","323062","","","","","2010-05-06 06:30:58","GPRS connection still connected while receiving phone call?","<android>","1","0","","",""
"2779002","1","","","2010-05-06 06:41:56","34","44155","<p>More generally, If a device has more than one camera,is there any way to initializing it?</p><p>I didn't find it in android reference doc.</p><p>Samsung SHW-M100S have 2 cameras.If there is no reference to use 2 cams, Any idea how samsung did..?</p>","263207","","","","","2014-04-12 17:12:12","How to open ""front camera"" on android platform?","<android><camera>","6","1","23","",""
"2779217","1","","","2010-05-06 07:21:38","3","2905","<p>If I create a checkbox view and call setEnabled(false), the checkbox look is grayed but if I create a radiobutton, the view is inactive but it is not grayed. Any idea ?</p>","164460","","","","","2011-10-12 09:55:30","android radiobutton disabled","<android><radio-button>","1","3","1","",""
"2779625","1","2783933","","2010-05-06 08:35:07","2","2930","<p>I'm writing a program that should display the amount of unread sms, mms, phone calls and emails. It was quite easy to find how to query for sms and phone calls (I used the search on this page) but I have not been able to find out how to query for emails. </p><p>Is there anyway to find out how many unread emails the user got in their phone?</p>","265023","","","","","2011-09-29 16:00:25","Android - How can I find out how many unread email the user has?","<android><gmail>","3","0","2","",""
"2779933","1","2780386","","2010-05-06 09:23:38","3","4625","<p>I had a simple button set up with a background image defined like</p><pre><code>android:background=""?attr/button""</code></pre><p>where <code>?attr/button</code> was a reference to a simple 9-patch png. Everything worked fine, text in the button was aligned correctly.</p><p>Then I needed to have a different background for a pressed state of the button. So I changed that to</p><pre><code>android:background=""@drawable/state_button""</code></pre><p>where <code>@drawable/state_button</code> is an xml with the following states</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/button_pressed"" /&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true""        android:drawable=""@drawable/button_pressed"" /&gt; &lt;!-- focused --&gt;    &lt;item android:drawable=""@drawable/button"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>And after that I can't align the text properly. If I put <code>android:gravity=""center_vertical""</code> the text is drawn about 1/4 of the button height from the top.</p><p>I double-checked my 9-patch images, everything seems fine with them. And I also tried having regular pngs for the background, it also doesn't change anything.</p>","125805","","","","","2010-11-17 14:04:32","How to vertically align text in a button with a background drawable?","<android><text><button><alignment>","2","0","1","",""
"2779991","1","","","2010-05-06 09:31:58","7","6019","<p>HI, all! </p><p>I'm trying to implement my own phone call handling UI.</p><p>What I want to do is, if a call comes in, the incoming telephone number and a picture are displayed, and, if I press a button, the incoming call will be accepted/answered. </p><p>The related codes are:</p><pre><code> @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    answerButton = (Button) findViewById(R.id.pickup);    answerButton.setOnClickListener(new OnClickListener() {        public void onClick(final View v) {            Intent intent = new Intent(""android.intent.action.ANSWER"");            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            startActivity(intent);                  }    });</code></pre><p>Sadly, the code does not work. At first, an exception is thrown if I press my answer button:</p><pre><code>  ActivityNotFoundException: No Activity found to handle Intent {    act=android.intent.action.ANSWER</code></pre><p>Then I added an entry in the AndroidManifest.xml:</p><pre><code>&lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;</code></pre><p>I run the app again, there is no exception anymore. However, I doubt the incoming call is not really accepted. Because if the press the Android's screen answer button (green button), the incoming call is accepted and a green in call icon is also displayed on the upper left corner of the emulator screen, while my app doesn't.</p><p>I also read the Phone app's source code in android source.  There is method such as acceptCall()  in the Phone class. But these codes seem difficult for me to use, because there are many imports declaration in the code, such as :</p><pre><code>import com.android.internal.telephony.Call;import com.android.internal.telephony.CallStateException;import com.android.internal.telephony.CallerInfo;import com.android.internal.telephony.CallerInfoAsyncQuery;import com.android.internal.telephony.Connection;import com.android.internal.telephony.MmiCode;import com.android.internal.telephony.Phone;</code></pre><p>And, if I add these imports in my code, there will be too many errors, such as : ""The import com.android.internal.telephony cannot be resolved""</p><p>What is the right and simple way for my problem?</p><p>Thanks in advance!</p>","324214","","473070","","2010-12-22 13:39:13","2014-02-22 06:10:20","How to accept an incoming call by clicking a button?","<android>","5","1","0","",""
"2780005","1","2781159","","2010-05-06 09:34:50","3","639","<p>I uploaded an app built with 1.5 SDK into market, but someone told me they can not find it in the market in their phone. I do not know why, because I have test it in 2.1 emulator. </p><p>Then how to know if my app is available in android market with all versions, is there any url to test that?</p>","238061","","","","","2010-05-06 12:44:10","How to know if my app is available in android market with all versions?","<android><google-play>","1","2","1","",""
"2780031","1","2780941","","2010-05-06 09:38:13","3","1783","<p>After many houres of bug searching in a big app, I have finally tracked down the bug. This logging captures the problem:</p><pre><code>Log.d(TAG,""buildList, DBresult.getInt(1): ""+DBresult.getInt(1));Log.d(TAG,""buildList, DBresult.getString(1): ""+DBresult.getString(1));Log.d(TAG,""buildList, DBresult.getInt(4): ""+DBresult.getInt(4));Log.d(TAG,""buildList, DBresult.getString(4): ""+DBresult.getString(4));</code></pre><p>The resulting output:</p><pre><code>05-06 11:11:20.123: DEBUG/TodoList(18943): buildList, DBresult.getInt(1): 005-06 11:11:20.123: DEBUG/TodoList(18943): buildList, DBresult.getString(1): false05-06 11:11:20.123: DEBUG/TodoList(18943): buildList, DBresult.getInt(4): 005-06 11:11:20.123: DEBUG/TodoList(18943): buildList, DBresult.getString(4): true</code></pre><p>There are no backgroung threads running. As you can see the problem is that '0' is interpreted as false on one occasion, and as true on another. Since I am completely lost on how this can happen, I dont know how to proceed. What could possibly result in such a behaviour? Both the columns are of the type ""boolean"", i.e a numeric in sqlite. Unfortunately the string returned is the correct value, while the integer is always 0. If I export the database to my computer and check it with SQlite Administrator I can see that the values are correctly set, it is only the getInt()-function that always returns 0. I know for a fact that this works in other apps I have coded, and I dont know why this has stopped working.</p><p>I have tried compiling the code under 2.0, 2.0.1 and 2.1, and it always appears. I can make my app runnable again by getting boolean values like this:</p><pre><code>myBool= (DBresult.getString(0).equals(""true""));</code></pre><p>but that is both ugly and not optimized. Any suggestions on what is causing this behaviour is welcome.</p><p>Cheers,</p>","249871","","","","","2010-05-06 12:12:38","Android Cursor strange behaviour","<android><sqlite><cursor>","1","3","","",""
"2780102","1","2780475","","2010-05-06 09:48:52","52","79770","<p>I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example)</p><p>I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to.</p><p>I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually.</p><p>Thanks for your help</p><pre><code>05-06 11:22:24.945: INFO/ActivityManager(76): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks bnds=[243,338][317,417] }05-06 11:22:25.005: INFO/ActivityManager(76): Start proc com.google.android.maps.mytracks for activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: pid=1176 uid=10063 gids={3003, 1015}05-06 11:22:26.995: INFO/ActivityManager(76): Displayed activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: 1996 ms (total 1996 ms)</code></pre>","334278","","235654","","2010-05-06 10:47:08","2014-04-16 06:11:08","Open another application from your own (intent)","<android><android-intent>","10","0","48","",""
"2780107","1","2949634","","2010-05-06 09:49:44","0","1600","<p>I am writing an application which encrypts and decrypts the user notes based on the user set password. i used the following algorithms for encryption/decryption1. PBEWithSHA256And256BitAES-CBC-BC2. PBEWithMD5And128BitAES-CBC-OpenSSL</p><pre><code>    e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);    d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);    e_Cipher.init()    d_Cipher.init()</code></pre><p>encryption is working well, but when trying to decrypt it gives </p><blockquote>  <p>Exception - Illegal Block size</p></blockquote><p>after encryption i am converting the cipherText to HEX and storing it in a sqlite database. i am retrieving correct values from the sqlite database during decyption but when calling <code>d_Cipher.dofinal()</code> it throws the Exception.</p><p>I thought i missed to specify the padding and tried to check what are the other available cipher algorithms but i was unable to found. </p><p>so request you to please give the some knowledge on <em>what are the cipher algorithms and padding that are supported by Android? if the algorithm which i used can be used for padding, how should i specify the padding mechanism?</em>I am pretty new to Encryption so tried a couple of algorithms which are available in <a href=""http://www.google.com/codesearch/p?hl=en#atE6BTe41-M/libcore/security/src/main/java/org/bouncycastle/jce/provider/BouncyCastleProvider.java&amp;q=package%3aandroid%20blowfish%20lang%3ajava&amp;d=9&amp;t=0&amp;l=205"" rel=""nofollow"">BouncyCastle.java</a> but unsuccessful.</p><p>As requested here is the code</p><pre><code>public class CryptoHelper {private static final String TAG = ""CryptoHelper"";//private static final String PBEWithSHA256And256BitAES = ""PBEWithSHA256And256BitAES-CBC-BC"";//private static final String PBEWithSHA256And256BitAES = ""PBEWithMD5And128BitAES-CBC-OpenSSL"";private static final String PBEWithSHA256And256BitAES = ""PBEWithMD5And128BitAES-CBC-OpenSSLPBEWITHSHA1AND3-KEYTRIPLEDES-CB"";private static final String randomAlgorithm = ""SHA1PRNG"";public static final int SALT_LENGTH = 8;public static final int SALT_GEN_ITER_COUNT = 20;private final static String HEX = ""0123456789ABCDEF"";private Cipher e_Cipher; private Cipher d_Cipher;private SecretKey secretKey;private byte salt[];public CryptoHelper(String password) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeySpecException {    char[] cPassword = password.toCharArray();    PBEKeySpec pbeKeySpec = new PBEKeySpec(cPassword);    PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, SALT_GEN_ITER_COUNT);    SecretKeyFactory keyFac = SecretKeyFactory.getInstance(PBEWithSHA256And256BitAES);    secretKey = keyFac.generateSecret(pbeKeySpec);    SecureRandom saltGen = SecureRandom.getInstance(randomAlgorithm);    this.salt = new byte[SALT_LENGTH];    saltGen.nextBytes(this.salt);    e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES);    d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES);    e_Cipher.init(Cipher.ENCRYPT_MODE, secretKey, pbeParamSpec);    d_Cipher.init(Cipher.DECRYPT_MODE, secretKey, pbeParamSpec);}public String encrypt(String cleartext) throws IllegalBlockSizeException, BadPaddingException {    byte[] encrypted = e_Cipher.doFinal(cleartext.getBytes());    return convertByteArrayToHex(encrypted);}public String decrypt(String cipherString) throws IllegalBlockSizeException {    byte[] plainText = decrypt(convertStringtobyte(cipherString));    return(new String(plainText));}public byte[] decrypt(byte[] ciphertext) throws IllegalBlockSizeException {            byte[] retVal = {(byte)0x00};    try {        retVal = d_Cipher.doFinal(ciphertext);    } catch (BadPaddingException e) {        Log.e(TAG, e.toString());     }    return retVal;}public String convertByteArrayToHex(byte[] buf) {    if (buf == null)          return """";    StringBuffer result = new StringBuffer(2*buf.length);      for (int i = 0; i &lt; buf.length; i++) {        appendHex(result, buf[i]);      }    return result.toString();}private static void appendHex(StringBuffer sb, byte b) {    sb.append(HEX.charAt((b&gt;&gt;4)&amp;0x0f)).append(HEX.charAt(b&amp;0x0f));}private static byte[] convertStringtobyte(String hexString) {    int len = hexString.length()/2;    byte[] result = new byte[len];    for (int i = 0; i &lt; len; i++) {        result[i] = Integer.valueOf(hexString.substring(2*i, 2*i+2), 16).byteValue();    }    return result;}public byte[] getSalt() {    return salt;}public SecretKey getSecretKey() {    return secretKey;}public static SecretKey createSecretKey(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {    PBEKeySpec pbeKeySpec = new PBEKeySpec(password);    SecretKeyFactory keyFac = SecretKeyFactory.getInstance(PBEWithSHA256And256BitAES);    return keyFac.generateSecret(pbeKeySpec);}</code></pre><p>}</p><p>I will call <code>mCryptoHelper.decrypt(String str)</code> then this results in Illegal block size exceptionMy Env: Android 1.6 on Eclipse</p>","177303","","177303","","2010-05-07 06:00:17","2010-09-06 17:13:38","Exception - Illegal Block size during decryption(Android)","<android><encryption>","2","1","","",""
"2780119","1","2781643","","2010-05-06 09:52:55","-2","132","<p>I have a model (MVC) class whose internal state (which basically contains of private <code>int</code> fields) I want to store. </p><p>The program is running on Android (for now) so I need to store the in a <code>Bundle</code>, but I'll be using the same class later in a desktop application where I'll have to store the state some other way, so I can't reference <code>Bundle</code> directly in my class.</p><p>So my question is: What is the best way to store (and retrieve) the state of a class without exposing it's implementation?</p><p>The best I could think of removing the <code>private</code> access modifier so that the fields become package accessible and create read/write helper classes in the same package, but that somehow seems wrong. </p>","318493","","318493","","2010-05-06 13:11:10","2010-05-06 14:11:27","Transparently storing class state without exposing implementation","<java><android><model-view-controller><serialization>","2","0","1","",""
"2780264","1","2781522","","2010-05-06 10:18:18","1","1726","<ol><li>I have an Activity which uses a layout with a LinearLayout in it.</li><li>Now I want to create in runtime a subactivity which loads some other layout and add this layout as item of my LinearLatout.</li></ol><p>How to do this? Please provide me with code example.</p>","120574","","","","","2010-05-06 13:34:24","Adding to LinearLayout another Layout and handle this Layout in separate Activity","<android><layout><activity>","1","0","2","",""
"2780273","1","","","2010-05-06 10:19:51","3","1711","<p>I use a Webview to display an image with zooming and scrolling enabled.The WebView is set to wrap_content for the height and width and the zoomcontrols are enabled. </p><p>If the image is smaller then the screen the webview will show just the image and there is lots of space left on the screen. The moment the user zooms the WebView will grow to fit the new imagesize. The problem is that the zoomcontrols stay at the same spot and stop working after the webview is resized. If I let them fade out and touch the view again they will appear at the new bottom of the view and work again. </p><p>This seems like a bug in the webview to me. Is there a way to capture the resize of the webview and then disable and enable the zoomcontrols?</p>","114066","","","","","2012-01-12 09:58:30","Android WebView zoom controls are not moved after resize","<android><layout><webview>","1","0","","",""
"2780326","1","","","2010-05-06 10:28:19","1","4563","<p>I understand that all Android phones will have the WebKit browser Application. Is there a default Media Player that can perform RTSP stream in all Android phones?It seems OpenCore supoprts RTSP streaming - but is there a Media Player Application by default?</p>","334313","","50447","","2010-05-06 10:37:35","2012-03-02 06:37:08","Default Media Player in Android phones","<android><rtsp>","1","0","","",""
"2780514","1","2780574","","2010-05-06 11:00:51","1","155","<p>** <strong>Not sure if this is entirely relevant to SO, it is programming related in nature but if its more suitable to a different forum please let me know and I will remove it</strong> **</p><p>I have a couple of questions for any Rom developers/experts on here regarding things that can be done with Android ROM's.</p><p><strong>1)</strong> Is a parser Rom upgrade possible? So is it possible to change a small part of a ROM and then allow users to upgrade their ROM easily?</p><p>So can I change a part of a ROM and then a customer can upgrade to the newer ROM without having to be technically savvy and needing to root and flash their devices?</p><p><strong>2)</strong> Can a change be burnt into a ROM so that when a user selects ""Restore Factory Settings"" that it doesn't remove the upgrade to the ROM?</p><p><strong>3)</strong> So essentially I want to know if its possible (with a device manufacturers permission) to add to a ROM some small additional parts and then give this new ROM version as a firmware upgrade to the device so that a user only has to ""upgrade"" and not go through the process of rooting and flashing there device?</p>","243999","","","","","2010-05-06 11:10:01","Android - Adding to a ROM and upgrading - Questions","<android><upgrade><firmware>","1","0","","",""
"2780544","1","","","2010-05-06 11:05:17","2","1027","<p>I am navigating images with the clicks of next and previous buttons.Here is my code:</p><pre><code>package com.myapps.imagegallery;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ImageView;import android.widget.TextView;import android.widget.Toast;public class ImageGallery extends Activity {    /** Called when the activity is first created. */    int imgs[] = {R.drawable.bluehills,R.drawable.lilies,R.drawable.sunset,R.drawable.winter};    String desc[] = {""Blue Hills"", ""Lillies"", ""Sunset"", ""Winter"" };    int counter=0;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final ImageView imgView = (ImageView)findViewById(R.id.ImageView01);        imgView.setImageResource(imgs[counter]);        final TextView tvDesc = (TextView)findViewById(R.id.tvDesc);        Button btnNext = (Button)findViewById(R.id.btnNext);        btnNext.setOnClickListener(new View.OnClickListener(){            @Override            public void onClick(View arg0) {                try{                // TODO Auto-generated method stub                if (counter &lt; desc.length -1)                   counter++;                imgView.setImageResource(imgs[counter]);                tvDesc.setText(desc[counter]);                }catch(Exception e)                {                    Toast.makeText(ImageGallery.this, e.toString(), Toast.LENGTH_SHORT).show();                }            }        });        Button btnPrev = (Button)findViewById(R.id.btnPre);        btnPrev.setOnClickListener(new View.OnClickListener(){            @Override            public void onClick(View arg0) {                // TODO Auto-generated method stub                try{                    // TODO Auto-generated method stub                    if (counter &gt; 0)                    counter--;                    imgView.setImageResource(imgs[counter]);                    tvDesc.setText(desc[counter]);                    }catch(Exception e)                    {                        Toast.makeText(ImageGallery.this, e.toString(), Toast.LENGTH_SHORT).show();                    }                       }});    }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout 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/ImageView01""android:layout_x=""70dip"" android:layout_width=""200px"" android:layout_height=""200px"" android:layout_y=""90dip""&gt;&lt;/ImageView&gt;    &lt;TextView     android:id=""@+id/tvDesc""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    android:layout_x=""90px""    android:layout_y=""300px""    /&gt;&lt;Button android:layout_x=""47dip"" android:layout_height=""wrap_content"" android:text=""Previous"" android:layout_width=""100px"" android:id=""@+id/btnPre"" android:layout_y=""341dip""&gt;&lt;/Button&gt;&lt;Button android:layout_x=""190dip"" android:layout_height=""wrap_content"" android:text=""Next"" android:layout_width=""100px"" android:id=""@+id/btnNext"" android:layout_y=""341dip""&gt;&lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre>","2355649","","21234","","2010-05-06 11:09:28","2010-05-06 11:09:28","How can i do the same thing with Gallery in Android","<android><gallery>","0","2","1","",""
"2781138","1","","","2010-05-06 12:41:33","0","182","<p>Can any one provide sample Remote service example. I want it like two different application. One application should contain service. Another application should use that service.Thanks in adv....</p>","551936","","313137","","2010-05-06 12:43:39","2012-02-13 11:03:00","Reg: Remote Service","<android><service>","2","2","1","",""
"2781304","1","2781468","","2010-05-06 13:07:58","1","1515","<p>Hey mates,is it possible, that android cleares the last known location after a restart?Yesterday my code worked very fine, but today after rebooting my phone (AND emulator) it seems that the .getLastKnownLocation (see below) returns null, which leads to a nullPointerException...Can you confirm that?How can I avoid this problem? I'm desperately searching for an answer</p><pre><code>lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);</code></pre><p>...</p><pre><code>Location locUser = lm    .getLastKnownLocation(LocationManager.GPS_PROVIDER);posUser = new GeoPoint((int) (locUser.getLatitude() * 1E6),(int) (locUser.getLongitude() * 1E6));</code></pre><p>Would be great if someone coult give me a hint or point out my mistake.</p><p>Nice greetings, Poeschlorn</p>","317301","","","","","2010-05-06 13:28:24","Android Position reset after Restart? -> Serious Problem","<android><gps><location><nullpointerexception>","1","0","","",""
"2781328","1","","","2010-05-06 13:12:51","1","813","<p>I have a widcomm example BluChat ""WIDCOMM SDK RFComm Service"" running on my PC with an USB dongle (BT-2400P). I would like to connect this chat from my HTC Desire. So I stared with the Java example <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/BluetoothChat/index.html</a>. This is also using BT RFComm. If I'm using my HTC as a server it work's fine, but I would like to use my PC as a server. Then .connect() comes back with ""Service Discovery Failure"".</p><p>I have modified the UUID string in the Java example to match the PC-application</p><pre><code>       mmSocket = mmDevice.createRfcommSocketToServiceRecord(UUID.fromString(""5fc2a42e-144e-4bb5-b43f-4e61711d1c32""));        mmSocket.connect();</code></pre><p>What is missing? </p><p>Any help appreciated.</p><p>Nicholas</p>","334459","","","","","2010-08-13 18:54:40","Connecting PC via Bluetooth SNP","<android><bluetooth>","2","0","","",""
"2781593","1","2782035","","2010-05-06 13:41:49","21","11512","<p>I'm trying to set my root LinearLayout element (which is set to fill_parent in both dimensions) to have a background image which is always located in the lower left corner of the screen no matter the orientation of the device. It would be excellent if there were some way to set the background image position such as that which you can do with css using ""background-position: left bottom;"" but I'm not seeing a way to achieve this in Android. Is there a way to do this?</p><p>Thanks for the help.</p>","198116","","","","","2012-10-08 10:32:52","Background Image Placement","<android><background-image><android-layout>","3","0","8","",""
"2781598","1","","","2010-05-06 13:42:38","3","2741","<p>From what I've read, speech recognition is available for 3 languages: English (UK, US, Au ..), Japanese and Chinese (Mandarin).</p><p>Does anyone know more details about how to switch between these languages?Is there a way to know (programatically) which language is active for speech recognition on a certain device? (maybe in Japan the only have Japanese ... but can I get this information somehow ... like a property or anything?).</p><p>Any help regarding this will be appreciated. </p><p>Thanks guys.</p>","316877","","316877","","2010-05-07 13:38:48","2013-11-25 04:00:22","Available languages for speech recognition","<android>","2","2","5","",""
"2781604","1","2788167","","2010-05-06 13:43:11","0","647","<h1>Here is my post:</h1><p>I'm trying to make myself as clear as possible:  </p><ol><li>Description of the classes in my application</li><li>Description of the code architecture (by the Service and by the Activity)</li><li>Description of what should happen</li><li>Description of what actually happens</li><li>Logcat</li><li>Source code</li></ol><hr><h2>Description of the application classes</h2><p>I have in my application:  </p><ul><li>a service that launches on boot, managed by the <code>MAJService</code> class</li><li>an activity that is managed by the <code>ConsoNRJ</code> class</li><li>a worker class that will get HTML pages over HTTP, called <code>MAJDonnees</code></li><li>an helper class that is called <code>InfosConso</code> and that will instantiate a <code>MAJDonnees</code> worker.</li></ul><h2>Description of the processing</h2><h3>When the Service starts, it will:</h3><ul><li>create an <code>InfosConso</code> object</li><li>this <code>InfosConso</code> object will create a <code>MAJDonnees</code></li><li>this <code>MAJDonnees</code> object will do HTTP queries using <code>HttpURLConnection</code></li></ul><h3>The activity does almost the same:</h3><ul><li>create an <code>InfosConso</code> object</li><li>this <code>InfosConso</code> object will create a <code>MAJDonnees</code></li><li>this <code>MAJDonnees</code> object will create an <code>AsyncTask</code>, and then do the HTTP queries using <code>HttpURLConnection</code></li></ul><p>You can see a graph that might help you understand my code:<br>code.google.com/p/consonrj/wiki/CodeStructure</p><hr><h2>What should happen</h2><p>Since the Activity and the Service basically run the <strong>same</strong> code (in the <code>MAJDonnees</code> class), they should behave exactly the same way: fetch HTML pages and parse them</p><h2>What actually happens</h2><p>When ran from the service, the <code>HttpURLConnections</code> returns a bad result while processing in <code>MAJDonnees</code>.The <code>HttpURLConnections</code> instance called <code>h</code> gives an invalid HTTP response: <code>h.getResponseCode()</code> returns -1.<br>I don't know how to get more debug information.  </p><p>However, if the activity is started, the HTTP connections work while processing in <code>MAJDonnees</code>, indeede <code>h.getResponseCode()</code> returns 200 (HTTP 200 OK).</p><p><strong>THEN</strong> if the Service runs again (it is scheduled to run every x minutes), the HTTP connections work!</p><hr><h2>Logcat</h2><p>You can have a logcat of the service first ran, then the activity, then again the service, and see the behavior.<br><a href=""http://pastebin.com/DGc8fym2"" rel=""nofollow"">http://pastebin.com/DGc8fym2</a><br>I'm sorry it is French, I hope you can still guess! :)</p><h2>Source code</h2><p>If you want, you can have a look at the whole source at:<br>code.google.com/p/consonrj/source/browse/#svn/trunk</p><hr><p>I hope you can help me debug this! My service needs to fetch data from Internet when the device starts and every x hours/days, and shouldn't need the activity to start first!</p><p>Thanks.</p>","334493","","","","","2010-05-07 11:29:33","Android Service unable to do HTTP connections until an Activity does HTTP connections","<java><android><httpurlconnection>","1","1","0","",""
"2781628","1","2783973","","2010-05-06 13:59:53","1","651","<p>I was wondering if there is any deviation or bug in de android 1.6 emulator on GPS coordinates.</p><p>when I search by Google maps on the GPS coordinates <code>51.501563,-0.12534</code> then I get ""Canon Row"" in London, but when i put this coordinates in the emulator(<code>geo fix -0.12534 51.501563</code>) the the emulator shows in Google maps(on the emulator) a different location(A301 bridge).</p>","193850","","","","","2012-03-24 22:12:24","deviation in gps coördinates android emulator","<android><android-emulator>","1","0","","",""
"2781800","1","2781890","","2010-05-06 14:24:51","0","1146","<p>Sorry for the question it might sounds stupid,</p><p>But:  <em>how do you activate a ProgressBar according to the cell you just cliked on ?</em></p><p>I have a list view, with a menu that shows after a long press.</p><p>When I click on one of my option I would like to display the ProgressBar in the listView according to the cell I clicked on. It is currently always displaying the one of my first cell, whatever I am doing</p><pre><code>public boolean onContextItemSelected(MenuItem item) {     AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();     switch (item.getOrder()) {        case 0:                    mProgressBar = (ProgressBar)findViewById(R.id.welcome_progressbar);                    mProgressBar.setVisibility(View.VISIBLE);            ... some execution ....                    return true;        case 1:                     ...</code></pre><p>Does anyone see anything wrong?</p>","290613","","","","","2010-05-06 14:35:49","ListView and undeterminate ProgressBar","<android><listview><progress-bar><contextmenu>","1","0","","",""
"2782015","1","","","2010-05-06 14:55:07","0","854","<p>How to change default focusable color(Orange) of <code>ExpandableListView</code>?   </p><p>Anyone have any idea please share.</p>","162644","","1079901","","2012-06-15 15:25:35","2012-06-15 15:25:35","Changing default focusable color of ExpandableListView","<android><listview>","1","1","","",""
"2782131","1","2782226","","2010-05-06 15:10:55","16","3154","<p>I'm starting Android doing an application for searching restaurants, and some guidance would be welcome!On the first screen I'd like to have a search field with a submit button (I get the data from a web service), and below a list with the results of the search. When clicking on one of the items of the list it will show a screen with the restaurant details as well as a map showing its location. My questions are:</p><ul><li>Can I do everything in one single activity or should I do an activity for the search, one for the result list, one for the restaurant description, and another for the map?</li><li>Would doing one single activity make the application more responsive?</li><li>How can I use a list and a map within a normal activity (without ListActivity and MapActivity)?</li></ul>","326849","","321731","","2014-03-08 23:09:19","2014-03-08 23:09:19","How many activities should I use?","<android>","4","2","3","2013-12-09 13:11:40",""
"2782218","1","2851159","","2010-05-06 15:22:30","1","3470","<p>Is it possible to connect the ADB with an HTC Hero?  I tried following the instructions for the <a href=""http://developer.android.com/sdk/win-usb.html"" rel=""nofollow"">Win USB driver</a> but when I try to install the driver I just get a generic message saying that there was a problem installing the driver.  Looking at the supported devices, the HTC Hero isn't listed.  Is this even possible?</p><p>As a note, I've tried removing drivers and then re-adding using USBDeview and I've also tried adding in the line "";HTC Hero%USB\VID_0BB4&amp;PID_0FFE.DeviceDescRelease%=androidusb.Dev, USB\Vid_0bb4&amp;Pid_0ffe&amp;Rev_0100"" in the inf file for the driver.</p>","326385","","","","","2010-05-17 17:13:15","Debugging android application on HTC Hero","<android><adb><htc-hero>","2","2","","",""
"2782448","1","2783139","","2010-05-06 15:51:19","0","3167","<p>Hey everyone,I'm trying to write an app that consists of an activity that manages a background service. However, I want to implement a user setting for automatically starting the service up at boot time. I have user settings implemented with SharedPreferences and I have the services starting up at boot by using a BroadcastReceiver and listening for BOOT_COMPLETED.</p><p>However, I can't figure out a good way to implement a setting so that the service is only started at boot if said setting is enabled. I can think of a few cheap ways to do this (such as messing with onCreate() in the service, or creating/checking for a file on SD card) but I want to follow good practice.</p><p>There must be a good way to do this because there's tons of apps out there that do it, I just can't find anything online about how to do it.</p><p>Thanks</p>","334608","","","","","2011-11-17 13:40:55","Android: how to start a service at boot based on user-settings?","<android>","3","0","3","",""
"2782612","1","2792774","","2010-05-06 16:12:52","2","562","<p>I have created a simple map app that shows the local garage sales in my town. It was simple enough to create and I parse out the Google Maps (html) xml doc that the local paper uses on their google maps mashup on their website.</p><p>I have noticed that the Map Tiles used in the MapView class are not as high-res as the tiles used in the real Android Google Maps app (I have a Droid). I have searched the docs and google, but I cannot find any info on this. Actually, I can't even find anyone mentioning this, which surprises me and makes me think I am missing something simple. Is this a case of Google making the APIs available, but at a lower quality, or am I missing some setting that enables higher quality map tiles?</p>","32965","","32965","","2010-05-06 16:53:26","2011-01-12 13:58:57","Android MapView with High Res tiles?","<android>","3","0","1","",""
"2783120","1","","","2010-05-06 17:29:41","1","1124","<p>Here's a question that comes from an unclear view of how things work : can a a phone be data roaming without being voice roaming ? If so how can a begin data roaming event can be detected ? This question came to me from the DDMS options , where one can have"" data roaming "" and  ""home voice"" .</p>","284609","","","","","2010-08-03 07:18:34","Data roaming in android","<android>","1","1","1","",""
"2783519","1","2784567","","2010-05-06 18:37:26","0","1952","<p>I have here a button which calls a very long lasting calculation. To indicate this to the user, i want to display a loading symbol. The calculation is called in this method in a extra thread (LoadingAnimationThread);</p><pre><code>@Override        public void onClick(View v) {            BookView bookView = (BookView) lexs.startBook();            LoadingAnimationThread thread = null;            if (type == BOOK) {            thread = new LoadingAnimationThread(BOOK, book, bookView);            } else if (type == CHAPTER) {                thread = new LoadingAnimationThread(CHAPTER, chapter, bookView);            } else if (type == PARAGRAPH) {                thread = new LoadingAnimationThread(PARAGRAPH, paragraph, bookView);            }            LoadingAnimation.startAnimation();            thread.run();        }</code></pre><p>The run method of the thread is the following:</p><pre><code>@Override        public void run() {            if (type == BOOK) {                ((BookView) bookView).setBookToDisplay(book);            } else if (type == CHAPTER) {                ((BookView) bookView).setBookToDisplay(chapter.getBook());                ((BookView) bookView).setExpanededChapter(chapter, true);            } else if (type == PARAGRAPH) {                ((BookView) bookView).setBookToDisplay(paragraph.getParentChapter().getBook());                ((BookView) bookView).setExpanededChapter(paragraph.getParentChapter(), false);                ((BookView) bookView).setExpandedParagraph(paragraph);            }            LoadingAnimation.stopAnimation();        }</code></pre><p>This calls in the run method of the Thread are the methods which need a lot of calculation. With LoadingAnimation.startAnimation() and LoadingAnimation.stopAnimation() is start respectively stop the animation:</p><pre><code>public static void startAnimation() {        lexs.runOnUiThread(new Runnable() {            @Override            public void run() {                loadingImage.setImageResource(R.drawable.loading_background);                animation.start();                Log.v(""Animation"", ""Loading Animation started"");            }        });    }    public static void stopAnimation() {        lexs.runOnUiThread(new Runnable() {            @Override            public void run() {                loadingImage.setImageResource(R.drawable.loading0);                animation.stop();                Log.v(""Animation"", ""Loading Animation stopped"");            }        });    }</code></pre><p>I see the Log lines in Logcat, but the animation isn't visible on the GUI. Why not??? I know the animation works properly, because on other places it works correctly. Sometimes Android doesn't update the UI immediately, that's why i used runOnUIThread(). But the doc for this method says:</p><blockquote>  <p>If the current thread is the UI  thread, then the action is executed  immediately.</p></blockquote><p>So i think the current thread isn't the UI thread, but how can i find the UI thread? Or how can i force the Runnable to run immediately??</p>","","anon","","","","2010-05-06 21:17:11","Android Animation/GUI Behaviour","<android>","1","3","1","",""
"2783586","1","","","2010-05-06 18:46:46","14","20893","<p>I have tried <a href=""http://www.droiddraw.org/"">DroidDraw</a> and the Eclipse layout editor and both seem very difficult to create anything other than very simple layouts.  I find myself dropping back to the XML file to be able to manipulate it.</p><p>Has anyone found any good tools to design the actual screens?  I am not looking for a mock-up tool...  but an actual tool to create the XML layouts.</p><p><strong>Update:</strong> The new eclipse designer with 2.3 is better, but honestly I thought that it would be further along.  I don't mind dropping down to the XML when necessary, but just seems like it is time to get some good designer tools in the space.</p>","21371","","21371","","2010-12-16 15:25:12","2012-10-25 02:06:48","Is there a good tool for doing Android layout design?","<android><gui><layout>","5","1","1","2014-02-08 00:17:24",""
"2783831","1","2784078","","2010-05-06 19:27:01","0","1147","<p>My wish is to know how I can program a mobile website, that fit to all mobile phones.</p><p>Are there any special approaches to recognize a device and render the code according to it?</p><p>Which tools and coding languages are required?</p><p>My first thought was to hold the website in XML, which would be parsed depending on the device. </p><p>You have to consider old phones, even devices with only wap support.</p><p>For example: The mobile website has to recognize Nokia N75 and render/send the code that looks optimal for this device. Same thing with an iPhone or a Motorola Razr.</p>","149690","","","","","2010-05-10 10:23:07","Looking for an approach to program a mobile website for any device. Are there any?","<iphone><android><windows-mobile><mobile>","5","2","","",""
"2783853","1","","","2010-05-06 19:30:11","4","1415","<p>I'm just starting with Android and everything seems to be working fine, but when I try to look at any XML file in eclipse, I get the following error.  The only way I can see them is by ""Opening With"" -> TextFile.</p><pre><code>org.eclipse.core.runtime.CoreException: Error opening the Android XML editor. Is the document an XML file? at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.createTextEditor(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.createAndroidPages(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.EditorReference.getEditor(EditorReference.java:286) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2857) 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)</code></pre>","334779","","180538","","2012-04-11 09:20:23","2012-11-28 19:23:09","Eclipse wont open Android Xml files","<xml><android><eclipse>","4","1","","",""
"2784003","1","","","2010-05-06 19:53:40","16","31485","<p>I have a complex layout, part of which features a value centered over a label, with + and - buttons on either side of the value.  I want the value to center between the buttons, whether it is ""1"" or ""99"".  It looks fine when it's a 2-digit number like ""99"", but when it's a single digit the number is left-justified.  How do I properly center that value?</p><p>Here's the portion of my layout that does 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:layout_above=""@id/runway_label""            android:layout_centerHorizontal=""true""            android:orientation=""horizontal""&gt;            &lt;ImageView android:id=""@+id/dec_runway_button"" android:src=""@drawable/minus_button""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_gravity=""center_vertical""/&gt;            &lt;TextView android:id=""@+id/runway_value""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:textColor=""#FFFFFF""                android:textStyle=""bold"" android:textSize=""40.0sp""                android:minWidth=""50sp""                android:layout_centerInParent=""true""                android:layout_gravity=""center""                android:shadowColor=""#333333"" android:shadowDx=""2.0""                android:shadowDy=""2.0"" android:shadowRadius=""3.0"" /&gt;            &lt;ImageView android:id=""@+id/inc_runway_button"" android:src=""@drawable/plus_button""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_gravity=""center_vertical""/&gt;        &lt;/LinearLayout&gt;</code></pre>","328364","","","","","2010-09-03 19:38:14","How do You Center a TextView in Layout?","<android><layout><center><textview>","2","0","1","",""
"2784022","1","2784595","","2010-05-06 19:55:14","1","3021","<p>I am writing a simple android application with a class that extends activity, that plays a video from a url on the web. There is a button on top that on click takes the user to a web page. </p><p>What I want to do is when the user is browsing the web page, if he hits the back button, I want him to come back to the main activity and restart the video. Is there a way to do this?</p><p>Also, is there a way the video can be resumed from where it left off?</p><p>Thank you.Chris</p>","334802","","","","","2012-06-01 01:24:44","Android - Video Restart or Resume","<android><video><activity><resume><restart>","2","0","","",""
"2784081","1","2784312","","2010-05-06 20:04:49","46","84369","<p>I'm all new to Android and I'm trying to create a spinner programmatically and feeding it with data from an array, but Eclipse gives me a warning that I can't handle.</p><p>Here's what I got:</p><p>This ArrayList holds the elements that should be in the spinner (gets filled from a file later on):</p><p><code>ArrayList&lt;String&gt; spinnerArray = new ArrayList&lt;String&gt;();</code></p><p>This is code I found on a site which should create the spinner:</p><pre><code>    Spinner spinner = new Spinner(this);    ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(this,        android.R.layout.simple_spinner_dropdown_item,            spinnerArray);    spinner.setAdapter(spinnerArrayAdapter);</code></pre><p>Now the second line (ArrayAdapter...) gives me a warning in Eclipse saying <code>""ArrayAdapter is a raw type... References to generic type ArrayAdapter&lt;T&gt; should be parameterized""</code>, I have no idea how to fix this (or what that means in the first place :) ).</p><p>It's just a warning and the App seems to run alright, but I'd still like to understand what's wrong and fix it. Any hint is appreciated.</p><p>Greetings,Select0r</p>","255905","","","","","2013-07-14 11:38:12","Android: Create spinner programmatically from array","<android><spinner>","4","0","13","",""
"2784184","1","","","2010-05-06 20:20:59","0","2156","<p>I'm developping an application in Android 1.6 (and can't use 2.0 or older). </p><p>I add a new contact on my phone as following : </p><pre><code>ContentValues contentValues = new ContentValues();contentValues.put(Contacts.People.NAME, name);Uri contactUri = this.getContentResolver().insert(Contacts.People.CONTENT_URI, contentValues);</code></pre><p>After that, I add phone numbers in the same way. It works as I am able to view the new added contact with following code : </p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);this.startActivity(intent);</code></pre><p>My problem is that, after adding and viewing the new contact, I can't see it in Contacts application unless I synchronized all my contacts (I also did a search with the contact's name, found it, nevertheless it wasn't added in contacts list). </p><p>How can I programmatically update the contacts in order to immediately have my new contact added in Contacts application ?  </p><p>Thank you !</p>","334818","","760489","","2011-09-14 08:00:54","2011-09-14 08:00:54","New programmatically added contact not visible in Contacts application","<android>","1","0","","",""
"2784387","1","4043078","","2010-05-06 20:48:50","0","1693","<p>I am creating a layout with a <code>ListView</code> and at the very top of the list there is this weird black line that I can't seem to figure out how to get rid of!  It's part of the <code>ListView</code> because it moves up and down as I size the <code>ListView</code>.  Has anyone ran into this before?</p><p><img src=""http://i18.photobucket.com/albums/b141/CasetB/window.png"" alt=""alt text""></p><p>I couldn't get DDMS to take a screen capture for some reason so I took a picture of the screen with my G1, so please forgive the quality!  As you can see the line is there at the top of the fade out in the list.<img src=""http://dl.dropbox.com/u/3618586/2010-05-07%2014.25.50.jpg"" alt=""alt text""></p>","236136","","69742","","2010-05-27 00:19:32","2011-01-11 21:25:53","Weird black line on top of list view","<android><listview>","3","2","0","",""
"2784441","1","","","2010-05-06 20:56:39","145","69069","<p>I've been trying to start a service when a device boots up on android, but I cannot get it to work. I've looked at a number of links online but none of the code works. Am I forgetting something? </p><h3>AndroidManifest.xml</h3><pre><code>&lt;receiver    android:name="".StartServiceAtBootReceiver""    android:enabled=""true""    android:exported=""false""    android:label=""StartServiceAtBootReceiver"" &gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action._BOOT_COMPLETED"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;&lt;service    android:name=""com.test.RunService""    android:enabled=""true"" /&gt;</code></pre><h3>BroadcastReceiver</h3><pre><code>public void onReceive(Context context, Intent intent) {    if (""android.intent.action.BOOT_COMPLETED"".equals(intent.getAction())) {        Intent serviceLauncher = new Intent(context, RunService.class);        context.startService(serviceLauncher);        Log.v(""TEST"", ""Service loaded at start"");    }}</code></pre><p>Thanks </p>","358894","","1130266","","2014-02-24 12:12:28","2014-02-24 12:12:28","Trying to start a service on boot on Android","<android><service><broadcastreceiver>","9","4","103","",""
"2784596","1","","","2010-05-06 21:21:27","4","930","<p>I'm trying to build a third party library which uses auto-generated source code files. In normal case, this kind of files is generated by gnu build tools. My question is How can I tell the Android NDK build tools to generate and build this kind of files. </p><p>Thanks in advance </p>","1832564","","","","","2010-11-02 13:43:44","How to deal with source code file auto-generated in the build process","<android><gnu><android-ndk><automake>","1","0","1","",""
"2784626","1","2784748","","2010-05-06 21:24:54","3","4294","<p>I have a Relative Layout.Which has 2 buttons, side by side and it is right-aligned.  </p><p>So this is my layout xml file.  My question is there are no spacing between the right-most button and the right border of the RelativeLayout and between the 2 buttons. How can I add that? I play with android:paddingRight, but nothing helps.</p><p>Thank you.</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:paddingLeft=""0dp"" android:paddingRight=""10dp""&gt;    &lt;Button android:id=""@+id/1button"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:paddingLeft=""10dp"" android:paddingRight=""10dp""/&gt;    &lt;Button android:id=""@+id/1button"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@id/1button""        android:paddingLeft=""10dp"" android:paddingRight=""10dp""/&gt;</code></pre>","286802","","795446","","2011-07-05 07:34:37","2011-07-05 07:34:37","How can I add spacing in RelativeLayout","<android><android-layout>","3","0","1","",""
"2784847","1","2790374","","2010-05-06 22:04:50","18","9930","<p>I know Android cannot handle PDFs natively. However, the Nexus One (and possibly other phones) come pre-installed with QuickOffice Viewer.  How would I determine whether the user has a PDF viewer installed?</p><p>Currently, the code to start the PDF download looks pretty simple:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setData(Uri.parse(url));startActivity(intent);</code></pre><p>After the download, the user clicks on the downloaded file to invoke the viewer.However, if there is no PDF viewer, Android reports ""Cannot download.  The content is not supported on the phone.""I want to determine if the user will get this message, and if so, direct them to PDF apps in the Android Market.</p>","449670","","114066","","2010-10-11 11:35:45","2010-10-18 23:36:47","How do I determine if Android can handle PDF","<android><pdf>","2","1","12","",""
"2784860","1","","","2010-05-06 22:08:44","2","759","<p>When I call drawCircle (ex. <code>canvas.drawCircle(x, y, r, mPaint);</code>) and I use Paint Style <code>STROKE</code> to initialize the parameter <code>mPaint</code>, the result doesn't quite make a full 360 degrees (2*PI radian) circle in all cases.  Sometimes you get a full circle (as I would expect) and sometimes only an arc. </p><p>Does someone have an idea what would cause this to happen ?</p><p>I don't know what cases work and which don't (yet).  I've noticed the ones that don't work seem to be the larger circles I'm drawing (>100.0 radius).  Could be size related.  I am using floating point for x, y and r.  I could try rounding to the nearest int when in the drawing code.  </p>","329999","","121278","","2011-12-14 09:42:41","2011-12-14 09:42:41","Android drawCircle's are not always 360 degrees","<android><graphics>","1","2","","",""
"2784889","1","3928034","","2010-05-06 22:15:39","31","27297","<p>I'm in the process of developping a Web Application for mobiles. Iwent with web applications because to me it seems a winning situationhaving to develop one application that could run also on iPhone /Windows Mobile / Palm etc.</p><p>I started testing today after a few days of doing concepts, ideas anddesigns and what I wanted to do was have a menu that sticks at thebottom of the page. Exactly like the menu on the bottom in this iPhoneapplication screenshot :</p><p><img src=""http://i.stack.imgur.com/yApHM.jpg"" alt=""enter image description here""></p><p>Using CSS, I though it would be really easy to do this. Only usingposition:fixed; bottom:0; would have done the trick but I have foundit doesn't behave the same on mobile browsers</p><p>I tried to split my page in 2 sections : 1 would be a scrollable div(for the content) and the other one would be the bottom menu.Scrollable divs also do not work on Android. I also tried using frameswith no luck either. Does anyone know of any way to re-create a menuthat would stick to the bottom of a page for mobile phones?</p>","334899","","664177","","2013-04-16 14:52:20","2013-04-16 14:52:20","Android Web App : Position:fixed broken?","<html><css><android><webkit><position>","5","2","14","",""
"2785212","1","2785233","","2010-05-06 23:31:13","1","1717","<p>I wonder if I could save a value (in my program its an index) so I could call it back when the program launches back again (even if the program destroyed) and the user could start from where finish.</p><p>Thanks </p>","302707","","1288","","2010-05-06 23:36:32","2010-05-06 23:38:43","how to save value onDestroy or onStop and get it back with the program launch again?","<java><android>","2","0","","",""
"2785336","1","2790930","","2010-05-07 00:02:09","10","15455","<p>I have a basic question about starting a frame-by-frame animation.</p><p>When I call the <strong>AnimationDrawable.start()</strong> method from my code directly, it doesn't seem to work.</p><pre><code>public void onCreate(Bundle savedInstanceState) {     ...     mAnimation.start();     ...  }</code></pre><p>But if I put this line inside the onClick() callback method of a button, pressing the buton starts the animation.</p><p>Why doesn't this line work in the code? </p><p>Thanks!</p><h2>Code:</h2><pre><code>public class MyAnimation extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    AnimationDrawable mframeAnimation = null;    super.onCreate(savedInstanceState);    setContentView(R.layout.my_animation);    ImageView img = (ImageView) findViewById(R.id.imgMain);    BitmapDrawable frame1 = (BitmapDrawable) getResources().getDrawable(            R.drawable.splash1);    BitmapDrawable frame2 = (BitmapDrawable) getResources().getDrawable(            R.drawable.splash2);    int reasonableDuration = 250;    mframeAnimation = new AnimationDrawable();    mframeAnimation.setOneShot(false);    mframeAnimation.addFrame(frame1, reasonableDuration);    mframeAnimation.addFrame(frame2, reasonableDuration);    img.setBackgroundDrawable(mframeAnimation);    mframeAnimation.setVisible(true, true);    //If this line is inside onClick(...) method of a button, animation works!!    mframeAnimation.start(); }</code></pre><p>}</p>","289918","","289918","","2010-05-07 18:42:45","2012-12-07 18:15:20","Starting Frame-By-Frame Animation","<android><animation>","3","4","4","",""
"2785485","1","2785493","","2010-05-07 00:47:28","656","297326","<p>Do Android devices have a unique id, and if so, what is a simple way to access it via Java?</p>","314994","","63550","","2014-02-09 12:04:24","2014-03-24 21:27:51","Is there a unique Android device ID?","<android><uniqueidentifier>","26","4","381","",""
"2785558","1","2816319","","2010-05-07 01:10:53","15","11136","<p>I can't find a way to obtain a reference the <code>Window</code> containing an arbitrary <code>View</code> v. I found <a href=""http://developer.android.com/reference/android/view/View.html#getWindowToken%28%29"">getWindowToken</a>, but I can't figure out how to use it? Does anyone know how?</p><p>Also, does anyone know why it returns an <code>IBinder</code> rather than a <code>Window</code>?</p>","165495","","165495","","2010-05-12 06:41:44","2011-05-26 17:02:21","Find the Window containing a View in Android","<android><user-interface>","1","0","4","",""
"2785614","1","2788282","","2010-05-07 01:28:15","3","2346","<p>I'm writing an application in Android that consumes some REST services I've created. These web services aren't issuing a standard Apache Basic challenge / response. Instead in the server-side code I'm wanting to interrogate the username and password from the HTTP(S) request and compare it against a database user to make sure they can run that service. </p><p>I'm using HttpClient to do this and I have the credentials stored on the client after the initial login (at least that's how I see this working). So here is where  I'm stuck. Preemptive authenticate under HttpClient requires you to setup an interceptor as a static member. This is the example Apache Components uses.</p><pre><code>    HttpRequestInterceptor preemptiveAuth = new HttpRequestInterceptor() {        @Override        public void process( final HttpRequest request, final HttpContext context) throws HttpException, IOException {            AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);            CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(                    ClientContext.CREDS_PROVIDER);            HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);            if (authState.getAuthScheme() == null) {                AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort());                Credentials creds = credsProvider.getCredentials(authScope);                if (creds != null) {                    authState.setAuthScheme(new BasicScheme());                    authState.setCredentials(creds);                }            }        }    };</code></pre><p>So the question would be this. What would the proper use of this be? Would I spin this up as part of the application when the application starts? Pulling the username and password out of memory and then using them to create this CredentialsProvider which is then utilized by the HttpRequestInterceptor? Or is there a way to do this more dynamically?</p>","334993","","","","","2011-08-29 13:47:56","Proper use of HttpRequestInterceptor and CredentialsProvider in doing preemptive authentication with HttpClient","<java><android><rest><restful-authentication>","2","0","","",""
"2785670","1","2786189","","2010-05-07 01:43:12","8","12513","<p>I'm working on an Android application that has several Activities. In it I have a class with several static methods. I would like to be able to call these methods from the different Activities. I'm using the static methods to load data from an xml file via a XmlResourceParser. To create a XmlResourceParser requires a call on the Application Context. So my question is, what is the best way to get a reference to the Application Context into the static methods? Have each Activity get it and pass it in? Store it somehow in a global variable? </p>","19072","","","","","2013-04-13 16:49:57","Best way to get an Application Context into a static method in Android","<android><android-context>","3","0","2","",""
"2785726","1","","","2010-05-07 02:00:54","0","533","<p>I am working on an app that uses the GPS on my g1.  I'm wondering if it is possible that when I am using the app I can have it update my Google Latitude location every x number of minutes.  Any thoughts on how this may be accomplished?</p>","335012","","881229","","2013-12-28 06:20:36","2013-12-28 06:20:36","Update Google Latitude location from 3rd party android app","<android><google-latitude>","1","1","","",""
"2785843","1","","","2010-05-07 02:39:24","8","8474","<p>It is very important that my service stay running until someone with a password stops the service from my UI screen. My app runs great but it is designed to be turned on/off by parents (with a password) on their kids phones. I have managed to make everything work but the problem I'm having is that if the kid uses a task manager to kill my service then my app is useless. I would be grateful to anyone who knows a way to either</p><p>1) monitor the service and start it back up automatically if its ""killed""or 2) prevent someone from being able to kill it except from the activity (administration screen) that launched the service. Or both?</p><p>I'm sorry if I'm not very clear in describing the problem, I'm a beginner. I've made great progress so far but I am stuck at this last hurdle.</p>","335031","","50776","","2012-07-27 15:09:48","2014-02-21 10:09:09","How can I prevent my Android app/service from being ""killed"" from a task manager?","<android><service><kill><taskmanager>","5","0","6","",""
"2785907","1","2786487","","2010-05-07 02:56:43","7","13312","<p>I've tried null and empty string, any other ideas?</p>","180825","","","","","2010-05-07 05:56:04","What does an EditText.getText() in android return if it is empty?","<android>","3","2","3","",""
"2786086","1","2786137","","2010-05-07 03:51:42","0","3462","<p>I'm trying to create a dynamic <code>ItemizedOverylay</code> (please see the code below) on Google Maps (Android 2.1) on a Nexus One. </p><p>In my <code>Activity</code> (that extends MapActivity) I'm creating a data thread that is receiving data from the network. A  'handler' is used to communicate the data from the receiving thread to map activity. This data contains the locations (lat, lon) of the markers that I want to overlay on my map. The location of each marker is dynamic (i.e., it changes every time I receive new data from the network.)  <code>refreshItems(ArrayList&lt;OverlayItem&gt; newItems)</code> method in invoked inside the <code>handleMessage()</code> of the handler. There are around 11 markers in the ArrayList that is passed to <code>refreshItems</code></p><p>I can see the markers overlayed on the map. However, I've two issues:</p><ol><li><p>The old markers are not removed from the map. After a while I see a trail of markers. </p></li><li><p>The map doesn't respond to any touch commands. I cannot move the map or zoom in or zoom out. After a while I see a system warning that my app is not responding (wait/close?) message. </p></li></ol><p>Any idea what's wrong here ?   </p><p>Thanks. </p><pre><code>    public class MyItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {private ArrayList&lt;OverlayItem&gt; overlayItems;public CoTItemizedOverlay(Drawable defaultMarker) {    super(boundCenter(defaultMarker));    overlayItems = new ArrayList&lt;OverlayItem&gt;();    populate();}public void addNewItem(GeoPoint location, String markerText, String snippet) {    overlayItems.add(new OverlayItem(location, markerText, snippet));    populate();}public void removeItem(int index) {    overlayItems.remove(index);    populate();}public void refreshItems(ArrayList&lt;OverlayItem&gt; newItems) {    // remove all existing items    for (int i = 0; i &lt; cotoverlayItems.size(); i++) {        overlayItems.remove(i);    }    // copy all the items    if (newItems != null &amp;&amp; cotoverlayItems.size() == 0) {        overlayItems.addAll(newItems);    }    populate();}@Overrideprotected OverlayItem createItem(int index) {    return overlayItems.get(index);}@Overridepublic int size() {    return overlayItems.size();}</code></pre><p>}</p>","306346","","306346","","2010-05-07 04:02:13","2012-10-26 04:54:45","Dynamic Overlays slowing down Google Maps (Android 2.1) on Nexus One","<android><google-maps-markers><google-maps><itemizedoverlay>","2","1","2","",""
"2786160","1","4622937","","2010-05-07 04:14:53","0","962","<p>Is there any way in android to determine when the user clicked the app icon to launch the app ? I mean say a user was using my app. Then he presses the home key as a result of which the app goes to the background. After sometime he clicks the app icon again. My question is do I get a call-back for this ?</p>","266272","","","","","2011-01-07 06:09:05","Determine when application icon is clicked to launch the app in android","<android><launch>","3","0","1","",""
"2786399","1","2880030","","2010-05-07 05:29:53","3","1168","<p>I am trying to implement text to speech by following <a href=""http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html"" rel=""nofollow"">this article</a> on the Android Developers Blog. It suggests the following code for installing text to speech data if it is not supported.</p><pre><code>Intent installIntent = new Intent();installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);startActivity(installIntent);</code></pre><p>This throws an <code>Exception</code>:</p><blockquote>  <p><code>ActivityNotFoundException</code>: No activity  found to handle Intent</p></blockquote><p>However, I am using the code <a href=""http://android-developers.blogspot.com/2009/01/can-i-use-this-intent.html"" rel=""nofollow"">here</a> to determine the the intent is actually supported. Here is the list representation:</p><pre><code>[ResolveInfo{43cc5280 com.svox.pico.DownloadVoiceData p=0 o=0 m=0x108000}]</code></pre><p>Why doesn't this work?</p><p><strong>Update</strong></p><p>I don't know why, but it seems to work now.</p>","165495","","165495","","2010-05-24 06:42:51","2010-05-24 06:42:51","IntentNotFoundException for TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA","<android><android-intent>","2","0","2","",""
"2786411","1","","","2010-05-07 05:33:32","0","262","<p>Team,</p><p>Can you please help me to understand why I m getting the following exception.</p><p>05-07 10:57:20.652: ERROR/AndroidRuntime(470): android.database.sqlite.SQLiteException: near ""1"": syntax error: , while compiling: SELECT Id,Name FROM act WHERE Id 1-IJUS-1</p><p>Thanks in advance,</p>","330266","","","","","2010-05-07 11:44:23","android : SQL Exception while querying","<android>","1","2","","",""
"2786647","1","","","2010-05-07 06:32:09","3","980","<p>We have a java server that keeps a socket channel open with an Android client in order to provide push capabilities to our client application.</p><p>However, after putting the Android in airplane mode, which I expected would sever the connection, the server can still write to the SocketChannel object associated with that Android client and no error is thrown. Calling SocketChannel.isConnected() before writing to it returns true.</p><p>What are we missing? Is the handling of sockets different with mobile devices?</p><p>Thanks in advance for your help.</p>","218100","","","","","2010-12-18 23:06:04","Writing to a java socket channel which should be closed does not generate an exception","<java><android><exception><sockets>","1","0","","",""
"2786655","1","","","2010-05-07 06:33:10","34","67445","<p>I'm trying to open a file in android like this :</p><pre><code>  try   {      FileInputStream fIn = context.openFileInput(FILE);      DataInputStream in = new DataInputStream(fIn);      BufferedReader br = new BufferedReader(new InputStreamReader(in));      if(in!=null)          in.close();   }   catch(Exception e)   {  }</code></pre><p>, but in case the file does not exists a file not found exception is thrown . I'd like to know how could I test if the file exists before attempting to open it. </p>","304866","","1440565","","2012-09-26 23:02:09","2012-09-26 23:02:09","Test if file exists","<java><android><file>","6","2","8","",""
"2786720","1","2787214","","2010-05-07 06:47:31","5","12660","<p>How can I use Android Service to do a ping callback? I need to open a webpage on a button click, but in the background, go ping another url for stats collection.  </p><p>Code snippets will be greatly helpful</p><p>ThanksChris</p>","321927","","","","","2014-01-28 15:57:29","Android Service - Ping URL","<android><url><service><ping>","1","0","5","",""
"2786742","1","","","2010-05-07 06:52:19","1","1221","<p>How could I detect that the phone is data roaming ?  </p>","304866","","","","","2010-05-07 08:12:52","detect roaming events?","<android>","1","0","","",""
"2786787","1","2787173","","2010-05-07 07:00:24","1","7330","<p>You know in iPhone, The four components of a typical iPhone application are a title bar, a navigation list, a destination page,and a button bar.</p><p><strong>for The Title Bar</strong>The title bar includes the following elements: Back button:  Screen title:  Command button: </p><p>My question comes, although i can use UI framework tool, such as:Phonegap, iui, jtquery to develop web app, but i can't display the TitleBar effect in Android, </p><p>i can't use below code in Android:  meta content=""yes"" name=""apple-mobile-web-app-capable""</p><p>Actually, the above can work in Apple Safari Browser, but I can't use Safari to display our Android Project, which is i don't want to see.</p><p>Does anyone know how to fulfill this effect in Android, please help me, your help will be great appreciated.</p><hr><p>to </p><p>""It's unclear if you developing a native android application or a webapp. </p><pre><code>                                 – alexanderblom yesterday""</code></pre><p>sorry that i forget to mention, i want to develop a iphone-webapp-style application in Android. Since it's too difficult, i want to use iWebkit, but it seems only work in apple iPhone OS or Safari which contain the specific engine to display the beautiful layout, like below:( -_-! i am new so i can't post images here)</p><p><img src=""http://images.appshopper.com/screenshots/305/690205_2.jpg"" alt=""alt text""></p>","335170","","114066","","2010-07-08 09:38:14","2010-07-08 09:38:14","How to implement iPhone TitleBar in Android","<iphone><android><titlebar>","1","3","2","",""
"2787015","1","2796537","","2010-05-07 07:51:05","7","5204","<p>I am trying to open a remote Stream of a JPEG image and convert it into a Bitmap object:  </p><pre><code>    BitmapFactory.decodeStream(new URL(""http://some.url.to/source/image.jpg"").openStream());</code></pre><p>The decoder returns null and in the logs I get the following message:  </p><pre><code>DEBUG/skia(xxxx): --- decoder-&gt;decode returned false</code></pre><p>Note:<br>1. the content length is non-zero and content type is <code>image/jpeg</code><br>2. When I open the URL in browser I can see the image.</p><p>What is that I am missing here?</p><p>Please help. Thanks.</p>","236128","","","","","2013-12-10 13:11:09","Skia Decoder fails to decode remote Stream","<android><imageview><skia>","3","2","2","",""
"2787055","1","2787070","","2010-05-07 07:57:41","40","12942","<p>I'm using Eclipse + the Android SDK on a Mac running Snow Leopard to develop Android apps.</p><p>Thing is, Eclipse is really slow - like, it ""beach balls"" for a few seconds when changing tabs.</p><p>Is there anything I can do to improve it's performance?</p>","2846","","","","","2013-03-26 08:21:49","Using the Android SDK on a Mac, Eclipse is really slow. How can I speed it up?","<android><eclipse><osx><performance>","4","2","26","",""
"2787092","1","","","2010-05-07 08:06:42","3","1267","<p>Is it possible to create multiple widgets in runtime?Application (Activity) should generate in some cases new widget(or edit exist) with new name and label and do some primitive action on click, which should be available in desktop widgets menu.</p>","311076","","6583","","2010-05-07 08:11:51","2010-05-07 22:08:04","Dynamically creating Widgets on Android","<android><android-widget>","2","0","0","",""
"2787161","1","2789656","","2010-05-07 08:22:21","8","11341","<p>I am developing in Android and I would like an input field for numbers, where the user can select the correct number using the plus sign at the top and the minus sign at the bottom of the input field. I know this works for <code>DatePicker</code>. Is there some property or something similar to make this available for any integer number input field?</p><p>Thanks</p>","335222","","2390083","","2013-11-18 08:25:07","2013-11-18 08:25:07","Android number input with plus and minus sign","<android><android-widget>","5","1","1","",""
"2787204","1","2787432","","2010-05-07 08:30:21","2","4867","<p>I just cant get this working. I tried using the code below with onTouchEventand and  it doesn't work. If i return true at the end of the method, i get the toast with the coordinates but can't move a map, and if i return false, i can move a map but cant display a toast after the user clicks on a map. If i get it right, the other onTap method is used only for clicking on a overlays. Has anybody figured this thiing out? </p><pre><code>        public boolean onTouchEvent(MotionEvent arg0, MapView arg1) {       //super.onTouchEvent(arg0);       int akcija = arg0.getAction();         if(akcija == MotionEvent.ACTION_UP){            if(!premik) {                Projection proj = mapView.getProjection();                GeoPoint loc = proj.fromPixels((int)arg0.getX(), (int)arg0.getY());                 String sirina=Double.toString(loc.getLongitudeE6()/1000000);                String dolzina=Double.toString(loc.getLatitudeE6()/1000000);                 Toast toast = Toast.makeText(getApplicationContext(), ""Širina: ""+sirina+"" Dolzina: ""+dolzina, Toast.LENGTH_LONG);                toast.show();            }        }             else if (akcija == MotionEvent.ACTION_DOWN){            premik= false;        }        else if (akcija== MotionEvent.ACTION_MOVE){                         premik = true;        }        return false;        //return super.onTouchEvent(arg0);      }</code></pre>","324417","","","","","2012-06-22 00:53:38","Getting coordinates when clicking anywhere on a MapView","<android><android-mapview>","1","0","","",""
"2787437","1","2787482","","2010-05-07 09:13:50","4","6488","<p>for example:</p><pre><code>public final class R {    public static final class raw {        public static final int yuri=0x7f040000;    }}</code></pre><p>How can I get the resource by its name?Without using R.raw.yuri = (int)</p>","309166","","114066","","2010-06-30 08:16:49","2012-01-16 04:52:16","How can I get Resources by name (string) and not by integer","<android><resources>","1","0","1","",""
"2787496","1","","","2010-05-07 09:26:26","1","1484","<p>Here is I would like to set up in my application, the function of sharing (facebook, twitter, e-mail) as that of YouTube for example but I get lost little.By looking I saw that apparently it would be necessary to use Intent.action_pick_activity but I do not manage to see how using it on my case.</p><p>What is that somebody has already implemented this kind of thing? Either what is what somebody knows where I can find examples??Thanks to all!</p>","335283","","","","","2013-05-08 11:52:13","Functioning of Intent.action_pick_activity?","<android><activity><android-intent>","2","0","","",""
"2787548","1","3196484","","2010-05-07 09:37:43","9","17385","<p>I'm writing an RSS reader for Android. I've faced a certain difficulty which the problem I can't resolve since databases aren't my expertise.. So i figured out maybe one of you could help me out! I currently have 3 tables (Categories, links and feeds). My goal is too link a feed to multiple categories. Therefor I'm using a Link table. My databases is an Android ContentProvider (sqlite) and looks like the following:</p><pre><code>| Categories |          |  Links  |          | Feeds ||------------|          |---------|          |-------||  _ID       |          | Category|          | _ID   | |  Title     |          | Feed    |          | Title |                                             | URL   |</code></pre><p>I currently wrote the following code in my FeedListActivity to retrieve a list of links and their feeds.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //gets the intent URI to retrieve the Feeds.    Intent intent = getIntent();    if (intent.getData() == null) {        intent.setData(Feeds.CONTENT_URI);    }    // stores the Category id so it knows from what category it came from    mCatId = intent.getIntExtra(""catId"", -1);       getListView().setOnCreateContextMenuListener(this);    // gets all Links that have the category placed    Cursor links = managedQuery(            Links.CONTENT_URI,             NewsReadUtils.LINK_PROJECTION_STRING,             Links.CATEGORY+ "" = ""+ mCatId, null, null);    String query = """";    Cursor cursor = null;    if(links.getCount()&gt;0){            // if there are links available try to get them and build a query.        links.moveToFirst();        do{            if (links.isFirst()) {                query = Feeds._ID+ "" = ""+links.getString(links.getColumnIndex(Links.FEED));                             }else{                query += "" OR "" +Feeds._ID+ "" = ""+links.getString(links.getColumnIndex(Links.FEED));            }                       }while(links.moveToNext());         cursor = managedQuery(getIntent().getData(), PROJECTION ,query, null,                Feeds.DEFAULT_SORT_ORDER);    }    Cursor cursor = managedQuery(getIntent().getData(), PROJECTION ,Feeds._ID+ "" = ""+ mCatId, null,            Feeds.DEFAULT_SORT_ORDER);    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, cursor,            new String[] { Feeds.TITLE }, new int[] { android.R.id.text1 });    setListAdapter(adapter);       }</code></pre><p>Now my question:</p><p>I was wondering how I could optimize this database layout, code or query so I would get my entries in a more efficient way. Because i believe this link table or the query to retrieve links isn't needed! Or am i doing this the correct way?</p><p>Thanks,</p><p>Antek</p>","218610","","","","","2012-03-01 12:18:10","Android ContentProvider database query multiple tables","<android><sqlite><android-contentprovider>","1","0","12","",""
"2787559","1","2849003","","2010-05-07 09:39:37","3","4056","<p>I just don't get it: when I use the camera with an intent and also specify an output file, the returned image is always very small on many devices (e.g. Motorola Milestone 2.1, HTC Desire 2.1, Emulator 2.1, Emulator 2.0.1) but not on all (e.g. Nexus One). Here's what I do to bring up the camera app:</p><pre><code>private final static String TEMP_PHOTO_FILE = Environment.getExternalStorageDirectory() + ""/TEMP_PHOTO.JPG"";  private final static int REQUEST_CAMERA = 0;  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(TEMP_PHOTO_FILE)));  startActivityForResult(intent, REQUEST_CAMERA);</code></pre><p>After the image has been taken I grab its outcome in <code>onActivityResult(int requestCode, int resultCode, Intent data)</code>:</p><pre><code>if (requestCode == REQUEST_CAMERA &amp;&amp; resultCode == RESULT_OK) {      String photo = MediaHandler.moveFile(TEMP_PHOTO_FILE, MediaHandler.SDCARD_IMAGE_PATH, System.currentTimeMillis());      BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();      // bitmapOptions.inSampleSize = 6;      imgBitmap = BitmapFactory.decodeFile(photo, bitmapOptions);  </code></pre><p>The bitmap is pretty small and I am wondering why this happens. I know that it <em>used to work</em> properly.<br>Does anyone have the same issue or even a hint on how to fix this?</p><p>Thanks,<br>Steff</p>","289849","","","","","2010-05-17 12:32:07","Small picture retrieved from Camera although specified MediaStore.EXTRA_OUTPUT in 2.X","<android><camera><mediastore>","1","0","1","",""
"2787860","1","","","2010-05-07 10:33:06","0","305","<p>Could someone with Htc hero (android 1.5) please try if boolean dispatchTouchEvent() method works on htc hero. I tried something on emulator and it works, but when i try it on my phone it doesn't get called.</p>","324417","","1145285","","2012-12-11 17:37:58","2012-12-11 17:37:58","Do dispatchTouchEvent() gets called on HTC Hero?","<java><android><htc-hero>","0","2","","",""
"2788206","1","2789382","","2010-05-07 11:35:47","0","468","<p>I am working in android application retrieve image in sdcard in image read in byte convertion  how can solve this type of problem  i am getting in image uri in sdcard </p>","254790","","","","","2010-05-07 14:41:02","how can retrieve image in sdcard in byte convertion in android application","<android>","1","0","1","",""
"2788285","1","","","2010-05-07 11:51:27","0","539","<p>I am working on android, and I am parsing a huge XML file.so all the time I need to get some data from that XML file, which is making the application very slow.</p><p>Is there any way that I can create a data set/record set/result set of the XML file</p><p>so that later I can get the data from the newly created set.</p><p>and also how to read that set :)</p><p>thanks alot!!</p><p>regards..</p><p>kai!!</p>","328518","","130033","","2010-05-07 12:01:10","2010-08-16 03:27:12","Save XML to Recordset","<java><xml><android><parsing><resultset>","1","0","","",""
"2788327","1","2788759","","2010-05-07 11:59:49","2","1279","<p>how to rectify this Window Leaked Exception. i cant find why its occured. My LogCat Info:</p><pre><code>05-07 17:25:05.402: ERROR/WindowManager(13595): Activity com.codecarpet.fbconnect.FBLoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b9ae0 that was originally added here05-07 17:25:05.402: ERROR/WindowManager(13595): android.view.WindowLeaked: Activity com.codecarpet.fbconnect.FBLoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b9ae0 that was originally added here05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:214)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.view.Window$LocalWindowManager.addView(Window.java:409)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.app.Dialog.show(Dialog.java:238)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.app.ProgressDialog.show(ProgressDialog.java:107)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.app.ProgressDialog.show(ProgressDialog.java:95)05-07 17:25:05.402: ERROR/WindowManager(13595):     at com.codecarpet.fbconnect.FBProgressDialog.show(FBProgressDialog.java:106)05-07 17:25:05.402: ERROR/WindowManager(13595):     at com.codecarpet.fbconnect.FBDialog$WebViewClientImpl.onPageStarted(FBDialog.java:508)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:214)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.os.Handler.dispatchMessage(Handler.java:99)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.os.Looper.loop(Looper.java:123)05-07 17:25:05.402: ERROR/WindowManager(13595):     at android.app.ActivityThread.main(ActivityThread.java:4203)05-07 17:25:05.402: ERROR/WindowManager(13595):     at java.lang.reflect.Method.invokeNative(Native Method)05-07 17:25:05.402: ERROR/WindowManager(13595):     at java.lang.reflect.Method.invoke(Method.java:521)05-07 17:25:05.402: ERROR/WindowManager(13595):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)05-07 17:25:05.402: ERROR/WindowManager(13595):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)05-07 17:25:05.402: ERROR/WindowManager(13595):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","267269","","1765573","","2013-07-26 13:47:34","2013-07-26 13:47:34","Window Leaked on FBConnect in Android?","<android><fbconnect><android-logcat>","2","0","","",""
"2788451","1","","","2010-05-07 12:18:43","4","12666","<p>I want to install SD card on android emulator(1.6). I am using Eclipse 3.4.0 </p><p>I found one command to install SD card:</p><p>mksdcard  </p><p>But where to execute it I am not getting??</p><p>I tried in Dev tools-> Terminal Emulator</p><p>But it is giving error : permission denied </p><p>Thank you..</p>","323062","","-1","","2013-04-02 20:01:38","2013-07-10 01:33:18","How to install SD card on Android emulator (1.6)","<android>","4","0","2","",""
"2788551","1","","","2010-05-07 12:36:11","0","2300","<p>I'm connecting to a REST service using HttpClient under Android. I'd like to be able to write code where I could pull the host, port, etc. out of a properties file and not have to write fake Schemes and other things like that in order to do the development work. In other words, the live site will have a cert. The dev site will have a self-signed cert or a CA cert. Either way, I need the code to seamlessly work with both kinds of certs if possible. Can someone point me in the right direction?</p>","334993","","68612","","2010-05-07 15:17:00","2010-05-28 20:23:51","How do you set up an SSL cert that HttpClient under Android will accept?","<android><ssl><ssl-certificate><httpclient>","1","0","","",""
"2789146","1","","","2010-05-07 14:05:31","2","446","<p>Anyone know how could I put Button inside my multiAutoCompleteTextView instead of a spannableString ?</p>","335500","","","","","2010-07-13 05:19:59","Button inside MultiAutoCompleteTextView Android Development","<android><button>","1","3","","",""
"2789232","1","2791863","","2010-05-07 14:20:12","1","628","<p>The default color of the text is white. Let's say if i want to change the color, then how can i do it? Any clue?</p>","2355649","","21234","","2010-05-07 14:23:01","2010-05-07 21:48:58","Android:How can i change the color of the text of the ListAdapter?","<android>","4","0","","",""
"2789276","1","2790688","","2010-05-07 14:27:14","10","22251","<p>I'm trying to get image from gallery. </p><pre><code>Intent intent = new Intent();intent.setType(""image/*"");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent, ""Select picture""), resultCode );</code></pre><p>After I returned from this activity I have a data, which contains Uri. It looks like:</p><pre><code>content://media/external/images/1</code></pre><p>How can I convert this path to real one  (just like '<code>/sdcard/image.png</code>') ?</p><p>Thanks</p>","332311","","","","","2014-02-18 12:56:18","android get real path by Uri.getPath()","<android><image-gallery>","2","0","9","",""
"2789462","1","2903954","","2010-05-07 14:52:56","23","40383","<p>I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found <a href=""http://developer.android.com/distribute/googleplay/promote/linking.html"">instructions</a> for creating the links to launch the Market but this assumes that you are the developer of the app in question and know the exact package name. </p><p>Is there any way to get the package name, other than just contacting the developers and asking?</p><p>Also, it turns out that those instructions don't really work for creating web hyperlinks. They only give you a URI to reference in a string of Java code in another Android app. Our site is in Drupal, so Java is not going to work.</p><p>For the iPhone, I found <a href=""http://developer.apple.com/iphone/library/qa/qa2008/qa1629.html"">easy instructions</a> for getting the URL/link style I need from the iTunes store, so I'm looking for info like that.</p>","104526","","1726308","","2012-10-23 09:21:50","2013-07-05 21:57:14","Find package name for Android apps to use Intent to launch Market app from web","<android><links><google-play><android-intent>","6","0","19","",""
"2789612","1","2789821","","2010-05-07 15:14:53","15","10797","<p>How would i know whether my device is connected the web or not? How can i detect connectivity? Any sample code? </p>","2355649","","","","","2013-08-12 12:35:47","How can i check whether an android device is connected to the web?","<android>","3","0","3","",""
"2789645","1","2790734","","2010-05-07 15:19:35","0","2002","<p>My application show a ListView with a button which allow user to add an element. When the user clicks on this button, another Activity is started to allow user to populate the new element. When the add is finished, we return to the previous Activity with the ListView and I would like to scroll to the new element. Note that this element is not necessarily at the end of the ListView because there is an ""order by"" when I retrieve the datas from the database.</p><p>I know I need the cursor position of the new element to make the ListView scrool to it, but the only info I have about this element is its id, so how to convert this id to cursor position ? Do I have to loop on the cursor to find the position ?</p><p>Thanks in advance</p>","231417","","231417","","2010-05-07 15:56:14","2010-05-07 18:18:48","How to scroll to the new added item in a ListView","<android><listview><cursor><cursor-position>","1","2","","",""
"2790036","1","7332352","","2010-05-07 16:20:03","2","1049","<p>Having got fed up with Eclipse I switched my IDE over to IntelliJ and so far have not looked back (Granted only been using it for a day or so). I never used ADT drag and drop layout editing either preferring to code my XML layouts by hand or in DroidDraw, so this was never a problem.</p><p>However, one thing I do miss is the ability to filter out the LogCat display depending on the Tag I am using. I've found that you can put a Search Query into the box and that acts like a filter, but there's no way to get it into it's own tab and it's also a pain flicking back and forth between that and the full LogCat view.</p><p>The search also includes some type of drop down and I was hoping this would be filled in by what ever I searched for, but I can not get it to function at all, it's always blank. I've searched through the documentation and can not find anything.</p><p>Does anyone know how I can use this search box to act like a multiple filter choice, or if I am missing something and IntelliJ already includes this ?</p>","298882","","1069068","","2013-03-19 14:45:34","2013-03-19 14:45:34","IntelliJ 9 and Android - Filtering LogCat","<android><intellij-idea><logcat>","2","0","1","",""
"2790377","1","2884851","","2010-05-07 17:22:03","0","626","<p>Just want to start out by saying this seems like a great site, hope you guys can help!</p><p>I'm trying to use the structure laid out in LunarLander to create a simple game in which the user can drag some bitmaps around on the screen (the actual game is more complex, but that's not important).  I ripped out the irrelevant parts of LanderLander, and set up my own bitmap drawing, something like</p><pre><code>BoardThread (an inner class of BoardView):run(){  while(mRun)  {    canvas = lockSurfaceHolder...    syncronized(mSurfaceHolder)    {      /* drawStuff using member position fields         in BoardView */    }    unlockSurfaceHolder  }}</code></pre><p>My drawStuff simply walks through some arrays and throws bitmaps onto the canvas.  All that works fine.  Then I wanted to start handling touch events so that when the user presses a bitmap, it is selected, when the user unpresses a bitmap, it is deselected, and if a bitmap is selected during a touch move event, the bitmap is dragged.  I did this stuff by listening for touch events in the BoardView's parent, BoardActivity, and passing them down into the BoardView.  Something like</p><pre><code>In BoardViewhandleTouchEvent(MotionEvent e){  synchronized(mSurfaceHolder)  {    /* Modify shared member fields in BoardView       so BoardThread can render the bitmaps */  }}</code></pre><p>This ALSO works fine.  I can drag my tiles around the screen no problem.</p><p>However, every once in a while, when the app first starts up and I trigger my first touch event, the handleTouchEvent stops executing at the synchronized line (as viewed in DDMS).  The drawing loop is active during this time (I can tell because a timer changes onscreen), and it usually takes several seconds or more before a bunch of touch events come through the pipeline and everything is fine again.</p><p>This doesn't seem like deadlock to me, since the draw loop is constantly going in and out of its syncronized block.  Shouldn't this allow the event handling thread to grab a lock on mSurfaceHolder?  What's going on here?  Anyone have suggestions for improving how I've structured this?</p><p>Some other info.  This ""hang"" only ever occurs on first touch event after activity start.  This includes on orientation change after restoreState has been called.  Also, I can remove EVERYTHING within the syncronized block in the event handler, and it will still get hung up at the syncronized call.</p><p>Thanks!</p>","335650","","","","","2010-05-21 19:10:19","How can I fix this touch event / draw loop ""deadlock""?","<android><synchronization>","1","0","","",""
"2790503","1","2790587","","2010-05-07 17:42:38","0","1611","<p>This question is related to my previous question:<a href=""http://stackoverflow.com/questions/2786720/android-service-ping-url"">http://stackoverflow.com/questions/2786720/android-service-ping-url</a></p><p>So I have an Android app that on the click of a button, opens up a web page. Now, in the background I want to call another http url for gathering stats. </p><p>My question is does this have to be a service? I know a service is for background tasks that run for an indefinite period of time, while the user is busy doing something else. In my case, all I really need is to get the URL in the background, not show it to the user, instead show the web page to the user. </p><p>Can I just not write code to get contents of the http url and fire up the activity that displays the web page? Coz all I want is to get the url in the background and be done with it. Or does this have to be done using the Service class?</p><p>I am confused.</p><p>ThanksChris</p>","334802","","","","","2010-05-07 17:54:47","Android - When to use Service","<android><url><service><activity>","1","0","","",""
"2790704","1","2790726","","2010-05-07 18:13:38","0","136","<pre><code>this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);</code></pre><p>Same problem that I've read on other posts. I don't want the soft keyboard to pop up when the Activity loads. The above code snippet works, however my View no longer scrolls up so that the User can still see the EditText.</p><p>It scrolls without this line of code. Any ideas?</p>","312176","","","","","2010-05-07 18:17:28","Supress the Soft Keboard when an activity loads... yet again","<android><keyboard><edittext>","1","0","","",""
"2790706","1","","","2010-05-07 18:14:20","2","1326","<p>I need to get the last modification time of a Contact: I try to use ContactsContract.Contacts.CONTACT_STATUS_TIMESTAMP, but in my emulatorit always returns 0. Any hint?</p>","335706","","489852","","2012-02-09 06:39:18","2012-02-09 06:39:18","Last modification time of a Contact on Android","<android><contacts>","1","2","1","",""
"2790742","1","","","2010-05-07 18:19:40","1","1404","<p>In My FBLoginActivity there is a error message ""cookies required"" with yellow background has shown. how to remove it or how can i rectify it?</p>","267269","","","","","2010-06-21 08:54:38","cookies required in FBConnect in android?","<android><facebook><fbconnect>","1","0","","",""
"2790754","1","2791289","","2010-05-07 18:20:51","0","1241","<p>I've built my own content provider and I've run into an instance where I need to execute a query and include a limit param.</p><p>The method call to managedQuery doesn't include this param and there fore I see no way to implement this w/o somehow overriding the managedQuery method?</p><p>I've created a second query method in my content provider which accepts an additional param, the limit param but I don't think I can make the managedQuery method call this custom query method of my content provider.</p><p>What's the best way to do this?</p><p>For reference, here is my content provider class...    package com.isi.sa;</p><pre><code>import java.text.DateFormat;import java.util.Date;import java.util.HashMap;import android.content.ContentProvider;import android.content.ContentUris;import android.content.ContentValues;import android.content.Context;import android.content.UriMatcher;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteQueryBuilder;import android.net.Uri;import android.text.TextUtils;import android.util.Log;import com.isi.sa.SATest.Questions;import com.isi.sa.SATest.Scores;public class SAContentProvider extends ContentProvider {  private static final String TAG            = ""SAProvider"";    private static final String DATABASE_NAME      = ""sa.db"";    private static final int DATABASE_VERSION      = 1;    private static final String QUESTIONS_TABLE_NAME  = ""questions"";    private static final String SCORES_TABLE_NAME    = ""scores"";    private static HashMap&lt;String, String&gt; sQuestionsProjectionMap;    private static HashMap&lt;String, String&gt; sScoresProjectionMap;    private static final int QUESTIONS = 1;    private static final int QUESTION_ID = 2;    private static final int SCORES = 3;    private static final int SCORE_ID = 4;    private DatabaseHelper mOpenHelper;    private static final UriMatcher sUriMatcher;  @Override  public boolean onCreate() {        mOpenHelper = new DatabaseHelper(getContext());    return true;  }  @Override  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();    switch (sUriMatcher.match(uri)){    case QUESTIONS:      qb.setTables(QUESTIONS_TABLE_NAME);      qb.setProjectionMap(sQuestionsProjectionMap);      if (TextUtils.isEmpty(sortOrder)) sortOrder = Questions.DEFAULT_SORT_ORDER;      break;    case QUESTION_ID:      qb.setTables(QUESTIONS_TABLE_NAME);      qb.setProjectionMap(sQuestionsProjectionMap);      qb.appendWhere(Questions._ID + ""="" + uri.getPathSegments().get(1));      if (TextUtils.isEmpty(sortOrder)) sortOrder = Questions.DEFAULT_SORT_ORDER;      break;    case SCORES:      qb.setTables(SCORES_TABLE_NAME);      qb.setProjectionMap(sScoresProjectionMap);      if (TextUtils.isEmpty(sortOrder)) sortOrder = Scores.DEFAULT_SORT_ORDER;      break;    case SCORE_ID:      qb.setTables(SCORES_TABLE_NAME);      qb.setProjectionMap(sScoresProjectionMap);      qb.appendWhere(Scores._ID + ""="" + uri.getPathSegments().get(1));      if (TextUtils.isEmpty(sortOrder)) sortOrder = Scores.DEFAULT_SORT_ORDER;      break;    default:      throw new IllegalArgumentException(""Unknown URI "" + uri);    }        // Get the database and run the query    SQLiteDatabase db = mOpenHelper.getReadableDatabase();    Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);        // Tell the cursor what uri to watch, so it knows when its source data changes    c.setNotificationUri(getContext().getContentResolver(), uri);    return c;  }  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder, String limit) {    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();    switch (sUriMatcher.match(uri)){    case QUESTIONS:      qb.setTables(QUESTIONS_TABLE_NAME);      qb.setProjectionMap(sQuestionsProjectionMap);      if (TextUtils.isEmpty(sortOrder)) sortOrder = Questions.DEFAULT_SORT_ORDER;      break;    case QUESTION_ID:      qb.setTables(QUESTIONS_TABLE_NAME);      qb.setProjectionMap(sQuestionsProjectionMap);      qb.appendWhere(Questions._ID + ""="" + uri.getPathSegments().get(1));      if (TextUtils.isEmpty(sortOrder)) sortOrder = Questions.DEFAULT_SORT_ORDER;      break;    case SCORES:      qb.setTables(SCORES_TABLE_NAME);      qb.setProjectionMap(sScoresProjectionMap);      if (TextUtils.isEmpty(sortOrder)) sortOrder = Scores.DEFAULT_SORT_ORDER;      break;    case SCORE_ID:      qb.setTables(SCORES_TABLE_NAME);      qb.setProjectionMap(sScoresProjectionMap);      qb.appendWhere(Scores._ID + ""="" + uri.getPathSegments().get(1));      if (TextUtils.isEmpty(sortOrder)) sortOrder = Scores.DEFAULT_SORT_ORDER;      break;    default:      throw new IllegalArgumentException(""Unknown URI "" + uri);    }        // Get the database and run the query    SQLiteDatabase db = mOpenHelper.getReadableDatabase();    Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder, limit);        // Tell the cursor what uri to watch, so it knows when its source data changes    c.setNotificationUri(getContext().getContentResolver(), uri);    return c;  }  @Override  public Uri insert(Uri uri, ContentValues initialValues) {        ContentValues values;        SQLiteDatabase db;        long rowId;        if (sUriMatcher.match(uri) != QUESTIONS &amp;&amp; sUriMatcher.match(uri) != SCORES) {            throw new IllegalArgumentException(""Unknown URI "" + uri);        }        if (initialValues != null){          values = new ContentValues(initialValues);        }        else{          values = new ContentValues();        }    switch (sUriMatcher.match(uri)){    case QUESTIONS:          if (values.containsKey(Questions.QUESTION) == false) values.put(Questions.QUESTION, """");        if (values.containsKey(Questions.QUESTION) == false) values.put(Questions.ANSWER, -1);        if (values.containsKey(Questions.OPTION1) == false) values.put(Questions.OPTION1, """");        if (values.containsKey(Questions.OPTION2) == false) values.put(Questions.OPTION2, """");        if (values.containsKey(Questions.OPTION3) == false) values.put(Questions.OPTION3, """");        if (values.containsKey(Questions.OPTION4) == false) values.put(Questions.OPTION4, """");        if (values.containsKey(Questions.OPTION5) == false) values.put(Questions.OPTION5, """");        if (values.containsKey(Questions.OPTION6) == false) values.put(Questions.OPTION6, """");        if (values.containsKey(Questions.OPTION7) == false) values.put(Questions.OPTION7, """");        if (values.containsKey(Questions.OPTION8) == false) values.put(Questions.OPTION8, """");        if (values.containsKey(Questions.OPTION9) == false) values.put(Questions.OPTION9, """");        if (values.containsKey(Questions.OPTION10) == false) values.put(Questions.OPTION10, """");          if (values.get(Questions.QUESTION).toString().length() &gt; 0 &amp;&amp;            values.get(Questions.ANSWER).toString() != ""-1"" &amp;&amp;            values.get(Questions.OPTION1).toString().length() &gt; 0){            db = mOpenHelper.getWritableDatabase();            rowId = db.insert(QUESTIONS_TABLE_NAME, Questions.QUESTION, values);            if (rowId &gt; 0) {                Uri noteUri = ContentUris.withAppendedId(Questions.CONTENT_URI, rowId);                getContext().getContentResolver().notifyChange(noteUri, null);                return noteUri;            }          }          break;    case SCORES:        if (values.containsKey(Scores.SCORE) == false) values.put(Scores.SCORE, -1);        if (values.containsKey(Scores.DATE_CREATED) == false) values.put(Scores.DATE_CREATED, DateFormat.getDateTimeInstance().format(new Date()));          if (values.get(Scores.SCORE).toString() != ""-1""){            db = mOpenHelper.getWritableDatabase();            rowId = db.insert(SCORES_TABLE_NAME, Scores.SCORE, values);            if (rowId &gt; 0) {                Uri noteUri = ContentUris.withAppendedId(Questions.CONTENT_URI, rowId);                getContext().getContentResolver().notifyChange(noteUri, null);                return noteUri;            }      }      break;    }            throw new SQLException(""Failed to insert row into "" + uri);  }  @Override  public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {    SQLiteDatabase db = mOpenHelper.getWritableDatabase();    int count;    switch(sUriMatcher.match(uri)){    case QUESTIONS:            count = db.update(QUESTIONS_TABLE_NAME, values, where, whereArgs);            break;    case QUESTION_ID:            String questionId = uri.getPathSegments().get(1);            count = db.update(QUESTIONS_TABLE_NAME, values, Questions._ID + ""="" + questionId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"), whereArgs);      break;    case SCORES:            count = db.update(SCORES_TABLE_NAME, values, where, whereArgs);      break;    case SCORE_ID:            String scoreId = uri.getPathSegments().get(1);            count = db.update(SCORES_TABLE_NAME, values, Scores._ID + ""="" + scoreId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"), whereArgs);      break;    default:      throw new IllegalArgumentException(""Unknown URI "" + uri);    }        getContext().getContentResolver().notifyChange(uri, null);    return count;  }  @Override  public int delete(Uri uri, String where, String[] whereArgs) {    SQLiteDatabase db = mOpenHelper.getWritableDatabase();    int count;    switch(sUriMatcher.match(uri)){    case QUESTIONS:            count = db.delete(QUESTIONS_TABLE_NAME, where, whereArgs);            break;    case QUESTION_ID:            String questionId = uri.getPathSegments().get(1);            count = db.delete(QUESTIONS_TABLE_NAME, Questions._ID + ""="" + questionId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"), whereArgs);      break;    case SCORES:            count = db.delete(SCORES_TABLE_NAME, where, whereArgs);      break;    case SCORE_ID:            String scoreId = uri.getPathSegments().get(1);            count = db.delete(SCORES_TABLE_NAME, Scores._ID + ""="" + scoreId                    + (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"), whereArgs);      break;    default:      throw new IllegalArgumentException(""Unknown URI "" + uri);    }        getContext().getContentResolver().notifyChange(uri, null);    return count;  }  @Override  public String getType(Uri uri) {        switch (sUriMatcher.match(uri)) {        case QUESTIONS:            return Questions.CONTENT_TYPE;        case QUESTION_ID:            return Questions.CONTENT_ITEM_TYPE;        case SCORES:            return Scores.CONTENT_TYPE;        case SCORE_ID:            return Scores.CONTENT_ITEM_TYPE;        default:            throw new IllegalArgumentException(""Unknown URI "" + uri);        }  }    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {          db.execSQL(""CREATE TABLE questions (""              + ""_id INTEGER PRIMARY KEY AUTOINCREMENT,""
              + ""question TEXT,""
              + ""answer INTEGER,""
              + ""option1 TEXT,""
              + ""option2 TEXT,""
              + ""option3 TEXT,""
              + ""option4 TEXT,""
              + ""option5 TEXT,""
              + ""option6 TEXT,""
              + ""option7 TEXT,""
              + ""option8 TEXT,""
              + ""option9 TEXT,""
              + ""option10 TEXT);"");            db.execSQL(""CREATE TABLE scores (""                + ""_id INTEGER PRIMARY KEY AUTOINCREMENT,""
                + ""score NUMERIC,""
                + ""date_created TEXT);"");        }        @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"");        }            }    static {        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);        sUriMatcher.addURI(SATest.AUTHORITY, ""questions"", QUESTIONS);        sUriMatcher.addURI(SATest.AUTHORITY, ""questions/#"", QUESTION_ID);        sUriMatcher.addURI(SATest.AUTHORITY, ""scores"", SCORES);        sUriMatcher.addURI(SATest.AUTHORITY, ""scores/#"", SCORE_ID);        sQuestionsProjectionMap = new HashMap&lt;String, String&gt;();        sQuestionsProjectionMap.put(Questions._ID, Questions._ID);        sQuestionsProjectionMap.put(Questions.QUESTION, Questions.QUESTION);        sQuestionsProjectionMap.put(Questions.ANSWER, Questions.ANSWER);        sQuestionsProjectionMap.put(Questions.OPTION1, Questions.OPTION1);        sQuestionsProjectionMap.put(Questions.OPTION2, Questions.OPTION2);        sQuestionsProjectionMap.put(Questions.OPTION3, Questions.OPTION3);        sQuestionsProjectionMap.put(Questions.OPTION4, Questions.OPTION4);        sQuestionsProjectionMap.put(Questions.OPTION5, Questions.OPTION5);        sQuestionsProjectionMap.put(Questions.OPTION6, Questions.OPTION6);        sQuestionsProjectionMap.put(Questions.OPTION7, Questions.OPTION7);        sQuestionsProjectionMap.put(Questions.OPTION8, Questions.OPTION8);        sQuestionsProjectionMap.put(Questions.OPTION9, Questions.OPTION9);        sQuestionsProjectionMap.put(Questions.OPTION10, Questions.OPTION10);        sScoresProjectionMap = new HashMap&lt;String, String&gt;();        sScoresProjectionMap.put(Scores._ID, Scores._ID);        sScoresProjectionMap.put(Scores.SCORE, Scores.SCORE);        sScoresProjectionMap.put(Scores.DATE_CREATED, Scores.DATE_CREATED);    }}</code></pre>","198116","","","","","2010-05-07 19:47:35","Any way to override the managedQuery method to include a limit param when using a self-made content provider?","<android><android-contentprovider>","1","0","","",""
"2790772","1","5356505","","2010-05-07 18:23:48","3","5524","<p>I've downloaded Eclipse Classic 3.5 Galileo, the last version of Android SDK, downloaded and installed Eclipse Android 1.6 platform.I've created first (and the only) AVD with Android 1.6 and the default skin.The log may show more:I've filtered only neccessary messages (warnings, errors).</p><p>-<a href=""http://www.clipboard.cz/63c"" rel=""nofollow"">http://www.clipboard.cz/63c</a></p><p>As you can see, my new AVD has started in 16:17 and it was still loading in 17:35...The emulator looks like this:</p><p><img src=""http://img130.imageshack.us/img130/3540/androidloading.png"" alt=""alt text""></p><p>PS: The restrictions about number of links for new accounts are REALLY annoying...</p>","335717","","88558","","2010-05-07 18:31:06","2012-06-15 18:02:15","Android Virtual Device freezing during its loading","<android><android-emulator>","5","2","0","",""
"2790826","1","2791320","","2010-05-07 18:32:55","3","720","<p>I'm writing an app that has a foreground service, content provider, and a Activity front end that binds to the service and gets back a List of objects using AIDL. The service does work and updates a database.</p><p>If I leave the activity open for 4-8+ hours, and go to the ""Running Services"" section under settings on the phone (Nexus One) an unusually large amount of memory being used is shown (~42MB). </p><p>I figure there is a leak. When I check the heap memory i get Heap size:~18MB, ~2MB allocated, ~16MB free. Analyzing the hprof in Eclipse MAT seems fine, which leads me to theorize that memory is leaking on the stack. Is this even possible? If it is, what can I do to stop or investigate the leak? Is the reported memory usage on the ""Running Services"" section of android even correct (I assume it is)?</p><p>Another note: I have been unable to reproduce this issue when the UI is not up (with only the service running)</p>","335631","","","","","2010-05-07 19:54:33","Stack memory in Android","<android><memory-leaks><stack><heap>","1","0","1","",""
"2791045","1","2791816","","2010-05-07 19:05:45","17","11422","<p>I'm using the following drawable:</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=""@color/content_background_gradient_start""        android:endColor=""@color/content_background_gradient_end""         android:angle=""270""        /&gt;&lt;/shape&gt;</code></pre><p>The problem is that I get severe banding on hdpi devices (like the Nexus One and Droid) since the gradient goes from the top of the screen to the very bottom.</p><p>According to <a href=""http://idunnolol.com/android/drawables.html#shape_gradient"">http://idunnolol.com/android/drawables.html#shape_gradient</a> there isn't a ""dither"" attribute for a gradient.  Is there anything I can do to smooth the gradient?</p><p>Note: adding dither=""true"" to shape doesn't seem to work.</p>","135199","","135199","","2010-05-07 22:38:27","2011-10-30 14:24:09","Is it possible to dither a gradient drawable?","<android><graphics>","3","0","3","",""
"2791267","1","","","2010-05-07 19:42:44","0","794","<p>is it possible to have a service (A) which will launch an activity (B) and then periodically capture B's screen?</p><p>also, is it possible to send onTouch events from A to B?</p><p>basically, i'd like to make a bot which would use an application so i don't have to.</p><p>i guess it's not possible but had to ask.</p>","335767","","","","","2013-10-25 09:45:54","capturing another activity's screen in android","<android><service><screen><activity><capture>","2","0","","",""
"2791545","1","","","2010-05-07 20:40:30","2","1176","<p>I have seen a lot of posts about this, and it seems like the code below should work.  I have created an SD Card image and added it to the emulator (and that works fine).</p><pre><code>        Intent intent = new Intent(Intent.ACTION_PICK);        intent.setType(""image/*"");        //intent.setAction(Intent.ACTION_GET_CONTENT);        startActivityForResult(intent, 1);</code></pre><p>It does launch and allow selection of images, but when I click on an image, everything exits and the emulator returns to the home screen, not the back to my app.  My onActivityResult is never called either.</p><p>What am I missing?</p>","324485","","60261","","2010-05-07 22:01:28","2010-05-09 15:26:02","Pick an image from the Gallery","<android>","2","0","2","",""
"2791650","1","","","2010-05-07 20:58:58","5","1996","<p>I have a custom timer that extends android.os.CountDownTimer. I have a test in the test project (standard Android/Eclipse project config) that tests the custom Timer. When I run this test, I get:</p><blockquote>  <p>java.lang.NoClassDefFoundError: android/os/CountDownTimer<br>  &nbsp; at java.lang.ClassLoader.defineClass1(Native Method)<br>  &nbsp; at java.lang.ClassLoader.defineClass(ClassLoader.java:698)</p></blockquote><p>You get the idea. Can I not run code that references android code code in junit test?</p>","335817","","","Roger Pate","2010-05-31 02:13:45","2010-08-10 19:24:37","Eclipse + Android + JUnit test references android.os class = NoClassDefFoundError","<android><eclipse><junit>","1","0","3","",""
"2791679","1","2791776","","2010-05-07 21:03:00","8","9437","<p>I wanted to design a customized text selector that changed the text color when user clicks the TextView. But got the following error:</p><p>java.lang.RuntimeException: Unable to start activity ComponentInfo{}: android.view.InflateException: Binary XML file line #55: Error inflating class </p><p>here is what I have: drawable/text_selector.xml</p><pre><code>    &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;item android:state_enabled=""false""         android:state_focused=""true""         android:drawable=""@color/black"" /&gt;   &lt;item android:state_pressed=""true""         android:drawable=""@color/blue"" /&gt;   &lt;item android:state_focused=""true""         android:drawable=""@color/black"" /&gt; &lt;/selector&gt; </code></pre><p>layout/textview.xml</p><pre><code>&lt;TextView android:id = ""@+id/last_page_button""    android:text=""@string/last_page_button_string""     android:gravity=""center_horizontal""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:background=""#ffffff""    android:textColor = ""@drawable/text_selector""    android:layout_weight=""1"" /&gt;</code></pre><p>values/color.xml</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;color name=""blue""&gt;#ffccddff&lt;/color&gt;</code></pre><p> </p>","253800","","253800","","2010-05-07 21:10:25","2012-09-21 10:40:31","android: customized text selector","<android><colors><selector><textview>","2","0","1","",""
"2791927","1","2797026","","2010-05-07 22:01:12","5","9737","<p>HI</p><p>I tried to implement a simple GPS tracker. Therefore is used </p><pre><code>lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this);  </code></pre><p>Then i used the</p><pre><code>public void onLocationChanged(Location location) {</code></pre><p>method to read the altitude of my current location.</p><p>But i dont really know what Location.getAltitude() returns. The document says it returns the altitude. But is this in meters? or feets? if i put the phone on the desk next to me, this value changes between 500 and -500??</p><p>How does this really work???</p>","329637","","213269","","2010-05-09 08:06:05","2013-06-06 13:10:22","How does getAltitude() of Android GPS Location Works","<android><gps><locationmanager><wgs84>","4","3","3","",""
"2792053","1","","","2010-05-07 22:25:48","1","161","<p>I can see my adp2 in ddms device chooser, but cant see Dave's droid. (used to be able to before updating to usb v3!). Can some smart person diff the inf files from usb v2 and v3 and see if they dropped the droid by mistake when they added the nexus? I can't think of any other reason why I cant see the droid in the device chooser. USB debug turned on, same debuggable app that runs on the 1.6 adp2. I'd like to be able to see the 2.1 device even if it has a red x by it!</p>","335873","","","","","2010-05-07 22:25:48","Android USB driver v2 vs v3? V3 doesnt see moto droid in device chooser?","<android>","0","0","","",""
"2792062","1","2792085","","2010-05-07 22:28:33","7","3945","<p>It is clear that cross compilers will not be allowed by the Apple App Store, so a developer will need to be familiar with Objective-C to create applications for the iPhone. </p><p>I was wondering, is there a cross compiler that will take Objective-C application code and rebuild it into a similar Java application that can be packaged for Android? That way, a developer could still learn just one language (obj-c) but put out applications on many devices.</p><p>I understand that the Java port would be less optimal than a natively coded application, but could conceivably save a developer some time.</p><p><strong>Edit:</strong>Yes, the applications would be terrible. But would they not be as terrible as if they had been built by monotouch or the flash cross compiler? Couldn't those same methods be used that these cross compilers use?</p>","277256","","277256","","2010-05-08 01:26:19","2013-07-05 02:30:22","Objective-C to Java cross compiler","<java><iphone><objective-c><android><cross-platform>","5","1","1","",""
"2792096","1","2792120","","2010-05-07 22:38:46","2","1220","<p>I have a listview where each item correlates to an instance of an item in an array. When the user selects an item, it will bring up a 'Details' page that reads and displays other data members of the list item.</p><p>Would this be better implemented with the Details page as its own activity, or a new view within the same activity? Pros and cons of each?</p><p>A new activity makes my job a little easier in terms of handling the 'back' button, but then I have the challenge of how do I pass the rest of the data structure to the new activity since I can't bundle it up (unless I serialize it).</p><p><em><strong></em>**EDIT**</strong> Essentially I have a Playlist where the list item shows the title, item number, and an icon. Clicking on the item will show a full item description screen. I'm leaning toward containing that within the playlist activity since all that data is contained there. </p>","325011","","325011","","2010-05-08 06:16:35","2010-05-08 06:16:35","ListView Item Detail Screen: New or Same Activity?","<android><listview><activity>","3","0","","",""
"2792166","1","","","2010-05-07 22:59:23","2","1657","<p>I had some fairly simple code in my app to invoke an Edit Contact activity on a known good contact index that worked in Android 1.6 but is broken for me now in Android 2.1 on the Droid. I built a sample activity/app <code>EdCon</code> to show this:</p><pre><code>package com.jbh;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;public class EdCon extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Build an intent to edit a known good contact index        Intent i;        i = new Intent(Intent.ACTION_EDIT);        i.setData(Uri.parse(""content://contacts/people/10""));        startActivity(i);       }}</code></pre><p>When I run this on my G1 running 1.6 it works as expected i.e. brings up the Edit Contact screen for the known index and then I can hit BACK to return to ""Hello World, EdCon"".</p><p>When I run this on the Droid under 2.1 I get the following:</p><pre><code>05-07 15:35:57.787: INFO/ActivityManager(1013): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.jbh/.EdCon }05-07 15:35:57.826: DEBUG/AndroidRuntime(13780): Shutting down VM05-07 15:35:57.826: DEBUG/dalvikvm(13780): DestroyJavaVM waiting for non-daemon threads to exit05-07 15:35:57.928: DEBUG/dalvikvm(13780): DestroyJavaVM shutting VM down05-07 15:35:57.928: DEBUG/dalvikvm(13780): HeapWorker thread shutting down05-07 15:35:57.928: DEBUG/dalvikvm(13780): HeapWorker thread has shut down05-07 15:35:57.928: DEBUG/jdwp(13780): JDWP shutting down net...05-07 15:35:57.928: DEBUG/jdwp(13780): Got wake-up signal, bailing out of select05-07 15:35:57.928: INFO/dalvikvm(13780): Debugger has detached; object registry had 1 entries05-07 15:35:57.928: DEBUG/dalvikvm(13780): VM cleaning up05-07 15:35:57.935: INFO/ActivityManager(1013): Start proc com.jbh for activity com.jbh/.EdCon: pid=13802 uid=10052 gids={1015}05-07 15:35:57.967: ERROR/AndroidRuntime(13780): ERROR: thread attach failed05-07 15:35:58.053: INFO/ActivityThread(13792): Publishing provider com.android.vending.SuggestionsProvider: com.android.vending.SuggestionsProvider05-07 15:35:58.154: INFO/dalvikvm(13802): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38)05-07 15:35:58.209: DEBUG/dalvikvm(13780): LinearAlloc 0x0 used 639500 of 5242880 (12%)05-07 15:35:58.365: INFO/dalvikvm(13802): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=18)05-07 15:35:58.639: INFO/ActivityManager(1013): Starting activity: Intent { act=android.intent.action.EDIT dat=content://contacts/people/10 cmp=com.android.contacts/.ui.EditContactActivity }05-07 15:35:58.975: DEBUG/dalvikvm(13137): GC freed 2902 objects / 166768 bytes in 61ms05-07 15:35:59.100: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.run(): Syncing local DB with package manager...05-07 15:35:59.100: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.syncLocalDbWithPackageManager(): No INSTALLING or UNINSTALLING assets.05-07 15:35:59.115: INFO/ActivityManager(1013): Displayed activity com.android.contacts/.ui.EditContactActivity: 387 ms (total 1296 ms) 05-07 15:35:59.185: DEBUG/Sources(13137): Creating external source for type=com.facebook.auth.login, packageName=com.facebook.katana05-07 15:35:59.225: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.run(): Syncing done.05-07 15:35:59.232: WARN/dalvikvm(13137): threadid=27: thread exiting with uncaught exception (group=0x4001b180)05-07 15:35:59.232: ERROR/AndroidRuntime(13137): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception05-07 15:35:59.295: ERROR/AndroidRuntime(13137): java.lang.RuntimeException: An error occured while executing doInBackground()05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.os.AsyncTask$3.done(AsyncTask.java:200)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.lang.Thread.run(Thread.java:1096)05-07 15:35:59.295: ERROR/AndroidRuntime(13137): Caused by: android.database.sqlite.SQLiteException: **no such column: raw_contact_id:** , while compiling: SELECT account_name, account_type, sourceid, version, dirty, data_id, res_package, mimetype, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data_sync1, data_sync2, data_sync3, data_sync4, _id, is_primary, is_super_primary, data_version, group_sourceid, sync1, sync2, sync3, sync4, deleted, contact_id, starred, is_restricted FROM contact_entities_view WHERE (1) AND (raw_contact_id=10)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:59)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1221)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:316)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:3850)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:3840)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.providers.contacts.ContactsProvider2$RawContactsEntityIterator.&lt;init&gt;(ContactsProvider2.java:4498)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.providers.contacts.ContactsProvider2.queryEntities(ContactsProvider2.java:4751)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.content.ContentProvider$Transport.queryEntities(ContentProvider.java:140)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.content.ContentProviderClient.queryEntities(ContentProviderClient.java:98)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.content.ContentResolver.queryEntities(ContentResolver.java:296)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.contacts.model.EntitySet.fromQuery(EntitySet.java:72)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.doInBackground(EditContactActivity.java:191)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.doInBackground(EditContactActivity.java:154)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at com.android.contacts.util.WeakAsyncTask.doInBackground(WeakAsyncTask.java:45)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at android.os.AsyncTask$2.call(AsyncTask.java:185)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)05-07 15:35:59.295: ERROR/AndroidRuntime(13137):     ... 4 more05-07 15:35:59.303: INFO/Process(1013): Sending signal. PID: 13137 SIG: 305-07 15:35:59.303: INFO/dalvikvm(13137): threadid=7: reacting to signal 305-07 15:35:59.303: ERROR/dalvikvm(13137): Unable to open stack trace file '/data/anr/traces.txt': Permission denied05-07 15:35:59.506: INFO/DumpStateReceiver(1013): Added state dump to 1 crashes05-07 15:36:07.053: DEBUG/dalvikvm(12901): GC freed 389 objects / 25056 bytes in 145ms05-07 15:36:17.287: DEBUG/dalvikvm(11649): GC freed 154 objects / 6816 bytes in 136ms05-07 15:36:22.365: DEBUG/dalvikvm(13574): GC freed 348 objects / 67848 bytes in 112ms05-07 15:36:27.451: DEBUG/dalvikvm(11836): GC freed 267 objects / 17432 bytes in 65ms05-07 15:36:32.553: DEBUG/dalvikvm(12757): GC freed 1888 objects / 92440 bytes in 67ms05-07 15:36:38.803: INFO/power(1013): *** set_screen_state 005-07 15:36:38.813: DEBUG/SurfaceFlinger(1013): About to give-up screen, flinger = 0x114c3005-07 15:36:38.826: DEBUG/Sensors(1013): using accelerometer (name=accelerometer)05-07 15:36:38.834: DEBUG/PhoneWindow(13137): couldn't save which view has focus because the focused view android.widget.ScrollView@44883558 has no id.05-07 15:36:38.865: DEBUG/WifiService(1013): ACTION_SCREEN_OFF05-07 15:36:38.889: DEBUG/WifiService(1013): setting ACTION_DEVICE_IDLE timer for 900000ms05-07 15:36:44.107: DEBUG/dalvikvm(1013): GC freed 7351 objects / 521440 bytes in 130ms05-07 15:36:49.373: DEBUG/dalvikvm(13553): GC freed 321 objects / 12056 bytes in 102ms</code></pre><p>The <code>no such column: raw_contact_id:</code> looks like the issue but I'm not sure howor why that would happen or what it means. Any help appreciated!</p>","225405","","496830","","2011-08-02 15:47:56","2011-08-02 15:47:56","Edit Contact code worked in 1.6 but doesn't work on Droid 2.1","<android>","3","0","1","",""
"2792221","1","","","2010-05-07 23:21:09","4","472","<p>I'm having an interesting problem signing my Android application, whether or not I'm using a debug key. Regardless of the JDK I have installed to <code>/usr/bin/{java,keytool,jarsigner}</code> (OpenJDK or Sun's JDK) it will always give the following output after compiling successfully:</p><pre>-package-debug-sign:[apkbuilder] Creating RemoteNotify-debug-unaligned.apk and signing it with a debug key...BUILD FAILED/home/ianweller/AndroidSDK/platforms/android-7/templates/android_rules.xml:281: The following error occurred while executing this line:/home/ianweller/AndroidSDK/platforms/android-7/templates/android_rules.xml:152: java.lang.NoClassDefFoundError: com.android.jarutils.DebugKeyProvider</pre><p>The application was built and signed just fine by Eclipse with the ADT plugin (even without Sun's JDK installed). I'm on Fedora 12.</p><p>I'm wanting to get my code out of Eclipse and move it into a git repository, but being unable to build it from ant will not allow this to happen.</p>","1956744","","","","","2011-05-25 16:31:05",".apk signing fails even with Sun JDK (java.lang.NoClassDefFoundError: com.android.jarutils.DebugKeyProvider)","<android><fedora>","1","2","","",""
"2792263","1","2817808","","2010-05-07 23:35:06","11","5266","<p>I'm trying to draw a route onto my MapView.I've extended Overlay and implemented the draw() method.The route is displayed properly, although while debugging,I added a breakpoint on draw(), and noticed it is being called constantly.</p><p>I only want it to be re-drawn if someone moves the map or zooms (the draw take into account these changes when drawing the route)What can cause this ?</p>","184973","","","","","2013-02-27 18:58:34","draw is being constantly called in my android map overlay","<android><overlay><android-mapview>","8","0","2","",""
"2792457","1","2793333","","2010-05-08 00:39:44","3","1048","<p>I'm implementing a home screen app widget. I was wondering which is better to store/read data: SharedPreferences or a SQLite database? The data is accessed from an AppWidgetProvider (similar to a BroadcastReceiver), and any given instance of the widget displays different data based on appWidgetId. Is one way or the other frowned upon?</p><p>Thanks for your time.</p>","264734","","","","","2010-05-08 07:52:16","Android App Widget: Data storage","<android><data><storage><widget>","1","0","","",""
"2792680","1","","","2010-05-08 02:18:38","2","774","<p>I'm on Android 1.5, and my code is like this:</p><pre><code>HttpPost httpPost = new HttpPost(url);HttpEntity entity = new UrlEncodedFormEntity(params, HTTP.UTF_8);httpPost.setEntity(entity);HttpResponse response = httpClient.execute(httpPost);HttpEntity respEntity = response.getEntity();String result = EntityUtils.toString(respEntity, DEFAULT_CHARSET);</code></pre><p>After successfully executed these codes, the result is a stripped string. I've tried using browser to test the url+param, it works fine and got all data.</p><p>What's wrong with this code? Is there any parameters I need to specified? </p>","234939","","","","","2010-05-08 10:13:06","Why my HttpPost can't receive all response data?","<java><android><apache><http>","2","3","","",""
"2792843","1","2792924","","2010-05-08 03:32:08","1","1441","<p>My current problem is very similar to <a href=""http://stackoverflow.com/questions/1440957/httpurlconnection-getresponsecode-returns-1-on-second-invocation"">this one</a>.</p><p>I have a <code>downloadFile(URL)</code> function that creates a new HttpURLConnection, opens it, reads it, returns the results. When I call this function on the same URL multiple times, the second time around it almost always returns a response code of -1 (But throws no exception!!!).</p><p>The <a href=""http://stackoverflow.com/questions/1440957/httpurlconnection-getresponsecode-returns-1-on-second-invocation/1441491#1441491"">top answer in that question</a> is very helpful, but there are a few things I'm trying to understand.</p><p>So, if setting http.keepAlive to false solves the problem, it indicates what exactly? That the server is responding in a way that violates the http protocol? Or more likely, my code is violating the protocol in some way? What will the trace tell me? What should I look for?</p><p>And what's the deal with this:  </p><blockquote>  <p>You need to read everything from error  stream. Otherwise, it's going to  confuse next connection and that's the  cause of -1.</p></blockquote><p>Does this mean if the response is some type of error (which would be what response code(s)?), the stream HAS to be fully read? Also, every time I am attempting an http request I am basically creating a new connection, and then <code>disconnect()</code>ing it at the end.</p><p>However, in my case I'm not getting a 401 or whatever. It's always a 200. But my second connection almost always fails. Does this mean there's some other data I <em>should</em> be reading that I'm not (in a similar manner that the error stream must be fully read)?</p><p>Please help shed some light on this? I feel like there's some fundamental http protocol understanding I'm missing.</p><p>PS If I were just using the Apache HttpClient, would I not have to deal with all these protocol details? Does it take care of everything for me?</p>","325011","","325011","","2010-05-08 03:37:21","2010-05-09 17:15:34","HttpURLConnection: What's the deal with having to read the whole response?","<java><android><httpurlconnection>","2","0","","",""
"2792890","1","","","2010-05-08 03:59:53","2","2070","<p>I've just uploaded my first app on the market. It all went and looks well. I tried a few keywords to search for it, words that I also have in my description AND promo text, but some words don't find my app, some do.</p><p>How does the keyword strategy work for an app on the market, I couldn't find no documentation on it.</p>","237863","","","","","2010-05-08 10:10:31","Android: I uploaded my first app! Keywords?","<android>","1","0","2","",""
"2792976","1","2792987","","2010-05-08 04:57:18","7","4608","<pre><code>Duplicate:</code></pre><p><a href=""http://stackoverflow.com/questions/2833057/background-listview-becomes-black-when-scrolling?lq=1"">Background ListView becomes black when scrolling</a></p><p>I have a listview within which each item contains black text on a white background. When testing on a Nexus One, when scrolling down to read through the text, a black highlight appears over the text and makes it unreadable.</p><p>I am trying to figure out what is this setting so I can turn it off. I do not want anything to get highlighted when scrolling down through the list. How can I accomplish this?</p><p>Thanks.</p>","268648","","267269","","2013-05-15 14:25:51","2013-05-15 14:25:51","Android listview produces black highlighting over text when scrolling. How to stop this?","<android>","4","1","1","",""
"2793007","1","2793072","","2010-05-08 05:12:22","5","5083","<p>My app intiates an activity. On the click of a button, the app opens up the browser with a webpage. When I hit the back button, it comes back to my initial activity screen, but does not resume or restart the activity. </p><p>When I put all the layout code and activity code in onResume instead of onCreate, the activity gets restarted. </p><p>My question is whether this is the right way to go about it? Can I use onResume to draw my layout and initiate the activity, or is this poor design? When the browser fires up, does the initial activity forget its layout?</p><p>Please let me know what you suggest.</p><p>ThanksChris</p>","321927","","","","","2010-05-08 05:42:24","Android back button does not restart activity?","<android><activity><restart><onresume>","1","0","","",""
"2793031","1","","","2010-05-08 05:23:28","2","1121","<p>I would like to developed full screen caller application in android.</p><p>How can i add my activity on top of the call screen of my phone? Any example?</p>","336004","","119895","","2011-08-20 15:20:26","2011-08-20 15:20:26","Full screen caller for Android","<android>","1","0","1","",""
"2793216","1","","","2010-05-08 06:55:18","8","8150","<p>I have a thread I use to periodically update the data in my Activity. I create the thread and start a looper for using a handler with <code>postDelay()</code>. In onDestroy() for my activity, I call removeCallbacks() on my handler.</p><p>Should I then call <code>handler.getLooper().quit()</code>? Or not worry about it and let the OS deal with it? Or would it just run forever then, consuming CPU cycles?</p>","325011","","","","","2012-02-05 18:56:26","Android: Quitting the Looper?","<android><multithreading><message-queue><handler>","2","0","","",""
"2793222","1","2793664","","2010-05-08 06:58:55","-5","696","<p>i am developing android application website address how can implemented validation </p><p>example :  www.yahoo.com</p><p>please forward some solution </p>","275791","","","","","2010-05-08 10:13:38","how can validate website address in android application","<android>","2","3","1","2012-08-21 11:48:34",""
"2793320","1","","","2010-05-08 07:47:47","18","1820","<p>I've extended Overlay and implemented <code>draw()</code> in order to draw some stuff onto the map.When zooming is done through <code>mapController.zoomIn()</code> (called when doubleTapping the map),the overlay is drawn properly onto the map.</p><p>But whenever I zoom in/out with the built in zoom controller, the overlay is not drawn properly and panning the map is needed to get the overlay refreshed.</p>","184973","","473070","","2011-04-05 08:03:35","2012-02-14 07:15:32","Weird Overlay draw behaviour when zooming in the MapView","<android><overlay><zoom><android-mapview>","6","3","5","",""
"2793406","1","","","2010-05-08 08:28:03","2","131","<p>I am new in the field of ANdroid.</p><p>I am using FBReaderj code for my project.</p><p>I want to download a book from my website.</p><p>In FBREADERJ they have integrated with three site.</p><p>I want to add my own.</p><p>Any ideas ??</p><p>Please Help..</p><p>Thanks in Advance</p>","336070","","","","","2012-05-10 11:21:19","How to add my network library integration into FBReaderj in android?","<android>","2","0","","",""
"2793471","1","2793590","","2010-05-08 09:00:51","2","1043","<p>Android - What is the maximum file size that setMaxFileSize can be set to in respect to Androids mediarecorder? I know it's somewhere between 4147483650 and 5147483650. Why is there a limit in the first place?</p><p>I'm recording on to a SDCARD, detecting the size of the cards space before we run.</p><p>""ERROR/AuthorDriver(31): setParameter(max-filesize = 7270309850) failed with result -5""""ERROR/AuthorDriver(31): Ln 903 handleSetParameters(""max-filesize=7270309850"") error""""ERROR/AndroidRuntime(409): java.lang.RuntimeException: setMaxFileSize failed.""</p>","330770","","213269","","2011-08-15 20:13:12","2011-08-15 20:13:12","Android - What is mediarecorder's maximum maxfilesize?","<android><runtime-error><mediarecorder>","3","0","0","",""
"2793542","1","2794763","","2010-05-08 09:35:21","1","1738","<p>I've recently knocked up a server/client app for Windows &amp; Android that allows one to send a file from Windows to an android phone over a socket connection. </p><p>It works great for a single file but trying to send multiple files over in a single stream is causing me problems. I've also realised that aside from the binary data, I will need to send messages over the socket to indicate error states and other application messages. I have little experience with network programming and and wondering what is the best way forward.</p><p>Basically the C# server side of the app just goes into a listening state and uses Socket.SendFile to transmit the file. On Android I use the standard Java Socket.getInputStream() to receive the file.  That works great for a single file transfer, but how should I handle multiple files and error/messaging information? Do I need to use a different socket for each file? Should I be using a higher level framework to handle this or can I send everything over the single socket? Any other suggestions for frameworks or learning materials?</p>","56564","","","","","2011-04-08 07:19:06","How to approach socket programming between C# -> Java (Android)","<c#><java><android><sockets>","1","2","1","",""
"2793727","1","","","2010-05-08 10:39:01","3","633","<p>I am developing an application to display all the images in android's built-in gallery in to a php page. I posted the uri (<code>content://media/extrenal/images/media</code>) of the gallery images to the php page. I was not able to recreate images by using webView's function <code>loadUrl()</code>.</p><p>Should I need to upload the whole gallery to another directory and display the images?Or passing the bitmap itself will do?</p><p>Please suggest me an idea to solve the problem.</p>","336120","","119895","","2010-07-03 12:52:45","2011-04-19 23:48:18","how to view all images in android's built- in gallery from a php page","<android>","1","1","","",""
"2793871","1","2793948","","2010-05-08 11:27:13","3","207","<p>I am new to android and last year i bought two books of <strong>android 1.5</strong>. But at that time i was busy in my project so was not able to work on android. Now i want to start android again. Should i go for those books or should i buy new editions Is there any major change regarding basic learnings?Two books i am having are:-</p><p><a href=""http://pragprog.com/titles/eband2/hello-android"" rel=""nofollow"">Pragmatic Hello Android</a>  (New addition of this book is available, But still in beta phase)</p><p><a href=""http://apress.com/book/view/9781430224198"" rel=""nofollow"">Apress begining Android</a>  (Dont know about this whether new edition is available or not)</p><p>Please let me know. Thanks</p><p><strong>EDIT</strong>here i am not asking about the good books of android, as there are lot of questions regarding that. I can find out from them.My question is purely related to <strong>change in version</strong></p>","179855","","179855","","2010-05-08 11:42:22","2010-05-08 11:51:55","Help regarding android 1.5 and 2.1 (beginner, issue of Book Version)","<android>","1","0","","",""
"2793956","1","3932350","","2010-05-08 11:55:56","22","69973","<p>I have followed the ""Hello World"" example from Google's Android developer's guide. When I try to run the application in the SDK emulator, nothing happens. The emulator startd up nicely, but after that nothing happens. I can't even see the application in the app tray.</p><p>I am using Eclipse with the Android add-on installed.</p>","336150","","","","","2013-07-30 04:08:07","Android Emulator won't run application started from eclipse","<android><eclipse><android-emulator>","11","3","12","",""
"2794001","1","2795348","","2010-05-08 12:15:54","0","540","<p>Is there a way to determine the audio format of an audio file in Android? On normal java I do it like this:</p><pre><code>File file= new File(...);AudioInputStream stream = AudioSystem.getAudioInputStream(file);AudioFormat format= stream.getFormat();</code></pre>","283494","","","","","2010-07-04 02:35:30","Determining audioformat of audio files in Android","<android>","2","0","","",""
"2794058","1","2795368","","2010-05-08 12:33:41","1","1367","<p>In the Android application I am building, I want to be able to communicate with a local server developed in Django. (Basically a login page and a home page populated with posts and images from users) So do I need to use XML Parsers for the parsing the response from a Django server or is it possible for the server to respond with strings which can be directly used? Also what about images?</p><p>Is the JSON or XML Parser easier and robust to use in Android? The responses would be basically like tweets with a username, image and message. I was thinking of using the SAXParser. Any better alternatives?</p><p>Regards, </p><p>Primal</p>","323404","","323404","","2010-05-09 05:38:56","2010-05-09 09:40:36","How to parse responses from a Django server in android?","<android><django><parsing>","2","1","1","",""
"2794120","1","2794131","","2010-05-08 12:53:10","0","750","<p>Say I have 2 activities (ActivityOne and ActivityTwo). How would I call ActivityTwo from ActivityOne? Then how would I return to ActivityOne from ActivityTwo? For example, I have a listview with all the contacts on the host phone. When I tap on a contact, another activity shows information and allows editing of that contact. Then I could hit the back button, and I would go back to the exact state that ActivityOne was in before I called ActivityTwo. I was thinking an Intent object, but I am not sure. Could someone post some code?</p>","200477","","","","","2010-05-08 22:06:55","Call other activities in an activity?","<java><android><activity>","2","0","","",""
"2794166","1","2794403","","2010-05-08 13:07:26","0","793","<p>I am trying to access a server that requires authorization using the WebView widget in Android. I think it's the .htaccess type of authorization.</p><p>I works with the default browser provided with the OS, but when I try it with a WebView.. it gives a <code>401</code> immediately.</p><p>Any ideas on how I can have a WebView present the dialog to enter the user/pass (and remember it)?</p><p>Thanks.</p>","312176","","750613","","2012-07-09 12:11:29","2012-07-09 12:11:29","Using a WebView widget to authorize access","<android><.htaccess><webview>","1","0","","",""
"2794583","1","2794613","","2010-05-08 15:16:22","3","1191","<p>im creating a game right now and im a bit stuck on how to implement storage of levels. i need to be able to download level files from the internet ota. im not so familiar with transferring files ota, but i have some experience with databases (<code>mysql</code>). what would be a better way of storing the game's level data?</p>","209784","","750613","","2012-07-09 12:10:34","2012-07-09 12:10:34","android SQLite vs Flat Files","<database><android><sqlite><flat-file>","2","2","1","",""
"2794754","1","2794783","","2010-05-08 16:19:10","1","575","<p>How could I get a list of all of the music on the host phone? Not videos or ringtones, just music.</p>","200477","","","","","2010-05-08 16:29:18","Retrieve list of all music on host Android phone","<java><android><music>","1","0","","",""
"2794802","1","2794811","","2010-05-08 16:36:19","0","2408","<p>What's the best way to unstub the following functions?</p><pre><code>// Convert a bit-vector to an integer. int bitvec2int(boolean[] b){    [CODE HERE]}// Convert an integer x to an n-element bit-vector. boolean[] int2bitvec(int x, int n){    [CODE HERE]}</code></pre><p>Or is there a better way to do that sort of thing than passing boolean arrays around?</p><p>This comes up in an Android app where we need an array of 20 booleans to persist and the easiest way to do that is to write an integer or string to the key-value store.</p><p>I'll post the way we (<a href=""http://stackoverflow.com/users/58164/bee"">Bee</a> and I) wrote the above as an answer.  Thanks!</p>","4234","","","","","2010-05-08 17:16:57","Convert bit vector (array of booleans) to an integer, and integer to bit vector, in Java","<java><android><bit-manipulation><bitwise><bit>","2","2","1","",""
"2794913","1","2794945","","2010-05-08 17:07:07","2","1058","<p>I have an image that is currently stored in variable of type ""File""..</p><pre><code>File img = ...;</code></pre><p>What is the easiest way to display this image onto the screen so I can verify it is working correct? </p><p>Thanks!</p>","314994","","750613","","2012-07-09 12:10:20","2012-07-09 12:10:20","Android - Display image that is of type file","<java><android>","1","0","","",""
"2794960","1","","","2010-05-08 17:21:13","1","1116","<p>I want to save text from 2 edittexts(<code>et1,et2</code>) and selection from 3 spinners(spinnerm,spinner and spinner2) onPause and setting them back onResume.Text from edittexts is saved correctly, only spinner selection don't work as desired.My code:</p><pre><code>  public void onResume(){     super.onResume();     Log.d(""REZUM"",""notr smo"");     SharedPreferences seti = getSharedPreferences( ""pavzica"", MODE_PRIVATE);     spinnerm.setSelection(seti.getInt(""m"", 0));         spinner.setSelection(seti.getInt(""k"", 0));         spinner2.setSelection(seti.getInt(""p"", 0));         et1.setText(seti.getString(""zade"", """"));         et2.setText(seti.getString(""Vseb"", """")); }public void onPause() {    shraniPolja();    super.onPause();}public void shraniPolja() {    SharedPreferences seti = getSharedPreferences( ""pavzica"", MODE_PRIVATE);    SharedPreferences.Editor edito = seti.edit();    edito.putString(""zade"", et1.getText().toString());    edito.putString(""Vseb"", et2.getText().toString());    edito.putInt(""m"", spinnerm.getSelectedItemPosition());    edito.putInt(""k"", spinner.getSelectedItemPosition());    edito.putInt(""p"", spinner2.getSelectedItemPosition());    edito.putBoolean(""b"", true);    edito.commit();}</code></pre><p>What am i doing wrong?</p>","324417","","750613","","2012-07-09 12:10:06","2012-07-09 12:10:06","Setting spinners onResume doesn't work","<java><android><spinner><onresume>","1","0","","",""
"2795043","1","2795073","","2010-05-08 17:49:13","1","791","<p>I am trying to update a datetime column in an android sqlite db to use international date format (yyyy-mm-dd) instead of the current format (<code>mm/dd/yyyy</code>). I want to use the sqlite date() function to reformat the current value of the column. I thought it would be as simple as the following:</p><p>update tblename set thedate = date(thedate)</p><p>but the above does not work.</p><p>How would i write the sql statement to accomplish this?</p><p>thankspatrick </p>","244190","","750613","","2012-07-09 12:09:28","2012-07-09 12:09:28","How do I reference sqlite db column to use in update statement","<android><sqlite><sqlite3>","1","0","","",""
"2795123","1","","","2010-05-08 18:14:04","4","722","<p>Is there any <code>shortcut key</code> to <code>drop down</code> the Android status bar without using the touch screen?</p>","336316","","750613","","2012-07-09 12:07:42","2012-07-09 12:07:42","How to show android status bar without touch screen?","<android>","1","0","1","",""
"2795224","1","","","2010-05-08 18:47:28","2","1553","<p>I'm new to Android but I'm trying to create an IME that allows for gesture-character recognition.  I can already do simple apps that perform gesture recognition but am not sure where to hook in the gesture views/obj with an IME.  Here is a starting skeleton of what I have for the IME so far.  I would like to use <code>android.gesture.Gesture/Prediction/GestureOverlayView/OnGesturePerformedListener</code>.  Does anyone have advice?</p><p>gestureIME.java</p><pre><code>public class gestureIME extends InputMethodService {    private static Keyboard keyboard;    private static KeyboardView kView;    private int lastDisplayWidth;@Override public void onCreate() {    super.onCreate();}@Override public void onInitializeInterface() {       int displayWidth;    if (keyboard != null) {     displayWidth = getMaxWidth();        if (displayWidth == lastDisplayWidth) return;        else lastDisplayWidth = getMaxWidth();    }    keyboard = new GestureKeyboard(this, R.xml.keyboard);}@Override public View onCreateInputView() {    kView = (KeyboardView) getLayoutInflater().inflate(R.layout.input, null);    kView.setOnKeyboardActionListener(kListener);    kView.setKeyboard(keyboard);    return kView;}@Override public View onCreateCandidatesView() { return null;}@Override public void onStartInputView(EditorInfo attribute, boolean restarting) {    super.onStartInputView(attribute, restarting);    kView.setKeyboard(keyboard);    kView.closing();                  //what does this do???}   @Override public void onStartInput(EditorInfo attribute, boolean restarting) {    super.onStartInput(attribute, restarting);}  @Override public void onFinishInput() {    super.onFinishInput();}public KeyboardView.OnKeyboardActionListener kListener = new KeyboardView.OnKeyboardActionListener() { @Override public void onKey(int keyCode, int[] otherKeyCodes) {  if(keyCode==Keyboard.KEYCODE_CANCEL) handleClose();  if(keyCode==10) getCurrentInputConnection().commitText(String.valueOf((char) keyCode), 1); //keyCode RETURN }@Override public void onPress(int primaryCode) {}  // TODO Auto-generated method stub@Override public void onRelease(int primaryCode) {}  // TODO Auto-generated method stub@Override public void onText(CharSequence text) {}  // TODO Auto-generated method stub@Override public void swipeDown() {}     // TODO Auto-generated method stub@Override public void swipeLeft() {}     // TODO Auto-generated method stub @Override public void swipeRight() {}     // TODO Auto-generated method stub @Override public void swipeUp() {}      // TODO Auto-generated method stub};private void handleClose() {    requestHideSelf(0);    kView.closing();}}</code></pre><p>GestureKeyboard.java</p><pre><code>    package com.android.jt.gestureIME;    import android.content.Context;    import android.inputmethodservice.Keyboard;    public class GestureKeyboard extends Keyboard {        public GestureKeyboard(Context context, int xmlLayoutResId) {            super(context, xmlLayoutResId);        }}</code></pre><p>GesureKeyboardView.java</p><pre><code>package com.android.jt.gestureIME;import android.content.Context;import android.inputmethodservice.KeyboardView;import android.inputmethodservice.Keyboard.Key;import android.util.AttributeSet;public class GestureKeyboardView extends KeyboardView {    public GestureKeyboardView(Context context, AttributeSet attrs) {        super(context, attrs);    }    public GestureKeyboardView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }    @Override protected boolean onLongPress(Key key) {        return super.onLongPress(key);    }}</code></pre><p>keyboard.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Keyboard xmlns:android=""http://schemas.android.com/apk/res/android""    android:keyWidth=""10%p""    android:horizontalGap=""0px""    android:verticalGap=""0px""    android:keyHeight=""@dimen/key_height""    &gt;    &lt;Row android:rowEdgeFlags=""bottom""&gt;         &lt;Key android:codes=""-3"" android:keyLabel=""Close""  android:keyWidth=""20%p"" android:keyEdgeFlags=""left""/&gt;         &lt;Key android:codes=""10"" android:keyLabel=""Return"" android:keyWidth=""20%p"" android:keyEdgeFlags=""right""/&gt;    &lt;/Row&gt;&lt;/Keyboard&gt;</code></pre><p>input.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.android.jt.gestureIME.GestureKeyboardView        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/gkeyboard""        android:layout_alignParentBottom=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        /&gt;</code></pre>","336265","","630668","","2012-07-09 13:58:02","2012-07-09 13:58:02","Android: How/where to put gesture code into IME?","<android><gesture-recognition><ime><android-keypad><android-gesture>","0","0","2","",""
"2795231","1","2795262","","2010-05-08 18:50:03","1","173","<p>I have an annoying problem with TabActivity. I have several activities in it and when I switch between them each of them gets recreated and loses all its info :(</p><p>I've tried using <code>android:launchMode=""singleTop""</code> but no luck :(</p><p>Any clues?</p>","230466","","750613","","2012-07-09 12:06:35","2012-07-09 12:06:35","Child Activity gets created from scratch after switching tabs in a TabActivity","<android><tabactivity>","1","0","","",""
"2795300","1","2795324","","2010-05-08 19:14:40","35","74856","<p>In the <a href=""http://developer.android.com/reference/android/app/AlertDialog.html"">Android docs on AlertDialog</a>, it gives the following instruction and example for setting a custom view in an AlertDialog:</p><p><Blockquote>If you want to display a more complex view, look up the FrameLayout called ""body"" and add your view to it:</Blockquote></p><pre><code>FrameLayout fl = (FrameLayout) findViewById(R.id.body);fl.add(myView, new LayoutParams(FILL_PARENT, WRAP_CONTENT));</code></pre><p>First off, it's pretty obvious that <code>add()</code> is a typo and is meant to be <code>addView()</code>.</p><p>I'm confused by the first line using R.id.body. It seems that it's the body element of the AlertDialog ... but I can't just enter that in my code b/c it gives a compile error. Where does R.id.body get defined or assigned or whatever?</p><p>Here's my code. I tried to use <code>setView(findViewById(R.layout.whatever)</code> on the builder but it didn't work. I'm assuming because I didn't manually inflate it?</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setTitle(""Title"")    .setCancelable(false)    .setPositiveButton(""Go"", new DialogInterface.OnClickListener() {    @Override    public void onClick(DialogInterface dialog, int id) {        EditText textBox = (EditText) findViewById(R.id.textbox);        doStuff();    }});FrameLayout f1 = (FrameLayout)findViewById(R.id.body /*CURRENTLY an ERROR*/);f1.addView(findViewById(R.layout.dialog_view));AlertDialog alert = builder.create();alert.show();</code></pre>","325011","","172350","","2011-10-26 19:43:09","2013-09-12 20:15:45","How to implement a custom AlertDialog View","<android><alertdialog>","5","2","17","",""
"2795528","1","2812701","","2010-05-08 20:33:11","0","1767","<p>I need to create a custom bluetooth service and I have to develop it using c++. I read a lot of examples but I didn't success in publishing a new service with a custom UUID. I need to specify a UUID in order to be able to connect to the service from an android app. This is what i wrote:</p><pre><code>GUID service_UUID = { /* 00000003-0000-1000-8000-00805F9B34FB */    0x00000003,    0x0000,    0x1000,    {0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}};    SOCKET s, s2;SOCKADDR_BTH sabif (WSAStartup(MAKEWORD(2, 2), &amp;wsd) != 0)    return 1;printf(""installing a new service\n"");s = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);if (s == INVALID_SOCKET){    printf (""Socket creation failed, error %d\n"", WSAGetLastError());    return 1;}memset (&amp;sab, 0, sizeof(sab));sab.addressFamily  = AF_BTH;sab.port = BT_PORT_ANY;sab.serviceClassId = service_UUID;if (0 != bind(s, (SOCKADDR *) &amp;sab, sizeof(sab))){    printf (""bind() failed with error code %d\n"", WSAGetLastError());    closesocket (s);    return 1;}int result=sizeof(sab);getsockname(s,(SOCKADDR *) &amp;sab, &amp;result );printSOCKADDR_BTH(sab);if(listen (s, 5) == 0)    printf(""listen() is OK! Listening for connection... :)\n"");else    printf(""listen() failed with error code %d\n"", WSAGetLastError());printf(""waiting connection"");for ( ; ; ){    int ilen = sizeof(sab2);    s2 = accept (s, (SOCKADDR *)&amp;sab2, &amp;ilen);    printf (""accepted"");}if(closesocket(s) == 0)    printf(""closesocket() pretty fine!\n"");if(WSACleanup () == 0)    printf(""WSACleanup() is OK!\n"");return 0;</code></pre><p>When i print the SOCKADDR_BTH structure retrieved with get getsockname i get an UUID that is not the mine. Furthermore if i use the UUID read from getsockname to connect the Android application the connection fails with this exception:</p><pre><code>java.io.IOException: Service discovery failed</code></pre><p>Could you help me??</p><p>Thanks!</p>","302798","","","","","2012-07-09 12:06:15","Bluetooth service problem","<c++><android><network-programming><bluetooth><winsock2>","2","0","","",""
"2795833","1","2799001","","2010-05-08 22:10:24","149","92213","<p>How can I check if the Android phone is in Landscape or Portrait? </p>","200477","","","","","2014-03-13 10:24:23","Check orientation on Android phone","<java><android><orientation>","14","0","36","",""
"2795838","1","","","2010-05-08 22:11:21","1","443","<p>I have built an app for the Motorola Droid which should automatically update a server with the phone's location. After the user performs a particular task on the main activity screen, an alarm is set to update the user's location periodically, using a service. The alarm is explicitly stopped when the user completes another task.</p><p>Thing is, I have set up a location manager within the main activity's onCreate() method which is supposed to place the first acquired lat/long into two textview fields. Even though the manifest is set up for acquiring coarse and fine coords and I'm using   <code>requestLocationUpdates  (String  provider, long minTime, float minDistance, LocationListener  listener)</code>, with minTime and minDistance set to zero, I'm not seeing the coords coming up on the screen. With that, I'm not recording any locations on the server.</p><p>When I seed the textviews with sample coords, they are being recorded fine on the server. I am not at a computer that can run the IDE, so don't currently have the code, but am desperate for some help on this.</p><p>One other thing is that the main activity screen calls a photography app before the user manually clicks ""send data"". I'm suspicious that I may need to override the main activity's    <code>onResume()</code> method to do this location acquisition. Please help, thanks.</p><p>Mark.</p>","333721","","","","","2010-12-09 05:30:32","Setting acquired location to a text view: How to maintain?","<android><locationmanager>","2","0","","",""
"2795985","1","2796168","","2010-05-08 23:06:54","3","1841","<p>I have three simultaneous instances of an AsyncTask for download three files. When two particular ones finish, at the end of <code>onPostExecute()</code> I check a flag set by each, and if both are true, I call <code>startActivity()</code> for the next Activity.</p><p>I am currently seeing the activity called twice, or something that resembles this type of behavior. Since the screen does that 'swipe left' kind of transition to the next activity, it sometimes does it twice (and when I hit back, it goes back to the same activity). It's obvious two versions of the activity that <em>SHOULD</em> only get called once are being put on the Activity stack.</p><p>Could this be from both onPostExecute()s executing simultaneously and both checking the flags each other set at the exact same time? This seems extremely unlikely since two processes would have to be running line-by-line in parallel...</p><p><em><strong></em>*EDIT*</strong> A lot removed from this question since I was way off in what I thought was wrong. Nonetheless I found the answer here quite useful, so I have edited the question to reflect the useful parts.</p>","325011","","325011","","2010-05-10 07:09:39","2010-05-10 07:09:39","Same Activity called twice... Issue with Multiple AsyncTasks?","<android><android-asynctask>","1","0","","",""
"2796050","1","2925830","","2010-05-08 23:33:06","1","5009","<p>I have a TabActivity and want to catch and handle presses of HOME and BACK. Where do I need to catch these events?</p><p>In my subclass of TabActivity I implement the following:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    switch (keyCode) {        // Code handling    }    return super.onKeyDown(keyCode, event);}</code></pre><p>Didn't work.</p><p>So I placed a breakpoint on the switch statement line. But this function <strong>never</strong> gets called, whether I press volume up/down, menu, home, or back. Where do I need to catch these KeyEvents?</p>","325011","","","","","2012-09-26 08:30:17","Key Events in TabActivities?","<android><keyevent>","5","0","1","",""
"2796157","1","2796262","","2010-05-09 00:27:41","16","17444","<p>I have here a device which can give me GPS coordinates. The time interval I can define. I want to use it to calculate the average speed during driving or travelling by car. Actually I used a orthodrome formula to calculate the distance between two points and then divided it by the given time interval. By the implementation I followed <a href=""http://de.wikipedia.org/wiki/Orthodrome#Genauere_Formel_zur_Abstandsberechnung_auf_der_Erde"">this term</a>. Unfortunately I could only find a German link, but I think the formula should be understandable in any language ;)</p><p>Unfortunately, using this formula and a time interval of 1 second gives very unprecise results. The speed while walking is between 1 km/h and 20 km/h.</p><p>So I wonder if there is a general reference on how to implement distance calculation between two GPS coordinates (I found something similar on SO) and particulary, which is the best time interval to update the GPS coordinates?</p>","329637","","1561471","","2012-08-15 07:42:45","2012-09-12 18:56:48","Best practice to calculate the average speed from GPS coordinates","<android><algorithm><math><gps>","3","8","11","",""
"2796219","1","2796363","","2010-05-09 00:54:16","11","48178","<p>How can I set a fixed width for an Android button? Everytime I try to set a fixed width it fills the current parent (the RelativeView). Here is my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/relativelayout"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;EditText android:layout_height=""wrap_content"" android:editable=""false"" android:layout_width=""fill_parent"" android:id=""@+id/output""&gt;&lt;/EditText&gt;    &lt;Button android:layout_height=""wrap_content"" android:id=""@+id/Button01"" android:layout_below=""@id/output"" android:text=""7"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt;    &lt;Button android:layout_below=""@id/output"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/Button02"" android:layout_toRightOf=""@+id/Button01"" android:text=""8""&gt;&lt;/Button&gt;    &lt;Button android:layout_below=""@id/output"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/Button03"" android:layout_toRightOf=""@+id/Button02"" android:text=""9""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre><p>How would I give it a FIXED width?<br><b>UPDATE</b><br> Say I have several buttons that I want the same size as each other and 1/3 of the entire view (Portrait), then I want a button with double the width. Then a button with double the height. How could I accomplish this other that manually sizing them?</p>","200477","","200477","","2010-05-09 01:03:49","2012-12-18 15:29:10","Set width of Button in Android","<java><xml><android><size>","3","0","2","",""
"2796231","1","2796297","","2010-05-09 00:57:30","5","5784","<p>I'm developing on the Droid Incredible (and have tested on a 1.5 AVD Emulator as well), and one of the tabs in my tab widget consists of a listview and a row with an EditText and a Send button (for a chat feature). I am using the following to close the soft keyboard once I click Send, but it's not working. This is identical to code I've found elsewhere that people have upvoted as correct.</p><p>See anything I'm missing?</p><pre><code>// in Button's onClick():EditText chatTextBox = (EditText) findViewById(R.id.chat_entry);// Handle button click ...chatTextBox.setText("""");InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(chatTextBox.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY);</code></pre><p>I also tried changing the flag to 0. No luck. Anyone know what's up??</p><p>*<strong><em>EDIT</em>*</strong> Just realized I was originally using <code>hideSoftInputFromInputMethod()</code> instead of <code>hideSoftInputFromWindow()</code>. Changing it didn't make it work though...</p>","325011","","325011","","2010-05-09 01:28:10","2013-11-19 13:43:49","Hide Soft Keyboard Not Working ","<android><hide><soft-keyboard>","3","0","1","",""
"2796252","1","2796299","","2010-05-09 01:05:27","2","488","<p>An application I'm developing requires that the app main a local list of things, let's say books, in a local ""library."" Users can access their local library of books and search for books using a remote web service. The app will be aware of other users of the app through this web service, and users can browse other users' lists of books in their library. Each book is identified by a unique <code>bookId</code> (represented as an <code>int</code>).</p><p>When viewing books returned through a search result or when viewing another user's book library, the individual list row cells need to visually represent if the book is in the user's local library or not. A user can have at most 5,000 books in the library, stored in SQLite on the device (and synchronized with the remote web service).</p><p>My question is, to determine if the book shown in the list row is in the user's library, would it be better to directly ask SQLite (via <code>SELECT COUNT(*)...</code>) or to maintain, in-memory, a <code>List</code> or <code>int[]</code> array of some sort containing the unique <code>bookId</code>s.</p><p>So, on each row display do I query SQLite or check if the <code>List</code> or <code>int[]</code> array contains the unique <code>bookId</code>? Because the user can have at most 5,000 books, each <code>bookId</code> occupies 4 bytes so at most this would use ~ 20kB.</p><p>In thinking about this, and in typing this out, it seems obvious to me that it would be far better for performance if I maintained a list or int[] array of in-library <code>bookId</code>s vs. querying SQLite (the only caveat to maintaining an int[] array is that if books are added or removed I'll need to grow or shrink the array by hand, so with this option I'll most likely use an <code>ArrayList</code> or <code>Vector</code>, though I'm not sure of the additional memory overhead of using <code>Integer</code> objects as opposed to primitives).</p><p>Opinions, thoughts, suggestions?</p>","300368","","","","","2011-01-26 03:08:08","Speed/expensive of SQLite query vs. List.contains() for ""in-set"" icon on list rows","<java><android>","3","0","1","",""
"2796502","1","2802079","","2010-05-09 03:25:33","2","2697","<p>Is it possible to install Android in a normal mobile phone?</p><p>I have Sony Ericsson <a href=""http://www.gsmarena.com/sony_ericsson_naite-2818.php"" rel=""nofollow"">Naite</a> which has only key pad interface (No touch). I would like to install Android in my phone for experimenting with it. It will be great if its possible to dual boot Android with Symbian :-). </p><p>Do we need any other special hardware to install operating system in a mobile phone? Will Android work on a key-pad mobile?</p><p>Any pointer/suggestion is appreciated. </p><p>Thank you in advance.</p>","152253","","750613","","2012-07-09 12:04:22","2012-07-09 12:04:22","Android installation in a mobile","<android><mobile><installation>","2","0","1","",""
"2796774","1","2796785","","2010-05-09 06:00:17","-1","1287","<p>first, please see the blog as the link showed below:</p><p><a href=""http://blogs.nitobi.com/joe/2008/10/17/phonegap-now-for-android/comment-page-1/#comment-12918"" rel=""nofollow"">http://blogs.nitobi.com/joe/2008/10/17/phonegap-now-for-android/comment-page-1/#comment-12918</a></p><p>the author made iPhone Style app in Android emulator, the pic showed below:</p><p>http: blogs.nitobi.com/joe/wp-content/uploads/2008/10/droidgap.png</p><p>if anyone knows, Would you please tell me how to make the iphone sytle app in android, as the pic shows? I checked the phonegap demo in the github, it's not the same as the picture showed in the blog. </p><p>I am so curious about how can make iphone style app in Android? Since it need the Iphone OS to display such effect. Would anyone please tell me how to make it?</p><p>so pity that the link doesn't work now: https: github.com/bowserj/gap/</p><p>your reply will be great appriciated.the same question i asked can be found with link:http: stackoverflow.com/questions/2786787/how-to-implement-iphone-titlebar-in-android</p><p><em><strong>only to synic:</em></strong></p><p>hi, synic, thanks to your great reply.</p><p>to your second note, because i find i didn't add a picture in my first question thread, but your suggestion is great.</p><p>to your example titlebar, the code is great, but i'd like to use opensource webapp-ui-framework like Phonegap, iqtouch, iui, which is more powerful and reusable, don't think so?</p><p>i can use iui or jqtouch, to make a fancy UI, by combining html into android's WebView api, but the problem is, i need use Safari to display the html, otherwise, it will not have the iPhone fancy tiltebar and the beautiful iPhone style, Safari has a engine to display such effect, which android OS may not have. So how can i find a library or jar file, which can subtitute this Safari engine and can be used in Android OS, Android emulator?</p><p>If there's no way, It's very pitiful and poor that Android UI developer had to create html with the standard iPhone style manualy , comparing to iPhone developer which can use existing iWebKit/iUi/jqtouch Webapp-UI-FrameWork, only to type simple tag such as titlebar leftnav, then the framework will to do the work to display the iPhone Style titlebar... OMG, too unfair. </p><p>If you suggest me to develop UI with Android API as you metioned above, yeah, it's ok to me, but it will make me uncomfortable that the Android api is so poor and inconvinient, leading much trouble, comparing with webapp-UI-framework i mentioned</p>","335170","","335170","","2010-05-09 08:28:12","2010-05-09 08:28:12","How to port Iphone style app into Android?","<iphone><android><coding-style>","1","1","","",""
"2796814","1","2799580","","2010-05-09 06:20:44","19","14225","<p>I'm designing an HTML page for display in Android browsers.  Consider this simple example page:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Simple!&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;&lt;img src=""http://sstatic.net/so/img/logo.png""&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>It looks just fine on the standard HVGA phones (320x480), but on HDPI WVGA sizes (480x800 or 480x854) the built-in browser automatically scales the image up; it looks ugly.</p><p>I've read that I should be able to use this tag to force the browser to stop scaling my page:</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;"" /&gt;</code></pre><p>... but all that does is disable user scaling (the zoom buttons disappear); it doesn't actually prevent the browser from scaling my image.  Adjusting the scale factors (setting them all to 2.0 or 0.5) has no effect at all.</p><p>How can I force the WVGA browser to stop scaling my images?</p>","54829","","","","","2011-12-02 03:10:24","How do I get the WVGA Android browser to stop scaling my images?","<android><browser><webkit><highdpi>","2","3","18","",""
"2796935","1","","","2010-05-09 07:23:47","1","589","<p>I'm trying to build a voip application on a new android device, i use AudioRecorder to read the microphone but I'm getting no valid results, just white noise.This happen only on this new device(other work well) and this is probably because this device has <code>PTT</code> ability.Is there some workaround to avoid using AudioRecoder to receive streaming data from the microphone?</p><p>Thanks.supersk.</p>","297512","","750613","","2012-07-09 12:03:23","2012-07-09 12:03:23","Android AudioRecorder object wont read from microphone","<java><android><voip>","1","0","","",""
"2796974","1","2847551","","2010-05-09 07:41:56","2","1802","<p>I have a code for populating content for tabs dynamically. First time it works ok, but when I want to replace tabs (and their content) with new content - tabs are changed but tabs' contents are not, how can I clear completely whole TabHost and replace with other content?</p><pre><code>TabHost tabHost = getTabHost();Intent intent;TabHost.TabSpec spec;tabHost.setCurrentTab(0);tabHost.clearAllTabs();int idx = 0;for(Group g: c.getGroups()){            intent = new Intent().setClass(this, GroupActivity.class);            ItemLookup.createForGroup(idx).putToIntent(intent);            spec = tabHost                .newTabSpec(""tab""+idx)                .setIndicator(g.getTitle())                .setContent(intent);            tabHost.addTab(spec);            idx++; } tabHost.setCurrentTab(0);</code></pre>","120574","","750613","","2012-07-09 12:02:48","2012-07-09 12:02:48","TabHost remove all content activities","<android><tabs><android-tabhost>","2","0","1","",""
"2797150","1","2797448","","2010-05-09 09:13:13","1","653","<p>Does anyone knows if the wifi networks for android phones are based on <code>Access Point Names</code> (APN) ?  I ask because in my android application I plan to overwrite some fields in all APN's to disable cellular network, but I still want to have available the wifi for the user</p>","284609","","750613","","2012-07-09 12:00:44","2012-07-09 12:01:42","Wifi functionality","<android><wifi><apn>","1","0","","",""
"2797158","1","","","2010-05-09 09:16:07","2","144","<p>I'm using layout xml file for the UI. But the images are compressed and the qualities have lost in some level.</p><p>My code is like this:</p><pre><code>&lt;ImageView    android:layout_width=""480px""    android:layout_height=""717px""    android:layout_x=""0px""    android:layout_y=""45px""    android:scaleType=""fitXY""    android:src=""@drawable/e4"" /&gt;</code></pre><p>The drawable is actually <code>480x717</code>. </p><p>What's the problem here? Is it due to the fitXY?</p>","234939","","750613","","2012-07-09 12:00:28","2012-07-09 12:00:28","Why are my images compressed?","<android><drawable>","1","13","0","",""
"2797317","1","2802008","","2010-05-09 10:19:31","0","1117","<p>I understand it is possible to sell the same application both in the market and outside it, great.</p><p>I still don't understand a few things, that AFAIK are not mentioned in the contract but I might have missed or misunderstood something, so I'm going to ask.</p><p><em>Disclaimer: I know you're not a lawyer, etc. etc.</em></p><p>Let's say I give in the market a demo version, <em>and</em> I sell in the market the full version too.May I <strong>also</strong> sell the full version outside the market?</p><p>I understand that you can't give away the demo in the market and then collect the payment outside, but what if I do allow the user to buy it in the market, but <strong>also</strong> allow him to buy outside the market?</p><p>What if I <strong>charge a lower price</strong> if he buys outside the market?</p>","207655","","21234","","2010-05-09 10:23:24","2012-11-19 00:50:31","Selling an application both in the android market and outside it","<android><legal>","4","0","0","",""
"2797649","1","","","2010-05-09 12:50:36","2","487","<p>I want my app to have a proximityAlert until the user removes it.  I use expiration -1 to create this proximityAlert.  The proximityAlertworks.  But I find on my Droid phone, after adding a proximityAlertand leaving the phone over night for charging, the proximityAlert doesnot work the next day.  How can I make sure that my proximityAlert isactive indefinitely unless the user removes it?</p><p>Thanks,</p><p>Prasanna</p>","304814","","750613","","2012-07-09 11:59:29","2012-07-09 11:59:29","AddProximityAlert Disappears Although Expiration -1","<android><proximity>","2","0","","",""
"2797894","1","2798275","","2010-05-09 14:17:38","10","2381","<p>I was following the progress dialog example in the ApiDemos.all went great except for one thing - I want to remove the numbers that appear underneath the bar (those running numbers that run from 0 to .getMax().</p><p>couldn't find how to do it.</p><p>anyone?</p><p>Ori</p>","258429","","510491","","2011-05-03 09:35:56","2013-03-15 14:30:16","ProgressDialog - how to remove the numbers","<android><progressdialog>","4","0","2","",""
"2797947","1","","","2010-05-09 14:40:31","4","4199","<p>There is a task to make smt like todo list on widget (with dinamic number of elements),how to organize this list for click support on this elements.I only found how add click event on one widget layout element (with <code>setOnClickPendingIntent</code>),and how send text to widget element TextView.</p><p>But it's unclear how handle click events for sub-elemets, or how get click coordinates(or item) where was click event.I saw widget ""<strong>Agenda widget</strong>"" - and it work fine with clicking on different calendar rows.</p><p>I will be very much appreciated for help.</p>","311076","","750613","","2012-07-09 11:58:05","2013-11-13 21:24:05","How to correctly handle click events on Widget","<android><android-widget>","1","0","1","",""
"2797958","1","2798115","","2010-05-09 14:43:29","3","2837","<p>I created my own custom keyboard following the the example in the sdk.</p><p>Now I would like to use this custom keyboard by default on my EditText in my app (actualy I have to long press the edittext and then choose my <code>custom keyboard</code>). </p><p>How can I do that ? (seems to be related to the inputType property but I can't find out how to set it)</p><p>Thanks !</p>","336657","","750613","","2012-07-09 11:57:47","2012-07-09 13:05:27","Android : EditText with custom keyboard","<android><keyboard><edittext>","3","0","2","",""
"2798078","1","2798154","","2010-05-09 15:18:26","0","1029","<p>I want to show an arrow that indicates the direction towards a goal, using the orientation sensor and current GPS position. Everything works well, except that I want to rotate the arrow image in my ImageView.</p><p>The current code, which shows the arrow pointing upwards, is this:</p><pre><code>ImageViewArrow.setImageResource(R.drawable.arrow);</code></pre><p>What is the best solution for showing the arrow, rotated by N degrees?</p><p>I tried this, but it gave messed up graphics:</p><pre><code>Matrix matrix = new Matrix(); matrix.postRotate(Rotation);Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),   R.drawable.arrow); Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,  bitmapOrg.getWidth(),bitmapOrg.getHeight(), matrix, true); BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);InfoArrow.setScaleType(ScaleType.CENTER);InfoArrow.setImageDrawable(bmd);</code></pre>","1507543","","1507543","","2010-05-09 16:44:05","2010-05-09 16:44:05","Rotated image in ImageView","<java><android>","2","0","","",""
"2798105","1","2798189","","2010-05-09 15:27:06","2","1604","<p>I'm looking forward the method for accessing the current image's Uri from an ImageView, to save it to my database, but i've only found the setter. </p><p>Where's the getter??</p>","336675","","750613","","2012-07-09 11:56:47","2012-07-09 11:56:47","How to retrieve ImageUri of an ImageView?","<android><image><uri><imageview>","1","0","","",""
"2798227","1","2798779","","2010-05-09 15:59:29","11","13472","<p>I have an application that will record and play audio files. Some of the audio files are downloaded using simple standard http downloads using httpclient. It worked like a charm for a long time. Now all of a sudden I cannot play the files I download. It fails with this stack. I store the files on the SDCard and I experience the problem both on a handset and a USB connected device.</p><p>I have checked that the downloaded file is cool on the server, and I can play it without any issues.</p><p>These are the code snippets I use ( I know that recordingFile is a valid path for the file).</p><pre><code>    // inside the activity class    private void playRecording() throws IOException{        File recordingFile = new File(recordingFileName);        FileInputStream recordingInputStream = new FileInputStream(recordingFile);         audioMediaPlayer.playAudio(recordingInputStream);    }</code></pre><p>Here is the media player code:</p><pre><code>    // inside my media player class which handles the recordings    public void playAudio(FileInputStream audioInputStream) throws IOException {        mediaPlayer.reset();        mediaPlayer.setDataSource(audioInputStream.getFD());        mediaPlayer.prepare();        mediaPlayer.start();}</code></pre><p>Here is the exception:</p><pre><code>E/MediaPlayerService(  555): offset errorE/MediaPlayer(  786): Unable to to create media playerW/System.err(  786): java.io.IOException: setDataSourceFD failed.: status=0x80000000W/System.err(  786):    at android.media.MediaPlayer.setDataSource(Native Method)W/System.err(  786):    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:632)W/System.err(  786):    at net.xxx.xxx.AudioMediaPlayer.playAudio(AudioMediaPlayer.java:69)W/System.err(  786):    at net.xxx.xxx.Downloads.playRecording(Downloads.java:299)W/System.err(  786):    at net.xxx.xxx.Downloads.access$0(Downloads.java:294)W/System.err(  786):    at net.xxx.xxx.Downloads$1.onClick(Downloads.java:135)</code></pre><p>I have tried seeking some answer of the offset error, but not really clear what this issue might be.</p><p>PS I download the file with this code:</p><pre><code>    public FileOutputStream executeHttpGet(FileOutputStream fileOutputStream) throws ClientProtocolException, IOException{        try {                 // Execute HTTP Post Request              httpResponse = httpClient.execute(httpPost, localContext);            int status = httpResponse.getStatusLine().getStatusCode();            // we assume that the response body contains the error message            if (status != HttpStatus.SC_OK) {                ByteArrayOutputStream ostream = new ByteArrayOutputStream();                httpResponse.getEntity().writeTo(ostream);                fileOutputStream = null;            } else {                InputStream content = httpResponse.getEntity().getContent();                byte[] buffer = new byte[1024];                int len = 0;                while ( (len = content.read(buffer)) &gt; 0 ) {                    fileOutputStream.write(buffer,0, len);                }                fileOutputStream.close();                content.close(); // this will also close the connection            }        } catch (ClientProtocolException e1) {              // TODO Auto-generated catch block             e1.printStackTrace();            fileOutputStream = null;        } catch (IOException e2) {              // TODO Auto-generated catch block              e2.printStackTrace();            fileOutputStream = null;        }        return fileOutputStream;    }</code></pre>","334064","","334064","","2010-05-09 16:56:49","2011-10-13 12:55:11","Android Mediaplayer: setDataSource issue for downloaded media file","<android><audio><media-player><sd-card>","2","0","0","",""
"2798423","1","","","2010-05-09 17:01:14","2","1204","<p>The following problem seems unique to 2.1, happens both on an emulator and on a nexus. The same example works fine on other platforms I've tested (<code>1.5, 1.6 and 2.0 emulators</code>).</p><p>I've added created gestureListener as described in <a href=""http://stackoverflow.com/questions/937313/android-basic-gesture-detection"">this post</a>.The difference is that I've added the listener on a TextView which also has a contextMenu registered, i.e. sth like the following:</p><pre><code> onCreate(...) {     ...     // Layout contains a large TextView on which I want to add a context menu     tv = findViewById(R.id.text_view);     tv.registerForContextMenu(this);     // create the gestureListener according above mentioned post.     gestureListener = ...     // set the listener on the text-view     tv.setOnTouchListener(gestureListener);     ...}</code></pre><p>When testing it, the correct gesture is recognized alright, but every other time it also causes the context menu to be opened. As the same example is working on non 2.1 platforms, I've got a feeling it is not my code that is the problem...</p><p>Thankful for any suggestions.</p><p>Update:Seems that the return value is flipped somewhere. If I let onFling() return the ""wrong"" value, i.e. true when the event is skipped and false when it was consumed, it works correctly in 2.1. But of course, that doesn't work on the other platforms. Seems like its time for an ugly workaround...</p>","311681","","750613","","2012-07-09 11:55:57","2012-07-09 11:55:57","Android 2.1 fling gesture captured on textview but still a contextmenu opens","<android><contextmenu><gesture-recognition><gesture>","1","1","","",""
"2798443","1","2798449","","2010-05-09 17:07:07","22","39653","<p>I'm trying to create a ProgressDialog for an Android-App (just a simple one showing the user that stuff is happening, no buttons or anything) but I can't get it right. I've been through forums and tutorials as well as the Sample-Code that comes with the SDK, but to no avail.</p><p>This is what I got:</p><pre><code>    btnSubmit.setOnClickListener(new View.OnClickListener() {      public void onClick(View view) {        (...)          ProgressDialog pd = new ProgressDialog(MyApp.this);          pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);          pd.setMessage(""Working..."");          pd.setIndeterminate(true);          pd.setCancelable(false);          // now fetch the results          (...long time calculations here...)          // remove progress dialog          pd.dismiss();</code></pre><p>I've also tried adding <code>pd.show();</code> and messed around with the parameter in <code>new ProgressDialog</code> resulting in nothing at all (except errors that the chosen parameter won't work), meaning: the ProgressDialog won't ever show up. The app just keeps running as if I never added the dialog.</p><p>I don't know if I'm creating the dialog at the right place, I moved it around a bit but that, too, didnt't help. Maybe I'm in the wrong context? The above code is inside <code>private ViewGroup _createInputForm()</code> in <code>MyApp</code>.</p><p>Any hint is appreciated,</p><p>Greetings,Select0r</p>","255905","","","","","2012-08-27 07:59:47","Android: ProgressDialog doesn't show","<android><context><progressdialog>","4","0","11","",""
"2798480","1","2798553","","2010-05-09 17:21:37","3","283","<p>I'm using the built in sqlite library on the Android platform.</p><p>I'm considering adding several general purpose fields that users will be able to use for their own custom applications, but these fields will be blank most of the time.</p><p>My question is, how much overhead will these blank fields add to my database?  Do null fields even take up per record memory in sqlite?  If so, how much?  I don't quite understand the inner workings of a sqlite database.</p>","131871","","","","","2010-05-09 17:49:14","Do null SQLite Data fields take up extra memory?","<java><android><database-design><sqlite>","1","0","","",""
"2798539","1","2953913","","2010-05-09 17:45:27","1","1392","<p>Whenever I have an EditText field in my android application, it is highlighted with the blinking cursor for input as soon as the activity is started (<code>though the keyboard doesn't pop up</code>). How can I disable this?</p>","118241","","750613","","2012-07-09 11:55:05","2012-07-09 11:55:05","EditText selects by default?","<java><android><edittext>","2","0","","",""
"2798710","1","2798743","","2010-05-09 18:41:13","1","1173","<p>I am trying to modify this example:</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a> </p><p>But instead of displaying images that are resources, I want to display Drawables that I currently am storing in a List.</p><p>Can anyone instruct me on how I would modify </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>To display my drawable items instead?</p><p>Thanks!</p>","314994","","54680","","2010-05-10 02:43:06","2010-05-10 02:43:06","Display a gallery of images that are stored as Drawables in a List","<android>","1","0","","",""
"2798739","1","","","2010-05-09 18:48:09","0","144","<p>I am trying to design a sqlite database that will store notes.  Each of these notes will have common fields like title, due date, details, priority, and completed.</p><p>In addition though, I would like to add data for more specialized notes like price for shopping list items and author/publisher data for books.</p><p>I also want to have a few general purpose fields that users can fill with whatever text data they want.</p><p>How can I design my database table in this case?</p><p>I could just have a field for each piece of data for every note, but that would waste a lot of fields and I'd like to have other options and suggestions.</p>","131871","","","","","2010-07-06 17:20:51","How to add user customized data to database?","<sql><android><database-design><sqlite>","4","0","","",""
"2798756","1","2798784","","2010-05-09 18:53:06","7","5987","<p>I'm trying to make a basic application that displays an image from the camera, but I when I try to load the .jpg in from the sdcard with <code>BitmapFactory.decodeFile</code>, it returns null.</p><p>It doesn't give an out of memory error which I find strange, but the exact same code works fine on smaller images.</p><p>How does the generic gallery display huge pictures from the camera with so little memory?</p>","118241","","750613","","2012-07-09 11:54:13","2013-07-26 04:37:12","Load large images into Bitmap?","<android><bitmap><jpeg><image>","5","0","3","",""
"2798761","1","","","2010-05-09 18:54:22","1","533","<p>I have an app that displays an an image in an ImageView using the setImageDrawable(Drawable) method.  However, with the release of the Droid Incredible the images are coming up as a blank screen.  I am using <code>Drawable.createFromPath(Environment.getExternalStorageDirectory() + ""\\imagefile"")</code> to access the image from the SD card.  I don't get any sort of error, just a black screen.  I will get a null pointer exception if after trying to load the image I try to access a property of the Drawable.  This makes me believe that the <code>Drawable</code> wasn't loaded, but I don't know why or how to make it work.  </p><p>This code as been working on all other Android devices, so I'm not sure what is different with the Incredible.  </p><p>Unfortunately I don't have access to an Incredible to test on, so I've got to rely on others to test and send me the log files.  Any help you can offer would be greatly appreciated.  If anyone knows how to replicate this issue on the emulator, that would be helpful too.  I've configured an emulator with firmware 7 and the correct screen resolution, but I was unable to replicate the issue.</p>","336769","","213269","","2010-12-21 14:25:59","2010-12-21 14:25:59","HTC Incredible displaying blank ImageView","<android><android-emulator><imageview><sd-card>","2","1","","",""
"2799097","1","","","2010-05-09 20:40:29","88","24573","<p>I would like to have my code run slightly differently when running on the emulator than when running on a device. (<strong>For example</strong>, using 10.0.2.2 instead of a public URL to run against a development server automatically.) What is the best way to detect when an Android application is running in the emulator?</p>","1031","","750613","","2012-07-09 11:52:45","2014-04-07 23:05:39","How can I detect when an Android application is running in the emulator?","<android><android-emulator>","23","2","39","",""
"2799119","1","2799179","","2010-05-09 20:48:07","6","12389","<p>I've rolled my own custom view and can draw to the screen alright, but what I'd really like to do is set the measuredHeigh of the screen to, say, 1000px and let the user scroll on the Y axis, but I'm having problems doing this.  Can anyone help?  </p><p>Here's some code:</p><pre><code>public class TestScreen extends Activity  {     CustomDrawableView mCustomDrawableView;     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);             mCustomDrawableView = new CustomDrawableView(this);         setContentView(mCustomDrawableView);     } }</code></pre><p>and </p><pre><code>public class CustomDrawableView extends View {    public CustomDrawableView(Context context) {        super(context);        setVerticalScrollBarEnabled(true);        setMinimumHeight(1000);    }    @Override    protected void onDraw(Canvas canvas) {        canvas.drawLine(...);        // more drawing    }}</code></pre><p>I've tried to override scrollTo, scrollBy, awakenScrollBars etc with a call to super but to no avail.  Am I missing something silly, or am I making some fundamental mistake?</p><p>Thank you in advance,</p><p>Martyn</p><p>Addition:</p><p>I've tried to add this as a custom component with the below layout file and changed the code in <code>TestScreen</code> to point at the correct resource with <code>setContentView(R.layout.exampleLayout)</code>, but this causes the emulator to crash. I tried commenting the code down to the bare minimum and it still crashes, so there's something fundamentally wrong that I'm doing but I'm not sure what it 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=""wrap_content""       android:layout_height=""wrap_content""&gt;       &lt;ScrollView android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;            &lt;com.martyn.testApp.CustomDrawableView               android:layout_width=""fill_parent""               android:layout_height=""fill_parent""             /&gt;       &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","264276","","264276","","2010-05-09 21:33:59","2011-03-17 20:19:11","Android: make a scrollable custom view","<android><view>","2","0","","",""
"2799152","1","2799177","","2010-05-09 20:57:09","4","306","<p>Well.. the title is pretty descriptive, I have a bunch of tab activities (which I implemented myself, didn't want to use the tabviews with activities inside them), so It's basically 5 activities calling each other every time the user clicks on the tabs displayed as a row of LinearLayouts at the bottom of the screen.</p><p>The thing is that the way I do it now, everytime the user jumps from one activity to another, a new activity is created and launched. Of course, I can see I'm wasting resources this way. So what I would like to do is to create every activity only once; and then if the user wants to go back to the previous (or any one that was already created and is probably paused) just check on some kind of list or array to see if the activity can be recovered and only in the case it can't; to lauch a new one.</p><p>My question is, how can I check this? should I save the intents? and how to recover the activities afterwards? I'm kind of new with java.</p><p>GreetingsNelson R. Perez</p>","274434","","","","","2010-05-09 21:03:43","I need to recover an instance of an activity","<java><android><serialization><activity>","2","0","1","",""
"2799180","1","","","2010-05-09 21:04:28","2","39981","<p>I try to make several connection in a class and update the multiple progressbar in the main screen. </p><p>But I've got the following error trying to use thread in android : Code: 05-06 13:13:11.092: ERROR/ConnectionManager(22854): ERROR:Can't create handler inside thread that has not called Looper.prepare() </p><p>Here is a small part of my code in the main Activity </p><pre><code>public class Act_Main extends ListActivity {  private ConnectionManager cm;  public void onCreate(Bundle savedInstanceState)  {       super.onCreate(savedInstanceState);       // Set up the window layout       requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);       setContentView(R.layout.main);       getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);  }  public void startConnection()  {       //open DB connection       db = new DBAdapter(getApplicationContext());       db.open();       cm = new ConnectionManager(handler, db);       showDialog(DIALOG_PROGRESS_LOGIN);  }  @Override  public void onStart()  {       super.onStart();       startConnection();  }  protected Dialog onCreateDialog(int id)  {       switch (id)       {       case DIALOG_PROGRESS_LOGIN:            progressDialog = new ProgressDialog(Act_Main.this);            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);            progressDialog.setMessage(""Connecting.\nPlease wait..."");            progressThreadLogin = new ProgressThreadLogin();            progressThreadLogin.start();            return progressDialog;       case DIALOG_PROGRESS_NETWORK:            [b]progressDialog = new ProgressDialog(Act_Main.this);[/b]            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);            progressDialog.setMessage(""Loading entire network.\nPlease wait..."");            progressThreadNetwork = new ProgressThreadNetwork();            progressThreadNetwork.start();            return progressDialog;       default:            return null;       }  }  // Define the Handler that receives messages from the thread and update the progress  final Handler handler = new Handler()  {       public void handleMessage(Message msg)       {            int total = msg.getData().getInt(""total"");            int step = msg.getData().getInt(""step"");            Log.d(TAG, ""handleMessage:PROCESSBAR:""+total);            progressDialog.setProgress(total);            if (total &gt;= 100)            {                 switch (step)                 {                      case UPDATE_NETWORK:                           dismissDialog(DIALOG_PROGRESS_LOGIN);                           showDialog(DIALOG_PROGRESS_NETWORK);                           cm.getNetwork();                           break;                                     ....                      default:                           break;                 }            }       }  };  private class ProgressThreadLogin extends Thread  {       ProgressThreadLogin() { }       public void run() { cm.login(); }  }  private class ProgressThreadNetwork extends Thread  {       ProgressThreadNetwork() { }       public void run() { cm.getNetwork(); }  } }</code></pre><p>And my connectionManager class: </p><pre><code>public class ConnectionManager {  public ConnectionManager(Handler handler, DBAdapter db)  {       this.handler = handler;       this.db = db;  }  public void updateProgressBar(int step, int value)  {       if (value == 0)            total = total+1;       else            total = value ;       Message msg = handler.obtainMessage();             Bundle b = new Bundle();             b.putInt(""total"", total);             b.putInt(""step"", step);             msg.setData(b);             handler.handleMessage(msg);  }  public void login()  {             //DO MY LOGIN TASK       updateProgressBar(Act_Main.UPDATE_NETWORK, 100);  }}</code></pre><p>The crash errors occurs on the first line of ""case DIALOG_PROGRESS_NETWORK:"". My first progressbar is hidden but the second one is not displayed. </p><p>I think I've done somthing wrong using the threads and handlers but I dont' know why. </p><p>I was first using handler.sendMessage in place of handler.handleMessage but when I had several task in my connectionManager, the progressbar was updated only at the end of all tasks. </p><p>Thank you in advance for your help</p>","337141","","","","","2011-03-08 10:49:04","Update UI in the main activity through handler in a thread (Android)","<android><multithreading><handler>","3","0","5","",""
"2799217","1","2799252","","2010-05-09 21:20:29","5","3581","<p>I am using an AlertDialog that is very simple, just a custom view with a text box, and the alertdialog positive submit button. I would like to validate that the text box has had text entered before the user dismisses the dialog. I see two possibilities, with questions about each:</p><ul><li>Disable the submit button until thetext box is not empty (in someonChange() type handler for the textbox)<ul><li>How do you know when the content of the text box changes?</li><li>How do you get a reference to the AlertDialog's button object?</li></ul></li><li>Check in the submit button'sonClick() and cancel the dismissingof the dialog if it's empty.<ul><li>Is it possible to do this with an AlertDialog's button? The dialog dismisses without manually calling dismiss() or cancel(), so I'm not sure...</li></ul></li></ul><p>Is either of these options possible with an AlertDialog (vs a custom dialog)?</p><p>I think the second option would be the simplest, but I'm up for either if it's possible.</p>","325011","","","","","2013-09-06 10:14:17","Validating Dialog Input","<android><alertdialog>","3","0","1","",""
"2799220","1","2799324","","2010-05-09 21:21:21","3","572","<p>i have a strange (?) error in my android application. I have defined some arrays in values/arrays.xml the following way:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;array name=""perimeter""&gt;        &lt;item&gt;10 miles&lt;/item&gt;        &lt;item&gt;20 miles&lt;/item&gt;        &lt;item&gt;30 miles&lt;/item&gt;    &lt;/array&gt;    &lt;array name=""regvalues""&gt;        &lt;item&gt;1&lt;/item&gt;        &lt;item&gt;2&lt;/item&gt;        &lt;item&gt;3&lt;/item&gt;    &lt;/array&gt;&lt;/resources&gt;</code></pre><p>Now I want to use them in a ListPreference for a PreferenceActivity (defined by an xml file). So i set <code>android:entries=""@array/perimeter""</code> <code>android:entryValues=""@array/regvalues""</code> for this ListPreference.When I try to use this on my device the app crashes. (NullPointer in Dialog.close()) If I try to use the regvalues-items as Entries for the ListPreference i get a NullPointer in ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 355  </p><p>So there seems to be sth wrong with the regvalues array. But what ?!? Eclipse shows me no errors at compile time. So everything in the xml-file and java-code is written correctly and there are no typos. Where is the problem?!?</p>","317913","","750613","","2012-07-09 11:51:33","2012-07-09 11:51:33","Android: Defined array resource not found?","<android><arrays><resources><preferences><listpreference>","1","0","","",""
"2799225","1","2799429","","2010-05-09 21:23:33","3","5674","<p>I read some documentations about classloaders, but im still not sure where and why they are needed. The Android API says:</p><blockquote>  <p>Loads classes and resources from a  repository. One or more class loaders  are installed at runtime. These are  consulted whenever the runtime system  needs a specific class that is not yet  available in-memory.</p></blockquote><p>So if i understand this correct, there can be many classlaoders which are responsible for loading new classes. But how the system decides which to use? And in which situation should a developer instantiate a new classloader?</p><p>In the Android API for Intent there is a method</p><pre><code>public void  setExtrasClassLoader  (ClassLoader  loader)</code></pre><p>The description says:</p><blockquote>  <p>Sets the ClassLoader that will be used  when unmarshalling any Parcelable  values from the extras of this Intent.</p></blockquote><p>So can i define there a special classloader so that i can pass object with an Intent which are not defined in the receiving activity? An example:</p><p>If activity A which is located in Project A (in Eclipse) defines an object which i want to send to Activity B in Project B using putExtra of the Intent object. If this object which is send over the Intent is not defined (source code in project B), then there is a NoClassDefFoundException. So can i use the method setExtraClassloader to avoid this exception? If yes, how can i decide which classloader object i have to pass? And how do I instantiate it correctly?</p>","","anon","","","","2010-05-17 05:45:23","Correct use of Classloader (especially in Android)","<java><android><classloader>","2","0","1","",""
"2799692","1","2799751","","2010-05-10 00:12:43","3","1925","<p>I have an android phone and am thinking of a project in which I will need to modify the operating system and reinstall it to the phone. Is this possible to do so? Can i be sure my phone is not gonna give up on me?</p><p>Thanks.</p>","286806","","","","","2010-05-10 00:35:11","Is it possible to modify Android internals and reinstall the operating system on a phone?","<android><mobile><internals>","2","2","","",""
"2799761","1","2802321","","2010-05-10 00:40:06","1","7588","<p>Android doesn't appear to provide a way for a <a href=""http://stackoverflow.com/questions/1332269/how-to-set-mobile-system-time-and-date-in-android"">user application to change the system time</a>. What I would like to do instead is to get the user to change the time. It is easy to open up the Date &amp; Time settings:</p><pre><code>startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));</code></pre><p>What I would like to know is:</p><ol><li>Is it possible to link directly to the set time option?</li><li>Is it possible to check that the user set the time correctly? I am aware of the <code>TIME_CHANGED</code> broadcast message, but I can't find any documentation on it</li></ol><p><strong>Update:</strong></p><p>The TIME_CHANGED broadcast message doesn't provide any information about how it changed. This isn't explicitly documented, but I tried <code>getData</code> and <code>getExtras</code> and received no information. Additionally, looking at the rest of the <a href=""http://stackoverflow.com/questions/2808325/documentation-for-extra-in-intents-for-android"">documentation</a> it appears that no data or extras are passed unless explicitly documented. Similarly, it is actually <a href=""http://developer.android.com/reference/android/provider/Settings.html#ACTION_DATE_SETTINGS"" rel=""nofollow"">documented</a> the <code>ACTION_DATE_SETTINGS</code> takes no input and it is implicit that it takes no extras, so there is no way to control it more precisely.</p><p><a href=""http://stackoverflow.com/questions/2799761/making-the-user-change-the-time-in-android/2802321#2802321"">CommonsWare</a> pointed out what should have been obvious to me - that simply checking that the user set the time to the value retrieved from the server, without worrying about the time spent in the options menu, will almost always work. As this assumption could actually be false, if I were using this method, then I would ensure the message said that the time was <em>probably</em> set correctly or incorrectly, rather than using a definite statement.</p><p>However, I discovered <a href=""http://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime%28%29"" rel=""nofollow"">elapsedRealtime</a> and so I will actually implement this detection properly.</p>","165495","","165495","","2010-05-12 23:21:17","2010-05-12 23:21:17","Making the user change the time in Android","<android><time>","1","0","1","",""
"2800004","1","","","2010-05-10 02:22:33","0","2809","<p>I try to have a bitmap moving over my android application. I m be able to have my bitmap behind my text view, but not over them.</p><pre><code>  public void onCreate(Bundle savedInstanceState)...     // ll is a FrameLayout     ll.addView(text1);     ll.addView(text2);     ll.addView(new Panel(this),200,400);</code></pre><p>my Panel class is defined like this :</p><pre><code>    class Panel extends SurfaceView...... @Override        public void onDraw(Canvas canvas) {           canvas.drawColor(0, PorterDuff.Mode.CLEAR);            Bitmap bitmap;            GraphicObject.Coordinates coords;            for (GraphicObject graphic : _graphics) {                bitmap = graphic.getGraphic();                coords = graphic.getCoordinates();                canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);            }        }</code></pre><p>Can you help me ?</p><p>How Can i Draw a transparent bitmap over my views of my application</p><p>Thanks a lot,</p><p>Cheers,</p><p>Victor</p>","468488","","","","","2010-05-10 06:15:15","Transparent View with Android","<java><android><layout><view><transparency>","1","0","","",""
"2800105","1","2800122","","2010-05-10 03:10:56","2","1603","<p>Is this possible in an Android app? I want to make it so that no matter how many times a user starts activityA, when they hit the back button they will never get more than one occurence of activityA.</p><p>What I am finding in my current code is that I have only two options:1. I can call finish() in activityA which will prevent it from being accessible via the back button completely, or2. I do not call finish(), and then if the user starts activityA  (n) times during their usage, there will be (n) instances when hitting the back button. </p><p>Again, I want to have activityA accessible by hitting the back button, but there is no reason to keep multiple instances of the same activity on the stack.  Is there a way to limit the number of instances of an activity in the queue to only 1?</p>","268648","","","","","2010-05-10 03:57:00","How to limit the number of the same Activity on the stack for an Android application","<android>","2","0","2","",""
"2800319","1","2802333","","2010-05-10 04:31:23","3","2189","<p>I am using a VideoView to display a video. I am using setOnPreparedListener and setOnCompletionListener to do stuff before and after the video starts and ends. </p><p>I was wondering how I could go about detecting some point of time in the video. For eg, say I want to write log to a file when the video has played for 10s. How can I detect the 10s mark?</p><p>ThanksChris</p>","321927","","","","","2012-07-14 21:55:58","Android VideoView - Detect point of time in video","<android><listener><videoview>","1","0","2","",""
"2800376","1","","","2010-05-10 04:50:46","1","1199","<p>In my List View, I want to display multiple Icon. Icon1 for list row 1, Icon 2 for list row 2, Icon1 for list row 3.</p>","328480","","","","","2011-03-27 18:53:24","Android: multiple icon in ListView","<android><listview>","2","0","","",""
"2800386","1","2800568","","2010-05-10 04:53:38","12","16168","<p>I am trying to debug the android source using Eclipse by following the instructions found at:</p><p><a href=""http://source.android.com/using-eclipse"">http://source.android.com/using-eclipse</a></p><p>I have downloaded the source, and gotten it to build.  I follow the directions in the link above and everything is fine until I run the ddms command.  At this point, if Eclipse is running I get the error 'Could not open Selected VM debug port (8700)'.  If I close Eclipse, then ddms runs with no problem, and I can the the processes on the emulator.  However, if I now open Eclipse, I get the same error.</p><p>In any case, no matter what I do, if I attempt to remote debug, it always fails with 'Failed to connect to remote VM'.</p><p>Any ideas?</p><p>Thanks</p>","457607","","","","","2014-04-05 11:38:42","Could not open Selected VM debug port (8700)","<android><remote-debugging>","8","3","1","",""
"2800526","1","","","2010-05-10 05:36:33","3","405","<p>Hi I don't want to display the any notification service in status bar if i saw one notification service once .For example i am displaying persons who are exceeding the 20 km distance from my location .some persons are displayed.when i saw it once then automatically the icon in the status bar is don't displayed.For this one give me some suggestions .Thanks in advance.</p>","454808","","","","","2010-05-10 11:33:20","don't display the notification after seeing that once","<android>","2","2","1","",""
"2800728","1","2801966","","2010-05-10 06:27:26","2","2225","<p>I've been working on an Android app in Eclipse, and so far, my program hasn't really grown past midget size.  However I've already run into an issue with an Out of Memory error.  You see, I've been using graphics comprised solely of bitmaps and PNGs in this program, and recently, when I tried to add a little bit more functionality to the program (mainly including a few more bitmaps and causing an extra sprite to be created), it started crashing in the graphics thread's constructor -> sprite's constructor.  When I tracked the problem down, it turned out to be an Out of Memory error that is seemingly caused by adding too many picture files to the program and creating Drawables out of them.</p><p>This would be a problem, as I really don't have that many picture resources worked into that program...maybe 20 or so.  I haven't even started to include sound yet.  These images aren't all that fancy.  My questions are this:</p><p>1) Are programs for the Android phone really that limited on how much memory they can employ, or is it probably something other than the 20-30 resource pictures causing that error?</p><p>2) If the memory for Android apps is so awful it can't even handle 20-30 picture resources being loaded into Drawables that exist at the same time, then how in the world are you supposed to make decent graphics and sound for that thing?</p><p>Thanks.</p>","279112","","","","","2013-09-10 03:31:39","How do I keep from running out of memory on graphics for an Android app?","<android><graphics><memory-management>","5","1","2","",""
"2800878","1","","","2010-05-10 07:02:40","0","480","<p>I want to make soft keyboard background transparent and key buttons semi-transparent.</p>","2624806","","327466","","2011-07-13 16:39:48","2014-03-14 20:52:41","How can I make my custom keyboard transparent?","<android><softkeys>","2","2","","",""
"2800950","1","2801403","","2010-05-10 07:19:20","12","10301","<p>I've heard that pressing the back button will essentially cause the current Activity to <code>finish()</code>. Is this always the case? Seems like it would be with the way it pops the Activity off the stack.</p><p>The one situation I'm not so sure about is when the root Activity in a Task has back pressed. I'm currently experiencing a very weird effect, described as follows:</p><p>On loading my application, the first Activity is for initialization, and once it finishes, it calls my main Activity (a TabActivity). This first init activity has android:noHistory=""true"" set in the Manifest so pressing Back from my main Activity won't go back to that. It goes to the Launcher. When I click on my App in the Launcher a second time, the initialization activity loads again, and loads the main Activity when done. Almost immediately after, it loads a second instance of my main Activity. But ONLY after the Application has already been run once, and was exited by pressing BACK from the main Activity. It does it every subsequent time until I force quit the app or load a new version from the IDE.</p><p>Based on this, I am suspecting some kind of Activity instance is lying around and being reused, since it only happens on the second+ time I run the application (and exit with BACK -- using HOME just returns to the last state of the app, no big deal). Anyone have any thoughts??</p>","325011","","","","","2013-09-15 04:25:51","Does pressing Back always cause Activity to finish()?","<android><activity><lifecycle>","5","0","2","",""
"2801109","1","","","2010-05-10 07:53:12","0","247","<p>i have couple of appz(diffrent apk's), and i run activities from one app to another.my target is to avoid package depndency between them, in case in the future i want to upgrade or compile one package without the absence of another.</p><p>the problem is that: without setting the dependecy between eachother(eclipse: buildpath->projects), i cant fire the intents, i`am getting error:""Unable to start activity component...""</p><p>any idea how can i solve this issue?</p><p>thanks,ray.</p>","260511","","","","","2010-05-10 08:01:46","avoid package dependency","<android>","1","0","","",""
"2801116","1","3036736","","2010-05-10 07:54:55","28","19632","<p>I will try to explain what exactly I need to do.</p><p>I have 3 separate screens say A,B,C. There is another screen called say HomeScreen where all the 3 screens bitmap should be displayed in Gallery view and the user can select in which view does he wants to go. </p><p>I have been able to get the Bitmaps of all the 3 screens and display it in Gallery view by placing all the code in HomeScreen Activity only. Now, this has complicated the code a lot and I will like to simplify it. </p><p>So, can I call another Activity from HomeScreen and do not display it and just get the Bitmap of that screen. For example, say I just call HomeScreen and it calls Activity A,B,C and none of the Activities from A,B,C are displayed. It just gives the Bitmap of that screen by getDrawingCache(). And then we can display those bitmaps in Gallery view in HomeScreen.</p><p>I hope I have explained the problem very clearly.</p><p>Please let me know if this is actually possible.</p>","261566","","1069068","","2013-03-19 14:45:22","2013-10-29 17:39:13","Converting a view to Bitmap without displaying it in Android?","<android><bitmap>","4","3","13","",""
"2801345","1","2801362","","2010-05-10 08:41:53","0","1666","<p>I have a layout xml file named my_layout.xml, in which the root view's layout_width and layout_height has been specified as 200px.</p><pre><code>&lt;com.jlee.demo.MyLayout     xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""horizontal""     android:layout_width=""200px""     android:layout_height=""200px""&gt;</code></pre><p>If I used this xml to be included in another xml, and specify the layout_width and layout_height as 100px. </p><pre><code>&lt;include layout=""@layout/my_layout""     android:layout_width=""100px""     android:layout_height=""100px""/&gt;</code></pre><p>What would be the real width/height of my_layout?</p>","234939","","","","","2010-05-10 08:45:37","Will <include> override the layout_width/layout_height value?","<android>","1","0","","",""
"2801368","1","","","2010-05-10 08:47:05","0","11571","<p>I want to develop an application on android phone regarding voice recorder. I have to record a sound for about 30 seconds and then stop and save the recorded sound in gallery. Can anyone post the code if you have please?</p>","285236","","1055764","","2013-07-29 12:58:21","2013-07-29 12:58:21","Can anyone give code for voice recorder as an application on android phone?","<android><voice><recorder>","5","0","2","",""
"2801584","1","2802361","","2010-05-10 09:27:19","4","6788","<p>Is it possible (without violating any licenses) to write a native C/C++ application on top of the Android OS and make it run as a daemon process?</p><p>There are already several daemon process' running which one can see with the 'ps' command, the legal part concerns me the most. And also the lack of documentation on how to exactly do this.</p><p>For the writing part, I guess one could use basic Linux programming concepts, since Android supports at least to some level the standard Posix API. To make it run as the phone boots, some modifications is of course required in init as well.</p><p>I have no plans to have this app in the Android Market, so installing it manually to the phone is not a problem. As long as it does not require re-compiling the whole OS or kernel.</p><p>I really appreciate all info on this topic, since there's isn't much available.</p><p>Thanks.</p>","337120","","","","","2010-05-10 11:56:13","Android daemon process","<android>","2","1","5","",""
"2801599","1","2801870","","2010-05-10 09:30:22","0","938","<p>I have a ListView and an adapter that sets alternating background colors to the list items overwriting getView Method in my adapter.</p><p>I want to go further and I would to set to each row a Resource background. I try in getView call the method setBackgroundResource:</p><pre><code>private int[] messages = new int[] {R.layout.message,R.layout.message2};//...public View getView(int position, View convertView, ViewGroup parent) {View v = super.getView(position, convertView, parent);int MessagePos = position % messages.length;v.setBackgroundResource(messages[MessagePos]);return v;}</code></pre><p>But this not work, and I the message throws by exception is File res/layout/message.xml from drawable resource ID #0x7f030004</p><p>Any ideas?</p><p>Thanks!</p>","330537","","","","","2010-05-10 10:20:35","Listview with alternating resources in Android","<android><listview><resources><row><alternate>","1","2","","",""
"2801696","1","","","2010-05-10 09:50:24","0","292","<p>i have  5 text views to be added horizontally,and it needs to occupy the displaywidth.When i change the screen orientation,it should change based on it.Is that can be done by Layout or it should be done programmatically</p>","138030","","1069068","","2013-03-19 14:45:08","2013-03-19 14:45:08","How to add the textviews equally in a Row?","<android>","2","0","","",""
"2801719","1","2801857","","2010-05-10 09:53:58","0","2041","<p>I actually had a multiautocompletetextview, where i call host after 3 characters to have a dynamic search list. But if the user put others characters, my code call host for each of them. So it must be very long.</p><p>Could I wait a moment (about 500 ms) before launching the action , in order to look if user do an action or not ? that's possible ? </p>","335500","","","","","2010-05-10 13:42:23","wait t time before launch an action?","<android>","1","0","","",""
"2801832","1","2803615","","2010-05-10 10:14:13","0","488","<p>I have a small Android app and currently I am firing a sql statement in android to get the count of rows in database for a specific where clause.</p><p>Following is my sample code:</p><pre><code>public boolean exists(Balloon balloon) {    if(balloon != null) {        Cursor c = null;        String count_query = ""Select count(*) from balloons where _id = ?"";        try {            c = getReadableDatabase().rawQuery(count_query, new String[] {balloon.getId()});            if (c.getCount() &gt; 0)                return true;        } catch(SQLException e) {            Log.e(""Running Count Query"", e.getMessage());        } finally {            if(c!=null) {                try {                    c.close();                } catch (SQLException e) {}            }        }    }    return false;}</code></pre><p>This method returns me a count 1 even when the database table is actually empty. I am not able to figure out; why that would happen. Running the same query in database gets me a count of 0. </p><p>I was wondering if it's possible to log or see in a log, all the sql queries that eventually get fired on database after parameter substitution; so that I can understand what's going wrong.</p><p>Cheers</p>","57847","","","","","2010-05-10 14:53:00","Logging SQL Statements in Android; fired by application","<database><android><sqlite><logging>","1","1","","",""
"2801864","1","","","2010-05-10 10:19:23","2","3638","<p>I want to call android application on clicking of button on some website from mobile.Suppose I am opening one url on android browser and I want to call my application on clicking on button provided by that site. How to do that??</p><p>Suppose we are using browser other than Chrome then is it allowing??</p>","323062","","323062","","2010-05-10 13:20:47","2010-05-10 13:20:47","How to call android application from web browser","<android>","3","0","3","",""
"2801877","1","","","2010-05-10 10:21:31","2","7236","<p>I have read several forums and examples on using invalidate() in order to update views immediately but I still do not understand why what I am doing will not work. The code below uses image buttons defined by ""red"", ""blue"", ""green"", and ""yellow"". I set a 1 second delay between each time I try and change a button's appearance.  Please someone tell me what i'm doing wrong.</p><pre><code>private void showPattern() {    if (correct == true) {        for (int k = 0; k &lt; temp_basket.length; k++) {            if (temp_basket[k] == 0) {                red.setPressed(true);                red.invalidate();                final Handler handler = new Handler();                Timer t = new Timer();                t.schedule(new TimerTask() {                    public void run() {                        handler.post(new Runnable() {                            public void run() {                                red.setPressed(false);                                red.invalidate();                            }                        });                    }                }, 1000);</code></pre><p>There are 3 more or these blocks after this one that are blue, green, and yellow.</p>","337155","","","","","2010-05-10 14:05:08","(Android) Why won't invalidate() update my buttons immediately?","<android>","2","0","1","",""
"2802415","1","","","2010-05-10 12:07:39","0","500","<p>I'm having a situation in my current project where I want to Download a wallpaper image from network. I want to download the image in chunks and at the same time display whatever image that has been downloaded in a ImageView. Can someone let me know how to implement this?The type of Image that I would be downloading would be ""PNG"".</p>","337214","","","","","2010-05-29 20:32:27","Android : Downloading and Displaying images simulataneously?","<android><image><download>","2","0","","",""
"2802472","1","8548926","","2010-05-10 12:16:01","68","40945","<p>How do you detect the network connection type on Android?</p><p>Is it through <code>ConnectivityManager.getActiveNetworkInfo().getType()</code>, and the answer is limited to Wifi and mobile?</p>","143378","","","","","2013-10-08 09:45:30","Detect network connection type on Android","<android><networking><wifi><connectivity>","5","0","62","",""
"2802528","1","","","2010-05-10 12:23:27","0","1395","<p>I am trying to write a simple android application to toggle a users bluetooth connection.  I would like a single application that can work on all versions of Android 1.5+. </p><p>I am aware that the Android 2+ API officially added support for bluetooth however if I am targeting a SDK level of 3 (android 1.5) then I don't get access to the official BluetoothAdapter classes.</p><p>I have seen some examples on the web that use reflection and this will work on 1.5 and 1.6 but not 2.0. </p><p>I have also seen the following unoffical bluetooth API's however neither of their example apps (available in the market as ""Bluetooth Samples"" and ""backport-android-bluetooth"") work on my Nexus One.</p><p><a href=""http://code.google.com/p/android-bluetooth/"" rel=""nofollow"">http://code.google.com/p/android-bluetooth/</a>http://code.google.com/p/backport-android-bluetooth/</p><p>Does anyone have some sample code that will work on ALL versions of Android?</p><p>I know it is possible to achieve bluetooth toggling in a single app and for versions 1.5+ because there are many applications on the market, that I have tested and are able to achieve this.</p><p>Any help is really appreciated and thanks for reading.</p><p>NOTE: Please don't just suggest writing separate apps targeting different versions, this is not what I am trying to achieve.</p>","334395","","","","","2013-06-28 08:52:52","How to Toggle Bluetooth in All Android Versions 1.5+ and Upwards","<android><bluetooth>","1","6","1","",""
"2802558","1","2802641","","2010-05-10 12:29:02","0","303","<p>I have different elements in my layout: Buttons, RadioButtons, EditText, a ListView and I have made a RelativeLayout that is clickable and starts a new intent. Everything works ok except that I can't select that element with the trackball. Is there any way to achieve this? Thanks in advance.</p>","265375","","265375","","2010-05-10 12:37:00","2010-05-10 12:42:03","Select TextView with trackball","<android><trackball>","1","0","","",""
"2802925","1","","","2010-05-10 13:25:33","2","142","<p>I am trying to develop an app and I want it to bring in data from a <code>mySQL</code> database. But from some reading I have done on different sites, I am realizing that it is probably not going to happen. But I am curious to know, how do apps like PhoneFlix and others view that dynamic data on the application? Does it somehow just bring it in through http? If so, how would I go about doing that?  Does anyone know of any good sites that will point me in the right direction? Thanks</p><p>ezekielweb</p>","337260","","750613","","2012-07-09 12:24:07","2012-07-09 12:24:39","How does android communicate with dynamic services?","<android><mysql>","1","0","1","",""
"2803028","1","2803770","","2010-05-10 13:43:20","1","2515","<p>while scroll the listview, the Layouts background gets flickering. that is the layout is has a background image. this image will gets invisible and reload all the time while scrolling. how to rectify this? Any Idea? </p><p>Note: its happening for inbuilt android Array Adapter too. </p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, list_value));</code></pre>","267269","","","","","2012-10-09 20:41:43","Gets Flickering layout's background while scrolling the listview in android?","<android><listview>","4","0","1","2013-06-25 03:31:47",""
"2803067","1","3087457","","2010-05-10 13:49:53","0","348","<p>I have several apps which I wrote using the standard SDK. They all connect to RFCOMM devices using bluetooth, so at present, I can only support devices which are 2.0 or newer. </p><p>What options are available for backporting a bluetooth app to pre-2.0 apps while re-writing as little code as possible?</p><p>Thank you.</p>","268803","","","","","2012-11-01 03:33:41","RFCOMM Before Android 2.0?","<android><bluetooth><android-ndk><rfcomm>","1","0","","",""
"2803069","1","2803175","","2010-05-10 13:50:08","2","8417","<p>Is there an intent that is fired when a user unlocks their screen?  I want my app to adjust the brightness when the screen turns on, but the problem im running into is that the screen on intent is fired on the lock screen and it does not adjust the display on that screen.</p>","274365","","","","","2013-04-12 14:59:03","android unlock screen intent?","<android><screen><locking><android-intent>","3","0","2","",""
"2803271","1","2804382","","2010-05-10 14:15:41","0","199","<p>Is it possible to check over Bluetooth if Android is running on a mobile phone?</p>","","anon","","","","2010-05-10 16:24:30","Get Mobile Phone OS over Bluetooth","<android><bluetooth><mobile-phones>","2","4","","",""
"2803466","1","2803506","","2010-05-10 14:37:46","3","766","<p>I'm looking to get a device (phone, tablet, etc.) for developing Android applications.  I know I can use the emulator to get me started, but I feel like that will only get me so far along.  I'm looking for something reasonably priced, and I don't want a phone contract, data plan, etc.  Anyone have any suggestions?</p>","142017","","","","","2010-05-10 15:22:50","Android Development Device","<android><mobile-phones>","4","0","","",""
"2803566","1","2805630","","2010-05-10 14:47:23","9","10108","<p>I'm working on an app for Android with a few other people, and the primary content is specified by our designers as text files in a certain file format, which we then parse, process, and serve in the app.  We're currently storing them in <code>res/raw</code>.</p><p>This makes things great for the designers because when they want to add content, they simply add a file to <code>res/raw</code>.  This is annoying as a developer, however, since we developers then need to add <code>R.raw.the_new_file</code> to an array in the code specifying which files to process at startup.</p><p>Is there a way to access the resource ID's of <code>res/raw</code> programatically?  Ideally when the application starts, we could make a call to see which files are in <code>res/raw</code>, process all of them, so we could eliminate the small overhead with matching up the contents of  <code>res/raw</code> with that of our array in the code.</p><p>The most promising path I've seen is <a href=""http://developer.android.com/reference/android/content/res/Resources.html#getAssets()"" rel=""nofollow""><code>getAssets</code></a> from <a href=""http://developer.android.com/reference/android/content/res/Resources.html"" rel=""nofollow"">Resources</a>, which would let me call <a href=""http://developer.android.com/reference/android/content/res/AssetManager.html#list(java.lang.String)"" rel=""nofollow""><code>list(String)</code></a> on the <a href=""http://developer.android.com/reference/android/content/res/AssetManager.html"" rel=""nofollow"">AssetManager</a>, but I've had trouble getting this to work, especially since you can't directly call <code>""res/raw""</code> as your filepath (or at least, it hasn't worked when I've tried.  </p><p>Suggestions?  Thanks</p>","196469","","750613","","2012-07-09 12:23:33","2012-07-09 12:23:33","Accesing contents of res/raw programatically (Android)","<java><android>","3","0","4","",""
"2803762","1","2902778","","2010-05-10 15:11:04","5","3949","<p>I would like to display a <code>DatePicker</code> where the year field would be visible or not, according to a checkbox.</p><p>But I didn't find anything giving me a way to implement it.</p><p>Any idea please ?</p><p>Thanks in advance.</p>","231417","","","","","2013-03-01 01:01:47","Displaying a DatePicker with or without the year field","<android><datepicker>","4","5","","",""
"2804206","1","2804228","","2010-05-10 16:02:09","0","188","<p>I've been using API level 4, and I am moving to level 5. I had a tab widget in my activity. The tabs used to be pretty light greys. After moving to API level 5, they are quite dark. The unselected tabs are almost black! I've tried setting the theme to light, but the colors remain very dark. What is the reason for this?</p>","246114","","63550","","2010-05-12 12:50:31","2010-05-12 12:51:52","Tabs very dark on API level 5, but used to be lighter with API level 4?","<android>","1","1","","",""
"2804317","1","","","2010-05-10 16:14:33","3","3059","<p>I want to use the OpenCV Android porting, that you can find <a href=""http://github.com/billmccord/OpenCV-Android"" rel=""nofollow"">HERE</a>, to make some image transformations for an Augmented Reality application. I've found no problem configuring and building the library, I receive no error and I succed put it within my Android application throght JNI process: the library libopencv.so is in the correct directory ""\libs\armeabi\"" under my project's directory.And now the problems:</p><p>1) First I want to understand what version of the original openCV library this porting derive from. Is important for me know if it derive from version 1.5, 2.0 or 2.1 because same functions are very different and others are absent.</p><p>2) Before starting with real time video manipulation, I'd try make some simple operations on a single image or saved video:</p><p><pre><code>JNIEXPORTjstringJNICALLJava_org_examples_testOpenCV_OpenCV_LoadImage(JNIEnv* env, jobject thiz){    IplImage* imgIn = cvLoadImage(""/sdcard/testimage.jpg"", -1);</p><pre><code>if (!imgIn) return env-&gt;NewStringUTF(""Error"");cvReleaseImage( &amp;imgIn );return env-&gt;NewStringUTF(""Ok"");</code></pre><p>}</pre></code></p><p><pre><code>JNIEXPORTjstringJNICALLJava_balmas_examples_testOpenCV_OpenCV_manageVideo(JNIEnv* env, jobject thiz){     CvCapture* capture = cvCaptureFromFile(""/sdcard/video_galaxyspica_352x288_15fps.3gp"");</p><pre><code>    if (!capture) return env-&gt;NewStringUTF(""Error"");    return env-&gt;NewStringUTF(""Ok"");</code></pre><p>}</pre></code></p><p>In both cases I receive ""Error"". There are no problems with files on the sdcard becouse I try to make this:</p><p><pre><code>FILE* file = fopen(""/sdcard/video_galaxyspica_352x288_15fps.3gp"",""w+"");</p><p>//FILE* file = fopen(""/sdcard/testimage.jpg"",""w+"");</p><pre><code>if (!file) return env-&gt;NewStringUTF(""Error"");else {    fflush(file);    fclose(file);    return env-&gt;NewStringUTF(""OK"");}</code></pre><p></pre></code></p><p>and I receive ""OK"".I realize that there is some problem within highgui library but I don't understand what and wath I should make to avoid the problem.Some suggestions!!!</p><p>Thank you everyone</p>","336094","","398460","","2010-12-02 15:03:43","2010-12-02 15:03:43","Using OpenCV Android porting","<android><opencv><android-ndk><augmented-reality>","1","1","1","",""
"2804375","1","","","2010-05-10 16:23:25","-2","376","<p>I'm searching for android phones that can use video out to the tv for a research project. I'm considering the HTC Touch Pro.</p><p>Is there anything I have to do specifically to get the video out to work (for displaying my app on the tv)? or will the phone just display a running app on the tv without extra work?</p><p>Thanks, I hope the post made sense =)</p>","277782","","","","","2010-05-10 16:36:11","Android phones: how does the video out feature work?","<android><video>","2","0","","",""
"2804411","1","11328176","","2010-05-10 16:28:48","13","15047","<p>How can i put textview with id=""naslov"" to the center? I also tried with layout_gravity=""center"" but that doesn't work either.</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/naslov""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""20dip""    android:text=""Povzetek""    android:gravity=""center""/&gt;   &lt;TextView       android:id=""@+id/aha""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""10dip""    android:text=""Vseh oddaj:""       android:layout_below=""@id/naslov""/&gt;   &lt;/RelativeLayout&gt; </code></pre>","324417","","","","","2013-03-27 04:25:10","Android relative layout problem with gravity","<android><layout>","6","1","3","",""
"2804688","1","2805256","","2010-05-10 17:01:54","15","34513","<p>how to change the color of the text indicator of tab? i can change the icon using selector tag refered the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"">example</a>. but cant to the text color. how? </p>","267269","","267269","","2010-08-21 13:03:01","2013-03-28 11:04:18","how to change the color of the tabs indicator text in android?","<android><tabs><tabwidget>","5","0","13","",""
"2805429","1","2805655","","2010-05-10 18:38:31","0","291","<p>I have an ImageView from which I want to copy a piece of it in the shape of a circle that I can then re-display to the user at a larger than original size to simulate a zoom effect. Would I use bitmaps for that? Thanks.</p>","336520","","13565","","2010-05-18 12:56:19","2011-10-08 18:27:53","Android: grab a piece of an ImageView","<android><image>","1","0","","",""
"2805488","1","","","2010-05-10 18:45:02","0","1188","<p>I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout.</p><pre><code>   &lt;TextView       android:id=""@+id/aha4""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""17dip""    android:text=""Vzdevek:""    android:layout_below=""@id/aha3"" /&gt;       &lt;EditText android:id=""@+id/nick""               android:layout_height=""wrap_content""        android:layout_width=""wrap_content""             android:layout_below=""@id/nivo""        android:layout_toRightOf=""@id/aha4""/&gt;         &lt;Button android:id=""@+id/poslji""            android:text=""Pošlji""            android:layout_height=""wrap_content""            android:layout_width=""20dip""            android:typeface=""serif"" android:textStyle=""bold""            android:layout_alignParentRight=""true""            android:layout_below=""@id/nivo""        android:layout_toRightOf=""@id/nick""/&gt;   </code></pre><p>What i currently get is this:<img src=""http://www.shrani.si/f/1Z/x8/2lWB3f8p/device.png"" alt=""alt text""></p><p>What is the appropriate layout_width for edittext and button?</p>","324417","","","","","2010-10-27 12:36:31","Problem with sizes of EditText and Button in Android","<android><layout>","3","0","","",""
"2805669","1","","","2010-05-10 19:11:30","3","73","<p>A little question about the listing in iPhone OS and some other applications, and possibly in Android Market. When listing the apps, it fills the list in an automatic process, when reaching or is near to reach the end.</p><p>My question is: How is that written in iPhone applications. But the main question is: Is that possible to make for Firefox users with Javascript, Ajax or possibly any other language? Been looking a little bit in documentation but havent found anything useful, maybe I just havent looked enough</p><p><strong>edit:</strong> Found it for Android - <a href=""http://stackoverflow.com/questions/1917773/dynamic-listview-in-android-app"">Dynamic ListView in Android app</a> Still looking for same futures for a Windows browser thoout</p><p><strong>edit2:</strong> im looking to implement it in a website with a list of books + some info.</p>","337587","","750613","","2012-07-09 12:21:04","2012-07-09 12:21:04","Listing like appstore in firefox or any other browser for windows/desktop linux","<android><firefox><list><app-store>","1","0","","",""
"2805767","1","2805788","","2010-05-10 19:24:45","0","1481","<p>I want to offer a webform on my app's website that sends an email to  the provided address, that if opened from a Android device would launch the marketplace on the phone.  I have used the following: </p><p><a href=""http://market.android.com/details?id=package.apk"" rel=""nofollow"">http://market.android.com/details?id=package.apk</a></p><p>It takes me to a loading screen, but I get Sorry, the application Market (process.com.android.vending) has stopped unexpectedly.  Please try again.</p><p>Is this possible?  It seems that it would be due to the marketplace even trying to load???</p><p>Thanks</p>","282789","","750613","","2012-07-09 12:20:26","2012-07-09 12:20:26","Android Marketplace, how would I email a link that would open the Market place from a device?","<android><google-play>","2","0","","",""
"2805866","1","","","2010-05-10 19:38:56","9","6997","<p>In a color picker, I have 3 SeekBars for Hue, Saturation, and Value.  Calling setProgressDrawable on these SeekBars only works once -- at initialization from onCreate.  When the user updates the Hue SeekBar, I want to call setProgressDrawable for the Saturation and Value SeekBars, to show the user their color choices for the new Hue.</p><p>But all calls to setProgressDrawable (after the initial ones from <code>onCreate</code>) cause the SeekBar to be blanked.</p><p>How can I update the background gradient of my SeekBars based upon user input?</p>","337622","","750613","","2012-07-09 12:19:56","2012-07-09 12:19:56","Android ProgressBar.setProgressDrawable only works once?","<android><seekbar>","2","0","7","",""
"2805947","1","","","2010-05-10 19:50:08","0","463","<p>I have understand that the only way to inject KeyEvents in the Android System is to implement an Input Method.</p><p>I have created my IME with the purpose to control from remote the device.</p><p>I emulate the hardware keys using the method <pre><code>private void keyDownUp(int keyEventCode) {        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode));        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_UP, keyEventCode));    }</pre></code>in my class that extends InputMethodService.</p><p>It works fine until an AlertDialog, or the menu of a Spinner comes in foreground. Also the windows that appears when the Menu key is problematic.My IME can't get focus on them, and the keyevents are sent to the activity behind them.</p><p>Using hardware keys, the Dialog get the focus and you can select the botton on the Dialog.How can i emulate that, using the IME(or anything else)?</p>","313874","","","","","2010-05-10 19:50:08","ANDROID. Emulate Hardware Keys with an IME. Doesn't work with Dialog and Spinner","<android>","0","2","","",""
"2805983","1","","","2010-05-10 19:55:30","0","6687","<p>I just started working with the Android, but seem to have come across a problem that I simply can't find the answer to.  I get the error ""Cannot cast from View to Button"" on this line :</p><pre><code>Button myButton = (Button)findViewById(R.id.my_button);</code></pre><p>I've tried many different things to get it going, and I've searched for the answer, but for some reason it just refuses to work right.  If anybody could point me in the right direction it'd be most appreciated.</p><p>Thank in advance.</p>","337630","","750613","","2012-07-09 12:19:07","2013-12-02 10:36:15","Android : Cannot cast from View to Button","<java><android><button><view><casting>","7","2","","",""
"2806045","1","2806068","","2010-05-10 20:03:47","1","1359","<p>This question probably reveals my total lack of knowledge in Java. But let me first show you what I thought was the correct way to declare a ""member field"":</p><pre><code>public class NoteEdit extends Activity {private Object mTitleText;private Object mBodyText;</code></pre><p>I'm following a google's notepad tutorial for android (<a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html"" rel=""nofollow"">here</a>) and they simply said: ""Note that mTitleText and mBodyText are member fields (you need to declare them at the top of the class definition)."" I thought I got it and then realized that this little snippet of code wasn't working.</p><pre><code>if (title != null) {            mTitleText.setText(title);        }        if (body != null) {            mBodyText.setText(body);        }</code></pre><p>So either I didn't set the ""member fields"" correctly which I thought all that was needed was to declare them private Objects at the top of the NoteEdit class or I'm missing something else. Thanks in advance for any help.</p><p><strong>UPDATE</strong></p><p>I was asked to show where these fields were being intialized here is another code snippet hope that it's helpful...</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.note_edit);    Long mRowId;    mTitleText = (EditText) findViewById(R.id.title);    mBodyText = (EditText) findViewById(R.id.body);</code></pre><p>So basically the error that is showing up is coming from eclipse:""The method setText(String) is undefined for the type Object""</p>","317705","","750613","","2012-07-09 12:17:41","2012-07-09 12:17:41","How do I declare ""Member Fields"" in Java?","<java><android>","7","4","","",""
"2806507","1","2806553","","2010-05-10 21:15:15","1","131","<p>I'm working on adding a tab to an application, but the last two tabs (<code>regardless of order</code>) are launching the same activity. If I go down to two tabs they both work correctly, but when I add the third the last two result in the same activity launching. Any suggestions?</p><pre><code>public void uiConnected() {    Log.d(TAG, ""UI Connected"");    tabHost.clearAllTabs();    intent.setClass(this, NowPlayingActivity.class);    spec = tabHost.newTabSpec(""nowplaying"").setIndicator(""Now Playing"").setContent(intent);    tabHost.addTab(spec);    intent.setClass(this, PlaylistActivity.class);    spec = tabHost.newTabSpec(""playlist"").setIndicator(""Playlist"").setContent(intent);    tabHost.addTab(spec);    intent.setClass(this, LibraryActivity.class);    spec = tabHost.newTabSpec(""library"").setIndicator(""Library"").setContent(intent);    tabHost.addTab(spec);    if (MPDApplication.DEBUG) {        tabHost.setCurrentTabByTag(app.sp.getString(AppPreferenceActivity.KEY_APP_LASTTAB, ""playlist""));    } else {        tabHost.setCurrentTabByTag(app.sp.getString(AppPreferenceActivity.KEY_APP_LASTTAB, ""nowplaying""));    }}</code></pre>","302649","","750613","","2012-07-09 12:17:16","2012-07-09 12:17:16","Why are the last two tabs in an android app doing the same thing?","<android><tabs>","1","0","","",""
"2806976","1","2813772","","2010-05-10 22:49:35","5","6692","<p>I am starting with an Activity based off of this <a href=""http://www.clingmarks.com/?paged=2"">ShakeActivity</a> and I want to write some unit tests for it.  I have written some small unit tests for Android activities before but I'm not sure where to start here.  I want to feed the accelerometer some different values and test how the activity responds to it.  For now I'm keeping it simple and just updating a private int counter variable and a TextView when a ""shake"" event happens.  </p><p>So my question largely boils down to this:  </p><p><strong>How can I send fake data to the accelerometer from a unit test?</strong></p>","63155","","","","","2012-07-09 12:16:43","How can I unit test an Android Activity that acts on Accelerometer?","<android><unit-testing><accelerometer>","3","0","1","",""
"2807019","1","2807238","","2010-05-10 22:58:56","1","1284","<p>I'm developing an activity that binds to a local service (in onCreate of the activity):  </p><pre><code>bindService(new Intent(this, CommandService.class), svcConn, BIND_AUTO_CREATE);  </code></pre><p>I would like to be able to call methods through the IBinder in my lifecycle methods, but can not be sure that onServiceConnected have been called prior to these. I'm thinking of handling this by adding a queue of sorts in the ServiceConnection implementation, so that the method calls (Command pattern) will be executed once the connection is established. </p><p><strong>My questions are then</strong>:</p><ol><li>Is this stupid, any better ways? :)</li><li>Are there any specification for which thread will be used to execute the ServiceConnection callbacks? More to the point, do I need to worry about synchronizing a queue datastructure?</li></ol><p>Edit - something like:</p><pre><code>public void onServiceConnected(ComponentName name, IBinder service) {    dispatchService = (DispatchAsync)service;    for(ExecutionTask task : queue){        dispatchService.execute(task.getCommand(), task);    }}</code></pre>","335930","","750613","","2012-07-09 12:15:59","2012-07-09 12:15:59","Thread used for ServiceConnection callback (Android)","<java><android><service><multithreading><serviceconnection>","1","0","","",""
"2807059","1","","","2010-05-10 23:12:52","2","250","<p>It seems that some Android devices like the HTC Incredible and the Archos 5 IT don't need a SD card for storage.</p><p>How should apps that read and write files to ""external"" storage (so far the SD card) deal with this in the most backward and forward compatible way possible?</p><p><strong>Edit</strong>: Getting more reports about devices that use onboard memory as storage, like Pandigital Novel, in which IO operations that work with the SD card fail. Any ideas? Is it a permissions problem?</p>","143378","","143378","","2010-08-04 07:03:19","2010-08-04 07:03:19","Dealing with Android devices that don't need a SD card","<android><storage><sd-card><forward-compatibility>","1","0","1","",""
"2807070","1","11798991","","2010-05-10 23:16:20","35","19687","<p>My goal is to be able to type a one word command and get a screenshot from a rooted Nexus One attached by USB.</p><p>So far, I can get the framebuffer which I believe is a <code>32bit xRGB888</code> raw image by pulling it like this:</p><pre><code>adb pull /dev/graphics/fb0 fb0</code></pre><p>From there though, I'm having a hard time getting it converted to a png. I'm trying with ffmpeg like this:</p><pre><code>ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb8888 -s 480x800 -i fb0 -f image2 -vcodec png image.png</code></pre><p>That creates a lovely purple image that has parts that vaguely resemble the screen, but it's by no means a clean screenshot. </p>","9574","","750613","","2012-07-09 12:15:22","2014-01-07 09:58:35","Screenshot of the Nexus One from adb?","<android><graphics><ffmpeg><screenshot>","13","0","27","",""
"2807197","1","2807291","","2010-05-10 23:44:57","3","3351","<p>I've written an Android app that needs the short timezone name in which the handset is currently located.</p><p>I'm using the following code:</p><pre><code>String timeZone = Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT);</code></pre><p>When running in Chicago, this returns ""CST"".  In New York, ""EST"".  In <a href=""http://maps.google.com/maps?q=48.589598,7.739639&amp;num=1&amp;sll=48.57479,7.734375&amp;sspn=22.132608,36.606445&amp;ie=UTF8&amp;ll=46.830134,6.328125&amp;spn=22.866457,36.606445&amp;z=5"" rel=""nofollow"">Strasbourg, France</a>, it's returning ""HNEC"" (<a href=""http://acronyms.thefreedictionary.com/HNEC"" rel=""nofollow""><em>Heure Normale de l'Europe Centrale</em> in French</a>).</p><p>The timezone in this location is referred to by some as ""Central European Time"" (see Wikipedia's <a href=""http://en.wikipedia.org/wiki/File%3aTime_zones_of_Europe.svg"" rel=""nofollow"">Time zones of Europe</a>).</p><p>I'm passing <code>timeZone</code> off to a third-party system which very much insists on getting ""CET"" (not ""HNEC"").  Is there an API call I can rely on to return the three-letter (and, I think, ""more modern"") short timezone name?</p><p>As my code runs in more and more locations, I'm guessing this problem is going to occur elsewhere, too.</p><p>I'm really hoping to avoid maintaining some sort of map of three-letter to four-letter short timezone names.</p>","116895","","","","","2010-05-11 00:12:56","Get three-letter short timezone name (as opposed to four-letter)?","<java><android><internationalization><timezone>","1","0","1","",""
"2807206","1","2807447","","2010-05-10 23:48:06","0","1536","<p>I have a few questions (so far) with the the LocationManager on Android and GPS in general.. Feel free to answer any number of the questions below, and I appreciate your help in advance! (I noticed this stuff doesn't appear to be documented very well, so hopefully these questions will help others out too!)</p><p>1) I am using the following code, but I think there may be extra fluff in here that I do not need. Can you tell me if I can delete any of this?</p><pre><code>LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);       LocationListener locationListener = new MyLocationListener();lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); LocationProvider locationProvider = lm.getProvider(""gps"");Location currentLocation = lm.getLastKnownLocation(locationProvider.getName());</code></pre><p>2) Is there a way to hold off on the last step (accessing ""getLastKnownLocation"" until after I am sure I have a GPS lock? What happens if this is called and GPS is still looking for signal? </p><p>3) MOST importantly, I want to ensure I have a GPS lock before I proceed to my next method, so is there a way to check to see if GPS is locked on and getLastKnownLocation is up to date?</p><p>4) Is there a way to 'shut down' the GPS listener once it does receive a lock and getLastKnownLocation is updated? I don't see a need to keep this running for my application once I have obtained a lock..</p><p>5) Can you please confirm my assumption that ""getLastKnownLocation"" is updated frequently as the receiver moves?</p><p>6) In my code, I also have a class called ""<strong>MyLocationListener</strong>"" (code below) that I honestly just took from another example.. Is this actually needed? I assume this updates my location manager whenever the location changes, but it sure doesn't appear that there is much to the class itself!</p><pre><code>private class MyLocationListener implements LocationListener     {        @Override        public void onLocationChanged(Location loc) {            if (loc != null) {                //Toast.makeText(getBaseContext(),   ""Location changed : Lat: "" + loc.getLatitude() + "" Lng: "" + loc.getLongitude(), Toast.LENGTH_SHORT).show();            }        }        @Override        public void onProviderDisabled(String provider) {            // TODO Auto-generated method stub        }        @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>","314994","","750613","","2012-07-09 12:15:03","2012-07-09 12:15:03","Various GPS Android Functionality Questions","<android><gps>","1","0","1","",""
"2807253","1","2808061","","2010-05-11 00:01:22","19","12198","<p>I'm really having trouble using the setEmptyView method. I tried it to implement it in GridView and ListView, but both of them didnt work. Here a sample codeblock:</p><pre><code> networkGames = (GridView) baseLayer.findViewById(R.id.all_game_grid_network); networkGames.setBackgroundResource(R.drawable.game_border); networkGames.setSelector(R.drawable.game_active_border); networkGames.setOnItemClickListener(new NetworkGameListener()); networkGames.setEmptyView(View.inflate(baseLayer, R.drawable.no_network_games, null)); networkGames.setAdapter(new NetworkAdapter());</code></pre><p>The network adapter contains no items:</p><pre><code>private class NetworkAdapter extends BaseAdapter {        /* (non-Javadoc)         * @see android.widget.Adapter#getCount()         */        @Override        public int getCount() {            return 0;        }        /* (non-Javadoc)         * @see android.widget.Adapter#getItem(int)         */        @Override        public Object getItem(int position) {            return null;        }        /* (non-Javadoc)         * @see android.widget.Adapter#getItemId(int)         */        @Override        public long getItemId(int position) {            return 0;        }        /* (non-Javadoc)         * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)         */        @Override        public View getView(int position, View convertView, ViewGroup parent) {            return null;        }    }</code></pre><p>I also tried to call networkGames.setAdapter(null), but this doesnt work either. My emtpyView looks like this:</p><pre><code>&lt;LinearLayoutandroid:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView    android:text=""There are currently no network games available. Start a new one.""    android:id=""@+id/TextView01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I really don't know what I'm doing wrong. I also read various tutorials, but none of them metnioned any problems.</p>","329637","","932225","","2012-07-13 09:27:14","2012-10-16 20:56:43","Correct use of setEmtpyView in AdapterView","<android><android-adapterview>","3","0","4","",""
"2807370","1","2919542","","2010-05-11 00:38:46","3","2211","<p>I'm starting with Scala + Android (and using the sbt android plugin). I'm trying to wire a button action to a button without the activity implementing View.OnClickListener.</p><p>The button click fails at runtime because the method cannot be found. The document I'm working through says that I need only declare a public void method taking a View on the action, and use that method name in the layout.</p><p>What have I done wrong?</p><p><strong>MainActivity.scala</strong></p><pre><code>package net.badgerhunt.hwaimport android.app.Activityimport android.os.Bundleimport android.widget.Buttonimport android.view.Viewimport java.util.Dateclass MainActivity extends Activity {  override def onCreate(savedInstanceState: Bundle) = {    super.onCreate(savedInstanceState)    setContentView(R.layout.main)  }  def calculate(button: View): Unit = println(""calculating with %s ..."".format(button))}</code></pre><p><strong>res/layout/main.xml</strong></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:text=""""    android:onClick=""calculate""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;</code></pre><p><strong>the failure onclick</strong></p><pre><code>D/AndroidRuntime(  362): Shutting down VMW/dalvikvm(  362): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  362): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  362): java.lang.IllegalStateException: Could not find a method calculate(View) in the activityE/AndroidRuntime(  362):    at android.view.View$1.onClick(View.java:2020)E/AndroidRuntime(  362):    at android.view.View.performClick(View.java:2364)E/AndroidRuntime(  362):    at android.view.View.onTouchEvent(View.java:4179)E/AndroidRuntime(  362):    at android.widget.TextView.onTouchEvent(TextView.java:6540)E/AndroidRuntime(  362):    at android.view.View.dispatchTouchEvent(View.java:3709)E/AndroidRuntime(  362):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  362):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  362):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)E/AndroidRuntime(  362):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)E/AndroidRuntime(  362):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)E/AndroidRuntime(  362):    at android.app.Activity.dispatchTouchEvent(Activity.java:2061)E/AndroidRuntime(  362):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)E/AndroidRuntime(  362):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)E/AndroidRuntime(  362):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  362):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  362):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(  362):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  362):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  362):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  362):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  362):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  362): Caused by: java.lang.NoSuchMethodException: calculateE/AndroidRuntime(  362):    at java.lang.ClassCache.findMethodByName(ClassCache.java:308)E/AndroidRuntime(  362):    at java.lang.Class.getMethod(Class.java:1014)E/AndroidRuntime(  362):    at android.view.View$1.onClick(View.java:2017)E/AndroidRuntime(  362):    ... 20 more</code></pre><p><em>UPDATE</em></p><p>Thinking that this may have been an error with the sbt android plugin I made doubly sure that the method was present after compilation. Using javap ...</p><pre><code>Compiled from ""MainActivity.scala""public class net.badgerhunt.hwa.MainActivity extends android.app.Activity implements scala.ScalaObject{    public net.badgerhunt.hwa.MainActivity();    public void calculate(android.view.View);    public void onCreate(android.os.Bundle);    public int $tag()       throws java.rmi.RemoteException;}</code></pre>","45525","","45525","","2010-05-12 01:02:16","2012-07-09 12:14:05","Can't find method in the activity","<android><scala><sbt>","1","0","","",""
"2807449","1","","","2010-05-11 01:03:30","1","912","<p>I have a ListView displays information about an object. When I click a ListView Item, I open an Activity that let's me manipulate parameters of the object held in the adapter. These parameters are updated and stored remotely.</p><p>When I return to the ListView (via the back button), I want to update the ListView Item that I clicked originally by requesting the parameter values from the remote server.</p><p>I am currently doing this up updating the entire ListView by clearing it and rebuilding it.</p><p>How do I reference the ListView Item so that I can update the data for that item only?</p><p>Thanks,Jason</p>","312176","","","","","2012-07-09 12:13:15","How to Identify a ListViewItem to Update a Single Row","<android><listview>","2","0","","",""
"2807643","1","2807675","","2010-05-11 02:07:46","0","1489","<p>i want to show this array as a listview in a new screen when a button is clicked.</p><pre><code>ArrayList&lt;String&gt; favorite = new ArrayList&lt;String&gt;();  </code></pre><p>this ListView is a small part of my class. i cant seem to figure out how to implement it with my code (i can figure out how to create a listview in a separate application, and set the onitemclicklistner  just for that listview) i want to display that listview when.</p><pre><code>case R.id.ShowFavButton:</code></pre>","326423","","","","","2010-05-11 02:19:30","Android show listview","<android><listview>","1","0","","",""
"2807879","1","2808562","","2010-05-11 03:19:09","1","2385","<p>I've literally looked everywhere on the net and found very little clarification on how to do this. Pretty much, I have 8 sound files laid out in an array.xml file and I need to play a randomly chosen file ONCE per or onClick or onShake. First off, what technique should I use to achieve this?  ARRAY->RANDOM- </p><blockquote>  <p>STRING->PLAY?  RANDOM INT->PLAY?  RANDOM INT->STRING->PLAY?  Any kind </p></blockquote><p>of direction will help greatly cause I'm almost 3 weeks worth of research into this. </p><p>*NOTE:              MediaPlayer mp = MediaPlayer.create(JelloMan.this,                      R.raw.sound)...is what I'm stuck on being you can't replace the ""R.raw"" part with a string...</p><p>Here is the whole code.</p><pre><code>package com.cyphasignals.jelloman;import java.util.Random;import android.app.Activity;import android.hardware.SensorManager;import android.media.MediaPlayer;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;public class JelloMan extends Activity {/** Called when the activity is first created. */   @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);            private final int NUM_SOUND_FILES = 3;    //Modifier invalid here     private int mfile[] = new mfile[NUM_SOUND_FILES];    //Modifier invalid here and SECOND ""mfile"" is wanting to create a class    private Random rnd = new Random(3);    //Modifier invalid here         mfile[0] = R.raw.sound1;        mfile[1] = R.raw.sound2;        mfile[2] = R.raw.sound3;    int sndToPlay = rnd.nextInt(NUM_SOUND_FILES);   ShakeListener MyShake = new ShakeListener((SensorManager) getSystemService(SENSOR_SERVICE));     MyShake.setForceThreshHold(4.0);     MyShake.setOnShakeListener(new ShakeListener.OnShakeListener() {        MediaPlayer mp = MediaPlayer.create(JelloMan.this, mfile[sndToPlay]);        //[sndToPlay] wants me to change the modifier         public void onShake() {             mp.seekTo(0);             mp.start();                          }     });    ImageButton mouthbutton = (ImageButton)findViewById(R.id.billmouth);    mouthbutton.setOnClickListener(new OnClickListener() {        MediaPlayer mp = MediaPlayer.create(JelloMan.this,                 mfile[sndToPlay]);            //[sndToPlay] wants me to change the modifier        public void onClick(View v) {            mp.seekTo(0);            mp.start();             }    });} @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event)  {    if (keyCode == KeyEvent.KEYCODE_BACK) {        finish();        return true;    };    return false;}</code></pre><p>}</p>","337865","","337865","","2010-05-12 05:06:35","2011-01-02 02:16:26","Randomly generate sound from onClick and onShake events?","<android><arrays><random><audio><generate>","3","0","","",""
"2807998","1","","","2010-05-11 04:05:22","4","1547","<p>Does anyone know what will be a good library for computing linear algebra in Android (SVD, QR, LU, least-squares, inverse, etc) ?</p>","337889","","","","","2013-09-10 17:37:37","Linear Algebra Library For Android","<android><math><mathematical-optimization>","3","0","","",""
"2808063","1","","","2010-05-11 04:25:52","0","2329","<p>How do you accurately compensate gravity such that I can know the magnitude of the acceleration due to my hand movement in the x-y-z component using the accelerometer data ?</p>","337889","","","","","2010-05-11 04:25:52","Android Accelerometer Gravity Compensation","<android><physics><game-physics>","0","2","","",""
"2808127","1","","","2010-05-11 04:42:59","1","3884","<p>I want to call android application from JavaScript.</p>","323062","","","","","2010-05-17 00:09:57","How to call android application from javascript","<android>","1","0","2","",""
"2808157","1","2808193","","2010-05-11 04:51:24","1","2144","<p>I'm trying to make a widget to my app, but it doesnt update.I just need to change the textview text and open an activity when a press a button, but none of them works...</p><ul><li>the code </li></ul><p>public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {</p><pre><code>    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget);    views.setTextViewText(R.id.tvNews, ""prueba1"");    views.setString(R.id.tvNews, ""setText"", ""prueba3"");    Intent intent = new Intent(context, DoctorChatAndroid.class);    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);    views.setOnClickPendingIntent(R.id.ibNext, pendingIntent);    for (int i = 0; i &lt; appWidgetIds.length; i++) {        appWidgetManager.updateAppWidget(i, views);    }</code></pre><ul><li>the layout</li></ul><p></p><pre><code>&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;    &lt;ImageButton        android:id=""@+id/ibNext""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_media_ff""        android:layout_alignParentRight=""true""/&gt;    &lt;ImageButton        android:id=""@+id/ibLast""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_media_rew""        android:layout_toLeftOf=""@id/ibNext""/&gt;    &lt;TextView        android:id=""@+id/tvNews""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/nwNoNewAnswer""        android:layout_toLeftOf=""@id/ibLast""/&gt;&lt;/RelativeLayout&gt;</code></pre><ul><li>the other xml</li></ul><p>.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""    android:minWidth=""294dp""    android:minHeight=""72dp""    android:updatePeriodMillis=""3000""    android:initialLayout=""@layout/newswidget""&gt;&lt;/appwidget-provider&gt;</code></pre><p>thx a lot!!!</p>","269671","","","","","2010-05-11 05:05:53","Android - Custom Widget doesnt update","<android><widget>","1","0","","",""
"2808190","1","","","2010-05-11 05:04:17","1","1168","<p>My Android app is using this code to get the short name of the timezone in which the handset is located.</p><pre><code>String shortDisplayName = Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT);</code></pre><p>For my user in <a href=""http://maps.google.com/maps?q=48.589598,7.739639&amp;num=1&amp;sll=48.57479,7.734375&amp;sspn=22.132608,36.606445&amp;ie=UTF8&amp;ll=46.830134,6.328125&amp;spn=22.866457,36.606445&amp;z=5"" rel=""nofollow"">Strasbourg, France</a>, <code>shortDisplayName</code> is ""HNEC"" (I haven't learned yet exactly which locale is in play).  I'm trying to determine exactly which TimeZone has that short name.  So, I threw together some quick test code:</p><pre><code>String[] ids = TimeZone.getAvailableIDs();Locale[] locales = Locale.getAvailableLocales();for (String id : ids) {    TimeZone timeZone = TimeZone.getTimeZone(id);    int rawOffset = timeZone.getRawOffset();    for (Locale locale : locales) {        String shortDisplayName = timeZone.getDisplayName(false, TimeZone.SHORT, locale);        if (shortDisplayName.equalsIgnoreCase(""HNEC"")) {            System.out.println(id + "" | "" + shortDisplayName + "" | "" + rawOffset);        }    }}</code></pre><p>When I run that code, no lines are printing.  That is, no timezones, using any locale, resolve to a shortname of ""HNEC""?  How can I figure out which TimeZone has a short name of ""HNEC""?</p>","116895","","1268895","","2012-05-01 02:39:59","2012-05-01 02:39:59","How to find the timezone with ""HNEC"" short name?","<java><android><timezone>","0","7","","",""
"2808325","1","2810253","","2010-05-11 05:38:26","3","213","<p>What documentation is there on the extras will be provided with Android intents? </p><p><strong>Update</strong>:</p><p>I did some further investigation. I understand that we can are meant to assume each intent to parses no data or extras unless explicitly documented. Additionally, some, but not all, extras mention which they are applicable to (see the <a href=""http://developer.android.com/reference/android/content/Intent.html#subclasses-direct-list"" rel=""nofollow"">android documentation</a> and search for Standard Extra Data). We are expected to then look at what the intent does (or guess from its name) to understand more clearly what the extra does. Those which don't mention this are expected to be used in a large range of applications.</p>","165495","","165495","","2010-05-12 05:20:50","2010-05-12 05:20:50","Documentation for extra in intents for Android","<android>","1","0","","",""
"2808389","1","","","2010-05-11 06:02:23","3","215","<p>I could not find a Stack Overflow notifier Android app so I am planning on making one.  I hope that my app will serve a similar purpose as the <a href=""https://chrome.google.com/extensions/detail/djioipahfnmmhddmnanoicecpnfomned"" rel=""nofollow"">Stack Overflow Notifier Chrome extension</a>.  This will be my first Android app so I am still unfamiliar with the platform.</p><p>So I currently plan to ask the user to login by bringing up a <code>WebView</code> and then access the <em>Recent Activity</em> page in the background at specific intervals.</p><p><strong>My question:</strong>How can I store the authentication cookie from StackOverflow after the user has logged in through the <code>WebView</code> and then send this cookie in the <code>HttpGet</code> request when accessing the <em>Recent Activity</em> page?</p>","98187","","496830","","2011-12-13 19:49:54","2011-12-13 19:49:54","Creating a Stack Overflow notifier","<android><cookies><notifications><stackoverflow.com>","1","2","1","",""
"2808496","1","8598679","","2010-05-11 06:29:25","3","1910","<p>I have an app which stores co-ordinates. I am using Google maps to show the location to allow full use of the maps app. I am using the intent call and placing the co-ordinates in the q=xxxxxxxxx,xxxxxxxxx part.</p><p>This works, however when Google maps shows the location it often finds a point on the road, sometimes a little distance from the actual co-ordinates. </p><p>Is there a way to get maps to show the actual point?</p>","232565","","","","","2011-12-22 02:03:15","Android Google maps co-ordinates","<android><google-maps>","1","6","","",""
"2808632","1","2808935","","2010-05-11 06:58:46","73","91759","<p>I'm just having trouble with getting my emulator SD card work...I created a new AVD device with a new SD card.</p><p>So how to put data onto it? I found the ""correct"" file to be mountet on Deamon tools, but is currupt or simply not readable... </p><p>It would be great if you have any idea :)</p>","317301","","317301","","2010-05-12 07:28:49","2013-05-21 08:11:42","manually put files to android emulator sd card","<android><emulator><mount><sd-card>","3","1","19","",""
"2808733","1","2808783","","2010-05-11 07:18:29","1","4669","<p>Why <strong>import org.apache.commons.lang.StringUtils</strong> cannot be imported in android by default.</p><p>Do i have to include an external library? Then where can i find that library on the web?</p><pre><code>package com.myapps.urlencoding;import android.app.Activity;import org.apache.commons.lang.StringUtils;public class EncodeIdUtil extends Activity {    /** Called when the activity is first created. */     private static Long multiplier=Long.parseLong(""1zzzz"",36);        /**         * Encodes the id.         * @param id the id to encode         * @return encoded string         */        public static String encode(Long id) {            return StringUtils.reverse(Long.toString((id*multiplier), 35));        }        /**         * Decodes the encoded id.         * @param encodedId the encodedId to decode         * @return the Id         * @throws IllegalArgumentException if encodedId is not a validly encoded id.         */        public static Long decode(String encodedId)             throws IllegalArgumentException {            long product;            try {                product = Long.parseLong(StringUtils.reverse(encodedId), 35);            } catch (Exception e) {                throw new IllegalArgumentException();            }            if ( 0 != product % multiplier || product &lt; 0) {                throw new IllegalArgumentException();            }            return product/multiplier;        }}</code></pre>","2355649","","21234","","2010-05-11 07:30:45","2012-08-24 14:26:11","Why StrinUtils Apache class is not recognized in android?","<android>","2","1","","",""
"2808793","1","2808963","","2010-05-11 07:29:33","4","3082","<p>I have a java code to read XML nodes, I want to add in the addition and want to read the parent node value also.</p><p>my XML file  sample is below:</p><pre><code> &lt;breakfast_menu&gt;&lt;food id=1&gt;&lt;name&gt; Belgian Waffles &lt;/name&gt;&lt;price&gt; $5.95 &lt;/price&gt;&lt;description&gt; two of our famous Belgian Waffles with plenty of real maple syrup &lt;/description&gt;&lt;calories&gt; 650 &lt;/calories&gt;&lt;/food&gt;&lt;food id=2&gt;&lt;name&gt;Strawberry Belgian waffles&lt;/name&gt;&lt;price&gt;$7.95&lt;/price&gt;&lt;description&gt;light Belgian waffles covered with strawberries and whipped cream&lt;/description&gt;&lt;calories&gt;900&lt;/calories&gt;&lt;/food&gt;&lt;/breakfast_menu&gt;</code></pre><p>and my code for parsing xml is :</p><pre><code>public static String getProductItem(String pid, String item) {    try {        url = new URL("""");        urlConnection = url.openConnection();    } catch (MalformedURLException e) {        e.printStackTrace();    } catch (IOException e) {    }    try {        dBuilder = dbFactory.newDocumentBuilder();    } catch (ParserConfigurationException e) {    }    try {        doc = dBuilder.parse(urlConnection.getInputStream());    } catch (SAXException e) {    } catch (IOException e) {    }    doc.getDocumentElement().normalize();    NodeList nList = doc.getElementsByTagName(""food"");    for (int temp = 0; temp &lt; nList.getLength(); temp++) {        Node nNode = nList.item(temp);        if (nNode.getNodeType() == Node.ELEMENT_NODE) {            Element eElement = (Element) nNode;                data = getTagValue(item, eElement);        }    }    doc = null;    dBuilder = null;    return data;}private static String getTagValue(String sTag, Element eElement) {    NodeList nlList = eElement.getElementsByTagName(sTag).item(0)    .getChildNodes();    Node nValue = (Node) nlList.item(0);    return nValue.getNodeValue();}</code></pre><p>What I want to do is to read the ""id"" value of food, so if if I am searching for a food, it only checks those food nodes, whose id matched the food node id.</p><p>if I read by tag id, it reads all tags not specifically one tag. How to achieve it?</p>","328518","","229410","","2012-12-01 08:48:21","2012-12-05 23:18:04","How to read XML parent node tag value in android","<android><android-xml>","3","1","3","",""
"2808796","1","4812421","","2010-05-11 07:30:04","159","47675","<p>I am a newbie to Android. I read the Android Documentation. Can anyone tell me what a ""Pending Intent"" is?</p>","138030","","2020956","","2014-02-26 11:18:27","2014-03-11 06:38:37","What is Pending Intent?","<android>","7","0","57","",""
"2808811","1","2809043","","2010-05-11 07:34:48","4","1524","<p>I looked over SensorManager and was still unsure, how do I detect if the phone is looking at true north (or any other direction for that matter). </p>","211983","","","","","2010-05-11 08:22:19","Determining north using the android phone","<android><compass-geolocation><sensor>","1","1","1","",""
"2808865","1","","","2010-05-11 07:44:23","3","1104","<p>I'm trying to read all the contacts stored in the phone using thiscode:</p><p>Cursor cursorNumber =context.getContentResolver().query( Contacts.Phones.CONTENT_URI,                                        new String[]{ Contacts.Phones._ID, Contacts.Phones.NAME,Contacts.Phones.NUMBER }, null, null, null );</p><p>but the result seems empty until the moment I sync the contacts withGoogle. Is that possible? Is it a limitation of Google Contacts API? </p>","338009","","","","","2012-08-16 10:16:32","Reading contacts","<android>","3","0","1","",""
"2808894","1","","","2010-05-11 07:51:40","1","327","<p>I would like to build an application that caters for multiple accounts (eg. home, work) and account types (e.g. ISP, VoIP, Mobile). Essentially, I would like to get the user to create the accounts they want and then have all the accounts listed on the start page grouped by type. For example:</p><p>ISP: - Home - Work</p><p>Mobile: - Mum - Dad</p><p>When you click on the account, it would take you to another screen where I do a bunch of calcs and display the results.</p><p>I currently do this via multiple apps but am looking at consolidating into the one app. I am just not sure where to start or how I go about achieving this? The way the Contacts app works is a good example of what I am wanting to do.</p>","330368","","","","","2010-05-11 11:39:41","Handling multiple accounts in Android app","<android>","1","0","","",""
"2809007","1","2809185","","2010-05-11 08:13:27","1","889","<p>I want to know how to get the ringtone,audio files in the device and I want set them as alarm. How to do it?</p><p>I am working in the code to set the alarm and I want to know how to retreive audio or ringtones from the device.</p>","138030","","63550","","2010-05-13 15:31:30","2010-05-13 15:31:30","How do I retrieve files or audio files programmatically from the device?","<android>","1","0","","",""
"2809062","1","2809180","","2010-05-11 08:25:51","0","162","<p>I have a problem, I have a custom ListVie, inside each row I have a TextView and other things. Inside the the TextView I have a Spannable text with a url open behaviour. My problem is I have a itemClick event for the listview too. If I activate de LinkMovementMethod for the textView, the itemclick event dont work. </p><p>Any solution? work arround?</p><p>Thanks,</p><p>flipper83</p>","338037","","","","","2010-05-11 08:44:46","Android: Problem with SpanableString and ListView","<android>","1","0","","",""
"2809147","1","2809376","","2010-05-11 08:39:51","4","111","<p>Our open source application is quite popular, and we are many developers.<br>The app uses my Android Market account, and I shared the keys with a developer.</p><p>But if both of us disappear, the application's Market account will be lost, and all users trapped.<br>Giving the keys to all developers is not a solution either, for security reasons.</p><p>Is there a foundation (like in Mozilla Foundation or Apache Foundation) that could accept to hold our Android Market account and release new versions in accordance with their own guidelines and our community consensus?</p><p>There are quite a lot of <a href=""http://en.wikipedia.org/wiki/Category:Open_source_project_foundations"" rel=""nofollow"">Open Source foundations</a>, but I could not find any that tackles this particular aspect of Android applications.</p>","226958","","","","","2010-05-12 01:05:00","Any foundation to administrate an Android open source application?","<android><open-source><project-management>","2","0","1","",""
"2809314","1","","","2010-05-11 09:06:33","3","2612","<p>Is it possible to programmatically restart the phone from a application (service) running on top of the Dalvik VM?</p><p>If the SDK does not provide this functionality, then how about using the NDK and calling some functions provided by the kernel? I know this option is not preferred (not stable enough libs), but if it's the only option, I'll have to consider that as well.</p>","337120","","181412","","2010-05-12 22:09:45","2012-10-25 12:23:26","Is it possible to restart the phone with Android SDK or NDK?","<android><android-ndk>","3","3","","",""
"2809531","1","2809579","","2010-05-11 09:39:59","4","1751","<p>The answer could be subjective. The answer could be intuition. And I guess the answer could be found from the traditional modal versus non-modal debates. </p><p>But in general how do you generally decide which one to go for? What are their use cases?</p><p>Thanks.</p>","236128","","","","","2010-05-11 09:46:52","Toast versus Dialog boxes: which to use when?","<android><dialog><modal-dialog><toast><non-modal>","1","0","","",""
"2809556","1","2810069","","2010-05-11 09:43:26","2","1996","<p>How do I get my contact card/id of a Android phone? eg: the owner of the phone</p>","243782","","","","","2011-10-19 09:04:12","How to get my contact card/id on Android?","<android><android-sdk-2.1>","2","0","","",""
"2809676","1","","","2010-05-11 10:02:00","1","810","<p>I have an app through which I can make a call to a number. What I wantis to send  Number ( 0-9 ) to receiver when talking. Can any one help me?</p>","338130","","","","","2010-05-11 10:02:00","Android Send Key Event When Calling","<android><key><keyevent>","0","1","","",""
"2809699","1","2856197","","2010-05-11 10:06:02","4","443","<p>I'm in the middle of development of a client-server ""socializing"" that is supposed to run on several mobile devices. The project is pretty complex, involving networking, exchanging media, using geolocation services, and nice user UI.</p><p>In terms of development efforts, technical risks and extensibility what is the best platform to start with? Taking into the account that the goal is go ""live"" as fast as possible with the mobile version. And second goal is to cover most users (but first is more important). </p><p>iPhone (iPod iPad)AndroidBlackBerryJava ME,Symbian</p><p>I realize that there are limitations on every platform, and there are different aspects to take into the account (for example iPhone has better developer's community then Android, J2ME runs in a terrible sandbox but covers most devices).</p><p>Please share your pros and cons. I have the experience only with J2ME, unfortunately I can't evaluate other platforms.</p>","244888","","","","","2010-06-21 03:09:08","Dev efforts for different mobile platforms","<iphone><android><blackberry><java-me><symbian>","7","1","1","",""
"2809733","1","","","2010-05-11 10:10:34","2","260","<p>i have created custom list view using </p><pre><code>class EfficientAdapter extends BaseAdapter implements{private LayoutInflater mInflater;        private Context context;        public EfficientAdapter(Context context) {            mInflater = LayoutInflater.from(context);            this.context = context;        }        public View getView(final int position, View convertView,                ViewGroup parent) {            ViewHolder holder;            convertView = mInflater.inflate(R.layout.adaptor_content, null);convertView.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {}            });}and other necessary methods... also}</code></pre><p>using touch screen when i click on list item OnClickListener of list item is called.</p><p>but when i use Mouse Boll / Track Boll (Phone Hardware) to click on ListItem OnClickListener of list item is not called.</p><p>can any one guide me is this Phone bug or My Fault?</p><p>any help would be appriciated.</p>","249991","","249991","","2010-05-11 10:20:37","2010-05-11 12:06:19","HTC Hero Mouse BOll click not working on Custom ListView?","<android><listview>","2","0","","",""
"2809908","1","5026467","","2010-05-11 10:36:25","4","1280","<p>Just a quick question as Google isn't throwing up much.</p><p>Is it possible to create a VPN connection using native code inAndroid?</p><p>And if so does the VPN offer support for keep alives?</p>","243999","","","","","2011-05-05 04:38:26","Android - VPN at the native layer","<android><vpn><android-ndk><keep-alive>","2","1","1","",""
"2809961","1","2935128","","2010-05-11 10:44:11","2","1417","<p>Hey Guys,analogue to this one (http://stackoverflow.com/questions/2788345/replacing-xml-in-file-from-document-in-java or <a href=""http://www.exampledepot.com/egs/javax.xml.transform/WriteDom.html"" rel=""nofollow"">http://www.exampledepot.com/egs/javax.xml.transform/WriteDom.html</a>) I try to use it under Android...</p><p>The problem is, that I can't use the suggested solution under android, because it throws java.lang.verifyError...</p><p>After reading a little bit, I found out, that the class that was used to store the data to file, is not usable in android...</p><p>can you suggest another solution, which is similar easy to use?</p>","317301","","508666","","2013-11-03 18:05:37","2013-11-03 18:05:37","Android: DOM-Model to XML","<android><xml>","3","0","0","",""
"2809998","1","","","2010-05-11 10:51:25","1","637","<p>I have Button and TextView in my ListView , and I would add listener on button but I can't do it.</p><p>Actually I have in my adapter : </p><p>[code]</p><pre><code>        imgClassement.setImageResource(drawable);        imgClassement.setTag(mail);        imgClassement.setOnClickListener(new OnClickListener(){         @Override         public void onClick(View view){          //I would like display an alerts in my activity         }        });</code></pre><p>[/code]</p><p>The OnClick works but, I would like to display alerts on my activity and I can't do it :/ I don't know how to lie my activity and my adapter</p>","335500","","","","","2011-07-30 07:43:04","button in listView","<android><listview>","2","1","","",""
"2810053","1","","","2010-05-11 11:00:19","1","964","<p>I'm using a seekbar in my android application to set the volume. However the length of the seekbar  is unesthetically  too short. So is there a way to customize the length of a seek bar ? </p>","304866","","","","","2011-06-02 12:57:29","Seekbar length manipulation","<android>","2","1","","",""
"2810075","1","2811105","","2010-05-11 11:03:28","3","5673","<p>how to change the tab indicator's images in android? there is a <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/res/res/drawable/tab_indicator.xml;hb=HEAD"" rel=""nofollow"">tab_indicator.xml</a> file in-built in android sdk. in that the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/res/res/layout/tab_indicator.xml;hb=HEAD"" rel=""nofollow"">Relative layout has the background as a tab_indicator</a> file as background. how to customize this images in tab_indicator and set our new images? I have a problem that the not selected tabs are highlighted with a white under line.because of those images. how to customize it? </p><p>That RelativeLayout doesn't have the id to access.how can i?Any Idea? Please help.</p><p>Note: <a href=""http://stackoverflow.com/questions/773690/android-customizing-tabs-on-state-how-do-i-make-a-selector-a-drawable/779588#779588"">Reto Meier's answer</a> a year ago says. its not possible at that time. what about now? </p>","267269","","267269","","2010-05-11 13:23:47","2013-02-22 11:44:00","Customizing tab indicator images in android?","<android><tabs><tabwidget>","1","0","2","",""
"2810107","1","","","2010-05-11 11:09:51","5","3679","<p>I am getting decoded frames from my engine and my playing it using SurfaceView in android.But it plays for 2-3 seconds and then my application crashes with the error ""debugger committing suicide to free the zombie"".</p><p>Please help me.</p><p>I am using Android SDK 2.1.</p>","338191","","","","","2010-06-17 22:20:22","debugger committing suicide to free the zombie","<android>","1","3","","",""
"2810265","1","2810440","","2010-05-11 11:32:58","4","3742","<p>I am playing around with the Gallery widget.</p><p>I would like to know how can we get the position of the image on focus in the gallery.</p><p>For example having several pictures in my gallery, if I tap my finger to the right, pictures will come and go until it stop to one. </p><p>How one can get the position of this one picture that is currently on focus ?</p><p>I don't know if I was clear enough, if there is anything you want me to add do not hesitate.Thank you,</p>","290613","","","","","2010-12-31 09:56:05","How to get which image (its position) is on focus in an Image Gallery?","<android><gallery><onfocus>","1","0","","",""
"2810564","1","2810716","","2010-05-11 12:19:51","0","538","<p>I'm new to android but I've been working my way through the tutoials. Still trying to get my head round layouts in a non-html world and was wondering how to achieve the following....</p><p>1) I'd like to set a tiled background to fill the screen behind the whole activity</p><p>2) I'd like to place a graphic and a button underneath it centred in the middle of the screen.</p><p>3) When the user clicks the button I'd like to start a new activity and presumably I have to do something to the current activity so the user can use the back button to get back to it.</p><p>Sorry for the newbie question.</p><p>Jon</p>","56007","","","","","2010-05-11 12:41:58","Basic Android Layout Question","<android><layout>","1","1","","",""
"2810592","1","2810644","","2010-05-11 12:22:57","1","828","<p>I've read lots about using local storage for android but how would I connect to an SQL database online to send and get data?</p><p>For example, if I was making a game and wanted to create a worldwide high score table, how would I store that online and make sure it was only available to that app?</p>","56007","","213269","","2011-12-14 01:37:33","2011-12-14 01:37:33","Android - How to get data from a server?","<android><database><client-server>","1","0","","",""
"2810615","1","2811049","","2010-05-11 12:26:33","7","16650","<p>I need to know how to retrieve data from cursor. I need this because the ringtonemanager returns all the audio files in form of cursor object, I need to know how to retrieve the values.</p><p>Anbudan.</p>","138030","","58792","","2010-08-24 08:40:08","2014-03-23 06:14:04","How to retrieve data from cursor class","<android>","3","2","2","",""
"2810679","1","","","2010-05-11 12:37:01","10","2423","<p>I am browsing the web but no way to find how to get metadata from a picture.</p><p>Does anyone has an idea ?</p><p>I can't see anything in the Bitmap/BitmapFactory/BitmapFactory.Options documentation that would give me a hint.</p><p>I would like to retrieve standard information such as :</p><ul><li>name </li><li>date it was taken </li><li>dimension</li><li>size</li></ul><p>and maybe more.</p><p>Any idea ?</p>","290613","","13565","","2010-05-18 12:55:47","2010-05-18 12:55:47","How to get metadata from a picture?","<android><bitmap><metadata>","2","0","3","",""
"2810694","1","2814532","","2010-05-11 12:38:45","2","1052","<p>In my current app, if the string is too long and doesn't fit into screen it gets cut. How to display rolling text for long strings in a spinner(i have seen that in some apps)?</p>","324417","","324417","","2010-05-11 13:52:01","2010-05-11 21:19:54","Displaying a long string in a spinner without cutting","<android><spinner>","2","0","0","",""
"2810973","1","","","2010-05-11 13:16:32","1","324","<p>On a Linux device (using Android [Eclair] with a 2.6.29 kernel), I seem to have some contents in my cache that never go away.</p><p>I would like to be able to examine the contents of my cache to find the culprit. I've looked at <code>mount</code> for any tmpfs that may be causing it, but they are taking up very little space.</p><p>What other types of things could be constantly using up cache?</p><p>If there is no built in way to examine the cache, what would be a good function in the kernel to dump information from regarding this? Is there any easy point?</p><p>Thanks</p>","292397","","","","","2012-12-01 00:03:50","Determine the contents of Linux Cache","<android><linux><linux-kernel>","1","3","1","",""
"2811052","1","","","2010-05-11 13:26:43","2","149","<p>I'm building a suite of applications, meaning that I have a single set of code that gets customized via a single change of an API key. This means that all of the applications have the same activities, same behaviors, but different icons, package names, and application names depending on the client I am building for.</p><p>Unfortunately, I haven't figured out a clean way to do this. Because the package name is what the Android Marketplace uses, I've been changing it to com.nilobject.productname.clientname. However, this changes the package for all of the activities to no longer be in the package of the application, since they live in ""com.nilobject.productname."" Additionally, the autogenerated ""R"" moves, so all of the references to R in com.nilobject.productname break.</p><p>Has anyone else dealt with this problem? I'm using Eclipse for development. Should I just refactor the activities with each build to be in the same package? Is there a system for this that I don't know about?</p><p>Thanks for any ideas and help!</p>","457","","","","","2011-01-28 08:55:11","How can I handle package names better while building a suite of android applications","<eclipse><android><marketplace>","1","2","1","",""
"2811357","1","","","2010-05-11 14:05:45","0","4741","<p>Im trying to make an activity that has a multiple choice dialog after you push a button. In there you select from a list of things. But these things are received from a web method before the dialog appears.</p><p>So I create a string array after I receive them inside the onCreate to initialise it there with the correct size.But my dialog method then cant get the array because propably its out of its scope.My code looks like this</p><pre><code>@Override protected Dialog onCreateDialog(int id)//Here is where the array is loaded to the multiple select dialogetc@Overridepublic void onCreate(Bundle savedInstanceState)//Here is where i initialise the array and get its contentsetc</code></pre><p>I cant initialise my array when the class starts because I dont know its size yet.This has to do something with the scopes of my variables and I am pretty confused</p>","338522","","","","","2014-04-01 22:54:18","Android use of an string array on another method","<android><arrays><scope>","2","0","0","",""
"2811615","1","2811647","","2010-05-11 14:39:14","7","8066","<p>I am having trouble accessing the database while I am developing on the phone. Whenever I execute</p><p><code>cd /data/data/com.mycompck/databases</code></p><p>and then run <code>ls</code> I get: <code>""opendir failed, Permission denied""</code></p><p>Or whenever I type in <code>sqlite3</code> I get: <code>""sqlite3: permission denied""</code></p><p>What am I doing wrong? </p><p>Are there some applications that can help me getting a human view of content resolvers values and/or SQLite databases?</p>","243782","","648313","","2012-04-12 12:50:11","2012-07-10 13:16:28","How to access the database when developing on Android phone?","<android><database><sqlite><phone><permission-denied>","3","1","3","",""
"2811690","1","","","2010-05-11 14:48:40","1","895","<p>i am working on an application that needs to find GPS location of the user. While testing my code on Droid i am unable to find the GPS location. While googling i found <a href=""http://code.google.com/p/android/issues/detail?id=5595"" rel=""nofollow"">this link</a> to an issue raised with Google.</p><p>But apps like Yelp can find the GPS location on droid. Is there a workaroud to find the user location on a device? Here's the code I am using</p><pre><code>import android.location.Location;import android.location.LocationListener;import android.location.LocationProvider;import android.os.Bundle;public class MyLocationListener implements LocationListener {private static double latitude;private static double longitude;public static boolean gpsAvailable = false;@Overridepublic void onLocationChanged(Location arg0) {    latitude = arg0.getLatitude();    longitude = arg0.getLongitude();    // Log.d(""MyLocationListener"", ""onLocationChanged"");}@Overridepublic void onProviderDisabled(String provider) {    // Log.d(""MyLocationListener"", ""onProviderDisabled"");}@Overridepublic void onProviderEnabled(String provider) {    // Log.d(""MyLocationListener"", ""onProviderEnabled"");}@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {    // Log.d(""MyLocationListener"", ""onStatusChanged called"");    if (provider.equals(""gps"") &amp;&amp; status != LocationProvider.AVAILABLE) {        gpsAvailable = false;        // Log.d(""MyLocationListener"", ""status NOTAVAILABLE"");    } else {        gpsAvailable = true;        // Log.d(""MyLocationListener"", ""status AVAILABLE"");    }}public static double getLatitude() {    return latitude;}public static double getLongitude() {    return longitude;}}</code></pre><p>thanks..</p>","152867","","","","","2010-05-13 11:34:04","Problem finding GPS location on Droid","<android><geolocation>","2","0","1","",""
"2812013","1","","","2010-05-11 15:31:42","1","961","<p>I cannot get my relative layuot view to shrink when using it in the follwing layout, used as a dialog.In below example the scrollview always expands to fill the entire dialog which looks very ugly if there is not much actual content.</p><p>I have tried most combinations of fill_parent, wrap_content etc without success.</p><p>The problem seems to be that setting the button to ""align_bottom"" will cause the dialog to fill its height. But if I change the order and have to button placed below the scrollview the button will not be visible if a lot of content is shown...</p><p>Workaround (that I think is a very ugly solution) is to set a margin-bottom on the scrollview and then the same negative margin-top on the button. But I'm not sure how this will look at different displays.  </p><p>Please help /Rudas</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/RelativeLayout01""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" &gt;    &lt;ScrollView        android:id=""@+id/ScrollView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_above=""@+id/dialogCloseButton""        android:layout_alignParentTop=""true"" &gt;        &lt;LinearLayout            android:id=""@+id/dialogContent""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:orientation=""vertical""            android:paddingBottom=""10dp"" &gt;            &lt;TextView                android:id=""@+id/TextView01""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" &gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;    &lt;Button        android:id=""@+id/dialogCloseButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:text=""Close"" &gt;    &lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/RelativeLayout01""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" &gt;    &lt;ScrollView        android:id=""@+id/ScrollView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_above=""@+id/dialogCloseButton""        android:layout_alignParentTop=""true"" &gt;        &lt;LinearLayout            android:id=""@+id/dialogContent""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:orientation=""vertical""            android:paddingBottom=""10dp"" &gt;            &lt;TextView                android:id=""@+id/TextView01""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" &gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;    &lt;Button        android:id=""@+id/dialogCloseButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:text=""Close"" &gt;    &lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre>","338433","","619673","","2012-10-16 09:19:29","2012-10-16 09:19:29","RelativeLayout does not shrink in height","<android><relativelayout>","1","0","","",""
"2812442","1","4905817","","2010-05-11 16:22:15","9","19768","<p>I've gone through the page <em><a href=""http://developer.android.com/guide/developing/device.html"">Using Hardware Devices</a></em>. My manifest has </p><pre><code>&lt;application android:icon=""@drawable/icon""     android:label=""@string/app_name""    android:debuggable=""true""&gt;</code></pre><p>My phone has <em>Menu</em> -> <em>Settings</em> -> <em>Applications</em> -> <em>Development</em> -> <em>USB Debugging</em> checked.</p><p>I have gone to the control panel on my Windows XP 64 bit installation and installed the USB drivers given to me by the SDK installer in <code>android-sdk_r05-windows\android-sdk-windows\usb_driver</code>. So my computer does recognize the Android device.</p><p>However.. when I run an app on Eclipse, it still insists on opening it up in an emulator rather than my phone. How can I fix that?</p>","211983","","63550","","2012-07-08 19:00:40","2013-10-03 06:21:51","Debugging an Android app to the phone","<android><android-emulator>","4","1","3","",""
"2812450","1","2814270","","2010-05-11 16:23:23","0","591","<p>I'm trying to programmatically uncheck all the <code>CheckBoxPreference</code> children of a <code>PreferenceScreen</code> in my app. How can I do that?</p>","35501","","","","","2010-05-11 20:37:57","How to access all the children of a PreferenceScreen?","<android><preferences>","2","0","1","",""
"2812536","1","2919941","","2010-05-11 16:34:28","2","1332","<p>Alright, so I'm trying to write a program for Android for a project for school, I figured out how to use Intents to scan, but once I find a product, how do I get that info into my app? For example, say I'm getting info from upcdatabase.com, I would just add the barcode number to the end of the url, but then how to I draw that data in? The same with Google search, how would I draw the data and the image of the item into the app? </p>","325400","","1236185","","2012-09-16 16:04:00","2012-09-16 16:04:00","Android: How to get product info after barcode scanning?","<android><barcode-scanner>","2","0","1","",""
"2812543","1","2812563","","2010-05-11 16:34:52","1","334","<p>i have created application using layout font sizes in ""pixels"" font and other layout looks fine on HTC hero and Motorola Droid but in nexus one which is bigger resolution phone every thing is messed up.</p><p>for example ,</p><p>i have used font 18px which is bigger size in HTC Hero and Motorola but in Nexus one it is looking very small.</p><p>same is the case with image height and width</p><p>a banner looks fine on both phones but in nexus one very small. actually we dont have height and width in percentage thats why i am not able to solve this problem.layout_width=""fill_parent"" also not helping..</p><p>kindly help me out what should i do to make application look same in all the phones with different resolutions.</p>","249991","","","","","2010-05-11 16:39:31","Layout Problem on Bigger resolution Phone like Nexus one?","<android><layout>","2","0","","",""
"2812650","1","4991800","","2010-05-11 16:45:49","4","1412","<p>Hope you will understand my question with my basic english...</p><p>In my application, I allow the user to have a button that launch the application of his choice. I get no problem to make a list of all installed apps, get the Intent and launch the choosen app.</p><p>But I would like to save the corresponding intent in the settings for the next time the user use my application, but settings only allow me to save basic data type ( Integer, boolean, Strings, etc. ) </p><p>So, my question is how to save an intent in a smart way.</p><p>I hope you can help me to find a solution.</p>","327402","","","","","2012-03-21 05:21:28","Any workaround to save an Intent in settings?","<android>","2","0","2","",""
"2812730","1","2812890","","2010-05-11 16:54:46","1","829","<p>Looking at Mark Murphy's excellent example at <a href=""http://github.com/commonsguy/cw-advandroid/tree/master/Views/ColorMixer/"" rel=""nofollow"">http://github.com/commonsguy/cw-advandroid/tree/master/Views/ColorMixer/</a> you can see where he's defined a custom widget called ColorMixer.  ColorMixer has an attribute named ""initialColor"" declared in attrs.xml.</p><p>In the constructor for ColorMixer, he obtains the attribute value as follows:</p><pre><code>  TypedArray a=getContext()      .obtainStyledAttributes(attrs, R.styleable.ColorMixer, 0, 0);  color = a.getInt(R.styleable.ColorMixer_initialColor, 0xFFA4C639);  a.recycle();</code></pre><p>This works just fine if 'R' is available to ColorMixer.  This will be the case if ColorMixer is written for and compiled with whatever package it's going to be part of.</p><p>But what if I wanted ColorMixer to be more generally useful?  I want to use the same source, unmodified, or even maybe put it into a jar file.  This means you can't make references to 'R'.</p><p>It seems to me that I should be able to do something like</p><pre><code>TypedArray a=getContext()          .obtainStyledAttributes(attrs, what-do-I-do-here?, 0, 0);int resid = context.getResources().getIdentifier(""ColorMixer_initialColor"",                 ""attr"", ""com.commonsware.android.colormixer.ColorMixer"")color = a.getInt(resid, 0xFFA4C639);</code></pre><p>but getIdentifier never returns anything but zero.  Is there something more I should be doing?  I want to re-write this code to be completely independent of 'R'</p><p>For source code to a concrete example, see www.efalk.org/tmp/CustomWidget.tar.gz</p>","338479","","338479","","2010-05-11 17:02:18","2010-05-11 17:18:40","Android: how do I define an attribute for a custom widget?","<android><android-widget>","1","0","","",""
"2812755","1","6163557","","2010-05-11 16:57:14","1","1283","<p>I know that I can have Eclipse build for 1.5 and 1.6 SDKs for different screen densities if I have the following snippet in AndroidManifest.xml</p><pre><code>&lt;supports-screens android:anyDensity=""false""/&gt;&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4"" /&gt;</code></pre><p>and if I set up my assets in the following manner in <code>res</code> folder:</p><pre><code>/res/drawable-hdpi-v4/res/drawable-ldpi-v4</code></pre><p>My default.properties has the following line:</p><pre><code># Indicates whether an apk should be generated for each density.split.density=false# Project target.target=android-4</code></pre><p>This setup allows me to create 1.5 and 1.6 builds in Eclipse IDE, but fails with the following error when I try to do a command line build.</p><pre><code>Buildfile: build.xml    [setup] Project Target: Android 1.6    [setup] API level: 4    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (4)Target ""resource-src"" does not exist in the project ""&lt;project-name&gt;"". It is used from target ""compile"".</code></pre><p>This error comes up whether I use build.xml generated by 1.5 SDK or the 1.6 SDK (with -resource-src, -aidl targets).</p><p>I think that on commandline the build.xml is defaulting to 1.5 SDK, I dont know any way of making it work with 1.6+ SDKs and would appreciate any thoughts, comments on this.</p><p>My goal is have one script that with will compile for all Android SDKs while supporting different screen densities.</p><p>Thanks</p>","33121","","","","","2011-05-28 18:22:09","Is it possible to have an Android build.xml that supports 1.5, 1.6 and also supports different screen densities?","<android><build>","1","0","0","",""
"2812764","1","2812831","","2010-05-11 16:59:04","1","737","<p>I'm trying to pass a bundle of two values from a started class to my landnav app, but according to the debug nothing is getting passed, does anyone have any ideas why?</p><pre><code>package edu.elon.cs.mobile;</code></pre><p>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;</p><p>public class PointEntry extends Activity{</p><pre><code>private Button calc;private EditText longi;private EditText lati;private double longid;private double latd;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.pointentry);    calc = (Button) findViewById(R.id.coorCalcButton);    calc.setOnClickListener(landNavButtonListener);    longi = (EditText) findViewById(R.id.longitudeedit);    lati = (EditText) findViewById(R.id.latitudeedit);}private void startLandNav() {    Intent intent = new Intent(this, LandNav.class);    startActivityForResult(intent, 0);}private OnClickListener landNavButtonListener = new OnClickListener() {    @Override    public void onClick(View arg0) {        Bundle bundle = new Bundle();        bundle.putDouble(""longKey"", longid);        bundle.putDouble(""latKey"", latd);        longid = Double.parseDouble(longi.getText().toString());        latd = Double.parseDouble(lati.getText().toString());        startLandNav();    }};</code></pre><p>}</p><p>This is the class that is suppose to take the second point</p><pre><code>   package edu.elon.cs.mobile;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.MyLocationOverlay;import com.google.android.maps.Overlay;import android.content.Context;import android.graphics.drawable.Drawable;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.location.Location;import android.location.LocationManager;import android.os.Bundle;import android.util.Log;import android.widget.EditText;import android.widget.TextView;public class LandNav extends MapActivity{    private MapView map;    private MapController mc;    private GeoPoint myPos;    private SensorManager sensorMgr;    private TextView azimuthView;    private double longitudeFinal;    private double latitudeFinal;    double startTime;    double newTime;    double elapseTime;    private MyLocationOverlay me;    private Drawable marker;    private GeoPoint finalPos;    private SitesOverlay myOverlays;    public LandNav(){        startTime = System.currentTimeMillis();    }    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.landnav);        Bundle bundle = this.getIntent().getExtras();        if(bundle != null){            longitudeFinal = bundle.getDouble(""longKey"");            latitudeFinal = bundle.getDouble(""latKey"");        }        azimuthView = (TextView) findViewById(R.id.azimuthView);        map = (MapView) findViewById(R.id.map);        mc = map.getController();        sensorMgr = (SensorManager) getSystemService(Context.SENSOR_SERVICE);        LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);         Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);        int longitude = (int)(location.getLongitude() * 1E6);        int latitude =  (int)(location.getLatitude() * 1E6);        finalPos = new GeoPoint((int)(latitudeFinal*1E6), (int)(longitudeFinal*1E6));        myPos = new GeoPoint(latitude, longitude);        map.setSatellite(true);        map.setBuiltInZoomControls(true);        mc.setZoom(16);        mc.setCenter(myPos);        marker = getResources().getDrawable(R.drawable.greenmarker);        marker.setBounds(0,0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight());        me = new MyLocationOverlay(this, map);        myOverlays = new SitesOverlay(marker, myPos, finalPos);        map.getOverlays().add(myOverlays);    }    @Override    protected boolean isRouteDisplayed() {        return false;    }    @Override    protected void onResume() {        super.onResume();        sensorMgr.registerListener(sensorListener,                sensorMgr.getDefaultSensor(Sensor.TYPE_ORIENTATION),                SensorManager.SENSOR_DELAY_UI);        me.enableCompass();        me.enableMyLocation();        //me.onLocationChanged(location)    }    protected void onPause(){        super.onPause();        me.disableCompass();        me.disableMyLocation();    }    @Override    protected void onStop() {        super.onStop();        sensorMgr.unregisterListener(sensorListener);    }    private SensorEventListener sensorListener = new SensorEventListener() {        @Override        public void onAccuracyChanged(Sensor arg0, int arg1) {            // TODO Auto-generated method stub          }        private boolean reset = true;        @Override        public void onSensorChanged(SensorEvent event) {            newTime = System.currentTimeMillis();            elapseTime = newTime - startTime;            if (event.sensor.getType() == Sensor.TYPE_ORIENTATION &amp;&amp; elapseTime &gt; 400) {                azimuthView.setText(Integer.toString((int) event.values[0]));                startTime = newTime;            }        }       };}</code></pre>","180825","","","","","2010-05-11 17:25:27","Why isn't my bundle getting passed?","<java><android><bundle>","1","1","0","",""
"2812868","1","","","2010-05-11 17:15:12","0","1081","<p>In c it would be: while(1){  i++;  printf(""%d \r"",i);}I assume the textview and the variable and the timer get created in oncreate, then there is a timer handler with an increment and a settext and a sleep? Seeing how to do this in androidese would really clarify things I think. Thanks.</p>","335873","","","","","2010-05-12 21:18:00","Minimal example wanted showing texview incrementing a count on a timer?","<android><timer>","2","4","","",""
"2812913","1","","","2010-05-11 17:21:47","1","3388","<p>I made a custom list adapter extending the Base adapter. Each item in the list has an imagebutton, 2 textviews and a button. I tried to add the context menu to the list so as to display some options for an item in the list. </p><pre><code>registerForContextMenu(getListView());</code></pre><p>I used a MenuInflater object to inflate the context menu xml file. But on clicking the items in the list nothing shows up or the usual highlighting of the item of list on click isn't shown. Is it that the context menu doesn't work for custom list views? Any help would be much appreciated.</p><p>Regards,Primal</p>","323404","","","","","2012-11-02 06:56:39","Android: Registering ContextMenu for a Custom ListAdapter","<android><list><contextmenu><adapter>","4","0","1","",""
"2813080","1","","","2010-05-11 17:47:10","1","603","<p>Can I set an ImageButton's image from an http URL?</p><p>ThanksChris</p>","334802","","","","","2010-05-11 20:02:08","Android ImageButton from url","<android><url><imagebutton>","1","0","","",""
"2813275","1","2813311","","2010-05-11 18:11:34","1","1808","<p>HiI have a multiplechoice dialog on my activity. I have a boolean array to keep track of which items are selected from the dialog. So I want each time an item is clicked to make the corresponding place on my array true. The array is being created in the onCreateDialog before the return.</p><pre><code>public Dialog onCreateDialog(int id) {  userlistlocal=getuserlist(username);  boolean[] usernamechecked=new boolean[userlistlocal.length/3];  Arrays.fill(usernamechecked,false);           return new AlertDialog.Builder(Newevent.this)        .setIcon(R.drawable.ic_menu_invite)        .setTitle(""Add People"")        .setMultiChoiceItems(userselectionlistlocal,                null,new DialogInterface.OnMultiChoiceClickListener() {                    public void onClick(DialogInterface dialog, int whichButton,                            boolean isChecked) {                         /* User clicked on a check box do some stuff */                     usernamechecked[whichButton]=isChecked;&lt;-------HERE                    }                })        .setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                /* User clicked Yes so do some stuff */            }        })        .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                /* User clicked No so do some stuff */            }        })       .create(); }</code></pre><p>But when I put in the onClick method my boolean array it says it has to be final(Cannot refer to a non-final variable usernamechecked inside an inner class defined in a different method). I dont know what to do</p>","338522","","","","","2010-05-11 18:54:45","Multiple choice dialog wont let me alter an array when clicked","<android><arrays><scope>","2","0","2","",""
"2813470","1","2845257","","2010-05-11 18:40:18","4","2259","<p>I am working on an Android app that uses the gdata-java-client to download documents for display only. So far I have an application that authenticates with the services and displays a list of user documents. When the user selects a document another query is made for the documents itself. A request for txt, html, rtf and doc files works well, however when I request a spreadsheet in either .csv or .xsl format the result is unexpected. </p><p>I'm using an HTTPResponse object to store the result of a an HTTPRequest. When I request a document in .csv or .xsl format the HTTPResponse.parseAsString() method produces an entire html page which appears to be the Google Docs home page. Sounds strange, but the result is the actual html for the login page. The HTTPResponse.getStatusMessage returns a 200. </p><p>Seems like I am missing something simple here. Is there another property of the HTTPResponse that contains the .csv data? </p><p>I am pretty sure that I am using the correct uri for downloading spreadsheets because it works when I download through my browser. In any case here is an example uri:</p><pre><code>https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=0AsE_6_YIr797dHBTUWlHMUFXeTV4ZzJlUGxWRnJXanc&amp;exportFormat=csv</code></pre><p>Thanks in advance for any help :)</p>","230561","","83406","","2010-09-21 17:35:38","2010-09-21 17:35:38","Downloading Spreadsheets From Google Docs","<java><android><google-docs><httpresponse><google-api-java-client>","2","4","1","",""
"2813828","1","","","2010-05-11 19:28:21","1","698","<p>I have created a main android project using ""android"" utility. e.g.</p><p>android create project --target 1 --name MyApp --path C:\testandroid\myui --activity LaunchActivity --package com.myui.activity</p><p>build.xml got generated fine (has ant targets like debug, release etc)</p><p>I generated a test android project (which depends on main project). I used ""android"" utility to do that. e.g.</p><p>android create test-project --path C:\testandroid\myuitest --main ..\myui --name MfAppTest</p><p>build.xml got generated but incorrect (does not have targets like run-tests). It has same targets as main project.</p><p>Can someone help as where is the problem?Thx.Ashley</p>","338656","","","","","2012-02-15 00:00:16","Not able to generate correct build.xml for android test project","<android>","1","0","1","",""
"2813906","1","","","2010-05-11 19:40:09","0","688","<p>For various reasons, i'm trying to write my own input keyboard. So far all is going well except that of creating the suggestions.</p><p>I've found the latinIME algorithm, which is all good.</p><p>However i'm having major difficulty working out how to load the dictionary in the first place.</p><p>I've had a good look round the net, and found various suggestions, but no definitive answers, and i cant seem to get any of them to work.</p><p>If anyone has any suggestions on how best to do it, or even better some sample code, that would be brilliant.</p><p>Many Thanks</p><p>James</p>","334712","","","","","2010-09-25 16:53:06","Loading dictionary for input method suggestion list","<android><android-keypad>","1","0","","",""
"2814004","1","","","2010-05-11 19:55:20","5","2415","<p>Has anyone figured out how to scroll the contents of the Layout Editor when those contents overflow one ""screen""? I'm talking about at design-time while using the ADT Layout Editor, not scrolling at run-time on a physical device (that works fine).</p>","277774","","252631","","2010-05-11 21:30:55","2012-10-11 20:18:37","Scroll the Layout Editor in Android ADT Eclipse Plug-in","<android><eclipse-plugin>","3","1","","",""
"2814201","1","2814724","","2010-05-11 20:29:29","1","173","<p>I'm writing an application that will ship in two versions: Android and PC version.</p><p>Is there a simple way to access files from the shared code?</p><p>Using <code>java.io</code> is simple, but I don't know how to access android resources or assets using it. And I can't write methods that operate on <code>FileInputStream</code>s instead, because some files contain references to another ones, so I need a way to access them from the method code.</p><p>Any suggestions?</p>","115493","","","","","2010-05-11 21:55:12","Is there a common way to access files, that works both on android and PC?","<java><android><file><file-io>","1","0","1","",""
"2814213","1","2814229","","2010-05-11 20:30:39","37","12187","<p>I am using the below code to write a backup copy to SDCard and I get</p><p><code>java.io.IOException: Parent directory of file is not writable: /sdcard/mydbfile.db</code></p><pre><code>private class ExportDatabaseFileTask extends AsyncTask&lt;String, Void, Boolean&gt; {        private final ProgressDialog dialog = new ProgressDialog(ctx);        // can use UI thread here        protected void onPreExecute() {           this.dialog.setMessage(""Exporting database..."");           this.dialog.show();        }        // automatically done on worker thread (separate from UI thread)        protected Boolean doInBackground(final String... args) {           File dbFile =                    new File(Environment.getDataDirectory() + ""/data/com.mypkg/databases/mydbfile.db"");           File exportDir = new File(Environment.getExternalStorageDirectory(), """");           if (!exportDir.exists()) {              exportDir.mkdirs();           }           File file = new File(exportDir, dbFile.getName());           try {              file.createNewFile();              this.copyFile(dbFile, file);              return true;           } catch (IOException e) {              Log.e(""mypck"", e.getMessage(), e);              return false;           }        }        // can use UI thread here        protected void onPostExecute(final Boolean success) {           if (this.dialog.isShowing()) {              this.dialog.dismiss();           }           if (success) {              Toast.makeText(ctx, ""Export successful!"", Toast.LENGTH_SHORT).show();           } else {              Toast.makeText(ctx, ""Export failed"", Toast.LENGTH_SHORT).show();           }        }        void copyFile(File src, File dst) throws IOException {           FileChannel inChannel = new FileInputStream(src).getChannel();           FileChannel outChannel = new FileOutputStream(dst).getChannel();           try {              inChannel.transferTo(0, inChannel.size(), outChannel);           } finally {              if (inChannel != null)                 inChannel.close();              if (outChannel != null)                 outChannel.close();           }        }     }</code></pre>","243782","","","","","2012-03-09 08:37:35","Making a database backup to SDCard on Android","<android>","1","4","32","",""
"2814223","1","2814304","","2010-05-11 20:31:35","3","912","<p>HI,</p><p>Can you please tell me how can I create 3 equally wide TextView which fill parent across the screen? I tried doing this, but the width of the TextView are different: it is 149, 89, 89.</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=""*""     android:shrinkColumns=""*""&gt;</code></pre><p></p><pre><code>&lt;TextView android:id=""@+id/t1""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_column=""0""/&gt;&lt;TextView android:id=""@+id/t2""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_column=""1""/&gt;&lt;TextView android:id=""@+id/t3""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_column=""2""/&gt;</code></pre><p></p>","128983","","","","","2010-05-11 20:43:50","How to create 3 equally wide TextView which fill parent across the screen","<android>","1","0","1","",""
"2814290","1","2817712","","2010-05-11 20:41:22","1","3734","<p>How to mount Android Phone's sdcard to be both visible on PC and Phone?</p>","243782","","","","","2010-07-03 17:33:20","How to mount Android Phone's sdcard to be both visible on PC and Phone?","<android>","4","0","","","2010-05-11 20:41:22"
"2814333","1","","","2010-05-11 20:48:31","0","530","<p>I have a custom View class in my app that I'm using in xml layouts.  Wherever I'm using this view in my xml, I don't want it to stretch it's container, but I want it to fill out whatever space is available.  Here's an example to make it a little clearer.  I have a LinearLayout set to horizontal orientation with my custom view followed by a TextView.  The TextView is going to stretch the LinearLayout so that it takes up the space it needs and no more.  I want my custom view to take up the vertical space that the TextView has made available.  Let's say the TextView ends up being 50px tall because of it's contents.  The LinearLayout is thus stretched to about this height (not taking into account any margins or padding), so I just want the view to know it can stretch to that height and not ""push on"" its container.</p><p>Without overriding any of the measurement methods of the base class (onMeasure, etc) my View is actually stretching to take up as much space as possible.  I have already played around with wrap_content and fill_parent a bunch, so I'm assuming I need to do something in one of the View class' measure methods.</p>","53501","","213269","","2010-12-14 12:13:25","2010-12-14 12:13:25","Android custom view - setting it to take up max space available but no more","<android><custom-view>","1","0","","",""
"2814375","1","2814390","","2010-05-11 20:55:51","2","846","<p>This is my code:</p><pre><code>public class MainActivity extends Activity {    private ComponentName mService;    private Servicio serviceBinder;    private ServiceConnection mConnection = new ServiceConnection() {           public void onServiceConnected(ComponentName className, IBinder service) {             serviceBinder = ((Servicio.MyBinder)service).getService();           }           public void onServiceDisconnected(ComponentName className) {             serviceBinder = null;           }        };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent bindIntent = new Intent(this, Servicio.class);        bindService(bindIntent, mConnection, Context.BIND_AUTO_CREATE);    }    @Override    protected void onStart() {        serviceBinder.somethingThatTakesTooMuch();        super.onStart();    }public class Servicio extends Service {    private final IBinder binder = new MyBinder();    @Override            public IBinder onBind(Intent intent) {    return binder;    }    public int somethingThatTakesTooMuch() {        return 1;    }    public class MyBinder extends Binder {          Servicio getService() {            return Servicio.this;          }    }</code></pre><p>When I run it,It get a NullPointerException in this line:</p><pre><code>serviceBinder.somethingThatTakesTooMuch();</code></pre>","119895","","","","","2010-05-11 20:58:18","Service bind to an Activity","<android>","1","0","1","",""
"2814458","1","","","2010-05-11 21:08:06","0","133","<p>I have an activity (called Sender) with the most basic UI, only a button that sends a message when clicked. In the onClickListener I only call this method:</p><pre><code>private void sendSMS(String msg)    {     PendingIntent pi = PendingIntent.getActivity(this, 0,       new Intent(this, Sender.class), 0);     PendingIntent pi = PendingIntent.getActivity(this, 0, myIntent, 0);     SmsManager sms = SmsManager.getDefault();     sms.sendTextMessage(""1477"", null, msg, pi, null);    }</code></pre><p>This works ok, the message is sent but every time a message is sent a new instance of Sender is started on top of the other. If I call sendSMS method three times, three new instances are started. I'm quite new to android so I need some help with this, I only want the same Sender to be on all the time</p>","338731","","","","","2010-05-12 20:07:45","Unwanted automated creation of new instances of an activity class","<java><android>","2","1","","",""
"2814509","1","","","2010-05-11 21:16:04","2","1724","<p>I've spent hours reading through the SDK reference, googling and reading tutorials - but I still can't figure it out. </p><p>I would like to know how to create a custom list item in the ListActivity widget on Android. Something similar to a Twitter client interface. Each list item has different types of text, possibly an icon, etc. </p><p>The issue is binding the data to the list item. If you define your own data structure, let's say ""Tweet"" which will store the message, author, date sent and a picture URL - how do you bind the tweet instance to the custom list item?</p><p>Does anyone know of any resources that would help me understand the process of creating something like that?</p><p>Any guidance would be appreciated. Thanks</p>","244182","","244182","","2010-05-11 21:34:01","2010-05-11 21:34:01","Custom Item in ListActivity on Android","<android>","1","0","2","",""
"2814675","1","3005100","","2010-05-11 21:45:11","5","2095","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/975384/eclipse-error-failed-to-connect-to-remote-vm"">Eclipse Error: &ldquo;Failed to connect to remote VM&rdquo;</a>  </p></blockquote><p>When I debug my application I get frequently Launch error: Failed to connect to remote VMeven If I try again it doesn't help, I need to restart Eclipse.</p><p><strong>Edit</strong><br>Not sure yet fully if the symptoms have to do with the fact that I get this error only when I launch Debug without a code modification. Whenever I do a modification to the source code and hit Debug it goes through, but if I don't it doesn't.</p>","243782","","243782","","2010-05-11 22:11:49","2012-03-05 11:09:31","When I debug my application I get frequently Launch error: Failed to connect to remote VM","<eclipse><android>","2","6","","2012-03-05 11:38:26",""
"2815063","1","","","2010-05-11 23:08:37","0","1612","<p>I recently started messing with Android Apps, but I have had nothing but problems trying to get them into the Virtual Device for testing.  For some reason, they never seem to show up in the AVD.  It has worked one time, but that's it out of hours spent just trying to test one or two very simple apps.</p><p>I've redone the AVD setup many, many times, trying different settings and what not to no avail.  I've followed multiple guides and tutorials to the letter to get it working, but they just refuse to show up in the list. :(  </p><p>Any insight would be appreciated, thank you.</p>","337630","","","","","2010-05-11 23:26:08","Android Apps Not Showing Up In AVD","<android><virtual><device><avd>","1","1","","",""
"2815080","1","2815459","","2010-05-11 23:12:30","1","4635","<p>I've set of <code>n</code> points and I want to draw a <code>n-sided</code> polygon using these points. </p><p>I tried using android.graphics.path (please see below). </p><pre><code>Path path = new Path();Vertex currVtx;for (int j = 0; j &lt; vertices.size(); j++) { currVtx = vertices.get(j); if (!currVtx.hasLatLong())  continue; Point currentScreenPoint = getScreenPointFromGeoPoint(   currVtx, mapview); if (j == 0)  path.moveTo(currentScreenPoint.x, currentScreenPoint.y);           // vertex. else  path.lineTo(currentScreenPoint.x, currentScreenPoint.y);}</code></pre><p>Currently I'm getting a solid (filled with the color of the canvas) polygon with this code. Is there a way that I can get an unfilled polygon. There is an alternative to <code>android.graphics.Path</code></p><p>Thanks. </p>","306346","","","","","2010-05-12 00:53:35","Drawing an empty polygon given a set of points on a Map Overylay (Android 2.1)","<android><graphics><path><polygon><android-sdk-2.1>","1","1","3","",""
"2815221","1","2815274","","2010-05-11 23:50:23","7","933","<p>I have a free app published in Android market.  I have lost the certificate used to sign the current version but I want to publish an updated version. Android market refuses to accept my upgrade because it is signed by a new certificate. I realize the users will have to uninstall the current version to get the upgrade but it's not clear how to get the updated version into the market so that the current users will find it. </p><p>What are my options?  </p><p>Thanks,</p><p>John</p>","4476","","","","","2010-05-12 00:02:21","Lost cert for published app","<android><google-play>","1","0","4","",""
"2815335","1","","","2010-05-12 00:19:15","0","4033","<p>I want to draw a a circle of 15 KM radius around a point on Google Maps by using Android. In Android we only have MapView and MapViewController. How can I implement the drawCircle funciton provided in <a href=""http://esa.ilmari.googlepages.com/circle.htm/"" rel=""nofollow"" title=""Circle"">Google Map Circle</a> example in Android.</p>","338851","","","","","2012-07-06 06:51:48","Draw 15Km radius around point in Android","<android><google-maps>","1","0","1","",""
"2815518","1","2815539","","2010-05-12 01:07:59","7","3866","<p>I have a really short question: Is it possible to communicate/use USB devices on Android OS? I assume it might be tablet device. </p><p>Lest say i want to connect some sort of USB card scanner to android tablet. Will it work? Do i need to write drivers by myself?</p><p>Thanks.</p>","116892","","","","","2013-12-15 23:33:25","Is there a way to communicate with USB devices on Android?","<java><android><usb><drivers>","3","0","2","",""
"2815654","1","2886710","","2010-05-12 01:39:42","5","1376","<p>Is it possible to make a multiple choice list with <code>android:choiceMode=""multipleChoice""</code> or <code>setChoiceMode(ListView.CHOICE_MODE_MULTIPLE)</code> on an <code>ExpandableListView</code>? I am able to do this with <code>CheckBox</code>es on a plain <code>ListView</code>, but it doesn't seem to be working with <code>ExpandableListView</code>.  In the latter, clicking the list item (either parent or child) does not affect the checkbox as it does in the former.</p><p>I have noticed that it is possible to click exactly on the checkbox to make it toggle, but this is a very small target.</p><p>Here is a <a href=""http://arstechnica.com/civis/viewtopic.php?f=20&amp;t=1108192"">relevant unanswered forum post</a>.</p>","105137","","105137","","2010-05-12 02:04:46","2013-09-04 16:52:02","Is choiceMode compatible with ExpandableListView?","<android>","2","0","2","",""
"2815938","1","2818603","","2010-05-12 03:22:30","6","1881","<p>I am thinking of setting up a global, default Exception handler for my (Android) Mobile application(which uses Java syntax) using <code>Thread.setDefaultUncaughtExceptionHandler(...)</code> call. I am thinking of just displaying an Alert Dialog with appropriate message to the user.</p><p>Are there any gotchas, caveats and rules that one needs to follow when setting  <code>DefaultExceptionHandlers</code>? Any best practices like making sure that the process is killed, full stack trace is written to logs etc. ?</p><p>Links to documentation, tutorials etc. that can throw some light on this are welcome.</p><p>Thanks. </p>","236128","","236128","","2010-05-12 04:11:09","2010-05-12 12:11:06","Global Exception Handlers in Java","<java><android><exception-handling>","2","0","4","",""
"2815975","1","2816522","","2010-05-12 03:35:55","0","1812","<p>I have a app that only consists of 2 services and a broadcast receiver (they check the internet periodically). I need to store preferences that can be shared across those services. Is this the same as for an activity? Just use getsharedpreferences()? This doesn't seem to be documented very well.</p>","375874","","","","","2010-05-12 06:45:10","Android preferences when application only contains service","<android><service><preferences>","1","0","1","",""
"2816086","1","2816465","","2010-05-12 04:15:05","2","25717","<p>Today I decided to start developing for the Android OS.  I went on their website, downloaded all the required software (Eclipse, The Android SDK, ADT Plugin for Eclipse etc.).  I followed the ""Hello World"" tutorial supplied (<a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">link text</a>).  I have it using the Android SDK 2.1.The program worked almost flawlessly.  It runs fine on the Android emulator, but doesn't install on any Android phones.  I don't own an Android phone, so I had three of my friends try to install the program on theirs.<br>The phones we used were:</p><ol><li>ROOTED G1 running 2.1</li><li>Droid running 2.1</li><li>Another Droid running 2.1</li></ol><p>I emailed the .apk to myself in gmail, and accessed it via the Android emulator.  It ran and installed the package just fine.  However, when my friends tried to install it on their phones, they were all met with this error:""[Parse Error] There is a problem parsing the package""</p><p>I'm wondering if anyone has any suggestions as to what may be wrong.  Thanks for your help.</p>","338953","","","","","2012-02-21 08:11:47","Android ""Hello World"" tutorial program. Error: [Parse Error] There is a problem parsing the package","<android>","6","3","","",""
"2816292","1","2817898","","2010-05-12 05:49:00","3","1020","<p>I have a ListActivity based on an ArrayAdapter with setTextFilterEnabled set to true. This works fine on a device with a physical keyboard. When I start typing something on the keyboard, the items get filtered.</p><p>My question is how to get the same behavior on a device with no physical keyboard?</p>","338981","","","","","2010-05-12 10:28:02","Android ListActivity ArrayAdapter filtering with no physical keyboard?","<android><keyboard><filter><listactivity><android-arrayadapter>","1","0","","",""
"2816554","1","","","2010-05-12 06:50:56","2","812","<p>How to get the default gmail user name and password of one android cell phone during developing android program.</p>","339018","","","","","2010-06-22 17:00:07","How to get the default gmail user name and password of one android cell phone","<android><gmail><default><username>","1","0","","",""
"2816677","1","","","2010-05-12 07:17:08","2","1705","<p>I'm trying to implement a local search in my activity. I've added an appropriate intent filter and metadata tag to manifest file but if I click Search button it invokes standard android search box. What's my problem?</p><p>Manifest file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifestxmlns:android=""http://schemas.android.com/apk/res/android""package=""com.nixsolutions.invertigation.android.dataprovider""android:versionCode=""1""android:versionName=""1.0""&gt;&lt;application    android:icon=""@drawable/icon""    android:label=""@string/app_name""    android:debuggable=""true""&gt;    &lt;provider        android:name=""NoteProvider""            android:authorities=""com.nixsolutions.investigation.android.NoteProvider""&gt;    &lt;/provider&gt;    &lt;activity        android:name=""NotesList""&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.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;&lt;/application&gt;&lt;uses-sdk    android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>searchable.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android"" android:label=""Custom search""android:hint=""Custom hint""android:searchMode=""showSearchLabelAsBadge""/&gt;</code></pre>","218783","","","","","2011-01-30 18:57:18","Android local search","<android>","1","0","2","",""
"2816708","1","4953532","","2010-05-12 07:21:27","2","2257","<p>How can I change a title from tab child?I tried a simple setTitle(...) but it won't work.</p><p>(from the parent tab activity, it does, however...)</p><p>thanks, Ori</p>","258429","","","","","2011-02-10 04:55:39","Set Title in Tab childs","<android>","3","2","","",""
"2816808","1","","","2010-05-12 07:38:35","1","2516","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1827751/is-there-a-way-to-make-ellipsize-marquee-always-scroll"">Is there a way to make ellipsize=“marquee” always scroll?</a>  </p></blockquote><p>I have a dynamic layout wich has one to six TextViews. All the TextViews are created in the Activity (programatically) and all are created equally.</p><p>I want to marquee the text in the TextViews, but I don't know how to do it. Apparently, the TextView needs to be focused for the marquee works fine, but how i focus six TextViews at the same time? I think that's not possible, so, is there any workaround? Is it possible to get the marquee working without having the focus?</p><p>This is the code of the TextViews:</p><pre><code>//TextViewTextView tvTitulo = new TextView(this);tvTitulo.setText(""Some loooooooooooooooooooooong text"");tvTitulo.setTypeface(null, Typeface.BOLD);//MarqueetvTitulo.setSingleLine();tvTitulo.setEllipsize(TruncateAt.MARQUEE);tvTitulo.setHorizontallyScrolling(true);tvTitulo.setFocusableInTouchMode(true);</code></pre><p>If I remove the line <code>tvTitulo.setFocusableInTouchMode(true);</code> the marquee is not working at all.If I don't remove the line, only one of the TextViews is getting the marquee working.</p><p>Greetings</p>","309853","","234938","","2010-05-12 09:29:15","2012-08-25 05:40:17","Marquee in various TextView at the same time?","<android><layout><textview><marquee>","1","1","1","2012-12-16 13:44:15",""
"2816845","1","","","2010-05-12 07:45:31","1","105","<pre><code> private final int NUM_SOUND_FILES = 4; private Random rnd = new Random(4); private int mfile[] = new mfile[NUM_SOUND_FILES]; //the second mfile                                                       //reports error everytime mfile[0] = R.raw.sound1; mfile[1] = R.raw.sound2; mfile[2] = R.raw.sound3; mfile[3] = R.raw.sound4; int sndToPlay = rnd.nextInt(NUM_SOUND_FILES);</code></pre><p>I keep getting syntax errors no matter how I write it.  And when I get the syntax right, it forcecloses.  Here's with the alleged ""correct"" syntax but forcecloses:</p><pre><code>private final int NUM_SOUND_FILES = 4;private Random rnd = new Random(4);private int mfile[] = new int[NUM_SOUND_FILES];{mfile[0] = R.raw.sound1;mfile[1] = R.raw.sound2;mfile[2] = R.raw.sound3;mfile[3] = R.raw.sound4;}</code></pre>","337865","","3713","","2010-05-12 07:47:12","2010-05-12 07:51:52","Am I writing this right? [noob]","<android><arrays><random><audio><int>","1","4","","",""
"2816893","1","","","2010-05-12 07:55:02","0","1125","<p>I'm looking for how to overlay an ImageButton by a TextView in android xml layout. For the moment when I reduce the the TextView margin top, the TextView is going under the ImageButton. I want the contrary.</p>","339069","","","","","2010-08-22 19:28:37","Android - Overlay ImageButton by TextView on xml layout","<android><layout><overlay><textview><imagebutton>","1","0","1","",""
"2816899","1","5763699","","2010-05-12 07:56:34","2","8521","<p>I like to use Xpath to parse XML ins java, but when I am doing the same on android, XPath is not found.</p><p>any idea how it can be implemented. and also if its not possible then any other parser for android which is fast?</p><p>Thanks</p><p>Kai</p>","328518","","","","","2013-09-01 07:04:35","I want to use Xpath in Android to parse XML","<xml><android><parsing><xpath>","2","1","2","",""
"2817166","1","","","2010-05-12 08:41:06","11","13927","<p>I'm working with Android 2.1 and have the following problem:Using the method View.getDrawingCache() always returns null. getDrawingCache() should return a Bitmap, which is the presentation of View's content.</p><p>Example code:</p><pre><code>public void onCreate(final Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  final View view = findViewById(R.id.ImageView01);  view.setDrawingCacheEnabled(true);  view.buildDrawingCache();  final Bitmap bmp = view.getDrawingCache();  System.out.println(bmp);</code></pre><p>}</p><p>I've already tried different ways to configure the View object for generating the drawing cache (e.g. <code>View.setWillNotDraw(boolean)</code> and <code>View.setWillNotCacheDrawing(boolean)</code>), but nothing works.</p><p>What is the right way, or what I'm doing wrong?</p><p>PS: In real code I want to apply getDrawingCache() on a ViewGroup like RelativeLayout. Is the behaviour the same when using a ViewGroup?</p>","339110","","339110","","2010-05-12 08:55:10","2012-07-19 21:38:31","Android 2.1 View's getDrawingCache() method always returns null","<android><caching><null><view><drawing>","7","2","3","",""
"2817289","1","2817368","","2010-05-12 09:01:03","0","1277","<p>My question is quite straightforward. I have a table, with, lets say x rows, with each an id, but i don't know how many rows i have. Now i want to delete the last row of my table for some reason... Is there an easy way to do that in android? I have been trying to use the last_insert_rowid  in my where clause...but no luck so far...any idea to do that with the sqlite database tools of android?thx for help</p>","263521","","1228","","2013-09-05 12:46:43","2013-09-05 12:46:43","delete last row in a table android","<android><delete><row>","1","3","","",""
"2817393","1","2817425","","2010-05-12 09:17:36","0","831","<p>Maybe my question might seem a bit weird, but I have an activity in which, in one case , I have to move to another activity before it finishes loading the screen. My condition is in the onCreate method, which means when I encounter it, i get a ""startActivity called from outside an activity context"" error and the app just crashes...<br>But then, is there an easy way like a flag for the intent to make it work without having the activity context resolved?thanks for any answer</p>","263521","","","","","2010-05-12 09:21:32","fire an intent from the onCreate method in android","<android><android-intent><oncreate>","1","0","","",""
"2817411","1","2817517","","2010-05-12 09:20:01","0","926","<p>I have this code fragment:</p><pre><code>public static class ExportDatabaseFileTask extends AsyncTask&lt;String, Void, Boolean&gt; {    private final ProgressDialog dialog = new ProgressDialog(ctx);    protected void onPreExecute();    protected Boolean doInBackground(final String... args);    protected void onPostExecute(final Boolean success);}</code></pre><p>I execute this thread as</p><pre><code>new ExportDatabaseFileTask().execute();</code></pre><p>As you see I use a ctx as Context variable in the new ProgressDialog call, how do I pass a context to the call method?</p><p>to this one:</p><pre><code>new ExportDatabaseFileTask().execute();*</code></pre>","243782","","","","","2010-06-30 16:52:16","How can I pass a Context object to a thread on call","<java><android>","3","1","","",""
"2817417","1","2818339","","2010-05-12 09:20:35","2","1770","<p>I'd like to get the value of Count column from cursor.</p><pre><code>public Cursor getRCount(String iplace) throws SQLException{ try {      String strSql = ""SELECT COUNT(_id) AS RCount FROM tbName WHERE place= '"" + iplace + ""'"";                  return db.rawQuery(strSql, null);    } catch (SQLException e) {        Log.e(""Exception on query"", e.toString());        return null;    }} </code></pre><p>I tried to get this count column value from cursor like below</p><pre><code>Cursor cR = mDbHelper.getRCount(cplace);if (cR.getCount() &gt; 0){long lCount = cR.getLong(0);}cR.close();}</code></pre><p>I got the debug error. How to get it? </p><p>PS: Could I use nested cursors?</p>","305732","","305732","","2010-05-12 10:00:54","2010-05-12 11:31:41","how to get count column","<android><cursor>","2","2","","",""
"2817424","1","2817459","","2010-05-12 09:21:23","1","4341","<p>I'm trying to run the Android MapView example, and am getting a 'Cannot cast from View to MapView' error in Eclipse.</p><p>My layout is as follows</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/mainlayout""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" &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=""0jwi0saLYCPGfO-t7glg5bQoBz7jVKWCcgyQWQA"" /&gt;&lt;LinearLayout    android:id=""@+id/zoomview""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignBottom=""@id/mapview""    android:layout_centerHorizontal=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>and the Activity code is</p><pre><code>package org.gaz.mapapp;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;import android.widget.ZoomControls;import com.google.android.maps.*;public class MapView extends MapActivity {LinearLayout linearLayout;MapView mapView;ZoomControls mZoom;public void onCreate(Bundle savedInstance) {    linearLayout = (LinearLayout) findViewById(R.id.mainlayout);    mapView = (MapView) findViewById(R.id.mapview);    mZoom = (ZoomControls) mapView.getZoomControls();       }@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}}</code></pre><p>The error is caused by the line</p><pre><code>mapView = (MapView) findViewById(R.id.mapview);</code></pre><p>Can anybody offer an suggestions as to a fix?</p><p>Cheers,Gaz.</p>","76242","","","","","2011-01-31 13:54:10","Android: Cannot cast from View to MapView","<android><casting><android-mapview>","1","0","","",""
"2817581","1","","","2010-05-12 09:42:29","0","10211","<p>Now I am doing a android project. The project needs to get the default username and password of Android phone.</p><p>I don't know how to get the default gmail information of one Android Cell Phone. Can u help me. Thanks.</p>","339018","","1626878","","2012-12-24 06:57:30","2013-03-14 07:08:11","How to get the default gmail username and password","<android><passwords><gmail><default><username>","2","1","1","",""
"2817767","1","2818189","","2010-05-12 10:12:16","1","3380","<p>I have a problem with initializing my app properly after the autostart.</p><p>I've managed to get an autostart to work, after a reboot the app is shown as started but the timer's are not.My guess is that the ""onCreate"" function of MyApp is not called when I call the context.startService(). The timers are set in the doActivity() function of MyApp.</p><p>I would greatly appreciate any tips on what I could be doing wrong or links to good tutorials. :)</p><p>The <strong>manifest</strong>:</p><pre><code>    &lt;activity android:name="".MyApp""              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=""MyApp_Receiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;[/syntax]</code></pre><p><strong>MyApp_Receiver</strong> is a BoradcastReciever with the following two functions</p><pre><code>public void onReceive(Context context, Intent intent) {    // Do Autostart if intent is ""BOOT_COMPLETED""    if ((intent.getAction() != null) &amp;&amp; (intent.getAction().equals(""android.intent.action.BOOT_COMPLETED"")))    {        // Start the service        context.startService(new Intent(context, MyApp.class));    }    // Else do activity    else        MAIN_ACTIVITY.doActivity();}public static void setMainActivity(MyApp activity){    MAIN_ACTIVITY = activity;}</code></pre><p><strong>MyApp</strong> extends PreferenceActivity and has an onCreate() and a doActivity(), the doActivity() reads out the preferences and sets a timer depending on them.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Show preferences    addPreferencesFromResource(R.xml.preferences);;    // Register Preference Click Listeners    getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);    // Prepare for one-shot alarms    if (mIntent == null)    {        mIntent = new Intent(MyApp.this, MyApp_Receiver.class);        mSender = PendingIntent.getBroadcast(MyApp.this,                0, mIntent, 0);        MyApp_Receiver.setMainActivity(this);    }    // Refresh and set all timers on start    doActivity();}</code></pre>","339177","","","","","2010-05-12 11:11:05","Android: Autostart app and load preferences","<android><autostart>","1","0","1","",""
"2817782","1","","","2010-05-12 10:13:35","0","600","<p>Hello I'm a new android developer.</p><p>I want to do a welcome page which can display program logo [ full screen image] and loading progress of my main program.</p><p>My main program has to load a webpage. My question is how to display the web-loading progress of the main program on the welcome page, while showing the welcome page until the download is completed.</p>","339179","","203458","","2012-10-11 17:34:10","2012-10-11 17:34:10","How to make a welcome screen","<android><loading>","2","0","","",""
"2817798","1","2817835","","2010-05-12 10:15:13","2","3411","<p>Whenever a application needs internet and connection fails, I get a message dialog </p><p><code>Connection failed<br>This application requires network access. Enable mobile network or Wi-Fi to download data.</code></p><p>and two buttons, Settings, Cancel.</p><p>How do I detect there is no internet connection?<br>How do I popup a same dialog in my application?</p>","243782","","243782","","2010-05-12 10:25:34","2013-02-27 18:57:20","How can I popup when no connection the default Connection Failed dialog?","<android>","2","0","3","",""
"2817853","1","","","2010-05-12 10:22:48","7","1040","<p>I need to redraw the overlay after the user zooms.<br>What is the best way to do this?<br>I've tried everything I can think of (saving a getZoomLevel() state, overriding onUserInteraction()), nothing actually works.<br>The problem is, that draw() is being called when the user clicks zoom, so the information my draw method gets (About the map's state) is different from the state after the mapview finishes zooming.<br>Also, draw() isn't being called at the end of the zoom, so only if I pan the map the overlay is actually being drawn properly.</p>","184973","","","","","2011-02-02 20:17:54","Zoom events that work in an android Mapview","<android><google-maps><android-mapview><zooming>","2","0","","",""
"2817905","1","","","2010-05-12 10:28:52","0","327","<p>i am using following code to create custom adapter for listview.now i want to use trackball click event in it but i dont know how to do that can any one help me out in creating ontracballevent in custom adapter?i have tried writing few lines  but not able to solve it.</p><pre><code>public  class EfficientAdapter extends BaseAdapter implements Filterable {        private LayoutInflater mInflater;        private Context context;         int pos;        public EfficientAdapter(Context context) {          mInflater = LayoutInflater.from(context);          this.context = context;        }        public View getView(final int position, View convertView, ViewGroup parent) {          ViewHolder holder;            convertView = mInflater.inflate(R.layout.adaptor_contentposts, null);convertView.setOnClickListener(new OnClickListener() {              @Override              public void onClick(View v) {</code></pre><p>//click functionality}                });</p><pre><code> MotionEvent event= MotionEvent.CREATOR.createFromParcel(null);            switch (event.getAction())             {            case MotionEvent.ACTION_DOWN:                //display click message            }            convertView.onTrackballEvent(event); return convertView;        }  class ViewHolder {          TextView textLine;          TextView textLine2;          TextView PostedByAndPostedOn;          ImageButton ImgButton;        }        @Override        public Filter getFilter() {            return null;        }        @Override        public long getItemId(int position) {            return 0;        }        @Override        public int getCount() {          return ad_id.length;        }        @Override        public Object getItem(int position) {          return ad_id[position];        }      }</code></pre>","249991","","","","","2010-05-12 10:32:12","how to create trackballevent in android custom adapter?","<android><adapter>","1","0","","",""
"2817931","1","2818173","","2010-05-12 10:32:24","6","5063","<p>I am about to build my own dialog to notifiy the user the app doesn't reach the internet, and I am planning to put two buttons on it. Settings, and Cancel as it is seen in many other apps.</p><p>I am wondering now, How do I launch settings directly on Wireless &amp; networks page?</p>","243782","","","","","2010-05-12 11:08:56","How do I launch settings directly on Wireless & networks page?","<android>","1","0","","",""
"2818005","1","","","2010-05-12 10:42:57","3","314","<p>My android application loads some markers on an overlay onto a MapView.<br>The markers are placed based on a dynamic list of GeoPoints.<br>I want to move the map center and zoom into the area with most items.<br>Naively, I can calculate the superposition of all the points, but I would like to remove the points that are very far from the mass of points from the calculation.<br>Is there a known way to calculate this ? (e.g. probability, statistics .. ?)</p>","184973","","184973","","2010-05-15 11:47:55","2011-01-28 09:15:21","Determining where to animate the map given a list of GeoPoints","<android><android-mapview><zooming>","1","0","","",""
"2818086","1","2818362","","2010-05-12 10:56:30","23","32589","<p>What is the function to get the current UTC time. I have tried with System.getCurrentTime but i get the current the of the device.</p><p>Thanks</p>","258863","","8331","","2011-04-21 11:54:59","2011-10-25 00:32:14","Android get Current UTC time","<java><android><datetime><time><utc>","2","0","10","2013-04-03 22:14:55",""
"2818204","1","2823592","","2010-05-12 11:13:32","19","8196","<p>When I generate javadoc for my Android project in Eclipse, there are lots of warnings like</p><pre><code>cannot find symbolsymbol  : class TextView</code></pre><p>and </p><pre><code>warning - Tag @see: reference not found: android.app.Dialog</code></pre><p>I also tried </p><pre><code>-link http://developer.android.com/reference/-link http://java.sun.com/j2se/1.4.2/docs/api/</code></pre><p>in <code>Extra javadoc options (path names with white spaces must be enclosed in quotes)</code> tab in <code>Configure Javadoc Arguments</code> (3rd dialog of eclipse->project->Generate Javadoc).</p><p>But only <code>-link <a href=""http://java.sun.com/j2se/1.4.2/docs/api/"">http://java.sun.com/j2se/1.4.2/docs/api/</a></code> is working i.e for String class link <code>http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true</code> is generated. but for <code>android.app.Dialog</code> , no link is generated.</p><p><strong>Edit</strong></p><p>I also tried selecting <code>android.jar</code> in <code>Select referenced archives and projects to which links should be generated</code>tab in <code>Configure Javadoc arguments for standard doclet</code> (2nd dialog of eclipse->project->Generate Javadoc),but this creates local links to docs in local android-sdk directory, NOT the online Android references like it does for Java APIs.</p>","301444","","1288","","2011-05-13 15:16:32","2012-08-26 14:39:07","How to generate links to the android Classes' reference in javadoc?","<android><javadoc>","5","0","9","",""
"2818284","1","2818390","","2010-05-12 11:24:14","1","4035","<p>ive implement simple udp server on my Android device.(sdk 1.5)it works fine when i am runnning a local client on the phone sends through it trigger to my server.</p><p>but when i try to get udp call from an outside server to my phone, it doesnt work.already make sure the outside server isnt blocked by firewall and it's sending the udp trigger to the right port, which my phone is listening to.</p><p>i used natstat on the phone and checked that the phone is realy listening to the it's local ip and the port ive setted it to.</p><p>here is my code of the server:(on the device)</p><pre><code>    // server will listen to one client    try    {        Thread udpServerThread = new Thread()        {            @Override            public void run()            {                try                {                //   Retrieve the ServerName                             InetAddress serverAddr = InetAddress                            .getByName(""localhost"");                    Log.d(""UDP"", ""S: Connecting..."");                    // Create new UDP-Socket                     socket = new DatagramSocket(SERVERPORT,serverAddr);                    byte[] buf = new byte[17];                    // * Prepare a UDP-Packet that can contain the data we                    // * want to receive                    DatagramPacket packet = new DatagramPacket(buf,                            buf.length);                    Log.d(""UDP"", ""S: Receiving..."");                //   wait to Receive the UDP-Packet                     socket.receive(packet);                    Log.d(""UDP"", ""S: Received: '""                            + new String(packet.getData()) + ""'"");                    acceptedMsg=new String(packet.getData());                    notifyService(acceptedMsg);                    Log.d(""UDP"", ""S: Done."");                } catch (Exception e)                {                    Log.e(""UDP"", ""S: Error"", e);                }            }        };        udpServerThread.start();    }    catch (Exception E)    {     Log.e(""r"",E.getMessage())  ;    }</code></pre><p>so as i said, when i try it with local client(seperate thread) which sends udp trigger it works fine, but when i take this client implementation and put it on an outside real server,after UDP being sent, the phone doesnt respond to it.</p><p>any idea?</p><p>thanks,</p><p>ray.</p>","260511","","20270","","2010-05-12 11:39:24","2010-05-12 11:39:24","UDP server doesnt accept calls from outside","<android>","1","0","1","",""
"2818697","1","2840873","","2010-05-12 12:24:57","89","119497","<p>In the application I am developing, I would like to send messages in the form of JSON objects to a Django Server and parse the JSON response from the server and populate a custom listview.</p><p>From the little JSON knowledge I have, I thought this format for the response from server</p><pre><code>{  ""post"": {    ""username"": ""someusername"",    ""message"": ""this is a sweet message"",    ""image"": ""http://localhost/someimage.jpg"",    ""time"":  ""present time""  },}</code></pre><p>How much knowledge of JSON should I have to accomplish this purpose? Also it would be great if someone could provide me links of some tutorials for sending and parsing JSON Objects.</p><h2><a href=""http://primal.pw/android/2010/06/05/parsing-json-in-android/"">Complete Solution</a></h2>","323404","","323404","","2013-07-30 14:35:02","2014-03-19 15:37:06","Sending and Parsing JSON in Android","<android><json><parsing>","12","3","63","",""
"2818732","1","","","2010-05-12 12:30:36","0","225","<p>I wanted to know whether we can call Android's inbuilt ContactList. ?</p>","335984","","21234","","2010-05-12 12:34:46","2010-05-12 12:37:13","Call android inbuilt ContactList","<android><contacts>","1","0","","",""
"2818794","1","2819370","","2010-05-12 12:38:48","0","304","<p>When I am using the background attribute for a Layout, the Pixels of the background image looks like blurry. I think there must be a resolution Problem. for example in Api Demos there is a module in this path Graphics/BitmapsPixels. My background image is looks like a third image. i would need to show my background image like the second one. How to do this? Any tutorials, Samples are most Thankful.</p>","267269","","","","","2010-05-12 13:47:56","Image Pixels Problem in Android?","<android><background>","1","0","","",""
"2818920","1","2819048","","2010-05-12 12:53:55","2","1353","<p>I will try to keep it simple:</p><p>In my main activity I make a handler:</p><pre><code>public class ARViewer extends ARDisplayActivity {    public final MHandler mHandler = new MHandler(this); public void onCreate(Bundle savedInstanceState) {...</code></pre><p>The class MHandler:</p><pre><code>public final class MHandler extends Handler{        //main activity private ARViewer arnv;        public MHandler(ARViewer arnv){  this.arnv = arnv; }        @Override public void handleMessage(Message msg) {            ...            case H_RR :                  arnv.setContentView(R.layout.routeplanner);                      break;            ...  super.handleMessage(msg); }}</code></pre><p>But if I call the handleMessage method from a callback function in a other Class, definitely from a other thread, I still get the exception message: <code>CalledFromWrongThreadException (Only the original thread that created a view hierarchy can touch its views)</code> :</p><pre><code>public void rFound(Route route) {           Message msg = new Message();           msg.what = MHandler.H_RR;           ARViewer.arnv.mHandler.handleMessage(msg);}</code></pre>","193850","","193850","","2010-05-12 13:01:39","2010-05-12 14:59:09","Can't resolve CalledFromWrongThreadException with Handler","<android><exception><multithreading>","2","0","1","",""
"2819027","1","2819158","","2010-05-12 13:09:03","0","164","<p>What is the Difference between Encoder and Decoder in <a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">Supported Media Formats</a> in android? What is the Need of it? Which is the recommended image Format by you?</p>","267269","","","","","2010-05-12 13:24:23","Media Formats in Android?","<android>","1","0","","",""
"2819151","1","","","2010-05-12 13:23:21","2","1655","<p>I have two tables and I want to get all records from one table that are different from the records in second table.</p><p>Eg.: if we have four records in the first table like A,B,C,D and three records in the second table thats A,B,C then the answer of query should be D.</p><p>I have tried ""EXCEPT"" operator but it doesn't work fine. Kindly help me in writing correct query for the given problem.</p>","208436","","7856","","2010-05-12 15:01:25","2012-01-12 07:44:48","How to differentiate two tables","<sql><android><sqlite>","4","2","1","",""
"2819778","1","","","2010-05-12 14:35:23","79","68682","<p>Reading the limited documentation that Google has provided, I get the feeling that it is possible to change the look (drawable) of a ProgressBar/ProgressDialog by simply creating a new style an assigning it to the style property of the ProgressBar. But I cannot get this to work properly. Here is what I did so far:</p><p>I created a shape like this (mp2.xml)</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=""ring""  android:innerRadiusRatio=""4""  android:thicknessRatio=""4""  android:useLevel=""false""&gt; &lt;size android:width=""50dip"" android:height=""50dip"" /&gt; &lt;gradient android:type=""sweep"" android:useLevel=""false"" android:startColor=""#300000ff"" android:centerColor=""#500000ff"" android:endColor=""#ff0000ff"" /&gt;&lt;/shape&gt;</code></pre><p>then created an animation (mp3.xml) like this:</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=""false""&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""0"" android:toDegrees=""30"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""30"" android:toDegrees=""60"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""60"" android:toDegrees=""90"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""90"" android:toDegrees=""120"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""120"" android:toDegrees=""150"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""150"" android:toDegrees=""180"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""180"" android:toDegrees=""210"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""210"" android:toDegrees=""240"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""240"" android:toDegrees=""270"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""270"" android:toDegrees=""300"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""300"" android:toDegrees=""330"" android:repeatCount=""1"" /&gt; &lt;/item&gt; &lt;item android:duration=""70""&gt;  &lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/mp2"" android:pivotX=""50%"" android:pivotY=""50%"" android:fromDegrees=""330"" android:toDegrees=""360"" android:repeatCount=""1"" /&gt; &lt;/item&gt;&lt;/animation-list&gt;</code></pre><p>then created a style (attrs.xml) like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt; &lt;style parent=""@android:style/Widget.ProgressBar"" name=""customProgressBar""&gt;  &lt;item name=""android:progressDrawable""&gt;@anim/mp3&lt;/item&gt; &lt;/style&gt;&lt;/resources&gt;</code></pre><p>and the in my main.xml I have set the style 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"" android:drawingCacheQuality=""high""&gt; &lt;ProgressBar android:id=""@+id/ProgressBar01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" style=""@style/customProgressBar""/&gt;&lt;/LinearLayout&gt;</code></pre><p>But it still shows the same drawable as before. What am I doing wrong?</p>","339392","","77914","","2011-03-15 20:04:19","2013-05-27 11:46:18","Custom Drawable for ProgressBar/ProgressDialog","<android><progress-bar><progressdialog>","6","3","73","",""
"2819902","1","2820000","","2010-05-12 14:48:05","1","1496","<p>When my app starts, it checks to see if it has stored login credentials. if it doesn't, it starts another activity to prompt the user for those credentials. My problem is, that when the prompt activity is started, the first activity continues execution and ends up with null pointers because the prompt activity has not yet returned the needed data</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    tv = new TextView(this);    setContentView(tv);    promptForLoginInfo(); //method creates intent and starts activity    displayCredentials(); //prints data to screen}</code></pre><p>the output reads: ""null"" because the program executes ""displayCredentials()"" before the login prompt activity returns.</p><p>Anyone have a clue what to do?</p>","339428","","","","","2010-05-12 14:58:16","android: pausing an activity until another finishes","<android><multithreading><wait><workflow-activity>","3","0","","",""
"2820284","1","3657259","","2010-05-12 15:28:22","5","4397","<p>I am trying to upload a file to some url using ssl. I use this code to set trust manager - </p><pre><code>public static void trustAll () {    TrustManage[] trustEverythingTrustManager = new TrustManager[] {        new X509TrustManager() {            public void checkClientTrusted(X509Certificate[] chain,            String authType) throws CertificateException {            // TODO Auto-generated method stub            }            public void checkServerTrusted(X509Certificate[] chain,            String authType) throws CertificateException {            // TODO Auto-generated method stub            }            public X509Certificate[] getAcceptedIssuers() {            // TODO Auto-generated method stub            return null;            }        }    };    SSLContext sc;    try {        sc = SSLContext.getInstance(""TLS"");        sc.init(null, trustEverythingTrustManager, new SecureRandom());        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());    } catch (Exception e) {    }}</code></pre><p>and this one to set host name verifier - </p><pre><code>public static HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {    public boolean verify(String hostname, SSLSession session) {        return true;    }};</code></pre><p>then i am opening connection like this - </p><pre><code>URL url = new URL(""some_url"");HttpURLConnection connection = null;// check if this is https or just httpif (url.getProtocol().toLowerCase().equals(""https"")) {    trustAll();    HttpsURLConnection https = (HttpsURLConnection) url.openConnection();    https.setHostnameVerifier(DO_NOT_VERIFY);    connection = https;} else {    connection = (HttpURLConnection) url.openConnection();}</code></pre><p>After i get the connection i use it to upload the data. Is i use http everything is ok but when i try https i get the following exception - </p><p>Write error: I/O error during system call, Broken pipejava.io.IOException: Write error: I/O error during system call, Broken pipeat org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativewrite(Native Method)at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$600(OpenSSLSocketImpl.java:55)at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:565)at java.io.OutputStream.write(OutputStream.java:82)at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection$HttpOutputStream.write(HttpURLConnection.java:652)at java.io.DataOutputStream.write(DataOutputStream.java:101)</p><p>The strange thing is that i don't get exception all the time. When i try to upload small files (200K) it's working O.K. or it's crashing very rare but when i try to upload bigger ones (more than 1MB) i get the exception almost every time.</p><p>Any ideas ?</p>","184601","","184601","","2010-05-12 15:34:02","2010-09-07 09:06:01","ssl on android strange issue","<android><ssl>","1","2","4","",""
"2820514","1","","","2010-05-12 15:55:26","1","613","<p>I would like to have different select regions on and image button that are not rectangular?  Is that possible?  </p>","339489","","","","","2010-10-19 03:31:18","Android - What is the best way to create different select (touch regions) on an image button/view","<android><image><button><region>","1","0","","",""
"2820820","1","2820898","","2010-05-12 16:31:46","0","128","<p>I'm interested in knowing how much the IPC mechanisms are meant to be exposed to the outside world. That is, if I wanted to impersonate a dalvik VM instance without having my app actually written in Java, am I allowed to do so, or will the protocol change the next time I look away from the screen? If it's allowed, what are the stability guarantees or lack thereof? Is there anything like documentation, or am I supposed just to read the fine sources on android.git.kernel.org?</p><p>The purpose of it all would be to write apps in !Java languages while retaining the ability to construct GUIs. I don't care or mind if the code is technically inside a dalvik process as a JNI callout, what I'm interested in is ""if I'm really good at pretending I'm Java over the wire, can I do everything actual Java code can? Or is there something that's only available as Java bytecode and nothing else?""</p>","339482","","","","","2010-05-12 16:41:28","Is Android IPC plumbing exposed in any official and/or supported way?","<android>","1","0","","",""
"2821270","1","2821949","","2010-05-12 17:34:33","0","1656","<p>I have performed some initial research, but have not found exactly what I am looking for (yet).  </p><p>I wanted to know if it is even possible to either set up or modify email account settings programmatically.  I do not believe it is, due to email applications controlling their own settings (and thus would depend upon a ContentProvider from that specific client), but I have not yet found a definitive ""no"", either.</p><p>Further, I was wondering about the email account support on Android in general.  It appears that Android 2.0 and above will allow for multiple ActiveSync/Exchange accounts and mulitple IMAP/POP3 accounts, and displays these in the same inbox.  Is this claim true?  Also, how is this different from the other major Android releases (Android 1.5 and 1.6)?</p>","261513","","","","","2010-05-12 19:08:18","Android Email Programmatic Setup","<android>","1","0","1","",""
"2821347","1","2821681","","2010-05-12 17:43:52","1","3287","<p>I am having a VideoView playing video on my Android app. When I try it on the potrait orientation, the video fills the screen. But when I change the orientation to landscape, the video takes up only half the screen space. I am using FILL_PARENT, FILL_PARENT as the layout params.</p><p>Is there a way I can have the video fill the screen in both orientations?</p><p>ThanksChris</p>","321927","","","","","2010-07-19 14:05:08","Android VideoView orientation change","<android><layout><orientation><videoview>","3","1","1","",""
"2823395","1","2823450","","2010-05-12 23:02:29","5","504","<p>Apart from <a href=""http://developer.android.com/guide/appendix/g-app-intents.html"">http://developer.android.com/guide/appendix/g-app-intents.html</a> (which is quite good but fairly limited in the number of apps/uri's it covers) I've been unable to find a decent reference source for looking up URI's to use when integrating with google apps.</p><p>I'm currently working on triggering the ""add new contact"" UI, and have found that the tel: uri pattern seems to work, but what if I only have a name and an email?</p><p>I wouldn't have expected I'd need to rely on sample code / trial and error, but I really can't see anywhere where the intent/URI interface is supposed to be documented in android apps.</p><p>Does such a standard exist?<br>Is there some quasi standard / user database that I can consult?</p><p>On a platform with such a good inter-interoperability architecture it just seems like something so useful I can't believe it's not there</p>","77528","","","","","2010-05-12 23:16:58","Is there a definitive list of uri patterns for use in android apps made by google?","<android><documentation><reference><android-intent>","1","0","0","",""
"2823696","1","2823785","","2010-05-13 00:21:56","3","2818","<p>My application will have some customisation for each company that uses it. Up until now, I have been loading images and strings from resource files. The idea is that the default resources will be distributed with the application and company specific resources will be loaded from our server after they click on a link from an email to launch the initialisation intent. Does anyone know how to replace resource files? I would really like to keep using resource files to avoid rewriting a lot of code/XML.</p><p>I would distribute the application from our own server, rather than through the app store, so that we could have one version per company, but unfortunately this will give quite nasty security warnings that would concern our customers.</p>","165495","","","","","2011-10-29 03:15:08","Download and replace Android resource files","<android><resources>","2","0","2","",""
"2823808","1","2823935","","2010-05-13 00:51:27","12","41840","<p>I;ve been trying to create a custom button in android using this tutorial - <a href=""http://www.gersic.com/blog.php?id=56"">http://www.gersic.com/blog.php?id=56</a></p><p>It works well but it doesn't say how to change the font size or weighting. Any ideas?</p><p>There was another question on here and the only answer was to use html styling but you can't change a font size in html without using css (or the deprecated font tag). There must be a better way of setting the pixel size of the font used on buttons?</p>","56007","","","","","2013-11-06 07:06:00","Android button font size","<android>","5","1","1","",""
"2823881","1","","","2010-05-13 01:14:01","0","1713","<p>I am working on mobile/server security related project. I am now stuck in generating a Diffie-Hellman key agreement part. It works fine in server side program but it is not working in mobile side. Thus, I assume that it is not compactible with Android.</p><p>I used the following class to get the parameters. It returns a comma-separated string of 3 values. The first number is the prime modulus P. The second number is the base generator G. The third number is bit size of the random exponent L.  </p><p><em>My question is is there anything wrong with the code or it is not compactible for android?What kind of changes should I do?</em><br>Your suggestion and guidance would be very much help for me. Thanks a lot in advance.</p><pre><code>public static String genDhParams() { try {// Create the parameter generator for a 1024-bit DH key pairAlgorithmParameterGenerator paramGen = AlgorithmParameterGenerator.getInstance(""DH"");paramGen.init(1024);// Generate the parametersAlgorithmParameters params = paramGen.generateParameters();DHParameterSpec dhSpec = (DHParameterSpec)params.getParameterSpec(DHParameterSpec.class);// Return the three values in a stringreturn """"+dhSpec.getP()+"",""+dhSpec.getG()+"",""+dhSpec.getL();} catch (NoSuchAlgorithmException e) {} catch (InvalidParameterSpecException e) {}return null;}</code></pre><p>Regards,<br><em>Sebby</em></p>","290167","","290167","","2010-05-13 01:36:50","2011-02-04 18:44:48","How To Generate Parameter Set for the Diffie-Hellman Key Agreement Algorithm in Android","<java><android><diffie-hellman>","1","5","","",""
"2824015","1","","","2010-05-13 01:54:48","4","9506","<p>From 2.0 the cts is freely downloadable from android's repository.</p><p>But there is no documents about it.</p><p>Does anyone can tell me:</p><ol><li>how to build cts? Is there a standard procedure?</li><li>How to run cts?</li><li>How to add customized test case?</li></ol><p>Here, share my experience.After repo sync all source, you can't directly run ""make"" to build all source.You will get some errors.</p><p>Now, I'am trying to first build android source without cts, and then build cts alone.</p><p>Also, here are some reference for run cts:</p><ol><li><a href=""http://i-miss-erin.blogspot.com/2010/05/how-to-add-test-plan-package-to-android.html"" rel=""nofollow"">http://i-miss-erin.blogspot.com/2010/05/how-to-add-test-plan-package-to-android.html</a></li><li>www.mentby.com/chenny/how-does-cts-work-where-can-i-get-the-test-streams.html</li><li>www.jxva.com/?act=blog!article&amp;articleId=157</li></ol><p><strong>1st time Update @ 5-13 18:39 +8:00</strong></p><p>I do the following steps: </p><blockquote>  <p>1.build android source without cts (move cts out of the $SDK_ROOT). </p>    <p>2.build cts (move cts back).</p></blockquote><p>both jdk1.5 and 1.6 have the following errors: </p><p>1.The 1st time ""make cts"" report:</p><blockquote>  <p>""Caused by:  java.io.FileNotFoundException: ...(Too  many open files)""</p></blockquote><p>2.The 2nd time ""make cts"" report:</p><blockquote>  <p>""acp: file  'out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/tests/data'  does not exist""</p></blockquote><p>3.The 3rd time ""make cts"" report:</p><blockquote>  <p>""/bin/bash: line 0: cd:  out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/hostjunit_files/classes:  No such file or directory""</p></blockquote><p>4.The last time ""make cts"" report:</p><blockquote>  <p>""zip error: Nothing to do! (try: zip  -q -r ../../android.core.vm-tests.jar . -i .)""</p></blockquote>","252894","","252894","","2010-05-13 10:38:05","2014-04-01 02:43:17","How to build android cts? And how to add and run your test case?","<android><cts>","2","1","2","",""
"2824257","1","2826066","","2010-05-13 03:28:25","3","5853","<p>Can any one help with how to test sensor events like shake on Android Emulator.I have found some posts pointing to openintents but can anyone explain how to use it in android 2.0 avd</p><p><a href=""http://code.google.com/p/openintents/wiki/SensorSimulator"" rel=""nofollow"">http://code.google.com/p/openintents/wiki/SensorSimulator</a></p><p>This has some solution but while installing OpenIntents.apk on emulator gives missing library error.</p><p>I succeded the steps till the line:</p><blockquote>  <p>If you don't have it already, install  the latest version of OpenIntents.apk  on your mobile phone.</p></blockquote><p>I am stuck on this line:</p><p>I found deprecated version (not latest) of OpenIntents.apk , but while installing gives missing library error.</p><p>Any help ?</p>","315619","","315619","","2010-05-13 04:39:27","2010-05-13 10:38:05","Testing Shake events on Android Emulator","<android>","1","0","","",""
"2824533","1","","","2010-05-13 05:09:25","0","269","<p>I have seen the BusinessCard example provide in Android examples.</p><p>I am using ContactAccessor abstract class to seperate out the SDK versions. </p><p>My code is running fine for 2.0 onwards, but when I am trying to build the code in Adnroid 1.6 I am getting the following errors:</p><ol><li>Build.VERSION_CODES.ECLAIR is not resolved.</li><li>Getting errors in the whole class in which I have used Contacts APIs from 2.0 (say in class ContactAccessorSdk5.java).</li></ol><p>How to resolve these issues?</p><p>I want to run my App on both the versions.</p><p>Please help me.</p><p>Regards,</p><p>Dhaiwat Bhavsar.</p>","193583","","","","","2011-02-07 07:12:02","Getting error in integrating Contacts APIs in Android 1.6 and 2.0","<android>","2","0","","",""
"2824554","1","2824574","","2010-05-13 05:18:05","1","1743","<p>i have HTC hero phone with operating system 1.5 i want to upgrade it to version 2.1 can any one guide me the complete procedure ? </p><p>any help would be appriciated.</p>","249991","","","","","2010-07-28 20:08:57","how to upgrade HTC hero from os 1.5 to 2.1?","<android>","2","1","1","",""
"2824614","1","","","2010-05-13 05:37:19","0","1672","<p>Pressing the back button causes onPause to be called, and the app stays paused until it is re-launched by clicking on the icon, at which point, onDestroy gets called, and the main activity continues to shut down. </p><p>Simple class to demonstrate.  Note, as far as I can tell, this <em>only</em> happens on the Nexus One.  I can't reproduce it in the emulator or on my Droid.</p><pre><code>package com.vimtips.testshutdown;import android.app.ActivityGroup;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent;public class MainActivity extends ActivityGroup {    private static final String TAG = ""MainActivity"";    private int counter = 3;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public boolean onKeyDown(int keyCode, KeyEvent event) {        if(keyCode == KeyEvent.KEYCODE_BACK) {            if(counter-- &gt; 0) return true;        }        return super.onKeyDown(keyCode, event);    }    @Override    public void onPause() {            super.onPause();            Log.d(TAG, ""onPause called"");    }    @Override    public void onDestroy() {        super.onDestroy();        if(isFinishing()) {            Log.d(TAG, ""Shutting down"");        }    }}</code></pre><p>And here's the log:</p><pre><code>I/ActivityManager(  132): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.vimtips.testshutdown/.MainActivity }I/ActivityManager(  132): Displayed activity com.vimtips.testshutdown/.MainActivity: 305 ms (total 305 ms)D/MainActivity( 1393): onPause calledI/ActivityManager(  132): Displayed activity com.vimtips.testshutdown/.MainActivity: 302 ms (total 302 ms)D/MainActivity( 1393): Shutting down</code></pre><p>This doesn't appear to happen on a normal Activity, just an Activity group, though looking at Android's sourcecode, I can't figure out why.  It's causing some serious problems with my app.</p><p>Anyone know why this would happen?</p>","238849","","","","","2010-07-22 09:18:48","Pressing back button in ActivityGroup causes it to pause, and then continue shutting down the next time the app is started","<android>","2","0","","",""
"2824630","1","","","2010-05-13 05:44:13","11","2059","<p>Is it possible to generate android styled javadocs for my android project (like <a href=""http://developer.android.com/reference/java/lang/String.html"">http://developer.android.com/reference/java/lang/String.html</a>, instead of <a href=""http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html</a>)</p><p>Is it something regarding using of some custom doclet instead of standard doclet? If yes, then which one I have to use?</p>","301444","","301444","","2010-05-18 11:26:40","2011-04-02 01:22:31","How to generate android styled javadocs?","<android><javadoc>","2","0","3","",""
"2824723","1","","","2010-05-13 06:09:10","4","3921","<p>HI,</p><p>I'd like to know what kind of attributes should I use in xml to set the window title text size ?</p>","304866","","","","","2011-06-20 02:30:19","window title text size","<android>","1","0","1","",""
"2824744","1","2826079","","2010-05-13 06:15:23","1","194","<p>ive read this article by Mark Murphy, while i was looking for a solution to my case.</p><p>I have a Listener in my system, which suppose to get a UDP trigger times to times from an outside server, ive done this listener as a service. </p><p>how could i prevent it being shut off by the user? (SDK 1.5), i`am working for a company which create cell phones, and we spread the device with this Listener. </p><p>as soon as the listener goes off our systems will be terminated</p><p>any idea for this scenario?</p><p>*i`am already aware to the face, that the system could also take it off, but this case will be easier to handle and avoid.</p><p>thanks,</p><p>ray. </p>","260511","","","","","2010-05-13 10:39:35","Diamonds Are Forever. Services Are Not","<android>","1","5","1","",""
"2824795","1","","","2010-05-13 06:26:13","12","13971","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1740834/emulator-problem-in-android"">Emulator problem in Android</a>  </p></blockquote><p>emulator: ERROR: the user data image is used by another emulator. aborting</p><p>most of the time i face this problem..I restart Eclipse even..and restart emulator also..but still problem remain as it is. Why ?</p>","2624806","","996493","","2012-09-29 08:03:42","2012-09-29 08:03:42","Android Emulator Error ""emulator: ERROR: the user data image is used by another emulator. aborting""","<android><android-emulator>","2","1","1","2011-10-03 08:34:57",""
"2824802","1","3519703","","2010-05-13 06:27:57","0","2429","<p>HTC Evo 4G from Sprint has a front facing camera. The Sprint dev site has some info about it  <a href=""http://androidcommunity.com/sprint-sdk-for-htc-evo-4g-teaches-devs-to-use-front-video-cam-hdmi-more-20100324/"" rel=""nofollow"">http://androidcommunity.com/sprint-sdk-for-htc-evo-4g-teaches-devs-to-use-front-video-cam-hdmi-more-20100324/</a></p><p>My question is: is the front facing camera SDK going to be included in Froyo?</p>","338981","","","","","2010-08-19 07:42:39","Is Android 2.2 (froyo) going to support the front facing camera on the new phones?","<android><camera><htc><sprint>","1","1","","",""
"2824910","1","2824922","","2010-05-13 06:51:41","24","41540","<p>Could someone please give me some sample code that uses an output parameter in function? I've tried to Google it but just found it just in functions. I'd like to use this output value in another function.</p><p>The code I am developing intended to be run in Android. </p>","305732","","254477","","2012-11-08 21:05:27","2012-12-17 11:53:28","How to use an output parameter in Java?","<java><android><parameters>","6","1","5","",""
"2825026","1","2829540","","2010-05-13 07:20:14","1","1646","<p>I am trying to parse a RSS2.0 feed, obtained from a remote server, on my Android device using XML Pull Parser. </p><pre><code>// get a parser instance and set input,encoding XmlPullParser parser = Xml.newPullParser();  parser.setInput(getInputStream(), null);</code></pre><p>I am getting invalid token exceptions after a few items have been parsed:</p><blockquote>  <p>Error parsing document. (position:line  -1, column -1) caused by: org.apache.harmony.xml.ExpatParser$ParseException:  At line 158, column 25: not  well-formed (invalid token)</p></blockquote><p>Strangely, when I download the feed XML on the device, bundle it inside the raw folder and then run the same code. Everything works fine. </p><p>What could be the problem here? How do I validate the XML before I parse it on device?</p><p>[EDIT: If this is set: <code>parser.setProperty(XmlPullParser.FEATURE_VALIDATION,true);</code> parsing fails immediately]Thanks.</p>","236128","","236128","","2010-05-13 07:35:27","2010-05-13 19:09:26","Parsing RSS2.0 feeds using Pull Parser on Android","<android><exception-handling><rss><xmlpullparser>","1","2","1","",""
"2825272","1","2825951","","2010-05-13 08:17:42","5","5737","<p>I'm trying to make a custom dialog to show a view in this dialog. This is the Builder code:</p><pre><code>//Getting the layoutLayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);View layout = inflater.inflate(R.layout.custom_dialog_simple,                               (ViewGroup) findViewById(R.id.rlDialogSimple));//Change Text and on clickTextView tvDialogSimple = (TextView) layout.findViewById(R.id.tvDialogSimple);tvDialogSimple.setText(R.string.avisoComprobar);Button btDialogSimple = (Button) layout.findViewById(R.id.btDialogSimple);btDialogSimple.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        //Do some stuff        //Here i want to close the dialog    }});AlertDialog.Builder builder = new AlertDialog.Builder(AcPanelEditor.this);builder.setView(layout);AlertDialog alert = builder.create();alert.show();</code></pre><p>So, i want to dismiss the dialog in the onClick of btDialogSimple. How i can do it? I don't know how to call the dismiss method from inside a onclicklistener.</p><p>My buttons have a custom layout, so i don't want to make a builder.setPositiveButton.</p><p>Any ideas?</p>","309853","","","","","2013-12-01 12:52:40","Dismiss a custom dialog?","<android><dialog>","3","1","1","",""
"2825360","1","2826096","","2010-05-13 08:34:38","5","2190","<p>I have developed some reusable android component which is basically a class . This class has some resource dependencies e.g. some png drawables, some xml layouts etc. So this class referenced the auto-generated R file.I would like to distribute this code in a single package like jar file to other developers for use in their applications. </p><p>I have read that the only possible solution is to distribute code together with all my resources, which others have to copy to their ""res"" folder (<a href=""http://stackoverflow.com/questions/1995004/packaging-android-resource-files-within-a-distributable-jar-file/2825174#2825174"">source</a>).</p><p>So I created a jar file having the class file (say MyClass which is in the package <code>com.xyz.android.app</code>) and resources and tried to use this in my new application.</p><p>So I added the jar file to my new applications build path using <code>add external jars</code> option in eclipse and copied all the resources to my new application's res folder. (The activity class say MainActivity of my new application is in <code>com.abc.myapplication</code> package, just for the case if it may helpful)</p><p>But when I run this new application there is <code>java.lang.ClassCastException</code> in the MyClass class. I tried to debug the application and then I found that in the MyClass class, there is ""R cannot be resolved"" problem.</p><p>Then I changed MainActivity's package to <code>com.xyz.android.app</code> (which is not the way, other developers will be happy to do), But again the same problem.</p><p>But When I just copy the source java file such that both MainActivity.java and MyClass.java are in com.xyz.android.app package then application runs fine.</p><p>So if I need to distribute such that other users need not to bother these package naming things,how can I accomplish this?  Please help !!</p><p><strong>Edit</strong></p><p>In android.jar, there are also some resources.  How are they referenced in a project? How are they used in android classes? There is also android.R file?</p><p>Is it not possible to do the same thing i.e. to make jar file like android.jar for my reusable code?</p>","301444","","301444","","2010-05-14 04:29:23","2010-05-14 04:29:23","How to distribute the android reusable code in a package?","<android><jar>","3","0","2","",""
"2825415","1","","","2010-05-13 08:47:44","0","816","<p>I'm trying to integrate a MediaController on top of a MediaPlayer. The controller is displayed all right, but its buttons are disabled, and the progress slider does not respond properly. </p><p>I found very little documentation about it and I still don't understand how to use it. This is very important and urgent for me. Can anyone who has dealt with it before explain how it works? </p><p>Thanks, Eyal</p>","340081","","","","","2010-07-15 22:27:52","How to use the MediaController","<android><android-widget>","1","1","","",""
"2825505","1","2827101","","2010-05-13 09:05:04","15","4517","<p>Can multi-touch events be tested on the Android Emulator? Or is there any way to test this without an actual device? I am using the 2.0 sdk and want to test zoom-in/zoom-out with two fingers.</p>","315619","","17651","","2013-03-12 20:31:57","2013-03-12 20:31:57","Is there any way to test multi-touch on the Android Emulator?","<android><android-emulator><pinchzoom>","3","0","1","",""
"2825539","1","","","2010-05-13 09:10:29","3","3579","<p>I want to create a simple Map based application in android ,where i can display my current position.Instead of overlaying a simple Image on the MapView to represent the position, i want to overlay the GLSurfaceView on the MapView. But i don't know how to achieve this. Is there any way to do that?. Please anybody knows the solution help me.</p>","131062","","","","","2012-04-28 18:55:52","How to overlay GLSurfaceView over a MapView in Android?","<android><opengl-es>","2","1","2","",""
"2825571","1","","","2010-05-13 09:15:16","7","8750","<p>I would like to have a custom ListView, where each row contains an EditText field, that may be edited by the user. But when I click on one of the EditTexts I lose the focus, and can't type text there (I suppose because the other rows are redrawn and get the focus).What can I do?</p>","","Yossi","166661","","2012-02-16 10:40:23","2013-11-13 20:29:54","Android: EditText in ListView","<android>","2","0","3","",""
"2825761","1","","","2010-05-13 09:43:35","0","839","<p>I am developing an application using services and Remote interface. </p><p>I have a question about passing the reference of my Remote interface throughout Activities.</p><p>In my first Activity, I bind my service with my activity, in order to get a reference to my interface I use </p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {        @Override        public void onServiceConnected(ComponentName arg0, IBinder service) {            x = X.Stub.asInterface(service);        }        @Override        public void onServiceDisconnected(ComponentName arg0) {            // TODO Auto-generated method stub        }    };</code></pre><p>x being the reference to my interface.Now I would like to access this interface from another activity, I see two ways to do it but I don't know which one is the ""proper"" way to do it :</p><ul><li>passing x with my intent when I call the new Activity</li><li>redo <code>this.bindService(new Intent(y.this,z.class), mConnection, Context.BIND_AUTO_CREATE);</code> in the onCreate() of my new Activity</li></ul><p>What would you advice me to do ?</p>","290613","","","","","2011-05-31 02:14:59","How to pass Remote Interface (aidl) throughout Activities?","<android><service><activity><android-intent><aidl>","1","0","","",""
"2825919","1","2829339","","2010-05-13 10:11:23","2","3754","<p>I'm trying to send an e-mail containing HTML, but the HTML shows up literally. How can I send an HTML link? Here's my current code:</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""text/html"");emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{""[EMAIL PROTECTED]""});emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,""Subject"");<b>emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,""&lt;html>&lt;body>Example&lt;/body>&lt;/html>"");</b>context.startActivity(Intent.createChooser(emailIntent, ""Sendmail...""));</code></pre>","304961","","707111","","2012-07-19 17:42:57","2012-07-19 17:42:57","Sending HTML in an e-mail message's body","<java><android>","2","0","","",""
"2826412","1","6876276","","2010-05-13 11:40:50","1","1787","<p>I want to load third-party jni library in runtime.<br>I've tried to load directly from sdcard. It expectedly failed.<br>I've tried to copy library from sdcard to /data/data/app/ and then<br><code>System.load(/data/data/app/libjni.so)</code><br>It works on HTC HERO, but fails on HTC Legend with Android 2.1.it fails during execution of native code and write to log uninformative stack traceAny other way to do it? Thats the best piece of code, that works at 1.5(HTC Hero), but donot works on 2.1(HTC Legend).   </p><pre><code>FileInputStream fis = new FileInputStream(""/sdcard/libjni.so"");File nf = new File(""/data/data/app/libjni.so"");FileOutputStream fos = new FileOutputStream(nf);byte[] buf = new byte[2048];int n;while ((n = fis.read(buf)) &gt; 0)    fos.write(buf, 0, n);fis.close();fos.close();System.load(""/data/data/app/libjni.so"");</code></pre>","263423","","263423","","2010-05-14 03:49:56","2011-07-29 18:10:26","How to load jni from sd card on android 2.1?","<android><jni><native-code>","1","3","","",""
"2826576","1","2827082","","2010-05-13 12:07:52","2","4510","<p>I've got a custom view and I want to get the X and Y coordinates of a user click.  I've found that I can only get the coordinates from the onTouchEvent and an onClickEvent won't fire if I have an onTouchEvent.  Unfortunately the onTouchEventfires when the user drags the screen as well as clicking.</p><p>I've tried to differentiate between the two, but I still get the code firing when I'm dragging:</p><pre><code> public boolean onTouchEvent(MotionEvent event) {  int action = event.getAction();  if (action == MotionEvent.ACTION_DOWN) {                //fires on drag and click</code></pre><p>I've had a look at <a href=""http://stackoverflow.com/questions/1967039/onclicklistener-x-y-location-of-event"">this</a> but as I mentioned above I don't think the solution there will work as I can't get the onClick and the onTouch events working at the same time.  Maybe I'm doing something wrong in this respect, is there a normal way of dealing with capturing user input on custom events? Should I be able to use the onClick and onTouch events at the same time?  </p><p>Thanks, Martyn</p>","264276","","","","","2013-12-18 08:59:00","Android: custom view onClickEvent with X & Y locations","<android><view><user-input>","4","0","","",""
"2826739","1","","","2010-05-13 12:33:10","7","3571","<p>I want to use colors from a Theme to apply it to some HTML my app is rendering. I am wondering if I can do that?</p><p>I am looking to use colors like they are specified in themes.xml:</p><pre><code>    &lt;item name=""colorBackground""&gt;@android:color/background_dark&lt;/item&gt;    &lt;item name=""textColorPrimary""&gt;@android:color/primary_text_dark&lt;/item&gt;</code></pre><p>So looking at them they are declared in the same way. So I thought I could access them in the same way too.</p><p>That is not the cause though. When trying to access those values this way:</p><pre><code>    TypedValue tv = new TypedValue();    getTheme().resolveAttribute(android.R.attr.colorBackground, tv, true);    System.out.println(""tv.string="" + tv.string);    System.out.println(""tv.coerced="" + tv.coerceToString());    int colorResourceId = getResources().getColor(tv.resourceId);    System.out.println(""colorResourceId="" + colorResourceId);    tv = new TypedValue();    getTheme().resolveAttribute(android.R.attr.textColorPrimary, tv, true);    System.out.println(""tv.string="" + tv.string);    System.out.println(""tv.coerced="" + tv.coerceToString());    colorResourceId = getResources().getColor(tv.resourceId);    System.out.println(""colorResourceId="" + colorResourceId);</code></pre><p>I get this as a result:</p><pre><code>I/System.out( 1578): tv.string=nullI/System.out( 1578): tv.coerced=#ffffffff I/System.out( 1578): colorResourceId=-1I/System.out( 1578): tv.string=res/color/primary_text_light.xmlI/System.out( 1578): tv.coerced=res/color/primary_text_light.xmlI/System.out( 1578): colorResourceId=-16777216</code></pre><p>The results are different. The first one actually gives me the color ""#fffffff"" which would work for me, the second one only gives me an xml. </p><p>Do I need to jump through a few more hoops here to resolve the actual color? Does my original intention work at all? Maybe it won't work, because colors could be arbitrary drawables?</p><p>I didn't find any <i>relevant</i> documentation, but if you know any, just point me there please.</p><p>Btw. I also tried obtainStyledAttributes(), but this had basically the same issues.</p>","45867","","","","","2010-07-02 22:22:15","How to extract color values (#rgb) from an Android theme?","<android><themes>","1","0","3","",""
"2826786","1","3992302","","2010-05-13 12:41:41","2","3686","<p>I would like to show a notification that displays the progress of anongoing operation. That works well for me.But at the same time the remote view should contain cancel button to stop the ongoing operation. The usual content intent should still do something else, i.e. not cancel the ongoing operation. It seems though that I can only have one intent.</p><p>I have to specify a contentIntent that is launched when clicking onthe notification: If I don't specify that I get something along thoselines:</p><pre><code>E/ActivityManager(   62): Activity Manager CrashE/ActivityManager(   62): java.lang.IllegalArgumentException: contentIntent required ...</code></pre><p>For the ""cancel"" button I set another intent:</p><pre><code>Intent cancelSyncIntent = new Intent(""com.xyz.CANCEL_SYNC"");contentView.setOnClickPendingIntent(R.id.cancel_sync,                                    PendingIntent.getBroadcast(context, 0,                                    cancelSyncIntent, 0));</code></pre><p>But this never works. I always get the content intent when the buttonis clicked. It looks like I cannot use buttons in remote views ofnotifications?!</p><p>I could probably display a text: ""&lt;&lt; Press to cancel operation >>"", but that seems rather heavy handed.</p><p>Update: Afer J.'s recommendations:</p><pre><code>    final Notification n = new Notification(R.drawable.gen_auto_notification_icon, context.getResources()            .getString(                    fastSyncOnly ? R.string.fast_synchronization_running_notification_title                            : R.string.synchronization_running_notification_title), new Date().getTime());    n.flags = Notification.FLAG_ONGOING_EVENT;    final RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.in_progress_notification);    n.contentView = contentView;    // Intent cancelSyncIntent = new Intent(""com.newsrob.CANCEL_SYNC"");    Intent cancelSyncIntent = new Intent();    cancelSyncIntent.setClass(context, FireReceiver.class);    PendingIntent pendingCancelSyncIntent = PendingIntent.getActivity(context, 0, cancelSyncIntent, 0);    contentView.setOnClickPendingIntent(R.id.cancel_sync, pendingCancelSyncIntent);    Intent showDashboardIntent = new Intent(context, DashboardListActivity.class);    PendingIntent showDashboardPendingIntent = PendingIntent.getActivity(context, 0, showDashboardIntent, 0);    n.contentIntent = showDashboardPendingIntent;</code></pre>","45867","","45867","","2010-05-14 15:59:29","2010-10-21 21:54:10","PendingIntents in Notifications","<android>","2","0","1","",""
"2826916","1","2827844","","2010-05-13 12:59:41","0","6585","<p>I have an application that contains 3 activities A, B and C. The activity A is the one that gets started when I start my app. From A I start B using <code>mIntent.setClass(A.this, B.class);</code>, then <code>startActivity(mIntent);</code> this goes well. What goes wrong is when I want to start the activity C from B.</p><p>this how the manifestfile looks like:</p><pre><code>    &lt;activity android:name="".B""/&gt;    &lt;activity android:name="".C""/&gt;</code></pre><p>I know that I can do the follwoings: start B from A and then from B go back to A and then start C</p><p>or let B has its own manifestfile thus a stand lone app, and let C be an activity within this app.</p><p>Any suggestion is welcome. My apoligies for my bad english.</p><p>thank you</p>","263481","","263481","","2010-05-13 13:35:38","2010-05-13 20:13:26","android startactivity","<android><activity>","3","5","","",""
"2826942","1","","","2010-05-13 13:03:25","3","6103","<p>I made a custom view. If I add the view to the layout XML file and I set the height to <code>fill_parent</code> ""specSize"" return 0. Why?</p><p>Code:</p><pre><code>    @Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int measuredHeight = 90;        int specMode = MeasureSpec.getMode(heightMeasureSpec);        int specSize = MeasureSpec.getSize(MeasureSpec.getMode(heightMeasureSpec));        if(specMode != MeasureSpec.UNSPECIFIED){         measuredHeight = specSize;        }        setMeasuredDimension(60, measuredHeight);}</code></pre><p>Does anyone know how I can get the height of <code>fill_parent</code>?</p>","340283","","119895","","2011-07-09 17:09:30","2011-11-23 20:32:04","Android: Problem with onMeasure()","<android><layout>","2","0","1","",""
"2827079","1","","","2010-05-13 13:22:28","20","11402","<p>I need to find out how big a view will be after attaching it to its parent.</p><p>I have overridden this method:</p><pre><code>onMeasure(int, int);</code></pre><p>but it looks like this method is invoked only when I actually add my custom view to it's container using:</p><pre><code>addView(myView);</code></pre><p>Do you think there is a way to get this information before rendering the view itself? Basically I need to know the actuall size before attaching it and not attach the view at all if it would take more certain amount of space.</p><p>anybody?</p>","87624","","","","","2013-05-12 22:09:22","measuring a view before rendering it","<android>","4","0","7","",""
"2827143","1","3692390","","2010-05-13 13:31:09","5","6360","<p>I have made an App that can connect to a program that I am running on a server, but it only seems to work with WiFi. When I try to use 3G it doesn't make the connection. Is there something special that I have to turn on or set in order to use 3G?</p>","314005","","314005","","2011-03-06 19:54:28","2011-06-02 13:27:06","How can I use a 3G internet connection in my Android App?","<android><internet><port><3g>","6","0","","",""
"2827144","1","2827251","","2010-05-13 13:31:11","1","14235","<p>I want to create a list view custom like this link :  <a href=""http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&amp;width=279"" rel=""nofollow"">http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&amp;width=279</a> </p><p>so far I have made a list view with text, and I am not extending list Activity, but I am extending Activity only.</p><p>please if someone can provide me with a code for this.</p><p>Thanks alot</p><p>Cheers</p><p>Kai</p>","328518","","","","","2012-12-29 20:29:32","How to create a custom listview in android","<android><image><listview>","3","0","1","",""
"2827248","1","","","2010-05-13 13:44:22","8","36433","<p>I am newb To Android.I just to check out few applications in my Desktop and have downloaded some sample applications. However, they are in the format .apk.Please let me know the procedure to import this file into Eclipse which helps me to run the application.</p><p>Regards,Serenity.</p>","340319","","","","","2014-04-07 10:27:57","how can I import .apk file of the downloaded file into Eclipse? Do we have this option?","<android>","8","0","","",""
"2827340","1","","","2010-05-13 14:00:06","1","2621","<p>How can I draw a pixel(2D view)for Android using OpenGlEs?</p><p>It is simple when we use for drawing</p><pre><code>draw(Canvas canvas){   ...} </code></pre><p>So using it we draw </p><pre><code>canvas.drawPoint(i, j, paint);</code></pre><p>But in OpenGlEs I still haven't got any function like it.</p><p>Please replyThank in Advance</p>","2624806","","1252063","","2012-08-03 11:45:25","2012-08-03 11:45:25","Draw Pixel using OpenGLEs for Android","<android><opengl-es><drawing>","2","0","2","",""
"2827367","1","2827857","","2010-05-13 14:03:16","0","1608","<p>i can implement the QSB on my app using onSearchRequested() method.i have 4 column in my table. when i was type in the QSB. it will give some suggestions on the Suggestion window. how to do that? searchable dictionary example shows the dictionary provider class to retrive the suggestions. but on that no data inserted. then how they getting the suggestions. can you explain me what are the steps we have to follow or tutorials, sample codes are most thankful.</p>","267269","","","","","2010-05-13 15:08:29","Suggestions on search in android?","<android><android-searchmanager>","1","0","","",""
"2827380","1","","","2010-05-13 14:04:40","3","778","<p>How can I control the trackball light in a nexus one ? I found something with NotificationManager but the samples do not work for me.</p><p>Thanks</p>","225691","","","","","2010-05-13 15:38:51","Android Nexus One - trackball light","<android>","1","0","","",""
"2827521","1","2827920","","2010-05-13 14:21:35","2","999","<p>How to get the dirty(changed) properties(any controls subclasses of view) amongst a number of properties  on a layout. Does android has a dirty flag to mark if the layout has any field that has a changed content??</p><p>Actually, i have a layout that has a few edittexts,spinners,datewidgets.Now doing a save should make request to the server only if the user has modified anything .I wanted to know that how can i check if the user has changed anything in that layout or not.Does android has any flag or something that sets itself when the user modifies any input control?</p><p>Hmm..Blckberry Does have isDirty(){boolean net.rim.device.api.ui.Manager.isDirty()}method. </p>","340353","","340353","","2010-05-13 15:28:48","2013-09-18 18:07:30","Android : How to get the dirty(changed) properties","<android>","3","1","","",""
"2827611","1","","","2010-05-13 14:32:50","3","3037","<p>I am trying to set up a GridView of buttons that responds to onTouch.  For example, if I swipe my finger across the screen horizontally, vertically or diagonally then I want the buttons which were touched to be selected.  I tried setting OnTouchListener's for the buttons, but this didn't work, only the first button in the drag event received the onTouch events.  </p><p>Next I tried creating an OnTouchListener for the GridView and then using the X,Y coords to determine which buttons where touched.  This doesn't seem to work either since the MOTION_DOWN events are only passed to the GridView's onTouch() if I start the drag on the very edge of the GridView.  In fact if I drag my finger horizontally across the grid, the onTouch events aren't fired at all unless I start the drag at the edge of the GridView.  Does anyone know of a better way to do this?</p><p>Thanks in advance.</p><pre><code>gridview.setOnTouchListener(new View.OnTouchListener(){ @Override public boolean onTouch(@SuppressWarnings(""unused"") View view, MotionEvent event) {  float X = event.getX();  float Y = event.getY();  switch (event.getAction()) {   case MotionEvent.ACTION_DOWN:   System.out.println(""Down: "" + X + "","" + Y);   break;  case MotionEvent.ACTION_MOVE:   System.out.println(""Move: "" + X + "","" + Y);   break;  case MotionEvent.ACTION_UP:    System.out.println(""Up: "" + X + "","" + Y);   break;   }  return true; }}</code></pre>","340352","","","","","2012-12-10 22:45:32","GridView onTouch","<android>","4","0","2","",""
"2827625","1","2827997","","2010-05-13 14:34:29","0","2227","<p>I am having layout which I want to render on to different sizes of mobile (like WVGA854). Resource structure is like </p><p>res\layout\main.xmlres\layout-large\main.xml</p><p>By default it is taking layout main.xml file itself of layout. Its not pointing to layout-large\main.xml</p><p>its throwing exception:Activity can not start resource not found</p><p>So can any one guide me how can I acheive this and how to support mutiple screens with different layouts like large,small and default along with images specified in respective dip folders.</p><p>Thanks in advance</p><p>Regards:Jayanth</p>","320276","","","","","2010-05-13 15:26:26","how to access layout-large layout in the activity?","<android><layout><activity>","1","0","","",""
"2827652","1","","","2010-05-13 14:39:28","0","635","<p>I have created a list activity where i have placed some items and i am using OnListItemClick to get the desired actions through D-pad and KeyLeft and KeyRight Buttons, In Emulator TouchEvent is not working , I want to know whether it works in real Handsets???How can i enable the TOuchEvent also, Can anyone please help me out in this.</p><p>Appreciate your Help</p><p>Thanks in Advance</p>","340374","","","","","2010-08-06 16:09:09","Android TouchEvent in ListActivity..!","<android><touchscreen><listactivity>","1","1","","",""
"2827662","1","4788681","","2010-05-13 14:41:09","5","4721","<p>I am currently trying to write a class in Android that will Scan for access points, calculate which access point has the best signal and then connect to that access point.</p><p>So the application will be able to scan on the move and attach to new access points on the go.</p><p>I have the scanning and calculation of the best signal working.</p><p>But when it comes to attaching to the best access point I am having trouble.</p><p>It appears that enableNetwork(netid, othersTrueFalse) is the only method for attaching to an Access point but this causes problems as from my Scan Results I am not able to get the id of the access point with the strongest signal.</p><p>This is my code:</p><hr><pre><code>public void doWifiScan(){  scanTask = new TimerTask() {  public void run() {      handler.post(new Runnable() {          public void run() {               sResults = wifiManager.scan(getBaseContext());                if(sResults!=null)               Log.d(""TIMER"", ""sResults count"" + sResults.size());               ScanResult scan = wifiManager.calculateBestAP(sResults);               wifiManager.addNewAccessPoint(scan);           }       });    }};    t.schedule(scanTask, 3000, 30000); }</code></pre><hr><pre><code>public ScanResult calculateBestAP(List&lt;ScanResult&gt; sResults){     ScanResult bestSignal = null;        for (ScanResult result : sResults) {          if (bestSignal == null              || WifiManager.compareSignalLevel(bestSignal.level, result.level) &lt; 0)            bestSignal = result;        }        String message = String.format(""%s networks found. %s is the strongest. %s is the bsid"",                sResults.size(), bestSignal.SSID, bestSignal.BSSID);        Log.d(""sResult"", message);        return bestSignal;}</code></pre><hr><pre><code>public void addNewAccessPoint(ScanResult scanResult){    WifiConfiguration wc = new WifiConfiguration();    wc.SSID = '\""' + scanResult.SSID + '\""';    //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 = mainWifi.addNetwork(wc);    Log.d(""WifiPreference"", ""add Network returned "" + res );    boolean b = mainWifi.enableNetwork(res, false);            Log.d(""WifiPreference"", ""enableNetwork returned "" + b );}</code></pre><hr><p>When I try to use addNewAccessPoint(ScanResult scanResult) it just adds another AP to the list in the settings application with the same name as the one with the best signal, so I end up with loads of duplicates and not actually attaching to them.</p><p>Can anyone point me in the direction of a better solution?</p>","243999","","","","","2014-02-27 19:03:23","Android - How to scan Access Points and select strongest signal?","<android><wifi><signals><scan><wifimanager>","2","0","2","",""
"2827756","1","3416774","","2010-05-13 14:52:39","0","1012","<p>I'm trying to define two different file extension mappings and two different mime-type IntentFilters in my manifest file but I can't seem to get them all to work; one works and others don't, etc.</p><p>How does one define multiple pathPatterns in the manifest?  Should/can all mime-types and pathPatterns be defined in a single IntentFilter?  Should they be different filters?  I can't find any examples that show multiple, distinct mappings.</p>","262119","","","","","2010-08-05 16:10:24","Defining multiple mime-type and file extension (pathPattern) mappings in AndroidManifest.xml?","<android>","1","1","","",""
"2828118","1","","","2010-05-13 15:39:22","3","342","<p>I've got a contextual menu that appears when a button is clicked. This menu has some links and after some seconds is hidden again. The problem is that after the menu has disappeared the links are still there. They are not shown but are clickable and the green border appears. And after some seconds they disappear. </p><p>I've tryied many ways of hiding the menu: display: none, visibility: hidden, width: 0, height: 0, jquery hide, jquery fadeout...  but none worked. Also hidding the links.</p><p>Does anyone have a idea about what's happening? With the rest of the browsers it works without problem</p><p>Thanks</p>","340437","","","","","2010-08-26 17:29:16","Hidden links are still clickable on the Android browser","<css><android>","1","0","","",""
"2828224","1","7750187","","2010-05-13 15:52:12","4","2990","<p>I made a Home application and I'd like to offer the ability to exit it and unset it as the default application.  </p><p>Exit is easy (just starting an intent) but the problem is I don't want my program to be launched again the next time the user click the Home button.</p><p>I know that this can be done by going in the <em>parameters / Applications / my app / erase default actions</em> but I would like to do it from my program so that the user doesn't have to search this function.  </p><p>How can it be done ?  </p>","263525","","","","","2011-11-17 22:41:50","programmatically unset a default application","<android>","1","0","","",""
"2828361","1","2829815","","2010-05-13 16:08:49","5","3059","<p>I've been trying to create a Compound Control in Android 1.5 (as <a href=""http://developer.android.com/guide/topics/ui/custom-components.html#compound"">described here</a>) but havn't been able to find any good examples on how to do this using an XML file to specify a layout. I'm fine with creating an Activity and then loading an xml file using the following in the constructor:</p><pre><code>setContentView(R.layout.main);</code></pre><p>However, I want to do this in subclass of LinearLayout - so I can use this compound component in other XML layouts. Something along the lines of:</p><pre><code>public class CustomView extends LinearLayout{  public CustomView(Context context) {       super(context);       setupView();  }  public CustomView(Context context, AttributeSet attrs)  {      super(context, attrs);      setupView();  }  public void setupView()  {    setContentView(R.layout.custom); // Not possible  }}</code></pre><p>What is the correct way of going about doing this?</p>","264257","","","","","2010-12-26 11:38:33","Create custom component based on LinearLayout, declaring layout in XML","<java><xml><android><layout>","1","0","1","",""
"2828623","1","2828701","","2010-05-13 16:46:30","6","1391","<p>I just read that <strong>Android has a 450% performance improvement because it added a JIT compiler</strong>, I know what JIT is, but I don't really understand why is it faster than normal compiled code? or what's the difference with the older approach from the Android platform (the Java like run compiled bytecode).</p><p>Thanks!</p><p>EDIT: This is hugely interesting, thanks!, I wish I could pick every answer as correct :)</p>","29253","","29253","","2010-05-13 17:16:22","2010-05-13 17:48:50","How a JIT compiler helps performance of applications?","<android><jit><compiler>","5","3","1","",""
"2828803","1","2829886","","2010-05-13 17:15:11","1","5678","<p>I'm still new to android and i'm having trouble creating a layout with two backgrounds that tile in the x direction but not y.</p><p>I've mocked up what I'm trying to create here...</p><p><a href=""http://img153.imageshack.us/img153/6008/cnbackground.png"" rel=""nofollow"">http://img153.imageshack.us/img153/6008/cnbackground.png</a></p><p>So the top section repeats horizontally, then there's a flat creen section in the middle in which I will center my content, then there's some horizontally repeating grass along the bottom.</p><p>Has anyone tried to do anything like this before?</p><p>Jon</p>","56007","","","","","2012-04-26 23:37:15","Android activity with multiple repeating backgrounds","<android>","2","0","3","",""
"2829204","1","","","2010-05-13 18:13:43","1","780","<p>Hey,I want to give the users of my app content in the same language as their ui interface. So if someone who has HTC Sense has their ui interface in Norwegian, they should get Norwegian content. However, while HTC Sense has Norwegian UI android does not include the norwegian locale, so the android sdk seems to not use the values-no/strings.xml file. How can I fix this? Basically I want the app to use the resources associated with the ui language of the phone.</p>","344871","","243782","","2010-05-13 18:25:52","2010-05-13 18:27:38","Detect ui language in htc sense on android","<android><locale><htc><htcsense>","1","3","","",""
"2829469","1","2829721","","2010-05-13 19:00:12","3","9381","<p>I would like to get a byte array from an jpeg image located in my res/drawable file ?</p><p>Does anyone know how to do that please ?</p>","290613","","1575570","","2013-07-23 11:31:36","2013-08-29 13:03:44","How to get a byte array from a drawable resource ?","<android><bytearray><resources><drawable>","3","0","","",""
"2829595","1","","","2010-05-13 19:15:04","1","3062","<p>I've more than one <code>Handlers</code> in an Activity. I create all the handlers in the <code>onCreate()</code> of the main activity. My understanding is the <code>handleMessage()</code> method of each handler will never be called at the same time because all messages are put in the same queue (the Activity thread MessageQueue). Therefore, they will be executed in the order in which are put into the Queue. They will also be executed in the main activity thread. Is this correct ? </p><pre><code> public void onCreate() {this.handler1 = new Handler() {@Overridepublic void handleMessage(Message msg) {                            //operation 1 : some operation with instanceVariable1super.handleMessage(msg);}};this.handler2 = new Handler() {@Overridepublic void handleMessage(Message msg) {                            //Operation 2: some operation with instanceVariable1super.handleMessage(msg);}};this.handler3 = new Handler() {@Overridepublic void handleMessage(Message msg) {                            //Operation 3: some operation with instanceVariable1super.handleMessage(msg);}};}</code></pre>","306346","","306346","","2010-05-13 19:46:33","2010-05-13 19:46:33","Android 2.1: Muliple Handlers in a Single Activity","<android><multithreading><handler><message-queue>","1","1","1","",""
"2830044","1","","","2010-05-13 20:23:39","6","5374","<p>If you want a button to provide haptic feedback (ie, the phone vibrates very briefly so you can feel that you really pushed the button), what's the standard way to do that?It seems you can either explicitly set an onClick() event and call the vibrate() function, giving a number of milliseconds to vibrate, or you can set hapticFeedbackEnabled in the view.</p><p>The documentation seems to indicate that the latter only works for long-presses or virtual on-screen keys:  <a href=""http://developer.android.com/reference/android/view/View.html#performHapticFeedback(int)"">http://developer.android.com/reference/android/view/View.html#performHapticFeedback(int)</a></p><p>If that's right, then I need to either make my button a virtual on-screen key or manually set the onClick() event.</p><p>What do you recommend?</p><p>Also, if I want the vibrating to happen immediately when the user's finger touches the button, as opposed to when their finger ""releases"" the button, what's the best way to accomplish that?</p><p>Related question:  <a href=""http://stackoverflow.com/questions/2228151/how-to-enable-haptic-feedback-on-button-view"">http://stackoverflow.com/questions/2228151/how-to-enable-haptic-feedback-on-button-view</a></p>","4234","","","","","2012-05-01 13:53:05","Android: Haptic feedback: onClick() event vs hapticFeedbackEnabled in the view","<java><android>","4","0","1","",""
"2830121","1","","","2010-05-13 20:35:31","2","445","<p>I have an issue with the following code:</p><pre><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                      WindowManager.LayoutParams.FLAG_FULLSCREEN);</code></pre><p>On my emulator this seems to work fine. The status bar disappears and the empty space is filled with the content view. However on my Nexus One this sometimes works and sometimes the empty space remains empty/black.</p><p>Any idea why this happens?</p><p>I tried to counteract this, but my naive approach wasn't fruitful: </p><pre><code>handler.postDelayed(new Runnable() {             @Override             public void run() {                 v.getRootView().invalidate();                 v.getRootView().requestLayout();                 v.getRootView().forceLayout();             }         }, 800);}</code></pre><p>I tried those things from above separately, synchronously and delayed (to wait for the hide animation to end first).</p>","45867","","","","","2010-05-13 21:35:23","Layout Issue Status Bar","<android>","1","0","1","",""
"2830664","1","2837516","","2010-05-13 22:10:16","15","14723","<p>For an <code>EditText</code> box, the user should only be entering valid numbers, so I am using <code>android:inputType=""numberDecimal""</code>. Unfortunately, the soft keyboard that Android brings up has numbers only along the top row, while the next three rows have various other symbols (dollar sign, percent sign, exclamation mark, space, etc). Since the <code>numberDecimal</code> only accepts numbers 0-9, negative sign, and decimal point, it would make more sense to use the ""phone"" soft keyboard (0-9 in a 3x3 grid, plus some other symbols). This would make the buttons larger and easier to hit (since it's a 4x4 grid rather than a 10x4 grid in the same screen area). Unfortunately, using <code>android:inputType=""phone""</code> allows non-numeric characters such as parentheses</p><p>I have attempted to use <code>android:inputType=""numberDecimal|phone""</code>, but the <code>numberDecimal</code> aspect of the bit flag seems to be ignored. I have also tried using <code>android:inputType=""phone""</code> in combination with <code>android:digits=""0123456789-.""</code>, but that still allows multiple negative signs or decimal points (<code>inputType=""number""</code> has really good error checking for things like that, and won't let the user even type it in). I have also tried using <code>android:inputType=""phone""</code> in the xml layout file, while using a <code>DigitsKeyListener</code> in the java code, but then that just uses the default number soft keyboard (the one that has numbers only along top row) (it appears to set <code>InputType.TYPE_CLASS_NUMBER</code>, which voids the <code>InputType.TYPE_CLASS_PHONE</code> set by the xml layout).</p><p>Writing a custom IME wouldn't work, since the user would have to select the IME as a global option outside the app.</p><p>Is there any way to use the ""phone"" style soft keyboard while also using the ""number"" restrictions on what is entered?</p>","340716","","1553909","","2013-06-12 13:15:32","2014-02-27 18:33:13","How do I use InputType=numberDecimal with the ""phone"" soft keypad?","<android><numeric-keypad>","5","2","6","",""
"2830669","1","3591416","","2010-05-13 22:10:57","2","2849","<p>In my Android app, I have a tabbed <code>Activity</code>. In one of the tabs I have two <code>TextView</code>s and two <code>EditText</code>s.  </p><p>The first <code>EditText</code> is only one line, and that's fine. However, I want the other <code>EditText</code>, <code>android:id=""@+id/paste_code""</code>, to take up the remaining space, but no matter what I do to it, it will only show one line. I don't want to manually set the number of lines, since the number that would fit on the screen differs based on your device.</p><p>Here's the relevant code. It's nested inside all the necessary components for a tabbed <code>Activity</code>.</p><pre><code>&lt;ScrollView    android:id=""@+id/basicTab""    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:layout_weight=""1"" &gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Paste title""            android:layout_weight=""0"" /&gt;        &lt;EditText            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:hint=""@string/paste_title_hint""            android:id=""@+id/paste_title""            android:lines=""1""            android:gravity=""top|left""            android:layout_weight=""0"" /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Paste text""            android:layout_weight=""0"" /&gt;        &lt;EditText            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:hint=""@string/paste_hint""            android:id=""@+id/paste_code""            android:gravity=""top|left""            android:layout_weight=""1"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","340743","","","","","2010-08-28 15:59:05","Android EditText won't take up remaining space","<android>","2","0","1","",""
"2830699","1","2831519","","2010-05-13 22:18:08","2","2238","<p>I want to create a simple android binary clock but my application crashes.I use 6 textview fields: 3 for the decimal and 3 for the binary representation of the current time (HH:mm:ss).Here's the code:</p><pre><code>import java.text.SimpleDateFormat;import java.util.Calendar;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class Binary extends Activity implements Runnable{ Thread runner;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);  if (runner == null)  { //start the song   runner = new Thread(this);   runner.start();  }    } @Override public void run() {  TextView hours_dec = (TextView) findViewById(R.id.hours_dec);  TextView mins_dec = (TextView) findViewById(R.id.mins_dec);  TextView secs_dec = (TextView) findViewById(R.id.secs_dec);  TextView hours_bin = (TextView) findViewById(R.id.hours_bin);  TextView mins_bin = (TextView) findViewById(R.id.mins_bin);  TextView secs_bin = (TextView) findViewById(R.id.secs_bin);        SimpleDateFormat hours_sdf = new SimpleDateFormat(""HH"");        SimpleDateFormat mins_sdf = new SimpleDateFormat(""mm"");        SimpleDateFormat secs_sdf = new SimpleDateFormat(""ss"");        Calendar cal = Calendar.getInstance();  while (runner != null)  {   WaitAMoment();   cal.getTime();   hours_dec.setText(hours_sdf.format(cal.getTime()));   mins_dec.setText(mins_sdf.format(cal.getTime()));   secs_dec.setText(secs_sdf.format(cal.getTime()));   hours_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) hours_dec.getText()))));   mins_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) mins_dec.getText()))));   secs_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) secs_dec.getText()))));  } } protected void WaitAMoment() {  try  {   Thread.sleep(100);  } catch (InterruptedException e) { }; }}`</code></pre>","340750","","","","","2011-06-01 08:57:07","Simple Android Binary Text Clock","<android><multithreading><timer><clock><runnable>","1","3","","",""
"2831091","1","","","2010-05-14 00:12:22","4","690","<p>I recently tried out the applicationCache / offline web apps on Android 2.1's WebKit and unfortunately it does not work exactly like on a webkit on the iPhone. I was wondering how I can easily see what features should be implemented and if there is something like a roadmap?</p><p>Does that information somewhere exist?</p>","302750","","","","","2011-06-20 20:50:52","Roadmap for HTML5 features in WebKit for Android","<android>","0","0","1","",""
"2831284","1","2832409","","2010-05-14 01:17:48","3","621","<p>As I know Android Froyo will support Flash 10.1. I just wonder how Flash apps could be distributed on Froyo based device.</p><p>Will Google allows distribute Flash apps by Android Market?Or, any other ways for it?</p><p>Regards,Wonil.</p>","212862","","","","","2010-05-14 07:08:28","How to distribute Flash apps on Android?","<android><flash><google-play>","2","2","","",""
"2831333","1","2832419","","2010-05-14 01:34:18","9","7397","<p>i try some method,but not success,help me.</p>","340834","","","","","2013-08-19 12:32:59","How to get app install time from android","<android>","3","3","7","",""
"2831450","1","2831718","","2010-05-14 02:11:17","0","264","<p>PostgreSQL has announced an Android app <a href=""http://wiki.postgresql.org/wiki/AndroidAppContest"" rel=""nofollow"">contest</a>. I wanted to try out something but the only hosting I have does not provide PostgreSQL.</p><p>Do I have any economical (read cheap :D ) options? Is there a free hosting that anyone knows of?</p><p>Thanks in advance. --AJ</p>","201788","","15785","","2010-05-14 09:03:42","2010-05-14 09:03:42","Database hosting options for a PosgreSQL project","<android><postgresql><hosting>","1","0","3","",""
"2831607","1","2833911","","2010-05-14 03:01:42","1","3650","<p>This question is related to an <a href=""http://stackoverflow.com/questions/2829595/android-2-1-muliple-handlers-in-a-single-activity"">existing question</a> I asked. I though I'll ask a new question instead of replying back to the other question.</p><blockquote>  <p>""I've more than one Handlers in an Activity."" Why? If you do not want a complicated <code>handleMessage()</code> method, then use <code>post()</code> (on <code>Handler</code> or <code>View</code>) to break the logic up into individual <code>Runnables</code>. Multiple <code>Handlers</code> makes me nervous. — CommonsWare</p></blockquote><p>I'm new to Android. My question is - is having multiple handlers in a single activity a bad design?</p><p>Here is the sketch of my current implementation. </p><p>I've a <code>mapActivity</code> that creates a data thread (a UDP socket that listens for data). My first handler is responsible for sending data from the data thread to the activity. </p><p>On the map I've a bunch of ""dynamic"" markers that are <code>refreshed</code> frequently. Some of these markers are video markers i.e., if the user clicks a video marker, I add a  <code>ViewView</code> that extends a <code>android.opengl.GLSurfaceView</code> to my map activity and display video on this new vide. I use my second handler to send information about the marker that the user tapped on <code>ItemizedOverlay</code> <code>onTap(int index)</code> method. </p><p>The user can close the video view by tapping on the video view. I use my third handler for this. </p><p>I would appreciate if people can tell me what's wrong with this approach and suggest better ways to implement this. </p><p>Thanks.  </p>","306346","","19750","","2012-01-17 04:47:59","2013-07-21 14:12:11","Android Multiple Handlers Design","<android><design><activity><handler>","1","0","1","",""
"2831769","1","","","2010-05-14 04:07:09","0","762","<p>Using</p><pre><code>HttpGet httpget = new HttpGet(urlToGet);</code></pre><p>I get an intermittent error that results in a forced closure of the app. The error is always Host is unresolved: www..com:443</p><p>How can I stop this from happening?</p>","330368","","330368","","2010-05-14 05:56:16","2011-09-06 14:08:59","Apache Httpget with https url - Host is unresolved error","<java><android><ssl><http-get>","2","1","","",""
"2831824","1","3238534","","2010-05-14 04:24:33","4","1284","<p>Are there known issues with navigator.onLine on Android 2.1?  I have a Droid on airplane mode, but navigator.onLine appears to be returning true anyway.  (I'm using an HTML manifest to cache the page, and its behavior works fine in Mobile Safari and Firefox in offline mode.)</p>","255196","","","","","2010-07-13 15:07:44","Are there known issues with navigator.onLine on Android 2.1?","<android><offline>","1","0","","",""
"2831915","1","","","2010-05-14 04:55:20","1","4140","<p>I'm trying to create a sliding drawer in code, but I don't understand what to do for the AttributeSet part of the constructor.</p><p>What do I need to do for that? </p><p>Also, how do I define in code where the slider is going to show up?</p><p>Thanks, </p>","358894","","","","","2011-07-05 10:09:43","How do I create a sliding drawer in code?","<android><set><attributes><slidingdrawer>","2","2","0","",""
"2831987","1","","","2010-05-14 05:19:53","-5","296","<p>Im new to android and thought it would be fun to develop an app that goes out and checks woot.com. The idea I came up with is for the app to be a widget that refresh woot.com once a day and displays a picture of the item and price. If the widget is clicked on it would open the browser to woot.com. In theory this seems like it would be easy but Im having trouble figuring out where to begin. Any help would be appreciated.</p><p>Thanks Tim</p>","340949","","","","","2010-05-14 15:41:31","I want to create an Android App that checks a website like Woot","<android>","1","0","","2011-09-05 19:07:48",""
"2831999","1","","","2010-05-14 05:25:23","0","214","<p>I have a range say,1-100 and i want the user to select a value from this range.Ofcourse showing this with a spinner will be awful.I want to use the functionality of date widget,where we can pick a date by pressing a +/- sign,the longer the press ,higher the iteration speed.I found numberpicker.java that has the code the date widget uses to get this functionality, but do i have to paste that entire code to achieve this functionality!</p>","340353","","","","","2010-09-09 02:20:55","numeric choice field:How to let the user set a value by incrementing/decrementing the displayed value","<android>","2","0","","",""
"2832109","1","","","2010-05-14 05:56:02","2","487","<p>I am developing a reminder application. I am generating notifications using notification manager class, when the timeline crosses.But if my cell phone is switched off ,I am unable to see these notifications. Not even when i switch it on again.</p><p>Even if i switch it off and switch on again, i think the pending intents are destroyed and no notification is generated.</p><p>How do i get it when the phone is switched on again ?</p>","335429","","","","","2010-05-14 06:01:15","Reminder application","<android>","1","1","2","",""
"2832161","1","","","2010-05-14 06:09:30","2","208","<p>What are the mobile handset security solutions used by you / your organization. </p><p>What are the pro's and cons of usage of these solution - and how far have you been successful in implementing these - were there any loopholes / issues faced in using them?.</p><p>In general, can you suggest a set of guidelines to watch for when going for going for selecting a specific solution in this context.</p><p>Are these solutions also inter-operable/compatible with the solutions used on the PC's/laptops. </p>","25713","","183528","","2010-11-05 03:50:31","2010-11-05 03:50:31","Mobile security solutions","<iphone><android><security><mobile>","1","4","2","",""
"2832251","1","2833874","","2010-05-14 06:28:05","0","813","<p>Hi I am displaying an icon in status bar depending up on my condition .upto this it is ok.Now problem in my application is when i come back to application still the icon is displayed in the status bar.I don't want the icon when i come back from the application.For this give me some suggestions</p>","454808","","454808","","2010-05-15 07:06:24","2014-03-13 14:13:20","Notification icon in the status bar","<android>","3","0","","",""
"2832292","1","2833628","","2010-05-14 06:39:46","3","4494","<p>I found an app called IM in Android's trunk on git, but that doesn't look like the Google Talk app that comes installed on Android phones.</p><p>Does anyone know if that source code is even published?</p>","338981","","","","","2012-06-01 03:06:32","Where to find the Google Talk Android client source code?","<android><source-code><google-talk>","2","0","","",""
"2832313","1","2832334","","2010-05-14 06:45:16","1","509","<p>In the spirit of using existing, tested and stable libraries of code, I started using the <a href=""http://commons.apache.org/math/"" rel=""nofollow"">Apache-Commons-Math library</a> and its <a href=""http://commons.apache.org/math/apidocs/org/apache/commons/math/fraction/BigFraction.html"" rel=""nofollow""><code>BigFraction</code> class</a> to perform some rational calculations for an Android app I'm writing called RationalCalc.</p><p>It works great for every task that I have thrown at it, except for one nagging problem.  When dividing certain <code>BigFraction</code> values, I am getting incorrect results.</p><p>If I create a <code>BigFraction</code> with the inverse of the divisor and multiply instead, I get the same incorrect answer but perhaps that is what the library is doing internally anyway.</p><p>Does anyone know what I am doing wrong?</p><p>The division works correctly with a <code>BigFraction</code> of 2.5 but not 2.51, 2.49, etc...</p><p><strong>[UPDATE]</strong></p><p>This was indeed a bug in the apache-commons-math 2.0 libraries.  The bug is fixed in v.2.1.</p><p>It is now listed in the Fixed Issues section of the bug tracker:</p><p><a href=""https://issues.apache.org/jira/browse/MATH-340"" rel=""nofollow"">When multiplying two BigFraction objects with numerators larger than will fit in an java-primitive int the result of BigFraction.ZERO is incorrectly returned.</a>.</p><p>Thanks to @BartK for attempting to reproduce the issue and setting me on the right track.</p><p><strong>[/UPDATE]</strong></p><pre><code>// *** incorrect! ***BigFraction one = new BigFraction(1.524);//one: 1715871458028159 / 1125899906842624BigFraction two = new BigFraction(2.51);//two: 1413004383087493 / 562949953421312BigFraction three = one.divide(two);//three: 0Log.i(""solve"", three.toString());//should be 0.607171315  ??//returns 0// *** correct! ****BigFraction four = new BigFraction(1.524);//four: 1715871458028159 / 1125899906842624BigFraction five = new BigFraction(2.5);//five: 5 / 2BigFraction six = four.divide(five);//six: 1715871458028159 / 2814749767106560Log.i(""solve"", six.toString());//should be 0.6096  ??//returns 0.6096</code></pre>","12919","","21234","","2012-05-17 15:32:38","2012-05-17 15:32:38","Why does the BigFraction class in the Apache-Commons-Math library return incorrect division results?","<java><android><division><apache-commons-math><bigfraction>","1","4","1","",""
"2832660","1","2833856","","2010-05-14 08:05:11","3","2624","<p>I want to zoom text that is displayed at center of screen as per user choice. How can I achieve this ?Using pinch multitouch cannot be tested on emulator and I want something that I can test on Android emulator.Can I use zoom in and out controls to control only text view for my layout ?Or Can I use webview to contain a text as webview has default zoom in out buttons ?</p>","315619","","","","","2010-05-14 11:50:44","How to use zoom controls on TextView in Android?","<android>","1","0","","",""
"2832698","1","2833863","","2010-05-14 08:13:36","0","599","<p>I have a webview that loads a webpage. I also have a reload button. Sometimes it works but sometimes it crashes when i hit reload and i get this exceptions:</p><pre><code>05-14 10:08:33.958: ERROR/WindowManager(918): Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here05-14 10:08:33.958: ERROR/WindowManager(918): android.view.WindowLeaked: Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:217)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.Window$LocalWindowManager.addView(Window.java:392)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.Dialog.show(Dialog.java:231)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.ProgressDialog.show(ProgressDialog.java:107)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.ProgressDialog.show(ProgressDialog.java:90)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.poslji.gor.Odgovori$2.onClick(Odgovori.java:120)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.View.performClick(View.java:2179)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.View.onTouchEvent(View.java:3828)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.widget.TextView.onTouchEvent(TextView.java:6307)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.View.dispatchTouchEvent(View.java:3368)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.Activity.dispatchTouchEvent(Activity.java:1997)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.Activity.dispatchTouchEvent(Activity.java:1997)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1761)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.os.Handler.dispatchMessage(Handler.java:99)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.os.Looper.loop(Looper.java:123)05-14 10:08:33.958: ERROR/WindowManager(918):     at android.app.ActivityThread.main(ActivityThread.java:3948)05-14 10:08:33.958: ERROR/WindowManager(918):     at java.lang.reflect.Method.invokeNative(Native Method)05-14 10:08:33.958: ERROR/WindowManager(918):     at java.lang.reflect.Method.invoke(Method.java:521)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)05-14 10:08:33.958: ERROR/WindowManager(918):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)05-14 10:08:33.958: ERROR/WindowManager(918):     at dalvik.system.NativeStart.main(Native Method)05-14 10:08:36.768: ERROR/AndroidRuntime(918): Uncaught handler: thread main exiting due to uncaught exception05-14 10:08:36.778: ERROR/AndroidRuntime(918): java.lang.IllegalArgumentException: View not attached to window manager05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.view.Window$LocalWindowManager.removeView(Window.java:400)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.app.Dialog.dismissDialog(Dialog.java:268)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.app.Dialog.access$000(Dialog.java:69)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.app.Dialog$1.run(Dialog.java:103)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.app.Dialog.dismiss(Dialog.java:252)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at com.poslji.gor.Odgovori$HelloWebViewClient.onPageFinished(Odgovori.java:180)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:225)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.os.Handler.dispatchMessage(Handler.java:99)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.os.Looper.loop(Looper.java:123)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at android.app.ActivityThread.main(ActivityThread.java:3948)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at java.lang.reflect.Method.invokeNative(Native Method)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at java.lang.reflect.Method.invoke(Method.java:521)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)05-14 10:08:36.778: ERROR/AndroidRuntime(918):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>What is going wrong here?</p>","324417","","235654","","2010-05-14 09:22:11","2010-05-14 11:51:45","Android exception i don't understand after loading webpage in a webview","<android><webview>","1","0","","",""
"2832701","1","3380132","","2010-05-14 08:13:52","6","9153","<p>I defined a scrollview with a texteedit in my layout:</p><pre><code> &lt;ScrollView android:fillViewport=""true""     android:layout_marginBottom=""50dip""     android:id=""@+id/start_scroller""     android:layout_height=""fill_parent""     android:layout_width=""fill_parent""     android:fadingEdge=""none""&gt; &lt;TextView      android:id=""@+id/text""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" &gt; &lt;/TextView&gt; &lt;/ScrollView&gt;</code></pre><p>I add text to this ScrollView with the following method:</p><pre><code>public void writeToLogView(String textMsg) {   if (text.getText().equals("""")) {       text.append(textMsg);   } else {    text.append(""\n"" + textMsg);    scroller.scrollBy(0, 1000000);   }}</code></pre><p>As you can see i append the text and try to scroll to the bottom of the ScrollView. Unfortunately this doesn't worked correctly. It scrolls down, but not always, and not always to the bottom. Any hints?</p>","","anon","","","","2010-08-03 10:07:00","ScrollView alawys scrolling to the bottom","<java><android><scrollview>","2","0","","",""
"2832773","1","2832848","","2010-05-14 08:28:34","10","2756","<p>I just got myself an android phone and I'm dying to start coding on it !However I'm not a big java fan, although I can live with that, I would like to know if there're reasonable alternatives for the android virtual machine.I've done a medium sized project using clojure, however from the reviews I read, it's very slow when running on android. How about scala ? I read that some people did experiments with it in android, is it ""fast enough"" ? How big is the learning curve ?</p><p>Cheers,Ze Maria</p>","361526","","","","","2012-03-22 17:54:26","Alternatives to java on android","<java><android><scala><clojure>","8","0","3","",""
"2832807","1","","","2010-05-14 08:37:45","-2","517","<p>At the Android 2.1 boot up i found ""A N D R O I D"" text . I want to hide this text or remove it. Do any one have the idea where i am storing this ""A N D R O I D"" text???</p>","341053","","","","","2010-05-14 09:15:48","How to remove “A N D R O I D” text at boot up?","<android>","1","2","","2012-08-16 12:45:23",""
"2832863","1","","","2010-05-14 08:49:30","5","2875","<p>How to pass a parameter to an application that I call from my Application?</p>","341068","","114066","","2010-05-14 12:24:43","2010-05-14 12:24:43","Android - can I pass a parameter when launch other applications from my application?","<android><android-intent>","1","0","1","",""
"2833057","1","2833103","","2010-05-14 09:26:26","290","59027","<p>I have created a specific List which exists out of the following elements to create a scrollable list with every row containing a Image on the left side and some text on the right side :</p><p>To begin with a ""root"" layout :</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:background=""#C8C8C8""&gt;&lt;TextView    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=""fill_parent""    android:drawSelectorOnTop=""false""    android:divider=""#C8C8C8""    android:background=""#C8C8C8""/&gt;</code></pre><p></p><p>and then within the ListView I place the following ""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=""wrap_content""    android:orientation=""horizontal""    android:background=""@drawable/bg_row""&gt;    &lt;ImageView        android:layout_width=""wrap_content""        android:paddingLeft=""10px""        android:paddingRight=""15px""        android:paddingTop=""5px""        android:paddingBottom=""5px""        android:layout_height=""wrap_content""        android:src=""@drawable/bg_image""    /&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingTop=""5px""        android:paddingBottom=""5px""        android:textSize=""16sp""        android:textColor=""#000000""        android:layout_gravity=""center""        android:maxHeight=""50px""/&gt;&lt;/LinearLayout&gt;</code></pre><p>As long as the screen is shown statically (as in no movement) it will be shown correctly, but when I start scrolling through the list the background of the row-item (an ""icon"" as can be shown in the code) will be shown corretcly but the background of the ""root"" layout will become completely black... when the scrolling stops the background will, most of the times, get back it's color...As I test I also added a TextView in that root-element with the same background, this one will detain it's color when the List is scrolled...Any idea why this is happening, and how to solve this ?</p>","162147","","267269","","2010-11-01 04:37:17","2014-03-18 05:22:35","Background ListView becomes black when scrolling","<android><listview>","5","0","71","",""
"2833121","1","2833176","","2010-05-14 09:36:31","0","808","<p>i have code that runs <code>onitemselectedlistener</code> event of spinner.So when i am in the method :</p><pre><code>public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {    //I want to do something here if its a user who changed the the selected item}</code></pre><p>... can i know whether item selection was changed programmatically or by a user action through UI.</p>","340353","","133802","","2010-05-14 09:37:46","2014-03-15 20:00:18","Spinner:How to know whether item selection was changed programmatically or by a user action through UI","<android>","3","0","","",""
"2833198","1","2833679","","2010-05-14 09:50:13","0","1822","<p>In my application it is necessary to have internet connection. Therefore i check while starting if a Internet connection is availaible. If not I ask the user if he would establish an Internet Connection, and what type (wifi oder mobile).</p><p>The wifi connection i can establish with the following code</p><pre><code>WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);wifiManager.setWifiEnabled(true);</code></pre><p>But how do i establish a mobile connection? Coulnd't find a single code snippet at Google.</p>","","anon","","","","2010-05-14 11:17:53","Enable mobile network","<android><internet>","1","0","","",""
"2833270","1","2833293","","2010-05-14 10:03:22","0","550","<p>i am using following code to open Android Contacts</p><pre><code>  @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        btnContacts = (Button) findViewById(R.id.btn_contacts);           txtContacts = (TextView) findViewById(R.id.txt_contacts);           btnContacts.setOnClickListener(new OnClickListener() {               public void onClick(View arg0) {                   txtContacts.setText("""");                Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);                   startActivityForResult(intent, PICK_CONTACT);               }           });   } @Override      public void onActivityResult(int reqCode, int resultCode, Intent data) {           super.onActivityResult(reqCode, resultCode, data);           switch (reqCode) {               case (PICK_CONTACT):                   if (resultCode == Activity.RESULT_OK) {   //display picked contact data.}}}</code></pre><p>now i want to put Button at the top of this Contact activity when opened or add my own  Menu in this Activity </p><p>can any one guide me is this possible or not if yes then please tell how to achieve this?</p><p>any help would be appriciated.</p>","249991","","","","","2010-09-08 14:12:53","how to add button or Menu in Contacts list?","<android><activity>","1","1","","",""
"2833430","1","","","2010-05-14 10:34:34","0","3363","<p>im triying to do an app using the notepad tutorial of Android as a guide. I can insert new elements on the table without problems, but if i want to update the fields of one of this elements an error is prompted. I revisited the tutorial lots of times but i cant find the solution.</p><p>Thank you!</p><p>Here is the menu (to insert, delete and update)</p><pre><code>package citic.android.remoteir;</code></pre><p>import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.ContextMenu;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.ContextMenu.ContextMenuInfo;import android.widget.SimpleCursorAdapter;import android.widget.AdapterView.AdapterContextMenuInfo;</p><pre><code>public class ServerCp extends ListActivity{private RemoteIrDbAdapter mDbHelper; private static final int ACTIVITY_CREATE=0;private static final int ACTIVITY_EDIT=1;private static final int  INSERT_ID = Menu.FIRST;private static final int  EDIT_ID = Menu.FIRST + 1;private static final int  DELETE_ID = Menu.FIRST + 2;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.contentlist);    mDbHelper = new RemoteIrDbAdapter(this);    mDbHelper.open();    fillDataServer();    registerForContextMenu(getListView());}private void fillDataServer() {    Cursor c = mDbHelper.fetchAllQueryDataAutoCompleteServerName();    startManagingCursor(c);    String[] from;    from = new String[] { RemoteIrDbAdapter.KEY_NAMESERVER};     int[] to = new int[] { R.id.row1 };    SimpleCursorAdapter data =        new SimpleCursorAdapter(this, R.layout.listrow, c, from, to);    setListAdapter(data);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID, 0, R.string.menu_insert_server);    return true;}@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {    case INSERT_ID:        createServer();        return true;    }    return super.onMenuItemSelected(featureId, item);}public void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, EDIT_ID, 0, R.string.menu_edit_server);    menu.add(0, DELETE_ID, 0, R.string.menu_delete_server);}@Overridepublic boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {    case EDIT_ID:        AdapterContextMenuInfo infoEdit = (AdapterContextMenuInfo) item.getMenuInfo();        Intent i = new Intent(this, ServerEdit.class);        i.putExtra(RemoteIrDbAdapter.KEY_ROWIDSERVER, infoEdit.id);        startActivityForResult(i, ACTIVITY_EDIT);    case DELETE_ID:        AdapterContextMenuInfo infoDelete = (AdapterContextMenuInfo) item.getMenuInfo();        mDbHelper.deleteQueryDataServer(infoDelete.id);        fillDataServer();        return true;    }    return super.onContextItemSelected(item);}private void createServer() {    Intent i = new Intent(this, ServerEdit.class);    startActivityForResult(i, ACTIVITY_CREATE);}/*@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, ProfileEdit.class);    i.putExtra(RemoteIrDbAdapter.KEY_ROWID, id);    startActivityForResult(i, ACTIVITY_EDIT);}*/    @Override    protected void onActivityResult(int requestCode, int resultCode,                                     Intent intent) {        super.onActivityResult(requestCode, resultCode, intent);        fillDataServer();    }}</code></pre><p>Here is the edit and create class:</p><pre><code>package citic.android.remoteir;</code></pre><p>import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;</p><pre><code>public class ServerEdit extends Activity{private EditText mNameText;private EditText mIpText;private EditText mPortText;private Long mRowId;private RemoteIrDbAdapter mDbHelper;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mDbHelper = new RemoteIrDbAdapter(this);    mDbHelper.open();    setContentView(R.layout.editserver);    mNameText = (EditText) findViewById(R.id.name);    mIpText = (EditText) findViewById(R.id.ip);    mPortText = (EditText) findViewById(R.id.port);    Button confirmButton = (Button) findViewById(R.id.confirm);    mRowId = savedInstanceState != null ? savedInstanceState.getLong(RemoteIrDbAdapter.KEY_ROWIDSERVER)                                         : null;    if (mRowId == null) {        Bundle extras = getIntent().getExtras();                    mRowId = extras != null ? extras.getLong(RemoteIrDbAdapter.KEY_ROWIDSERVER)                                 : null;    }    System.out.println(""el rowid es"" + mRowId);    populateFields();    confirmButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            setResult(RESULT_OK);            finish();        }    });}private void populateFields() {  // &lt;- This is where the error refers    if (mRowId != null) {        Cursor server = mDbHelper.fetchServer(mRowId);        startManagingCursor(server);        mIpText.setText(server.getString(                server.getColumnIndexOrThrow(RemoteIrDbAdapter.KEY_IP)));        mPortText.setText(server.getString(                server.getColumnIndexOrThrow(RemoteIrDbAdapter.KEY_PORT)));        mNameText.setText(server.getString(                server.getColumnIndexOrThrow(RemoteIrDbAdapter.KEY_NAMESERVER)));        }}@Overrideprotected void onSaveInstanceState(Bundle outState) {    super.onSaveInstanceState(outState);    outState.putLong(RemoteIrDbAdapter.KEY_ROWIDSERVER, mRowId);}@Overrideprotected void onPause() {    super.onPause();    saveState();}@Overrideprotected void onResume() {    super.onResume();    populateFields();}private void saveState() {    String name = mNameText.getText().toString();    String ip = mIpText.getText().toString();    String port = mPortText.getText().toString();    if (mRowId == null) {        long id = mDbHelper.createQueryDataServer(ip, port, name);        if (id &gt; 0) {            mRowId = id;        }    } else {        mDbHelper.updateServerData(mRowId, ip, port, name);    }}</code></pre><p>}</p><p>And here the database management:</p><pre><code>package citic.android.remoteir;</code></pre><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><pre><code>public class RemoteIrDbAdapter{    public static final boolean DISTINCT = true;    public static final String KEY_ROWIDSERVER= ""_id""; //ANTES _IDS    public static final String KEY_PORT = ""port"";    public static final String KEY_IP = ""ip"";    public static final String KEY_NAMESERVER = ""server"";    public static final String KEY_ROWIDPROFILE= ""_id""; //ANTES _id    public static final String KEY_NAMEPROFILE= ""profile"";    //public static final String KEY_ROWID = ""_id"";    private static final String TAG = ""RemoteIrDbAdapterBak"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private static final String DATABASE_CREATE_SERVER = ""create table server (_id integer primary key autoincrement,ip string not null, port string not null, server string not null);"";            /*""create table server (_id integer primary key autoincrement, ""                     + ""ip string not null, port string not null, server string not null);"";*/    private static final String DATABASE_CREATE_PROFILE = ""create table profile (_id integer primary key autoincrement, profile string not null);"";            /*""create table profile (_id integer primary key autoincrement, ""                    + ""profile string not null);"";*/    private static final String DATABASE_CREATE_SERPRO = ""create table serpro (_ids integer not null, _idp integer not null, PRIMARY KEY (_ids, _idp), CONSTRAINT fk_idsps FOREIGN KEY (_ids) REFERENCES server(_id) ON DELETE CASCADE, CONSTRAINT fk_idspp FOREIGN KEY (_ids) REFERENCES server(_id) ON DELETE CASCADE);"";            /*""create table serpro (_ids integer not null, _idp integer not null, PRIMARY KEY (_ids, _idp), ""                     + "" CONSTRAINT fk_idsps REFERENCES server(_id) ON DELETE CASCADE ""                    + "" CONSTRAINT fk_idspp REFERENCES profile(_id) ON DELETE CASCADE);"";*/private static final String DATABASE_TABLE_SERVER = ""server"";    private static final String DATABASE_TABLE_PROFILE = ""profile"";    private static final String DATABASE_TABLE_SERPRO = ""serpro"";    private static final String TRIGGER_SERPRO_IP = ""create trigger serpro_pi before insert on serpro for each row when ((select _id from profile where _id = new._id) is null) begin select raise(abort, 'insert on table \""serpro\"" violates foreign key constraint \""fk_idspp\""'); end;"";    /*""CREATE TRIGGER SERPRO_PI BEFORE INSERT ON serpro FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM profile WHERE _id = NEW._id) IS NULL ) THEN RAISE (ABORT, ‘insert on table serpro violates foreign key constraint fk_idspp’) END; END;"";*/    private static final String TRIGGER_SERPRO_UP = ""create trigger serpro_up before update on serpro for each row when ((select _id from profile where _id = new._id) is null) begin select raise(abort, 'update on table \""serpro\"" violates foreign key constraint \""fk_idspp\""'); end;"";     /*""CREATE TRIGGER SERPRO_UP BEFORE UPDATE ON serpro FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM profile WHERE _id = NEW._id) IS NULL ) THEN RAISE (ABORT, ‘update on table serpro violates foreign key constraint fk_idspp’) END; END;"";*/    private static final String TRIGGER_SERPRO_DP = ""create trigger serpro_dp before delete on profile for each row begin select raise(abort, 'delete on table \""profile\"" violates foreign key constraint \""fk_idspp\"" on \""serpro\""') where (select _idp from serpro where _idp = old._id) is not null; end;"";    /*""CREATE TRIGGER SERPRO_DP BEFORE DELETE ON profile FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM serpro WHERE _id = OLD._id) IS NULL ) THEN RAISE (ABORT, ‘delete on table profile violates foreign key constraint fk_idspp’) END; END;"";*/    private static final String TRIGGER_SERPRO_IS = ""create trigger serpro_is before insert on serpro for each row when ((select _id from server where _id = new._id) is null) begin select raise(abort, 'insert on table \""serpro\"" violates foreign key constraint \""fk_idsps\""'); end;"";    /*""CREATE TRIGGER SERPRO_IS BEFORE INSERT ON serpro FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM server WHERE _id = NEW._id) IS NULL ) THEN RAISE (ABORT, ‘insert on table serpro violates foreign key constraint fk_idsps’) END; END;"";*/    private static final String TRIGGER_SERPRO_US = ""create trigger serpro_us before update on serpro for each row when ((select _id from server where _id = new._id) is null) begin select raise(abort, 'update on table \""serpro\"" violates foreign key constraint \""fk_idsps\""'); end;"";    /*""CREATE TRIGGER SERPRO_US BEFORE UPDATE ON serpro FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM server WHERE _id = NEW._id) IS NULL ) THEN RAISE (ABORT, ‘update on table serpro violates foreign key constraint fk_idsps’) END; END;"";*/    private static final String TRIGGER_SERPRO_DS = ""create trigger serpro_ds before delete on server for each row when ((select _ids from serpro where _ids = old._id) is not null) begin select raise(abort, 'delete on table \""server\"" violates foreign key constraint \""fk_idsps\"" on \""server\""'); end;"";    /*""CREATE TRIGGER PROFILE_DS BEFORE DELETE ON server FOR EACH ROW BEGIN SELECT CASE WHEN ((SELECT _id FROM serpro WHERE _id = OLD._id) IS NULL ) THEN RAISE (ABORT, ‘delete on table server violates foreign key constraint fk_idsps’) END; END;"";*/    /*private static final String DATABASE_CREATE =            ""create table userdata (_id integer primary key autoincrement, ""                    + ""ip string not null, port string not null, query string not null, calendar string not null);"";*/    private static final String DATABASE_NAME = ""data"";    //private static final String DATABASE_TABLE = ""remoteirdata"";    private static final int DATABASE_VERSION = 2;    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_SERVER);            db.execSQL(DATABASE_CREATE_PROFILE);            db.execSQL(DATABASE_CREATE_SERPRO);            db.execSQL(TRIGGER_SERPRO_IP);            db.execSQL(TRIGGER_SERPRO_UP);            db.execSQL(TRIGGER_SERPRO_DP);            db.execSQL(TRIGGER_SERPRO_IS);            db.execSQL(TRIGGER_SERPRO_US);            db.execSQL(TRIGGER_SERPRO_DS);          }        @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 server"");            db.execSQL(""DROP TABLE IF EXISTS profile"");            db.execSQL(""DROP TABLE IF EXISTS serpro"");            onCreate(db);        }    }    public RemoteIrDbAdapter(Context ctx) {        this.mCtx = ctx;    }    public RemoteIrDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }    public long createQueryDataServer(String ip, String port, String server) {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_IP, ip);        initialValues.put(KEY_PORT, port);        initialValues.put(KEY_NAMESERVER, server);        return mDb.insert(DATABASE_TABLE_SERVER, null, initialValues);    }    public long createQueryDataProfile(String profile) {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_NAMEPROFILE, profile);        return mDb.insert(DATABASE_TABLE_PROFILE, null, initialValues);    }    public long createQueryDataSerpro(Integer _id, Integer _idp) {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_ROWIDSERVER, _id);        initialValues.put(KEY_ROWIDPROFILE, _idp);        return mDb.insert(DATABASE_TABLE_SERPRO, null, initialValues);    }    public boolean deleteQueryDataServer(long rowId) {        return mDb.delete(DATABASE_TABLE_SERVER, KEY_ROWIDSERVER + ""="" + rowId, null) &gt; 0;    }    public boolean deleteQueryDataProfile(long rowId) {        return mDb.delete(DATABASE_TABLE_PROFILE, KEY_ROWIDPROFILE + ""="" + rowId, null) &gt; 0;    }    public Cursor fetchServer(long rowId) throws SQLException {        Cursor mCursor =                mDb.query(true, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER,                        KEY_IP, KEY_PORT, KEY_NAMESERVER}, KEY_ROWIDSERVER + ""="" + rowId, null,                        null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public Cursor fetchAllQueryDataServer() {        return mDb.query(DISTINCT, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER,KEY_IP, KEY_PORT, KEY_NAMESERVER}, null, null, null, null, null, null);       }    public Cursor fetchAllQueryDataProfile() {        return mDb.query(DISTINCT, DATABASE_TABLE_PROFILE, new String[] {KEY_ROWIDPROFILE,KEY_NAMEPROFILE}, null, null, null, null, null, null);       }    public Cursor fetchAllQueryDataAutoCompleteIp(){        return mDb.query(DISTINCT, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER, KEY_IP}, null, null, KEY_IP, null, null, null);        }    public Cursor fetchAllQueryDataAutoCompletePort(){        return mDb.query(DISTINCT, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER, KEY_PORT}, null, null, KEY_PORT, null, null, null);        }    public Cursor fetchAllQueryDataAutoCompleteServerName(){        //return mDb.query(DISTINCT, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER, KEY_NAMESERVER}, null, null, KEY_NAMESERVER, null, null, null);          return mDb.rawQuery(""SELECT DISTINCT server, _id as _id from server order by _id"", null);       }    public Cursor fetchAllQueryDataAutoCompleteProfileName(){    //      return mDb.query(DISTINCT, DATABASE_TABLE_PROFILE, new String[] {KEY_ROWIDPROFILE, KEY_NAMEPROFILE}, null, null, KEY_NAMEPROFILE, null, null, null);                //""SELECT DISTINCT (ip, _id) FROM userdata ORDER BY ip"";        return mDb.rawQuery(""SELECT DISTINCT profile, _id from profile order by _id"", null);            //return mDb.rawQuery(""SELECT DISTINCT profile, _id as _id from profile order by _id"", null);       }     public Cursor fetchAllQueryData() {        return mDb.query(DISTINCT, DATABASE_TABLE_SERVER, new String[] {KEY_ROWIDSERVER,KEY_IP, KEY_PORT, KEY_NAMESERVER}, null, null, null, null, null, null);               }    public Cursor fetchAllServersNotOnProfileData(long idProfile ){        String sqlstart = ""SELECT server.server FROM server INNER JOIN ( serpro INNER JOIN profile ON serpro._id = profile._id WHERE profile._id NOT LIKE '"";         String sqlend = ""')ON server._id = serpro._id;"";        String sql = sqlstart + idProfile + sqlend;             return mDb.rawQuery(sql, null);    } public Cursor fetchAllServersOnProfileData(long idProfile ){        String sqlstart = ""SELECT server.server FROM server INNER JOIN ( serpro INNER JOIN profile ON serpro._id = profile._id WHERE profile._id LIKE '"";         String sqlend = ""')ON server._id = serpro._id;"";        String sql = sqlstart + idProfile + sqlend;             return mDb.rawQuery(sql, null);    }    public boolean updateServerData(long rowId, String ip, String port, String server) {        ContentValues args = new ContentValues();        args.put(KEY_IP, ip);        args.put(KEY_PORT, port);        args.put(KEY_NAMESERVER, server);        return mDb.update(DATABASE_TABLE_SERVER, args, KEY_ROWIDSERVER + ""="" + rowId, null) &gt; 0;    }    public boolean updateProfileData(long rowId, String profile) {        ContentValues args = new ContentValues();        args.put(KEY_NAMEPROFILE, profile);        return mDb.update(DATABASE_TABLE_PROFILE, args, KEY_ROWIDPROFILE + ""="" + rowId, null) &gt; 0;    }}</code></pre><p>And the error is this:</p><pre><code>05-14 10:07:46.766: ERROR/AndroidRuntime(324): Uncaught handler: thread main exiting due to uncaught exception05-14 10:07:46.776: ERROR/AndroidRuntime(324): java.lang.RuntimeException: Unable to start activity ComponentInfo{citic.android.remoteir/citic.android.remoteir.ServerEdit}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 005-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.os.Handler.dispatchMessage(Handler.java:99)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.os.Looper.loop(Looper.java:123)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread.main(ActivityThread.java:4203)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at java.lang.reflect.Method.invokeNative(Native Method)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at java.lang.reflect.Method.invoke(Method.java:521)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at dalvik.system.NativeStart.main(Native Method)05-14 10:07:46.776: ERROR/AndroidRuntime(324): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 005-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:172)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at citic.android.remoteir.ServerEdit.populateFields(ServerEdit.java:57)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at citic.android.remoteir.ServerEdit.onCreate(ServerEdit.java:41)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)05-14 10:07:46.776: ERROR/AndroidRuntime(324):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)</code></pre><p>Thank you all, im pretty desperate with this :s</p>","341150","","","","","2010-05-14 12:56:54","Android SQL problem on app similar to notepad tutorial:CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0","<sql><android><index><notepad>","1","0","","",""
"2833474","1","2833889","","2010-05-14 10:42:06","14","13778","<p>I want to create checkbox in my preference Activity that allows user to toggle orientation change. </p><p>In similar questions people write only about complete orientation lock (by overriding onConfigurationChanged method or adding configChanges in AndroidManifest.xml) or orientation enforcing ( by setRequestedOrientation ). </p><p>Is there a way to toggle orientation lock?  </p><hr><p>EDIT:I've created a method that sets preferred orientation to one of three states: landscape, portrait and sensor. This method is used in conjunction with retrieving orientation <code>getResources().getConfiguration().orientation)</code> and saving retrieved orientation into preferences. Then in activity that needs to lock orientation I fire this method with preferred orientation from preferences. </p><pre><code>private static void setActivityOrientation(Activity activity, int preferenceOrientation) {    if (preferenceOrientation == Configuration.ORIENTATION_LANDSCAPE) {         if( activity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){         // You need to check if your desired orientation isn't already set because setting orientation restarts your Activity which takes long            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);        }    } else if (preferenceOrientation == Configuration.ORIENTATION_PORTRAIT) {        if( activity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT){            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);        }        } else {        if( activity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_SENSOR){            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);        }    }}</code></pre>","296427","","296427","","2010-11-08 19:00:42","2011-07-07 19:34:27","How to toggle orientation lock in android?","<java><android><orientation>","1","0","4","",""
"2833488","1","","","2010-05-14 10:43:46","11","10193","<p>LOCK screen aprears at the main screen, after boot the emulator boot up. I want to disable the locking at main screen, So that while next time i boot up my emulator not LOCK screen apears. Can any body suggest me best solution for this?</p>","341053","","","","","2013-07-30 17:53:32","How to remove the LOCK screen that aprear after the emulator boot up to main screen in ANDROID 2.1","<android>","5","2","3","",""
"2833643","1","2833857","","2010-05-14 11:10:20","0","1763","<p>I would like to perform an activity at the key guard screen, but the only way I can find to do so is to disable the key guard, do my activity, then re enable the key guard.  This would be ok if it didn't cause the key guard screen to flash off and on (disable makes it disappear then re enable brings it back).  I am wondering how I can perform an activity with it still being displayed?  Kinda like how when the alarm goes off it shows a pop-up which is displayed over the key-guard screen?  </p>","274365","","","","","2010-05-14 11:50:47","how to preform an activity at the android lock screen?","<android><screen><locking>","1","0","2","",""
"2834058","1","2834080","","2010-05-14 12:28:52","3","5514","<p>I'm creating an appwidget, where the user should be able to configure it before it is added to the home screen. To me, PreferenceScreen/PreferenceActivity seems perfect for the task, but the intention behind these classes seem to be configuring an actual application. I've searched, but cannot find any documentation or tutorials which covers this question.</p><p>Is it possible to configure a widget using these classes, or is the only alternative to configure it through an ordinary view?</p><p>Thanks for any answers!</p>","340145","","","","","2011-08-17 19:20:14","Using PreferenceScreen/PreferenceActivity to configure home screen widgets","<android>","2","0","4","",""
"2834079","1","","","2010-05-14 12:31:50","2","1090","<p>I want to be able to set a ringtone which is associated to a particular application only. If the message with a special prefix arrives, my application intercepts it and does whatever it has to do. On message arriving, i want to be able to tell the user that the 'special' message has arrived, through a ringtone( which exclusively plays upon that kind of msg).anyone with a lead, please help.</p>","327491","","","","","2011-02-25 16:54:24","setting ringtone for a specific application only","<android>","1","0","1","",""
"2834180","1","11621738","","2010-05-14 12:43:55","2","2929","<p>I know about the existince of <a href=""http://developer.android.com/intl/de/reference/android/webkit/CookieManager.html"" rel=""nofollow"">CookieManager</a>, but how do I remove cookies of a domain only?</p><p>Can someone help me with some code fragment?</p>","243782","","","","","2013-06-20 11:07:02","How to remove cookies using CookieManager for a specific domain?","<android><cookies><webkit>","3","0","1","",""
"2834476","1","2835721","","2010-05-14 13:28:43","1","4091","<p>I'm working on an Android application that needs to download an image and display it inside an image view. The Bitmap is passed to the main java file and added to the image view like this:</p><pre><code>comic = (ImageView) findViewById(R.id.comic);comic.setImageBitmap(c.getImageBitmap());</code></pre><p>This works, except that the left side of the image disappears off the screen. The ImageView is in a ScrollView and the scroll view maintains the correct size. This means that there is black space to the right in the ScrollView and the image is cut off to the left.</p><p>The XML for the ImageView is this:</p><pre><code>    &lt;ScrollView android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;HorizontalScrollView android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" &gt;   &lt;ImageView android:id=""@+id/comic"" android:layout_height=""fill_parent""    android:layout_width=""fill_parent"" android:layout_gravity=""center""    android:src=""@drawable/xkcdlogo"" /&gt;  &lt;/HorizontalScrollView&gt; &lt;/ScrollView&gt;</code></pre><p>Any idea why my image is being cut off?</p><p>Thanks!</p>","118391","","60261","","2010-05-14 13:44:31","2010-09-20 00:54:14","Bitmap in ImageView is cropped off the screen","<java><android><bitmap><imageview>","3","0","0","",""
"2834868","1","4045965","","2010-05-14 14:25:25","6","2583","<p>I'm a writing a program to add a new way of communication such as MMS/SMS or SIP phone to Android. </p><p>Is there a way to add an icon in the QuickContactBadge menu, when clicking on a contact photo in the Contacts application ?</p><p>I wasn't able to fully understand how it works from android sources ... Is the list of icons only populated from mime types found in contacts datas ? </p><p>Thanks, </p><p>Laurent</p>","339138","","","","","2011-02-15 04:22:23","How to add add icons and Intents in the QuickContactBadge menu for my android program?","<android><icons><contact><badge>","4","1","6","",""
"2834886","1","2835238","","2010-05-14 14:27:06","1","1658","<p>I try to learn java for android devices..i have to create the update function. But still have one question: How????</p><p>in class root </p><pre><code>public void update(){ maindebug(""update""); // This is my debug function}public void run(){ while(isRunning){ // isRunning is a boolean variable     SystemClock.sleep(100);  update(); }}</code></pre><p>and inside onCreate </p><pre><code>run();</code></pre><p>but it doesnt work :( </p>","245371","","52201","","2010-05-14 15:13:56","2010-05-14 15:40:31","Update function","<java><android><events>","2","2","","",""
"2834892","1","2834961","","2010-05-14 14:28:10","3","1427","<p>I'm trying to add a context menu to my ExpandableListView. I've implemented onCreateContextMenu() and onContextItemSelected() but if I hold my finger on a menu item context menu doesn't appear. What's my mistake? </p><p>Thanks,</p><p>Aleksander</p>","218783","","","","","2010-05-14 14:37:43","ExpandableListView context menu","<android>","1","0","","",""
"2835425","1","","","2010-05-14 15:37:00","4","1960","<p>As you probably know, you can setup date format in the Settings of an Android device. </p><p>In code how do we make sure that we use that format for date display?</p>","243782","","","","","2013-06-21 21:00:47","How to use the date format that has been setup as default in Settings?","<locale><date-format><android>","2","0","0","",""
"2835508","1","","","2010-05-14 15:48:40","0","335","<p>I wanted to start working on android but having installation issues. When I start the AVD Manager and check the <strong>repository.xml url</strong> it <strong>gives</strong> me an <strong>error</strong> ""... not able to fetch the url. Connection timeout."" the same thing happens if I use http or https but if i try to open the url in my browser, it returns the response. I do not have a manual proxy set in the browser but do have an automatic proxy configuration url. I tried copying that url to the internet section in AVD but still no response returned. Also, we do not have the permission to turn off the firewall.Is there a place where i can download the SDK <strong>Platform</strong> Android (1.6 preferred)?</p>","322571","","383124","","2012-12-22 11:34:54","2012-12-22 11:34:54","Not able to add android platform using AVD manager - not able to fetch the url from AVD","<android>","4","0","","",""
"2835556","1","2835694","","2010-05-14 15:53:50","58","28694","<p>What's the difference between <code>setWebViewClient</code> vs. <code>setWebChromeClient</code> in Android?</p>","243782","","244296","","2011-02-17 13:51:50","2013-10-23 16:54:51","What's the difference between setWebViewClient vs. setWebChromeClient?","<android><webviewclient><webchromeclient>","1","1","25","",""
"2835676","1","","","2010-05-14 16:10:45","1","422","<p>I just want my connection to use this apn, i.e. I don't want to set the global apn.</p>","306517","","","","","2010-05-14 16:10:45","is it possible to specify an apn setting for a connection in Android?","<android><http><apn>","0","1","","",""
"2835977","1","","","2010-05-14 16:50:32","0","1007","<p>I have written a number of applications for blackberry and am just starting in Android.  It seems to me that android has a lot more built in functions.  I am starting by recreating some of my BB apps on Android and on one I take a few xml sites and parse them out.  On blackberry I implemented this by creating a class that extended a thread.  I would construct a new instance of this class with the parameters of my http request and it would call a function back in my main class, sending it the results.  I am tempted to reuse my code, but am curious if android has something better built in.  I have been looking at the handler class as well as possible using a service.</p><p>Bascially, I would like to start a new thread that will return a document of a specific url.</p><p>Thanks! </p>","341447","","","","","2010-05-14 17:37:54","Android HTTP get methods","<android>","1","0","","",""
"2835982","1","","","2010-05-14 16:51:04","3","551","<p>I have an app that is streaming audio content and sometimes it juststops all of the suddent.</p><p>the logcat windows shows --</p><p>AudioHardware pcm playback is going to standby</p><p>and that's it.</p><p>I saw on another thread (pun intended) that someone was saying it wasbecause he was using too many threads.  Could that really be causingthis?  Could i give the audio thread higher priority?</p><p>Anyway to prevent the audio hardware pcm from going to standby?</p>","306517","","","","","2010-07-14 20:05:35","android playback suddenly stopping","<android><media><pcm><playback>","1","1","","",""
"2836098","1","4092859","","2010-05-14 17:09:16","18","19066","<p>Given a closed Path object result is like this: </p><p><img src=""http://i.stack.imgur.com/jm1ov.jpg"" alt=""enter image description here""></p><p>Although that is a rectangle I'm looking for something which works with any closed Path.</p>","250340","","1231359","","2014-02-12 08:48:16","2014-02-12 08:48:16","How to fill a Path in Android with a linear gradient?","<android><graphics><path><fill>","2","0","4","",""
"2836172","1","2837533","","2010-05-14 17:20:56","17","7703","<p>The default progress wheel on Android doesn't display well when the background is white, it's barely visible. How can I fix this?</p>","243782","","","","","2012-08-20 21:08:56","Is there a black progress bar to be visible on a white background?","<android><progress-bar>","3","0","4","",""
"2836256","1","2836754","","2010-05-14 17:32:51","28","17982","<p>I have an activity that when started needs access to two different ArrayLists.  Both Lists are different Objects I have created myself. </p><p>Basically I need a way to pass these objects to the activity from an Intent.  I can use addExtras() but this requires a Parceable compatible class.  I could make my classes to be passed serializable but as I understand this slows down the program.</p><p>What are my options?</p><p>Can I pass an Enum?</p><p>As an an aside: is there a way to pass parameters to an Activity Constructor from an Intent?</p>","248521","","","","","2013-07-12 09:09:10","Passing enum or object through an intent (the best solution)","<android>","12","0","10","",""
"2836352","1","","","2010-05-14 17:46:19","0","1049","<p>Can you please tell me how can I specify  dimension of layout for different density of screen?i.e. the layout are the same across different densities, but some dimension are different.how can I do that?</p><p>Thank you.</p>","286802","","","","","2013-03-11 10:07:17","How can I specify different dimension of layout for different density","<android>","3","0","1","",""
"2836419","1","2836773","","2010-05-14 17:55:40","0","63","<p>I'd like to divide my tabs to 3 diffrent raws so each raw will have tabs of a similar activity( E.g. action games, board games, shooters games)How it can be done?Thanks,Eyal.</p>","341497","","","","","2010-05-14 18:49:38","How Can I control the nunmber of tabs raws inAndroid 1.5","<android><android-tabhost>","1","0","","",""
"2836432","1","3370598","","2010-05-14 17:57:44","1","615","<p>I'm having a bit of a problem with my Android application. I have 2 activities (among many others) which are Map activities.</p><p>The problem is that whenever I call the 2nd map activity and if the map view changes from that which was on the 1st map activity, the app crashes when returning to the first.Well not really crash, since it's not a force close, but the map in the 1st activity is non-existant...just grey squares...the only part visible is the one that was cached from before the 2nd map activity was called.</p><p>Anyone know how to fix this? Logcat shows Illegal State Exception: Connection pool shutdown and then floods the log with similar warnings.</p><p>Do help :)</p>","297616","","","","","2010-07-30 10:25:38","Multiple map activies in an application","<android><map>","1","0","","",""
"2836840","1","","","2010-05-14 19:01:37","0","2114","<p>im new to Android programing</p><p>I build a listview showing station names, that grabs its data from a URL. </p><p>I used ArrayAdapter to accomplish listview with data.</p><p>I need to navigate through station names in listview, using previous, next buttons click.</p><p>I google for this task and tried in different ways to workout bt im not able to solve.  </p><p>shall any one pls help me out for this issue.</p><p>Thanks in advance......</p><p>I tried like this</p><pre><code>private ListView stationList;public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.playscreen);            // move up event handler            preButton= (ImageButton) findViewById(R.id.prevButton);            preButton.setOnClickListener(new View.OnClickListener() {               public void onClick(View view) {                   movePre();               }            });            // move down event handler            nxtButton= (ImageButton) findViewById(R.id.nextButton);            nxtButton.setOnClickListener(new View.OnClickListener() {               public void onClick(View view) {                   moveNxt();               }            });            stationList.setAdapter(new StationAdapter(this,                    android.R.layout.simple_list_item_1, _stationList));        } else {            Log.d(TAG, ""No Stations"");        }    }private void movePre(){         stationList.setSelection(stationList.getSelectedItemPosition() - 1);}    // Move selected item ""down"" in the ViewList.    private void moveNxt(){        stationList.setSelection(stationList.getSelectedItemPosition() + 1);    }private class StationAdapter extends ArrayAdapter&lt;Station&gt; {        private Vector&lt;Station&gt; items;        public StationAdapter(Context context, int textViewResourceId,                Vector&lt;Station&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        public void setSelectedPosition(int pos){            selectedPos = pos;            // inform the view of this change            notifyDataSetChanged();        }        public int getSelectedPosition(){            return selectedPos;        }        @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.row, null);            }            Station st = items.get(position);            if (st != null) {                TextView tt = (TextView) v.findViewById(R.id.toptext);                TextView bt = (TextView) v.findViewById(R.id.bottomtext);                if (tt != null) {                    tt.setText(st.getStationName());                }                if (bt != null) {                    bt.setText(st.getCT());                }            }            return v;        }    }</code></pre>","341443","","1961262","","2013-01-17 09:39:09","2013-01-17 09:39:09","Move to next item or position in List view on button click","<android><android-emulator><android-widget><android-listview>","0","4","","",""
"2837071","1","2838488","","2010-05-14 19:39:59","2","4367","<p>I'm probably just being daft but my Google searches are not working out well.</p><p>I have a bunch of buttons i add in code that all have dynamic text.  I've set a background image for each of these buttons since the default greybutton doesn't work well for my application.</p><p>This works perfectly and when the text size (or content) changes, the button automatically grows to accommodate the expanded text.  What doesn't work is that I'd like the button to scale proportionally - i.e. if the background image is round, i'd like it to stay round rather than oval as the button gets bigger.</p><p>With an imagebutton, there is a property ""Adjust view bounds"" that does exactly this but I cant put text on an imagebutton.  Is there something equivalent for a regular button?</p><p>or am I going about this wrong?</p><p>i also tried setting the width of the button in code, but I can't seem to determine the new height (button.getHeight() returns 0)</p>","329776","","","","","2010-05-15 01:06:07","Android: scaling a button with a background image","<android><image><text><button><scale>","1","0","2","",""
"2837342","1","2852911","","2010-05-14 20:18:54","0","1844","<p>I'm trying to run some of the google applications like calendar, market, and email but the google login service doesn't work.  The various errors (like NoClassDefFoundError) make it seem like the pieces aren't even installed.  Any ideas?</p>","326385","","","","","2010-05-17 21:23:00","Google login service on android 2.1?","<android><android-emulator>","1","0","","",""
"2837676","1","2837801","","2010-05-14 21:13:28","8","19318","<p>I have tasks completed by AsyncTask in background. At some point I need to issue a Toast that something is completed. </p><p>I've tried and I failed because <code>Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></p><p>How can I do that?</p>","243782","","","","","2013-07-17 13:48:47","How to raise a toast in AsyncTask, I am prompted to used the Looper","<android><android-asynctask><toast><looper>","5","0","2","",""
"2837775","1","","","2010-05-14 21:33:15","1","1070","<p>I want to be able to start a short video on an incoming phone call. The video will loop until the call is answered. I've loaded the video onto the emulator sdcard then created the appropriate level avd with a path to the sdcard.iso file on disk. Since I'm running on a Mac OS x snow leopard I am able to confirm the contents of the sdcard. All testing has be done on the Android emulator.</p><p>In a separate project TestVideo I created an activity that just launches the video from the sdcard. That works as expected. Then I created another project TestIncoming that creates an activity that creates a PhoneStateListener that overrides the onCallStateChanged(int state, String incomingNumber) method. In the onCallStateChanged() method I check if state == TelephonyManager.CALL_STATE_RINGING. If true I create an Intent that starts the video. I'm actually using the code from the TestVideo project above. Here is the code snippet.</p><pre><code>PhoneStateListener callStateListener = new PhoneStateListener() {   @Override   public void onCallStateChanged(int state, String incomingNumber) {       if(state == TelelphonyManager.CALL_STATE_RINGING) {           Intent launchVideo = new Intent(MyActivity.this, LaunchVideo.class);           startActivity(launchVideo);       }   }};</code></pre><p>The PhoneStateListener is added to the TelephonyManager.listen() method like so,</p><pre><code>telephonyManager.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE);</code></pre><p>Here is the part I'm unclear on, the manifest. What I've tried is the following:</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.incomingdemo""  android:versionCode=""1""  android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".IncomingVideoDemo""              android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.ANSWER"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".LaunchVideo""              android:label=""LaunchVideo""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""2"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;&lt;/manifest&gt;</code></pre><p>I've run the debugger after setting breakpoints in the IncomingVideoDemo activity where the PhoneStateListener is created and none of the breakpoints are hit. Any insights into solving this problem is greatly appreciated. Thanks.</p>","307351","","1832221","","2013-05-29 09:59:01","2013-05-29 09:59:01","Start a short video when an incoming call is detected, first case using the emulator","<android><android-emulator><android-service>","0","2","0","",""
"2837973","1","7524269","","2010-05-14 22:13:39","5","798","<p>Here's what I'm trying to run on Android 1.6:</p><pre><code>package com.healthlogger.test;public class AllTests extends TestSuite{    public static Test suite()    {        return new TestSuiteBuilder(AllTests.class).includeAllPackagesUnderHere().build();    }}</code></pre><p>and:</p><pre><code>package com.healthlogger.test;public class RecordTest extends AndroidTestCase{    /**     * Ensures that the constructor will not take a null data tag.     */    @Test(expected=AssertionFailedError.class)    public void testNullDataTagInConstructor()    {        Record r = new Record(null, Calendar.getInstance(), ""Data"");        fail(""Failed to catch null data tag."");    }}</code></pre><p>The main project is HealthLogger. These are run from a separate test project (HealthLoggerTest).  HealthLogger and jUnit4 are in HealthLoggerTest's build path. jUnit4 is also in HealthLogger's build path. The class ""Record"" is located in com.healthlogger.</p><p>Commenting out the ""@Test..."" and ""Record r..."" lines allows this test to run. When they are uncommented, I get a VerifyError exception. I am severely blocked by this; why is it happening?</p><hr><p>EDIT: some info from logcat after the crash:</p><pre><code>    E/AndroidRuntime( 3723): Uncaught handler: thread main exiting due to uncaught exception                         E/AndroidRuntime( 3723): java.lang.VerifyError: com.healthlogger.test.RecordTest       E/AndroidRuntime( 3723): at java.lang.Class.getDeclaredConstructors(Native Method)    E/AndroidRuntime( 3723): at java.lang.Class.getConstructors(Class.java:507) E/AndroidRuntime( 3723): at  android.test.suitebuilder.TestGrouping$TestCasePredicate.hasValidConstructor(TestGrouping.java:226) E/AndroidRuntime( 3723): at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:215)  E/AndroidRuntime( 3723):    at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:211) E/AndroidRuntime( 3723):        at android.test.suitebuilder.TestGrouping.select(TestGrouping.java:170) E/AndroidRuntime( 3723):        at android.test.suitebuilder.TestGrouping.selectTestClasses(TestGrouping.java:160) E/AndroidRuntime( 3723):        at android.test.suitebuilder.TestGrouping.testCaseClassesInPackage(TestGrouping.java:154) E/AndroidRuntime( 3723):        at android.test.suitebuilder.TestGrouping.addPackagesRecursive(TestGrouping.java:115) E/AndroidRuntime( 3723):        at android.test.suitebuilder.TestSuiteBuilder.includePackages(TestSuiteBuilder.java:103) E/AndroidRuntime( 3723):        at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:321) E/AndroidRuntime( 3723):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3848) E/AndroidRuntime( 3723):        at android.app.ActivityThread.access$2800(ActivityThread.java:116) E/AndroidRuntime( 3723):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) E/AndroidRuntime( 3723): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 3723): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 3723):        at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 3723): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3723): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 3723): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 3723):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 3723):        at dalvik.system.NativeStart.main(Native Method)</code></pre>","341654","","637362","","2011-09-22 10:00:58","2011-09-23 04:34:14","VerifyError When Running jUnit Test on Android 1.6","<android><unit-testing><junit><android-sdk-1.6><verifyerror>","1","3","","",""
"2838063","1","2838286","","2010-05-14 22:34:36","1","2452","<p>I have created an account type using the AccountAuthenticator stuff as done in the <code>SampleSyncAdapter</code> tutorial. I am now trying to get account preferences working.</p><p>I have added the line <code>android:accountPreferences=""@xml/account_preferences""</code> to my <code>account-authenticator</code> and account_preferences.xml looks like so:</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/alum_settings_title""/&gt;&lt;CheckBoxPreference    android:key=""sync_alum""    android:title=""@string/sync_alum""    android:summaryOn=""@string/sync_alum_check""    android:summaryOff=""@string/sync_alum_nocheck""/&gt;&lt;ListPreference    android:key=""sync_alum_since""    android:title=""@string/alum_years""    android:entries=""@array/years""    android:entryValues=""@array/years""    android:dependency=""sync_alum""/&gt;&lt;/PreferenceScreen&gt;</code></pre><p>The checkbox preference works exactly like it should but the ListPreference crashes the entire system with the following message:</p><pre><code>05-14 22:32:16.794: ERROR/AndroidRuntime(63): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</code></pre><p>I get the same error with EditTextPreference and with the custom subclass of DialogPreference I created.</p>","111644","","","","","2010-10-01 09:59:08","Account preferences crashes on ListPreference","<android>","5","1","0","",""
"2838099","1","2838338","","2010-05-14 22:44:43","16","7467","<p>I've created my own DefaultHandler to parse rss feeds and for most feeds it's working fine, however, for ESPN, it is cutting off part of the article url due to the way ESPN formats it's urls.  An example of a full article url from ESPN..</p><pre><code>http://sports.espn.go.com/nba/news/story?id=5189101&amp;amp;campaign=rss&amp;amp;source=ESPNHeadlines</code></pre><p>The problem is for some reason the DefaultHandler characters method is only getting this from the tag that contains the above url.</p><pre><code>http://sports.espn.go.com/nba/news/story?id=5189101</code></pre><p>As you can see, it's cutting everything off the url from the ampersand escape code and after.  How can I get the SAX parser to not cut my string off at this escape code?  For ref. here is my characters method..</p><pre><code> public void characters(char ch[], int start, int length) {  String chars = (new String(ch).substring(start, start + length));  try {   // If not in item, then title/link refers to feed   if (!inItem) {    if (inTitle)     currentFeed.title = chars;   } else {    if (inLink)     currentArticle.url = new URL(chars);    if (inTitle)     currentArticle.title = chars;    if (inDescription)     currentArticle.description = chars;    if (inPubDate)     currentArticle.pubDate = chars;    if (inEnclosure) {    }   }  } catch (MalformedURLException e) {   Log.e(""RSSReader"", e.toString());  } }</code></pre><p>Rob W.</p>","326430","","","","","2013-01-24 10:19:37","Android SAX parser not getting full text from between tags","<android><parsing><escaping><sax>","2","0","11","",""
"2838217","1","2846290","","2010-05-14 23:20:25","6","14224","<p>I am utilizing a version of the ""Grid View"" example from the Android Developers site:</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p><p>And I would like to display a small text caption below each of the images.</p><p>Can someone please give an example of how this might be accomplished (i.e. what needs to be edited)? </p><p>Thanks!</p>","314994","","","","","2010-05-17 02:08:55","Android - Display Image Caption Below Images in Gridview","<android>","2","0","1","",""
"2838495","1","2839680","","2010-05-15 01:08:48","9","5600","<p>I have a background service that can be configured to perform some action every x minutes. I want to implement a widget that gets updated every time my service performs that action. However, I can't get the onUpdate method of my AppWidgetProvider called in any way, except when adding a widget to the homescreen.</p><p>I tried sending APPWIDGET_UPDATE intents but onUpdate did not get called although the AppWidgetProvider did receive the intent since the onReceive method was called. Is there any way I can trigger widget updates from a service?</p>","321103","","","","","2010-05-30 08:34:34","How to update widgets from a service?","<android><widget>","1","0","3","",""
"2838757","1","2904259","","2010-05-15 03:04:09","86","127693","<p>I have a button as in the following:</p><pre><code>&lt;Button      android:text=""Submit""      android:id=""@+id/Button01""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""&gt;&lt;/Button&gt;</code></pre><p>In my <code>onCreate()</code> event, I am calling Button01 like this:</p><pre><code>setContentView(R.layout.main);View Button01 = this.findViewById(R.id.Button01);Button01.setOnClickListener(this);</code></pre><p>There is a background in the application, and I want to set an opacity on this submit button. How can I set an opacity for this view? Is it something that I can set on the java side, or can I set in the main.xml file?</p><p>On the java side I tried <code>Button01.mutate().SetAlpha(100)</code>, but it gave me an error.</p>","239626","","1522562","","2013-06-12 06:16:17","2013-12-17 21:54:29","How to Set Opacity (Alpha) for View in Android","<android><button><view><opacity>","10","0","32","",""
"2838938","1","2839685","","2010-05-15 04:37:07","2","5267","<p>Is it possible to change the default shape (i.e rectangular) of the button (normal button as well as imagebutton) to something else maybe like star or a triangle in Android? Any tutorials or sample code would be much appreciated. </p>","323404","","","","","2010-05-15 10:06:29","Android: How to change the default shape of a button?","<android><button>","1","0","","",""
"2838953","1","2844230","","2010-05-15 04:49:40","0","876","<p>Is there a way to trace through function calls at the lowest levels of the Android system? Right now when I debug in Eclipse, it goes through the source files that are located inside the frameworks folder, but is it possible to go even lower? For example show what functions are being called from the libcore folder. I am also interested to find how it communicates with the linux kernel at the bottom of the layers. Is there a way to do this?Thanks</p>","193562","","","","","2010-05-16 15:08:17","Low level Android Debugging","<android><linux><debugging><kernel>","3","0","1","",""
"2838992","1","","","2010-05-15 05:08:48","-1","1791","<p><strong>This is the error:</strong></p><pre><code>android.database.sqlite.SQLiteException: attempt to write a readonly database</code></pre><p><strong>This is my code:</strong></p><pre><code>SQLiteDatabase db = mDatabase.getWritableDatabase();db.beginTransaction();try {   // add new records   ContentValues newRecord = new ContentValues();   newRecord.put(Emergencydetails.EMERGENCYNUMBER, emergencyNumber.getText().toString());   db.insert(Emergencydetails.EMERGENCY_TABLE_NAME, null, newRecord);   db.setTransactionSuccessful();} finally {db.endTransaction();}</code></pre>","341733","","6372","","2010-05-15 05:09:46","2010-05-15 11:05:33","attempt to write a readonly database in Android2.1","<database><android>","1","1","","",""
"2839046","1","2839134","","2010-05-15 05:33:50","0","1241","<p>i am writing a software that i have to drill down on content a lot. For example when the program starts a listview is displayed. When user clicks on an item, then a second listview must be displayed. For example:</p><p>Select Continent > Select Country > Select State > Select City > Select Address</p><ol><li><p>What is the best way to do this (less memory, faster, easier to code etc)? To create multiple listviews with multiple adapters? Or 1 listview with multiple Adapters? Lists are loaded from an external XML File.</p></li><li><p>So far i am creating a new adapter and setting it to the listview. How do i create a second listview and after clicking on 1st listview displaying the second one, with animation. Any examples?</p></li><li><p>Extend my class to ListActivity or Activity?</p></li></ol>","341781","","1069068","","2013-03-19 14:44:53","2013-03-19 14:44:53","What is the best way to do multiple listviews in android?","<android><listview><adapter><listactivity>","2","1","","",""
"2839090","1","","","2010-05-15 05:55:35","12","7098","<p>Is there a Kalman filter implementation I can use to fliter my gyroscope and acceleration data from an Android Phone? </p>","341787","","","","","2010-06-21 09:39:35","Kalman Filter for Android","<android><game-physics>","2","0","11","",""
"2839366","1","2839423","","2010-05-15 07:58:45","1","1867","<p>I am developing Android Twitter application. I downloaded TwitterClient Demo deom net.But there is a class file ""android.net.http.RequestQueue"" that is not available in sDK component in android.jar. Please advise on the same.</p>","301549","","","","","2013-09-02 16:51:27","android.net.http.RequestQueue not found in andorid.jar","<android>","1","0","1","",""
"2839533","1","2839560","","2010-05-15 08:56:13","7","4374","<p>I'm trying to generate some points at random distances away from a fixed point using GPS.</p><p>How can I add distance in meters to a GPS coordinate?I've looked at UTM to GPS conversion but is there a simpler method to achieve this?</p><p>I'm working on Android platform just in case.</p><p>Cheers, fgs</p>","341842","","","","","2013-10-23 11:14:29","Adding distance to a GPS coordinate","<android><gps>","3","0","6","",""
"2839727","1","2839911","","2010-05-15 10:22:17","5","8378","<p>I am displaying an icon in status bar.Now I want to remove that icon immediately when I open that content, after some time if we receive any alert, that icon will be displayed again. How can I do this?</p>","454808","","815724","","2013-02-26 01:04:11","2013-02-26 01:04:11","Remove the notification icon from the status bar","<android>","2","0","3","",""
"2839905","1","2856662","","2010-05-15 11:23:52","1","3681","<p>I have activity with ListView. That listView contains imageView and two textViews (aka first and last names). I want to organize searching with this listView by one of textView (e.g. by last name). How can I implement that? </p><p>I found that Quick Search Box can be used but I didn't understand how to work with it.</p><p>Help, plz :)</p>","332311","","","","","2010-05-18 11:16:54","Android. Searching over the listView","<android><search><listview>","1","0","","",""
"2839940","1","2840125","","2010-05-15 11:33:45","0","656","<p>I'm trying to build <a href=""http://github.com/dschaefer/android-box2d"" rel=""nofollow"">dschaefer android-box2d</a>, and did follow the recipe.I do get this error when trying to build the TestBox2d with eclipse:</p><hr><p>make all/cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld \-nostdlib -shared -Bsymbolic --no-undefined \-o obj/libtest.so obj/test.o -L../box2d/lib/android -lbox2d \-L/cygdrive/c/android/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib \-llog -lc -lstdc++ -lm \/cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a \</p><p>/cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld: cannot find -lbox2dmake: <em>*</em> [obj/libtest.so] Error 1</p><hr><p>The only thing I did change was in the TestBox2d\Makefile where i did change the path to the NDK.</p><p>There are some other that have the same problem <a href=""http://markmail.org/message/akikscccxkqvs56w#query%3aDoug%20Schaefer%20box2d+page:1+mid%3aakikscccxkqvs56w+state%3aresults"" rel=""nofollow"">HERE</a> but I do not know how to fix it.</p>","27840","","27840","","2010-05-15 11:58:26","2010-05-15 12:40:59","Problem Building dschaefer / android-box2d","<c++><android><eclipse><android-ndk><box2d>","1","0","","",""
"2839978","1","2840382","","2010-05-15 11:46:23","2","6597","<p>I have a cluster of items on an overlay in a mapView.<br>I know where the top/bottom/left/right most objects are.<br>I want to use the zoomToSpan() method to zoom onto that area.  </p><p>What is the proper way to calculate the lat/lng degrees for this method ?</p>","184973","","","","","2012-02-21 02:55:00","Calculating zoomToSpan() degrees based on min/max lat/lng to be in the mapView","<android><google-maps><android-mapview><zooming>","3","0","","",""
"2840248","1","2840551","","2010-05-15 13:19:58","0","961","<p>I've been figuring how to popup a webview all day when a row in my ListActivity is clicked. I can't even show a Toast when it's clicked. Need help  </p><p>I'm still new with Android, a web developer trying to learn. Thanks before.</p><p>package com.mf.ar;</p><p>import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;</p><p>import android.app.Activity; import android.app.AlertDialog; import android.app.ListActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ArrayAdapter; import android.widget.Toast;</p><p>public class ListViewer extends ListActivity {  private String mJSON;  private String[] listRows;  private String[] listRowsURI;</p><pre><code> /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     //setContentView(R.layout.listview);     Bundle the = getIntent().getExtras();     this.mJSON = the.getString(""JSON"");     Log.i(""ListViewIntentJSON"", this.mJSON);     try {JSONObject UrbJSON = new JSONObject(mJSON);JSONObject UrbQuery = UrbJSON.getJSONObject(""query"");int rows = UrbQuery.getInt(""row"");Log.i(""UrbRows"", String.format(""%d"",rows));JSONArray resultArray = UrbJSON.getJSONArray(""result"");this.listRows = new String[rows];for(int i=0; i&lt;rows; i++) {  this.listRows[i] = resultArray.getJSONObject(i).   getString(""business_name"").toString();}this.listRowsURI = new String[rows];for(int i=0; i&lt;rows; i++) {  this.listRowsURI[i] = resultArray.getJSONObject(i).   getString(""business_uri_mobile"").toString();}     } catch(JSONException e) {      e.printStackTrace();     }     this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,              android.R.layout.simple_list_item_1, ListViewer.this.listRows)); } @Override protected void onListItemClick(android.widget.ListView l, View v, int position, long id) {  super.onListItemClick(l, v, position, id);  String theURI = ListViewer.this.listRowsURI[position].toString();  /*String theURI = ListViewer.this.listRowsURI[position].toString();  //String theURI = ""http://www.mediafusion.web.id"";  WebView webview = new WebView(this);  //setContentView(webview);  //addContentView(webview, null);  webview.getSettings().setJavaScriptEnabled(true);  getWindow().requestFeature(Window.FEATURE_PROGRESS);  final Activity activity = this;webview.setWebChromeClient(new WebChromeClient() {  public 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 * 1000);  }});webview.setWebViewClient(new WebViewClient() {  public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {    Toast.makeText(activity, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();  }});  webview.loadUrl(theURI);*/  Toast.makeText(ListViewer.this.getApplicationContext(), theURI, Toast.LENGTH_SHORT); }</code></pre><p>}</p>","341925","","","","","2010-05-15 14:59:47","Android ListActivity OnListItemClick error with Webviews","<android><webview><listactivity>","1","0","","",""
"2840325","1","2840557","","2010-05-15 13:45:22","0","1085","<p>I have ListViewActivity</p><pre><code>public class SelectActivity extends ListActivity {    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.select_one_of);        SimpleAdapter adapter = new SimpleAdapter(            this,            createChildList(),            R.layout.select_one_of_childrow,             new String[] { KEY_VALUE },            new int[] { R.id.selectoneof_add_new_item});        setListAdapter(adapter);    }// ...}</code></pre><p>after setListAdapter() calls I would like to execute the following code:</p><pre><code>((TextView) getListView().getChildAt(0).findViewById(R.id.selectoneof_add_new_item)).setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ticked, 0);</code></pre><p>but getListView().getChildAt(xxx) returns null and I catch NullPointerException. Where should I put mentioned above code-snippet?</p>","332311","","","","","2010-05-15 15:01:31","Android's listview. Update view within of of the cells just after invalidating Activity's view","<android><listview>","1","0","","",""
"2840608","1","2842625","","2010-05-15 15:17:44","90","87937","<p>When I define in a TextView in XML, how do I add new line to it? \n seams to not work.</p><pre><code>&lt;TextView   android:id=""@+id/txtTitlevalue""   android:text=""Line1: \n-Line2\n-Line3""   android:layout_width=""54dip""   android:layout_height=""fill_parent""   android:textSize=""11px"" /&gt;</code></pre>","243782","","243782","","2012-08-21 06:25:37","2014-03-16 12:09:15","How do I add a newline to a TextView in Android?","<android><newline><textview>","16","2","10","",""
"2840614","1","2840656","","2010-05-15 15:19:37","3","2324","<p>What is the difference between <code>Context.startService(intent)</code> and <code>startService(intent)</code> and does it matter which one is used?</p>","263481","","366904","","2012-03-21 04:56:22","2012-03-21 05:16:29","Context.startService(intent) or startService(intent)","<android><service>","2","0","1","",""
"2840632","1","","","2010-05-15 15:26:07","0","552","<p>I have a android app that is communicating with a server (written in java).Between these two parts I have established a Socket connection and want to send data. The problem I am having is that sometimes, for some users, the information that reaches the server is null.</p><p>This works (for all phones, all users):<br>Server:  </p><pre><code>int a = Integer.parseInt(in.readLine());int b = Integer.parseInt(in.readLine());int c = Integer.parseInt(in.readLine());int d = Integer.parseInt(in.readLine());String checksum = in.readLine();String model = in.readLine();String device = in.readLine();String name = in.readLine();</code></pre><p>Client:  </p><pre><code>out.println(a);out.println(b);out.println(c);out.println(d);out.println(hash);out.println(Build.MODEL);out.println(Build.DEVICE);String name = fixName();out.print(name);out.flush();</code></pre><p>This does not work (for some users):<br>Server: </p><pre><code>int a = Integer.parseInt(in.readLine());String checksum = in.readLine();String model = in.readLine();String device = in.readLine();String name = in.readLine();String msg = in.readLine();int version = -1;String test = ""hej"";try{    test = in.readLine();    version = Integer.parseInt(test);}catch(Exception e){    e.printStackTrace();}</code></pre><p>Client:  </p><pre><code>out.println(a);out.println(hash);out.println(Build.MODEL);out.println(Build.DEVICE);String name = fixName();if(name == null) name = ""John Doe"";out.println(name);String msg = fixMsg();if(msg == null) name = ""nada"";out.println(msg);out.println(curversion);out.flush();</code></pre><p>Sometimes, in the second case, the name, msg, and version (the string test) are null at the server side. The catch is triggered because test is null.<br>curversion,a are ints, the rest are strings.</p><p>Any ideas?</p>","341975","","","","","2010-05-16 03:28:33","Sockets receiving null (Android)","<java><android><sockets><null>","2","0","","",""
"2840652","1","2840657","","2010-05-15 15:33:02","1","183","<p>I am trying a database app on Android.<br>I want to use the SQLiteDatabase <strong><em>update(...)</em></strong> convenience method to update a record.<br>Normally, for a WHERE clause of a single key this is working. Following code is working fine:-</p><pre><code>values.put(""testname"", ""Quiz1"");  mDB.update(""Tests"", values, ""id=?"", new String[]{""2""}); //this statement works</code></pre><p>However, I want to update a column in a table which has a combination of two keys as the unique identifier. I tried the following. This executes without exception, but nothing is updated.</p><pre><code>values.put(""score"", 60);  mDB.update(""Results"", values, ""studentid=? AND testid=?"",     new String[] { ""2,1"" }); // this statement does not work`</code></pre><p>How to do it? </p>","289918","","235654","","2010-05-15 16:12:45","2010-05-15 16:12:45","How to update a record with multiple keys","<sql><android>","1","0","","",""
"2840750","1","","","2010-05-15 16:00:43","2","1502","<p>Ok so I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things. </p><p>If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens. </p><p>Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation? </p><p>If it helps my manifest is: </p><pre><code>&lt;!-- receivers for AlarmManager --&gt; &lt;receiver android:exported=""true"" android:label=""Shift roster updating calendar."" android:name=""com.skooter.shiftroster.backend.service.UpdateCalendar"" &gt; &lt;/receiver&gt; &lt;receiver android:exported=""true"" android:label=""Shift roster checking alarm."" android:name=""com.skooter.shiftroster.backend.service.SetWakeup"" &gt; &lt;/receiver&gt; </code></pre><p>and nothing esoteric is going on in the AlarmManager/BroadcastReceivers</p>","308675","","","","","2010-05-15 16:21:54","Why do AlarmManager broadcasts get cancelled when app gets killed?","<android><broadcastreceiver><alarmmanager>","1","0","","",""
"2840970","1","2841053","","2010-05-15 17:06:52","0","771","<p>the least thing i like on the nexus one is the useless app it runs when on the desktop dock.</p><p>I already wasted a good day searching for the 3 topics below and failed to find anything.</p><ol><li><p>Is there any replacement for it already available?</p></li><li><p>Is there source code for the original one?</p></li><li><p>Is there documentation on how to replace them?</p></li></ol>","183132","","","","","2010-05-15 17:31:33","replacement for clock app","<android><clock><dock><nexus-one>","1","0","1","",""
"2840989","1","","","2010-05-15 17:11:33","0","114","<p>I'm a new in Android and Java and I have the following problem. I want to change standard resources,  such as  button background, programatically to allow applications using standard buttons be displayed with custom background. My problem is - how shall I identify the path for retrieval resources on phone or emulator? And if we have permissions to access to those resources? </p>","341998","","","","","2010-05-15 18:14:53","How to change standard resources on phone/emulator","<android><resources>","1","0","","",""
"2841086","1","2841105","","2010-05-15 17:39:12","2","671","<p>I'm using the SQLite3 database system in the Android library.</p><p>I need to execute a query during a transaction to see if there is a similar entry already there.  If there is, I have to perform some other logic and adjustments before I add a new row.</p><p>Can I execute a query within a transaction and get the result back immediately?</p>","131871","","","","","2012-12-19 16:06:07","Can I query inside a SQLite Transaction?","<android><sqlite>","2","0","","",""
"2841298","1","3333068","","2010-05-15 18:41:42","2","554","<p>I think I'm experiencing the same as<a href=""http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357"" rel=""nofollow"">http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357</a><br>This is Android 1.5 SDK.I happen to call several times below code(which is in a method) withthe same url and it fails intermittently.<br>When it fails, there is no exception, the stream is empty so thereadConnection fails, and getResponseCode returns -1.<br>Global caching is disabled, setDefaultUseCaches(false);</p><p>I suppose there must be some kind of url connection object pool somewhere.</p><p>Any idea on how can I workaround this?</p><pre><code>HttpURLConnection connection = null;    try {        URL url = new URL(this.url);        connection = (HttpURLConnection) url.openConnection();        connection.setRequestProperty(""Authorization"", ""basic "" +        Base64Coder.encodeString(user + "":"" + password));        connection.setRequestProperty(""User-Agent"", userAgent);        connection.connect();        readConnection(connection.getInputStream());        connection.disconnect();    } catch (IOException ex) {               reportException(ex, connection.getResponseCode())    } catch (ParserException ex) {               reportException(ex, connection.getResponseCode())    } </code></pre>","78667","","","","","2011-04-04 05:41:47","HttpsURLConnection failing intermittently to the same URL","<android><https><get>","2","0","1","",""
"2841316","1","2841677","","2010-05-15 18:45:48","0","1244","<p>I'm developing on Android with OpenGL ES, I draw some cubes and I change their colors with glColor4f. Now, what I want is to give a more realistic effect on the cubes, so I create a monochromatic 8bit depth, 64x64 pixel size PNG file. I loaded on a texture, and here is my problem, which is the way to combine the color and the texture to get a colorized and textured cubes onto the screen?</p><p>I'm not an expert on OpenGL, I tried this:</p><p>On create:</p><pre><code>public void asignBitmap(GL10 gl, Bitmap bitmap){    int[] textures = new int[1];    gl.glGenTextures(1, textures, 0);    mTexture = textures[0];    gl.glBindTexture(GL10.GL_TEXTURE_2D, mTexture);    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);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);    gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_ALPHA, bitmap, 0);    ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);    tbb.order(ByteOrder.nativeOrder());    mTexBuffer = tbb.asFloatBuffer();    for (int i = 0; i &lt; 48; i++) mTexBuffer.put(texCoords[i]);    mTexBuffer.position(0);}</code></pre><p>And OnDraw:</p><pre><code>public void draw(GL10 gl, int alphawires) {    gl.glColor4f(1.0f, 0.0f, 0.0f, 0.5f); //RED    gl.glBindTexture(GL10.GL_TEXTURE_2D, mTexture);gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glEnable(GL10.GL_BLEND);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);    //Set the face rotation    gl.glFrontFace(GL10.GL_CW);    //Point to our buffers    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    //Enable the vertex and color state    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    //Draw the vertices as triangles, based on the Index Buffer information    gl.glDrawElements(GL10.GL_TRIANGLES, 36, GL10.GL_UNSIGNED_BYTE, indexBuffer);    //Disable the client state before leaving    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glDisable(GL10.GL_BLEND);    gl.glDisable(GL10.GL_TEXTURE_2D);}</code></pre><p>I'm even not sure if I have to use a blend option, because I don't need transparency, but it's a plus :)</p>","244930","","26428","","2010-07-11 16:57:45","2010-07-11 16:57:45","OpenGL, how to set a monochrome texture to a colored shape?","<android><opengl-es><colors><textures>","1","0","","",""
"2841694","1","2841737","","2010-05-15 20:48:35","1","2549","<p>I have two SQLite tables, that I would love to join them on a name column. This column contains accented characters, so I am wondering how can I compare them for join. I would like the accents dropped for the comparison to work. </p>","243782","","243782","","2010-05-15 21:04:51","2012-10-25 05:43:05","How to SQL compare columns when one has accented chars?","<sql><android><sqlite><normalization>","3","0","1","",""
"2841766","1","4648123","","2010-05-15 21:09:28","49","43640","<p>I've set up the Android SDK and Eclipse on my machine running Windows XP and AVDs (Android Virtual Devices) are saved to ""Documents and Settings\<em>user</em>\.android"" by default.  Is there any way to change this behavior?  I have all of the other components saved in a directory on a separate partition and would like everything to be consolidated.  Obviously not a huge deal but does anyone here know a workaround for this?</p>","321871","","","","","2013-04-24 21:20:50","Possible to change where Android Virtual Devices are saved?","<windows><android><avd>","9","0","24","",""
"2841973","1","","","2010-05-15 22:28:18","5","19919","<p>I have a form with 2 fields where you can enter in either months or years.  How do I setup the form so that if you enter in the years, the months edittext field will be automatically calculated and entered into it's own box.  Likewise, I want the years to be calculated if you entered in the months</p><p>Can anyone give me sample code for this?</p>","342143","","","","","2014-02-17 04:29:26","onFocusChange code example?","<android>","1","0","1","",""
"2842080","1","2842182","","2010-05-15 23:24:57","6","9315","<p>I get null pointer exception at line mService.start() when i try to bind to an already started service. I do the same thing from different activity(where the service gets started) everythig goes right. All these activities are part of one application.</p><p>What do you think I do wrong?</p><pre><code>public class RouteOnMap extends MapActivity{    private static final int NEW_LOCATION = 1;    private static final int GPS_OFF = 2;    private MapView mMapView;    private ILocService mService;    private boolean mServiceStarted;    private boolean mBound;    private Intent mServiceIntent;    private double mLatitude, mLongitude;    private ServiceConnection connection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder iservice) {            mService = ILocService.Stub.asInterface(iservice);            mBound = true;        }        public void onServiceDisconnected(ComponentName className) {            mService = null;            mBound = false;        }    };    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.mapview);        mMapView = (MapView) findViewById(R.id.mapview);        mMapView.setBuiltInZoomControls(true);              mServiceIntent = new Intent();        mLatitude = 0.0;        mLongitude = 0.0;        mBound = false;    }    @Override    public void onStart(){        super.onStart();        mServiceIntent.setClass(this, LocationService.class);        //startService(mServiceIntent);        if(!mBound){            mBound = true;            this.bindService(mServiceIntent, connection, Context.BIND_AUTO_CREATE);        }    }    @Override    public void onResume(){        super.onResume();        try {            mService.start();        } catch (RemoteException e) {            e.printStackTrace();        }    }    @Override    public void onPause(){        super.onPause();        if(mBound){            this.unbindService(connection);        }    }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre>","263481","","","","","2010-05-16 00:20:10","android bindservice","<android><service>","1","0","2","",""
"2842248","1","","","2010-05-16 00:58:13","2","1699","<p>I'm using Wikitude API 1.1 as an AR viewer in my application. The problem with Wikitude, if I haven't launched the actual Wikitude application since the phone's bootup, I will get a NullPointerException everytime I start my own application.</p><p>So I figure if I can start my app first and them check if Wikitude is installed and or running. If it's not installed, go to market n download. If it's not running, then we should run it straight to background so that my app doesn't loose its focus.</p><pre><code>    // Workaround for Wikitude    this.WIKITUDE_PACKAGE_NAME = ""com.wikitude"";    PackageManager pacMan = Poligamy.this.getPackageManager();    try {        PackageInfo pacInfo = pacMan.getPackageInfo(this.WIKITUDE_PACKAGE_NAME, pacMan.GET_SERVICES);        Log.i(""CheckWKTD"", ""Wikitude is Installed"");        ActivityManager aMan = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);        List&lt;RunningAppProcessInfo&gt; runningApps = aMan.getRunningAppProcesses();        int numberOfApps = runningApps.size();        for(int i=0; i&lt;numberOfApps; i++) {            if(runningApps.get(i).processName.equals(this.WIKITUDE_PACKAGE_NAME)) {                this.WIKITUDE_RUNNING = 1;                Log.i(""CheckWKTD"", ""Wikitude is Running"");            }        }        if(this.WIKITUDE_RUNNING == 0) {            Log.i(""CheckWKTD"", ""Wikitude is NOT Running"");            /*final Intent wIntent = new Intent(Intent.ACTION_MAIN, null);            wIntent.addCategory(Intent.CATEGORY_LAUNCHER);            final ComponentName cn = new ComponentName(""com.wikitude"",                     ""com.mobilizy.wikitudepremium.initial.Splash"");            wIntent.setComponent(cn);            wIntent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);            startActivityIfNeeded(wIntent, 0);*/        }    } catch (NameNotFoundException e) {        // TODO Auto-generated catch block        Log.i(""CheckWKTD"", ""Wikitude is NOT Installed"");        e.printStackTrace();        //finish();    }</code></pre><p>The part I block commented is the intent to start Wikitude. But I always failed in restricting Wikitude to background. Any help? Thanks before.</p><p>Best,Tista</p>","341925","","","","","2010-05-16 10:21:50","Starting an Intent to Launch an app to Background in Android","<android><background><android-intent><launch>","1","0","","",""
"2842363","1","2842380","","2010-05-16 02:07:44","0","506","<p>Just wondering what you'd suggest as the best platform for developing a business application for a tablet device. </p><p>The application needs to be multitouch, have access to a maps API, a database on the device. </p><p>It will not be going on sale in the app store or Androids market, it is purely for specific business task and not for the general consumer.</p><p>Obviously the options seem to be iPhone OS and the iPad or Android and an Android tablet device. The form factor for the end product requires something in the region of 8 inch+ screen and enough processing power to provide a good experience for the end user.</p><p>Any help would be much appreciated.</p><p>Thanks</p>","310133","","131433","","2014-04-03 17:03:23","2014-04-03 17:03:23","Better product to develop for, iPad or Android based tablet in a purely business related application","<java><android><iphone><objective-c>","4","0","1","",""
"2842375","1","","","2010-05-16 02:11:07","2","704","<p>So, I followed a tutorial for drawing stuff on android. I have created a Panel class that extends SurfaceView that I draw on using a thread. Now I want to put this Panel in a scroll view, specifically one that scrolls horizontally so that I can draw stuff wider than the screen. I would I go about doing that?</p>","342187","","","","","2011-02-10 19:22:44","How do I add a custom view to a HorizontalScrollView?","<android><drawing><scrollview>","2","1","","",""
"2842399","1","","","2010-05-16 02:23:12","2","443","<p>I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app.</p><p><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>However, when I try to run in the Android emulator, I get the error:</p><p>""The application Hello Tab Widget has stopped unexpectedly. Please try again.""</p><p>I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.</p>","342189","","","","","2011-12-23 05:33:49","Error when starting a tab activity in Android?","<android><android-emulator><android-manifest>","3","1","","",""
"2842443","1","2842547","","2010-05-16 02:55:43","1","1587","<p>I'm trying to set up the Android SDK on Ubuntu.  Someday I want to make apps that can reach most of the market.</p><p>I've heard I need to make the apps compatible with Android 1.6 for this.  Does that mean everything I install should be for Android 1.6 (API level 4?).  Will I have any trouble running the apps on my phone with is Android 2.1?</p>","13009","","","","","2010-05-16 05:33:27","Android Set up Question - Which API Level do I Install?","<android>","4","0","","",""
"2842461","1","2846224","","2010-05-16 03:10:30","0","552","<p>I am trying to retrieve information from a web service call. The following is what I have so far. In my text view, it is showing</p><pre><code>Map {item=anyType{key=TestKey; value=2;}; item=anyType{key=TestField; value=adsfasd; };}</code></pre><p>When I ran that in the debugger, I can see the information above in the variable, tempvar. But the question is, how do I retrieve the information (i.e. the actual values of ""key"" and ""value"" in each of the array positions)?  Yes, I know there is a lot going on in onCreate and I will fix it later.</p><p>Thanks in advance,Monte</p><p>My codes are as follows,</p><pre><code>import java.util.Vector;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.AndroidHttpTransport;public class ViewHitUpActivity extends Activity {private static final String SOAP_ACTION = ""test_function"";private static final String METHOD_NAME = ""test_function"";private static final String NAMESPACE = ""http://www.monteandjanicechan.com/"";private static final String URL = ""http://www.monteandjanicechan.com/ws/test_ws.cfc?wsdl"";// private Object resultRequestSOAP = null;private TextView tv;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);tv = (TextView)findViewById(R.id.people_view);//SoapObjectrequest.addProperty(""test_item"", ""1"");SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.setOutputSoapObject(request);AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);try{androidHttpTransport.call(SOAP_ACTION, envelope);/*resultRequestSOAP = envelope.getResponse();Vector tempResult = (Vector) resultRequestSOAP(""test_functionReturn"");*/SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;Vector tempResult = (Vector) resultsRequestSOAP.getProperty(""test_functionReturn"");int testsize = tempResult.size();// SoapObject test = (SoapObject) tempResult.get(0);//String[] results = (String[]) resultRequestSOAP;Object tempvar = tempResult.elementAt(1);tv.setText(tempvar.toString());}catch (Exception aE){aE.printStackTrace ();tv.setText(aE.getClass().getName() + "": "" + aE.getMessage());}}} </code></pre>","287396","","9167","","2010-05-16 03:58:22","2010-05-17 22:14:27","retrieving information from web service calls","<android><web-services>","2","0","1","",""
"2842523","1","2843802","","2010-05-16 03:46:26","1","1821","<p>Newb alert, I'm sure I'm doing something dumb here.</p><p>I've been progressively expanding my UI, and I want to add a ListView in the middle of my UI.  When I add it and change the activity to extend a ListActivity instead of just an Activity, I'm getting a Force Close.  Using 1.5.  Does a ListView not work embedded in a RelativeLayout?</p><p>Thanks</p><pre><code>public class Categories extends ListActivity{final static String[] ITEMS = {""blah"", ""floop"", ""gnarlp"", ""stuff""};@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.categories);        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,                R.layout.listrow, R.id.textview, ITEMS);        setListAdapter(adapter);</code></pre><p>XML looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&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;ImageView   android:id=""@+id/ImageView01""   android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:scaleType=""center"" android:background=""@drawable/background""&gt; &lt;/ImageView&gt; &lt;ImageView android:id=""@+id/ImageView02"" android:src=""@drawable/cat_heading"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_centerHorizontal=""true""&gt;  &lt;/ImageView&gt;&lt;ListView android:id=""@+id/ListView01"" android:layout_below=""@id/ImageView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout02"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_alignBottom=""@+id/RelativeLayout01"" android:layout_centerHorizontal=""true""&gt;&lt;ImageButton android:id=""@+id/ImageButtonRecipes"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true"" android:src=""@drawable/recipes""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:id=""@+id/ImageButtonSearch"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true"" android:layout_toRightOf=""@+id/ImageButtonRecipes"" android:src=""@drawable/search""&gt;&lt;/ImageButton&gt;&lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>and the listrow.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;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/textview""/&gt;&lt;/LinearLayout&gt;</code></pre>","302857","","1288","","2010-05-16 12:45:28","2010-05-16 12:56:10","ListActivity problem when using with RelativeLayout","<android><listview><listactivity>","2","2","","",""
"2843087","1","2847681","","2010-05-16 08:45:29","7","919","<p>I am trying to align four equally sized <em>squares</em> on an Android Screen &amp; I have now tried what feels like a million different approaches, yet none of them seem to work :(.</p><p>What I've got at the moment is the following:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:id=""@+id/MasterLayout"" android:layout_width=""wrap_content""     android:layout_height=""fill_parent""  android:background=""#FFFFFF""&gt;&lt;TableLayout android:layout_width=""fill_parent"" android:id=""@+id/mainlay"" android:background=""#444444"" android:layout_weight=""0.2"" android:layout_height=""wrap_content"" android:padding=""0dip""&gt;    &lt;TableRow android:layout_weight=""1""  android:background=""#BBBBBB"" android:padding=""0dip""&gt;        &lt;ImageView android:id=""@+id/ImageView1"" android:layout_marginLeft=""10px"" android:layout_weight=""1"" android:layout_marginRight=""5px"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:scaleType=""centerInside"" android:src=""@drawable/bigbox_new""&gt;&lt;/ImageView&gt;        &lt;ImageView android:id=""@+id/ImageView2"" android:layout_marginLeft=""5px"" android:layout_weight=""1"" android:layout_marginRight=""10px"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:scaleType=""centerInside"" android:src=""@drawable/bigbox_new""&gt;&lt;/ImageView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_weight=""1"" android:padding=""0dip""&gt;        &lt;ImageView android:id=""@+id/ImageView3"" android:layout_marginLeft=""10px"" android:layout_weight=""1"" android:layout_marginRight=""5px"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:scaleType=""centerInside"" android:src=""@drawable/bigbox_new""&gt;&lt;/ImageView&gt;        &lt;ImageView android:id=""@+id/ImageView4"" android:layout_marginLeft=""5px"" android:layout_weight=""1"" android:layout_marginRight=""10px"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:scaleType=""centerInside"" android:src=""@drawable/bigbox_new""&gt;&lt;/ImageView&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>This basically does the job. However, every one of those four Images has a huge padding above and under it. How do I get rid of that? Or do I need to use a different Layout type alltogether?</p><p>To help illustrate my problem, here's a picture.On the left is what I got, on the right is what I need.<a href=""http://www.freeimagehosting.net/uploads/th.a839cd1b5a.png"">Image</a></p><p>Thank you very much!</p><p>Cheers, Markus!</p>","321116","","321116","","2010-05-16 08:53:01","2010-05-17 08:47:46","Android: Alignment of four squares","<java><xml><android><layout>","3","0","","",""
"2843151","1","2843225","","2010-05-16 09:12:00","7","1853","<p>Hello I am a beginning android developer using windows and the eclipse IDE to develop java android applications.I have published one game but there is a free version of the game and a paid version. The google market insists that the different versions must have different package names. So far i have been refactoring the package with 2 different names and changing the R resource file import each time i build the different versions. The code is 99% the same for both versions.Is there a better way?</p>","263111","","","","","2010-06-02 20:10:39","Android & Eclipse 2 different versions of the same app","<android><eclipse>","2","0","1","",""
"2843152","1","2843440","","2010-05-16 09:12:28","8","265","<p>I'm considering making an existing mobile app into an open-source project. It has an Android and iPhone version.</p><p>While I have used open-source projects and submitted feature requests and bug reports, I have never created an open-source project nor contributed with a patch to an existing one.</p><p>What are the top things that I should take into account before opening the source of my project? What specific steps do you recommend taking for open-sourcing a mobile app?</p>","143378","","918414","","2013-03-16 03:11:41","2013-03-16 03:11:41","Open-sourcing a mobile app","<android><iphone><mobile><open-source>","4","0","3","",""
"2843250","1","2843274","","2010-05-16 09:52:32","8","14591","<p>How to send a command to the terminal through android app and get the output back? For example, sending ""ls /"" and getting the output to print it in the GUI?</p>","292942","","","","","2013-11-29 11:18:20","How to run terminal command in Android application?","<java><android><terminal>","3","0","11","",""
"2843260","1","2844015","","2010-05-16 09:55:29","2","270","<p>In an Android manifest, how can I use a negative match in the <code>android:pathPattern</code>?</p><p>I'd like to use a <code>pathPattern</code> that matches on all URLs <em>except</em> for a specific hostname, if it's possible.</p>","17328","","","","","2010-05-16 13:59:39","How can I perform a negative match in Android intent filter?","<java><android><regex><manifest><android-intent>","1","0","","",""
"2843322","1","","","2010-05-16 10:21:01","0","4917","<p>I am creating  an Android application.</p><p>My Application has audio and png files which i have saved in res/drawable folder.</p><p>When i run the app , its giving error</p><p>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE</p><p>and in the logcat it says -</p><p>ERROR/PackageManager(54): Couldn't copy package file to temp file.</p><p>I tried creating new avd also.But i am getting the same error.</p><p>I want all those png and audio files.</p><p>I dont want to store them in sdcard.</p><p>Please Suggest me how to solve this problem.</p><p>Thanks in Advance</p>","336070","","","","","2013-09-20 14:52:38","how to increase the storage space in Android emulator? (Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE)","<android>","3","1","","",""
"2843704","1","","","2010-05-16 12:25:26","0","814","<p>I have a problem with resizing content in a HorizontalScrollView when the phone is rotated. I'm overriding onConfigurationChanged in my activity containing the HorizontalScrollView, since I want to handle the resizing myself. However, I'm having great problem finding where i should put the resizing of the content. The HorizontalScrollView it self has FILL_PARENT as width and a fixed height. The idea is that it should always fill the screen width-wise, while having several cells of content, each as wide as the HorizontalScrollView itself.</p><p>The content in my HorizontalScrollView consists of one LinearLayout (let's call it wrapperLayout) with several LinearLayouts inside it. When the phone rotates I simply want to change the width of all the LinearLayouts inside the wrapperLayout. This is easy to do and works great when I test the resizing code by putting it in onInterceptTouchEvent(MotionEvent ev), that is the views are resized just as they are supposed to when I touch the HorizontalScrollView.</p><p>The difficulty appears when I try to find a good spot to execute resizing code, so that the resizing happens automatically when the phone is rotated. I have tried all possible combinations of requestLayout, onSizeChanged, onLayout, onConfigurationChanged and a few others and varying their calls to super (if any) before and after the resizing code. I can not make this work (the views are not resized even though the resize code is executed) and it is really frustrating. I've done a lot of logging to make sure the HorizonalScrollView really has changed width before calling my resize code but to no avail.</p><p>Does anyone have any clue as to what is going on? What methods are called and in what order when I handle the onConfigurationChanged by myself like this?</p><p>Thanks in advance</p>","390457","","390457","","2010-05-16 12:51:34","2010-09-15 00:48:50","Changing size of content in HorizontalScrollView when phone is rotated by overriding onConfigurationChanged","<android><android-linearlayout><horizontalscrollview>","1","0","","",""
"2843723","1","","","2010-05-16 12:29:47","1","131","<p>This GlRenderer works fine on the moto droid, but does not work well at all on droid eris or other android phones does anyone know why?</p><pre><code>package com.ntu.way2fungames.spacehockeybase;import java.io.DataInputStream;import java.io.IOException;import java.nio.Buffer;import java.nio.FloatBuffer;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import com.ntu.way2fungames.LoadFloatArray;import com.ntu.way2fungames.OGLTriReader;import android.content.res.AssetManager;import android.content.res.Resources;import android.opengl.GLU;import android.opengl.GLSurfaceView.Renderer;import android.os.Handler;import android.os.Message;public class GlRenderer extends Thread implements Renderer {        private float drawArray[];        private float yoff;        private float yoff2;        private long lastRenderTime;        private float[] yoffs= new float[10];        int Width;        int Height;        private float[] pixelVerts = new float[] {                +.0f,+.0f,2,                +.5f,+.5f,0,                +.5f,-.5f,0,                +.0f,+.0f,2,                +.5f,-.5f,0,                -.5f,-.5f,0,                +.0f,+.0f,2,                -.5f,-.5f,0,                -.5f,+.5f,0,                +.0f,+.0f,2,                -.5f,+.5f,0,                +.5f,+.5f,0,        };        @Override        public void run() {}        private float[] arenaWalls = new float[] {                8.00f,2.00f,1f,2f,2f,1f,2.00f,8.00f,1f,8.00f,2.00f,1f,2.00f,8.00f,1f,8.00f,8.00f,1f,                2.00f,8.00f,1f,2f,2f,1f,0.00f,0.00f,0f,2.00f,8.00f,1f,0.00f,0.00f,0f,0.00f,10.00f,0f,                8.00f,8.00f,1f,2.00f,8.00f,1f,0.00f,10.00f,0f,8.00f,8.00f,1f,0.00f,10.00f,0f,10.00f,10.00f,0f,                2f,2f,1f,8.00f,2.00f,1f,10.00f,0.00f,0f,2f,2f,1f,10.00f,0.00f,0f,0.00f,0.00f,0f,                8.00f,2.00f,1f,8.00f,8.00f,1f,10.00f,10.00f,0f,8.00f,2.00f,1f,10.00f,10.00f,0f,10.00f,0.00f,0f,                10.00f,10.00f,0f,0.00f,10.00f,0f,0.00f,0.00f,0f,10.00f,10.00f,0f,0.00f,0.00f,0f,10.00f,0.00f,0f,                8.00f,6.00f,1f,8.00f,4.00f,1f,122f,4.00f,1f,8.00f,6.00f,1f,122f,4.00f,1f,122f,6.00f,1f,                8.00f,6.00f,1f,122f,6.00f,1f,120f,7.00f,0f,8.00f,6.00f,1f,120f,7.00f,0f,10.00f,7.00f,0f,                122f,4.00f,1f,8.00f,4.00f,1f,10.00f,3.00f,0f,122f,4.00f,1f,10.00f,3.00f,0f,120f,3.00f,0f,                480f,10.00f,0f,470f,10.00f,0f,470f,0.00f,0f,480f,10.00f,0f,470f,0.00f,0f,480f,0.00f,0f,                478f,2.00f,1f,478f,8.00f,1f,480f,10.00f,0f,478f,2.00f,1f,480f,10.00f,0f,480f,0.00f,0f,                472f,2f,1f,478f,2.00f,1f,480f,0.00f,0f,472f,2f,1f,480f,0.00f,0f,470f,0.00f,0f,                478f,8.00f,1f,472f,8.00f,1f,470f,10.00f,0f,478f,8.00f,1f,470f,10.00f,0f,480f,10.00f,0f,                472f,8.00f,1f,472f,2f,1f,470f,0.00f,0f,472f,8.00f,1f,470f,0.00f,0f,470f,10.00f,0f,                478f,2.00f,1f,472f,2f,1f,472f,8.00f,1f,478f,2.00f,1f,472f,8.00f,1f,478f,8.00f,1f,                478f,846f,1f,472f,846f,1f,472f,852f,1f,478f,846f,1f,472f,852f,1f,478f,852f,1f,                472f,852f,1f,472f,846f,1f,470f,844f,0f,472f,852f,1f,470f,844f,0f,470f,854f,0f,                478f,852f,1f,472f,852f,1f,470f,854f,0f,478f,852f,1f,470f,854f,0f,480f,854f,0f,                472f,846f,1f,478f,846f,1f,480f,844f,0f,472f,846f,1f,480f,844f,0f,470f,844f,0f,                478f,846f,1f,478f,852f,1f,480f,854f,0f,478f,846f,1f,480f,854f,0f,480f,844f,0f,                480f,854f,0f,470f,854f,0f,470f,844f,0f,480f,854f,0f,470f,844f,0f,480f,844f,0f,                10.00f,854f,0f,0.00f,854f,0f,0.00f,844f,0f,10.00f,854f,0f,0.00f,844f,0f,10.00f,844f,0f,                8.00f,846f,1f,8.00f,852f,1f,10.00f,854f,0f,8.00f,846f,1f,10.00f,854f,0f,10.00f,844f,0f,                2f,846f,1f,8.00f,846f,1f,10.00f,844f,0f,2f,846f,1f,10.00f,844f,0f,0.00f,844f,0f,                8.00f,852f,1f,2.00f,852f,1f,0.00f,854f,0f,8.00f,852f,1f,0.00f,854f,0f,10.00f,854f,0f,                2.00f,852f,1f,2f,846f,1f,0.00f,844f,0f,2.00f,852f,1f,0.00f,844f,0f,0.00f,854f,0f,                8.00f,846f,1f,2f,846f,1f,2.00f,852f,1f,8.00f,846f,1f,2.00f,852f,1f,8.00f,852f,1f,                6f,846f,1f,4f,846f,1f,4f,8f,1f,6f,846f,1f,4f,8f,1f,6f,8f,1f,                6f,846f,1f,6f,8f,1f,7f,10f,0f,6f,846f,1f,7f,10f,0f,7f,844f,0f,                4f,8f,1f,4f,846f,1f,3f,844f,0f,4f,8f,1f,3f,844f,0f,3f,10f,0f,                474f,8f,1f,474f,846f,1f,473f,844f,0f,474f,8f,1f,473f,844f,0f,473f,10f,0f,                476f,846f,1f,476f,8f,1f,477f,10f,0f,476f,846f,1f,477f,10f,0f,477f,844f,0f,                476f,846f,1f,474f,846f,1f,474f,8f,1f,476f,846f,1f,474f,8f,1f,476f,8f,1f,                130f,10.00f,0f,120f,10.00f,0f,120f,0.00f,0f,130f,10.00f,0f,120f,0.00f,0f,130f,0.00f,0f,                128f,2.00f,1f,128f,8.00f,1f,130f,10.00f,0f,128f,2.00f,1f,130f,10.00f,0f,130f,0.00f,0f,                122f,2f,1f,128f,2.00f,1f,130f,0.00f,0f,122f,2f,1f,130f,0.00f,0f,120f,0.00f,0f,                128f,8.00f,1f,122f,8.00f,1f,120f,10.00f,0f,128f,8.00f,1f,120f,10.00f,0f,130f,10.00f,0f,                122f,8.00f,1f,122f,2f,1f,120f,0.00f,0f,122f,8.00f,1f,120f,0.00f,0f,120f,10.00f,0f,                128f,2.00f,1f,122f,2f,1f,122f,8.00f,1f,128f,2.00f,1f,122f,8.00f,1f,128f,8.00f,1f,                352f,8.00f,1f,358f,8.00f,1f,358f,2.00f,1f,352f,8.00f,1f,358f,2.00f,1f,352f,2.00f,1f,                358f,2.00f,1f,358f,8.00f,1f,360f,10.00f,0f,358f,2.00f,1f,360f,10.00f,0f,360f,0.00f,0f,                352f,2.00f,1f,358f,2.00f,1f,360f,0.00f,0f,352f,2.00f,1f,360f,0.00f,0f,350f,0.00f,0f,                358f,8.00f,1f,352f,8.00f,1f,350f,10.00f,0f,358f,8.00f,1f,350f,10.00f,0f,360f,10.00f,0f,                352f,8.00f,1f,352f,2.00f,1f,350f,0.00f,0f,352f,8.00f,1f,350f,0.00f,0f,350f,10.00f,0f,                350f,0.00f,0f,360f,0.00f,0f,360f,10.00f,0f,350f,0.00f,0f,360f,10.00f,0f,350f,10.00f,0f,                358f,6.00f,1f,472f,6.00f,1f,470f,7.00f,0f,358f,6.00f,1f,470f,7.00f,0f,360f,7.00f,0f,                472f,4.00f,1f,358f,4.00f,1f,360f,3.00f,0f,472f,4.00f,1f,360f,3.00f,0f,470f,3.00f,0f,                472f,4.00f,1f,472f,6.00f,1f,358f,6.00f,1f,472f,4.00f,1f,358f,6.00f,1f,358f,4.00f,1f,                472f,848f,1f,472f,850f,1f,358f,850f,1f,472f,848f,1f,358f,850f,1f,358f,848f,1f,                472f,848f,1f,358f,848f,1f,360f,847f,0f,472f,848f,1f,360f,847f,0f,470f,847f,0f,                358f,850f,1f,472f,850f,1f,470f,851f,0f,358f,850f,1f,470f,851f,0f,360f,851f,0f,                350f,844f,0f,360f,844f,0f,360f,854f,0f,350f,844f,0f,360f,854f,0f,350f,854f,0f,                352f,852f,1f,352f,846f,1f,350f,844f,0f,352f,852f,1f,350f,844f,0f,350f,854f,0f,                358f,852f,1f,352f,852f,1f,350f,854f,0f,358f,852f,1f,350f,854f,0f,360f,854f,0f,                352f,846f,1f,358f,846f,1f,360f,844f,0f,352f,846f,1f,360f,844f,0f,350f,844f,0f,                358f,846f,1f,358f,852f,1f,360f,854f,0f,358f,846f,1f,360f,854f,0f,360f,844f,0f,                352f,852f,1f,358f,852f,1f,358f,846f,1f,352f,852f,1f,358f,846f,1f,352f,846f,1f,                128f,846f,1f,122f,846f,1f,122f,852f,1f,128f,846f,1f,122f,852f,1f,128f,852f,1f,                122f,852f,1f,122f,846f,1f,120f,844f,0f,122f,852f,1f,120f,844f,0f,120f,854f,0f,                128f,852f,1f,122f,852f,1f,120f,854f,0f,128f,852f,1f,120f,854f,0f,130f,854f,0f,                122f,846f,1f,128f,846f,1f,130f,844f,0f,122f,846f,1f,130f,844f,0f,120f,844f,0f,                128f,846f,1f,128f,852f,1f,130f,854f,0f,128f,846f,1f,130f,854f,0f,130f,844f,0f,                130f,854f,0f,120f,854f,0f,120f,844f,0f,130f,854f,0f,120f,844f,0f,130f,844f,0f,                122f,848f,1f,8f,848f,1f,10f,847f,0f,122f,848f,1f,10f,847f,0f,120f,847f,0f,                8f,850f,1f,122f,850f,1f,120f,851f,0f,8f,850f,1f,120f,851f,0f,10f,851f,0f,                8f,850f,1f,8f,848f,1f,122f,848f,1f,8f,850f,1f,122f,848f,1f,122f,850f,1f,                10f,847f,0f,120f,847f,0f,124.96f,829.63f,-0.50f,10f,847f,0f,124.96f,829.63f,-0.50f,19.51f,829.63f,-0.50f,                130f,844f,0f,130f,854f,0f,134.55f,836.34f,-0.50f,130f,844f,0f,134.55f,836.34f,-0.50f,134.55f,826.76f,-0.50f,                350f,844f,0f,350f,854f,0f,345.45f,836.34f,-0.50f,350f,844f,0f,345.45f,836.34f,-0.50f,345.45f,826.76f,-0.50f,                360f,847f,0f,470f,847f,0f,460.49f,829.63f,-0.50f,360f,847f,0f,460.49f,829.63f,-0.50f,355.04f,829.63f,-0.50f,                470f,7.00f,0f,360f,7.00f,0f,355.04f,24.37f,-0.50f,470f,7.00f,0f,355.04f,24.37f,-0.50f,460.49f,24.37f,-0.50f,                350f,10.00f,0f,350f,0.00f,0f,345.45f,17.66f,-0.50f,350f,10.00f,0f,345.45f,17.66f,-0.50f,345.45f,27.24f,-0.50f,                130f,10.00f,0f,130f,0.00f,0f,134.55f,17.66f,-0.50f,130f,10.00f,0f,134.55f,17.66f,-0.50f,134.55f,27.24f,-0.50f,                473f,844f,0f,473f,10f,0f,463.36f,27.24f,-0.50f,473f,844f,0f,463.36f,27.24f,-0.50f,463.36f,826.76f,-0.50f,                7f,10f,0f,7f,844f,0f,16.64f,826.76f,-0.50f,7f,10f,0f,16.64f,826.76f,-0.50f,16.64f,27.24f,-0.50f,                120f,7.00f,0f,10.00f,7.00f,0f,19.51f,24.37f,-0.50f,120f,7.00f,0f,19.51f,24.37f,-0.50f,124.96f,24.37f,-0.50f,                120f,7.00f,0f,130f,10.00f,0f,134.55f,27.24f,-0.50f,120f,7.00f,0f,134.55f,27.24f,-0.50f,124.96f,24.37f,-0.50f,                10.00f,7.00f,0f,7f,10f,0f,16.64f,27.24f,-0.50f,10.00f,7.00f,0f,16.64f,27.24f,-0.50f,19.51f,24.37f,-0.50f,                350f,10.00f,0f,360f,7.00f,0f,355.04f,24.37f,-0.50f,350f,10.00f,0f,355.04f,24.37f,-0.50f,345.45f,27.24f,-0.50f,                473f,10f,0f,470f,7.00f,0f,460.49f,24.37f,-0.50f,473f,10f,0f,460.49f,24.37f,-0.50f,463.36f,27.24f,-0.50f,                473f,844f,0f,470f,847f,0f,460.49f,829.63f,-0.50f,473f,844f,0f,460.49f,829.63f,-0.50f,463.36f,826.76f,-0.50f,                360f,847f,0f,350f,844f,0f,345.45f,826.76f,-0.50f,360f,847f,0f,345.45f,826.76f,-0.50f,355.04f,829.63f,-0.50f,                130f,844f,0f,120f,847f,0f,124.96f,829.63f,-0.50f,130f,844f,0f,124.96f,829.63f,-0.50f,134.55f,826.76f,-0.50f,                7f,844f,0f,10f,847f,0f,19.51f,829.63f,-0.50f,7f,844f,0f,19.51f,829.63f,-0.50f,16.64f,826.76f,-0.50f,                19.51f,829.63f,-0.50f,124.96f,829.63f,-0.50f,136.47f,789.37f,-2f,19.51f,829.63f,-0.50f,136.47f,789.37f,-2f,41.56f,789.37f,-2f,                134.55f,826.76f,-0.50f,134.55f,836.34f,-0.50f,145.09f,795.41f,-2f,134.55f,826.76f,-0.50f,145.09f,795.41f,-2f,145.09f,786.78f,-2f,                345.45f,826.76f,-0.50f,345.45f,836.34f,-0.50f,334.91f,795.41f,-2f,345.45f,826.76f,-0.50f,334.91f,795.41f,-2f,334.91f,786.78f,-2f,                355.04f,829.63f,-0.50f,460.49f,829.63f,-0.50f,438.44f,789.37f,-2f,355.04f,829.63f,-0.50f,438.44f,789.37f,-2f,343.53f,789.37f,-2f,                460.49f,24.37f,-0.50f,355.04f,24.37f,-0.50f,343.53f,64.63f,-2f,460.49f,24.37f,-0.50f,343.53f,64.63f,-2f,438.44f,64.63f,-2f,                345.45f,27.24f,-0.50f,345.45f,17.66f,-0.50f,334.91f,58.59f,-2f,345.45f,27.24f,-0.50f,334.91f,58.59f,-2f,334.91f,67.22f,-2f,                134.55f,27.24f,-0.50f,134.55f,17.66f,-0.50f,145.09f,58.59f,-2f,134.55f,27.24f,-0.50f,145.09f,58.59f,-2f,145.09f,67.22f,-2f,                463.36f,826.76f,-0.50f,463.36f,27.24f,-0.50f,441.03f,67.22f,-2f,463.36f,826.76f,-0.50f,441.03f,67.22f,-2f,441.03f,786.78f,-2f,                16.64f,27.24f,-0.50f,16.64f,826.76f,-0.50f,38.97f,786.78f,-2f,16.64f,27.24f,-0.50f,38.97f,786.78f,-2f,38.97f,67.22f,-2f,                124.96f,24.37f,-0.50f,19.51f,24.37f,-0.50f,41.56f,64.63f,-2f,124.96f,24.37f,-0.50f,41.56f,64.63f,-2f,136.47f,64.63f,-2f,                124.96f,24.37f,-0.50f,134.55f,27.24f,-0.50f,145.09f,67.22f,-2f,124.96f,24.37f,-0.50f,145.09f,67.22f,-2f,136.47f,64.63f,-2f,                19.51f,24.37f,-0.50f,16.64f,27.24f,-0.50f,38.97f,67.22f,-2f,19.51f,24.37f,-0.50f,38.97f,67.22f,-2f,41.56f,64.63f,-2f,                345.45f,27.24f,-0.50f,355.04f,24.37f,-0.50f,343.53f,64.63f,-2f,345.45f,27.24f,-0.50f,343.53f,64.63f,-2f,334.91f,67.22f,-2f,                463.36f,27.24f,-0.50f,460.49f,24.37f,-0.50f,438.44f,64.63f,-2f,463.36f,27.24f,-0.50f,438.44f,64.63f,-2f,441.03f,67.22f,-2f,                463.36f,826.76f,-0.50f,460.49f,829.63f,-0.50f,438.44f,789.37f,-2f,463.36f,826.76f,-0.50f,438.44f,789.37f,-2f,441.03f,786.78f,-2f,                355.04f,829.63f,-0.50f,345.45f,826.76f,-0.50f,334.91f,786.78f,-2f,355.04f,829.63f,-0.50f,334.91f,786.78f,-2f,343.53f,789.37f,-2f,                134.55f,826.76f,-0.50f,124.96f,829.63f,-0.50f,136.47f,789.37f,-2f,134.55f,826.76f,-0.50f,136.47f,789.37f,-2f,145.09f,786.78f,-2f,                16.64f,826.76f,-0.50f,19.51f,829.63f,-0.50f,41.56f,789.37f,-2f,16.64f,826.76f,-0.50f,41.56f,789.37f,-2f,38.97f,786.78f,-2f,        };        private float[] backgroundData = new float[] {//                # ,Scale, Speed,                300 , 1.05f, .001f,                150 , 1.07f, .002f,                075 , 1.10f, .003f,                040 , 1.12f, .006f,                 20 , 1.15f, .012f,                 10 , 1.25f, .025f,                 05 , 1.50f, .050f,                  3 , 2.00f, .100f,                  2 , 3.00f, .200f,                             };        private float[] triangleCoords = new float[] {                 0,  -25, 0,             -.75f,   -1, 0,             +.75f,   -1, 0,                 0, +2, 0,              -.99f, -1, 0,               .99f, -1, 0,        };        private float[] triangleColors = new float[] {                1.0f,  1.0f, 1.0f, 0.05f,                1.0f,  1.0f, 1.0f, 0.5f,                1.0f,  1.0f, 1.0f, 0.5f,                1.0f,  1.0f, 1.0f, 1.0f,                1.0f,  1.0f, 1.0f, 0.5f,                1.0f,  1.0f, 1.0f, 0.5f,       };        private float[] drawArray2;        private FloatBuffer drawBuffer2;        private float[] colorArray2;        private static FloatBuffer colorBuffer;        private static FloatBuffer triangleBuffer;        private static FloatBuffer quadBuffer;        private static FloatBuffer drawBuffer;        private float[] backgroundVerts;        private FloatBuffer backgroundVertsWrapped;        private float[] backgroundColors;        private Buffer backgroundColorsWraped;        private FloatBuffer backgroundColorsWrapped;        private FloatBuffer arenaWallsWrapped;        private FloatBuffer arenaColorsWrapped;        private FloatBuffer arena2VertsWrapped;        private FloatBuffer arena2ColorsWrapped;        private long wallHitStartTime;        private int wallHitDrawTime;        private FloatBuffer pixelVertsWrapped;        private float[] wallHit;        private FloatBuffer pixelColorsWrapped;        //private float[] pitVerts;        private Resources lResources;        private FloatBuffer pitVertsWrapped;        private FloatBuffer pitColorsWrapped;        private boolean arena2;        private long lastStartTime;        private long startTime;        private int state=1;        private long introEndTime;        protected long introTotalTime =8000;        protected long introStartTime;        private boolean initDone= false;        private static int stateIntro = 0;        private static int stateGame  = 1;        public GlRenderer(spacehockey nspacehockey) {            lResources = nspacehockey.getResources();            nspacehockey.SetHandlerToGLRenderer(new Handler() {                @Override                public void handleMessage(Message m) {                    if (m.what ==0){                        wallHit = m.getData().getFloatArray(""wall hit"");                        wallHitStartTime =System.currentTimeMillis();                        wallHitDrawTime = 1000;                    }else if (m.what ==1){                        //state = stateIntro;                        introEndTime= System.currentTimeMillis()+introTotalTime ;                        introStartTime = System.currentTimeMillis();                    }            }});        }        public void onSurfaceCreated(GL10 gl, EGLConfig config) {                gl.glShadeModel(GL10.GL_SMOOTH);                gl.glClearColor(.01f, .01f, .01f, .1f);                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);        }        private float SumOfStrideI(float[] data, int offset, int stride) {            int sum= 0;            for (int i=offset;i&lt;data.length-1;i=i+stride){                sum = (int) (data[i]+sum);            }            return sum;        }    public void onDrawFrame(GL10 gl) {        if (state== stateIntro){DrawIntro(gl);}        if (state== stateGame){DrawGame(gl);}    }    private void DrawIntro(GL10 gl) {        startTime = System.currentTimeMillis();        if (startTime&lt; introEndTime){            float ptd = (float)(startTime- introStartTime)/(float)introTotalTime;            float ptl = 1-ptd;            gl.glClear(GL10.GL_COLOR_BUFFER_BIT);//dont move                    gl.glMatrixMode(GL10.GL_MODELVIEW);                int setVertOff = 0;                gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);                gl.glEnableClientState(GL10.GL_COLOR_ARRAY);                gl.glColorPointer(4, GL10.GL_FLOAT, 0, backgroundColorsWrapped);                for (int i = 0; i &lt; backgroundData.length / 3; i = i + 1) {                    int setoff = i * 3;                    int setVertLen = (int) backgroundData[setoff];                    yoffs[i] = (backgroundData[setoff + 2]*(90+(ptl*250))) + yoffs[i];                    if (yoffs[i] &gt; Height) {yoffs[i] = 0;}                    gl.glPushMatrix();                    //gl.glTranslatef(0, -(Height/2), 0);                    //gl.glScalef(1f, 1f+(ptl*2), 1f);                    //gl.glTranslatef(0, +(Height/2), 0);                    gl.glTranslatef(0, yoffs[i], i+60);                    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, backgroundVertsWrapped);                    gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 2 * 3) - 0, (setVertLen * 2 * 3) - 1);                    gl.glTranslatef(0, -Height, 0);                    gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 2 * 3) - 0, (setVertLen * 2 * 3) - 1);                    setVertOff = (int) (setVertOff + setVertLen);                    gl.glPopMatrix();                }                gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);                gl.glDisableClientState(GL10.GL_COLOR_ARRAY);        }else{state = stateGame;}    }        private void DrawGame(GL10 gl) {            lastStartTime = startTime;            startTime = System.currentTimeMillis();            long moveTime = startTime-lastStartTime;            gl.glClear(GL10.GL_COLOR_BUFFER_BIT);//dont move                    gl.glMatrixMode(GL10.GL_MODELVIEW);                int setVertOff = 0;                gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);                gl.glEnableClientState(GL10.GL_COLOR_ARRAY);                gl.glColorPointer(4, GL10.GL_FLOAT, 0, backgroundColorsWrapped);                for (int i = 0; i &lt; backgroundData.length / 3; i = i + 1) {                    int setoff = i * 3;                    int setVertLen = (int) backgroundData[setoff];                    yoffs[i] = (backgroundData[setoff + 2]*moveTime) + yoffs[i];                    if (yoffs[i] &gt; Height) {yoffs[i] = 0;}                    gl.glPushMatrix();                    gl.glTranslatef(0, yoffs[i], i+60);                    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, backgroundVertsWrapped);                    gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 6) - 0, (setVertLen *6) - 1);                    gl.glTranslatef(0, -Height, 0);                    gl.glDrawArrays(GL10.GL_TRIANGLES, (setVertOff * 6) - 0, (setVertLen *6) - 1);                    setVertOff = (int) (setVertOff + setVertLen);                    gl.glPopMatrix();                }                       //arena frame                gl.glPushMatrix();                gl.glVertexPointer(3, GL10.GL_FLOAT, 0, arenaWallsWrapped);                gl.glColorPointer(4, GL10.GL_FLOAT, 0, arenaColorsWrapped);                gl.glColor4f(.1f, .5f, 1f, 1f);                gl.glTranslatef(0, 0, 50);                gl.glDrawArrays(GL10.GL_TRIANGLES, 0, (int)(arenaWalls.length / 3));                gl.glPopMatrix();                //arena2 frame                if (arena2 == true){                    gl.glLoadIdentity();                    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, pitVertsWrapped);                    gl.glColorPointer(4, GL10.GL_FLOAT, 0, pitColorsWrapped);                    gl.glTranslatef(0, -Height, 40);                    gl.glDrawArrays(GL10.GL_TRIANGLES, 0, (int)(pitVertsWrapped.capacity() / 3));                }                if (wallHitStartTime != 0) {                    float timeRemaining = (wallHitStartTime + wallHitDrawTime)-System.currentTimeMillis();                    if (timeRemaining&gt;0) {                        gl.glPushMatrix();                        float percentDone = 1-(timeRemaining/wallHitDrawTime);                        gl.glLoadIdentity();                        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, pixelVertsWrapped);                        gl.glColorPointer(4, GL10.GL_FLOAT, 0, pixelColorsWrapped);                        gl.glTranslatef(wallHit[0], wallHit[1], 0);                        gl.glScalef(8, Height*percentDone, 0);                        gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 12);                        gl.glPopMatrix();                    } else {                        wallHitStartTime = 0;                    }                }                gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);                gl.glDisableClientState(GL10.GL_COLOR_ARRAY);    }        public void init(GL10 gl) {            if (arena2 == true) {                AssetManager assetManager = lResources.getAssets();                try {                    // byte[] ba = {111,111};                    DataInputStream Dis = new DataInputStream(assetManager                            .open(""arena2.ogl""));                    pitVertsWrapped = LoadFloatArray.FromDataInputStream(Dis);                    pitColorsWrapped = MakeFakeLighting(pitVertsWrapped.array(),                            .25f, .50f, 1f, 200, .5f);                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }            if ((Height != 854) || (Width != 480)) {                arenaWalls = ScaleFloats(arenaWalls, Width / 480f, Height / 854f);            }            arenaWallsWrapped = FloatBuffer.wrap(arenaWalls);            arenaColorsWrapped = MakeFakeLighting(arenaWalls, .03f, .16f, .33f,                    .33f, 3);            pixelVertsWrapped = FloatBuffer.wrap(pixelVerts);            pixelColorsWrapped = MakeFakeLighting(pixelVerts, .03f, .16f, .33f,                    .10f, 20);            initDone=true;        }        public void onSurfaceChanged(GL10 gl, int nwidth, int nheight) {                Width= nwidth;                Height = nheight;             // avoid division by zero                if (Height == 0)                    Height = 1;                // draw on the entire screen                gl.glViewport(0, 0, Width, Height);                // setup projection matrix                gl.glMatrixMode(GL10.GL_PROJECTION);                gl.glLoadIdentity();                gl.glOrthof(0, Width, Height, 0, 100, -100);                // gl.glOrthof(-nwidth*2, nwidth*2, nheight*2,-nheight*2, 100, -100);                // GLU.gluPerspective(gl, 180.0f, (float)nwidth / (float)nheight,                // 1000.0f, -1000.0f);                gl.glEnable(GL10.GL_BLEND);                gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);                System.gc();                if (initDone == false){                    SetupStars();                    init(gl);                    }        }        public void SetupStars(){            backgroundVerts = new float[(int) SumOfStrideI(backgroundData,0,3)*triangleCoords.length];            backgroundColors = new float[(int) SumOfStrideI(backgroundData,0,3)*triangleColors.length];            int iii=0;            int vc=0;            float ascale=1;            for (int i=0;i&lt;backgroundColors.length-1;i=i+1){                if (iii==0){ascale = (float) Math.random();}                if (vc==3){                    backgroundColors[i]= (float) (triangleColors[iii]*(ascale));                }else if(vc==2){                    backgroundColors[i]= (float) (triangleColors[iii]-(Math.random()*.2));                }else{                    backgroundColors[i]= (float) (triangleColors[iii]-(Math.random()*.3));                }                iii=iii+1;if (iii&gt; triangleColors.length-1){iii=0;}                                 vc=vc+1;  if (vc&gt;3){vc=0;}            }            int ii=0;            int i =0;            int set =0;                            while(ii&lt;backgroundVerts.length-1){                float scale = (float) backgroundData[(set*3)+1];                int   length= (int) backgroundData[(set*3)];                for (i=0;i&lt;length;i=i+1){                    if (set ==0){                        AddVertsToArray(ScaleFloats(triangleCoords, scale,scale*.25f), backgroundVerts, (float)(Math.random()*Width),(float) (Math.random()*Height), ii);                       }else{                        AddVertsToArray(ScaleFloats(triangleCoords, scale), backgroundVerts, (float)(Math.random()*Width),(float) (Math.random()*Height), ii);}                    ii=ii+triangleCoords.length;                }                set=set+1;            }            backgroundVertsWrapped = FloatBuffer.wrap(backgroundVerts);            backgroundColorsWrapped = FloatBuffer.wrap(backgroundColors);        }        public void AddVertsToArray(float[] sva,float[]dva,float ox,float oy,int start){            //x                     for (int i=0;i&lt;sva.length;i=i+3){                if((start+i)&lt;dva.length){dva[start+i]= sva[i]+ox;}                }            //y                     for (int i=1;i&lt;sva.length;i=i+3){                if((start+i)&lt;dva.length){dva[start+i]= sva[i]+oy;}                }            //z            for (int i=2;i&lt;sva.length;i=i+3){                if((start+i)&lt;dva.length){dva[start+i]= sva[i];}                }        }        public FloatBuffer MakeFakeLighting(float[] sa,float r, float g,float b,float a,float multby){            float[] da = new float[((sa.length/3)*4)];            int vertex=0;            for (int i=0;i&lt;sa.length;i=i+3){                if (sa[i+2]&gt;=1){                    da[(vertex*4)+0]= r*multby*sa[i+2];                    da[(vertex*4)+1]= g*multby*sa[i+2];                    da[(vertex*4)+2]= b*multby*sa[i+2];                    da[(vertex*4)+3]= a*multby*sa[i+2];                }else if (sa[i+2]&lt;=-1){                    float divisor = (multby*(-sa[i+2]));                    da[(vertex*4)+0]= r / divisor;                    da[(vertex*4)+1]= g / divisor;                    da[(vertex*4)+2]= b / divisor;                    da[(vertex*4)+3]= a / divisor;                }else{                    da[(vertex*4)+0]= r;                    da[(vertex*4)+1]= g;                    da[(vertex*4)+2]= b;                    da[(vertex*4)+3]= a;                                    }                vertex = vertex+1;            }            return FloatBuffer.wrap(da);        }        public float[] ScaleFloats(float[] va,float s){            float[] reta= new float[va.length];            for (int i=0;i&lt;va.length;i=i+1){                reta[i]=va[i]*s;            }            return reta;        }        public float[] ScaleFloats(float[] va,float sx,float sy){            float[] reta= new float[va.length];            int  cnt = 0;            for (int i=0;i&lt;va.length;i=i+1){                if      (cnt==0){reta[i]=va[i]*sx;}                else if (cnt==1){reta[i]=va[i]*sy;}                else if (cnt==2){reta[i]=va[i];}                cnt = cnt +1;if (cnt&gt;2){cnt=0;}            }            return reta;        }}</code></pre>","263111","","44729","","2010-05-17 15:06:10","2010-05-17 15:06:10","opengl problem works on droid but not droid eris and others","<android><opengl-es>","0","2","","",""
"2843756","1","","","2010-05-16 12:39:36","0","2554","<p>I have some trouble testing my Android application which includes the google maps API. The ooficial API example worked just fine but if I copy the code into my own project it keeps saying: ""The application has stopped unexpectedly"". I looked up the key in the keystore several times  and registered it with google. Even tried reinstalling the SDK. Does anybody know what the problem is?</p><p>Thanks in advance</p><pre>05-16 14:31:11.142: ERROR/ActivityThread(662): Failed to find provider info for com.google.settings05-16 14:31:11.150: ERROR/ActivityThread(662): Failed to find provider info for com.google.settings05-16 14:31:12.598: ERROR/MediaPlayerService(542): Couldn't open fd for content://settings/system/notification_sound05-16 14:31:12.624: ERROR/MediaPlayer(562): Unable to to create media player05-16 14:31:05.098: ERROR/ActivityThread(608): Failed to find provider info for android.server.checkin05-16 14:31:06.538: ERROR/ActivityThread(608): Failed to find provider info for android.server.checkin05-16 14:31:06.645: ERROR/ActivityThread(608): Failed to find provider info for android.server.checkin05-16 14:31:12.803: ERROR/AndroidRuntime(715): ERROR: thread attach failed05-16 14:31:13.698: ERROR/ActivityThread(723): Failed to find provider info for com.google.settings05-16 14:31:13.987: ERROR/AndroidRuntime(723): Uncaught handler: thread main exiting due to uncaught exception</pre><p>Basically my code is:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //connect to server    //get current map scope    //get media within map scope + a bit    //init and show map    setContentView(R.layout.main);    //add zoom controls    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);     //add menu}</code></pre><p>Exceptions:</p><pre>05-16 15:13:05.204: ERROR/AndroidRuntime(726): java.lang.RuntimeException: Unable to start activity     ComponentInfo{org.diretto.client.smartphone.android/org.diretto.client.smartphone.android.AnDiretto}: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.os.Handler.dispatchMessage(Handler.java:99)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.os.Looper.loop(Looper.java:123)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.main(ActivityThread.java:3948)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at java.lang.reflect.Method.invokeNative(Native Method)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at java.lang.reflect.Method.invoke(Method.java:521)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at dalvik.system.NativeStart.main(Native Method)05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.Activity.setContentView(Activity.java:1626)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at org.diretto.client.smartphone.android.AnDiretto.onCreate(AnDiretto.java:39)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     ... 11 more05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: java.lang.reflect.InvocationTargetException05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.google.android.maps.MapView.(MapView.java:237)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at java.lang.reflect.Constructor.constructNative(Native Method)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     ... 21 more05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: java.lang.IllegalStateException: You are only allowed to have a single MapView in a MapActivity05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:180)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.google.android.maps.MapView.(MapView.java:279)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     at com.google.android.maps.MapView.(MapView.java:254)05-16 15:13:05.204: ERROR/AndroidRuntime(726):     ... 25 more</pre><p>XML file line 6 would be:</p><pre><code>&lt;com.google.android.maps.MapView android:id=""@+id/mapview"" ...</code></pre><p>followed by other lines of XML-parameters</p>","330816","","40342","","2011-03-07 08:34:51","2011-03-07 08:34:51","Google Maps Api android key","<android><android-emulator><google-maps>","2","1","","",""
"2843845","1","2843864","","2010-05-16 13:08:22","2","331","<p>Has anyone made use of ASE (<a href=""http://code.google.com/p/android-scripting/"" rel=""nofollow"">Android scripting enviroment</a>) for anything other than proof of concept apps?</p><p>What are the major limitations?</p><p>Any feedback would be great.</p>","130929","","130929","","2010-05-16 18:30:10","2010-05-16 18:30:10","Feedback on using ASE on Android?","<python><android><ase>","3","0","3","",""
"2843874","1","2844043","","2010-05-16 13:16:54","6","11187","<p>I have an Activity (A) and a Service (S) which gets started by A like this:</p><pre><code>Intent i = new Intent();i.putExtra(""updateInterval"", 10);i.setClassName(""com.blah"", ""com.blah.S"");startService(i);</code></pre><p>A have a function like this one in A:</p><pre><code>public void someInfoArrived(Info i){...}</code></pre><p>Now I want to call A.someInfoArrived(i) from within S.Intent.putExtra has no version where I could pass an Object reference etc ... Please help!</p><p>PS: The other way around (A polling S for new info) is NOT what I need. I found enough  info about how to do that. </p>","147779","","","","","2010-05-16 14:10:42","In Android: How to Call Function of Activity from a Service?","<android><service><callback><activity><android-intent>","1","0","3","",""
"2844219","1","2845718","","2010-05-16 15:03:44","1","578","<p>I’m looking for a settings file that is customized for Android development, can you point to any?</p>","31207","","","","","2010-05-16 22:21:59","Eclipse Clean Up and Formatting settings for Android application","<android><eclipse><formatting>","2","1","","2012-08-16 12:52:01",""
"2844274","1","2844278","","2010-05-16 15:22:55","10","8611","<p>Solved while writing this question, but posting in case it helps anyone:</p><p>I'm setting multiple alarms like this, with different values of <code>id</code>:</p><pre><code>AlarmManager alarms = (AlarmManager)context.getSystemService(        Context.ALARM_SERVICE);Intent i = new Intent(MyReceiver.ACTION_ALARM);  // ""com.example.ALARM""i.putExtra(MyReceiver.EXTRA_ID, id);  // ""com.example.ID"", 2PendingIntent p = PendingIntent.getBroadcast(context, 0, i, 0);alarms.setRepeating(AlarmManager.RTC_WAKEUP, nextMillis, 300000, p);  // 5 mins</code></pre><p>...and receiving them like this:</p><pre><code>public void onReceive(Context context, Intent intent) {    if (intent.getAction().equals(ACTION_ALARM)) {        // It's time to sound/show an alarm        final long id = intent.getLongExtra(EXTRA_ID, -1);</code></pre><p>The alarm is delivered to my receiver at the right times, but often with <code>EXTRA_ID</code> set to the wrong value: it's a value that I have used at some point, just not the one that I wanted delivered at that particular time.</p>","6540","","","","","2012-01-13 11:21:40","Multiple calls to AlarmManager.setRepeating deliver the same Intent/PendingIntent extra values, but I supplied different ones","<android><android-pendingintent><extras><alarms>","3","0","7","",""
"2844384","1","2854453","","2010-05-16 15:56:34","1","1388","<p>I'm porting android to Devkit8000 which is a BeagleBoard clone. I have a GPS module connected on /dev/ttyS0. I could successfully get NMEA output when writing ""cat /dev/ttyS0"" in the terminal emulator.</p><p>I want to know how to let android know that there is a GPS module on /dev/ttyS0 and it is outputting NMEA standard? To be able to use the android.location class with it! or test it with any GPS app in the store!</p><p>Is there something to edit in the android's source? adding driver for example, writing a code with android-ndk or what?</p>","292942","","110028","","2011-02-20 10:18:19","2011-02-20 10:18:19","How to define GPS module in Android?","<java><android><linux-kernel><android-ndk><beagleboard>","1","0","1","",""
"2844440","1","2844484","","2010-05-16 16:11:37","0","1395","<p>I'm writing an application that starts with a loading activity. In the loading activity the app requests html from web and parses the html, then it sends the parsing result to the main activity. The main activity has several tabs, and contents of these tabs are based on the result of parsing.</p><p>For example, the result of parsing is a list of strings [""apple"", ""banana"", ""orange""], and I need to pass this list to main activity, so that the main activity can create three tabs named after three fruits.</p><p>I would like to know if there is any way to pass a list of strings among activities, BTW, is it the common way of do this?</p><p>Many thanks.</p>","111896","","111896","","2010-05-16 16:26:16","2010-06-18 10:21:47","Passing arguments from loading activity to main activity","<android>","2","0","2","",""
"2844886","1","2845222","","2010-05-16 18:13:29","2","501","<p>An application I'm building uses a local <code>Service</code> for downloading files from the web to the phone's SD card. In this app users can browse lists of books, and read them while online. A user can also download a <code>pdf</code> copy of a book for offline viewing.</p><p>To handle downloads I'm using a locally bound <code>Service</code>. I do not want this <code>Service</code> to run all the time, only when downloading files. So that the <code>Service</code> can shut itself down when its tasks are complete, I am not binding to the service, rather I'm sending an ""enqueue for download"" command through the <code>Intent</code> passed to <code>Context.startService</code>.</p><p>Books available for download are shown in a list. A user can choose to download a book by clicking on its row in the list. On download, I need to show download progress using a <code>ProgressBar</code> on the actual book list row. I need to also show, on the rows, if a book is enqueued for download, or if its download has completed or failed. The books can be shown in different activities throughout the application--in search, or in the user's list of favorite books, for example. When the books are shown in different places, these are not the same objects, but they are uniquely identified by their <code>bookId</code>.</p><p>Because I do not want to bind to the service from every <code>Activity</code>, my tentative plan was to use a <code>public static final HashMap</code> on the <code>Service</code> class itself to contain a mapping of <code>bookId</code> to download status, an <code>enum</code> of enqueued, downloading, cancelled, etc. Each book view, when displayed, would check this static HashMap, and if the bookId is in the map, retrieve and display its status. I don't particularly like this idea, but at the moment it's the only way I can think of to retrieve status from the Service without having to bind to it and start it.</p><p>Additionally I need to retrieve download progress percent from the <code>Service</code>, for a given <code>bookId</code>, if it is the active download. Again I'd rather not bind to the service from every activity, so I'm not sure how to go about retrieving current progress from the <code>Service</code>. My current plan is to use some sort of singleton mediator, that the <code>Service</code> will push updates to, and the views can read from. But I'm not terribly happy with this idea.</p><p>The reason I'd like to avoid binding to the <code>Service</code> from each Activity is 1.) I'm already running another <code>Service</code> and 2.) binding is verbose and I'd like to avoid needing to pass around a reference to the <code>Service</code> (but admittedly this isn't too much of a problem).</p><p>Perhaps binding to the local <code>Service</code> isn't expensive enough to warrant this other setup? Should I not be concerned about binding to it from each <code>Activity</code>? Maybe this is a non-issue?</p>","300368","","","","","2010-05-16 19:53:53","Communicate progress from local Service","<android>","1","0","","",""
"2844980","1","2845670","","2010-05-16 18:40:30","2","2268","<p>I'm trying to put a TextView and a ToggleButton in a table row, however, they don't seem to align (The top of the button starts about 10px below the top of the textview even though the height each element is the same. Can anyone tell me why?</p><pre><code>&lt;TableLayout        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        &gt;    &lt;TableRow&gt;        &lt;AutoCompleteTextView        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:singleLine=""true""        android:layout_weight=""1""        /&gt;        &lt;ToggleButton        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        /&gt;        &lt;/TableRow&gt;        &lt;/TableLayout&gt;</code></pre>","239774","","","","","2010-05-16 22:04:45","Android Layout: Why don't the TextView and a ToggleButton align","<android><alignment><textview><togglebutton>","1","0","","",""
"2845150","1","2845245","","2010-05-16 19:30:10","1","1247","<p>I found out that on Android contacts, at least HTC Sense stores Facebook ID with the following mimetype: <code>vnd.android.cursor.item/vnd.facebook.profile</code> this differs from their mimetype format such as <code>com.htc.socialnetwork.facebook/smallavatar</code></p><p>I am wondering where do I find a list of officially supported mimetypes for Android?</p>","243782","","","","","2010-05-16 20:00:12","Where do I find a list of officially supported mimetypes for Android?","<android><mime-types>","1","0","","",""
"2845157","1","2845194","","2010-05-16 19:31:54","1","228","<p>I'm using a TableLayout for an Activity and if I have more than a certain number of TableRows a vertical line appears to the right of the screen.</p><p><img src=""http://dl.dropbox.com/u/5342899/device.png"" alt=""alt text""></p><p>If I use fewer Views in my layout, the line disappears. If this is not a bug, where should I look in my layout for problems?</p>","292263","","","","","2010-05-17 04:39:24","Annoying line to the right of the screen when using TableLayout","<android><tablelayout>","3","2","","",""
"2845453","1","2845653","","2010-05-16 20:59:48","0","1378","<p>My zoom controls keep zooming in when I press the button, and will not stop, am I missing something?</p><pre><code>zoomControls = (ZoomControls) findViewById(R.id.zoom);        zoomControls.setOnZoomInClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                        mc.zoomIn();                }        });        zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                        mc.zoomOut();                }        });</code></pre>","180825","","","","","2010-05-16 22:00:12","Android Zoom Controls keep zooming in and will not stop","<android><widget><zoom>","1","0","","",""
"2845599","1","2845612","","2010-05-16 21:39:43","54","55563","<p>I have an HttpResponse object for a web request I just made. The response is in the JSON format, so I need to parse it.  I can do it in an absurdly complex way, but it seems like there must be a better way.</p><p>Is this really the best I can do?</p><pre><code>    HttpResponse response; // some response object    Reader in = new BufferedReader(        new InputStreamReader(response.getEntity().getContent(), ""UTF-8""));    StringBuilder builder= new StringBuilder();    char[] buf = new char[1000];    int l = 0;    while (l &gt;= 0) {        builder.append(buf, 0, l);        l = in.read(buf);    }    JSONTokener tokener = new JSONTokener( builder.toString() );    JSONArray finalResult = new JSONArray( tokener );</code></pre><p>I'm on Android if that makes any difference.</p>","1031","","1031","","2010-05-16 21:48:47","2013-11-18 14:35:52","How do I parse JSON from a Java HTTPResponse?","<java><android><json>","7","0","28","",""
"2845613","1","2845634","","2010-05-16 21:44:52","2","2310","<p>I have a weird situation with AlarmManager. I am scheduling an event with AlarmManager and passing in a string using intent.putExtra. The string is either silent or vibrate and when the receiver fires the phone should either turn of the ringer or set the phone to vibrate. The log statement correctly outputs the expected value each time. </p><pre><code>        Intent intent;        if (eventType.equals(""start"")) {            intent = new Intent(context, SReceiver.class);        } else {            intent = new Intent(context, EReceiver.class);        }        intent.setAction(eventType+Long.toString(newId));        Log.v(""EditQT"",ringerModeType.toUpperCase());        intent.putExtra(""ringerModeType"", ringerModeType.toUpperCase());        PendingIntent appIntent = PendingIntent.getBroadcast(context, 0,                intent, 0);        AlarmManager alarmManager = (AlarmManager) getSystemService     (Context.ALARM_SERVICE);        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),                appIntent);</code></pre><p>The receiver that fires when the alarm executes also has a log statement and I can see the first time around that the statement outputs the expected string either SILENT or VIBRATE but for each subsequent execution the output shows the original value on the receiver end. The alarm executes and then I change the value for putExtra to opposite string and the receiver still displays the previous value event though the call from the code above shows that the new value was passed in. The value for setAction is the same each time.</p><pre><code>audioManager = (AudioManager) context.getSystemService(Activity.AUDIO_SERVICE);Log.v(""Start"",intent.getExtras().get(""ringerModeType"").toString());if (intent.getExtras().get(""ringerModeType"").equals(""SILENTMODE"")) {audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);} else {audioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);}</code></pre><p>Any thoughts?</p>","312443","","312443","","2010-05-16 22:08:17","2010-10-31 10:07:57","Intent.putExtras not consistent","<android><android-intent><alarmmanager>","2","0","1","",""
"2845655","1","","","2010-05-16 22:00:55","2","2270","<p>I am almost done with my project in android, now I want to make the executable version of the application.</p><p>I need to demonstrate it in .exe form as soft app as on emulator, not by built and debug process from eclipse.</p>","257580","","257580","","2010-05-18 23:39:05","2010-05-18 23:39:05","How to make executable version of software in Android?","<android><executable>","1","1","","",""
"2846128","1","2846146","","2010-05-17 00:43:19","0","79","<p>For my  <code>private static final String PREFS_NAME = ""mypref"";</code> does the PREFS_NAME have to be unique for every application? Or can I use the same one over and over.</p>","326423","","13070","","2010-05-17 00:50:40","2010-05-17 00:50:40","Android preference, does it have to be unique?","<android>","1","0","","",""
"2846315","1","2848357","","2010-05-17 02:16:02","0","623","<p>Is there any android widget that enable to pick the date and the time at the same time ? I already use the basic date picker and date picker:</p><p><a href=""http://developer.android.com/guide/tutorials/views/hello-timepicker.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-timepicker.html</a>http://developer.android.com/guide/tutorials/views/hello-datepicker.htmlbut 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,WW.</p>","342698","","","","","2010-05-17 10:48:20","Android Time&Date Picker","<android><android-widget>","1","0","","",""
"2846321","1","2846347","","2010-05-17 02:18:18","0","1146","<p>As part of the application we are developing (with android client and Django server) a json object which contains user name and pass word is sent to server from android client as follows</p><pre><code>HttpPost post = new HttpPost(URL); /*Adding key value pairs */ json.put(""username"", un); json.put(""password"", pwd); StringEntity se = new StringEntity(json.toString());    post.setEntity(se);    response = client.execute(post);</code></pre><p>The response is parsed like this</p><pre><code>result = responsetoString(response.getEntity().getContent()); //Converts response to String jObject = new JSONObject(result); JSONObject post = jObject.getJSONObject(""post"");    username = post.getString(""username"");    message = post.getString(""message"");</code></pre><p><i>Hope upto this everything is fine.</i> The problem comes when parsing or sending JSON responses in Django server. Whats the best way to do this?</p><p>We tried using <b>SimpleJSON</b> and it turned out not to be so simple as we didn't find any good tutorials or sample code for the same? Are there any python functions similiar to get,put and opt in java for JSON? Any help would be much appreciated.. </p>","323404","","","","","2010-05-17 06:47:04","Best and simple way to handle JSON in Django","<android><django><json><parsing>","3","0","","",""
"2846374","1","","","2010-05-17 02:38:29","2","1447","<p>I made an android application with googlemap api, and draw some 16x16 png (about 200 count) on overlay. When I move or zoom on/in mapview, ""out of memory"" error occurs very often.</p><p>I also used the googlemap appication in my htc itself. Seams that it uses about 14+MB memmory, and never happens ""out of memory"".</p><p>How to save memmory usage in a googlemap api, or how to enlarge android api memmory limit.</p><p>Thanks a lot!</p>","342707","","2026280","","2014-02-24 12:39:47","2014-02-24 12:39:47","Android googlemap Out of memory","<android><google-maps><google-maps-api-3><maps><out-of-memory>","2","1","0","",""
"2846382","1","2847553","","2010-05-17 02:42:22","0","824","<p>I occur a problem when develop a application on android.</p><p>There have two image which can be download from server in a list item, it will show one image and will show another image when user select or click this item .if I try to download another image from server when user click it,the user will never have time to see it, for this time is shorter than download image form server,so i want to download two of them,and when I click it again,the app can invoke another image from local.</p><p>but I do not know how to invoke this image ?</p><p>Any suggestion will be appreciate.</p><p>thx</p>","287654","","","","","2010-05-17 08:30:13","How to use Selector when click a item in list","<android><download><selector><listactivity>","1","0","1","",""
"2846403","1","2848365","","2010-05-17 02:53:24","3","1182","<p>I'm writing an application which contains many tabs, and sometimes the number of tabs may exceed five. So I want to make it behave like iPhone, which is, move additional tabs to a ""More..."" tab. I would like to know if this feature is supported by TabHost, or if there is any existing open source widget which can do the favor for me. Thanks.</p>","111896","","","","","2012-02-26 13:12:52","Automatically add ""More..."" Tab in Android","<android><android-tabhost>","2","1","","",""
"2846512","1","2854272","","2010-05-17 03:36:05","0","223","<p>I have three activities in my android app. First activity is main application screen which gives option to open second screen containing second activity. But when I click on the button on second activity which was supposed to open third activity screen, I get ""Application has stopped unexpectedly"" error. </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.anddev.android.SampleApp""  android:versionCode=""1""  android:versionName=""1.0""&gt;&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;/activity&gt;            &lt;activity android:name="".ThirdActivity""              android:label=""@string/app_name"" &gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p></p>","203018","","","","","2012-01-12 00:49:34","Calling subactivity from subactivity","<android>","3","0","1","",""
"2846595","1","","","2010-05-17 04:05:28","3","514","<p>I need to be able to selectively invalidate multiple (about 20) rectangles on the screen for performance reasons, so tried the following:</p><pre><code>Vector&lt;Rect&gt; myRects = new Vector&lt;Rect&gt;();// ... add some Rects to myRectsfor (Rect r : myRects) {    invalidate(r);}</code></pre><p>However this seems to invalidates a union of all the <code>Rect</code>'s, forming one large rectangle which covers all of small ones I'm trying to invalidate.</p><p>How can one invalidate multiple areas on the screen, and only those areas?</p>","342731","","","","","2011-10-21 13:27:38","Android: How to invalidate multiple parts of screen","<android><drawing>","1","0","","",""
"2846748","1","","","2010-05-17 04:55:31","3","1269","<p>I'm struggling to understand the Android AccountManager API. As far as I got thinks working I can use the blockingGetAuthToken method and specify whether Android should provide a notification for user to allow or deny the request. Another possibility is to use getAuthToken and check if KEY_INTENT is returned. If that's the case I could start a new Activity where the user can confirm my request.</p><p>My problem is that I would like to call one of these two methods from within a Service. Is there any chance to get a callback once the user has made a decision?</p><p>Thanks for your help</p>","342753","","","","","2011-05-09 19:17:28","Android AccountManager API","<android>","1","0","","",""
"2846853","1","","","2010-05-17 05:35:10","4","2129","<p>Hello I'm developing an android application .. which will send location data to a web service to store in the server database.</p><p>In Java:I've used this protocol so the URI is: HTTP request instead of REST</p><pre><code>HttpPost request = new HttpPost(""http://trafficmapsa.com/GService.asmx/GPSdata?   lon=""+Lon+""&amp;Lat=""+Lat+""&amp;speed=""+speed);    </code></pre><p>In Asp.net (c#) web service will be:</p><pre>[WebMethod]    public CountryName GPSdata(Double Lon, Double Lat, Double speed){String ConnStr = ConfigurationManager.ConnectionStrings[""TrafficMapConnectionString""].ConnectionString;        SqlConnection myConnection = new SqlConnection(ConnStr);          SqlCommand myCommand = new SqlCommand(""INSERT INTO Traffic(Longitude,Latitude,Speed,Distance,Time,MAC_Address) VALUES('"" + (@Lon).ToString() + ""','"" + (@Lat).ToString() + ""','"" + (@speed).ToString() )"", myConnection);        SqlDataAdapter sadp = new SqlDataAdapter();        sadp.SelectCommand = myCommand;        myConnection.Open();        DataSet DS = new DataSet();        myCommand.ExecuteNonQuery();        myConnection.Close(); </pre><p>after passing the data from android ..nothing return in back .. and there is no data in the database!!Is there any library missing in the CS file!!I cannot figure out what is the problem.</p>","325296","","325296","","2010-05-17 06:15:20","2010-05-18 06:37:47","Passing parameters to web service method in c#","<c#><android><rest><web-services><methods>","3","1","","",""
"2846923","1","","","2010-05-17 05:56:22","1","306","<p>I'm implementing CRUD functionality using ExpandableListView. Wen I delete a parent data on screen refreshes automatically but it doesn't when I delete a child. I've solved this with:</p><pre><code>int categoryId = ExpandableListView.getPackedPositionGroup(info.packedPosition);getExpandableListView().collapseGroup(categoryId);getExpandableListView().expandGroup(categoryId);</code></pre><p>Is there any better way to this?</p><p>Thanks</p><p>Aleksander</p>","218783","","","","","2010-05-17 05:56:22","Cursor backed ExpandableListView data update","<android>","0","0","","",""
"2847002","1","","","2010-05-17 06:20:31","1","239","<p>I want to make my application work on different resolutions and different densities. How can I position the controls through code in such a way that it works on all resolutions?</p>","320276","","603977","","2012-05-06 21:04:15","2012-05-06 21:04:15","Positioning controls independent of display resolution and density","<android><layout><resolution>","0","3","","2012-05-07 17:49:21",""
"2847221","1","2847297","","2010-05-17 07:18:29","2","3486","<p>I have an edit text field. When the user clicks on it by default it shows small letters on the virtual keyboard.</p><p>I want by default to display first letter caps and rest of them small on the keyboard.</p><p>How can this be done?</p>","216431","","1069068","","2013-03-28 18:47:13","2013-03-28 18:47:13","Android virtual keyboard turn on caps lock","<android><input><keyboard>","2","1","","",""
"2847276","1","2847355","","2010-05-17 07:29:10","1","83","<p>i have created a single page application of showing phonebook data in a list.i am using 2.1 sdk in emulator and application works fine.</p><p>but in my HTC hero firmware is 1.5 when i try to intall same application on HTC heroapplication is installed successfully but when i click on app icon it gives me force close error even i have set minsdkversion property in manifest file to 3 here is the log Cat</p><pre><code>[2010-05-17 12:28:18 - AddressBook]Starting activity com.example.AddressBook.AddressBook on device [2010-05-17 12:28:19 - AddressBook]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-05-17 12:28:19 - AddressBook]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-05-17 12:28:20 - AddressBook]ActivityManager: Starting: Intent { comp={com.example.AddressBook/com.example.AddressBook.AddressBook} }</code></pre><p>please help me out whats wrong?any help would be appriciated.</p>","249991","","","","","2010-05-17 07:46:36","Android application not working on 1.5 firmware?","<android><activity>","1","0","","",""
"2847466","1","2848392","","2010-05-17 08:09:41","0","371","<p>I have implemented a custom list view which looks like the twitter timeline.  </p><pre><code>adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList);       setListAdapter(adapter);</code></pre><p>The constructor for MyClickableListAdapter is as follows</p><pre><code>private class MyClickableListAdapter extends ClickableListAdapter{  public MyClickableListAdapter(Context context, int viewId, List objects) {   super(context, viewId, objects);  }</code></pre><p>ClickableListAdapter extends BaseAdapter and implements the necessary methods.</p><p>The xml code for the list view is as follows </p><pre><code>&lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;  </code></pre><p>This is what it <a href=""http://www.freeimagehosting.net/image.php?66c4ed3ea6.png"" rel=""nofollow"">looks like</a>.</p><p>I have 3 questions</p><p><b>1)</b> I tried registering a context menu for the list view by adding the line after setting the list adapter</p><p><code>registerforContextMenu(getListView())</code>;</p><p>But on long-click the menu doesnt get displayed. I cannot understand what I am doing wrong! </p><p><b>2)</b> Is it possible to display a textview above the listview? I tried it by adding the code for textview above the listview. But then, only the textview gets displayed. </p><p><b>3)</b> I have seen in many twitter clients that on clicking post in the options menu a window pops up from the top of the screen covering only as much its required and rest of the timeline is visible. How can this be done in Android? A window to enter the message and on pressing post the message is passed to the Activity that started it. The Window pops up from the top and takes only a quarter of the screen, rest of the screen displays the contents of the earlier activity.</p><p>Any help would be much appreciated..</p>","323404","","323404","","2010-05-17 11:54:07","2010-05-17 11:54:07","Android: CustomListAdapter","<android><listview><contextmenu>","1","0","","",""
"2847517","1","","","2010-05-17 08:18:35","-2","267","<p>I use autocompletetextview with SimpleCursorAdapter to get data from sqlite. I'd like to get its drop down list started by the entered key. In my autocompletetextview, the list is not shown or filtered by input text.</p><p>eg,If user enter ""an"", all text started with ""an"" will be seen in this list.  </p><p>In Java</p><pre><code>    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.new);        txtPNo = (AutoCompleteTextView) findViewById(R.id.txtSTo);                mDbHelper = new DBAdapter(this);        mDbHelper.open();        SimpleCursorAdapter notes = fillToData();        txtPNo.setAdapter(notes); }    private SimpleCursorAdapter fillToData() {        Cursor c = mDbHelper.getName();        startManagingCursor(c);        String[] from = new String[] {DBAdapter.Name,DBAdapter.No1};        int[] to = new int[] {R.id.txtName,R.id.txtNo1};        Log.d(TAG, ""cursor.getCount()="" + c.getCount());        SimpleCursorAdapter notes =            new SimpleCursorAdapter(this, R.layout.autocomplete, c, from,to);        return notes;    } </code></pre><p>In new.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:background=""#ffffff""    &gt;   &lt;AutoCompleteTextView android:id=""@+id/txtSTo""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""18sp""        android:textColor=""#000000""             android:hint=""To""               android:completionThreshold=""1""         android:selectAllOnFocus=""true""          android:layout_alignParentTop = ""true""        android:layout_alignParentLeft=""true""/&gt;       &lt;/RelativeLayout&gt;</code></pre><p>In autocomplete.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_width=""fill_parent"" android:layout_height=""wrap_content""    android:stretchColumns=""0"" android:padding=""5dp""&gt;     &lt;TableRow android:padding=""5dp""&gt;        &lt;LinearLayout android:orientation=""vertical""&gt;            &lt;TextView android:id=""@+id/txtName""                xmlns:android=""http://schemas.android.com/apk/res/android""                android:textColor=""#000000""                   android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;             &lt;TextView android:id=""@+id/txtNo1""                xmlns:android=""http://schemas.android.com/apk/res/android""                android:textColor=""#000000""                   android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;         &lt;/LinearLayout&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>How to implement to get just filtered list?</p>","305732","","305732","","2010-05-19 01:28:47","2010-05-19 01:28:47","Autocomplettextview filtered by input keys","<android><autocompletetextview>","1","0","","",""
"2847545","1","10618058","","2010-05-17 08:23:29","1","238","<p>I would like to send email via </p><pre><code>startActivity(Intent.createChooser(new Intent(android.content.Intent.ACTION_SEND)))</code></pre><p>I know that to attach file to email I need </p><pre><code>intentEmail.putExtra(android.content.Intent.EXTRA_STREAM, &lt;Uri of file&gt;)</code></pre><p>but I need to attach several files. How can I do this?</p>","332311","","","","","2012-05-16 12:01:02","Android. sent multiply-attachement email","<android><email><attachment>","1","1","","",""
"2847603","1","2848412","","2010-05-17 08:33:58","2","599","<p>I am wondering how would I be able to run a SQLite order by in this manner</p><pre><code>select * from contacts order by jarowinkler(contacts.name,'john smith');</code></pre><p>I know Android has a bottleneck with user defined functions, do I have an alternative?</p>","243782","","","","","2011-05-31 15:42:43","Doing order by using the Jaro-Winkler distance algorithm?","<android><sqlite><sql-order-by><jaro-winkler>","2","0","","",""
"2847763","1","","","2010-05-17 09:05:11","0","4515","<p>I have created a layout which includes a ListView.</p><p>The data shown within this ListView isn't too complicated, it's mostly an Array which is passed when the extended Activity is started.</p><p>The rows themselves exist out of an icon and a text, thus an ImageView and a TextView.To fill up the ListView I use an ArrayAdapter simply because an Array is passed containing all the text-items that should be shown.</p><p>Now I'd like to actually be able to filter those, thus I found the android:textFilterEnabled paramater to add on the ListView xml declaration...Now a search field is shown nicely but when I enter some letters it won't filter but it will simply delete the whole list.I found out that that's because the textfilter has no idea what it should filter.</p><p>So now my question is : I know I need to tell the textfilter what it should filter, I also still have my array filled with the text that should get filtered so how do i couple those two?</p><p>I have seen examples extending a CursorAdapter, but again, I don't have a Cursor, I don't want to do calls to a DB I want to re-utilize my Array with data and obviously the ArrayAdapter itself so that the data will be represented decently on screen (i.e with my ImageView and TextView layout).</p><p>How can this be done?</p>","162147","","114066","","2010-07-27 12:25:06","2010-07-27 12:25:06","ArrayAdapter and android:textFilterEnabled","<android><listview><android-arrayadapter>","2","0","3","",""
"2847917","1","2856560","","2010-05-17 09:31:09","1","1207","<p>I'm using a list with choice mode set to ListView.CHOICE_MODE_MULTIPLE. Can I use my own layout instead of simple_list_item_multiple_choice.xml? Which standard views has it to include?</p>","218783","","","","","2010-05-18 11:01:05","Customizing view in list with CHOICE_MODE_MULTIPLE","<android>","1","0","","",""
"2848056","1","","","2010-05-17 09:55:43","4","5029","<p>How do I get the row ID from a Cursor?</p>","258429","","","","","2012-07-20 21:48:39","how to get a row ID from a Cursor","<android>","4","0","1","",""
"2848091","1","2849954","","2010-05-17 09:59:51","6","2885","<p>I need a clue how to collapse (or find IDs for) all parent items in ExpandableListView. </p><p>Thanks,</p><p>Aleksander</p>","218783","","","","","2010-05-17 14:40:09","ExpandableListView collapsing all parent items","<android>","1","0","1","",""
"2848106","1","","","2010-05-17 10:01:38","2","5484","<p>I am working on the task to search a location which stored in DB. After that i have to drop a pin on the corresponding location. I made a modification on Quick Search Box(QSB) to search the DB which is in my app. for that QSB performance i followed the Search Dictionary example in API Demos. when i click the search suggestion it reloads the current activity and drop the pin on it. when click the back button it shows the below exception in the Logcat. why it happens. Any Idea? </p><p>My Log CAT Value:</p><pre><code>05-17 15:16:30.572: ERROR/ActivityThread(17448): Activity com.example.brown.Bru_Maps has leaked IntentReceiver    android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()?05-17 15:16:30.572: ERROR/ActivityThread(17448): android.app.IntentReceiverLeaked: Activity com.example.brown.Bru_Maps has leaked IntentReceiver android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()?05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher.&lt;init&gt;(ActivityThread.java:748)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread$PackageInfo.getReceiverDispatcher(ActivityThread.java:576)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ApplicationContext.registerReceiverInternal(ApplicationContext.java:770)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:757)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:751)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:290)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.net.NetworkConnectivityListener.startListening(NetworkConnectivityListener.java:138)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at com.google.android.maps.MapActivity.onResume(MapActivity.java:232)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.Activity.performResume(Activity.java:3559)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1819)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.os.Handler.dispatchMessage(Handler.java:99)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.os.Looper.loop(Looper.java:123)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at android.app.ActivityThread.main(ActivityThread.java:4203)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at java.lang.reflect.Method.invokeNative(Native Method)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at java.lang.reflect.Method.invoke(Method.java:521)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)05-17 15:16:30.572: ERROR/ActivityThread(17448):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>What is the Activity Thread Exception in Android? Please Help.</p>","267269","","267269","","2010-07-20 13:35:30","2012-06-06 12:41:40","ActivityThread exception in Android?","<android><exception>","3","0","1","",""
"2848189","1","2894402","","2010-05-17 10:16:54","19","22060","<p>I want to do the following and am kind of stuck on these for a few days:</p><ol><li><p>I was trying to <strong>draw polylines</strong> (I have encoded polylines, but have managed to decode those) <strong>that move when I move the map</strong>.<br>The only solution that I found was for Geopoints to be transformed into screen coordinates... which won't move if I move the map.</p></li><li><p><a href=""https://developers.google.com/maps/documentation/android/v1/hello-mapview"" rel=""nofollow"">I used <code>HelloItemizedOverlay</code></a> to add about <strong>150 markers and it gets very very slow</strong>.<br>Any idea what to do? I was thinking about threads (handler).</p></li><li><p>I was looking for some sort of a <strong>timer function that executes a given function periodically</strong>, say, every 1 minute or so.</p></li><li><p>I was also looking for ways to <strong>clear the Google map from all the markers/lines</strong>, etc.</p></li></ol>","342925","","517705","","2013-10-31 18:02:40","2013-10-31 18:05:08","Efficient Map Overlays in Android Google Map","<android><google-maps><google-maps-markers>","5","9","30","","2010-05-17 10:24:58"
"2848195","1","2848292","","2010-05-17 10:17:44","1","6990","<p>while developing an application how to get current operating system version installed in mobile phone?</p><p>for example,</p><p>1.5,2.1 etc..</p><p>can any one guide me how to get it?</p><p>any help would be appriciated.</p>","249991","","","","","2010-05-17 11:01:27","how to get android firmware version installed in phone?","<android>","1","0","1","",""
"2848383","1","","","2010-05-17 10:52:54","0","160","<p>It has been suggested to me to use a Gallery type of widget for user data input (text input, checkboxes, dropdowns).</p><p>Has anyone used this approach ?Code example ?What about usability ? Have the users been happy with this in practice ?</p>","77115","","77115","","2010-05-17 11:10:46","2010-05-17 11:10:46","Usability of Android Gallery to contain a ""horizontal form""?","<android>","0","2","","",""
"2848441","1","","","2010-05-17 11:02:40","-1","828","<p>Im new to android, developing a social networking application which requires user to upload images, but i dont know how to achive the file upload dialog box. How can we achive it,using java file or xml layout file?</p>","342959","","342959","","2010-05-17 11:05:12","2010-05-17 11:12:54","How can i achive file upload dialog box in android through java or xml layout","<android><file-upload>","1","0","","",""
"2848575","1","","","2010-05-17 11:26:08","50","7084","<p>Is there a robust way to detect if <code>Thread.currentThread()</code> is the Android system UI thread in an application?<br>I would like to put some asserts in my model code that asserts that only one thread (<strong>eg</strong> the ui thread) accesses my state, to assure that no kind of synchronization is necessary.</p>","289566","","1791578","","2013-07-10 16:23:29","2013-07-10 16:30:12","How to detect UI thread on Android?","<android>","5","0","9","",""
"2848775","1","","","2010-05-17 11:56:47","20","14564","<p>I have MainActivity  which is an Activity and other class(which is a simple java class), we`ll call it ""SimpleClass"".now i want to run from that class the command startActivityForResult.</p><p>now i though that i could pass that class(SimpleClass), only MainActivity's context, problem is that, u cant run context.startActivityForResult(...);</p><p>so the only way making SimpleClass to use 'startActivityForResult; is to pass the reference of MainActivity as an Activity variable to the SimpleClass something like that:</p><p>inside the MainActivity class i create the instance of SimpleClass this way:</p><pre><code>SimpleClass simpleClass=new SimpleClass(MainActivity.this);</code></pre><hr><p>now this is how SimpleClass looks like:</p><pre><code>public Class SimpleClass {Activity myMainActivity;   public SimpleClass(Activity mainActivity) {       super();       this.myMainActivity=mainActivity;       }....    public void someMethod(...) {        myMainActivity.startActivityForResult(...);    }}</code></pre><p>now its working, but isnt a proper way of doing this? I`am afraid i could have some memory leaks in the future.</p><p>thanks.ray.</p>","260511","","114066","","2010-06-01 15:17:37","2011-12-29 08:53:03","use startActivityForResult from non-activity","<android>","3","1","4","",""
"2848879","1","2886706","","2010-05-17 12:12:29","13","16647","<p>In Android's settings, in the ""Manage Applications"" activity when clicking on an app, the data is broken down into Application, Data, and cache.  There is also a button to clear the cache.  My app caches audio files and I would like the user to be able to clear the cache using this button.  How do I store them so they get lumped in with the cache and the user can clear them?  I've tried storing files using both of the following techniques:</p><pre><code>newFile = File.createTempFile(""mcb"", "".mp3"", context.getCacheDir());newFile = new File(context.getCacheDir(), ""mcb.mp3"");newFile.createNewFile();</code></pre><p>In both cases, these files are listed as Data and not Cache.</p>","240566","","","","","2010-05-22 02:57:07","How do I take advantage of Android's ""Clear Cache"" button","<android><caching><file-io>","2","1","12","",""
"2848887","1","2849225","","2010-05-17 12:14:18","1","292","<p>Looking for examples of some ""final touches"" to enhance an existing (raw) user interface.</p><p>I.e nothing related to the core functionalities of the application, but rather examples of all these little details which give an application a ""polished"" look (new fonts, change in layout, more descriptive labels...others ?)</p><p>The target platform will be a mobile platform (android/iphone). </p><p>Note that I'm severly graphically impaired regarding colour and shape combinations, so anything too sophisticated will probably pass me by completely ;)</p>","159610","","13803","","2010-05-17 13:14:55","2010-05-17 14:47:11","Polishing an user interface","<iphone><android><user-interface>","2","3","","",""
"2849125","1","","","2010-05-17 12:49:08","1","2223","<p>I am relatively new to development of Android apps. I have bought some books on Android development which got me started in developing simple apps.</p><p>Now, I want to start building an app that has more functionality. Part of this app consists of a ListView containing about 100 rows. Each row should contain a little image (from remote URL) of a cover of a book and furthermore it should contain the title of the book and the publication date. Tapping on the row should bring up a new Activity containing all details of the movie.</p><p>I already have found out how to retrieve the underlying data from a remote web service using JSON. </p><p>Right now I am focusing on the GUI.</p><p>I would very much appreciate it if someone could give me some tips/code samples of this type of GUI!</p><p>Regards,</p><p>Mark</p>","343048","","","","","2011-04-29 08:33:45","Android app: custom listview with image","<android><gui><listview>","1","0","","",""
"2849188","1","2849397","","2010-05-17 12:59:35","0","339","<p>Im trying to parse a Soap ProbeMatch message with XMLPullParser. I receive this via UDP Multicast. I use the following code to receive it.</p><pre><code>byte[] buf = new byte[1900];DatagramPacket packet = new DatagramPacket(buf, buf.length);mSocket.receive(packet);// Damn ugly....String data = new String(packet.getData())</code></pre><p>If i convert the byte[] to String the Parser doesnt eat it... Are there any more elegant ways to do this?</p><p>When i print the xml (as String), i get the unused bytes at the end of the String:</p><pre><code>&lt;/s12:Envelope&gt;À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?À?</code></pre>","111093","","111093","","2010-05-17 13:11:59","2010-05-17 13:30:01","Datagrampacket to xml","<xml><android><packet><datagram>","1","0","","",""
"2849636","1","2849856","","2010-05-17 14:01:48","3","2225","<p>I would like to proportionally decrease the size of all text in a WebView as easily as possible. I've tried <code>android:textSize=""...""</code> without success. Api Level 7.</p>","82515","","","","","2010-05-17 14:28:08","Adjust text size of WebView?","<android>","1","0","1","",""
"2849819","1","2850147","","2010-05-17 14:24:13","0","452","<p>I created a database via javascript using Google Gears on Android 1.5 and I'd like to access directy the sqlite file to look inside it whitout using Gears. I found several ""File Browser"" but they only browse the SD card. Is there a way to fetch it from the phone file system?</p><p>I have an HTC Dream running Androis 1.5.</p><p>Thank you!</p>","286557","","","","","2010-05-17 15:07:58","Access Android 1.5 browser's gears-created database localy","<database><android><google-gears><file-manager>","1","0","","",""
"2850062","1","2855923","","2010-05-17 14:54:53","3","2127","<p>I have created a ContentProvider for my main Sqlite table, pretty much following <a href=""http://developer.android.com/guide/tutorials/notepad/index.html"" rel=""nofollow"">NotePad example</a> from SDK (although I am not sure whether I will ever be exposing my data to other apps). However, I need to create lots of other, non-trivial queries on that and other tables and views. A good example would be queries to extract some statistics from the base data, averages, totals etc.</p><p>So what's the best place for this code in an Android project? How it should be related and connected to the Uri-based data access exposed by a Provider? Any good examples out there?</p>","82592","","","","","2010-05-18 09:25:00","How to organize database access code in Android project?","<database><android>","2","2","1","",""
"2850336","1","","","2010-05-17 15:22:03","4","1353","<p>I've got a ListView with items composed of RelativeLayouts. This is the relevant XML from the list items:</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/xx""        android:gravity=""center_vertical""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical""        android:layout_centerInParent=""true""         android:layout_alignParentLeft=""true""/&gt;    &lt;TextView        android:id=""@+id/title""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/xx"" /&gt;    &lt;TextView        android:id=""@+id/tag""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/xx""        android:layout_below=""@id/title"" /&gt;    &lt;TextView        android:id=""@+id/subtitle""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/tag""        android:layout_below=""@id/title"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>On Android 2.1 (tested on a Nexus One), this shows the desired behavior: <img src=""http://img42.imageshack.us/img42/7668/85324076.png"" alt=""Android 1.5"" title=""Android 1.5""></p><p>On Android 1.5 however (tested on a HTC Hero), it shows up like this: <img src=""http://img257.imageshack.us/img257/2849/72229324.png"" alt=""Android 1.5"" title=""Android 1.5""></p><p>[edit] On 1.6 (emulator), it works as expected as well.</p><p>The small grey line on the top left is what shows up in the first pic as ""xx"", so that should be vertically centered. As far as I can see, the XML dictates this, but for some reason, 1.5 ignores it.</p><p>Why is this? I can't find anything about this difference, and I've been brute forcing any combination of layout_center, center, alignParent*, but to no avail...</p><p>Can anyone shed some light on this? Thanks!</p>","279363","","279363","","2010-05-17 15:37:44","2010-06-08 05:48:17","RelativeLayout differences between 1.5 and 2.1","<android><listview><relativelayout>","3","0","2","",""
"2850536","1","","","2010-05-17 15:47:14","7","1341","<p>I have installed a couple of free apps on my Android phone and then later ""upgraded"" to the paid full version.  My first instincts for doing the same would be to create two apps with the same package name so that installing one overwrites the other, but apps in the Market must be unique by package name.</p><p>What are some patterns and best practices for sharing code and resources for free and paid versions of the same app and any naming conventions or project structures that work for this scenario as well?</p>","53501","","","","","2010-05-17 18:53:16","Options and best practices to release free and paid version of the same app to Android Market","<android><google-play>","2","1","3","",""
"2850573","1","2850597","","2010-05-17 15:51:23","376","146592","<p>What is this error, and why does it happen?</p><pre><code>05-17 18:24:57.069: ERROR/WindowManager(18850): Activity com.mypkg.myP has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44c46ff0 that was originally added here05-17 18:24:57.069: ERROR/WindowManager(18850): android.view.WindowLeaked: Activity ccom.mypkg.myP has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44c46ff0 that was originally added here05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:231)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.view.Window$LocalWindowManager.addView(Window.java:424)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.Dialog.show(Dialog.java:239)05-17 18:24:57.069: ERROR/WindowManager(18850):     at com.mypkg.myP$PreparePairingLinkageData.onPreExecute(viewP.java:183)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.os.AsyncTask.execute(AsyncTask.java:391)05-17 18:24:57.069: ERROR/WindowManager(18850):     at com.mypkg.myP.onCreate(viewP.java:94)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.os.Handler.dispatchMessage(Handler.java:99)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.os.Looper.loop(Looper.java:123)05-17 18:24:57.069: ERROR/WindowManager(18850):     at android.app.ActivityThread.main(ActivityThread.java:4595)05-17 18:24:57.069: ERROR/WindowManager(18850):     at java.lang.reflect.Method.invokeNative(Native Method)05-17 18:24:57.069: ERROR/WindowManager(18850):     at java.lang.reflect.Method.invoke(Method.java:521)05-17 18:24:57.069: ERROR/WindowManager(18850):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)05-17 18:24:57.069: ERROR/WindowManager(18850):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)05-17 18:24:57.069: ERROR/WindowManager(18850):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","243782","","844882","","2012-05-04 06:13:52","2014-03-18 19:21:27","Activity has leaked window that was originally added","<android>","23","1","96","",""
"2850709","1","2850757","","2010-05-17 16:09:09","5","1506","<p>Has anyone any idea how could I obtain a view that has the following description:At the top at the page there is a custom test , and below there is displayed the content from a url .Currently my layout is 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""     &gt;    &lt;TextView          android:id=""@id+/test""        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;/LinearLayout&gt;</code></pre><p>In the on create of the application tight to this layout I get the TextView with findViewById and set the text for it. Similar I get the WebView and call loadUrl(""url"") for it, but the behavior is not the expected one. At first the text set is briefly displayed and then a fullscreen browser page with the content from the passed url is shown.</p>","284609","","","","","2010-05-17 16:14:35","Display a WebView","<android>","1","0","","",""
"2851483","1","2851595","","2010-05-17 18:01:21","8","4853","<p>How to trace the Memory Leaks in Android Development? I am working on eclipse IDE to develop the application. i cant find out how to rectify the memory or window Leaks Exceptions? Any Idea. </p><p>Mainly the Window Leaked error raises the Illegal Argument Exception? how to rectify both og this. Please Help.</p>","267269","","267269","","2010-08-21 12:05:29","2011-01-05 10:52:27","Tracing the Memory/Window Leaks in Android?","<android><memory-leaks>","2","1","3","",""
"2851488","1","2851876","","2010-05-17 18:01:49","1","1095","<p>I'm building a webapp for Android smartphones that runs with the OS internet browser. the main interface is to input datas. the data is added to a queue (android 1.5: gears, android 2.x: html5). Each 5 minutes (using setTimeout), the script looks if an internet connection is active, and if so, sends all the queue to the server.</p><p>If the phone is plugged on the wall and the webpage is ontop, the timeout works. if the browser is minimized or another application runs on top of it, the timeout doesn't work. if the phone is in sleep mode it doesn't work either.</p><p>can only native apps runs in background?</p>","286557","","","","","2010-10-18 14:48:35","Android browser javascript events when minimised","<android><javascript-events>","2","0","","",""
"2851694","1","2851840","","2010-05-17 18:31:52","2","1540","<p>In an Android application I run a task in a separate thread. While the thread is running it updates a progress bar in the main window to let the user know what's going on. The problem is, that if a user starts the thread a second time the progress bar won't be reset. It will just sit on 100% without doing anything.</p><p>The whole source is <a href=""http://github.com/exhuma/android-contactbackup/tree/v1.0.1/src/lu/albert/android/jsonbackup/"" rel=""nofollow"">available on github</a>. As an example take the <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/BackupThread.java"" rel=""nofollow"">BackupThread</a> and <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/JsonBackup.java"" rel=""nofollow"">JsonBackup</a> (the main class). Note that ""RestoreThread"" shows the same behaviour, but I assume that in both cases the problem is identical.</p><p>On to a quick walk through:</p><p>At around <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/JsonBackup.java#L295"" rel=""nofollow"">line 300 in JsonBackup.java</a>, I open a new ProgressDialog. As it's a new instance, I assume all is initialised properly. On my current working copy I have added a line setting the progress to ""0"", but that didn't change anything. In the same block, I create the backup thread and run it.</p><p>The next bit of code of interest is the moment when the thread communicates it's progress back to the main application. This happens around <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/BackupThread.java#L185"" rel=""nofollow"">line 185 of BackupThread.java</a>.</p><p>The message is handled in <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/JsonBackup.java#L80"" rel=""nofollow"">line 80 of JsonBackup.java</a> which will update the progress bar.</p><p>So far for the code walkthrough. One thing that struck me while writing this is <a href=""http://github.com/exhuma/android-contactbackup/blob/v1.0.1/src/lu/albert/android/jsonbackup/JsonBackup.java#L87"" rel=""nofollow"">line 87 of JsonBackup.java</a>. I think it would be best if the thread sent a different message, explicitly stating that it's done. But I assume this is not the real problem here. I say this because the progress dialog properly dismisses itself once it reaches 100%.</p><p>So, if this whole thing is run once, everything works as expected. Now assume, that the user leaves the application, but the OS decides to leave it loaded in memory. Later the user comes back and wants to create a new backup. Then the app won't work as the progress hangs at 100%. If you kill the app, so it's completely unloaded it will work again. So I assume that some object instance is still in memory and has an unclean state when re-run. But for the life of me, I cannot find what's going on. As a tangent I might add: Apart from the Notepad tutorials, this is my first Android app, and bla di blah blah...</p><p>What am I missing here...?</p>","160665","","","","","2010-05-17 20:32:08","ProgressBar not reset to ""0"" when opening the second time","<android><multithreading><progress-bar>","2","1","","",""
"2851862","1","2851972","","2010-05-17 18:54:55","1","245","<p>We want to build a smartphone app which uses geolocation, etc. and target the most important smartphones. Which OS would you support for a b2c application? I found a german statistic here: <a href=""http://de.statista.com/statistik/daten/studie/150842/umfrage/prognostizierte-marktanteile-der-smartphone-betriebssysteme-in-2013/"" rel=""nofollow"">http://de.statista.com/statistik/daten/studie/150842/umfrage/prognostizierte-marktanteile-der-smartphone-betriebssysteme-in-2013/</a> which forecasts the smartphone usage for 2013. To summarize it lists the following OS, ordered by priority:</p><p>Symbian, Android, Blackberry (RIM), Windows Mobile, iPhone</p><p>Would you agree with this priority or should we start with the classical: iPhone/Android combo?</p>","142671","","147141","","2010-05-17 18:58:13","2010-06-27 12:11:40","What smartphones to target for a modern b2c app?","<iphone><android><symbian><smartphone>","5","1","","",""
"2851866","1","2851962","","2010-05-17 18:55:33","1","417","<p>I have an iPhone application and I am porting it over to Android.</p><p>I have a service/controller that spawns new threads to perform some network tasks.</p><p>I use <code>performSelectorOnMainThread</code> in my iPhone app. How can I have my Java app do the same or similar thing?</p>","23528","","","","","2010-05-17 19:13:09","performSelectorOnMainThread equivalent in Java for Android","<java><android><multithreading>","2","0","","",""
"2852081","1","2852237","","2010-05-17 19:23:40","7","6197","<p>In the new official Twitter app, the scrollbars in all the ListViews the app uses are hidden unless the user is scrolling through the list.  </p><p>When you start scrolling, the scrollbars appear.  When you stop, they fade out with an animation until they are gone completely.</p><p>I can't seem to find anything in the documentation that indicates this as being a standard feature.</p><p>Is this something included in the API?  If not, anyone know how this might be done?</p>","238849","","","","","2010-11-04 18:05:45","Autohide scrollbars when not scrolling in a ListView","<android>","4","0","1","",""
"2852181","1","2852312","","2010-05-17 19:38:21","10","5260","<p>We are now testing our application with a few friends. Sometimes there are some errors which don't throw an exception. So I don't really know whats the problem was. So I thought it would be a good idea to implement a menu item which allows to send the logcat output to a e-mail address, so that we can examine the log.</p><p>Unfortunately I didn't find a hint in the Internet how to extract the logcat from a phone. How to send an email shouldn't be the problem.</p>","329637","","1525300","","2012-08-22 06:39:27","2012-12-18 07:44:21","Send Logcat output of an App to an EmailAdress","<android><logcat>","5","0","3","",""
"2852254","1","","","2010-05-17 19:50:20","1","733","<p>I want to add -Xlint:deprecated to the java compiler while building android app.<br>I've seen the compilerarg tag inside javac tags, but the generated build.xml for the standard project doesn't have such a tag.Any hint?</p>","78667","","","","","2010-10-12 08:19:34","Add compiler flags to the standard android build.xml","<android><ant>","1","0","","",""
"2853017","1","2853515","","2010-05-17 21:38:04","13","15177","<p>Some Questions about Android and Google Directions Service:</p><ul><li><p>Is there a native way on Android to use the Directions Service from Google or are there any nice Wrapper Frameworks? I would like to retrieve the time needed to get from A to B and maybe show the route in a table and/or map.</p></li><li><p>As far as I know directions can only be retrieved for ""walking"" and ""driving"". Is there a way (maybe not from google) to get this Information also for public transports or ""biking""  ?</p></li></ul><p>Thx a lot for your help!</p>","343482","","85950","","2013-01-31 03:35:23","2013-08-27 13:45:45","Android Google Directions Service usable natively? with wrapper framework? Public transit/biking directions available?","<android><api><frameworks>","1","0","6","",""
"2853022","1","","","2010-05-17 21:38:30","1","171","<p>I'm writing a live wallpaper, and I'm forking off two separate threads in my main wallpaper service.  One updates, and the other draws.  I was under the impression that once you call thread.start(), it took care of everything for you, but after some trial and error, it seems that if I want my update and draw threads to keep running, I have to manually keep calling their run() methods?  In other words, instead of calling start() on both threads and forgetting, I have to manually set up a delayed handler event that calls thread.run() on both the update and draw threads every 16 milliseconds.  Is this the correct way of having a long running thread?</p><p>Also, to kill threads, I'm just setting them to be daemons, then nulling them out.  Is this method ok?  Most examples I see use some sort of join() / interrupt() in a while loop...I don't understand that one...</p>","313547","","","","","2012-06-18 19:34:00","Is my way of doing threads in Android correct?","<java><android><multithreading>","2","0","","",""
"2853058","1","","","2010-05-17 21:43:49","0","1291","<p>I have a simple test code for testing SimpleDateFormat. This code works well on Eclipse and Android 1.5 emulator, but it failed at Android 2.0 emulator. Does anyone know why? Thanks.</p><pre><code>public class TemplateActivity 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(R.string.hello);       setContentView(tv);       SimpleDateFormat format =           new SimpleDateFormat(""EEE, dd MMM yyyy HH:mm:ss zzz"");       String dateStr = ""Mon, 17 May 2010 01:45:41 GMT"";        try {           Date parsed = format.parse(dateStr);           Log.v(""Test"", parsed.toString());       } catch (ParseException pe) {           Log.v(""Test"", ""ERROR: Cannot parse \"""" + dateStr + ""\"""");       }   }}</code></pre><p>Log message:</p><pre><code>V/Test(  400): ERROR: Cannot parse ""Mon, 17 May 2010 01:45:41 GMT""</code></pre>","256239","","","","","2010-10-11 13:26:27","Weird parsing date string error in Android 2.0 emulator","<java><android>","3","0","","",""
"2853112","1","2854472","","2010-05-17 21:50:17","2","2371","<p>I am trying to make a task switcher and i succed in it. My only problem is that when I launch activities, they are relaunched as they were new activities ( for instance, I am writing an email, i press home and go into my activity,launch email, and then the app launch the email bout goes back at the inbox and the email is lost) So that's not true multitasking.</p><p>Here are my steps:</p><p>1) getting all the running apps:</p><p><code>List&lt;ActivityManager.RunningTaskInfo&gt; allTasks = activityManager.getRunningTasks(30);</code></p><p>2) getting the intent:</p><p><code>for (ActivityManager.RunningTaskInfo aTask : allTasks) {        Intent i = new Intent(Intent.ACTION_MAIN);        i.setComponent(aTask.baseActivity);(...)</code></p><p>3) Launching the application when clicking on the button:</p><pre><code>    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED).addCategory(Intent.CATEGORY_LAUNCHER);    monthis.startActivity(intent);</code></pre><p>`</p><p>What is wrong with this code? Should I do something different to get it?</p><p>Thank a lot for any answer.</p>","327402","","","","","2012-02-05 11:38:30","Launching an activity at its current state","<android><android-intent>","3","0","2","",""
"2853153","1","","","2010-05-17 21:57:14","2","418","<p>If I have a paid app on Android Market, will my merchant API callback URL get a hit when the customer goes to check out? I am wondering how merchants/vendors/developers secure their applications for android market.</p><p>I have used google checkout before to implement a custom integration, so I understand how that all works. What I do not see anywhere that I have looked is what, if any, integration does the merchant/developer have with the Android Market checkout process? I understand that the market uses google checkout, but in that case the market hosts the checkout process and not the merchant, so it's not clear whether they give your URL a call.</p><p>So where is the hook? Am I right in assuming it is the merchant API callback URL?</p>","343490","","199972","","2012-06-23 16:15:21","2012-06-23 16:15:21","Does the android market use your merchant API callback URL during the Google checkout process for paid applications?","<android><google-play>","0","1","1","",""
"2853246","1","2854399","","2010-05-17 22:11:36","5","2128","<p>Our app (<a href=""http://android.wordpress.org"">WordPress for Android</a>) uses a scrollview for the new post view, where a user enters in their new blog post.  There's quite a few fields on this view, including a large EditText for the post content field.  </p><p>It appears that when an EditText is in a ScrollView, the ScrollView takes over the scrolling action, so the user can't scroll <em>within</em> the EditText area if they are writing a large post.  What can be done so that scrolling will work both within the EditText and the ScrollView?</p><p>Here is the layout xml for this view, any help would be appreciated!  The EditText that needs the scrolling is @id/content:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/main""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:scrollbars=""none""    android:background=""#FFF5F5F5""&gt;&lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:layout_gravity=""center_horizontal""                android:padding=""10dip""                &gt;     &lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:background=""@drawable/content_bg""                android:id=""@+id/section1""&gt;    &lt;TextView android:id=""@+id/l_section1""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""Post Content""              style=""@style/WordPressSectionHeader""/&gt;    &lt;TextView android:id=""@+id/l_title""               android:layout_below=""@id/l_section1""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:text=""@string/post_title""/&gt;    &lt;EditText android:id=""@+id/title""               android:minHeight=""40dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:background=""@android:drawable/editbox_background""              android:autoText=""true""              android:capitalize=""sentences""              android:layout_below=""@id/l_title""/&gt;    &lt;TextView android:id=""@+id/l_content""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:text=""@string/post_content""              android:layout_below=""@id/title""/&gt;    &lt;EditText android:id=""@+id/content""              android:gravity=""top""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:background=""@android:drawable/editbox_background""              android:minLines=""5""              android:maxLines=""5""              android:autoText=""true""              android:capitalize=""sentences""              android:layout_below=""@id/l_content""/&gt;&lt;Button              android:id=""@+id/bold""            android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_below=""@id/content""            android:textStyle=""bold""            android:textSize=""22dip""            android:text=""B"" /&gt;           &lt;Button            android:id=""@+id/em""            android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_alignTop=""@id/bold""            android:layout_toRightOf=""@id/bold""            android:textStyle=""italic""            android:textSize=""22dip""            android:text=""I "" /&gt;&lt;Button             android:id=""@+id/link""              android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_alignTop=""@id/em""            android:layout_toRightOf=""@id/em""            android:textSize=""22dip""            android:textColor=""#006699""            android:text=""link"" /&gt;  &lt;Button            android:id=""@+id/bquote""            android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""             android:layout_alignTop=""@id/link""            android:layout_toRightOf=""@id/link""            android:textSize=""22dip""            android:text=""b-quote"" /&gt;                        &lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:background=""@drawable/content_bg""                android:id=""@+id/section2""                android:layout_marginTop=""10dip""                android:layout_below=""@id/section1""&gt;                 &lt;TextView android:id=""@+id/l_media""              android:layout_marginBottom=""6dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""Media""              style=""@style/WordPressSectionHeader""/&gt;               &lt;Button            android:id=""@+id/addPictureButton""            android:layout_marginTop=""4dip""            android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_below=""@id/l_media""             android:textSize=""18dip""            android:text=""@string/add""/&gt;&lt;Button            android:id=""@+id/clearPicture""            android:background=""@drawable/wp_button_small""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""             android:visibility=""gone""            android:textSize=""18dip""            android:layout_alignBottom=""@id/addPictureButton""            android:layout_toRightOf=""@id/addPictureButton""            android:text=""@string/clear"" /&gt;            &lt;GridView                       android:id=""@+id/gridView""                       android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                    android:gravity=""fill_vertical""                    android:numColumns=""3""                    android:visibility=""gone""                    android:layout_below=""@id/addPictureButton""&gt;                            &lt;/GridView&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:background=""@drawable/content_bg""                android:id=""@+id/section3""                android:layout_marginTop=""10dip""                android:layout_marginBottom=""10dip""                android:layout_below=""@id/section2""&gt;                 &lt;TextView android:id=""@+id/l_tags_categories""              android:layout_marginBottom=""6dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""Tags &amp;amp; Categories""              style=""@style/WordPressSectionHeader""/&gt;                                 &lt;TextView android:id=""@+id/l_tags""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:layout_below=""@id/l_tags_categories""               android:text=""@string/tags_separate_with_commas""/&gt;    &lt;EditText android:id=""@+id/tags""               android:minHeight=""40dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:background=""@android:drawable/editbox_background""              android:autoText=""true""              android:layout_below=""@id/l_tags""/&gt;    &lt;TextView android:id=""@+id/l_category""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:text=""@string/categories""              android:layout_below=""@id/tags""              android:layout_marginTop=""10dip""/&gt;  &lt;Button            android:id=""@+id/selectCategories""            android:background=""@drawable/wp_button_small""            android:layout_below=""@id/l_category""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:textSize=""18dip""            android:text=""@string/select_categories"" /&gt;     &lt;TextView android:id=""@+id/selectedCategories""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""              android:text=""@string/selected_categories""              android:layout_below=""@id/selectCategories""/&gt;         &lt;/RelativeLayout&gt;   &lt;RelativeLayout android:id=""@+id/location_wrapper""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""                android:layout_below=""@id/section3""                android:layout_marginTop=""-10dip""&gt;  &lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:background=""@drawable/content_bg""                android:id=""@+id/section4""                android:layout_marginTop=""10dip""                android:layout_marginBottom=""10dip""                android:layout_below=""@id/section3""                android:visibility=""gone""&gt;                 &lt;TextView android:id=""@+id/l_location""              android:layout_marginBottom=""6dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""@string/location""              style=""@style/WordPressSectionHeader""/&gt;              &lt;TextView android:id=""@+id/locationText""              android:layout_marginBottom=""6dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""@string/loading""              android:layout_below=""@id/l_location""/&gt;               &lt;Button            android:id=""@+id/viewMap""            android:background=""@drawable/wp_button_small""            android:layout_below=""@id/locationText""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:textSize=""18dip""            android:text=""View Map"" /&gt;                                  &lt;/RelativeLayout&gt;  &lt;/RelativeLayout&gt;   &lt;RelativeLayout android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:background=""@drawable/content_bg""                android:id=""@+id/section5""                android:layout_marginTop=""10dip""                android:layout_marginBottom=""10dip""                android:layout_below=""@id/location_wrapper""&gt;                 &lt;TextView android:id=""@+id/l_status""              android:layout_marginBottom=""6dip""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:text=""@string/status""              style=""@style/WordPressSectionHeader""/&gt;                                           &lt;CheckBox android:id=""@+id/publish""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_below=""@id/l_status""            android:text=""@string/publish""            android:button=""@drawable/wp_checkbox""            /&gt;  &lt;/RelativeLayout&gt;            &lt;Button            android:id=""@+id/post""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_below=""@id/section5""            android:layout_alignParentRight=""true""            android:textSize=""18dip""            android:background=""@drawable/wp_button""            android:text=""@string/save"" /&gt;&lt;Button            android:id=""@+id/upload""            android:layout_width=""wrap_content""              android:layout_height=""wrap_content""            android:layout_alignBottom=""@id/post""            android:layout_toLeftOf=""@id/post""            android:textSize=""18dip""            android:background=""@drawable/wp_button""            android:text=""@string/upload_now"" /&gt;            &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre>","309558","","","","","2014-03-06 03:44:39","Enable Scrolling within EditText that is in a ScrollView","<android><layout><edittext><scrollview>","3","0","","",""
"2853277","1","","","2010-05-17 22:15:52","0","279","<p>I want to write an application that reads blogpost from the internet and then present in my own way.</p><p>The blogposts are stored in databases, so I figured that the only thing I had to do was to query an online database for the posts that I want to show.. But I can´t find a way to opoen a connecion to an online database...</p><p>anyone out there with a solution to my problem?</p><p>//Narancha</p>","332710","","","","","2010-05-17 22:19:00","Online Database","<database><android>","1","5","","",""
"2853790","1","3143789","","2010-05-17 23:59:29","0","3750","<p>Yesterday we received OTA Android 2.1 on my wife's HTC Droid - HOORAY!!! I am finally able to load my carputer app on her phone.</p><p>Well we loaded it, but it doesn't work. Specifically, it connects but sees no I/O!!! </p><p>I paired, re-paired, and re-paired again, every time its the same problem: connect() says we connected successfully, but any attempt to send or receive data appears to work but no data ever arrives in the input buffer. </p><p>The device I'm connecting to uses AT commands. <code>ATI</code> should respond with a device ID. That works fine when I run the app on my Moto Droid, but on the HTC droid, no data is ever present in the inputstream/buffer. </p><p>Personally, I'm feeling pretty sure it's a bug or limitation in this release for the HTC (because the app works great on my Moto A855 Droid).</p><p>Can anybody comment on the issue? </p><p>Obligatory code snippets: </p><p>Member variable defining my RFCOMM UUID</p><pre><code>static final UUID UUID_RFCOMM_GENERIC = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");</code></pre><p>Parts of my connect()</p><pre><code>    // make sure peer is defined as a valid device based on their MAC. If not then do it.     if (mBTDevice == null)         mBTDevice = mBTAdapter.getRemoteDevice(mPeerMAC);    // Make an RFCOMM binding.     try {mBTSocket = mBTDevice.createRfcommSocketToServiceRecord(UUID_RFCOMM_GENERIC);    } catch (Exception e1) {        msg (""connect(): Failed to bind to RFCOMM by UUID. msg="" + e1.getMessage());        return false;    }    msg (""connect(): Try to connect."");    try {        mBTSocket.connect();    } catch (Exception e) {        msg (""connect(): Exception thrown during connect: "" + e.getMessage());        return false;        // there was a problem connecting... make a note of the particulars and move on.     }    msg (""connect(): CONNECTED!"");    try {        mBTOutputStream = mBTSocket.getOutputStream();        mBTInputStream  = new BufferedInputStream (mBTSocket.getInputStream(),INPUT_BUFFER_SIZE);        //msg (""Connecting non-buffered input stream..."");        //mBTInputStream  = mBTSocket.getInputStream();    } catch (Exception e) {        msg (""connect(): Error attaching i/o streams to socket. msg="" + e.getMessage());        return false;    }    resetErrorCounters();    setConnected(true);    return true;}</code></pre><p>Then I send <code>""ATI\r""</code></p><p>and expect something like <code>""CAN OBD II""</code> but I get nothing. </p><p><code>mBTInputStream.available()</code>, it seems, is ALWAYS zero, even when data should be in the input buffer. </p><p>There are GOBS of trace messages being generated by the OS as viewed with <code>adb logcat -v time</code></p><p>Some of the more interesting ones: </p><pre><code>05-17 19:44:21.447 D/BluetoothSppPort( 5809): connected to device service!05-17 19:44:21.447 D/BluetoothSppPort( 5809): Creating a BluetoothSpp proxy object05-17 19:44:21.467 D/BluetoothSppService(   74): createPort called!05-17 19:44:21.467 D/BluetoothSppService(   74): createPort checking uuid05-17 19:44:21.467 D/BluetoothSppService(   74): createPort UUID=00001101-0000-1000-8000-00805f9b34fb auth=true encrypt=true05-17 19:44:21.467 D/BluetoothSppService(   74): createPort enforcing bluetooth perm05-17 19:44:21.467 D/BluetoothSppService(   74): createPort creating a jbtlspp object05-17 19:44:21.467 D/BluetoothSppService(   74): createPort checking if the btl spp object is valid05-17 19:44:21.467 D/BluetoothSppService(   74): createPort try to create an spp container05-17 19:44:21.467 D/BluetoothSppService(   74): createPort try to create security params05-17 19:44:21.467 D/BluetoothSppService(   74): createPort Set Security L205-17 19:44:21.467 D/BluetoothSppService(   74): createPort spp port create05-17 19:44:21.467 D/JBtlSpp (   74): create: Entered05-17 19:44:21.467 D/JBtlSpp (   74): Calling NativeJBtlSpp_Create05-17 19:44:21.467 D/JBtlSppNative(   74): NativeJBtlSpp_Create: Entered05-17 19:44:21.467 D/JBtlSppNative(   74): NativeJBtlSpp_Create: Calling BTL_SPP_Remote_Create05-17 19:44:21.477 D/JBtlSppNative(   74): NativeJBtlSpp_Create: BTL_SPP_Remote_Create returned 0, context:1805-17 19:44:21.477 D/JBtlSppNative(   74): NativeJBtlSpp_Create: Setting context value in jContext out parm05-17 19:44:21.477 D/JBtlSppNative(   74): NativeJBtlSpp_Create: Calling Java setValue(0x18) in context's class05-17 19:44:21.477 D/JBtlProfileContext(   74): setValue: setValue called, value:2405-17 19:44:21.477 D/JBtlSppNative(   74): create_spp_port_data: will use context struct 0 for the port 2405-17 19:44:21.477 D/JBtlSppNative(   74): create_spp_port_data: spp port context 0 added05-17 19:44:21.477 D/JBtlSppNative(   74): NativeJBtlSpp_Create:Exiting Successfully05-17 19:44:21.477 D/JBtlSpp (   74): After NativeJBtlSpp_Create, status=SUCCESS, Context = 2405-17 19:44:21.477 D/JBtlRbtlServices(   74): addUser: Entered, userRefCount = 105-17 19:44:21.477 D/BluetoothSppService(   74): port create returned status SUCCESS05-17 19:44:21.477 D/JBtlSpp (   74): enable: Entered05-17 19:44:21.477 D/JBtlSpp (   74): enable: UUID=00001101-0000-1000-8000-00805f9b34fb05-17 19:44:21.477 D/JBtlSppNative(   74): NativeJBtlSpp_Enable: Entered05-17 19:44:21.487 D/JBtlSppNative(   74): NativeJBtlSpp_Enable: BTL_SPP_Enable returned 005-17 19:44:21.487 D/JBtlSppNative(   74): NativeJBtlSpp_Enable:Exiting05-17 19:44:21.487 D/JBtlSpp (   74): After NativeJBtlSpp_Enable, status=SUCCESS05-17 19:44:21.487 D/JBtlSpp (   74): enable: Exiting05-17 19:44:21.487 D/BluetoothSppService(   74): port enable returned status SUCCESS05-17 19:44:21.487 D/BluetoothSppService(   74): connectPort called!05-17 19:44:21.497 D/BluetoothSppService(   74): connectPort received bdaddress:00:18:E4:1D:23:9B05-17 19:44:21.527 D/BluetoothSppService(   74): Trying to connect to 00:18:E4:1D:23:9B05-17 19:44:21.527 D/JBtlSpp (   74): setServiceName: Entered05-17 19:44:21.527 D/JBtlSppNative(   74): NativeJBtlSpp_SetServiceName: Entered05-17 19:44:21.547 D/JBtlSppNative(   74): NativeJBtlSpp_SetServiceName: native func returned 005-17 19:44:21.547 D/JBtlSppNative(   74): NativeJBtlSpp_SetServiceName:Exiting05-17 19:44:21.547 D/JBtlSpp (   74): After setServiceName, status=SUCCESS05-17 19:44:21.547 D/JBtlSpp (   74): setServiceName: Exiting05-17 19:44:21.557 D/BluetoothSppService(   74): port setServiceName returned status SUCCESS05-17 19:44:21.587 D/JBtlSpp (   74): connect: Entered connecting to 00:18:E4:1D:23:9B05-17 19:44:21.587 D/JBtlSppNative(   74): NativeJBtlSpp_Connect: Entered05-17 19:44:21.597 D/JBtlSppNative(   74): NativeJBtlSpp_Connect: BTL_SPP_Connect returned 205-17 19:44:21.597 D/JBtlSppNative(   74): NativeJBtlSpp_Connect:Exiting05-17 19:44:21.597 D/JBtlSpp (   74): After NativeJBtlSpp_Connect, status=PENDING05-17 19:44:21.747 D/AK8973  (   61): Compass CLOSE 05-17 19:44:21.887 W/Process (   74): Unable to open /proc/5749/status05-17 19:44:21.917 I/ActivityManager(   74): Displayed activity com.gtosoft.dash/.Dash: 1279 ms (total 1279 ms)05-17 19:44:24.047 D/        (   74): signal_BTEVENT_ACCESSIBLE_CHANGE: Entered05-17 19:44:24.047 D/        (   74): signal_BTEVENT_ACCESSIBLE_CHANGE: Calling Java Accessible Change callback05-17 19:44:24.047 D/JBtlBmg (   74): nativeAccessibleChange05-17 19:44:24.087 D/BluetoothService(   74): Callback - accessbileChange, btErrCode = NO_ERROR, mode = CONNECTABLE_ONLY05-17 19:44:24.087 D/BluetoothService(   74): Sending ACTION_SCAN_MODE_CHANGED intent, mode = 2105-17 19:44:24.087 D/        (   74): signal_BTEVENT_ACCESSIBLE_CHANGE: Exiting05-17 19:44:24.097 D/        (   74): signal_BTEVENT_LINK_CONNECT_CNF: Entered05-17 19:44:24.097 D/        (   74): signal_BTEVENT_LINK_CONNECT_CNF: context: 1, errCode: 005-17 19:44:24.097 D/        (   74): signal_BTEVENT_LINK_CONNECT_CNF: Calling Java Link Connect Confirmation callback05-17 19:44:24.097 D/JBtlBmg (   74): nativeLinkConnectCnf05-17 19:44:24.107 D/BluetoothService(   74): Callback - linkConnectCnf, btErrCode = NO_ERROR, bdAddr = 00:18:E4:1D:23:9B05-17 19:44:24.117 D/JBtlBmg (   74): getKnownDeviceInfo: Entered05-17 19:44:24.117 D/JBtlBmg (   74): getKnownDeviceInfo: Calling NativeJBtlBmg_GetKnownDeviceInfo05-17 19:44:24.137 D/        (   74): NativeJBtlBmg_GetKnownDeviceInfo: Entered05-17 19:44:24.137 D/        (   74): NativeJBtlBmg_GetKnownDeviceInfo: Calling BTL_BMG_GetKnownDeviceInfo05-17 19:44:24.227 D/JBtlBmgJniKnownDeviceInfo(   74): setValues: Entered05-17 19:44:24.227 D/        (   74): NativeJBtlBmg_GetKnownDeviceInfo:Exiting05-17 19:44:24.227 D/JBtlBmg (   74): getKnownDeviceInfo: After NativeJBtlBmg_GetKnownDeviceInfo, status=SUCCESS05-17 19:44:24.227 D/JBtlBmg (   74): getKnownDeviceInfo: Exiting05-17 19:44:24.227 D/BluetoothService(   74): onRemoteDeviceConnected, device 00:18:E4:1D:23:9B is Paired05-17 19:44:24.227 D/BluetoothService(   74): Sending ACTION_ACL_CONNECTED intent, address = 00:18:E4:1D:23:9B05-17 19:44:24.227 D/BluetoothA2dpService(   74): Received intent with action: android.bluetooth.device.action.ACL_CONNECTED05-17 19:44:24.227 D/        (   74): signal_BTEVENT_LINK_CONNECT_CNF: Exiting05-17 19:44:24.757 D/JBtlAg  (  163): setIndicatorValue: entered05-17 19:44:24.767 I/JBtlAg  (  163): After NativeJBtlAg_SetIndicatorValue, status = SUCCESS05-17 19:44:24.767 D/JBtlAg  (  163): setIndicatorValue: exiting05-17 19:44:24.807 D/JBtlSppNative(   74): signal_SPP_EVENT_OPEN: Entered05-17 19:44:24.807 D/JBtlSppNative(   74): signal_SPP_EVENT_OPEN: status: 0 context:2405-17 19:44:24.827 D/JBtlSpp (   74): nativeCb_open: Entered from 00:18:E4:1D:23:9B05-17 19:44:24.827 D/JBtlSpp (   74): nativeCb_open: Calling callback05-17 19:44:24.827 D/BluetoothSppService(   74): connected called!05-17 19:44:24.847 D/JBtlSpp (   74): connect: Exiting05-17 19:44:24.847 D/BluetoothSppService(   74): port connect returned status SUCCESS05-17 19:44:24.847 D/JBtlSppNative(   74): signal_SPP_EVENT_OPEN: Exiting05-17 19:44:24.847 D/JBtlSppNative(   74): signal_SPP_EVENT_MODEM_STATUS_IND: Entered05-17 19:44:24.847 D/JBtlSppNative(   74): signal_SPP_EVENT_MODEM_STATUS_IND: Exiting05-17 19:44:25.424 D/BluetoothSppService(   74): writeSync called!05-17 19:44:25.424 D/JBtlSpp (   74): write: Entered05-17 19:44:25.427 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: Entered05-17 19:44:25.427 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: BTL_SPP_WriteSync returned 0 written: 6 total: 0/605-17 19:44:25.437 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: Entered05-17 19:44:25.437 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: status: 0 context:24 txDataLen:605-17 19:44:25.437 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: Exiting ok05-17 19:44:25.437 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: written 605-17 19:44:25.437 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative:Exiting with 005-17 19:44:25.437 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: returning 6 bytes05-17 19:44:25.437 D/JBtlSpp (   74): After write, status=SUCCESS05-17 19:44:25.437 D/JBtlSpp (   74): write: Exiting05-17 19:44:25.437 D/BluetoothSppPort( 5809): written 6 bytes05-17 19:44:25.467 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Entered05-17 19:44:25.467 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: status: 0 context: 24 rxDataLen: 105-17 19:44:25.467 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Exiting05-17 19:44:25.477 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Entered05-17 19:44:25.477 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: status: 0 context: 24 rxDataLen: 505-17 19:44:25.477 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Exiting05-17 19:44:25.487 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Entered05-17 19:44:25.487 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: status: 0 context: 24 rxDataLen: 1005-17 19:44:25.487 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Exiting05-17 19:44:25.497 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Entered05-17 19:44:25.497 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: status: 0 context: 24 rxDataLen: 705-17 19:44:25.497 D/JBtlSppNative(   74): signal_SPP_EVENT_RX_DATA_IND: Exiting05-17 19:44:27.930 W/ActivityManager(   74): Activity destroy timeout for HistoryRecord{447e0d48 com.gtosoft.dash/.Dash}05-17 19:44:29.907 D/dalvikvm(  448): GC freed 78 objects / 3664 bytes in 153ms05-17 19:44:29.917 D/BluetoothSppService(   74): writeSync called!05-17 19:44:29.917 D/JBtlSpp (   74): write: Entered05-17 19:44:29.917 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: Entered05-17 19:44:29.927 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: BTL_SPP_WriteSync returned 0 written: 6 total: 0/605-17 19:44:29.937 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: Entered05-17 19:44:29.937 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: status: 0 context:24 txDataLen:605-17 19:44:29.937 D/JBtlSppNative(   74): signal_SPP_EVENT_TX_DATA_COMPLETE: Exiting ok05-17 19:44:29.937 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: written 605-17 19:44:29.937 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative:Exiting with 005-17 19:44:29.937 D/JBtlSppNative(   74): NativeJBtlSpp_WriteNative: returning 6 bytes05-17 19:44:29.937 D/JBtlSpp (   74): After write, status=SUCCESS05-17 19:44:29.937 D/JBtlSpp (   74): write: Exiting</code></pre>","268803","","","","","2012-12-19 15:39:32","Why can't HTC Droid running OTA 2.1 communicate with RFCOMM?","<android><bluetooth><htc><rfcomm>","2","0","2","",""
"2853945","1","","","2010-05-18 00:44:44","2","1793","<p>I 'm developing a video streaming android application on HTC Tattoo. I 've Lighttpd server at my server side which i use to stream videos to a web site. On Android , Do I need to enable any module in Lighttpd server?</p><p>Thanks</p>","218665","","","","","2010-06-20 11:12:34","Video Streaming in Android using Lighttpd","<android><video><streaming><lighttpd>","2","0","","",""
"2854237","1","2854444","","2010-05-18 02:32:21","4","4483","<p>Working through some OpenGL-ES tutorials, using the Android emulator. I've gotten up to texture mapping and am having some trouble mapping to a cube. Is it possible to map a texture to all faces of a cube that has 8 vertices and 12 triangles for the 6 faces as described below?</p><pre><code>// Use half as we are going for a 0,0,0 centre.    width  /= 2;    height /= 2;    depth  /= 2;    float vertices[] = { -width, -height, depth, // 0                          width, -height, depth, // 1                          width,  height, depth, // 2                         -width,  height, depth, // 3                         -width, -height, -depth, // 4                          width, -height, -depth, // 5                          width,  height, -depth, // 6                         -width,  height, -depth, // 7    };    short indices[] = {             // Front            0,1,2,            0,2,3,            // Back            5,4,7,            5,7,6,            // Left            4,0,3,            4,3,7,            // Right            1,5,6,            1,6,2,            // Top            3,2,6,            3,6,7,            // Bottom            4,5,1,            4,1,0,    };   float texCoords[] = {        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f,        0.0f, 0.0f,        1.0f, 0.0f,    };</code></pre><p>I have gotten the front and back faces working correctly, however, none of the other faces are showing the texture.</p><p><img src=""http://www.freeimagehosting.net/uploads/60d292613d.jpg"" alt=""alt text""></p><p>Drawing code</p><pre><code>public void draw(GL10 gl) {    // Counter-clockwise winding.    gl.glFrontFace(GL10.GL_CCW);    // Enable face culling.    gl.glEnable(GL10.GL_CULL_FACE);    // What faces to remove with the face culling.    gl.glCullFace(GL10.GL_BACK);    // Enabled the vertices buffer for writing and to be used during    // rendering.    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    // Specifies the location and data format of an array of vertex    // coordinates to use when rendering.    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, verticesBuffer);    if (normalsBuffer != null) {        // Enabled the normal buffer for writing and to be used during rendering.        gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);        // Specifies the location and data format of an array of normals to use when rendering.        gl.glNormalPointer(GL10.GL_FLOAT, 0, normalsBuffer);    }    // Set flat color    gl.glColor4f(rgba[0], rgba[1], rgba[2], rgba[3]);    // Smooth color    if ( colorBuffer != null ) {        // Enable the color array buffer to be used during rendering.        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);        // Point out the where the color buffer is.        gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorBuffer);    }    // Use textures?    if ( textureBuffer != null) {        gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);        gl.glEnable(GL10.GL_TEXTURE_2D);        gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    }    // Translation and rotation before drawing    gl.glTranslatef(x, y, z);    gl.glRotatef(rx, 1, 0, 0);    gl.glRotatef(ry, 0, 1, 0);    gl.glRotatef(rz, 0, 0, 1);    gl.glDrawElements(GL10.GL_TRIANGLES, numOfIndices, GL10.GL_UNSIGNED_SHORT, indicesBuffer);    // Disable the vertices buffer.    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    gl.glDisableClientState(GL10.GL_COLOR_ARRAY);    gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    // Disable face culling.    gl.glDisable(GL10.GL_CULL_FACE);}</code></pre>","18340","","18340","","2010-05-18 03:27:00","2014-01-06 19:51:27","OpenGL ES - texture map all faces of an 8 vertex cube?","<android><opengl-es>","2","2","0","",""
"2854600","1","","","2010-05-18 04:39:22","2","6501","<p>is it possible that I send a request from my Android app to a web service and in return I get a data for example a XML file from the web service which I parse in android?</p><p>Thanks</p><p>kai</p>","328518","","","","","2011-11-19 17:28:40","Sending and receiving data from a web service using android","<android><web-services><request>","1","2","2","2012-12-03 00:05:48",""
"2854771","1","2855137","","2010-05-18 05:38:19","2","3680","<p>How can i carousel image gallery which never gets end.. after last first image and before first last image.</p>","216431","","","","","2011-11-24 09:59:55","Android carousel image gallery","<android><gallery><carousel>","1","2","1","",""
"2854783","1","2856681","","2010-05-18 05:40:47","3","6895","<p>The context menu is not popping up on the long click on the list items in the list view. I've extended the base adapter and used a view holder to implement the custom list with textviews and an imagebutton. </p><pre><code>adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList);       list.setAdapter(adapter);       registerForContextMenu(list);  </code></pre><p>Implementation of onCreateContextMenu</p><pre><code>  @Override public void onCreateContextMenu(ContextMenu menu, View v,   ContextMenuInfo menuInfo) {  // TODO Auto-generated method stub  super.onCreateContextMenu(menu, v, menuInfo);  Log.d(TAG, ""Entering Context Menu"");   menu.setHeaderTitle(""Context Menu"");  menu.add(Menu.NONE, DELETE_ID, Menu.NONE, ""Delete"")  .setIcon(R.drawable.icon); }</code></pre><p>The XML for listview is here</p><pre><code> &lt;ListView    android:id=""@+id/list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;</code></pre><p>I've been trying this for many days. I think its impossible to register Context-menu for a custom list view like this. Correct me if I am wrong (possibly with sample code).</p><p>Now I am thinking of a adding a button to the list item and it displays a menu on clicking it. Is it possible with some other way than using Dialogs?  </p><p>Any help would be much appreciated.. </p>","323404","","","","","2011-09-04 03:45:33","ContextMenu not popping up on Long click","<android><contextmenu>","3","0","2","",""
"2855013","1","","","2010-05-18 06:43:32","2","3852","<p>If you know about Compatibility Test Suit for Android. Please send us the information regarding source code downloading of CTS, environment setup, building and execution.</p>","343722","","1108213","","2012-03-01 09:18:42","2012-05-11 06:11:40","Android CTS : downloading of CTS, environment setup, building and execution","<android><android-source>","3","0","","",""
"2855085","1","","","2010-05-18 06:58:34","-1","283","<p>I'm new to android development and I am stuck with a problem.</p><p>I am trying to develop an android application that shows the user the location of atms, hotels etc on a google map. I haven't started working on the gps yet. As of now the app works something like this, first of all a map loads on which I intend to show the users current location. On clicking on the menu button there are 3 options:</p><ul><li>services</li><li>about us</li><li>quit</li></ul><p>On selecting services option the following options are available.</p><ul><li>atm</li><li>hospital</li><li>hotel</li></ul><p>etc</p><p>on selecting the atm option we will be shown a screen displaying some text.</p><p>on using the menu for this screen we get the following menu items.</p><ul><li>sbi</li><li>canara</li><li>hdfc</li><li>icici</li></ul><p>etc</p><p>my intention is that when the user selects the sbi option a map should load showing the various places where there are sbi atms near where the user is currently.</p><p>I started out with the google map api but I had to quit because when I select one of the menu options, such as ""sbi"", the map does not load, instead I am getting the error ""application failed to load"". Basically I was trying to load a map activity from my first map activity. After googling a bit without any results I tried another approach. I tried to download and view the static map of the location I wanted. It worked, but when I tried to download the static map when I select an option like before I get the same error. ""application failed to load"". then I tried downloading 2 images from inside onCreate that worked. I cannot do the same thing outside the onCreate. for eg.inside the function for the selected option.</p><p>I have given the link to my code below.</p><p>If someone can please look into this it would be of great help to me. I have been sitting with this problem for days now. And its urgent too. I have done the project in eclipse.</p><p>httpDownload.java ---   <a href=""http://dpaste.com/195981/"" rel=""nofollow"">http://dpaste.com/195981/</a></p>","343730","","234976","","2011-11-25 03:53:11","2011-11-25 03:53:11","Android Development-cannot download an image outside of onCreate","<android><google-maps>","1","1","","",""
"2855110","1","4514578","","2010-05-18 07:05:46","12","6315","<p>I wanted to create a notification without the icon in the status bar (the state that is not expanded). I tried the custom expanded view and set the icon for this view only. But it did not work. When I give 0 as icon to the constructor, the icon disappears but notification also does not appear in the expanded view.  </p><p>Notification notification = new Notification(0, """", 0);</p><p>I tried a lot of combinations but didn't come out with a solution. By the way, I know it is working because I saw this feature in some apps. Thanks.</p>","40929","","243999","","2010-05-18 08:13:22","2013-07-19 01:58:24","Android: No icon for Notification","<android><user-interface><icons><notifications><expanded>","4","2","6","",""
"2855136","1","5922341","","2010-05-18 07:10:58","2","864","<p>I recently introduced multi-stroke gestures into my application. This is a preference so I set the StrokeType dynamically in Activity.OnCreate. What I have discovered is that if you set the StrokeType dynamically, it changes the behaviour of the GestureOverlayView in the following way.</p><p>The normal behaviour is that you draw a gesture and it stays on the screen after it is drawn. When you change the stroke type dynamically however, any gesture drawn on the screen disappears immediately after the OnGestureEnded event has fired. I reloaded the sample GesturesBuilder application and confirmed it has the same problem if you add the second line shown here:</p><pre><code>    GestureOverlayView overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay);    overlay.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_SINGLE);    overlay.addOnGestureListener(new GesturesProcessor());}</code></pre><p>Is this a bug in the Android gestures library and does anyone know a workaround?</p><p>Note that this is on an HTC Magic so it could also be a handset issue.</p>","81317","","","","","2012-01-03 11:13:46","Why would changing the StrokeType of a GestureOverlayView affect the standard behaviour of the view?","<android><gestures>","1","0","1","",""
"2855150","1","2855280","","2010-05-18 07:13:09","0","387","<p>I am new to Android. I need to know how to install it in Windows XP. Which is the best IDE and what are its requirements? Also, how can I develop an application?</p>","324223","","496830","","2011-10-10 16:12:36","2011-10-10 16:12:36","How can I get started with Android in Windows XP?","<android>","2","0","","2012-07-29 13:55:44",""
"2855417","1","2875673","","2010-05-18 07:58:49","3","443","<p>I have a preferences activity where I can change the language and the theme of my application. From there I return to the previous activity via the Back key, and I want to recreate the activity. </p><p>I've managed to do that by reinitializing the layout in <code>onResume</code> and also calling <code>onRestoreInstanceState</code> from there. All the views are restored properly, with checkboxes checked if needed, edittexts filled with texts I left there previously.</p><p>But I also have a button which is initially disabled, and becomes enabled only when a radiobutton is checked. The problem with it is the following: I check the radiobutton, the button becomes enabled. Then I go to settings, change the theme there, and return to the first activity. When I arrive there, the radiobutton is restored as checked, but the button is disabled.</p><p>So it seems that the enabled/disabled state isn't being saved into the bundle, which seems counterintuitive. And I haven't found any code in the Android source that does this, too. Am I missing something, or do I have to write my own code for that?</p><p>EDIT: BTW, state is saved only for the views which have ids. And that button does have one, I guarantee that :)</p>","125805","","125805","","2010-05-18 08:04:47","2010-05-22 10:52:16","Should onSaveInstanceState save the ""enabledness"" of the views?","<android><views><bundle><activity-state>","2","0","","",""
"2855751","1","2866475","","2010-05-18 08:54:31","0","678","<pre><code>Scanner scanner = new Scanner(lapsPerMile_st);                  if (!scanner.hasNextDouble()) {                      Context context = getApplicationContext();                    String msg = ""Please Enter Digits and Decmials Only"";                    int duration = Toast.LENGTH_LONG;                    Toast.makeText(context, msg, duration).show();                    lapsPerMileEditText.setText("""");                    return;                } else {                     //Edit box has only digits, Set data and display stats                    data.setLapsPerMile(Integer.parseInt(lapsPerMile_st));                    lapsRunLabel.setVisibility(0);                    lapsRunTextView.setText(Integer.toString(data.getLapsRun()));                    milesRunLabel.setVisibility(0);                    milesRunTextView.setText(Double.toString(data.getLapsRun()/data.getLapsPerMile()));                }&lt;EditTextandroid:id=""@+id/mileCount""android:layout_width=""100dp""android:layout_height=""wrap_content""android:layout_marginTop=""110dp""android:inputType=""numberDecimal""android:maxLength=""4""/&gt;</code></pre><p>For some reason if I enter a non decimal number such as 3, or 5, it works fine but when I enter a floating point such as 3.4 or 5.8 it force closes.  I cant seem to figure out whats going on.  Any ideas?</p>","336861","","11343","","2012-05-06 14:04:01","2012-05-06 14:04:01","Why is my Android app force closing when I try to check if an EditText has a double","<android><edittext>","2","1","","",""
"2855776","1","2857397","","2010-05-18 08:58:49","3","536","<p>Is it possible to determine the coordinates of the tiles that are visible in a MapView, relative to the first tile in the upper left corner of the <em>entire</em> map (including the invisible part)? I can't seem to find a way to get the tile coordinates ...</p>","321103","","","","","2010-05-18 12:55:51","MapView tile coordinates","<android><tiles><android-mapview>","1","0","","",""
"2855959","1","2900095","","2010-05-18 09:29:12","5","2885","<p>I am trying to parse a Rss2.0 feed on Android using a Pull parser. </p><pre><code>XmlPullParser parser = Xml.newPullParser();parser.setInput(url.open(), null);</code></pre><p>The prolog of the feed XML says the encoding is ""utf-8"". When I open the remote stream and pass this to my Pull Parser, I get invalid token, document not well formed exceptions. </p><p>When I save the XML file and open it in the browser(FireFox) the browser reports presence of Unicode 0x12 character(grave accent?) in the file and fails to render the XML.</p><p>What is the best way to handle such cases assuming that I do not have any control over the XML being returned? </p><p>Thanks.</p>","236128","","","","","2010-05-30 16:21:03","How to remove accent characters from an InputStream","<android><xml-parsing><diacritics>","5","0","1","",""
"2856337","1","2856809","","2010-05-18 10:26:08","0","2958","<p>I have this scenario</p><p>onResume of an activity:</p><pre><code>@Override    protected void onResume() {        if (adapter1!=null) adapter1.notifyDataSetChanged();        if (adapter2!=null) adapter2.notifyDataSetChanged();        if (adapter3!=null) adapter3.notifyDataSetChanged();        super.onResume();    }</code></pre><p>Adapter has been defined as:</p><pre><code>public class ListCursorAdapter extends SimpleCursorAdapter {   Cursor c;    /* (non-Javadoc)     * @see android.widget.CursorAdapter#onContentChanged()     */    @Override    protected void onContentChanged() {        // this is not called        if (c!=null) c.requery();        super.onContentChanged();    }}</code></pre><p>And the onContentChanged event is not fired, although the onResume and the call to the adapter is issued.  What is wrong?</p>","243782","","243782","","2010-05-18 11:09:40","2010-05-18 11:35:43","Calling notifyDataSetChanged doesn't fire onContentChanged event of SimpleCursorAdapter","<android><events><cursor><adapter>","1","0","","",""
"2856357","1","","","2010-05-18 10:31:07","2","1275","<p>I have an app developed and deployed on my HTC mobile phone. I am able to debug this in eclipse with the USB driver SDK. The mobile phone appears now in the hardware manager ADB interface. </p><p>I would now be able to send data through this USB connection to the mobilephone wich my app is able to handle. I know some tethering software wich does this, therefore there must be a way to communicate with user data and with my app.</p>","343902","","1069068","","2013-03-19 14:44:41","2013-03-19 14:44:41","How to send Data to my App over USB Connection in Windows","<android><usb>","0","0","0","",""
"2856392","1","","","2010-05-18 10:38:22","0","842","<p>I want to show few sms available in inbox in my application. And how to identify or to distinguish to sms from others? Is there any message ID or something to identify sms?</p>","343910","","2281","","2010-05-18 10:52:44","2011-10-24 06:16:56","Android Access inbox","<android><inbox>","1","1","","",""
"2856407","1","2859721","","2010-05-18 10:40:42","26","51891","<p>In J2ME, I've do this like that: <code>getClass().getResourceAsStream(""/raw_resources.dat"");</code></p><p>But in android, I always get null on this, why?</p>","309955","","1149919","","2012-03-29 12:38:55","2014-02-04 22:07:05","Android how to get access to raw resources that i put in res folder?","<android><java-me><resources><inputstream><android-resources>","6","2","10","",""
"2856454","1","2856551","","2010-05-18 10:47:38","0","74","<p>I'm passing data to a ListView to display some restaurant names. Now when clicking on an item I'd like to start another activity to display more restaurant data. I'm not sure about how to do it. Shall I pass all the restaurant data in a bundle through the intent object? Or shall I just pass the restaurant id and get the data in the other activity? In that case, how can I access my restaurantList from the other activity? In any case, how can I get data from the restaurant I clicked on (the view only contains the name)?</p><p>Any help, pointers welcome!</p><p>Thanks</p><p>Jul</p><pre><code>ListView lv= (ListView)findViewById(R.id.listview);lv.setAdapter( new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,restaurantList.getRestaurantNames()));lv.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {        Intent i = new Intent(Atable.this, RestaurantEdit.class);        Bundle b = new Bundle();        //b.putInt(""id"", ? );        startActivityForResult(i, ACTIVITY_EDIT);    }});</code></pre><p>RestaurantList.java</p><pre><code>package org.digitalfarm.atable;import java.util.ArrayList;import java.util.List;public class RestaurantList {    private List&lt;Restaurant&gt; restaurants = new ArrayList&lt;Restaurant&gt;();    public List&lt;Restaurant&gt; getRestaurants() {        return this.restaurants;    }    public void setRestaurants(List&lt;Restaurant&gt; restaurants) {        this.restaurants = restaurants;    }    public List&lt;String&gt; getRestaurantNames() {              List&lt;String&gt; restaurantNames = new ArrayList&lt;String&gt;();        for (int i=0; i&lt;this.restaurants.size(); i++) {            restaurantNames.add(this.restaurants.get(i).getName());        }        return restaurantNames;    }}</code></pre><p>Restaurant.java</p><pre><code>package org.digitalfarm.atable;public class Restaurant {    private int id;    private String name;            private float latitude;    private float longitude;    public int getId() {        return this.id;     }    public void setId(int id) {        this.id = id;    }           public String getName() {        return this.name;       }    public void setName(String name) {        this.name = name;    }    public float getLatitude() {        return this.latitude;    }    public void setLatitude(float latitude) {        this.latitude = latitude;    }    public float getLongitude() {        return this.longitude;    }    public void setLongitude(float longitude) {        this.longitude = longitude;    }}</code></pre>","326849","","","","","2010-05-18 11:05:12","How can data not stored in a DB be accessed from any activity in Android?","<android><data><activity>","1","0","","",""
"2856467","1","","","2010-05-18 10:49:08","0","454","<p>How to do the startActivityResult() for the Quick Search Box? that is if i click a button in my activity. it should wake up the QSB and search. i click the suggestion button. it will return the string which is shown as a suggestion. how to do it? which intent action i have to use and how ? Any Idea? </p><p>EDIT:i am using android:searchSuggestIntentAction=""android.intent.action.VIEW"" attribute. its reloads the current Activity.Why? which intent action i have to use and how ? </p>","267269","","267269","","2010-05-18 11:36:05","2010-05-18 11:36:05","startActivityResult Problem on Quick Search Box in Android?","<android>","1","0","","",""
"2856574","1","","","2010-05-18 11:03:26","1","2144","<p>Is there any way to play a sound file under Android browser? </p>","320125","","","","","2011-02-02 19:40:54","How to play a sound file under Android browser","<android><browser><audio><playback>","2","1","","",""
"2856642","1","","","2010-05-18 11:13:38","2","16730","<p>my listview.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&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"" xmlns:myapp=""http://schemas.android.com/apk/res/zaid.quotes.dlama""&gt;    &lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:layout_alignParentTop=""true""        android:layout_marginBottom=""50dp"" android:paddingTop=""50dp""&gt;&lt;/ListView&gt;    &lt;Button android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/Back""        android:layout_alignParentBottom=""true"" android:text=""Go Back""&gt;&lt;/Button&gt;    &lt;LinearLayout android:layout_width=""wrap_content""        android:id=""@+id/LinearLayout01"" android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""&gt;        &lt;com.admob.android.ads.AdView android:id=""@+id/ad""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF""            myapp:secondaryTextColor=""#CCCCCC"" android:layout_alignParentTop=""true"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>the current size of the text in the listview is large. and i cant seem to figure out how to change the text size.</p>","326423","","","","","2013-04-23 09:04:48","Android ListView TextSize","<android><listview>","4","4","1","",""
"2856657","1","","","2010-05-18 11:16:32","2","699","<p>I have an HTC Hero with a major issue. It thinks that the headset/headphones are plugged in. I sent it to HTC and they said there is water damage so no fix.</p><p>I have tried toggleheadset, toggleheadset2. I've rooted my device and installed the Android 2.1 ROM. Now I found out that AudioManager.setRouting and .setWiredHeadsetOn(bool) have been deprecated and subsequently removed. </p><p>I read a post somewhere about how you can create a wrapper for the AudioSystem class as the setRouting is still available there. I as of yet have not been able to figure out how to go about doing this as the AudioSystem class is hidden in the SDK and the code makes use of native functions.</p><p>Does anybody know of a way to go about creating and implementing a wrapper for AudioSystem or of another way to disable the headset?</p><p>I've also cleaned out the headset port so there is no dust or anything sending false signals to the mainboard.</p><p>Any help will be greatly appreciated.</p>","171926","","1288","","2012-08-17 17:36:37","2012-08-17 17:36:37","Programmatically disable WiredHeadset","<android><htc-hero><audiomanager>","0","0","","",""
"2856993","1","","","2010-05-18 12:00:08","6","7096","<p>I am using Android SDK 1.6. Could someone tell me how to set an image as the wallpaper in the homescreen.</p><pre><code>getApplicationContext().setWallpaper(); </code></pre><p>seems to be not working for me.</p>","343974","","184184","","2011-11-19 20:15:20","2011-11-19 20:15:20","How to set wallpaper in Android","<android><wallpaper>","1","1","5","",""
"2857101","1","5902569","","2010-05-18 12:15:10","5","10795","<p>I am using below code for scheduling a task in android but its not giving any results. Please advise on the same.</p><pre><code>int delay = 5000; // delay for 5 sec.int period = 1000; // repeat every sec.Timer timer = new Timer();timer.scheduleAtFixedRate(new TimerTask() {   public void run() {      Toast.makeText(getApplicationContext(),""RUN!"",Toast.LENGTH_SHORT).show();   }}, delay, period);</code></pre>","301549","","114066","","2010-07-26 15:35:36","2014-02-15 19:42:47","Schedule task in android","<android>","2","1","4","",""
"2857121","1","2864161","","2010-05-18 12:18:48","12","4549","<p>When I create preference activity I define all preferences in xml file. Every preference has a key defined in this xml. But when I access preference I write: </p><pre><code>SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this);boolean foo_value = appPreferences.getBoolean(""foo_key_defined_in_xml"", false);</code></pre><p>Is there any way to avoid referencing ""foo_key_defined_in_xml"" in hard-coded way?Maybe there is a possibility to reference it in R style way (not to refer to string)?</p>","296427","","296427","","2010-11-08 19:02:02","2013-07-06 18:21:37","Where to store Android preference keys?","<java><android><preferences><android-preferences>","5","0","8","",""
"2857215","1","3152064","","2010-05-18 12:30:24","1","1584","<p>Hi i have a problem programming with android SDK 1.6. I'm doing the same things of the ""notepad exaple"" but the programm crash when i try some query. If i try to do a query directly in to the DatabaseHelper create() metod it goes, but out of this function it doesn't. Do you have any idea?</p><p>this is the source:<code>public class DbAdapter {</p><pre><code>public static final String KEY_NAME = ""name"";public static final String KEY_TOT_DAYS = ""totdays"";public static final String KEY_ROWID = ""_id"";private static final String TAG = ""DbAdapter"";private DatabaseHelper mDbHelper;private SQLiteDatabase mDb;private static final String DATABASE_NAME = ""flowratedb"";private static final String DATABASE_TABLE = ""girl_data"";private static final String DATABASE_TABLE_2 = ""girl_cyle"";private static final int DATABASE_VERSION = 2;/** * Database creation sql statement */private static final String DATABASE_CREATE =        ""create table ""+DATABASE_TABLE+"" (id integer, name text not null, totdays int);"";private static final String DATABASE_CREATE_2 =    ""create table ""+DATABASE_TABLE_2+"" (ref_id integer, day long not null);"";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);        db.execSQL(DATABASE_CREATE_2);        db.delete(DATABASE_TABLE, null, null);        db.delete(DATABASE_TABLE_2, null, null);    }    @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 ""+DATABASE_TABLE);        db.execSQL(""DROP TABLE IF EXISTS ""+DATABASE_TABLE_2);        onCreate(db);    }}public DbAdapter(Context ctx) {    this.mCtx = ctx;}public DbAdapter open() throws SQLException {    mDbHelper = new DatabaseHelper(mCtx);    mDb = mDbHelper.getWritableDatabase();    return this;}public void close() {    mDbHelper.close();}public long createGirl(int id,String name, int totdays) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_ROWID, id);    initialValues.put(KEY_NAME, name);    initialValues.put(KEY_TOT_DAYS, totdays);    return mDb.insert(DATABASE_TABLE, null, initialValues);}public long createGirl_fd_day(int refid, long fd) {    ContentValues initialValues = new ContentValues();    initialValues.put(""ref_id"", refid);    initialValues.put(""calendar"", fd);    return mDb.insert(DATABASE_TABLE, null, initialValues);}public boolean updateGirl(int rowId, String name, int totdays) {    ContentValues args = new ContentValues();    args.put(KEY_NAME, name);    args.put(KEY_TOT_DAYS, totdays);    return mDb.update(DATABASE_TABLE, args, KEY_ROWID + ""="" + rowId, null) &gt; 0;}public boolean deleteGirlsData() {    if (mDb.delete(DATABASE_TABLE_2, null, null)&gt;0)        if(mDb.delete(DATABASE_TABLE, null, null)&gt;0)            return true;    return false;}public Bundle fetchAllGirls() {    Bundle extras = new Bundle();    Cursor cur = mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NAME,            KEY_TOT_DAYS}, null, null, null, null, null);    cur.moveToFirst();    int tot = cur.getCount();    extras.putInt(""tot"", tot);    int index;    for (int i=0;i&lt;tot;i++){        index=cur.getInt(cur.getColumnIndex(""_id""));        extras.putString(""name""+index, cur.getString(cur.getColumnIndex(""name"")));        extras.putInt(""totdays""+index, cur.getInt(cur.getColumnIndex(""totdays"")));    }    cur.close();    return extras;}public Cursor fetchGirl(int rowId) throws SQLException {    Cursor mCursor =            mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,                    KEY_NAME, KEY_TOT_DAYS}, KEY_ROWID + ""="" + rowId, null,                    null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public Cursor fetchGirlCD(int rowId) throws SQLException {    Cursor mCursor =            mDb.query(true, DATABASE_TABLE_2, new String[] {""ref_id"",                    ""day""}, ""ref_id="" + rowId, null,                    null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}</code></pre><p>}</code></p><p>Tank'sValerio From Italy :)</p>","314554","","","","","2012-11-26 16:32:20","Android SQLite Problem: Program Crash When Try a Query!","<android><mysqli><database-connection>","4","1","","",""
"2857290","1","2857597","","2010-05-18 12:41:50","0","1424","<p>I want to stop user from entering white space into the edittext, easiest way is to do not have button in keyboard appearing on click.</p><p>how to hide white space button from keyboard ?</p><p>or is there any other way to stop user entering white space into the edit text field.</p>","216431","","","","","2010-05-18 13:19:34","android virtual keyboard remove white space button","<android><keyboard>","2","0","","",""
"2857329","1","2858581","","2010-05-18 12:47:10","0","397","<p>I have an activity with three listviews, each having three different cursors, but all have the same ContextMenu show/resolve code and when the selection event fires, I want to get the ListView to refresh it.</p><p>I can't use <code>menuInfo.targetView</code>, as that holds the LinearLayout for the ListView row, and not the ListView.</p><p>in this method</p><pre><code> public boolean onContextItemSelected(MenuItem item) </code></pre><p>How is possible?</p>","243782","","243782","","2010-05-18 14:39:49","2011-03-07 16:13:34","How to get on which ListView has been a ContextItem selected?","<android><listview>","4","0","","",""
"2858094","1","2858124","","2010-05-18 14:20:25","1","545","<p>What is the distinction between MIDP and JME? </p><p>How do both relate to Android? As far as I understand JME isn't supported on Android - is that correct?</p><p>Thanks</p>","146588","","","","","2010-05-18 18:57:51","What is the relationship between MIDP and JME (and Android)?","<android><midp><java-me>","1","0","","",""
"2858140","1","","","2010-05-18 14:26:16","3","4586","<p>I don't get it and I can't find it by myself. How to display (and update) a route between two locations (for example, current device location and destination) in Android application using Google Maps API?</p>","90571","","","","","2012-04-29 02:17:38","How to display route with Google Maps API in Android application?","<android><google-maps><android-maps>","1","0","5","",""
"2858161","1","2859248","","2010-05-18 14:28:38","8","5815","<p>I'm trying to display a list of available sensors but it's like there are not!<br />I was thinking that it was because of the emulator, but i tried it on the phone and the result is the same.</p><pre><code>private SensorManager mSensorManager;TextView mSensorsTot,mSensorAvailables;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Get the texts fields of the layout and setup to invisible    mSensorsTot   = (TextView) findViewById(R.id.sensoritot);    mSensorAvailables  = (TextView) findViewById(R.id.sensoridisponibili);    // Get the SensorManager     mSensorManager= (SensorManager) getSystemService(SENSOR_SERVICE);    // List of Sensors Available    List&lt;Sensor&gt; msensorList = mSensorManager.getSensorList(SensorManager.SENSOR_ALL);    // Print how may Sensors are there    mSensorsTot.setText(msensorList.size()+"" ""+this.getString(R.string.sensors)+""!"");    // Print each Sensor available using sSensList as the String to be printed    String sSensList = new String("""");    Sensor tmp;    int x,i;    for (i=0;i&lt;msensorList.size();i++){     tmp = msensorList.get(i);     sSensList = "" ""+sSensList+tmp.getName(); // Add the sensor name to the string of sensors available    }    // if there are sensors available show the list    if (i&gt;0){     sSensList = getString(R.string.sensors)+"":""+sSensList;     mSensorAvailables.setText(sSensList);    }}</code></pre>","314554","","426671","","2014-04-04 01:24:29","2014-04-04 01:24:29","Display an Android Sensors List","<android><sensor>","2","0","2","",""
"2858173","1","","","2010-05-18 14:30:05","0","1666","<p>Is any SDK version which support Windows 2000? r05 doesn't - I found that \android-sdk-windows\tools\emulator.exe imports from WS2_32.dll functions freeaddrinfo, getaddrinfo and getnameinfo which missed from this library.</p>","344121","","","","","2011-10-15 12:33:32","Android SDK for Windows 2000","<android>","2","0","","",""
"2858255","1","2891712","","2010-05-18 14:39:47","7","9311","<p>I need to calculate a rotation vector out of the data i get from Sensor.TYPE_ORIENTATION.</p><p>The sensor data is defined like this:</p><ul><li>the values have to be recalculated to become a correct 3d position: values[0]: Azimuth, angle between the magnetic north direction and the Y axis, around the Z axis (0 to 359). 0=North, 90=East, 180=South, 270=West </li><li>values<a href=""https://github.com/bitstars/droidar"" rel=""nofollow"">1</a>: Pitch, rotation around X axis (-180 to 180), with positive values when the z-axis moves toward the y-axis. </li><li>values[2]: Roll, rotation around Y axis (-90 to 90), with positive values when the x-axis moves away from the z-axis</li></ul><p>I need all three values like the Z axis value (from 0 to 360 degree). I tried a lot but cant figure out how to do this :/ </p><p><strong>( edit: To see the idea behind in working code take a look at the class ActionWithSensorProcessing of the <a href=""https://github.com/bitstars/droidar"" rel=""nofollow"">DroidAR framework</a> there you can see how the different event types can be processed.)</strong></p><p>i also tried to use Sensor.TYPE_ACCELEROMETER and Sensor.TYPE_MAGNETIC_FIELD to calculate this 3d vector on my own. here is the code:</p><pre><code>final float[] inR = new float[16];// load inR matrix from current sensor data:SensorManager.getRotationMatrix(inR, null, gravityValues, geomagneticValues);float[] orientation = new float[3];SensorManager.getOrientation(inR, orientation);mapMagAndAcclDataToVector(orientation); //here i do some *360 stufforientetionChanged(orientation); //then the correct values are passed (in theorie)</code></pre><p>But this didn't work and i think it is much to complicated. So i bet there is a simple solution how to recalc the values of ensor.TYPE_ORIENTATION to make them a 3d rotation vector, but i just dont know how to do it. If you know the answer please tell me.</p><p>EDIT:i should add that i want to pass there values to OpenGL to align it to the axis like this:</p><pre><code>gl.glRotatef(values[1], 1, 0, 0);gl.glRotatef(values[2], 0, 1, 0);gl.glRotatef(values[0], 0, 0, 1);</code></pre><p>but because of the strange value ranges i obviously cant do this. the same problem with the values from SensorManager.getOrientation because they flip too when you pass the horizon line..</p><p>another solution would be to calculate the angles using the inR matrix but i think there must be an easier solution (?)</p>","165106","","165106","","2013-10-09 08:35:18","2013-10-09 08:35:18","Need to calculate rotation-vector from Sensor.TYPE_ORIENTATION data","<android><opengl-es><vector><matrix><sensor>","2","0","8","",""
"2858448","1","","","2010-05-18 15:00:11","3","4073","<p>I have a HorizontalScrollView with a series of CompoundButtons. I want to find the (x,y) for a given child view. I have tried using:   getLocationOnScreen()   getLocalVisibleRect()   getChildVisibleRect()</p><p>like this:  View tmpView = this.findViewById(viewId);  Rect hitRect = new Rect();<br>  tmpView.getLocalVisibleRect(hitRect);</p><p>the hitRect is always 0,0 - 0,0. </p><p>I need the x,y mainly to scroll to a particular child view. Any help is greatly appreciated. Thanks.</p>","344154","","","","","2011-01-20 06:43:07","Position of a Child View in a HorizontalScrollView","<android>","1","0","2","",""
"2858474","1","2858538","","2010-05-18 15:03:21","0","1212","<p>I'm writing an android app where I need to use AES. Is it better to use the bouncy castle libraries or should I just stick with what is included in default android libraries?</p>","344151","","","","","2010-05-18 15:10:03","Should I use the bouncy castle libraries or the ones included in Android for AES","<android><encryption><aes><bouncycastle>","1","2","","",""
"2858489","1","2858679","","2010-05-18 15:04:34","1","576","<p>here's my scenario: I start an Activity A via an AppWidget. The AppWidget displays (inter alia) 3 buttons. Each of them has its own intent. They are designed to provide information to the Activity via a class called AppWidgetReceiver. In latter I create an intent like this:</p><pre><code>Intent i = new Intent(context, CreateNoteActivity.class);  i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  i.putExtra(AppWidget.WIDGET_ITS_TRIGGER_ID, trigger_id);  i.putExtra(AppWidget.WIDGET_TITLE, title);  i.putExtra(AppWidget.WIDGET_DESCRIPTION, descr);  context.startActivity(i);</code></pre><p>This launches the Activity A. Based on <code>trigger_id</code>, <code>title</code> and <code>descr</code> I create some sort of information menu for the user:</p><pre><code>coreQuestionTitle   = getIntent().getStringExtra(AppWidget.WIDGET_TITLE);  coreQuestionDescr   = getIntent().getStringExtra(AppWidget.WIDGET_DESCRIPTION);  coreQuestionId      = getIntent().getIntExtra(AppWidget.WIDGET_ITS_TRIGGER_ID, -1); TextView tvCoreQuestion = (TextView) findViewById(R.id.create_note_core_question_text);tvCoreQuestion.setText(coreQuestionTitle);</code></pre><p>All of this works fine. The problem arises when I don't 'close' the Activity via <code>this.finish()</code>, e.g. the home- or back-button is pressed. When I now click on an OTHER button on the AppWidget the previously opened Activity is restored instead of restarted. The <code>onCreate()</code> is not called. Instead, it jumps right into <code>onStart()</code>. I know that this is intended by the Activity lifecycle since the task is still alive.<br>Unfortunately, I really need to be able to retrieve the parameters specified in the intent to set the desired information. Moreover, I would like to be able to restore the state of ANY of 3 different tasks. Can anyone help me out on this?</p><p>By the way: I'm avoiding to pass the <code>onCreate()</code> by making use of android:configChanges=""keyboardHidden|orientation"" and <code>onConfigurationChanged()</code>. The declaration of the Activity in the Manifest.xml looks like this:</p><pre><code>&lt;activity android:name="".notes.CreateNoteActivity""      android:configChanges=""keyboardHidden|orientation""      android:label=""@string/create_note""      android:launchMode=""singleTask""      android:theme=""@android:style/Theme.NoTitleBar"" &gt;      &lt;intent-filter&gt;          &lt;category android:name=""android.intent.category.CATEGORY_HOME"" /&gt;      &lt;/intent-filter&gt;  &lt;/activity&gt;</code></pre><p>Thanks in advance,<br>Steff</p>","289849","","","","","2010-05-18 15:27:31","How to restore content in the same Activity based on the calling Intent?","<android><activity><android-intent><restore>","1","0","","",""
"2858493","1","2858514","","2010-05-18 15:04:50","3","5394","<p>Im using </p><pre><code>// this is a DefaultHttpClientList&lt;Cookie&gt; cookies = this.getCookieStore().getCookies();</code></pre><p>Now, since Cookie does not implement serializeable, I can't serialize that List.</p><p>EDIT: (specified my goal, not only the problem)</p><p>My goal is to use the DefaultHttpClient with persistent cookies. </p><p>Anyone with experience that could lead me on the right track here? There might be another best practice that I haven't discovered...</p>","133858","","133858","","2010-05-18 17:21:50","2011-06-02 22:47:50","How to make persistent Cookies with a DefaultHttpClient in Android?","<java><android><http>","2","0","3","",""
"2858641","1","","","2010-05-18 15:24:01","0","1555","<p>Have you ever met such problems? When exiting the activity in a thread in a <code>SurfaceView</code>.<br>This log appears in this situation:</p><pre><code>05-18 15:20:20.344: ERROR/AndroidRuntime(2018): Uncaught handler: thread main exiting due to uncaught exception05-18 15:20:20.355: ERROR/AndroidRuntime(2018): java.lang.IllegalArgumentException: parameter must be a descendant of this view05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:2454)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:2391)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewRoot.scrollToRectOrFocus(ViewRoot.java:1301)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewRoot.draw(ViewRoot.java:1107)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.os.Handler.dispatchMessage(Handler.java:99)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.os.Looper.loop(Looper.java:123)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at android.app.ActivityThread.main(ActivityThread.java:3948)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at java.lang.reflect.Method.invokeNative(Native Method)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at java.lang.reflect.Method.invoke(Method.java:521)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)05-18 15:20:20.355: ERROR/AndroidRuntime(2018):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","165273","","234938","","2010-05-18 17:18:59","2010-09-01 19:22:54","Problem exiting an Activity using a SurfaceView","<android>","2","0","","",""
"2858648","1","2864376","","2010-05-18 15:25:07","3","11476","<p>Do you know any books, articles, examples, screencasts that document how to develop an home screen widget on Android?</p><p>I just found these links:  </p><ul><li><a href=""http://developer.android.com/guide/practices/ui_guidelines/widget_design.html"" rel=""nofollow"">widget design guidelines</a>    </li><li><a href=""http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html"" rel=""nofollow"">Introducing home screen widgets andthe AppWidget framework</a></li></ul><p>I would like to develop a tiny home screen ticker and I'm searching for the proper way to code it.</p>","130929","","130929","","2011-04-12 19:12:10","2012-07-25 22:02:49","Android home screen widget documentation","<android><android-widget>","3","0","5","",""
"2859212","1","2859409","","2010-05-18 16:35:06","52","47135","<p>I am resusing ImageViews for my displays, but at some point I don't have values to put it.</p><p>So how to clear an ImageView in Android?</p><p>I've tried:</p><pre><code>mPhotoView.invalidate();mPhotoView.setImageBitmap(null);</code></pre><p>None of them have cleared the view, it still shows previous image.</p>","243782","","","","","2014-01-09 18:06:07","How to clear an ImageView in Android?","<android>","11","2","13","",""
"2859458","1","","","2010-05-18 17:12:57","3","3992","<p>According to Android SDK MediaRecorder.setCamera can be used to recycle the existing camera instance for video capture and preview without resetting the preview. I was not able to find any sample, and all my attempts were futile: I either get the wrong state exception, or MediaRecorder.prepare fails.</p><ul><li>Does anyone know if this method usable at all?</li><li>How can I use it then?</li><li>Any samples available in the Wild Wild Web?</li></ul><p>For reference:<a href=""http://developer.android.com/reference/android/media/MediaRecorder.html#setCamera(android.hardware.Camera"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaRecorder.html#setCamera(android.hardware.Camera</a>)</p>","2877","","213269","","2011-08-12 09:12:34","2013-08-19 12:01:55","How to use setCamera (MediaRecorder)?","<android><camera><mediarecorder>","5","0","1","",""
"2859550","1","2859600","","2010-05-18 17:27:34","0","1444","<p>I have an activity, where the ListView holds customized linear layout elements for each row. One of the rows has a button defined as:</p><pre><code> &lt;Button            android:text=""Pick a contact""            android:id=""@+id/btnPickContact""            android:layout_width=""wrap_content""            android:gravity=""center_vertical""            android:layout_height=""wrap_content""&gt;&lt;/Button&gt;</code></pre><p>Then in java, I have this code:</p><pre><code>((Button) row.findViewById(R.id.btnPickContact)).setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);                    intent.putExtra(EXTRA_ONLINE_ID, (String)v.getTag(TAG_ONLINE_ID));                    act.startActivityForResult(intent, PICK_CONTACT);                }            });</code></pre><p>In this setup the event fails to start.</p><p>Also I've tried by implementing the interface:</p><pre><code>@Override    public void onClick(View v) {            Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);            intent.putExtra(EXTRA_ONLINE_ID, (String)v.getTag(TAG_ONLINE_ID));            startActivityForResult(intent, PICK_CONTACT);    }</code></pre><p>still no luck, the event doesn't fire.</p><p>What to do?</p>","243782","","","","","2012-04-03 08:10:29","Why my buttons OnClick event fails to fire?","<android><button><onclick>","5","0","","",""
"2859574","1","2859685","","2010-05-18 17:32:13","36","12038","<p>Why do I get this Exception?</p><pre><code>05-18 20:29:38.044: ERROR/AndroidRuntime(5453): java.lang.IllegalArgumentException: The key must be an application-specific resource id.05-18 20:29:38.044: ERROR/AndroidRuntime(5453):     at android.view.View.setTag(View.java:7704)05-18 20:29:38.044: ERROR/AndroidRuntime(5453):     at com.mypkg.viewP.inflateRow(viewP.java:518)</code></pre><p>the line in question is:</p><pre><code>((Button) row.findViewById(R.id.btnPickContact)).setTag(TAG_ONLINE_ID,objContact.onlineid);</code></pre><p>and I have it defined as:</p><pre><code>private static final int TAG_ONLINE_ID = 1;</code></pre>","243782","","","","","2014-03-14 17:25:50","The key must be an application-specific resource id","<android><illegalargumentexception>","3","0","7","",""
"2859831","1","16073980","","2010-05-18 18:12:02","6","2729","<p>I have this code:</p><pre><code>Intent intent = new Intent();        intent.setAction(Intent.ACTION_PICK);        intent.setData(ContactsContract.Contacts.CONTENT_URI);        intent.putExtra(EXTRA_ONLINE_ID, (String) v.getTag());        startActivityForResult(intent, PICK_CONTACT);</code></pre><p>Then on response:</p><pre><code>public void onActivityResult(int reqCode, int resultCode, Intent data) {        switch (reqCode) {            case (PICK_CONTACT):                if (resultCode == Activity.RESULT_OK) {                    try {                        Uri contactData = data.getData();                        String onlineid = data.getStringExtra(EXTRA_ONLINE_ID);                    } catch (Exception e) {                        e.printStackTrace();                    }                }                break;        }        super.onActivityResult(reqCode, resultCode, data);    }</code></pre><p>the <code>onlineid</code> variable is null.  How can I pass a value and then to receive it back?</p><p><strong>EDIT</strong></p><p>I even tried,  </p><pre><code>Bundle extras = data.getExtras(); // returns null</code></pre>","243782","","82118","","2011-06-14 23:35:45","2013-04-18 06:08:36","startActivityForResult and Intents Extras, it seems extras are not pushed back","<android><android-intent><extras>","5","2","2","",""
"2859850","1","2860062","","2010-05-18 18:14:58","2","1400","<p>I use XML output in my app. So basically the main activity just tells the android to show the XML layout of main.</p><p>But what if I have in the activity code defined integer variable and I want this integer variable also be shown on the display? </p><p>How do I PUSH the integer variable to the XML??? From main XML reference to other strings in XML is easy - @string/app_name ... but how do I use the integer variable from the activity?</p>","344344","","212218","","2012-08-23 00:36:32","2012-08-23 00:36:32","How to show integer from activity in XML?","<xml><android><integer>","2","0","","",""
"2860157","1","3093966","","2010-05-18 18:56:33","25","26939","<p>I'm going crazy, I created a file object, so it can be read with ObjectInputStream, and I placed the assets folder.The method works with a file smaller than 1M, and give error with larger files.I read that is a limit of Android platform, but I also know that can be ""easily"" avoided.Those who have downloaded the game Reging Thunder, for example, can easily see that in their assets folder is a file 18.9M large.This is my code for read 1 object from a ObjecInputStream</p><pre><code>File f = File.createTempFile(""mytempfile"", ""dat"");FileOutputStream fos = new FileOutputStream(f);InputStream is = mc.getAssets().open(path,3);ObjectInputStream ois=new ObjectInputStream(is);byte[] data = (byte[]) ois.readObject();fos.write(data);fos.flush();fos.close();ois.close();is.close();</code></pre><p>now I have an uncompressed file and I can use it without worrying about the error ""This file can not be opened as a file descriptor; it is probably compressed""</p><p>This function works well with files smaller than 1M, with bigger files return an java.io.IOException on line ""ObjectInputStream ois=new ObjectInputStream(is);""</p><p>why??</p>","411786","","","","","2014-02-08 16:05:29","Load files bigger than 1M from assets folder","<android><load><inputstream><assets><objectinputstream>","10","0","29","",""
"2860460","1","","","2010-05-18 19:33:36","2","2881","<p>I need to set a background image for an android button (text button), but I want to keep the gray button.  When i use the setBackgroundResource() it has the image in place of the gray button.  How can I keep the gray button?</p><p>I tried using setCompoundDrawablesWithIntrinsicBounds, but the image only takes up part of the button, even when I have no text.</p><p>Notes: I will not have text while I display the image, but the button needs to be a TextButton because there will be text without images at times, and images with text at others.</p>","344414","","244296","","2010-05-18 19:42:37","2010-05-19 00:14:59","How to set background image for Android button but keep the gray button?","<android><button><background>","1","2","0","",""
"2860771","1","2863551","","2010-05-18 20:13:02","1","8011","<p>i have 2 questions about widgets update</p><ul><li>I have 2 buttons and i need to change one button text when i press the other one, how can i do this?</li><li><p>The first time i open the widget it calls the onUpdate method, but it never calls it again. I need to update the widget every 2 seconds and i have this line in the xml. </p><p>android:updatePeriodMillis=""2000""</p></li></ul><p>Do i need a service or should it works just with the updatePeriodMillis tag?</p><ul><li><p>onUpdate method</p><pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget);Intent intent = new Intent(context, DetalleConsulta.class);intent.putExtra(DetalleConsulta.CONSULTA_ID_NAME, ""3"");PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);views.setOnClickPendingIntent(R.id.btNews, pendingIntent);/* Inicializa variables para llamar el controlador */this.imei = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();this.controlador = new Controlador(this.imei);try {    this.respuestas = this.controlador.recuperarNuevasRespuestas();<pre><code>if(this.respuestas != null &amp;amp;&amp;amp; this.respuestas.size() &amp;gt; 0){    Iterator&amp;lt;Consulta&amp;gt; iterRespuestas = this.respuestas.iterator();    views.setTextViewText(R.id.btNews, ((Consulta)iterRespuestas.next()).getRespuesta());}</code></pre>} catch (PersistenciaException e) {    //TODO manejar error}appWidgetManager.updateAppWidget(appWidgetIds, views);</code></pre></li></ul><p>thx a lot!!!</p>","269671","","269671","","2010-05-19 03:15:42","2013-06-05 18:21:25","Android - update widget text","<android><widget>","2","4","","",""
"2861109","1","2861131","","2010-05-18 20:56:15","2","3034","<p>I have an android app where I am doing the following:</p><pre><code>private void onCreate() {    final ProgressDialog dialog = ProgressDialog.show(this, ""Please wait.."", ""Doing stuff.."", true);    new Thread() {        public void run() {            //do some serious stuff...            dialog.dismiss();                   }    }.start();     stepTwo();}</code></pre><p>And I would like to ensure that my thread is complete before stepTwo(); is called. How can I do this?</p><p>Thanks!</p>","314994","","4893","","2010-05-18 21:03:58","2010-05-19 12:58:59","Wait for inline thread to complete before moving to next method","<java><android><multithreading>","3","0","","",""
"2861544","1","2861558","","2010-05-18 22:18:26","0","3589","<p>I am exploring android and developement and I found one problem.</p><p>My app UI is defined in main.xml</p><p>I have 2 texts and 2 buttons defined - easy app.</p><p>I read that I may be able to change TEXT in the ACTIVITY using the setText() method.</p><p>And thats the problem - how do I POINT the setText() Method? How do I tell it to change a specified text?</p><p>If I would declare the TextView inside the Activity with NEW TextView NAME Object, I would just need to use NAME.setText(STRING)... But I didnt so i dont have anything like NAME of the object?</p><p>How can this be done?</p>","344344","","212218","","2012-08-23 00:35:50","2012-08-23 00:35:50","TextView defined in main.xml - how to ""name"" it to be able to use - setText() method?","<xml><android><textview><settext>","1","2","","",""
"2862067","1","","","2010-05-19 00:18:51","0","781","<p>I am almost done with my project in android, now I want to make the executable version of the application.</p><p>I need to demonstrate it in .exe form as soft app as on emulator, not by built and debug process from eclipse.</p><p>need immediate idea</p>","257580","","","","","2011-09-02 07:07:47","How to make .EXE for demonstration of a Android Software built in eclipse?","<android><eclipse><exe>","1","3","","",""
"2862212","1","","","2010-05-19 01:03:21","1","785","<p>I am using a ListView with an ArrayAdapter that holds objects. When I select an item, I am capturing the position and index of the selected item. If I scroll down prior to selection, the position and index represent the location of the item in the list. Selecting that items takes me to another activity. When I use the back button to return to the list, it seems that the ListView gets a new position and index for the visible items. </p><p>As a result, I can't figure out how to reference the selected item during the restart() of the ListView Activity. I have tried to capture position and index, but as I've said, they change upon returning to the Activity.</p><p>Is my understanding of the ListView ""redraw"" correct? Does it renumber my items based on what's visible? -When in the life cycle is getView() called? Is there a way to force an update to the ListView so that my captured index still points to the same object?</p><p>Thanks,Jason</p>","312176","","82118","","2010-07-22 20:51:14","2010-07-22 20:51:14","ListView - Index and Position Behavior upon restart()","<android><listview><position>","1","0","","",""
"2862350","1","","","2010-05-19 01:47:42","0","415","<p>who knows about the method ""add"" in menu interface? how to implement exactly? which is it's imlementation class? i couldn't find detail implementation in source code of sdk. i want to check how to implement in android source code for ""add"" method.</p><p>e.g.</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {    menu.***add***(0, MENU_NEW_GAME, 0, ""New Game"");    menu.add(0, MENU_QUIT, 0, ""Quit"");    return true;}</code></pre><p>thanks in advance!</p>","343809","","2405","","2010-05-19 01:48:54","2010-05-19 02:46:53","android dev: how to implement for add method in menu interface?","<android>","1","0","","",""
"2862528","1","","","2010-05-19 02:44:33","41","42113","<p>I want to hide the app title bar.</p>","330210","","244296","","2011-03-01 19:38:57","2013-12-05 10:36:12","How to hide app title in android?","<android>","3","0","23","2013-07-24 12:29:48",""
"2862613","1","","","2010-05-19 03:14:39","2","1793","<p>In would like to write a simple Android application that takes a picture from the camera and uploads it to a webserver. Additionaly, I would like it to print in the screen the response from the server wich is a simple text string.</p><p>Do you know if there is any sample code that does something like that?</p><p>Thank you,Michael</p>","344686","","","","","2010-05-19 06:22:18","Sample code for image upload","<android>","1","0","1","",""
"2862629","1","3566637","","2010-05-19 03:21:09","5","4869","<p>I have been working on a replacement for the stock Car Home app for a bit, and I am completely stumped on how to override the Home button so that my app will be brought back to the foreground whenever the phone is docked. This is the way that Car Home works, so there must be a way.</p><p>It seems that BroadcastReceivers won't work, because the intent that is broadcast whenever the Home button is pressed will still cause the default homescreen app to launch; I cannot prevent it. I can override the Home button from within my app, but that does me no good since this needs to work when the user is outside my app. Car Home also does not do anything weird like set itself as the default homescreen app while it's running (I checked the logcat to make sure).</p><p>I've been really beating my head against the wall on this. Does anyone have any ideas, or can you at least point me in the right direction?</p>","316836","","313758","","2011-04-01 07:03:20","2012-01-23 10:56:55","Overriding Home button for a Car Home replacement app","<android><dock><home>","4","0","6","",""
"2862662","1","2871035","","2010-05-19 03:30:40","5","3403","<p>I'm using the following code to simulate tabs and since there are more tabs that width can accommodate user can scroll left or right to make a tab button visible. It all works, however I also provide user with ability to fling between tabs by swiping finger left or right on the tab contents. Again - it works. But when I fling to the rightmost tab its corresponding button is barely visible. I want to autoscroll table inside the <code>HorizontalScrollView</code> so the selected tab button will be visible but when I execute <code>HorizontalScrollView.smoothScrollTo(300, 0)</code> nothing happens. It doen't matter how high I set first <code>x</code> parameter nothing will ever move (yes I do have an algorithm to calculate exact position). </p><p>Here's XML code for scrolling tab buttons</p><pre><code>&lt;HorizontalScrollView android:layout_width=""fill_parent""    android:background=""@color/tabs_header"" android:layout_height=""55dip""    android:scrollbars=""none"" android:id=""@+id/tabsButtonView""&gt;    &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""fill_parent"" android:layout_weight=""1""            android:layout_height=""0dip"" android:paddingTop=""5dip"" android:paddingLeft=""3dip""&gt;            &lt;ImageButton android:src=""@drawable/linkup_logo_small"" android:id=""@+id/tabBtt0""                android:layout_width=""wrap_content"" android:layout_marginLeft=""2dip"" android:layout_marginRight=""2dip""                android:layout_height=""fill_parent"" android:padding=""5dip"" android:background=""@drawable/tab_selected""&gt;&lt;/ImageButton&gt;            &lt;ImageButton android:src=""@drawable/simplyhired_small"" android:id=""@+id/tabBtt1""                android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:layout_marginLeft=""2dip""                android:layout_marginRight=""2dip"" android:padding=""5dip"" android:background=""@drawable/tab_normal""&gt;&lt;/ImageButton&gt;            &lt;ImageButton android:src=""@drawable/indeedcom_small"" android:id=""@+id/tabBtt2""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""5dip""                android:layout_marginLeft=""2dip"" android:layout_marginRight=""2dip"" android:background=""@drawable/tab_normal""&gt;&lt;/ImageButton&gt;            &lt;ImageButton android:src=""@drawable/careerbuilder_logo_small"" android:id=""@+id/tabBtt3""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""5dip""                android:layout_marginLeft=""2dip"" android:layout_marginRight=""2dip"" android:background=""@drawable/tab_normal""&gt;&lt;/ImageButton&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/HorizontalScrollView&gt;</code></pre>","135946","","135946","","2010-05-19 15:32:24","2011-09-02 03:22:43","Android: Autoscrolling HorizontalScrollView","<android><autoscroll><horizontalscrollview>","2","1","1","",""
"2863015","1","5763820","","2010-05-19 05:13:05","0","1176","<p>In my android app I set</p><p>this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                 WindowManager.LayoutParams.FLAG_FULLSCREEN );Then my touch screen event doesnt’ work any more.</p><p>Further Explaining,</p><p>I have a button and onClick it changes the contentView by setContentView(R.layout.choose_player);.It works fine. But if you take the focus to the button by the trackball(making it yellow) and tap on it, it gives the exception.</p><p>java.lang.IllegalArgumentException: parameter must be a descendant of this view</p><pre><code>public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   requestWindowFeature(Window.FEATURE_NO_TITLE);       this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                           WindowManager.LayoutParams.FLAG_FULLSCREEN);           setContentView(R.layout.main1);    } public void onClick(View v) {      setContentView(R.layout.main2); }</code></pre>","274107","","102937","","2013-02-20 20:16:50","2013-02-20 20:16:50","setContentView gives an exception","<android><exception><focus><state>","2","0","","",""
"2863127","1","2865004","","2010-05-19 05:40:27","1","650","<p>Tracking events and setting up Analytics for Websites seems easy. You create an account with one of the Analytics service providers like Google. They give you javascript code that you embed in your pages (whichever event you wish to track) and voila..you're done. </p><p>I have written a native application for Android phones, which is actually an adaptation of the actual web site. Now, I am required to setup Analytics and tracking for this native application. </p><p>Question:  </p><ol><li><p>How to do setup a native application for Analytics?   </p></li><li><p>We have Java Script code(not Google Analytics but for some other engine) that works for the original web site. Is there a way to incorporate that in the native application?  </p></li><li><p>I know Android supports Java Script via WebViews(Webkit);my application does not have webviews, it is native! </p></li></ol><p>I have not worked on JavaScript since school so excuse me if I sound naive. </p><p>Thanks.</p>","236128","","236128","","2010-05-19 05:45:40","2010-08-18 20:38:00","Setting up Android application for Analytics and tracking","<javascript><android><analytics>","2","0","1","",""
"2863193","1","","","2010-05-19 05:58:19","0","663","<p>Where can I get code to generate a calendar which displays dates in a proper grid?Or can I get code for a calendar app so that I can make a few changes to it? It will help ma save a lot of time.</p>","344768","","26428","","2010-07-18 03:56:52","2010-07-18 03:56:52","calendar code required","<android>","1","1","","",""
"2863383","1","","","2010-05-19 06:43:03","0","677","<p>I want to know is there any way to store an incoming/Outgoing voice call in android.</p>","138030","","1069068","","2013-03-19 14:36:11","2013-03-19 14:36:11","How To Store Incoming Call in Android","<android>","1","0","","",""
"2863564","1","2870403","","2010-05-19 07:23:29","1","8773","<p>Im having a problem regarding installing ADT plugin on Eclipse.the error prompt was</p><p>An error occurred while collecting items to be installed  session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Collect, operand=, action=).</p><p>Unable to read repository at <a href=""http://download.eclipse.org/releases/galileo/201002260900/aggregate/plugins/org.eclipse.emf.common_2.5.0.v200906151043.jar.pack.gz"" rel=""nofollow"">http://download.eclipse.org/releases/galileo/201002260900/aggregate/plugins/org.eclipse.emf.common_2.5.0.v200906151043.jar.pack.gz</a>....</p><p>The server download.eclipse.org failed to respond</p><hr><p>Is there any other location where i can download ADT for eclipse?</p><p>thanks</p>","326474","","","","","2012-07-17 13:46:50","Im unable to install ADT on Eclipse 3.5","<android><eclipse-plugin>","7","0","","",""
"2863827","1","2865276","","2010-05-19 08:14:33","13","8152","<p>in arrays.xml</p><pre><code>&lt;string-array name=""my_items""&gt;  &lt;item&gt;My item 1&lt;/item&gt;  &lt;item&gt;My item 2&lt;/item&gt;  &lt;item&gt;My item 3&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>in strings.xml</p><pre><code>&lt;resources&gt;  &lt;string name=""item1""&gt;My item 1&lt;/string&gt;  &lt;string name=""item2""&gt;My item 2&lt;/string&gt;  &lt;string name=""item3""&gt;My item 3&lt;/string&gt;&lt;/resources&gt;</code></pre><p>I would like to reference the string in the array ""My item 1"" from strings.xml.  How do I do that?</p>","248521","","","","","2012-07-31 20:48:03","Referencing an XML string in an XML Array (Android)","<android>","2","0","3","",""
"2863943","1","","","2010-05-19 08:33:58","0","820","<p>In my android app I set</p><pre><code>this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                 WindowManager.LayoutParams.FLAG_FULLSCREEN );</code></pre><p>Then my touch screen event doesnt’ work any more.</p><p>Further Explaining,I have a button and onClick it changes the contentView by <code>setContentView(R.layout.choose_player);</code>. It works fine. But if you take the focus to the button by the trackball(making it yellow) and tap on it, it gives the exception.</p><blockquote>  <p>java.lang.IllegalArgumentException: parameter must be a descendant of this view</p></blockquote>","274107","","102937","","2013-02-20 20:20:46","2013-02-20 20:20:46","Android full Screen flag gives an exception","<android><fullscreen><state>","1","2","","",""
"2863971","1","","","2010-05-19 08:42:21","0","2112","<p>What do we need to change in the android source code to get the resolution of 1360x768 working in an emulator?</p><p>The following changes let me start an emulator 1280x720</p><pre><code>project bionic/diff --git a/libc/kernel/arch-arm/asm/memory.h b/libc/kernel/arch-arm/asm/memory.hindex c1137a7..743b6ef 100644--- a/libc/kernel/arch-arm/asm/memory.h+++ b/libc/kernel/arch-arm/asm/memory.h@@ -46,7 +46,7 @@ #define MODULE_START (PHYS_OFFSET) #ifndef CONSISTENT_DMA_SIZE-#define CONSISTENT_DMA_SIZE SZ_2M+#define CONSISTENT_DMA_SIZE SZ_8M #endif #ifndef __virt_to_physproject external/kernel-headers/diff --git a/original/asm-arm/memory.h b/original/asm-arm/memory.hindex 91d536c..fcec3b1 100644--- a/original/asm-arm/memory.h+++ b/original/asm-arm/memory.h@@ -114,7 +114,7 @@  * between 2MB and 14MB inclusive.  */ #ifndef CONSISTENT_DMA_SIZE-#define CONSISTENT_DMA_SIZE SZ_2M+#define CONSISTENT_DMA_SIZE SZ_8M #endif /*diff --git a/original/linux/mmzone.h b/original/linux/mmzone.hindex f45163c..043a812 100644--- a/original/linux/mmzone.h+++ b/original/linux/mmzone.h@@ -18,7 +18,7 @@ /* Free memory management - zoned buddy allocator.  */ #ifndef CONFIG_FORCE_MAX_ZONEORDER-#define MAX_ORDER 11+#define MAX_ORDER 12 #else #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER #endifproject external/qemu/diff --git a/vl.c b/vl.cindex 3242c23..154f44f 100644--- a/vl.c+++ b/vl.c@@ -181,7 +181,7 @@ int main(int argc, char **argv) #  define LOG_IOPORT(...) do { } while (0) #endif-#define DEFAULT_RAM_SIZE 128+#define DEFAULT_RAM_SIZE 512 /* Max number of USB devices that can be specified on the commandline.  */ #define MAX_USB_CMDLINE 8</code></pre>","344859","","15416","","2010-05-19 09:19:36","2011-03-26 10:36:24","Android Emulator Screen Size","<android><android-emulator>","2","0","1","",""
"2864016","1","","","2010-05-19 08:50:46","2","14653","<p>I have some troubles with ssl using httpclient on android i am trying to access self signed certificate in details i want my app to trust all certificates ( i will use ssl only for data encryption). First i tried using this guide <a href=""http://hc.apache.org/httpclient-3.x/sslguide.html"" rel=""nofollow"">http://hc.apache.org/httpclient-3.x/sslguide.html</a> on Desktop is working fine but on android i still got javax.net.ssl.SSLException: Not trusted server certificate. After searching in google i found some other examples how to enable ssl.</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/62d856cdcfa9f16e"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/62d856cdcfa9f16e</a> - Working when i use URLConnection but with HttpClient still got the exception.</p><p><a href=""http://www.discursive.com/books/cjcook/reference/http-webdav-sect-self-signed.html"" rel=""nofollow"">http://www.discursive.com/books/cjcook/reference/http-webdav-sect-self-signed.html</a> - on Desktop using jars from apache is working but in android using included in SDK classes can't make it work.</p><p><a href=""http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/200808.mbox/%3C1218824624.6561.14.camel@ubuntu%3E"" rel=""nofollow"">http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/200808.mbox/%3C1218824624.6561.14.camel@ubuntu%3E</a> - also get the same exception</p><p>So any ideas how can i trust all certificates on android using HttpClient</p>","184601","","184601","","2010-05-19 10:07:53","2011-06-16 21:40:00","httpclient ssl certificate on android","<android><ssl><certificate><httpclient>","3","0","6","",""
"2864043","1","","","2010-05-19 08:53:57","2","162","<p>Im trying to prepare a set of guidelines and project template for my future Android projects. Im already implementing the basic MVC architecture modularity. Im trying to have add more advanced level of design to my Android projects to make my development easier and maintainable.</p><p>For example can someone suggest me a way to make Intent calls to Activity without explicitly mentioning the class while creating the Intent. Im trying to loose couple the intent calls and hopefully use AndroidManifest to assign action to an activity which then can be called globally within the application.</p><p>Any other type of suggestions are welcome. </p><p>Also please suggest any kind of coding conventions that you might be using yourself.</p>","237403","","","","","2010-05-19 10:54:06","Suggestions for Android project guidlines","<android><guidelines><coding-style>","1","0","","",""
"2864271","1","2864367","","2010-05-19 09:31:35","3","6090","<p>i am beginner in Android app development i am working on a app which lists the videos and images  and uploads them from android phone to the windows server,   </p><p>Button Listvideo = (Button) findViewById(R.id.Listvideo);        Listvideo.setOnClickListener(this);</p><p>help me out  with the listing images and videos........................</p>","164850","","","","","2010-05-19 10:12:18","How to access gallery -> Camera Media videos and display it in List on button Click?","<android><list><video><image>","2","0","4","",""
"2864331","1","2864490","","2010-05-19 09:40:28","8","15661","<p>I have a layout which specifies sizes of widgets in relative dimension, for example:</p><pre><code>&lt;LinearLayout ... layout_height=""fill_parent""&gt;     &lt;ImageView ... layout_height=""wrap_content"" /&gt;     &lt;TextView ... layout_height=""120dp"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Immediately after <code>onCreate</code>, I want to know how much is the height of the ImageView. How to do that?</p><p><strong>Note:</strong> If I call <code>getHeight()</code> in <code>onCreate</code>, I get 0.</p><p>I have also tried <code>imageView.postDelayed</code>, it works on 2.1 emulator but fails on 1.5 emulator (I got 0, too).</p><p>Finally, I tried to create a <code>Handler</code>, and then I call <code>handler.postDelayed</code> with 10 ms delay. It works in both 2.1 and 1.5 emulator, but failed when I start the program in eclipse debugger (So, I conclude that using the delay doesn't guarantee that the getting of the height happens after the imageview is layout-ted.)</p>","11238","","","","","2013-01-16 17:45:21","How to get an Android widget's size after layout is calculated?","<android><layout><handler><android-linearlayout><postdelayed>","2","0","1","",""
"2864488","1","","","2010-05-19 10:04:19","3","3334","<p>How do i pause frame animation using AnimationDrawable?</p>","226946","","","","","2011-10-20 19:04:43","How do i pause frame animation using AnimationDrawable?","<android><animation><frame>","2","0","2","2012-11-14 05:02:50",""
"2864489","1","","","2010-05-19 10:04:23","2","2304","<p>Is there anyway to get the base station and/or cellId information of the subscriber in Android?</p>","344931","","","","","2010-05-19 10:06:57","Getting Base Station Information in Android","<android><geolocation><locationmanager><cellid>","1","0","","",""
"2864563","1","2866239","","2010-05-19 10:16:31","4","6300","<p>I have a scrollview and I only want an event to happen if it's already scrolled to the bottom but I can't find a way to check if the scrollview is at the bottom.</p><p>I have solved it for the opposite; only allow the event to happen if it's already scrolled to the top:</p><pre><code>ScrollView sv = (ScrollView) findViewById(R.id.Scroll);    if(sv.getScrollY() == 0) {        //do something    }    else {        //do nothing    }</code></pre>","331293","","","","","2014-01-17 08:48:39","How do I know that the scrollview is already scrolled to the bottom?","<android><scrollview>","4","0","4","",""
"2864873","1","2957372","","2010-05-19 11:01:51","1","777","<p>I'm creating 3GP videos with the Android - however, when the 3GP files are posted on a site, the same Android phone cannot view it back. (The file works on the iPhone).</p><p>What is right way to encode/resize the 3GP video so that the video player on Android can play it back?</p><p>Thanks</p>","219111","","","","","2011-06-13 09:49:58","How to convert 3GP video for Android to view?","<android><mencoder>","3","2","","",""
"2864918","1","2865360","","2010-05-19 11:09:56","0","772","<p>I want to merge a sound file and a video file (remove the sound from the video file and replace it with my own sound) and this should happen on the phone. I have done this through ffmpeg, but I can't do that now.</p><p>Any help appreciated,10x,Danail</p>","232798","","","","","2010-05-19 12:19:53","Android: Processing video and sound on phone","<android><video><audio>","1","1","1","",""
"2864995","1","2865905","","2010-05-19 11:23:50","-2","1494","<p>i am using a web service. i have to start that particular service at every 6 hrs interval, automatically . i want to perform this task with alarm manager. but i have no idea.</p>","304961","","356440","","2013-01-03 09:34:57","2013-01-03 09:34:57","how can we call webservice through background service","<android>","2","0","1","2013-01-03 12:13:01",""
"2865154","1","2867260","","2010-05-19 11:51:31","2","4061","<p>I'm using the android.location.Geocoder for the first time. The Idea is: I have a Listener on a button which takes input from an EditText and resolve the location. Up to now it's debugging phase, so I have no handler taking messages from the thread, only geocoding and write to logcat.Q: Why this method always returns an empty list of Address objects?</p><pre><code>private View.OnClickListener checkLocation = new View.OnClickListener() {           @Override    public void onClick(View v) {        location = ((EditText)findViewById(R.id.getLocation)).getText().toString();        Thread thr = new Thread(){            public void run (){                Log.d(""Looking for"", location);                Geocoder gc = new Geocoder(ctx,Locale.ITALY);                try {                    fa= gc.getFromLocationName(location, 3);                    if (fa.isEmpty())Log.d(""getFromLocationName"", ""NothingFound"");                    else                    {                        int size= fa.size();                        for (int i = 0; i&lt;size ;i++)                            Log.d(""getFromLocationName.at(""+ String.valueOf(i) +"")"", fa.get(i).getAddressLine(0)+"", ""+fa.get(0).getAddressLine(1));                    }                } catch (IOException e) {                    Log.e(""IOException"", e.getMessage());                }            }        };        thr.start();    }};</code></pre><p>manifest:</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.ACCESS_COARSE_LOCATION"" /&gt;</code></pre><p>Somebody knows why? (btw I am using 1.6 sdk) Input tried</p>","201058","","","","","2010-10-21 15:37:42","why Geocoder.getFromLocationName(...) returns an empty list?","<android><geolocation>","2","0","","",""
"2865238","1","","","2010-05-19 12:02:32","1","2645","<p>i have two files</p><p>App.java</p><p>Gallery.java</p><p>App. java contains  frontend buttons and functionalitiesGallery.java lists the imagesin the sd card</p><p>i want to call Gallery.java in  click event in app.java</p><p><strong>App.java</strong></p><p>package gallery.display;</p><p>import android.app.Activity;import android.os.Bundle;import android.view.View.OnClickListener;import android.view.View;import android.widget.Button;import android.widget.Toast;import android.app.AlertDialog;import android.content.DialogInterface;import android.app.ProgressDialog;</p><p>public class App extends Activity implements OnClickListener {</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); // set a click listener on the yesno button    Button Delete = (Button) findViewById(R.id.Delete);    Delete.setOnClickListener(this);    // set a click listener on the Upload button    Button Upload = (Button) findViewById(R.id.Upload);    Upload.setOnClickListener(this);    Button Listvideo = (Button) findViewById(R.id.Listvideo);    Listvideo.setOnClickListener(this);}public void onClick(View view) {    // which button is clicked?    // the Toast button    // the delete button is clicked    if (view == findViewById(R.id.Delete)) {        // prepare the alert box        AlertDialog.Builder alertbox = new AlertDialog.Builder(this);        // set the message to display        alertbox.setMessage(""Do u  want to Delete!"");        // set a positive/yes button and create a listener        alertbox.setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {            // do something when the button is clicked            public void onClick(DialogInterface arg0, int arg1) {                Toast.makeText(getApplicationContext(), ""'Yes' button clicked"", Toast.LENGTH_SHORT).show();            }        });        // set a negative/no button and create a listener        alertbox.setNegativeButton(""No"", new DialogInterface.OnClickListener() {            // do something when the button is clicked            public void onClick(DialogInterface arg0, int arg1) {                Toast.makeText(getApplicationContext(), ""'No' button clicked"", Toast.LENGTH_SHORT).show();            }        });        // display box        alertbox.show();    }    // the delete button is clicked    // the delete button is clicked    if (view == findViewById(R.id.Upload)) {          ProgressDialog dialog = new ProgressDialog(this);          // make the progress bar cancelable          dialog.setCancelable(true);          // set a message text          dialog.setMessage(""Uploading the video..."");          // show it          dialog.show();    }    if (view == findViewById(R.id.Listvideo)) {  }}</code></pre><p>}</p>","164850","","","","","2010-05-19 12:22:30","how do i call a java file on click in another java class?","<android><class>","1","1","","",""
"2865402","1","","","2010-05-19 12:24:01","0","537","<p>I am using <strong>Unicode</strong> at the place of <strong>ASCII</strong> in Soft keyboard application,bt i found some code like :</p><p>? - &#x2191; (up arrow) ? - &#x2193; (down arrow) ? - &#x2190; (left arrow) ? - &#x2192; (right arrow) ? - &#x21B5; (down-left arrow) ? - &#x21A8; (up-down arrow with bottom line) ...and may be more</p><p>have problem,showing Rectangular/space.Any one have list of Supported Unicode Char list for Android.</p><p><strong>Thank in Advance</strong></p>","2624806","","21234","","2010-05-19 12:32:40","2012-04-30 06:24:06","Unicode problem with Android","<android><softkeys>","1","2","","",""
"2865452","1","2865947","","2010-05-19 12:30:57","34","16724","<p>Given the following HTML:</p><p><code>&lt;p&gt;This is text and this is an image &lt;img src=""http://www.example.com/image.jpg"" /&gt;.&lt;/p&gt;</code></p><p>Is it possible to make the image render? When using this snippet: <code>mContentText.setText(Html.fromHtml(text));</code>, I get a cyan box with black borders, leading me to believe that a TextView has some idea of what an img tag is.</p>","184844","","","","","2014-03-10 11:25:49","Is it possible to display inline images from html in an Android TextView?","<android><image><textview>","6","1","22","",""
"2865486","1","","","2010-05-19 12:35:07","1","939","<p>Is there any way to synchronize the capturing and playback of audio data in Android?</p><p>I need to do some signal processing (echo cancellation, etc.) that needs synchronization at sample level.</p><p>I.e. everey time the hardware captures an audio frame, I need the corresponding frame that was played through the speaker with high accuracy.</p><p>Any help or hint is really appreciated. Thanks in advance.</p><p>-flesym</p>","345041","","","","","2011-08-19 17:19:01","How to synchronize AudioRecord and AudioTrack","<android><audio><synchronization>","1","0","1","",""
"2865497","1","2865558","","2010-05-19 12:36:33","24","16475","<p>Hi heres a part from my XML for LAND format:</p><pre><code>&lt;TableLayout    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center""    android:stretchColumns=""*""&gt;&lt;TableRow&gt;        &lt;Button        android:id=""@+id/countbutton""        android:text=""@string/plus1""/&gt;          &lt;Button        android:id=""@+id/resetbutton""        android:text=""@string/reset""         /&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>And now what I dont get - the WIDTH of one row and also of the button depends on the TEXT inside the button. If the both texts are equaly long lets say : TEXT its ok - the table half is in the middle of the screen. But if they have different size - lets say ""A"" and ""THIS IS THE LONG BUTTON"" the CENTER of the table isnt in the middle of the screen anymore and so the buttons are not equally width...</p>","344344","","212218","","2012-08-23 00:27:17","2014-04-18 21:07:19","XML Table layout? Two EQUAL-width rows filled with equally width buttons?","<xml><android><table><width>","4","0","4","",""
"2865577","1","","","2010-05-19 12:48:50","14","14241","<p>I am getting an error in my Problems tab for my Android Project in Eclipse.  The error is ""<strong>Android Packaging Problem</strong>"" with an Unknown location.   </p><p><strong>Unknown Error NullPointerException</strong></p><p>I cannot determine what this problem is.  My project was working a few hours ago.  The only change I made was to add a <strong><em>public interface ITrackDao</em></strong>  to my project and implement it.  There are no errors associated with this.</p><p>I am not even sure where to begin to look.  I cannot launch the application.  Can someone give me an idea on what area I can look into?ThanksPeter</p>","99863","","","","","2013-06-23 15:46:10","Android Eclipse Error ""Android Packaging Problem""","<android>","8","0","1","",""
"2865683","1","","","2010-05-19 13:02:13","31","14028","<p>How can I turn off the orange highlight when clicking an item in a GridView?</p><p>I haven't been able to find a solution in the documentation or through testing.</p>","339110","","2715","","2011-12-22 02:02:39","2013-05-08 08:37:31","Android: Disable highlighting in GridView","<android><gridview><click><highlighting>","5","1","13","",""
"2865699","1","2866149","","2010-05-19 13:03:57","1","1645","<p>In android mobile we have an default application Market, under submenu there is functionality called all applications. In this, first it shows only ten records in which it will display defalut image and text, then in back ground it will update images. When we scroll down (i.e., end of list) and it shows loading and then it loads next 10, images will load lazily.</p><p>How to acheive this senario.</p><p>Thanks in Adavance</p><p>Jayanth</p>","320276","","","","","2012-04-10 06:56:18","View Stub(Pagination) and Lazy loading of Images in android","<android><listview><image><pagination><viewstub>","2","0","","",""
"2865973","1","","","2010-05-19 13:39:09","0","686","<p>I have this code in android. But when the Thread begging the loading in freezing. How I can prevent the freezing. here the code: </p><p>private void reload(final String criteria) {        try {myProgressDialog = ProgressDialog.show(myfiles.this,     ""Please wait..."", ""Loading Your Photos... Please Wait"",     false);</p><p>new Thread() {    public void run() {     try {</p><pre><code>  Thread.sleep(2000); } catch (Exception e) { } runOnUiThread(new Runnable() {  @Override  public void run() {   // Fetch the fact   try {    /* here my code  */   } catch (Exception e) {    myProgressDialog.dismiss();    // TODO Auto-generated catch block    e.printStackTrace();   }  } }); // Dismiss the Dialog myProgressDialog.dismiss();}</code></pre><p>}.start();} catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }</p><pre><code>}</code></pre>","345099","","345099","","2010-05-19 14:03:40","2010-05-19 14:03:40","Android Loading Dialog Freez","<android>","1","0","","",""
"2866014","1","2867634","","2010-05-19 13:44:38","0","1297","<p>I have a custom Dialog in my app and I have a problem achieving the desired behavior. My Dialog has 4 Buttons. (Back, Valid, Modify and Restore). When the user clicks on Modify or Valid I would like to call another activity. So I am using Intent but it's crashing.</p><p>The error Log : </p><blockquote>  <p>05-19 13:29:21.495:  ERROR/DEBUGTAG(974):  java.lang.NullPointerException 05-19  13:29:21.495: ERROR/DEBUGTAG(974):<br>  at  android.content.ComponentName.(ComponentName.java:75)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.content.Intent.(Intent.java:2551)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.booztermobile.activity.HeaderMailDisplayActivity.onClick(HeaderMailDisplayActivity.java:571)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.View.performClick(View.java:2364)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.View.onTouchEvent(View.java:4179)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.widget.TextView.onTouchEvent(TextView.java:6540)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.View.dispatchTouchEvent(View.java:3709)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.app.Dialog.dispatchTouchEvent(Dialog.java:643)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.view.ViewRoot.handleMessage(ViewRoot.java:1691)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.os.Handler.dispatchMessage(Handler.java:99)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.os.Looper.loop(Looper.java:123)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  android.app.ActivityThread.main(ActivityThread.java:4363)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  java.lang.reflect.Method.invokeNative(Native  Method) 05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  java.lang.reflect.Method.invoke(Method.java:521)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  05-19 13:29:21.495:  ERROR/DEBUGTAG(974):     at  dalvik.system.NativeStart.main(Native  Method)</p></blockquote><p>My custom Dialog : </p><pre><code>package com.android.booztermobile.services;import com.android.booztermobile.R;import android.app.Dialog;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.widget.Button;public class MailDialog extends Dialog {    private Button btnValid;    private Button btnBack;    private Button btnRestore;    private Button btnModify;    private Context context;    public MailDialog(Context cont) {        super(cont);        context = cont;        }    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(""TestApp"", ""Dialog created"");            setContentView(R.layout.dialog_classement);                 btnValid = (Button) findViewById(R.id.btnValidClassement);            btnBack = (Button) findViewById(R.id.btnBackClassement);                btnRestore = (Button) findViewById(R.id.btnRestoreClassement);            btnModify = (Button) findViewById(R.id.btnModifyClassement);    }}</code></pre><p>and the activity (cut because too long):</p><pre><code>        //create dialog public void getMailInformations(View v, Context context){  currentMail = (MailHeader) v.getTag();  dial = new MailDialog(context);  dial.setTitle(""Classement"");  dial.show();  btnValidClassement = (Button) dial.findViewById(R.id.btnValidClassement);  btnValidClassement.setOnClickListener(this); }</code></pre><p>/** the Onclick : */</p><pre><code>    public void onClick(View view) {//THIS WORKS (Activity Button)    if (view == lblPreviousMails) {            positionList -= 20;            // create Intent            Intent defineIntentDisplayPreviousMails = new Intent(HeaderMailDisplayActivity.this, HeaderMailDisplayActivity.class);            //Create bundle to pass informations to the other activity            Bundle objetbundle = new Bundle();            objetbundle.putString(""positionList"", String.valueOf(positionList));            objetbundle.putStringArrayList(""currentMails"", seqnumList);            objetbundle.putString(""uidh"", uidh);            defineIntentDisplayPreviousMails.putExtras(objetbundle);            // call headermailDisplayActivity            HeaderMailDisplayActivity.this.startActivity(defineIntentDisplayPreviousMails);        }//THIS DOESN'T WORKS (Dialog Button)    if(view == btnValidClassement){   try{    ClassementHandlerCall classement = new               ClassementHandlerCall();       boolean mailClassify = classement.classifyMail(AuthentificationActivity.uidh,          String.valueOf(currentMail.getSeqnum()), null, null);       dial.dismiss();       if (mailClassify == true){                //create Intent                 Intent defineIntentClassifyMails = new Intent(MailClassificationActivity.this, HeaderMailDisplayActivity.class);                // Object that allows to pass person's uidh and positionList onto HeaderMailDisplayActivity                Bundle objetbundle = new Bundle();                objetbundle.putString(""uidh"",uidh);                objetbundle.putString(""positionList"", String.valueOf(positionList));                defineIntentClassifyMails.putExtras(objetbundle);                // call HeaderMailDisplayActivity                 MailClassificationActivity.this.startActivity(defineIntentClassifyMails);       }   }catch(Exception e){    // TODO Auto-generated catch block    Log.e(""DEBUGTAG"",""Error occured"", e);    e.printStackTrace();   }  }}</code></pre>","335500","","232328","","2011-12-09 19:18:54","2011-12-09 19:18:54","Issue with custom Dialog Android","<android><dialog><android-intent>","2","5","","",""
"2866212","1","2867967","","2010-05-19 14:07:20","1","3819","<p>i tried to load the url ww.youtube.com on my app in a webview. but it cant be load completely. it loads just like below image. in the browser it loads comfortably. why? Any Idea?</p><p><img src=""http://www.freeimagehosting.net/uploads/d7356dd8e1.png"" alt=""image""></p>","267269","","","","","2010-10-03 18:54:52","WebView Problem on Youtube site in Android?","<android><webview>","3","0","1","",""
"2866273","1","","","2010-05-19 14:13:18","1","375","<p>How to find the exact pixel center of a String?I need this for drawing onto a canvas.</p>","248521","","27615","","2011-12-15 14:02:24","2011-12-15 14:02:24","How to find the exact center of a String?","<android>","2","3","","",""
"2866565","1","2867561","","2010-05-19 14:43:34","12","19335","<p>How / where can I see what happened when my Android application crashes in Eclipse (using Run, not Debug)?</p>","326849","","276052","","2011-09-23 14:14:55","2012-07-23 19:55:43","How can I see the error log (logcat) for Android in Eclipse?","<android><eclipse><error-log>","3","0","3","",""
"2866660","1","2868536","","2010-05-19 14:55:41","0","590","<p>Long Story Short: a method of my activity updates and scrolls the ListView through an ArrayAdapter like it should, but a method of an internal TimerTask for polling messages (which are displayed in the ListView) updates the ListView, but don't scroll it. Why?</p><p>Long Story:</p><p>I have a chat activity with 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#fff""    &gt;    &lt;ListView android:id=""@+id/messageList""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:stackFromBottom=""true""        android:transcriptMode=""alwaysScroll""        android:layout_weight=""1""        android:fadeScrollbars=""true""    /&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center""        &gt;        &lt;EditText android:id=""@+id/message""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""        /&gt;        &lt;Button android:id=""@+id/button_send""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Send""            android:onClick=""sendMessage""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The internal listView (with id messageList) is populated by an ArrayAdapter which inflates the XML below and replaces strings in 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:clickable=""false""    android:background=""#fff""    android:paddingLeft=""2dp""    android:paddingRight=""2dp""    &gt;    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/date""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:textSize=""16sp""     android:textColor=""#00F""     android:typeface=""monospace""     android:text=""2010-10-12 12:12:03""     android:gravity=""left"" /&gt; &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/sender""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:textSize=""16sp""     android:textColor=""#f84""     android:text=""spidey""     android:gravity=""right""     android:textStyle=""bold"" /&gt; &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/body""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:textSize=""14sp""     android:padding=""1dp""     android:gravity=""left""     android:layout_below=""@id/date""     android:text=""Mensagem muito legal 123 quatro cinco seis.""     android:textColor=""#000"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The problem is: in the main layout, I have a EditText for the chat message, and a Button to send the message. I have declared the adapter in the activity scope:</p><pre><code>public class ChatManager extends Activity{ private EditText et; private ListView lv; private Timestamp lastDate = null; private long campaignId; private ChatAdapter ca; private List&lt;ChatMessage&gt; vetMsg = new ArrayList&lt;ChatMessage&gt;(); private Timer chatPollingTimer; private static final int CHAT_POLLING_PERIOD = 10000;...}</code></pre><p>So, inside sendMessage(View v), the notifyDataSetChanged() scrolls the ListView acordingly, so I can see the latest chat messages automatically:</p><pre><code> public void sendMessage(View v) {  String msg = et.getText().toString();  if(msg.length() == 0){   return;  }  et.setText("""");  String xml = ServerCom.sendAndGetChatMessages(campaignId, lastDate, msg);  Vector&lt;ChatMessage&gt; vetNew = Chat.parse(new InputSource(new StringReader(xml)));  //Pegando a última data  if(!vetNew.isEmpty()){   lastDate = vetNew.lastElement().getDateSent();   //Atualizando a tela   vetMsg.addAll(vetNew);   ca.notifyDataSetChanged();  }    }</code></pre><p>But inside my TimerTask, I can't. The ListView IS UPDATED, but it just don't scroll automatically. What am I doing wrong?</p><pre><code> private class chatPollingTask extends TimerTask {  @Override  public void run() {   String xml;   if(lastDate != null){    //Chama o Updater    xml = ServerCom.getChatMessages(campaignId, lastDate);   }else{    //Chama o init denovo    xml = ServerCom.getChatMessages(campaignId);   }   Vector&lt;ChatMessage&gt; vetNew = Chat.parse(new InputSource(new StringReader(xml)));   if(!(vetNew.isEmpty())){    //TODO: descobrir porque o chat não está rolando quando chegam novas mensagens    //Descobrir também como forçar o rolamento, enquanto o bug não for corrigido.    Log.d(""CHAT"", ""New message(s) acquired!"");    lastDate =  vetNew.lastElement().getDateSent();    vetMsg.addAll(vetNew);    ca.notifyDataSetChanged();   }  } }</code></pre><p>How can I force the scroll to the bottom? I've tried using scrollTo using lv.getBottom()-lv.getHeight(), but didn't work. Is this a bug in the Android SDK?</p><p>Sorry for the MASSIVE amount of code, but I guess this way the question gets pretty clear.</p>","131326","","","","","2010-05-21 21:06:06","Why my button can trigger the UI to scroll and my TimerTask inside the activity can't?","<android><listview><android-arrayadapter>","1","0","","",""
"2866924","1","","","2010-05-19 15:26:38","1","12155","<p>am almost done with my project in android, now I want to make the executable version of the application.</p><p>I need to demonstrate it in .exe form as soft app as on emulator, not by built and debug process from eclipse.</p>","257580","","244296","","2010-05-19 17:19:53","2014-01-13 09:02:41","How to make an EXE file using .apk file","<android><adb><apk>","5","5","","",""
"2866991","1","2867029","","2010-05-19 15:34:40","0","363","<p>i got 2 java files  app.java and gallaery.java</p><p><strong>App.java</strong> public class App extends Activity implements OnClickListener {</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button Listvideo = (Button) findViewById(R.id.Listvideo);    Listvideo.setOnClickListener(this); </code></pre><p>public void onClick(View view) {</p><p>if (view == findViewById(R.id.Listvideo)) {</p><pre><code>   // i have to call gallery.java here which executes list of images in the android pone   }</code></pre><p>}</p>","164850","","","","","2010-05-19 15:38:55","How can i access or execute .java file in another javafile in android app development?","<android>","1","2","","",""
"2867348","1","2867420","","2010-05-19 16:12:32","0","1520","<p>I'm wondering which is the best way to communicate between a Service and an activity..</p><ul><li>Broadcast intent</li><li>Callback</li><li>others?...</li></ul><p>Bye</p>","302798","","","","","2010-05-19 16:20:31","Android service- how to communicate with activities","<android><service><activity>","1","0","","",""
"2867469","1","2867737","","2010-05-19 16:27:38","4","13975","<p>An <code>OnItemClickListener</code> for a <code>ListView</code> has the following method:</p><pre><code>@Overridepublic void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)</code></pre><p>I'd like to have the adapter behind the <code>ListView</code> refresh, and I believe this is done through the use of:</p><pre><code>BaseAdapter.notifyDataSetChanged()</code></pre><p>How do I use the <code>parent</code> parameter in the <code>onItemClick</code> method to do this? So far I've tried:</p><pre><code>parent.getAdapter().notifyDataSetChanged();</code></pre><p>This throws an error because the object returned is of class <code>HeaderViewListAdapter</code>, which for reasons unknown isn't a subclass of <code>BaseAdapter</code>.</p>","219929","","","","","2011-06-19 12:54:43","How to call notifyDataSetChanged() from a generic Adapter","<android><listview><adapter><listadapter>","4","0","1","",""
"2867979","1","","","2010-05-19 17:44:34","0","586","<p>I am trying to create something like a rectangular grid with pictures. When a picture is clicked, it should zoom in pushing the other ones out. I don't know what you name you call this particular model with but does anyone have suggestions on where I should start? </p><p><a href=""http://olliebray.typepad.com/.a/6a00d8341eb53c53ef0112793e5d3428a4-300wi"" rel=""nofollow"">Collage Example</a></p>","184046","","","","","2010-05-19 18:08:27","Android::Creating a clickable collage?","<android><design><design-patterns><android-widget>","1","0","","",""
"2868047","1","2868052","","2010-05-19 17:54:15","93","57264","<p>How do I make an activity full screen? I mean without the notification bar. Any ideas?</p>","267269","","56285","","2013-10-29 14:54:52","2014-03-12 15:38:55","Fullscreen Activity in Android?","<android><fullscreen><android-fullscreen>","4","1","28","",""
"2868492","1","2869506","","2010-05-19 18:55:58","0","901","<p>I am developing a microblogging platform in which I need to populate the page with Post (user defined class with fields) obtained from the Django server using HttpGet. </p><p>In the client side(Android) I am using GSON to parse the responses from server to the type Post. So I require that server should send Post's one by one so as to add each of them to a list of Posts after parsing and then finally notifying the list adapter of changes in the data set after all Post's have been added. </p><p>But the problem coming when intially loading the application, the page has to be populated with 10 latest Post's from the server. So I thought of a rather dirty way of sending 10 httpget requests to the server one after the other to the server. The code looks like this</p><pre><code>public void populateTimeline(){Thread populate = new Thread(){    public void run(){        Looper.prepare();        InputStream data = getData(serviceURL);  //gets a post from server        if(data!= null){            String result = responsetoString(data); //turns response to String            progressDialog.show();            Posts post = toPostfromGson(result); //Parses string to Post Object                     }        Looper.loop();    }};populate.start();       </code></pre><p>}</p><p>I was thinking of executing it 10 times in a loop to get the 10 Post's I require. But in Django as far I know (correct me if I am wrong) there's no way to keep an index of the last sent Post to the client and so no way to send the 'next' Post on the next HttpGet request. So I am out of ideas.</p><p>I feel there's a better way to do this efficiently. Any help would be much appreciated.</p>","323404","","","","","2010-05-19 21:18:49","Sending multiple http requests to Django from Android","<android><django><http>","1","1","","",""
"2868504","1","","","2010-05-19 18:57:34","2","924","<p>Hi I'm developing a game for android using OpenGL es and have hit a problem:</p><p>My game loads fine in the emulator (windows xp and vista from eclipse), it also loads fine on a T-Mobile G2 (HTC Hero) however when I load it on my new HTC Desire none of the textures appear to load correctly (or at all). I'm suspecting the BitmapFactory.decode method although I have no evidence that that is the problem.</p><p>All of my textures are power of 2 and JPG textures seem to load (although they don't look great quality) but anything that is GIF or PNG just doesn't load at all except for a 2x2 red square which loads fine and one texture that maps to a 3d object but seems to fill each triangle of the mesh with the nearest colour).</p><p>This is my code for loading images:</p><pre><code>     AssetManager am = androidContext.getAssets();  BufferedInputStream is = null;  try {     is = new BufferedInputStream(am.open(fileName));     Bitmap bitmap;     bitmap = BitmapFactory.decodeStream(is);     GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);     bitmap.recycle();  } catch(IOException e) {     Logger.global.log(Level.SEVERE, e.getLocalizedMessage());  } finally {     try {        is.close();     } catch(Exception e) {        // Ignore.     }  }</code></pre><p>thanks</p>","345399","","","","","2012-08-25 12:40:27","PNG Textures not loading on HTC desire","<java><android><opengl-es><textures>","2","0","0","",""
"2868544","1","","","2010-05-19 19:02:27","3","1030","<p>Is there a (simple) possibility for turning the mobile network on/off with Java code?If so, for mobile service too?'Cause I'd like to make an app which turns the network on and service off (or the opposite).</p><p>Thanks for help.</p>","345404","","","","","2010-05-19 20:49:24","Turning on/off network settings on Android","<java><android><networking>","2","0","1","",""
"2869006","1","","","2010-05-19 20:07:30","8","1958","<p>On the stock Droid and Nexus One, an intent like this:</p><p><code>new Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse(""http://example.com/somemp3.mp3""), ""audio/mp3"");</code></p><p>works just fine and pops open the system music player to stream the file. But it doesn't match any activities on the HTC Incredible, causing a force-close when I call <code>startActivity</code> on it (I'm guessing due to missing intent filters in SenseUI's replacement applications). I'd prefer not to have to manage a MediaPlayer instance myself if I don't have to; does anyone know if there's a way to structure an Intent to convince the Incredible to play an MP3 stream over HTTP in its built-in Music or Streaming Media apps?</p>","59058","","","","","2012-09-27 10:03:45","Android Intent for HTTP MP3 stream on HTC Incredible","<android><htc>","4","1","4","",""
"2869134","1","2969253","","2010-05-19 20:26:41","3","1307","<p>I am doing a custom title for my android app and I want to have a refresh button like the Twitter app.I am using a <code>RelativeLayout</code> an my ImageView is defined by:</p><pre><code>&lt;ImageView android:id=""@+id/title_refresh""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/ic_menu_refresh""    android:layout_alignParentRight=""true""&gt;&lt;/ImageView&gt;</code></pre><p>In my <code>Activity</code> I have something like this:</p><pre><code>refreshView = (ImageView) findViewById(R.id.title_refresh);refreshView.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        /* Make the refreshView turn into a progress bar. */        startService(new Intent(MyActivity.this, MyService.class));    }}</code></pre><p>I would like the ImageView to turn into a ProgressBar while I wait for my service to finish processing.How is the correct way to do this?</p>","119895","","","","","2012-09-02 12:27:59","Turning a refresh ImageView into a ProgressBar","<android><progress-bar>","1","0","1","",""
"2869578","1","","","2010-05-19 21:32:12","0","1467","<p>I'm building a google map application that marks several points on the map. I'm currently trying to get the dialog box to appear when the marker is clicked. Right now, the markers appear at the right places but when i click them, the entire application stops unexpectedly/forced to close. Does anyone have any suggestions on what is wrong and how i should go about fixing it?</p><p>MyMapsActivity.java class:</p><pre><code>package net.learn2develop.MyGoogleMapsNew;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.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;public class MyMapsActivity extends MapActivity {    /** Called when the activity is first created. */ public MyItemOverlay itemoverlay;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MapView mapView = (MapView) findViewById(R.id.mapview);        //MapView = new MapView(this, ""example_Maps_ApiKey_String"");        mapView.setBuiltInZoomControls(true);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);        itemoverlay = new MyItemOverlay(drawable);        GeoPoint point1 = new GeoPoint(19240000,-99120000);        OverlayItem overlayitem1 = new OverlayItem(point1, ""Hola, Mundo!"", ""I'm in Mexico City!"");        GeoPoint point2 = new GeoPoint(35410000, 139460000);        OverlayItem overlayitem2 = new OverlayItem(point2, ""Sekai, konichiwa!"", ""I'm in Japan!"");        GeoPoint point3 = new GeoPoint(39000000, -77000000);        OverlayItem overlayitem3 = new OverlayItem(point3, """","""");        itemoverlay.addOverlay(overlayitem1);        itemoverlay.addOverlay(overlayitem2);        itemoverlay.addOverlay(overlayitem3);        mapOverlays.add(itemoverlay);    }    protected boolean isRouteDisplayed() {        return false;    }}</code></pre><p>MyItemOverlay class:</p><pre><code>package net.learn2develop.MyGoogleMapsNew;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.drawable.Drawable;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.OverlayItem;public class MyItemOverlay extends ItemizedOverlay { private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;(); private Context mContext; public MyItemOverlay(Drawable defaultMarker) {  super(boundCenterBottom(defaultMarker));  // TODO Auto-generated constructor stub } public MyItemOverlay(Drawable defaultMarker, Context context) {    super(defaultMarker);    mContext = context; } @Override protected boolean onTap(int index) {   OverlayItem item = mOverlays.get(index);   AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);   dialog.setTitle(item.getTitle());   dialog.setMessage(item.getSnippet());   dialog.show();   return true; }/* protected boolean onTap(int index) {        OverlayItem item = mOverlays.get(index);        AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);        dialog.setTitle(item.getTitle());        dialog.setMessage(item.getSnippet());        dialog.setPositiveButton(""Yes"", new OnClickListener() {                @Override            public void onClick(DialogInterface dialog, int which) {                dialog.dismiss();            }        });        dialog.show();        return true;    }}*/// @Override /*protected OverlayItem createItem(int arg0) {  // TODO Auto-generated method stub  return null; }*/ /*@Override public int size() {  // TODO Auto-generated method stub  return 0; }*/ @Override public int size() {   return mOverlays.size(); } public void addOverlay(OverlayItem overlay) {     mOverlays.add(overlay);     populate(); } @Override protected OverlayItem createItem(int i) {   return mOverlays.get(i); }}</code></pre><p>AndroidManifest.xml 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=""net.learn2develop.MyGoogleMapsNew""      android:versionCode=""1""      android:versionName=""1.0""&gt;      &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;uses-library android:name=""com.google.android.maps"" /&gt;         &lt;activity android:name="".MyMapsActivity""                  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-permission         xmlns:android=""http://schemas.android.com/apk/res/android""         android:name=""android.permission.INTERNET""&gt;    &lt;/uses-permission&gt;    &lt;uses-permission         xmlns:android=""http://schemas.android.com/apk/res/android""         android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;    &lt;/uses-permission&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt;</code></pre>","345525","","321731","","2014-02-21 04:33:52","2014-02-21 04:33:52","Android Map application forces close when map marker is clicked","<android><map><marker>","2","4","","",""
"2869633","1","","","2010-05-19 21:40:02","0","190","<p>So, I'm new to developing apps (altogether) and I thought that it would be fun to start out on the Android. I did the test with ""HelloAndroid"" app, but I have no clue on how to run the app on my phone via Eclipse. I remember reading about it a long time ago (sometime in February) but I have no idea where to find it. Any help, here?</p>","345526","","","","","2010-05-19 22:28:44","Android App Building","<android><phone>","2","0","0","",""
"2869662","1","","","2010-05-19 21:44:50","0","363","<p>I have a big problem.</p><p>When I lauch my MapActivity this launch the ilegal argument. I think that i check all</p><p>1) add map.jar from api 3 to eclipse2) I obtain a api key3) In androidmanifest I have putted the uses-library and te internet permision4) I launch the google api emulator for api 3.5) I dont know that i can try.</p><p>Please, any idea? this can't be too dificult, I can't belive. Sure that it is a stupid thing :S</p>","338037","","","","","2010-05-20 09:05:33","IllegalAccessError: cross-loader access from pre-verifed class in MapActivity","<android>","1","1","","",""
"2869730","1","","","2010-05-19 21:54:25","0","1008","<p>Android 2.1 (not sure how much that matters)  My test hardware is a Motorola Droid (not sure how much that matters either)</p><p>I want to push a bookmark/internet-shortcut to a user's home screen as a result of them clicking on a link  - via their browser of choice.</p><p>I know they can usually set the bookmark themselves and then choose to put it on their home screen.  But I'd like to provide a link like ""Put a shortcut to this page on your home screen""that takes care of everything kind of in the background/underneath.</p><p>Is this even possible?  What parts of the framework would I need access to to make it happen?</p>","316683","","","","","2010-05-20 03:14:11","Push a bookmark to a user's home screen in Android","<android><bookmarks>","1","0","","",""
"2869749","1","3126959","","2010-05-19 21:57:30","10","6639","<p>I am trying to inflate an ImageView that scales a Drawable that I can display in a GalleryView.  My code to inflate the view seems to work fine, except that the attributes of the ImageView are not applied.  Specifically, the inflated ImageView does not have the width/height that I set for it via the android:layout params in XML.</p><p>Can someone show me what I'm doing wrong?</p><p>I want to set the width/height of the image in dp, so that it is the correct size across multiple screen dpis and support Android 1.5+.  As a result I cannot use something like:</p><pre><code>i.setLayoutParams(new Gallery.LayoutParams(150, 116)</code></pre><p>My layout definition is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""150dp"" android:layout_height=""116dp""    android:background=""@drawable/gallery_item_background""    android:scaleType=""fitXY"" /&gt;&lt;/ImageView&gt;</code></pre><p>And the snippet I am using to inflate the ImageView is:</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        ImageView i = (ImageView) inflater.inflate(R.layout.gallery_item, null);        i.setImageResource(mImageIds.get(position));        i.setScaleType(ImageView.ScaleType.FIT_XY);        return i;    }</code></pre>","233202","","","","","2014-02-10 13:47:14","Inflated ImageView to put in GalleryView isn't the right size","<android><imageview><galleryview>","2","1","1","",""
"2869817","1","2869836","","2010-05-19 22:10:34","2","551","<p>Can someone clarify - if in my activity, I leave to call an intent via startActivityForResult (such as take a picture), when users return to my app, what is the entry point for that activity? Is it onCreate, onStart, or onResume?</p><p>Thanks!</p>","314994","","","","","2011-12-15 07:50:22","Clarification on Android Activity Lifecycle","<android>","2","1","1","",""
"2870039","1","","","2010-05-19 23:02:05","1","658","<p>For example, I want to make an image appear in webview to utilize the zoom functions.I would use this line of code:</p><pre><code>this.myWebView.loadUrl(""file://"");</code></pre><p>I just need to know what to put after file to reference the image.</p>","345584","","75801","","2010-05-19 23:04:21","2010-11-30 15:21:21","How can I reference a file in my drawable folder to put in WebView in android?","<android><file><reference><webview>","1","0","","",""
"2870040","1","2870071","","2010-05-19 23:02:46","0","1481","<p>Okay.. I am doing something similar to the below:</p><pre><code>private void onCreate() {    final ProgressDialog dialog = ProgressDialog.show(this, ""Please wait.."", ""Doing stuff.."", true);Thread t = new Thread() {    public void run() {        //do some serious stuff...        dialog.dismiss();               }};t.start(); t.join();stepTwo();}</code></pre><p>However, what I am finding is that my progress dialog never even shows up. My App stalls for a moment so I know it is chugging along inside of thread t, but why doesnt my dialog appear?</p><p>IF I remove the line:</p><pre><code>t.join();</code></pre><p>Then what I find happens is that the progress dialog does show up, but my app starts stepTwo(); before what happens in the thread is complete..</p><p>Any ideas?</p>","314994","","","","","2010-05-20 08:21:55","Progress Dialog in Android doesn't Show?","<java><android><multithreading>","2","0","","",""
"2870086","1","","","2010-05-19 23:16:53","2","627","<p>Where can I find third-party components for the Android?  Components such as dials, meters, graphics of volume controls LED's, etc?</p>","345594","","21234","","2010-05-19 23:21:29","2010-08-06 08:18:29","Where can I find third-party components?","<android>","2","0","2","",""
"2870168","1","","","2010-05-19 23:38:28","1","507","<p>how to rotate same control in java? For example I want to rotate radiobutton for 90 or 180 degrees</p><p>How to do this on on  JAVA SDK for android developing?</p>","345602","","20654","","2010-05-20 19:25:48","2010-06-06 11:45:54","Rotate controls in Java","<java><android><control><rotation>","1","0","","",""
"2870177","1","","","2010-05-19 23:40:38","0","191","<p>I tried installing the Android USB driver on my x64 machine and it fails. Does Android development not support 64 bit Windows, or am I possibly doing something wrong?</p>","345604","","","","","2010-05-19 23:48:41","How do I make ADB work on x64?","<android><usb><x64><adb>","1","1","","",""
"2870323","1","2870588","","2010-05-20 00:24:33","2","2256","<p>Linear layout below.  This layout is aligned parent bottom in a Relative Layout.  Problem is I want all buttons to have the same height.  I have tried layout_gravity=""fill"" but that doesn't seem to work.</p><pre><code>&lt;LinearLayout android:id=""@+id/button_layout""         android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:background=""#FFFFFF""        android:layout_alignParentBottom=""true""&gt;    &lt;Button android:text=""Send"" android:id=""@+id/send_button""        android:layout_weight=""1"" android:layout_gravity=""fill""        android:layout_width=""0dip"" android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;    &lt;Button android:text=""Report Missing Image"" android:id=""@+id/report_button""        android:layout_weight=""1""        android:layout_width=""0dip"" android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;    &lt;Button android:text=""Close"" android:id=""@+id/close_button""        android:layout_weight=""1"" android:layout_gravity=""fill""        android:layout_width=""0dip"" android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","297762","","126562","","2010-05-20 00:26:38","2010-05-20 06:51:41","Buttons with equal heights","<android><layout>","3","0","","",""
"2870486","1","","","2010-05-20 01:23:45","0","226","<p>I want display the images saved in the cell phone in my own application. now I am using MediaStore.Images.Media to do this. I can get the name, size and other information of the images. but i don't know how to get the bitmap? can u help me. thx.</p><p>There is a method getBitmap(ContentResolver cr, Uri url), but i don't know how to get the Uri of one certain image.</p><p>thx.</p>","339018","","","","","2010-05-20 03:14:11","How can I get the photo saved in Android cell phone in my application","<android><image><bitmap>","1","0","","",""
"2870604","1","","","2010-05-20 02:07:59","1","842","<p>I'm building a dialog class which inherits from Dialog, and all internal UI is programmatic. It's structured in the following way:</p><p>Dialog<br>+LinearLayout<br>++TextView<br>++ScrollView<br>+++LinearLayout<br>++++ListView  </p><p>Unfortunately, when I show() the Dialog, it's too short. I'd like it to maximize and cover as much of the screen as possible, but only when there are enough items in the ListView to warrant it.</p><p>I haven't found my answer in the docs, and I haven't been able to get it to work by setting WRAP_CONTENT as layout parameters, or setting heights manually.</p><p>What is the proper way to approach this? </p><p>Thanks,Sean</p>","345651","","","","","2010-05-20 02:55:35","Dialog, LinearLayout, ScrollView size issues","<android><android-widget>","1","0","","",""
"2870619","1","","","2010-05-20 02:12:19","4","3295","<p>I'm breaking into GUI programming with android, trying to compile and analyze Lunar Lander sample program.  The instructions for using Eclipse say to select ""Create project from existing source"" but that option doesn't exist.  If I select File->New->Project I can select ""Java project from Existing Ant Buildfile"".  Using that I've tried selecting various xml files as ""Ant Buildfile"" but all give me the ""The file selected is not a valid Ant buildfile"" error.</p><p>I just want to run GUI sample projects, preferably with Eclipse.  Any useful tips will be appreciated.</p>","345654","","","","","2013-01-06 16:00:54","How to Compile Sample Code","<android><gui><sample>","3","0","1","",""
"2870678","1","","","2010-05-20 02:34:52","7","8391","<p>I'm new to Android. Can someone explain me the concept of Context class/Object. What it is? What it will be used for? Why Context class?</p>","345666","","","","","2012-03-30 19:55:30","Please explain me Context class in Android","<android><context>","4","2","","",""
"2870686","1","2870728","","2010-05-20 02:37:45","15","11891","<p>I use TAB and Shift-Tab in Visual Studio to indent an entire selection. This does nothing in Eclipse, and I can't seem to find another way to do it.</p><p>Update: I wasn't really paying all that much attention to this initially and did not ask the question correctly.I now realized that it is in XML files where TAB still does not indent a selection. I did not find a setting for this in the properties, so I assume it is not possible.</p>","58880","","58880","","2010-05-21 18:39:06","2010-05-21 18:39:06","How can I indent a selected block of text in Eclipse 3.5.2?","<eclipse><android>","2","2","5","",""
"2870694","1","","","2010-05-20 02:40:48","3","1093","<p>The XML documentation for layouts isn't very good. There are a large number of related variables and it isn't clear at all how they interact or differ. Is there any guide - maybe a book, or blog post ect that would help me understand this? </p><p><strong>Related</strong></p><ul><li><a href=""http://stackoverflow.com/questions/1360134/is-there-any-android-xml-documentation"">Is there any Android XML documentation?</a></li></ul>","165495","","","","","2010-05-20 13:00:46","Android XML Layout Guide","<xml><android><layout>","1","0","","",""
"2870743","1","2873910","","2010-05-20 03:00:31","1","5469","<p>I cannot figure out the origin of the <code>ConcurrentModificationException</code>. In my <code>activity</code> I'm calling <code> updateMapOverlay()</code>. I'm also calling <code>updateMapOverlay()</code> inside another Thread (a <code>TimerTask</code>) that is invoked on regular intervals. I'm taking the appropriate locks when invoking <code>updateMapOverlay()</code> from both the threads. Is this problem being caused because I'm invoking <code>updateMapOverlay</code> from inside a non-UI thread (i.e., <code>TimerTask</code>). Has anyone else faced a similar issue ? </p><p><code>    private void updateMapOverlay() {</p><pre><code>    this.itemizedOverlay.refreshItems(createOverlayItemsList());    List&lt;Overlay&gt; overlays = mapView.getOverlays();    overlays.clear();    overlays.add(cotItemizedOverlay);            this.mapview.invalidate();}</code></pre><p></code>   </p><p>Thanks. </p><p><strong>Exception</strong>: </p><pre><code>W/dalvikvm(10641): threadid=3: thread exiting with uncaught exception (group=0x4001b180)E/AndroidRuntime(10641): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(10641): java.util.ConcurrentModificationExceptionE/AndroidRuntime(10641):    at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64)E/AndroidRuntime(10641):    at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41)E/AndroidRuntime(10641):    at com.google.android.maps.MapView.onDraw(MapView.java:494)E/AndroidRuntime(10641):    at android.view.View.draw(View.java:6535)E/AndroidRuntime(10641):    at android.view.ViewGroup.drawChild(ViewGroup.java:1531)E/AndroidRuntime(10641):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)E/AndroidRuntime(10641):    at android.view.ViewGroup.drawChild(ViewGroup.java:1529)E/AndroidRuntime(10641):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)E/AndroidRuntime(10641):    at android.view.View.draw(View.java:6538)E/AndroidRuntime(10641):    at android.widget.FrameLayout.draw(FrameLayout.java:352)E/AndroidRuntime(10641):    at android.view.ViewGroup.drawChild(ViewGroup.java:1531)E/AndroidRuntime(10641):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)E/AndroidRuntime(10641):    at android.view.ViewGroup.drawChild(ViewGroup.java:1529)E/AndroidRuntime(10641):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)E/AndroidRuntime(10641):    at android.view.View.draw(View.java:6538)E/AndroidRuntime(10641):    at android.widget.FrameLayout.draw(FrameLayout.java:352)E/AndroidRuntime(10641):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)E/AndroidRuntime(10641):    at android.view.ViewRoot.draw(ViewRoot.java:1349)E/AndroidRuntime(10641):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)E/AndroidRuntime(10641):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)E/AndroidRuntime(10641):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(10641):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(10641):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(10641):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(10641):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(10641):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(10641):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(10641):    at dalvik.system.NativeStart.main(Native Method)I/Process (   95): Sending signal. PID: 10641 SIG: 3</code></pre>","306346","","1839241","","2012-11-30 12:16:34","2012-11-30 12:16:34","Android 2.1 GoogleMaps ItemizedOverlay ConcurrentModificationException","<android><google-maps><concurrency><android-mapview><itemizedoverlay>","4","0","2","",""
"2870851","1","","","2010-05-20 03:34:58","4","3029","<p>I have a PreferenceScreen that is defined in XML that serves all the preferences for my application. This PreferenceScreen also has a child PreferenceScreen nested within it. My implementing class is called PreferencesActivity. I know I can open the main Preferences window via startActivity(new Intent(this, PreferencesActivity.class)); but how do I go about opening the child PreferenceScreen via an Intent?</p>","345692","","","","","2013-12-16 16:28:39","How to open a nested child PreferenceScreen in Android","<android><android-preferences>","2","0","","",""
"2870867","1","","","2010-05-20 03:39:58","0","717","<p>I am here to seek some help with my code which i am facing a dead end road with. I'm trying to pass values from screen1.java using Intent to screen2.java. Passing the values is fine and I managed to get through it; however, when I check using if statement the program crash down. Here are my files, plzzzzzzzzzzz help </p><p>screen1.java</p><pre><code>package test.android;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class screen1 extends Activity{    static String strKey = ""Hello"";    static final String strValue = ""Hello"";    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.screen1);        //** button A              Button A = (Button) findViewById(R.id.btnClickA);        A.setOnClickListener(new View.OnClickListener() {            public void onClick(View arg0) {                Intent i = new Intent(screen1.this, screen2.class);                strKey = ""NAME"";                i.setClassName(""packageName"", ""packageName.IntentClass"");                String term = ""Hello"";                i.putExtra(""packageName.term"", term);                //i.putExtra(strKey, strValue);                startActivity(i);            }        });        //**        //** button B              Button B = (Button) findViewById(R.id.btnClickB);        B.setOnClickListener(new View.OnClickListener() {            public void onClick(View arg0) {                Intent i = new Intent(screen1.this, screen3.class);                startActivity(i);            }        });        //**    }}</code></pre><p>screen2.java</p><pre><code>package test.android;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class screen2 extends Activity{   public void onCreate(Bundle icicle)   {       Bundle extras = getIntent().getExtras();        String term = extras.getString(""packageName.term"");        System.out.println(""--- Name  is  --&gt;""+ term);        if(term.equalsIgnoreCase(""Hello"") || term.equalsIgnoreCase(""Name"")){            super.onCreate(icicle);            setContentView(R.layout.screen3);            Button b = (Button) findViewById(R.id.btnClick3);            b.setOnClickListener(new View.OnClickListener() {                public void onClick(View arg0) {                    setResult(RESULT_OK);                    finish();                }            });        } else {            super.onCreate(icicle);            setContentView(R.layout.screen2);            Button b = (Button) findViewById(R.id.btnClick2);            b.setOnClickListener(new View.OnClickListener() {                public void onClick(View arg0) {                    setResult(RESULT_OK);                    finish();                }            });        }        // DOES NOT WORK !!!!!!!!!        System.out.println(""--- Name  is  --&gt;""+ term);    }}</code></pre><p>Layouts:screen1.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=""You are in the first Screen""/&gt;&lt;Button  android:id =""@+id/btnClickA""  android:background=""@drawable/sleep0""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""Open Screen 2""/&gt;&lt;Button  android:id =""@+id/btnClickB""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""Open Screen 3""/&gt;&lt;ImageView android:id=""@+id/icon"" android:layout_width=""wrap_content""android:layout_height=""fill_parent"" android:src=""@drawable/icon""android:layout_gravity=""center""/&gt;&lt;/LinearLayout&gt;</code></pre><p>screen2.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=""You are in Screen 2""/&gt;&lt;Button  android:id =""@+id/btnClick2""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""Close""/&gt;&lt;/LinearLayout&gt;</code></pre><p>screen3.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- ScrollView: will allow the layout to be scroll Up/Down and Left/right  --&gt;&lt;ScrollView   android:id=""@+id/widget54""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   xmlns:android=""http://schemas.android.com/apk/res/android""   &gt;&lt;LinearLayout  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:scrollbars=""vertical""&gt;&lt;TextView  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:text=""You are in Screen 3""/&gt;&lt;Button  android:id =""@+id/btnClick3""  android:background=""@drawable/sss""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""Close""/&gt;&lt;ImageView android:id=""@+id/sssq""  android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:src=""@drawable/sssq""android:layout_gravity=""center""  /&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>AndroidManifest.xml</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""test.android""&gt;   &lt;application android:icon=""@drawable/icon""&gt;      &lt;activity android:name=""screen1""                        android:label=""SCREEN 1""&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=""screen2""                        android:label=""SCREEN 2""&gt;      &lt;/activity&gt;      &lt;activity android:name=""screen3""                        android:label=""SCREEN 3""&gt;      &lt;/activity&gt;     &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>=====The error is caused by these lines of code in screen2.java:</p><pre><code>  if(term.equalsIgnoreCase(""Hello"") || term.equalsIgnoreCase(""Name"")){      super.onCreate(icicle);      setContentView(R.layout.screen3);      Button b = (Button) findViewById(R.id.btnClick3);      b.setOnClickListener(new View.OnClickListener() {         public void onClick(View arg0) {         setResult(RESULT_OK);         finish();         }      });  }  else {      super.onCreate(icicle);      setContentView(R.layout.screen2);      Button b = (Button) findViewById(R.id.btnClick2);      b.setOnClickListener(new View.OnClickListener() {          public void onClick(View arg0) {              setResult(RESULT_OK);              finish();          }      });  }</code></pre><p>**notice if I get rid of the entire IF statement and go with only the ELSE the program works fine. </p>","345698","","4893","","2010-05-20 04:03:00","2010-05-20 17:36:51","Calling different layers from the same class","<java><android><android-intent><layer>","2","0","","",""
"2870906","1","","","2010-05-20 03:51:30","2","2711","<p>I have an activity that takes a photo with the camera, and then adds it to its proper folder (in this case /DCIM/Camera). But then when you exit the app and load up the Android gallery...it's not there. I was doing some playing around and noticed it only appears there when after restarting the phone. I'm not sure the reason behind this (maybe it has to create the thumbnail?)...is there any way around this? I want it to show up right away.</p><p>Thanks!</p>","326468","","","","","2013-01-31 05:10:52","Adding pictures to the Gallery - Android","<android><camera><gallery>","2","0","","",""
"2870947","1","2871614","","2010-05-20 04:05:05","1","1075","<p>I'm trying to extract <code>n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs=</code> using w3c dom</p><pre><code>&lt;html&gt;&lt;div id='token' style='display:none;'&gt;n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs=&lt;/div&gt;&lt;/html&gt;</code></pre><p>but I seem to be stuck</p><pre><code>DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();Document doc = builder.parse(con.getInputStream());NodeList list = doc.getElementsByTagName(""div"");</code></pre><p>Can someone please point me to some basic tutorials that would help me solve my dilemma.Thanks.</p><p>EDIT:</p><p>Okay I got it to work but it seems a little bit clunky</p><pre><code>String token;DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();Document doc = builder.parse(con.getInputStream());Element root = doc.getDocumentElement();NodeList items = root.getElementsByTagName(""html"");for(int i = 0; i &lt; items.getLength(); i++) {    Message message = new Message();    Node item = items.item(i);    NodeList properties = item.getChildNodes();    for(int j = 0; j &lt; properties.getLength(); j++) {        Node property = properties.item(j);        String name = property.getNodeName();        if(name.equalsIgnoreCase(""div"")) {            token = property.getFirstChild().getNodeValue());                               }    }}</code></pre><p>Is there a prettier way to get the token?</p>","159856","","159856","","2010-05-20 04:22:02","2013-12-03 04:27:33","XML Parser","<java><xml><android>","2","4","2","",""
"2871036","1","","","2010-05-20 04:37:41","0","1410","<p>please someone help me about this.i need to implement a list view with checkbox and each item should be assosiated with images.ex: </p><pre><code>[image1] list_item_1       [checkbox][image2]  list_item_2      [checkbox]                   '                   .                   .</code></pre><p>please help me        </p>","345724","","","","","2010-05-20 05:24:12","ListView With checkbox and images in android","<android><list><view>","1","1","","",""
"2871111","1","2876293","","2010-05-20 04:58:09","0","928","<p>Where are my assets being installed to?</p><p>I utilize an assets folder in my new app. I have two files in the folder. When I install my app on the emulator, I cannot access my assets, and furthermore I cannot see them on the emulator filesystem. </p><p>Extracted my apk and confirmed the assets folder exists:</p><pre><code>$ ls -ltr assets/total 16-rw-rw-r--. 1 brad brad 1050 2010-05-20 00:33 schema-DashDB.sql-rw-rw-r--. 1 brad brad 9216 2010-05-20 00:33 dash.db</code></pre><p>On the emulator, no assets folder: </p><pre><code># pwd/data/data/com.gtosoft.dash# ls -ldrwxr-xr-x system   system            2010-05-20 00:46 lib# </code></pre><p>I just want to package a pre-built database with my app and then open it to obtain data when needed. </p><p>Just tried it on my Moto Droid, unable to access/open the DB, just like the emulator:</p><pre><code>DBFile=/data/data/com.gtosoft.dash/assets/dash.db</code></pre><p>Building the DB on the fly from a schema file is out of the question because its such a slow process (about 5-10 statements per second is all I get for throughput).</p>","268803","","","","","2010-05-20 17:30:24","Why isn't my assets folder being installed on emulator?","<android><sqlite><assets>","2","1","2","",""
"2871120","1","","","2010-05-20 05:00:53","2","1082","<p>I'm trying to create class with generics that will have ability to serialize its state using Parcelable interface.The problem is that class has to contain constructor with single parameter - Parcel, but in my case I need to create class with additional parameters.Besides, Parcelable.Creator doesn't allow to use generics.</p><p>Here is an example:</p><p><code>public class Sample&lt;T&gt; {</code></p><p><code>...</code></p><p><code>public Sample(Context ctx, SomeInterface iface, Parcel parcel) {...}</code></p><p><code>...</code></p><p><code>}</code></p><p>What is the best practice to do it?</p>","345734","","","","","2010-05-20 06:41:01","How to use Parcelable if class requires additional parameters in construcor","<android><parcelable>","1","0","","",""
"2871163","1","","","2010-05-20 05:13:46","1","515","<p>I'm new to android i'm developing small application i want to arrange pictures in screen just like tumbnail view and want scroll on all picture then i have to able to select the one picture after touching the picture on the screen how can i do it? plz help me</p><p>Thanks in Advance.</p>","345742","","","","","2010-05-20 16:01:30","android picture frame","<android>","1","1","","",""
"2871190","1","2982310","","2010-05-20 05:21:31","5","3228","<p>I have recently started working on an app which has both Java andnative components. I am trying to generate trace information for bothcomponents using <code>Debug.startMethodTracing(""myapp"")</code> and<code>Debug.startNativeTracing()</code> alternately.  However, both are behaving unexpectedly. </p><p>When I use <code>Debug.startMethodTracing(""myapp"")</code>, I can see a file <code>/sdcard/myapp.trace</code> being created but it is always empty no matter how long I run my app.  When I use <code>Debug.startNativeTracing()</code> and start the emulator with the <code>-trace &lt;tracename&gt;</code> switch, I see a message saying <em>""Trace started""</em>, but when I try to run my app, theemulator crashes. </p><p>Am I missing something obvious here? How do I debug this problem?</p>","341008","","2961","","2010-05-20 05:32:38","2011-10-30 01:27:27","How to use startMethodTracing APIs on Android?","<android><trace>","1","0","2","",""
"2871221","1","2872139","","2010-05-20 05:28:43","0","119","<p>I m working on application in which i have to send all contacts from Android mobile to other   mobile through SMS. I don't have any problem in getting contact information but when I send those Contacts after few messages there is Alert Window pop up saying ""A large number of message have being send"" and ask if you want to send or not.I am testing this application on HTC Hero.Is this problem is for specific mobiles or for all?I don't know what should i do to avoid this window because I cant get SMS Sent event.Please help me with any ideas that i can implement........ </p>","198686","","114066","","2010-05-20 07:16:25","2010-05-20 08:36:52","Problem in getting Contact Info","<android><sms>","2","1","","",""
"2871308","1","","","2010-05-20 05:47:24","0","762","<p>I'm doing a Gdata Blogger from Android device:</p><pre><code>GoogleLoginServiceHelper.getCredentials(this, REQUEST_CODE_LOGIN, null,          GoogleLoginServiceConstants.REQUIRE_GOOGLE,          BLOGGER_SERVICE, true);</code></pre><p>I have this permissions in my manifest:</p><pre><code>&lt;uses-permission android:name=""com.google.android.googleapps.permission.GOOGLE_AUTH""/&gt;   &lt;uses-permission android:name=""com.google.android.googleapps.permission.GOOGLE_AUTH.blogger""/&gt;</code></pre><p>But I got a SecurityException:</p><p>ERROR/AndroidRuntime(20985): java.lang.SecurityException: caller pid 20985 uid 10044 lacks com.google.android.googleapps.permission.GOOGLE_AUTH.BLOGGER</p><p>What could be wrong?</p>","345766","","114066","","2010-05-20 07:11:23","2010-05-20 13:09:53","Android SecurityException with entry in Manifest","<android><permissions>","1","1","","",""
"2871334","1","2872148","","2010-05-20 05:54:13","5","5409","<p>I queried ""content//sms/"" and I don't know what some fields mean. They are -</p><ol><li>Thread ID</li><li>Protocol</li><li>Status</li><li>Reply_Path_Present</li><li>Service_Center</li></ol><p>I checked them in LogCat and found the values to be these:</p><ul><li>Thread ID : 1 to 6 etc..</li><li>Protocol : null / 0</li><li>Status : -1</li><li>Reply_Path_Present : null / 0</li><li>Service_Center : null</li></ul><p>Please tell me what the meanings of those values are.</p>","305732","","237838","","2013-05-18 08:15:32","2013-05-18 08:15:32","What are the meanings of the values in the Android ""content//sms/"" content provider?","<android><sms><android-contentprovider>","2","0","3","",""
"2871681","1","","","2010-05-20 07:14:10","2","3425","<p>i want to know  how to calculate the accelerometer movement.When i place the mobile horizontally in idle state and similarly when i place the mobile in hands,So there accelerometer value change when it is place horizontally or while it is in hand vertically.How To Identify them,Any Sample Codes will be useful</p>","138030","","1069068","","2013-03-19 14:44:32","2013-03-19 14:44:32","How To use Android Accelerometer Detection","<android>","2","0","","",""
"2871780","1","2966364","","2010-05-20 07:33:53","2","2078","<p>The Google I/O app was made by Google to help attendees to the conference track which sessions they want to watch and see the entire schedule. I was wondering if it was available as open source since it has some good UI design and usability patterns.</p>","338981","","","","","2014-02-01 10:00:50","Is the Google I/O 2010 Android app open source?","<android>","7","4","2","",""
"2871951","1","","","2010-05-20 08:03:37","2","977","<p>I add animation on a Button, use .SetFillAfter(true) to keep the last view on screen. But I find it impossible to call touch event function by touching Button icon on the screen any more  (but it can be called by touching original position).</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;Button    android:id =""@+id/button""      android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Move""    /&gt;&lt;/AbsoluteLayout&gt;</code></pre><hr><pre><code>  anim = AnimationUtils.loadAnimation(this, R.anim.move);  anim.setInterpolator(this, android.R.anim.accelerate_decelerate_interpolator);</code></pre>","345855","","234938","","2010-05-20 08:41:28","2011-06-08 16:43:51","Cannot activate View Touch Event After Animation end","<android><animation><view>","1","0","3","",""
"2871963","1","2875174","","2010-05-20 08:05:50","2","2439","<p>If you have an Android application that needs to retrieve data from your own server that depends on the latitude and longitude of the requests, do you need to let a user agree with the ability to save that same latitude and longitude for simple (and fun) statistical and anonymous purposes in some sort of EULA?</p><p>Or is it sufficient to mention the gathering of statistics somewhere in the Help section of that app?</p>","321103","","321103","","2010-05-20 08:41:22","2010-05-20 15:21:12","Do I need an EULA for this Android app?","<android><legal><eula>","2","0","","",""
"2872118","1","2872225","","2010-05-20 08:32:51","20","4351","<p>I'd like to start developing for iPhone or Android in my spare time, as a chance to learn something new but also hoping make some extra income. </p><p>I'm not sure which is the best development for me to start developing on. I own an iPhone, but I don't have a Mac (which I would need to use the SDK), plus with the iPhone I believe there's an annual charge to develop for it.</p><p>As far as I understand Android, the SDK is free and can be used on Windows.</p><p>Professionally I develop using .net and C#, which sounds more similar to the Java based Android enviroment.</p><p>Another negative I perceive against iPhone is it has a much more crowded App Store, I would think apps get better exposure on Android?</p>","86218","","86218","","2010-05-21 15:25:32","2012-10-14 14:04:19","Developing for iPhone or Android? (As a C# developer)","<iphone><android>","8","4","9","2012-10-15 14:52:59",""
"2872214","1","","","2010-05-20 08:51:30","4","9006","<p>I noticed in the class TelephonyManager there are CALL_STATE_IDLE, CALL_STATE_OFFHOOK and CALL_STATE_RINGING. They seem to be used for incoming calls.</p><p>What I actually want to do is to be notified when an outgoing call is made, is received, or timed out. How to do that?</p>","345909","","2660","","2011-12-13 23:59:22","2013-07-19 09:45:36","How do I get state of a outgoing call in android phone?","<android><state><call>","3","0","1","",""
"2872275","1","2953873","","2010-05-20 09:00:29","2","460","<p>I'm trying to enumerate all the permissions used by all the installed packages, however when I check the <a href=""http://developer.android.com/reference/android/content/pm/PackageInfo.html#requestedPermissions"" rel=""nofollow"">requestedPermissions</a> property for each of my installed packages it is always null.</p>","327","","21234","","2010-07-14 14:26:39","2010-07-17 04:57:14","Why is PackageInfo.requestedPermissions always null?","<android>","1","1","","",""
"2872288","1","","","2010-05-20 09:02:09","0","3066","<p>I want to create a tab which contains a tab for viewing contact detail. Here is what i did:</p><pre><code>    intent = new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, """"+contactId));    nativeInfo = tabHost.newTabSpec(""native info"").setIndicator(""N Info"").setContent(intent);</code></pre><p>It throw security exception.</p><p>I appreciate your help.</p><p>Thanks.</p>","345917","","","","","2010-05-20 17:15:40","How to start 'View Contact' Activity on android?","<android><contacts>","1","1","1","",""
"2872638","1","2959681","","2010-05-20 09:57:04","12","5654","<p>How do I remove strings from / obfuscate a compiled binary? The goal is to avoid having people read the names of the functions/methods inside.</p><p>It is a dynamic library (.so) compiled from C++ code for Android with the NDK tools (includes GCC)</p><p>I compile with <code>-O3</code> and already use <code>arm-eabi-strip -g mylib.so</code> to remove debugging symbols, but when I do <code>strings mylib.so</code> all the names of the functions/methods are still readable.</p>","229745","","229745","","2010-05-20 12:12:06","2010-07-11 18:26:16","How to remove strings from a compiled binary (.so)","<android><linux><gcc><compilation><android-ndk>","4","0","3","",""
"2872713","1","2872918","","2010-05-20 10:06:01","5","4545","<p>As part of the Android application I am developing in eclipse, I need to combine two packages from different projects into a single project. I tried copying the files in the package of the second project under the src folder of the first folder and copied other files required for second package into the res folder of the first project. </p><p>But the auto-generated Java files i.e R.java doesn't get updated on copying. I tried right clicking on the project and clicking on Android Tools -> Fix Project Properties. But nothing changed.</p><p>Any pointers on what I am doing wrong would be much appreciated.</p>","323404","","323404","","2010-05-20 14:08:25","2012-01-01 10:44:07","Combining packages from different projects into a single project in eclipse","<android><eclipse><packages>","3","0","2","",""
"2872996","1","2873471","","2010-05-20 10:52:25","7","6219","<p>I have a <code>ListView</code> with custom <code>ArrayAdapter</code>. Each of the row in this <code>ListView</code> has an icon and some text. These icons are downloaded in background,cached and then using a callback, substituted in their respective <code>ImageViews</code>. The logic to get a thumbnail from cache or download is triggered every time <code>getView</code>() runs.</p><p>Now, according to Romain Guy:</p><blockquote>  <p>""there is absolutely no guarantee on  the order in which getView() will be  called nor how many times.""</p></blockquote><p>I have seen this happen, for a row of size two getView() was being called six times!</p><p>How do I change my code to avoid duplicate thumbnail-fetch-requests and also handle view recycling? </p><p>Thanks.</p>","236128","","222815","","2010-05-24 14:48:11","2013-07-09 09:12:32","Best way to handle multiple getView calls from inside an Adapter","<android><listview>","5","0","4","",""
"2873173","1","2873995","","2010-05-20 11:22:11","1","925","<p>When you take a picture or looks at one in the album, there is a ""share-button"" visible. Is it possible to hook-in your own item to that list, so I can share the picture via my own app? If so, how do I do that?</p>","346027","","","","","2011-04-07 23:48:35","Hook in your own item to the ""share-list""","<android>","2","0","","",""
"2873298","1","11272039","","2010-05-20 11:42:44","3","705","<p>I have a question that is pretty similar to <a href=""http://stackoverflow.com/questions/2870432/how-can-i-get-jquery-uis-draggable-and-sortable-functions-to-work-on-the-iphone"">this</a> one.</p><p>Is it possible to make the jQuery UI <a href=""http://jqueryui.com/demos/draggable/"" rel=""nofollow"">draggable</a> and sortable interaction work on in the Android browser?</p>","229189","","","","","2012-06-30 06:35:33","How can I get jQuery UI’s Draggable and Sortable functions to work on the Android browser?","<jquery><android><jquery-ui><touch>","1","1","2","",""
"2873437","1","","","2010-05-20 12:01:31","1","524","<p>hi i am implementing registration form adding date field  then click icon to display date dialog window  then limit date validation in system date below date only how can implement the validation</p><p>protected Dialog onCreateDialog(int id)     {</p><pre><code>Calendar c = Calendar.getInstance();int cyear = c.get(Calendar.YEAR);int cmonth = c.get(Calendar.MONTH);int cday = c.get(Calendar.DAY_OF_MONTH);switch (id) {case DATE_DIALOG_ID:return new DatePickerDialog(this,  mDateSetListener,  cyear, cmonth, cday);        }    return null;    }private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {String date_selected = String.valueOf(monthOfYear+1)+"" /""+String.valueOf(dayOfMonth)+"" /""+String.valueOf(year);EditText birthday=(EditText) findViewById(R.id.EditTextBirthday);    birthday.setText(date_selected);    }};public void onClick(View v) {if(v == b1)showDialog(DATE_DIALOG_ID);    }}**showing in system date in below dates only how can implemented</code></pre><p>some solution  in running year to below years are display  not incrementing above years this condition are appliying validations how can implemented ?</p>","254790","","254790","","2010-05-21 07:48:38","2010-05-21 07:48:38","In registration form adding date dialogbox how can apply validation in system date in dialog ends with system date in android","<android>","0","2","1","",""
"2873469","1","3737569","","2010-05-20 12:06:32","3","4424","<p>I am trying to use the Wifimanager to calculate the Signal Level of the access points found during a scan.</p><p>I am using the following method:</p><p><a href=""http://developer.android.com/intl/de/reference/android/net/wifi/WifiManager.html#calculateSignalLevel%28int,%20int%29"" rel=""nofollow"">WifiManager.calculateSignalLevel(int, int)</a></p><p>But it appears to always return the same int no matter what the RSSI level is.</p><p>Here is my code:</p><hr><pre><code>public int calculateQoS(int aRSSI){    signalLevel = WifiManager.calculateSignalLevel(RSSI, 5);    return signalLevel;}</code></pre><hr><pre><code>public void testCalculateQoS(){            Log.d(""signal"", ""signal = : ""                    + connMonitor.calculateQoS(-44)                    + "" "" + connMonitor.calculateQoS(-80)                    + "" "" + connMonitor.calculateQoS(-120)                    + "" "" + connMonitor.calculateQoS(-20));        }</code></pre><p>The logging outputs 1 for all the test cases for calculateQoS(int).</p><p>Am I missing something simple here? Why is the SignalLevel always 1?</p>","243999","","","","","2013-04-02 21:59:48","Issue with WifiManager.calculateSignalLevel(RSSI, 5)","<android><rssi><wifimanager>","3","0","4","",""
"2873568","1","2966425","","2010-05-20 12:19:51","35","28991","<p>In Tim Bray's latest Android <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"">blog post</a> he mentions the ""dashboard"" ui pattern (what is used for the Twitter app, Facebook app, etc.  Is this layout as simple as a GridView with Buttons or is it something else?</p><p><strong>Update:</strong></p><p>The <a href=""https://gist.github.com/882650"">DashboardLayout</a> was released by Roman Nurik last night. It is a derivative of the layout used in the Google IO 2010 app.</p>","297762","","297762","","2011-03-23 12:37:17","2012-07-16 18:05:28","Android Dashboard Pattern","<android><layout><dashboard>","8","2","45","",""
"2873887","1","8127628","","2010-05-20 12:59:24","2","1601","<p>I'm doing an AppWidget and in its settings I'm letting the user enable/disable text shadow. Since I can't invoke the shadow method through the RemoteViews class, I'm doing a ""draw"" method that dynamically paints the widget and its container.</p><p>When drawing the text though, it gets kinda blurred and not that crisp like when using a TextView. The only code I've used for the text painting is:</p><pre><code>Paint p = new Paint();p.setAntiAlias(true);p.setColor(Color.WHITE);</code></pre><p>Are there any other magic I need to do for it to become more crisp?</p>","346115","","","","","2014-03-09 18:27:45","Render crisp text using Canvas.drawText in Android","<android><android-widget>","3","0","","",""
"2873944","1","2873975","","2010-05-20 13:07:07","3","3784","<p>My input is a InputStream which contains an XML document. Encoding used in XML is unknown and it is defined in the first line of XML document.From this InputStream, I want to have all document in a String.</p><p>To do this, I use a BufferedInputStream to mark the beginning of the file and start reading first line. I read this first line to get encoding and then I use an InputStreamReader to generate a String with the correct encoding.</p><p>It seems that it is not the best way to achieve this goal because it produces an OutOfMemory error.</p><p>Any idea, how to do it ?</p><pre><code>    public static String streamToString(final InputStream is) {    String result = null;    if (is != null) {        BufferedInputStream bis = new BufferedInputStream(is);        bis.mark(Integer.MAX_VALUE);        final StringBuilder stringBuilder = new StringBuilder();        try {            // stream reader that handle encoding            final InputStreamReader readerForEncoding = new InputStreamReader(bis, ""UTF-8"");            final BufferedReader bufferedReaderForEncoding = new BufferedReader(readerForEncoding);            String encoding = extractEncodingFromStream(bufferedReaderForEncoding);            if (encoding == null) {                encoding = DEFAULT_ENCODING;            }            // stream reader that handle encoding            bis.reset();            final InputStreamReader readerForContent = new InputStreamReader(bis, encoding);            final BufferedReader bufferedReaderForContent = new BufferedReader(readerForContent);            String line = bufferedReaderForContent.readLine();            while (line != null) {                stringBuilder.append(line);                 line  = bufferedReaderForContent.readLine();            }             bufferedReaderForContent.close();            bufferedReaderForEncoding.close();        } catch (IOException e) {             // reset string builder            stringBuilder.delete(0, stringBuilder.length());        }          result = stringBuilder.toString();    }else {        result = null;    }    return result;}</code></pre><p>Regards,Quentin </p>","60292","","","","","2013-01-08 11:17:09","Convert InputStream to String with encoding given in stream data","<java><android>","2","0","0","",""
"2874108","1","2879298","","2010-05-20 13:25:32","0","267","<p>Ive got two activities in the same application.the first one is <strong>with</strong> gui(main activity)the second one is a listener which works infinite <strong>without</strong> gui.</p><p>Wierd problem occurs: </p><p>i am running the second activity with a diffrent thread so i could keep on manipulate the gui.. </p><p>but for some reason, the gui losing it's focus for some reason, only when i press 'home' and come back to it, then i can continune maniuplate the gui.</p><p>it feels like after i launch the second activity, the gui activity(the main) is losing the focus.how come?</p><p>in my mainactivity i have:</p><p>setContentView(R.layout.main);</p><p>and its setted as the launcher in the manifest.</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-11-05 16:00:26","remine focus on the main activity (while switching activities)","<android>","3","0","","",""
"2874191","1","2874232","","2010-05-20 13:35:39","27","36455","<p>i have created a custom dialog class</p><pre><code>public class NewPost extends Dialog{// functionality}</code></pre><p>now my requirement is to create listview inside it. i know we can create textboxes,buttons,dropdown list inside it.</p><p>but in order to create list view we should inherit our class from listActivity class</p><p>what you suggest is it possible or not if yes then how to achieve this using any interface or what?</p><p>any help would be appriciated.</p>","249991","","133802","","2010-05-20 13:39:49","2013-04-12 08:05:12","is it possible to create listview inside dialog?","<android><listview><dialog>","4","0","13","",""
"2874276","1","2875356","","2010-05-20 13:45:26","37","17051","<p>My problem is that when I start application and user didn't open my <code>PreferenceActivity</code> so when I retrieve them don't get any default values defined in my preference.xml file.</p><p>preference.xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""    android:key=""applicationPreference"" android:title=""@string/config""    &gt;    &lt;ListPreference            android:key=""pref1""            android:defaultValue=""default""            android:title=""Title""            android:summary=""Summary""            android:entries=""@array/entry_names""            android:entryValues=""@array/entry_values""            android:dialogTitle=""@string/dialog_title""    /&gt;                  &lt;/PreferenceScreen&gt;</code></pre><p>Snippet from my main Activity (<code>onCreate</code> method):</p><pre><code>    SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this);            String pref1 = appPreferences.getString(""pref1"", null);</code></pre><p>In result I end up with a <code>null</code> value.</p>","296427","","296427","","2010-11-08 19:01:48","2011-05-17 02:15:31","Initialize preferences from XML in the main Activity","<android><xml><preferences><android-preferences>","3","0","14","2013-10-31 06:17:39",""
"2874310","1","2874452","","2010-05-20 13:49:15","0","1364","<p>I use this code to generate a spinner in my app: </p><pre><code>    subCatAdapter = new ArrayAdapter&lt;Subcategory&gt;(this, android.R.layout.simple_spinner_item, subCategories);    subCatAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);</code></pre><p>On my device (Motorola Milestone) and in the emulator this looks like the standard gray spinner widget.On of my colleagues uses a Motorola Backflip and on his device the Spinner is black.Now its very hard to read the font in the spinner. </p><p>What do I have to do to use my own view for the spinner? I don't mind to have the gray spinner on all devices, but it should always look the same on all devices.</p>","114066","","828193","","2013-08-31 11:11:54","2013-08-31 11:11:54","My Spinner Widgets look different on different devices. How can I define a own Spinner that looks the same on all handsets?","<android><layout><spinner><device>","1","0","","",""
"2874320","1","","","2010-05-20 13:50:14","0","364","<p>I need a gridview to show 9 items. I've written a custom baseadapter.</p><p>However, I have a problem with the position in the <code>getView</code> method. It looks like this gridview misses the 7th item. The code looks like this:</p><pre><code>public class ImageAdapter extends BaseAdapter {private Hashtable&lt;String, LayoutDTO&gt; menuHashtable =  Global.menuHashtable;private LayoutInflater mInflater;public ImageAdapter(Context context) {    this.mInflater = LayoutInflater.from(context);}@Overridepublic int getCount() {    //Log.v(""size........"", Integer.toString(menuHashtable.size()));    return menuHashtable.size();}@Overridepublic Object getItem(int position) {    return menuHashtable.get(Integer.toString(position));}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    LayoutDTO lDto = menuHashtable.get(Integer.toString(position));    ViewHolder vHolder = new ViewHolder();    //if (convertView == null) {        if (lDto != null) {            String titleString = lDto.getTitle();            Bitmap iconBitmap = lDto.getIcon();            convertView = mInflater.inflate(R.layout.custombutton, null);            vHolder.icon = (ImageView) convertView                    .findViewById(R.id.imageicon);            vHolder.icon.setImageBitmap(iconBitmap);            vHolder.text = (TextView) convertView                    .findViewById(R.id.icontitle);            int index = titleString.indexOf(""\u0026"");            if (index != -1) {                String title1 = titleString.substring(0, index + 1).trim();                String title2 = titleString.substring(index + 1,                        titleString.length()).trim();                vHolder.text.setLines(2);                String newtitle = title1 + ""\n"" + title2;                vHolder.text.setText(newtitle);            } else {                vHolder.text.setLines(2);                String newtitle = titleString + ""\n"" + "" "";                vHolder.text.setText(newtitle);            }            convertView.setTag(vHolder);        }        else{            Log.v(""null........"",Integer.toString(position));        }    return convertView;}private class ViewHolder {    ImageView icon;    TextView text;}</code></pre><p>}</p><p>The log shows this:</p><pre><code>05-20 21:37:16.066: VERBOSE/title...........(158): Dining  005-20 21:37:16.105: VERBOSE/title...........(158): Dining  005-20 21:37:16.125: VERBOSE/title...........(158): Dining  005-20 21:37:16.135: VERBOSE/title...........(158): Dining  005-20 21:37:16.166: VERBOSE/title...........(158): Dining  005-20 21:37:16.185: VERBOSE/title...........(158): Entertainment  105-20 21:37:16.195: VERBOSE/title...........(158): Shopping  205-20 21:37:16.195: VERBOSE/title...........(158): Fashion  305-20 21:37:16.205: VERBOSE/title...........(158): Health &amp; Beauty  405-20 21:37:16.215: VERBOSE/title...........(158): Supermarkets  505-20 21:37:16.226: VERBOSE/title...........(158): Auto Services  605-20 21:37:16.236: VERBOSE/title...........(158): Travel &amp; Accommodation  805-20 21:37:16.316: VERBOSE/title...........(158): Dining  005-20 21:37:16.326: VERBOSE/title...........(158): Dining  005-20 21:37:16.336: VERBOSE/title...........(158): Dining  005-20 21:37:16.345: VERBOSE/title...........(158): Dining  0</code></pre>","275788","","1128737","","2012-01-11 16:27:44","2012-01-11 16:27:44","Gridview missing an item","<android>","0","5","","",""
"2874347","1","2880510","","2010-05-20 13:54:13","18","14364","<p>Following directions on Android's main website to pull down sources, I'm looking at this command to initialize repo for the cupcake branch:</p><p><code>repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake</code></p><p>How can I view all available branches besides cupcake, i.e eclair, donut, etc...?</p>","204317","","114066","","2010-05-21 09:00:31","2012-08-24 00:08:54","How to display available branches in Android source tree?","<git><android><android-ndk><repository>","4","0","10","",""
"2874394","1","2977168","","2010-05-20 13:58:07","0","1827","<p>I have an activity with a ListView which is populated through a custom ArrayAdapter.  There is an array of objects which have a Boolean property called 'isRead'.  Based on the value of this property, I want to set the typeface of one of the TextViews in the row to either 'normal' or 'bold'.  I also set the color of the text to either 'gray' or 'black'</p><p>When the Activity initially starts up, everything works as expected.  If isRead is true, the text is gray with a normal font.  Once I scroll down the list and then scroll up again, the text of an object where isRead is true is colored gray, but the font is bold.</p><p>Am I doing something wrong here?  Or is this some Android strangeness?</p><p>ArrayAdapter code is below:</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {       LayoutInflater inflater = getLayoutInflater();       View row = convertView;       ArticleListRowViewWrapper wrapper=null;       if (row == null) {           row=inflater.inflate(R.layout.articlesrow, parent, false);           wrapper = new ArticleListRowViewWrapper(row);           row.setTag(wrapper);       } else {           wrapper = (ArticleListRowViewWrapper)row.getTag();       }       Article a = articles.get(position);       String dateString = df.format(a.getPubDate());       TextView titleLabel=wrapper.getTitleLabel();       Typeface tf = titleLabel.getTypeface();       if (a.getIsRead()) {           titleLabel.setTextColor(Color.GRAY);           titleLabel.setTypeface(tf, Typeface.NORMAL);       } else {           titleLabel.setTextColor(Color.BLACK);           titleLabel.setTypeface(tf, Typeface.BOLD);       }       titleLabel.setText(a.getTitle());       TextView dateLabel =wrapper.getDateLabel();       dateLabel.setText(dateString);       return row;    }}</code></pre>","346166","","","","","2010-06-13 21:11:57","Setting TextView properties in a ListView - Strange Result","<android>","1","4","1","",""
"2874410","1","","","2010-05-20 14:00:24","3","4064","<p>I'm going to develope a Android program, with a photo display on screen. And there are some text and drawing (circle/Rect) over the photo. The text and drawing will change when use touch on the screen. How can I implement? SurfaceView? ItemizedOverlay? or anything else?</p><p>Pls. advise. Thx all:)</p>","346158","","","","","2010-05-20 14:26:51","How to add layers on View?","<android><view><drawing><canvas><photo>","1","0","","",""
"2874412","1","","","2010-05-20 14:00:57","5","4745","<p>Hi i have one application which play with content provider(contacts etc) now when i uninstall my application i want to arranger the original data of content provider.</p><p>Is there any way, if my application is going uninstall at that time i get event and do my work.</p><p>Thanks    </p>","193583","","","","","2012-03-21 11:03:47","Get application uninstall event in android","<android><uninstall>","1","0","1","",""
"2874437","1","","","2010-05-20 14:03:22","2","223","<p>I'm trying to implement filtering using ExpandableListView and SimpleCursorTreeAdapter (its subclass). How can I specify which data (maybe cursor field or TextView text) to use for filtering?</p><p>Thanks</p>","218783","","1012284","","2012-06-03 12:07:16","2012-06-03 12:07:16","Filtering with SimpleCursorTreeAdapter","<android><sqlite><listview>","0","1","","",""
"2874537","1","3173594","","2010-05-20 14:14:48","28","28822","<p>I've added a RatingBar in a layout :</p><pre><code>&lt;RatingBar android:id=""@+id/ratingbar""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:numStars=""5""            android:stepSize=""1.0""            &gt;&lt;/RatingBar&gt;   </code></pre><p>But the default style for the rating bar is too large.I've trie to change it by adding the android style : <code>style=""?android:attr/ratingBarStyleSmall""</code></p><p>But the result is too small and it's impossible to set a rate with this property.</p><p>How could i do?</p>","336675","","","","","2013-07-13 18:14:31","How to make a smaller RatingBar?","<android><coding-style><android-widget><rating>","6","0","29","",""
"2874629","1","","","2010-05-20 14:26:23","2","2835","<p>I'm trying to mimic the success of gilead (<a href=""http://stackoverflow.com/q/2660968/398460"">here</a>) but so far his code in my app fails.  I've tried multiple UUIDs but nothing works.  When I run <code>sdptool records [address]</code> I get:</p><pre><code>$ sdptool records 00:12:F3:04:80:80sdptool records 00:12:F3:04:80:80Service Name: SPPService RecHandle: 0x10001Service Class ID List:""Serial Port"" (0x1101)Protocol Descriptor List:""L2CAP"" (0x0100)""RFCOMM"" (0x0003)Channel: 1Failed to connect to SDP server on 00:12:F3:04:80:80: Connection timed out</code></pre><p>It shows the device is on channel 1 so I don't understand why the code does not work. I'm running Android 2.1. I cannot access the other device in any way and while debugging tmpsock has all the correct values before <code>.connect()</code> is called.</p><p>My code</p><pre><code>public void test(BluetoothDevice d) throws Exception{ BluetoothSocket tmpsock = null; OutputStream out = null; InputStream in = null; int port = 1; Method m = d.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class }); tmpsock = (BluetoothSocket)m.invoke(d, port); Log.d(""BT"", ""CONNECTING!!!!""); tmpsock.connect(); Log.d(""BT"", ""CONNECTED!"");    ...}</code></pre>","346208","","135978","","2011-08-30 17:23:27","2011-08-30 18:02:39","Android SPP bluetooth to non Android device","<android><bluetooth><rfcomm>","1","0","0","",""
"2874705","1","2875311","","2010-05-20 14:32:52","1","205","<p>Currently I supply a user with a URL to click on to download my j2me application.  This URL includes their user id as a parameter, a servlet takes this information and dynamically creates a jad file that includes this user id , thus making the user id available to the j2me app.</p><p>However, I am now using j2me polish to compile my program and thus have the compiled .apk for this same program.  However, I cannot work out how to make this information accessible to the the compiled program as there is no jad / jar mechanism.  The information is only available at the time of download.</p><p>Any suggestions gratefully received!  (is this even possible in an android application?)</p><p>Thanks,</p><p>CJ</p><p>p.s. I have to assume complete illiteracy from the users point of view, i.e. I cannot ask them to first install other programs etc, it needs to be a simple ""click on the link"" -> ""get the app"" sort of thing.</p>","200891","","","","","2010-05-20 15:34:28","How can I include information to my android application post compilation?","<android><dynamic><java-me><j2mepolish>","1","0","","",""
"2874743","1","2875006","","2010-05-20 14:36:58","17","13376","<p>I need to use volume buttons to control a variable parameter in my application. I use <code>Activity.onKeyDown</code> to get notified when the button is pressed but the media volume is also increased.<br>Android is doing something like below when I press the volume key:</p><ol><li>increase media / ringtone volume  </li><li>pass the event to my application</li></ol><p>Is there a way to avoid increasing the system volume and use volume key only for my application?</p>","225691","","626273","","2011-11-16 13:05:15","2012-10-06 22:15:45","Android - Volume Buttons used in my application","<android>","2","0","15","",""
"2875010","1","2876134","","2010-05-20 15:05:19","2","507","<p>I'd like users to be able to send emails from my app and the client would like the message body to be html-formatted.  They look nicer and the message includes a rather ugly url that would be better placed inside an anchor tag.</p><p>I've seen some older queries on the web asking how to do this but have not been able to find a definitive answer.</p><p>Is it possible to use an Intent.ACTION_SEND (or some other method) to send an email pre-set with an html-formatted message body?</p>","346166","","","","","2010-05-20 17:09:50","Sending html text in an email","<android>","1","0","2","",""
"2875227","1","2875330","","2010-05-20 15:27:04","5","7999","<p>I´m using a checkbox in my code that when its checked it makes a textview and a editText visibles, but if I uncheck de checkbox they continue being visible instead of dissapear.</p><p>Here is the code:</p><pre><code>final CheckBox save = (CheckBox) findViewById(R.id.checkbox);        save.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks, depending on whether it's now checked                if (((CheckBox) v).isChecked()) {                    nameText.setVisibility(1);                    editName.setVisibility(1);                } else {                    nameText.setVisibility(0);                    editName.setVisibility(0);                }            }        });</code></pre><p>And part of the xml which is inside an Relative Layout:</p><pre><code>    &lt;LinearLayout android:id=""@+id/linearLayout3""            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below = ""@+id/linearLayout2""&gt;    &lt;TextView android:id=""@+id/text""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:text=""@string/name""         android:visibility=""invisible""/&gt;    &lt;EditText android:id=""@+id/name""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_weight=""1""        android:visibility=""invisible""/&gt;        &lt;CheckBox android:id=""@+id/checkbox""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/save"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>What should i do to make the textView and EditText dissapear when i uncheck the checkbox?</p><p>Thank you!</p>","341150","","","","","2011-10-28 05:50:22","Android visibility issue with checkbox","<android><layout><checkbox><view><visibility>","3","1","","",""
"2875385","1","2876317","","2010-05-20 15:42:04","3","769","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2764733/android-checking-if-headphones-are-plugged-in"">Android: Checking if headphones are plugged in</a>  </p></blockquote><p>Is there a way to check if earphones are connected to the Android device? Some kind of audio routing property or something?</p>","98094","","","","","2010-05-20 17:33:46","Android earphone jack","<java><android>","1","0","","2010-05-21 01:24:31",""
"2875487","1","","","2010-05-20 15:51:58","10","1039","<p>I'm beginning the process of learning the ins and outs of developing sites for mobile web browsers.  Are there any good resources/communities online that discuss mobile specific site development issues?</p><p>My initial understanding is that to cover different phones you need to build one site that is enabled for browsers with the webkit engine (iphone, android, etc.) and another more basic site for other older browsers, is this assumption correct?</p><p>Also what does developing for webkit mean exactly? How is it different than just using javascript/css/html?  Is it the same except that you limit yourself to webkit specific functions and css? I looked on the webkit site, but it didn't explain it in those terms.</p><p>Are there any other snafus I need to watch out for when developing for mobile browsers?</p>","346304","","","","","2010-06-17 15:16:35","Mobile Specific Site Development. Where to start?","<iphone><android><mobile><webkit><mobile-webkit>","5","0","2","",""
"2875630","1","5675546","","2010-05-20 16:06:00","10","4440","<p>This is a simple question. Is there a way to allow users to enter in a comment and or rating for my app from directly within my app and have that data posted back to the Android Market? If so, what would the code for that look like if I used an EditText view to allow user input? If not, then is my only other option directly linking to my app in the Market (i.e. the user clicks the link in my app, or a button, and the Market app launches with my app page displayed)? For example:</p><pre><code>view.setOnClickListener( new OnClickListener(){    public void onClick(View v) {        startActivity( new Intent( Intent.ACTION_VIEW,           Uri.parse(""market://details?id=packagename"") ) );    }}</code></pre><p>*where ""packagename"" is replaced by my app's package name from the manifest.</p><p>Thanks.</p>","272302","","","","","2011-04-26 11:19:02","Android -- How to post app rating/comments to Market from within app?","<android><comments><rating><google-play><marketplace>","2","1","3","",""
"2876116","1","","","2010-05-20 17:07:33","5","1053","<p>I can set max line in my TextView in layout xml file.In my code, after I call setText() to the TextView, how can I find out if the text content has been cut off (i.e. the text is longer than the max line)?</p><p>Thank you.</p>","339688","","","","","2013-08-23 20:56:42","How to find out if TextView text content has been cut off","<android>","2","0","1","",""
"2876117","1","","","2010-05-20 17:07:50","0","801","<p>I have problems with switching between activities.</p><p>I have two TabActivities (A and B), each of of tab activity has 4 tabs with ListActivity. I am trying to show B activity onListItemClick.</p><p>Code on click is:</p><pre><code>Intent intent = new Intent(getApplicationContext(), TabBActivity.class);startActivity(intent);</code></pre><p>My manifest file is following:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/app_icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;     &lt;activity android:name="".SplashScreen""                  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="".TabAActivity""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.TabAActivity"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".TabAListActivityA"" android:label=""AA""/&gt;        &lt;activity android:name="".TabAListActivityB"" android:label=""AB""/&gt;        &lt;activity android:name="".TabAListActivityC"" android:label=""AC""/&gt;        &lt;activity android:name="".TabBActivity"" android:label=""B""/&gt;        &lt;activity android:name="".TabAListBctivityA"" android:label=""BA""/&gt;        &lt;activity android:name="".TabAListBctivityB"" android:label=""BB""/&gt;        &lt;activity android:name="".TabAListBctivityC"" android:label=""BC""/&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>Is my manifest correct or maybe something is wrong with code? I would appreciate any help on this topic.</p>","346362","","","","","2010-05-20 17:07:50","Start TabActivity from ListActivity (which is content of parent TabActivity) in Android","<android><listactivity>","0","2","","",""
"2876229","1","2876324","","2010-05-20 17:23:19","1","346","<p>How to access another third party application from my application in android?</p>","267269","","267269","","2010-05-20 18:14:08","2011-09-26 10:43:44","Accessing another third party app in android","<android>","2","0","","",""
"2876236","1","2877122","","2010-05-20 17:24:28","3","4586","<p>As we Android developers know, the <a href=""http://developer.android.com/intl/de/reference/android/database/sqlite/SQLiteDatabase.html"" rel=""nofollow"">SQLiteDatabase</a> <code>execSQL</code> method can execute only one statement. </p><p>The doc says:</p><blockquote>  <p>Execute a single SQL statement that is not a query. For example, <code>CREATE TABLE</code>, <code>DELETE</code>, <code>INSERT</code>, etc. Multiple statements separated by <code>;</code>s are not supported.</p></blockquote><p>I have to load in a batch of records, 1000 and counting.<br>How do I insert these efficiently?<br>And what's the easiest way to deliver these SQLs with your apk?</p><p>I mention, there is already a system database and I will run this on the <code>onUpdate</code> event.</p><p>I have this code so far:</p><pre><code>List&lt;String[]&gt; li = new ArrayList&lt;String[]&gt;();        li.add(new String[] {                ""-1"", ""Stop"", ""0""        });        li.add(new String[] {                ""0"", ""Start"", ""0""        });    /* the rest of the assign */try {        for (String[] elem : li) {            getDb().execSQL(                    ""INSERT INTO "" + TABLENAME + "" ("" + _ID + "","" + NAME + "","" + PARSE_ORDER                            + "") VALUES (?,?,?)"", elem);        }    } catch (Exception e) {        e.printStackTrace();    }</code></pre>","243782","","301832","","2010-07-21 10:00:20","2010-07-21 10:00:20","Efficient batch SQL query execution on Android, for upgrade database","<android><sqlite><upgrade>","2","0","4","",""
"2876457","1","2876549","","2010-05-20 17:53:10","0","425","<p>Is it possible to cancel an event from within the onKey method. I only want to allow numbers 0 through 9. If another key was pressed then I want to cancel the key press</p><pre><code>public boolean onKey(View v, int keyCode, KeyEvent ev) {            // TODO Auto-generated method stub            if(keyCode &lt;30 || keyCode &gt; 39){               //Cancel Event            }            return false;        }</code></pre>","244190","","","","","2010-05-20 18:06:13","Cancel onKey Event from onKey method","<android><listeners>","1","0","","",""
"2876980","1","3002529","","2010-05-20 19:06:36","0","1387","<p>I would like to launch the market from a preference screen but when I try to do this I obain a java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.action.test/.ui.activities.Test } from ProcessRecord{44db1300 3697:com.pippo.pluto/10067} (pid=3697, uid=10067) requires null.This is my code: </p><pre><code>startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(""market://search?q=pname:com.action.test"")));</code></pre><p>what am I doing wrong?</p><p>Thanks in advanceTobia</p>","269585","","","","","2010-06-09 01:19:10","SecurityException: Permission Denial requires null","<android><activity><android-intent>","1","0","","",""
"2877140","1","2890967","","2010-05-20 19:31:40","3","1905","<p>Android 2.2 release notes have just been released. ActivityManager.restartPackage method has been deprecated and the description is:</p><blockquote>  <p>the previous behavior here is no longer available to applications because it allows them to break other applications by removing their alarms, stopping their services, etc. </p></blockquote><p>Instead 2.2 has given another tool for pesky ""task killer"" apps by introducing new ActivityManager.killBackgroundProcesses method. </p><p><a href=""http://developer.android.com/reference/android/app/ActivityManager.html#killBackgroundProcesses%28java.lang.String%29"" rel=""nofollow"" title=""More info"">More Info</a></p><p>Can someone explain whether ActivityManager.killBackgroundProcesses will kill our scheduled alarms? </p><p>If so, deprecating ActivityManager.restartPackage was pointless as ""task killer"" will now abuse ActivityManager.killBackgroundProcesses.</p>","290469","","243782","","2010-05-20 19:59:29","2010-06-18 00:38:20","Android 2.2 deprecates restartPackage but adds another headache","<android><android-sdk-2.2>","2","2","","",""
"2877166","1","","","2010-05-20 19:34:14","1","1185","<p>I am getting reports of 'Can't create handler inside thread that has not called Looper.prepare()' once I added ScoreNinja to my Android app, and released it to the market.</p><p>It seems that it isn't happening all the time as the ScoreNinja highscore has lots of entries from users.</p><p>I have looked on the web for help but there are no clear directions on what to do.</p><p>I have used the ScoreNinja code exactly as shown on the scoreninja website.</p><p>Thanks for any help.</p><p>Dave B</p><p>BTW If anyone is having problems with ScoreNinja only displaying one score, check to see if the launchmode is not set to 'singleinstance' in your manifest. This fixed it for me!</p>","327828","","","","","2010-06-30 16:08:06","Android: I am getting reports of 'Can't create handler inside thread that has not called Looper.prepare()' after adding ScoreNinja","<android><scoreninja>","2","0","","",""
"2877204","1","2877284","","2010-05-20 19:39:24","1","1165","<p><a href=""http://img139.imageshack.us/img139/1203/devicei.png"" rel=""nofollow"">http://img139.imageshack.us/img139/1203/devicei.png</a></p><p>I've seen this in a few apps, and i have expiremented with both PopupWindow, and AlertDialog and I was confused which this was.</p><p>Thanks</p>","346485","","13992","","2010-05-20 19:40:32","2010-05-20 19:49:46","Is this an example of a AlertDialog or PopupWindow in Android?","<android><dialog>","1","0","0","",""
"2877567","1","2877622","","2010-05-20 20:30:07","7","6964","<p>Is there any tool that will allow me to browse databases on my Android device? Something like Sql Management Studio - you know GUI tool that displays databases, tables, row in tables, etc.</p><p>I'm using Eclipse for development (if it is important for plug-in suggestions).</p><p>Thanks!</p>","237858","","","","","2013-08-17 21:25:50","Android - viewing SQLite databases on device?","<android><sqlite>","4","1","1","",""
"2877754","1","2884523","","2010-05-20 20:56:49","1","2695","<p>I have a PhoneGap app that I'm testing on webOS, Android, and iPhone. I'm using physical devices as well as emulators (the ones that come with their respective SDKs, not the <a href=""http://blogs.nitobi.com/yohei/2009/04/01/phonegap-air-simulator-in-development/"" rel=""nofollow"">PhoneGap emulator</a>).</p><p>Part of the code uses the <code>navigator.notification.vibrate()</code> and <code>navigator.notification.beep()</code> functions.</p><p>All the physical devices I'm using either perform the behavior or ignore it if they're not capable (e.g., the iPod can't vibrate). However, the emulators behave differently.</p><p>The Android emulator kills the app whenever the <code>beep()</code> function is called. The iPhone emulator causes the app to hang whenever the <code>vibrate()</code> function is called.</p><p>Is there any way to get the emulators to ignore those function calls when they are unable to execute them? That is, is there a way to get them to degrade gracefully so I can test the app both places without having to modify the code specifically for the emulators?</p>","191521","","","","","2010-05-21 18:21:01","PhoneGap's vibrate() and beep() functions break in iPhone, Android emulators","<iphone><android><ios-simulator><android-emulator><phonegap>","1","0","","",""
"2877828","1","2877881","","2010-05-20 21:03:49","30","34019","<p>when editing a String in XML I need to add line breaks. And I wanted to ask what is the RIGHT form when programming for android? Because <code>&lt;br&gt;</code> works but ECLIPSE marks the area as problematic. If I check out suggestions Eclipse tells me that I shall add a end tag <code>&lt;/br&gt;</code> - IF I add that the line break dissapears...</p><p>So the one works but is marked as problematic, the other works not but Eclipse tells me its ok..</p><p>What form shall I use?</p>","344344","","212218","","2012-08-23 00:35:21","2012-12-28 12:48:29","Line Break in XML formatting? ","<xml><android><line><break>","4","1","4","",""
"2877938","1","3339203","","2010-05-20 21:19:44","5","2951","<p>I'm writing a PhoneGap application that sends requests to a central database. It needs to be able to identify the unique devices that connect to it.</p><p>PhoneGap's <a href=""http://docs.phonegap.com/docs/device""><code>device.uuid</code> property</a> would seem to do the trick. On webOS and iPhone, I get back a unique string of alphanumeric characters, which will satisfy my need. However, the Android devices I've tested (Motorola Droid and the Android SDK emulator, both running Android 2.1) return ""undefined"" as the <code>device.uuid</code>.</p><p><code>device.platform</code> and <code>device.name</code> return correct values on all three platforms, so the problem doesn't have to do with the <code>device</code> object itself (it's defined in the code blocks where I use it).</p><p>Is this an Android limitation? A problem with PhoneGap?</p><p>Is there any other way to get such a globally unique identifier if not through <code>device.uuid</code>?</p><p>EDIT: It appears that the <code>deviceready</code> event is never getting fired, which needs to happen before the <code>device.uuid</code> property becomes available.</p>","191521","","191521","","2010-05-24 16:14:47","2013-02-21 05:15:05","device.uuid undefined in PhoneGap on Android?","<android><phonegap>","2","2","","",""
"2878403","1","","","2010-05-20 22:45:40","1","2782","<p>I recently started Android programming and was working on my first program which displays a historic text document, sectioned by tabs via TabHost.  I have limited my program to one activity and merely used setContent in my TabSpec's to switch between different XML views.</p><p>The document has both unedited and corrected versions of the text for which I have built text views to accommodate. I wanted to implement the standard menu to have buttons to ""view corrected"" and ""view original"" and switch the content of the tabs which have changes (without altering the tabs or their indicators).</p><p>I've read on the TabHost API and there is no way to edit existing tab content with setContent() of TabSpec; and AFAIK TabWidget only affects the actual tabs, not the content that is displayed upon pressing them.</p><p>I've thought about creating a new class which extended TabHost and super() all of the original methods, while including one more which updated the mTabSpec list.</p><p>My question would be, how would I <strong>update</strong> the frameLayout view of a specific tab to display content I specify?</p>","346612","","","","","2010-05-20 23:07:07","Android: TabHost How To: set new content in existing tabs upon menu button?","<xml><android><android-tabhost><tabwidget>","1","0","","",""
"2878442","1","3860240","","2010-05-20 22:53:50","3","6201","<p>An Android app I am building requires web authentication for users to make data calls. In Adobe AIR and later the iPhone, we did this by rendering a login page in a webview-equivalent page and setting a cookie when the user signs in. Subsequent data calls use the same Cookie Jar and so are seen as authenticated.</p><p>In the Android version, I authenticate the user using a WebView and then once thats done, I make a data call using DefaultHttpClient, however I cant seem to load the data on the second call.</p><p>Is there some cookie gotcha I am missing? I imagine the HTTPClient and WebView would share the same Cookie space. Am I wrong?</p>","101876","","","","","2013-06-17 22:26:15","Shared Cookies between WebView and HTTPClient?","<android><webview><httpclient>","1","0","6","",""
"2878536","1","","","2010-05-20 23:12:15","2","5306","<p>Fastest 2D frame rate possible with android NDK, my try included, better options available?</p><p>I used the NDK and OpenGL ES 2.0 to display a frame as a texture on a GL_TRIANGLE_STRIP.This was done on a HTC Desire, same hardware as Nexus One.I tried to load multiple GL_RGBA textures and switch between the textures, because the normal fill rate with a single texture was disappointingly low:</p><ul><li>1 texture:   4.78 fps</li><li>2 textures: 19.68 fps</li><li>3 textures: 20.18 fps</li><li>4 textures: 28.52 fps</li><li>5 textures: 29.01 fps</li><li>6 textures: 30.32 fps</li></ul><p>I think even 30.32 fps RGBA is still too slow.</p><p>So is this the way to go to achieve the fastest 2D frame rate (with same quality)?Any suggestions to speed it up?</p><p>Here is the relevant code, it is based on the hello-gl2 NDK example:</p><p>=== GL2JNIView.java :</p><pre><code>init(false, 0, 0);ConfigChooser(5, 6, 5, 0, depth, stencil);</code></pre><p>=== gl_code.cpp : </p><pre><code>#include &lt;GLES2/gl2.h&gt;#include &lt;GLES2/gl2ext.h&gt;#include &lt;android/log.h&gt;#include &lt;stdlib.h&gt;#include &lt;time.h&gt;typedef unsigned char byte;static int view_width, view_height;static byte* framebuffer;static int framebuffer_size;static GLuint texture_id[6];static const char* vertexSrc = ""precision highp float;\n"" ""precision highp int;\n"" ""attribute vec4 vertexCoords;\n"" ""attribute vec2 textureCoords;\n"" ""varying vec2 f_textureCoords;\n"" ""void main() {\n"" ""  f_textureCoords = textureCoords;\n"" ""  gl_Position = vertexCoords;\n"" ""}\n"";static const char* fragmentSrc  = ""precision highp float;\n"" ""precision highp int;\n"" ""uniform sampler2D texture;\n"" ""varying vec2 f_textureCoords;\n"" ""void main() {\n"" ""  gl_FragColor = texture2D(texture, f_textureCoords);\n"" ""}\n"";static GLuint shaderProgram;static GLint attrib_vertexCoords;static GLint attrib_textureCoords;static GLint uniform_texture;static const GLfloat vertexCoords[] = {-1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0};static const GLfloat textureCoords[] = {0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0};JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_init(JNIEnv * env, jobject obj,  jint width, jint height) { view_width = width; view_height = height; framebuffer_size = 4*view_width*view_height; framebuffer = (byte*)calloc(framebuffer_size, sizeof(byte)); for (int i = 0; i &lt; framebuffer_size; i++) framebuffer[i] = 0; glViewport(0, 0, view_width, view_height); glGenTextures(6, &amp;texture_id[0]); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture_id[0]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture_id[1]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, texture_id[2]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, texture_id[3]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glActiveTexture(GL_TEXTURE4); glBindTexture(GL_TEXTURE_2D, texture_id[4]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glActiveTexture(GL_TEXTURE5); glBindTexture(GL_TEXTURE_2D, texture_id[5]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); shaderProgram = glCreateProgram();  GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);  glShaderSource(vertexShader, 1, &amp;vertexSrc, NULL);  glCompileShader(vertexShader); glAttachShader(shaderProgram, vertexShader);  GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);  glShaderSource(fragmentShader, 1, &amp;fragmentSrc, NULL);  glCompileShader(fragmentShader); glAttachShader(shaderProgram, fragmentShader); glLinkProgram(shaderProgram); glUseProgram(shaderProgram); uniform_texture = glGetUniformLocation(shaderProgram, ""texture""); glUniform1i(uniform_texture, 0); attrib_vertexCoords = glGetAttribLocation(shaderProgram, ""vertexCoords""); glEnableVertexAttribArray(attrib_vertexCoords); glVertexAttribPointer(attrib_vertexCoords, 2, GL_FLOAT, GL_FALSE, 0, vertexCoords); attrib_textureCoords = glGetAttribLocation(shaderProgram, ""textureCoords""); glEnableVertexAttribArray(attrib_textureCoords); glVertexAttribPointer(attrib_textureCoords, 2, GL_FLOAT, GL_FALSE, 0, textureCoords);}JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_step(JNIEnv * env, jobject obj) { static int frame_count = 0; static clock_t last_time = clock(); static int last_frame_count = 0; frame_count++; if (clock()-last_time &gt; 1e7) {  __android_log_print(ANDROID_LOG_INFO, ""libgl2jni"", ""fps: %f"", ((float)frame_count-last_frame_count)/(clock()-last_time)*1e6);  last_time = clock();  last_frame_count = frame_count; } static byte val = 0; val++; if (val == 256) val = 0; for (int i = 0; i &lt; framebuffer_size; i++) framebuffer[i] = val; int tst = frame_count%6; if (tst == 0) {  glActiveTexture(GL_TEXTURE0); } else if (tst == 1) {  glActiveTexture(GL_TEXTURE1); } else if (tst == 2) {  glActiveTexture(GL_TEXTURE2); } else if (tst == 3) {  glActiveTexture(GL_TEXTURE3); } else if (tst == 4) {  glActiveTexture(GL_TEXTURE4); } else if (tst == 5) {  glActiveTexture(GL_TEXTURE5); } glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width, view_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);}</code></pre>","346617","","","","","2011-04-04 11:34:24","Fastest 2D frame rate possible with android NDK, my try included, better options available?","<android><video><opengl-es><frame-rate><glteximage2d>","1","1","1","",""
"2878676","1","","","2010-05-20 23:45:24","2","320","<p>My goal is to launch a video in the YouTube player, and then return to my app. I realize I can't control what's going on in another app, BUT I'm wondering if the YouTube app supports any kind of flags or data set in the calling Intent that might support this functionality.</p><p>Anyone aware of any?</p><p>I cannot find any documentation on the YouTube app/activities. I had to watch the logs just to figure out which activity to call in the first place (so the choose app dialog didn't appear).</p>","325011","","","","","2013-08-08 07:51:36","Are there any Android YouTube Player Flags?","<android><youtube>","1","0","1","",""
"2878694","1","2879582","","2010-05-20 23:51:33","7","5457","<p>Is there a way to check and see if an Activity exists on your device? If I have a youtube video link I want to specify it open in the YouTube PlayerActivity. However, I don't want to crash if for some reason they don't have it.</p><p>Is there a way to check and see if the activity exists? I don't think I can catch the runtime exception since startActivity() doesn't throw it.</p>","325011","","","","","2013-12-31 23:10:10","Determining if an Activity exists on the current device?","<android><activity>","4","0","1","",""
"2878882","1","5740490","","2010-05-21 00:43:09","5","11703","<p>How to add additional font in android environment? I need to make a font like LCD with pale background numbers like this:</p><p><a href=""http://www.androidfreeware.net/img2/gps_speedometer_android_1.png"">http://www.androidfreeware.net/img2/gps_speedometer_android_1.png</a></p>","346665","","","","","2011-04-21 07:47:01","Android develop LCD font","<android><fonts>","3","1","8","",""
"2879193","1","2879355","","2010-05-21 02:14:14","0","1805","<p>I have a string named <code>s_Result</code> which will be parsed from the Internet. The format may be <code>""Distance: 2.8km (about 9 mins)""</code>, and there are 4 variables which are <code>f_Distance</code>, <code>m_DistanceUnit</code>, <code>f_timeEst</code>, <code>m_timeEstUnit</code>.</p><p>My question is how to parse <code>s_Result</code> and assign <code>2.8</code>, <code>km</code>, <code>9</code>, <code>mins</code> into <code>f_Distance</code>, <code>m_distanceUnit</code>, <code>f_timeEst</code> and <code>m_timeEstUnit</code> respectively using regular expression?</p><p>I tried using <code>""\d+(\.\d+)?""</code> in RegEx Tester and the result showed 2 matches found, but if I use <code>""\\d+(\\.\\d+)?""</code> in Android code, it showed no matches!</p><p>Any suggestions what might be going wrong?</p>","304078","","56338","","2010-05-21 02:21:03","2010-05-21 10:10:29","How to use a regular expression and assign the result to variables in Android?","<java><android><regex>","3","0","2","",""
"2879294","1","2881433","","2010-05-21 02:52:52","0","1107","<p>I'm mapping a texture from my texture atlas to a square on a cube. For some reason, the t axis is inverted with 0 being at the top and 1 being at the bottom. Any ideas why this is happening?</p><p>Also, I have to specify the texture coordinates in clockwise order rather than counter-clockwise. I am using counter-clockwise windings. The vertices, indices and texture coordinates I'm using are below.</p><pre><code> float vertices[] = {      // Front face     -width, -height, depth, // 0     width, -height, depth, // 1     width,  height, depth, // 2     -width,  height, depth, // 3            // Back Face            width, -height, -depth, // 4          -width, -height, -depth, // 5            -width,  height, -depth, // 6            width,  height, -depth, // 7            // Left face            -width, -height, -depth, // 8            -width, -height, depth, // 9            -width,  height, depth, // 10            -width,  height, -depth, // 11            // Right face            width, -height, depth, // 12            width, -height, -depth, // 13            width,  height, -depth, // 14            width,  height, depth, // 15            // Top face            -width,  height, depth, // 16            width,  height, depth, // 17            width,  height, -depth, // 18            -width,  height, -depth, // 19            // Bottom face          -width, -height, -depth, // 20          width, -height, -depth, // 21          width, -height, depth, // 22          -width, -height, depth, // 23    };    short indices[] = {       // Front   // Back      0,1,2, 0,2,3,  4,5,6, 4,6,7,      // Left    // Right      8,9,10, 8,10,11,  12,13,14, 12,14,15,      // Top    // Bottom      16,17,18, 16,18,19, 20,21,22, 20,22,23,    };    float textures[] = {  // Front  0.0f, 0.0f, 0.25f, 0.0f, 0.25f, 0.25f, 0.0f, 0.25f,        // Back     0.25f, 0.0f, 0.50f, 0.0f, 0.50f, 0.25f, 0.25f, 0.25f,        // Left     0.50f, 0.0f, 0.75f, 0.0f, 0.75f, 0.25f, 0.50f, 0.25f,        // Right     0.75f, 0.0f, 1f, 0.0f, 1f, 0.25f, 0.75f, 0.25f,        // Top     0.0f, 0.25f, 0.25f, 0.25f, 0.25f, 0.50f, 0.0f, 0.50f,        // Bottom     0.25f, 0.25f, 0.50f, 0.25f, 0.50f, 0.50f, 0.25f, 0.50f,    };</code></pre><p>My texture - a 256x256 .png file created in mspaint.</p><p><img src=""http://www.freeimagehosting.net/uploads/9a87120b99.png"" alt=""alt text""></p>","18340","","18340","","2010-05-21 03:28:20","2010-05-21 10:59:51","OpenGL-ES Texture Atlas. t axis is inverted","<android><opengl-es><texture-mapping>","1","2","","",""
"2879455","1","3509397","","2010-05-21 03:52:15","8","6189","<p>I have a fairly simple game that works perfectly on every version now up through 2.1, but with the new 2.2 (Froyo) release I am unable to create a socket.  I am using the mina package for nio, and get this exception:</p><blockquote>  <p>W/System.err(  263): <strong>java.net.SocketException: Bad address family</strong>  W/System.err(  263):    at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)  W/System.err(  263):    at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)  W/System.err(  263):    at org.apache.harmony.nio.internal.SocketChannelImpl.connect(SocketChannelImpl.java:272)  W/System.err(  263):    at org.apache.harmony.nio.internal.PipeImpl$SinkChannelImpl.finishConnect(PipeImpl.java:164)  W/System.err(  263):    at org.apache.harmony.nio.internal.PipeImpl.(PipeImpl.java:48)  W/System.err(  263):    at org.apache.harmony.nio.internal.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:51)  W/System.err(  263):    at org.apache.harmony.nio.internal.SelectorImpl.(SelectorImpl.java:141)  W/System.err(  263):    at org.apache.harmony.nio.internal.SelectorProviderImpl.openSelector(SelectorProviderImpl.java:58)  W/System.err(  263):    at java.nio.channels.Selector.open(Selector.java:48)  W/System.err(  263):    at org.apache.mina.transport.socket.nio.SocketConnector.startupWorker(SocketConnector.java:248)  W/System.err(  263):    at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:210)  W/System.err(  263):    at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:137)  W/System.err(  263):    at org.apache.mina.common.support.BaseIoConnector.connect(BaseIoConnector.java:40)</p></blockquote><p>Later in the log, usually immediately following I get this:</p><blockquote>  <p>W/System.err(  263): java.lang.NullPointerException  W/System.err(  263):    at org.apache.harmony.nio.internal.SelectorImpl.wakeup(SelectorImpl.java:418)  W/System.err(  263):    at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:222)  W/System.err(  263):    at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:137)  W/System.err(  263):    at org.apache.mina.common.support.BaseIoConnector.connect(BaseIoConnector.java:40)</p></blockquote><p>I have done all the googling and looking around I can think of and found nothing.  The closest I have come seems to be an old JDK bug with ipv6 support on XP and Vista machines (I'm running Vista).  Recommendations included disabling ipv6 (that did not work) and disabling ipv4 and leaving ipv6 (will not work for me as my router and ISP don't support it and so could not test anyway).</p><p>Any thoughts, suggestions, things I have not tried?</p><p>Thanks,Josh</p>","346733","","243782","","2010-05-21 05:10:33","2012-03-13 12:31:34","Android 2.2 and ""Bad address family"" on Socket Connect","<android><android-sdk-2.2>","3","3","4","",""
"2879622","1","2879818","","2010-05-21 04:43:07","1","1221","<p>Can anybody help me out with traceview!I created sdcard and mounted it on my emulator , after closing my app , when i try to pull to copy the files (using command:adb pull /sdcard/calc.trace /tmp)i get this error:""remote object /sdcard/calc.trace does not exist"".I am listin gdown the commands in sequence.1)f:>mksdcard 1024 ./myimage2)f:>emulator -sdcard ./myimage -avd 13)(After running my app and exiting the app)adb pull /sdcard/calc.trace /tmp</p><p>in my activity i have start/stop method tracing with fiename calc.trace.n ya i am running windows -->""\""regards</p>","340353","","","","","2010-05-21 05:47:42","error in pulling trace file -sdcard","<android>","1","0","","",""
"2879672","1","","","2010-05-21 04:58:48","4","4479","<p>Team,</p><p>I need to run a background thread in my application. Could you please share the best practices  where to initiate the thread so that keeps running irrespective of the Activity is being shown and things to consider. The purpose of this background thread is to fire transactions from the Simulator to the server and get the response back from the host.</p><p>thanks,Ramesh</p>","330266","","304673","","2010-05-21 06:39:43","2010-05-21 06:39:43","Android : background thread","<android><multithreading>","2","0","","2012-10-03 12:07:24",""
"2879914","1","2880818","","2010-05-21 06:13:07","4","15377","<p>I am calling a subactivity from main activity. This subactivity should take few numbers from user (i'm using Edit text control to achieve this), save them to static variable in another class and terminate. I want main activity to wait for subactivity but both are just running simultaneously. Even doing sth like that doesn't help:</p><pre><code>     Thread t = new Thread(new Runnable(){     public void run(){     Log.v(""=================="", ""run ""+new Date());     startActivityForResult(new Intent(ctx,myCustomSubactivity.class),1);       } });     Log.v(""=================="", ""calling run ""+new Date());     t.start();           try {        t.join();    } catch (InterruptedException e) {Log.v(""=================="", ""can't join"");}    Log.v(""=================="", ""back from activity ""+new Date());</code></pre><p>do you know how to force main activity to wait? Thread.wait() method is not supported in Android(program throws error).</p>","325943","","","","","2010-05-21 17:44:13","How to force main Acivity to wait for subactivity in Android?","<android><activity><blocking><wait><subactivity>","4","0","0","",""
"2880020","1","2880101","","2010-05-21 06:33:01","0","3954","<p>i am using following code to setlistview adapter but giving me error at last line</p><pre><code>public class MyCustomDialog extends Dialog {    String[] items= {""lorem"", ""ipsum"", ""dolor"", ""sit"", ""amet"",            ""consectetuer"", ""adipiscing"", ""elit"", ""morbi"", ""vel"",            ""ligula"", ""vitae"", ""arcu"", ""aliquet"", ""mollis"",            ""etiam"", ""vel"", ""erat"", ""placerat"", ""ante"",            ""porttitor"", ""sodales"", ""pellentesque"", ""augue"", ""purus""};            TextView selection;    public MyCustomDialog(Context context)     {        super(context);    }    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.mylistviewdialog);ListView lst=(ListView)findViewById(R.id.mylist);        lst.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, items));  // error here The constructor ArrayAdapter&lt;String&gt;(MyCustomDialog, int, String[]) is undefined    }}</code></pre><p>please guide what mistake am i doing?any help would be appreciated.</p>","249991","","","","","2010-05-21 06:53:55","how to set listviewadapter in android custom dialog?","<android><dialog>","1","0","1","",""
"2880170","1","","","2010-05-21 07:08:33","0","443","<p>I have created <code>ListActivity</code> of images I want touchevent just like <code>onItemClickListner</code>, how can I do it? I'm not finding any <code>onItemTochListener</code>.</p>","346841","","426671","","2013-05-31 21:49:12","2013-05-31 21:49:12","android touchevent for listActivity","<android>","2","0","","",""
"2880412","1","","","2010-05-21 07:53:37","1","7591","<p>How to I tell my own custom Spinner Layout to use my Theme?</p><p>Style:</p><pre><code>&lt;style name=""SpinnerText"" parent=""@android:style/Widget.TextView.SpinnerItem""&gt;    &lt;item name=""android:textAppearance""&gt;@style/AnswerTextElement&lt;/item&gt;&lt;item name=""android:gravity""&gt;center_vertical|center_horizontal&lt;/item&gt;&lt;/style&gt;</code></pre><p>Theme:</p><pre><code> &lt;style name=""ApplicationTheme"" parent=""android:style/Theme.NoTitleBar""&gt;    &lt;item name=""android:buttonStyle""&gt;@style/Button&lt;/item&gt;    &lt;item name=""android:spinnerStyle""&gt;@style/Spinner&lt;/item&gt;    &lt;item name=""android:spinnerItemStyle""&gt;@style/SpinnerText&lt;/item&gt;&lt;/style&gt;</code></pre><p>This works for default Spinners, however does not work with my custom layout:</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent""android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/text1""    android:text=""label name"" android:layout_width=""fill_parent""    android:layout_toLeftOf=""@+id/check1""&gt;&lt;/TextView&gt;&lt;CheckBox android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/check1""    android:layout_alignParentRight=""true"" android:clickable=""false""    android:focusable=""false"" android:focusableInTouchMode=""false""    style=""@style/CheckBoxPlainBackground""&gt;&lt;/CheckBox&gt;&lt;/RelativeLayout&gt;</code></pre>","248521","","","","","2012-12-03 22:59:22","How to I tell my own custom Spinner Layout to use my Theme?","<android>","2","0","","",""
"2880450","1","","","2010-05-21 08:03:05","5","725","<p>I'm new to Android development and I couldn't find this in the Dev Guide.</p><p>I would like to create a background service so that any other app could connect to it and get some data from it. I saw android.app.Service, but it seems that it only allows other apps to ping the service, it doesn't allow them to register for some specific events.I had in mind something like the built in LocationManager and its addProximityAlert or even requestLocationUpdates.</p><p>Is anything like this possible with the existing sdk?</p>","198131","","","","","2010-05-21 11:23:09","Providing a background service for other apps","<android><service>","2","0","1","",""
"2880477","1","","","2010-05-21 08:08:41","0","305","<p>The AlertDialog  can show normally, but why the music service does not start?</p><pre><code>package com.commonware.android.AnalogClock;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.media.*;public class AlarmAlert extends Activity{  public MediaPlayer myPlayer = new MediaPlayer();      @Override      protected void onCreate(Bundle savedInstanceState)       {         super.onCreate(savedInstanceState);         startService(new Intent(""com.commonware.android.AnalogClock.START_AUDIO_SERVICE""));         new AlertDialog.Builder(AlarmAlert.this)        .setIcon(R.drawable.clock)       .setTitle(""Alarm Clock!!"")       .setMessage(""Get up!!!"")       .setPositiveButton(""Close it!"",       new DialogInterface.OnClickListener()       {          public void onClick(DialogInterface dialog, int whichButton)          {        stopService(new Intent(""com.commonware.android.AnalogClock.START_AUDIO_SERVICE""));            AlarmAlert.this.finish();          }       })       .show();   }}///////////////////////////////////////////////////////////////////////////////////////package com.commonware.android.AnalogClock;import android.app.Service;import android.content.Intent;import android.media.MediaPlayer;import android.os.IBinder;public class Music extends Service {private MediaPlayer player;@Overridepublic IBinder onBind(Intent arg0) {    // TODO Auto-generated method stub    return null;}public void onStart(Intent intent, int startId) {           super.onStart(intent, startId);    player = MediaPlayer.create(this, R.raw.gequ);    player.start();}public void onDestroy() {    super.onDestroy();    player.stop();}}//////////////////////////////////////////////////////////////////////////////////// AndroidManifest.xml      &lt;Service android:name="".music""&gt;      &lt;intent-filter&gt;        &lt;action      android:name=""com.commonware.android.AnalogClock.START_AUDIO_SERVICE"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;    &lt;/Service&gt;</code></pre>","290323","","","","","2011-03-02 05:41:55","Why the service does not work?","<android><service>","1","0","","",""
"2880590","1","","","2010-05-21 08:36:04","1","585","<p>I have a page that has a 100% width and height div in it (all surrounding elements are sized accordingly so that it does actually achieve 100% width and height). Below that div I have a second div with a fixed height.</p><p>In mobile safari and blackberry everything is fine, when the page loads the dimensions are applied correctly (the top div filling the viewport) and the user can scroll down to reveal the second div. Android 2.1 also applies the dimensions correctly, but with an added quirk; when the user scrolls down and removes the address bar from the page, the dimensions of the div are recalculated to fill the viewport, causing the content to jump. Ideally I would like the dimensions of the div to remain static when the page is scrolled, but remain 100% so that it will fill the viewport regardless of device size or orientation.</p><p>Does anyone know of any way to disable this recalculation?</p><p>Thanks for any help you can provide. </p>","346891","","","","","2010-06-28 17:46:41","Android 2.1 address bar causes change in viewport dimensions","<android><mobile><webbrowser-control><viewport>","1","0","0","",""
"2880758","1","","","2010-05-21 09:01:58","1","217","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2869338/where-to-start-to-learn-android"">Where to start to learn Android?</a>  </p></blockquote><p>what language does it use? iphone is objective c what is android? what are some good sites for beginners?</p>","250416","","114066","","2010-05-21 09:16:44","2010-05-21 09:16:44","How to program for Android","<android>","2","4","","2010-05-21 16:58:38",""
"2881122","1","","","2010-05-21 10:01:52","2","831","<p>I am using two xml layout file layoutPotrait.xml and layoutLandscape.xml.When device/emulator is in portrait mode i want to set the content view with layoutPortrait.xml file and when I will change the emulator to landscape mode I want to set content view with layoutLandscape.xml file. How can I achieve this?</p>","324225","","114066","","2012-02-02 13:04:54","2012-02-02 13:04:54","How to know device/emulator layout (landscape/portrait) is changed","<android><android-layout>","3","1","","",""
"2881128","1","","","2010-05-21 10:02:48","57","12083","<p><strong>( edit: I added the best working approach in my <a href=""https://github.com/bitstars/droidar"">augmented reality framework</a> and now also take the gyroscope into account which makes it much more stable again: <a href=""https://github.com/bitstars/droidar"">DroidAR framework</a> )</strong></p><p>I have written a TestSuite to find out how to calculate the rotation angles from the data you get in <code>SensorEventListener.onSensorChanged()</code>.I really hope you can complete my solution to help people who will have the same problems like me. Here is the code, I think you will understand it after reading it.</p><p>Feel free to change it, the main idea was to implement several methods to send the orientation angles to the opengl view or any other target which would need it.</p><p>method 1 to 4 are working, they are directly sending the rotationMatrix to the OpenGl view.</p><p>method 6 works now too, but I have no explanation why the rotation has to be done y x z..</p><p>all other methods are not working or buggy and I hope someone knows to get them working.I think the best method would be method 5 if it would work, because it would be the easiest to understand but i'm not sure how efficient it is. the complete code isn't optimized so I recommend to not use it as it is in your project.</p><p>here it is:</p><pre><code>/** * This class provides a basic demonstration of how to use the * {@link android.hardware.SensorManager SensorManager} API to draw a 3D * compass. */public class SensorToOpenGlTests extends Activity implements Renderer,  SensorEventListener { private static final boolean TRY_TRANSPOSED_VERSION = false; /*  * MODUS overview:  *   * 1 - unbufferd data directly transfaired from the rotation matrix to the  * modelview matrix  *   * 2 - buffered version of 1 where both acceleration and magnetometer are  * buffered  *   * 3 - buffered version of 1 where only magnetometer is buffered  *   * 4 - buffered version of 1 where only acceleration is buffered  *   * 5 - uses the orientation sensor and sets the angles how to rotate the  * camera with glrotate()  *   * 6 - uses the rotation matrix to calculate the angles  *   * 7 to 12 - every possibility how the rotationMatrix could be constructed  * in SensorManager.getRotationMatrix (see  * http://www.songho.ca/opengl/gl_anglestoaxes.html#anglestoaxes for all  * possibilities)  */ private static int MODUS = 2; private GLSurfaceView openglView; private FloatBuffer vertexBuffer; private ByteBuffer indexBuffer; private FloatBuffer colorBuffer; private SensorManager mSensorManager; private float[] rotationMatrix = new float[16]; private float[] accelGData = new float[3]; private float[] bufferedAccelGData = new float[3]; private float[] magnetData = new float[3]; private float[] bufferedMagnetData = new float[3]; private float[] orientationData = new float[3]; // private float[] mI = new float[16]; private float[] resultingAngles = new float[3]; private int mCount; final static float rad2deg = (float) (180.0f / Math.PI); private boolean landscape; public SensorToOpenGlTests() { } /** Called with the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);  openglView = new GLSurfaceView(this);  openglView.setRenderer(this);  setContentView(openglView); } @Override protected void onResume() {  // Ideally a game should implement onResume() and onPause()  // to take appropriate action when the activity looses focus  super.onResume();  openglView.onResume();  if (((WindowManager) getSystemService(WINDOW_SERVICE))    .getDefaultDisplay().getOrientation() == 1) {   landscape = true;  } else {   landscape = false;  }  mSensorManager.registerListener(this, mSensorManager    .getDefaultSensor(Sensor.TYPE_ACCELEROMETER),    SensorManager.SENSOR_DELAY_GAME);  mSensorManager.registerListener(this, mSensorManager    .getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),    SensorManager.SENSOR_DELAY_GAME);  mSensorManager.registerListener(this, mSensorManager    .getDefaultSensor(Sensor.TYPE_ORIENTATION),    SensorManager.SENSOR_DELAY_GAME); } @Override protected void onPause() {  // Ideally a game should implement onResume() and onPause()  // to take appropriate action when the activity looses focus  super.onPause();  openglView.onPause();  mSensorManager.unregisterListener(this); } public int[] getConfigSpec() {  // We want a depth buffer, don't care about the  // details of the color buffer.  int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };  return configSpec; } public void onDrawFrame(GL10 gl) {  // clear screen and color buffer:  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);  // set target matrix to modelview matrix:  gl.glMatrixMode(GL10.GL_MODELVIEW);  // init modelview matrix:  gl.glLoadIdentity();  // move camera away a little bit:  if ((MODUS == 1) || (MODUS == 2) || (MODUS == 3) || (MODUS == 4)) {   if (landscape) {    // in landscape mode first remap the rotationMatrix before using    // it with glMultMatrixf:    float[] result = new float[16];    SensorManager.remapCoordinateSystem(rotationMatrix,      SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X,      result);    gl.glMultMatrixf(result, 0);   } else {    gl.glMultMatrixf(rotationMatrix, 0);   }  } else {   //in all other modes do the rotation by hand   //the order y x z is important!   gl.glRotatef(resultingAngles[2], 0, 1, 0);   gl.glRotatef(resultingAngles[1], 1, 0, 0);   gl.glRotatef(resultingAngles[0], 0, 0, 1);  }  //move the axis to simulate augmented behaviour:  gl.glTranslatef(0, 2, 0);  // draw the 3 axis on the screen:  gl.glVertexPointer(3, GL_FLOAT, 0, vertexBuffer);  gl.glColorPointer(4, GL_FLOAT, 0, colorBuffer);  gl.glDrawElements(GL_LINES, 6, GL_UNSIGNED_BYTE, indexBuffer); } public void onSurfaceChanged(GL10 gl, int width, int height) {  gl.glViewport(0, 0, width, height);  float r = (float) width / height;  gl.glMatrixMode(GL10.GL_PROJECTION);  gl.glLoadIdentity();  gl.glFrustumf(-r, r, -1, 1, 1, 10); } public void onSurfaceCreated(GL10 gl, EGLConfig config) {  gl.glDisable(GL10.GL_DITHER);  gl.glClearColor(1, 1, 1, 1);  gl.glEnable(GL10.GL_CULL_FACE);  gl.glShadeModel(GL10.GL_SMOOTH);  gl.glEnable(GL10.GL_DEPTH_TEST);  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);  // load the 3 axis and there colors:  float vertices[] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 };  float colors[] = { 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1 };  byte indices[] = { 0, 1, 0, 2, 0, 3 };  ByteBuffer vbb;  vbb = ByteBuffer.allocateDirect(vertices.length * 4);  vbb.order(ByteOrder.nativeOrder());  vertexBuffer = vbb.asFloatBuffer();  vertexBuffer.put(vertices);  vertexBuffer.position(0);  vbb = ByteBuffer.allocateDirect(colors.length * 4);  vbb.order(ByteOrder.nativeOrder());  colorBuffer = vbb.asFloatBuffer();  colorBuffer.put(colors);  colorBuffer.position(0);  indexBuffer = ByteBuffer.allocateDirect(indices.length);  indexBuffer.put(indices);  indexBuffer.position(0); } public void onAccuracyChanged(Sensor sensor, int accuracy) { } public void onSensorChanged(SensorEvent event) {  // load the new values:  loadNewSensorData(event);  if (MODUS == 1) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);  }  if (MODUS == 2) {   rootMeanSquareBuffer(bufferedAccelGData, accelGData);   rootMeanSquareBuffer(bufferedMagnetData, magnetData);   SensorManager.getRotationMatrix(rotationMatrix, null,     bufferedAccelGData, bufferedMagnetData);  }  if (MODUS == 3) {   rootMeanSquareBuffer(bufferedMagnetData, magnetData);   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     bufferedMagnetData);  }  if (MODUS == 4) {   rootMeanSquareBuffer(bufferedAccelGData, accelGData);   SensorManager.getRotationMatrix(rotationMatrix, null,     bufferedAccelGData, magnetData);  }  if (MODUS == 5) {   // this mode uses the sensor data recieved from the orientation   // sensor   resultingAngles = orientationData.clone();   if ((-90 &gt; resultingAngles[1]) || (resultingAngles[1] &gt; 90)) {    resultingAngles[1] = orientationData[0];    resultingAngles[2] = orientationData[1];    resultingAngles[0] = orientationData[2];   }  }  if (MODUS == 6) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   final float[] anglesInRadians = new float[3];   SensorManager.getOrientation(rotationMatrix, anglesInRadians);   //TODO check for landscape mode   resultingAngles[0] = anglesInRadians[0] * rad2deg;   resultingAngles[1] = anglesInRadians[1] * rad2deg;   resultingAngles[2] = anglesInRadians[2] * -rad2deg;  }  if (MODUS == 7) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in x y z    * order Rx*Ry*Rz    */   resultingAngles[2] = (float) (Math.asin(rotationMatrix[2]));   final float cosB = (float) Math.cos(resultingAngles[2]);   resultingAngles[2] = resultingAngles[2] * rad2deg;   resultingAngles[0] = -(float) (Math.acos(rotationMatrix[0] / cosB))     * rad2deg;   resultingAngles[1] = (float) (Math.acos(rotationMatrix[10] / cosB))     * rad2deg;  }  if (MODUS == 8) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in z y x    */   resultingAngles[2] = (float) (Math.asin(-rotationMatrix[8]));   final float cosB = (float) Math.cos(resultingAngles[2]);   resultingAngles[2] = resultingAngles[2] * rad2deg;   resultingAngles[1] = (float) (Math.acos(rotationMatrix[9] / cosB))     * rad2deg;   resultingAngles[0] = (float) (Math.asin(rotationMatrix[4] / cosB))     * rad2deg;  }  if (MODUS == 9) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in z x y    *     * note z axis looks good at this one    */   resultingAngles[1] = (float) (Math.asin(rotationMatrix[9]));   final float minusCosA = -(float) Math.cos(resultingAngles[1]);   resultingAngles[1] = resultingAngles[1] * rad2deg;   resultingAngles[2] = (float) (Math.asin(rotationMatrix[8]     / minusCosA))     * rad2deg;   resultingAngles[0] = (float) (Math.asin(rotationMatrix[1]     / minusCosA))     * rad2deg;  }  if (MODUS == 10) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in y x z    */   resultingAngles[1] = (float) (Math.asin(-rotationMatrix[6]));   final float cosA = (float) Math.cos(resultingAngles[1]);   resultingAngles[1] = resultingAngles[1] * rad2deg;   resultingAngles[2] = (float) (Math.asin(rotationMatrix[2] / cosA))     * rad2deg;   resultingAngles[0] = (float) (Math.acos(rotationMatrix[5] / cosA))     * rad2deg;  }  if (MODUS == 11) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in y z x    */   resultingAngles[0] = (float) (Math.asin(rotationMatrix[4]));   final float cosC = (float) Math.cos(resultingAngles[0]);   resultingAngles[0] = resultingAngles[0] * rad2deg;   resultingAngles[2] = (float) (Math.acos(rotationMatrix[0] / cosC))     * rad2deg;   resultingAngles[1] = (float) (Math.acos(rotationMatrix[5] / cosC))     * rad2deg;  }  if (MODUS == 12) {   SensorManager.getRotationMatrix(rotationMatrix, null, accelGData,     magnetData);   rotationMatrix = transpose(rotationMatrix);   /*    * this assumes that the rotation matrices are multiplied in x z y    */   resultingAngles[0] = (float) (Math.asin(-rotationMatrix[1]));   final float cosC = (float) Math.cos(resultingAngles[0]);   resultingAngles[0] = resultingAngles[0] * rad2deg;   resultingAngles[2] = (float) (Math.acos(rotationMatrix[0] / cosC))     * rad2deg;   resultingAngles[1] = (float) (Math.acos(rotationMatrix[5] / cosC))     * rad2deg;  }  logOutput(); } /**  * transposes the matrix because it was transposted (inverted, but here its  * the same, because its a rotation matrix) to be used for opengl  *   * @param source  * @return  */ private float[] transpose(float[] source) {  final float[] result = source.clone();  if (TRY_TRANSPOSED_VERSION) {   result[1] = source[4];   result[2] = source[8];   result[4] = source[1];   result[6] = source[9];   result[8] = source[2];   result[9] = source[6];  }  // the other values in the matrix are not relevant for rotations  return result; } private void rootMeanSquareBuffer(float[] target, float[] values) {  final float amplification = 200.0f;  float buffer = 20.0f;  target[0] += amplification;  target[1] += amplification;  target[2] += amplification;  values[0] += amplification;  values[1] += amplification;  values[2] += amplification;  target[0] = (float) (Math    .sqrt((target[0] * target[0] * buffer + values[0] * values[0])      / (1 + buffer)));  target[1] = (float) (Math    .sqrt((target[1] * target[1] * buffer + values[1] * values[1])      / (1 + buffer)));  target[2] = (float) (Math    .sqrt((target[2] * target[2] * buffer + values[2] * values[2])      / (1 + buffer)));  target[0] -= amplification;  target[1] -= amplification;  target[2] -= amplification;  values[0] -= amplification;  values[1] -= amplification;  values[2] -= amplification; } private void loadNewSensorData(SensorEvent event) {  final int type = event.sensor.getType();  if (type == Sensor.TYPE_ACCELEROMETER) {   accelGData = event.values.clone();  }  if (type == Sensor.TYPE_MAGNETIC_FIELD) {   magnetData = event.values.clone();  }  if (type == Sensor.TYPE_ORIENTATION) {   orientationData = event.values.clone();  } } private void logOutput() {  if (mCount++ &gt; 30) {   mCount = 0;   Log.d(""Compass"", ""yaw0: "" + (int) (resultingAngles[0])     + ""  pitch1: "" + (int) (resultingAngles[1]) + ""  roll2: ""     + (int) (resultingAngles[2]));  } }}</code></pre>","165106","","165106","","2013-10-09 08:24:50","2014-01-09 09:50:14","How to use onSensorChanged sensor data in combination with OpenGL","<android><opengl-es><matrix><rotation><sensor>","5","0","25","","2010-05-21 10:06:18"
"2881139","1","2881225","","2010-05-21 10:04:54","7","3642","<p>I have a really long collection with 10k items, and when running a toString() on the object it crashes. I need to use this output somehow.</p><pre><code>05-21 12:59:44.586: ERROR/dalvikvm-heap(6415): Out of memory on a 847610-byte allocation.05-21 12:59:44.636: ERROR/dalvikvm(6415): Out of memory: Heap Size=15559KB, Allocated=12932KB, Bitmap Size=613KB05-21 12:59:44.636: ERROR/AndroidRuntime(6415): Uncaught handler: thread main exiting due to uncaught exception05-21 12:59:44.636: ERROR/AndroidRuntime(6415): java.lang.OutOfMemoryError05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:155)05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.StringBuilder.append(StringBuilder.java:202)05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.util.AbstractCollection.toString(AbstractCollection.java:384)</code></pre><p>I need step by step guide how to increase the heap for and Android application. I don't run the command line.</p>","243782","","","","","2010-05-21 10:28:16","OutOfMemoryError what to increase and how?","<java><android><heap><out-of-memory>","2","2","2","",""
"2881529","1","2881617","","2010-05-21 11:16:32","7","5338","<p>Is there any way to stop the garbage collector for some time?</p>","165106","","","","","2010-05-21 14:09:27","How do i stop the android garbage collector? Is it possible?","<android><garbage-collection>","2","3","","",""
"2881641","1","2881759","","2010-05-21 11:37:13","21","5833","<p>Is there a simple way to find the current version of my application from within it?  I would like to add the version string to the about screen.</p>","238174","","238174","","2012-05-08 08:40:00","2013-09-07 10:37:55","Finding app version number in code","<android><version>","2","0","8","",""
"2881904","1","2883981","","2010-05-21 12:14:27","12","7974","<p><b>How do I sign an APK with more than one certificate, so that I can do this when I publish to the Android Market:</b></p><p>Version 1.0 => Signed with Certificate A<br>Version 2.0 => Signed with Certificate A &amp; B<br>Version 3.0 => Signed with Certificate B  </p><p>The Android Market does give me some hope but I am not sure what to make of it, when I upload with a different sign certificate it gives me this message:</p><blockquote>  <p>""The apk must be signed with at least one certificate in common with the previous version.""</p></blockquote><p><b>Motive:</b><br />I have published an app on the market using the Android Signing Tool as part of MotoDev Studio for android. The problem is that it handles the keys itself and there is no way (documented) to get them. I want to change it to use a keystore and certificate that I have more control of and can use even if I don't use MotoDev Studio anymore.  Also it seems that MotoDev Studio will lock you out of new features such as shared libraries.</p><p><b>UPDATE 5/3/2011:</b><br /> They have been actually really quick and prompt at updating MotoDev Studio but it seems like I believe that Google should still provide a work around for those that want to change the certificates of their applications. Updating application to all use the same certificate, creating new ones over time, and possibly creating a new one so that you may hand of the support and distribution of your application to others.</p>","45708","","45708","","2011-05-03 16:10:36","2013-10-17 16:31:09","How to sign an APK with more than one certificate?","<android><google-play>","3","0","10","",""
"2881939","1","","","2010-05-21 12:19:46","6","6640","<p>I try to read an image from sdcard (in emulator) and then create a Bitmap image with the </p><p><code>BitmapFactory.decodeByteArray</code>  </p><p>method. I set the options:  </p><p><code>options.inPrefferedConfig = Bitmap.Config.ARGB_8888</code><br><code>options.inDither = false</code>  </p><p>Then I extract the pixels into a ByteBuffer.  </p><p><code>ByteBuffer buffer = ByteBuffer.allocateDirect(width*height*4)</code><br><code>bitmap.copyPixelsToBuffer(buffer)</code>  </p><p>I use this ByteBuffer then in the JNI to convert it into RGB format and want to calculate on it.</p><p>But always I get false data - I test without modifying the ByteBuffer. Only thing I do is to put it into the native method into JNI. Then cast it into a <code>unsigned char*</code> and convert it back into a <code>ByteBuffer</code> before returning it back to Java. </p><p><code>unsigned char* buffer = (unsinged char*)(env-&gt;GetDirectBufferAddress(byteBuffer))</code><br><code>jobject returnByteBuffer = env-&gt;NewDirectByteBuffer(buffer, length)</code>  </p><p>Before displaying the image I get data back with</p><p><code>bitmap.copyPixelsFromBuffer( buffer )</code>  </p><p>But then it has wrong data in it.</p><p>My Question is if this is because the image is internally converted into RGB 565 or what is wrong here? </p><p>.....</p><p>Have an answer for it:</p><p>->>> yes, it is converted internally to RGB565. </p><p>Does anybody know how to create such an bitmap image from PNG with ARGB8888 pixel format?</p><p>If anybody has an idea, it would be great!</p>","345982","","345982","","2010-05-21 13:39:24","2012-09-03 02:44:59","Android - Read PNG image without alpha and decode as ARGB_8888","<android><image><png><bitmap><argb>","1","2","2","",""
"2881958","1","2882125","","2010-05-21 12:21:59","3","332","<p>So I recently tested deassembling one of my android apps, and to my horror I discovered that the code was quite readable. Even worse, all my variable names where intact! I thought that those would be compressed to something unreadable at compile time. The app is triggered to expire after a certain time. However, now it was trivial for me to find my function named checkIfExpired() and find the variable ""expired"". Is there any good way of making it harder for a potential hacker messing with my app?</p><p>Before someone states the obvious: Yes, it is security through obscurity. But obviously this is my only option since the user always will have access to all my code. This is the same for all apps. The details of my deactivation-thingy is unimportant, the point is that I dont want deassembler to understand some of the things I do.</p><p>side questions: Why are the variable names not compressed? Could it be the case that my program would run faster if I stopped using really long variable names, as are my habit?</p>","249871","","183528","","2010-05-21 17:43:41","2010-05-21 17:43:41","Protecting my apps security from a disassembler","<android><security><reverse-engineering>","2","1","1","",""
"2881980","1","2882037","","2010-05-21 12:25:01","1","1666","<p>Hi I am new to Android. How to use System memory as a SD Card in the Android 1.5 Emulator.I am using Eclipse IDE. </p>","324223","","304673","","2010-05-21 12:29:18","2010-05-21 12:33:27","How to use SD Card in Android Emulator 1.5","<android><sd-card>","1","0","","",""
"2882091","1","2882141","","2010-05-21 12:42:43","0","1400","<p>Newbie question.</p><p>After I have written the Android App (easy part) I need to sign it and upload it (seems the hard part)</p><p>Is there an Open Source app or tool that I can use to do this so that I don't have to write command shell scripts. JARSIGNER looks overly complex.</p><p>I'm looking for a dead simple Sign-And-Package up tool.</p><p>I am using Eclipse with the Android plug in.</p>","172861","","","","","2013-11-22 02:20:27","Android JARSIGNER GUI tool?","<android><jarsigner>","3","0","","",""
"2882161","1","2886553","","2010-05-21 12:52:00","1","2242","<p>I have a problem with TextView and autoLink feature.</p><p>I have an about screen in my application with some information like support phone number, email address, website URL and application version in form like 01.01.01</p><p>After setting autoLink=""all"" on the textView, all values are linked fine - except that version number 01.01.01 is linked as the phone number as well.</p><p>Is there some way to exclude this text fragment from linkifing?</p>","306831","","","","","2012-08-07 12:33:25","Android TextView Linkify problem with phone numbers and application version number","<android><android-widget>","2","0","","",""
"2882253","1","2888222","","2010-05-21 13:04:52","48","102629","<p>I would like to pull the log file from a device to my PC. How can I do that?</p>","243782","","","","","2014-03-07 13:56:35","How do I get the logfile from an Android device?","<android>","10","0","21","",""
"2882346","1","7255115","","2010-05-21 13:16:00","3","1851","<p>I'm trying to build a compound control in Android, containing (among other things) a ScrollView. Things go wrong when I try to view the control in Eclipse, crashing with a NullPointerException after the error message: ""Parser is not a BridgeXmlBlockParser"".</p><p>Stacktrace:</p><pre><code>java.lang.NullPointerExceptionat android.view.View.&lt;init&gt;(View.java:1720)at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:277)at android.widget.FrameLayout.&lt;init&gt;(FrameLayout.java:83)at android.widget.ScrollView.&lt;init&gt;(ScrollView.java:128)at android.widget.ScrollView.&lt;init&gt;(ScrollView.java:124)at android.widget.ScrollView.&lt;init&gt;(ScrollView.java:120)at my.compound.control.StringPicker.onMeasure(StringPicker.java:46)...</code></pre><p>I've traced the error to the following conditions:</p><ul><li>The NPE is thrown because a <code>Context.obtainStyledAttributes()</code> call returns <code>null</code> when the <code>attrs</code> argument passed is <code>null</code>.</li><li>This only applies to the <code>BridgeContext</code> implementation used in Eclipse, which expects <code>attrs</code> to be an instance of the <code>BridgeXmlBlockParser</code>.</li><li>The <code>attrs</code> argument is <code>null</code> because I create the ScrollView using the (Context) constructor.</li></ul><p>There is a workaround of course, which is passing the <code>attrs</code> I receive when Eclipse constructs the compound control, but I don't want all the attributes set on the compound control to apply to my inner control.</p><p>Am I doing something wrong, is this a bug in Android Eclipse, ...?</p><p>This is what my.compound.control.StringPicker.onMeasure looks like (stripped it a bit for clarity):</p><pre><code>@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    if (this.getChildCount() != requestedLength) {        this.removeAllViews();        int childWidth = getWidth() / requestedLength;        int childHeight = getHeight();        for (int i = 0; i &lt; requestedLength; i++) {            ScrollView child = new ScrollView(getContext()); // NPE here            child.setLayoutParams(new LayoutParams(childWidth, childHeight));            addView(child);        }    }    super.onMeasure(widthMeasureSpec, heightMeasureSpec);}</code></pre>","63548","","63548","","2011-08-29 16:50:05","2011-08-31 09:45:00","Programmatically creating scrollview(s) from custom component in android","<android><custom-component><scrollview>","2","4","","",""
"2882416","1","","","2010-05-21 13:25:12","2","100","<p>What is the convention for naming xml styles in Android.</p><p>I have seee things like </p><pre><code>Widget.TextView.SpinnerItem </code></pre><p>and </p><pre><code>Theme.Black</code></pre><p>If I extend these in my own styles how should I name it?</p>","248521","","","","","2011-07-28 14:06:18","How should I name styles and Themes in Android","<android>","1","0","","",""
"2882425","1","","","2010-05-21 13:26:25","9","19745","<p>I'm trying to update and install the latest Android SDK (API 8) and keep getting the following error:</p><p>Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/repository.xml"">https://dl-ssl.google.com/android/repository/repository.xml</a>, reason: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</p><p>I'm running on OS X 10.6.3  If I visit the url in a browser I'm not getting any errors about an untrusted cert.  </p><p>edit:  I'm running Revision 5 of the Android SDK  and AVD manager (if that makes a difference)edit:  Tried downloading the latest android sdk (revision 6) and running everything from the command line and still no dice.  I can only assume there's something either in my java installation or in os x on my machine.</p>","337551","","337551","","2010-05-21 17:16:39","2012-11-30 16:02:27","Android sdk download/update failing","<android><eclipse><osx>","8","0","1","",""
"2882459","1","","","2010-05-21 13:31:20","21","12955","<p>I am trying to make some alarms after the user selects something with a time from a list and create a notification for it at the given time. My problem is that the ""showname"" that a putExtra on my Intent cant be received at the broadcast receiver. It always get null value.This is the way I do it for most of my intents but I think this time maybe because of the pendingIntent or the broadcastReceiver something need to be done differentelly.Thank you </p><p>The function that sends the Intent through the pending intent</p><pre><code>public void setAlarm(String showname,String time) {    String[] hourminute=time.split("":"");    String hour = hourminute[0];    String minute = hourminute[1];    Calendar rightNow = Calendar.getInstance();    rightNow.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour));    rightNow.set(Calendar.MINUTE, Integer.parseInt(minute));    rightNow.set(Calendar.SECOND, 0);    long t=rightNow.getTimeInMillis();    long t1=System.currentTimeMillis();    try {       Intent intent = new Intent(this, alarmreceiver.class);      Bundle c = new Bundle();                c.putString(""showname"", showname);//This is the value I want to pass    intent.putExtras(c);    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 12345, intent, 0);    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.set(AlarmManager.RTC_WAKEUP, rightNow.getTimeInMillis(),pendingIntent);    //Log.e(""ALARM"", ""time of millis: ""+System.currentTimeMillis());    Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();    } catch (Exception e) {        Log.e(""ALARM"", ""ERROR IN CODE:""+e.toString());    }}</code></pre><p>And this is the receiving end</p><pre><code>public class alarmreceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    // Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();          Bundle b = intent.getExtras();    String showname=b.getString(""showname"");//This is where I suppose to receive it but its null    NotificationManager manger = (NotificationManager) context            .getSystemService(context.NOTIFICATION_SERVICE);    Notification notification = new Notification(R.drawable.icon,            ""TVGuide ?pe???µ?s?"", System.currentTimeMillis());    PendingIntent contentIntent = PendingIntent.getActivity(context, 0,            new Intent(context, tvguide.class), 0);    notification.setLatestEventInfo(context, ""?? ?????aµµa ?e????se"",            showname, contentIntent);    notification.flags = Notification.FLAG_ONLY_ALERT_ONCE;    notification.sound = Uri.parse(""file:///sdcard/dominating.mp3"");    notification.vibrate = new long[]{100, 250, 100, 500};    manger.notify(1, notification);}           }</code></pre>","338522","","126562","","2010-05-21 19:18:51","2013-09-30 10:48:41","getExtra from Intent launched from a pendingIntent","<android><android-intent><bundle><alarm>","4","0","10","",""
"2882483","1","2882546","","2010-05-21 13:34:17","1","201","<p>I am trying to unit test a class that does SAX parsing and creates an object.This class takes a string as a parameter representing the URL of a document on the internet, parses it and then creates an object based on the contents.</p><p>I don't want to have the unit tests actually access the network, so I'd like to have a few test xml files to parse. However I can't figure out how to access them from my AndroidTestCases. I don't want to include the test files with the actual application, I want them in the test project (it's a separate project, as is the norm for Android tests from what I could gather - due to the need to have a custom AndroidManifest.xml, for one).</p><p>One way would be to put the XML files in the test project's assets directory, I can read them using <code>getContext().getAssets().open(filename</code>) into an <code>InputStream</code> in the test case, but my class expects a URL string. I'd rather not have to provide an InputStream to this class instead of the current URL string. I can test just the parsing by making two methods, one that takes a string and one an Inputstream, and test the second, but how can I then test the one that just takes a string?</p><p>How should I design my class and or tests to circumvent this problem?</p>","35501","","","","","2010-05-21 13:43:39","How to refactor my class so I can unit test it?","<android><unit-testing><refactoring><uri>","1","0","","",""
"2882592","1","2888556","","2010-05-21 13:48:51","0","765","<p>This logic is written in a function with signature</p><pre><code>private void showDialog(final AdapterView&lt;? extends Adapter&gt; parent,     String title, String message, final Tag subject)</code></pre><p>Is there a better way of doing this?</p><pre><code>// refresh adapterSimpleCursorAdapter adapter;if (parent.getAdapter() instanceof WrapperListAdapter) {    adapter = (SimpleCursorAdapter) ((WrapperListAdapter) parent.getAdapter()).getWrappedAdapter();} else {    adapter = (SimpleCursorAdapter) parent.getAdapter();}adapter.getCursor().requery();adapter.notifyDataSetChanged();</code></pre><p>Also, is there any point in having <code>AdapterView&lt;? extends Adapter&gt;</code> in the signature and not just <code>AdapterView&lt;?&gt;</code>?</p>","219929","","","","","2010-05-22 14:59:23","ListAdapters and WrapperListAdapter algorithm","<java><android><listadapter>","1","0","","",""
"2882652","1","2882796","","2010-05-21 13:56:00","0","143","<p>(I'm coming from an iPhone dev world. )</p><p>In Android do we need to worry what OS version we compile against? In the iPhone world I would usually target a release that's at least 6 months old to limit the number of issues with installing on iPhones with old OSs.</p><p>What strategy should I use when choosing what to compile against on the Android?</p>","172861","","","","","2010-06-15 15:31:11","From iPhone to Android Question","<iphone><android><sdk><version>","4","0","1","",""
"2882856","1","6674637","","2010-05-21 14:19:53","2","2489","<p>when i click the button i start a activity for youtube video like this:</p><pre><code>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.youtube.com/watch?v=cxLG2wtE7TM"")));</code></pre><p>if i use this its redirect to the intent chooser to open that video url on browser or youtube app. how to select the default app as youtube programmatically? </p><p>my output should open that video directly on youtube player. how? any idea?</p>","267269","","","","","2011-07-13 05:56:35","How to hide the Intent Chooser window in android?","<android><video><android-intent>","2","0","1","",""
"2882859","1","3523001","","2010-05-21 14:19:59","4","1127","<p>I was unable to find the google's search widget on the home screenneither on the the list of available widgets.If i click menu from thehome screen and if i press search nothing happens.</p><p>I could neither find an option called ""Search"" in settings page fromwhere i could enable my application in searchable items.The issue iswe have enabled Global search for our application and previously ifused to show search results from my application if i search here.</p><p>I tested this in a stimulator and i am yet to test it on a device.</p><p>Has it been removed in 2.2? </p>","302328","","","","","2011-09-09 08:34:23","Google's global quick search widget missing in Android 2.2","<android><android-emulator>","1","0","0","",""
"2883024","1","2888539","","2010-05-21 14:38:59","5","1685","<p>If you extend SQLiteOpenHelper, for the Constructor you have to use a Context. I am wondering if there is a way to leave this out, and be able to work with database tables without a Context.</p><p>Or at least be least restrictive, I mean a way of project/class structure that will make history the several context passings I have to do now. </p><p>As it is my application has several level of classes, chained in each other, and there are a few that connects to the database, but have no whatsoever influence on the interface, so they don't actually need the Context.</p><p>Are you creating your classes in the way that you pass each time a Context to them?<br>If not, how you do, how you reuse a Context in a short class?</p>","243782","","","","","2010-05-22 14:54:52","How to use SQLiteOpenHelper without or less restrictive use of Context?","<java><android><coding-style>","1","0","2","",""
"2883038","1","2884219","","2010-05-21 14:42:32","0","1323","<p>I need to create a home screen (menu) with four to six items arranged in a grid view, each item needs to have an icon and a text below the icon. I googled and everything I could find were adapterView examples, with dynamic menu loading, and I want to make it with static xml, this view will not change so no need for dynamic code.</p><p>Can anyone post an xml example of this?</p>","180344","","","","","2010-05-21 17:34:33","Android menu view, gridview or something else?","<android><gridview>","2","0","","",""
"2883255","1","","","2010-05-21 15:08:29","2","9457","<p>please help me I am using windows xp</p><p>adb devices command doesnt show my xperia x10 and eclipse doesn't recognize my xperia x10I have htc magic and it works fine please help me.</p><p>I downloaded driver from:<a href=""http://developer.sonyericsson.com/community/docs/DOC-3328#cf"" rel=""nofollow"">http://developer.sonyericsson.com/community/docs/DOC-3328#cf</a></p><p>and I installed driver without problems and I don't have for example yellow question mark on driver in device manager.and it is very recent ()</p><p>I downloaded sony ericsson applications like Sony_Ericsson_PC_Companion_2.00.134.exeand Update_Service_Setup-2.10.5.11.exeand they can detect my phone</p><p>but other apps cant detect my phonefor example:adb devices command cant detect my phoneeclipse and android plug in cant detect my phoneapk installer app cant detect my phone</p><p>please help me</p><p>note:I followed this documentation from Sony ericsson in driver installation:h t t p :// developer . sonyericsson . com/community/docs/DOC-3496#cf</p><p>and I tthink that I noticed some thing mah help in solving this problem</p><p>in this documentation, they say that I should replace default adb.exe with another one that sony ericsson developed and this file is included in driver zip file.</p><p>but I didn't find this file in driver zip file that I downloaded from sony ericsson</p><p>if it is truethen if someone gave this missing file, may be my problem will be solved.</p><p>please help meThank You  </p>","346727","","","","","2012-11-21 05:50:59","adb devices command and eclipse don't recognize my sony ericsson xperia x10. please help","<android><adb><x10>","4","0","","",""
"2883329","1","11459963","","2010-05-21 15:17:28","2","3669","<p>Using <a href=""http://stackoverflow.com/questions/1930963/rotating-a-view-in-android"">this mechanism</a> I'm able to successfully rotate the image in an ImageView.  Works great.</p><p>However, if the ImageView has a background image, that drawable is not also rotated.  How can I also rotate the background image of an ImageView?</p>","82156","","","","","2012-07-12 20:19:27","Rotate an Android ImageView AND its background","<android><rotation><imageview>","2","0","","",""
"2883355","1","2885744","","2010-05-21 15:21:00","60","51576","<p>In my application I will receive a byte stream and convert it to a pdf file in the phone memory. How do I render that to a pdf? And show it on an activity?</p>","279560","","114066","","2010-10-11 11:34:10","2013-07-01 19:10:52","How to render PDF in Android","<java><android><pdf>","2","1","40","",""
"2883368","1","2884599","","2010-05-21 15:21:41","2","1046","<p>Recently one of our clients is considering the posibility of picking up an old WinMobile 5.0 project.</p><p>Several features are to be added to the point it will be a major version update.</p><p>The client is worried about the mobile market, and thinks there's a chance all the effort put in this development will have to be thrown away in a couple of year due to the dinamics of the mobile market and the deprecation of mobile devices.</p><p>So, the client is not sure whether he should continue with Windows Mobile (changing from WM 5.0 to 6.X) or starting from scratch with another technology.</p><p>From our part we have been studing the mobile market, looking for clues for which will be the winning horse.</p><p>The safe move seems to continue with WM just because re writing an entire application from scratch involves more risks and delays.</p><p>On the other hand WM seems to be losing market and the ghost of an exit on their part is growing stronger everyday.</p><p>But what can be say about Android? Everyone is talking about it and is growing at full speed but what avantagies will it bring to the table? Why should we start a fresh applicaction on this technology?</p><p>So the question remains the same.. is Android mature enough for an enterprise application? Will you recomend it to one of your clients? Will you port/rewrite a WM application to Android? What's the trade-off?</p><p>EDIT: Addressing commentaries.</p><ul><li>The app is entirely built with C# and Compact Framework.</li><li>The app is for logistics/management. </li></ul>","215542","","918414","","2012-08-03 09:15:36","2012-08-03 09:15:36","Why Android for enterprise applications?","<android><windows-phone-7><windows-mobile>","2","4","","2012-08-03 14:03:38",""
"2883518","1","","","2010-05-21 15:43:51","4","3295","<p>Following line will only not result in a nullpointer exception if I'm connected to a WLAN:</p><pre><code>ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);</code></pre><p>Otherwise I get a nullpointer-exception straight ahead? How can I fix this? I want my background service to only work, when it is connected to wlan. But that Nullpointerexception just kills the whole app...</p>","283494","","","","","2012-11-08 16:25:08","Nullpointerexception getSystemService","<android>","3","3","2","",""
"2883568","1","2885433","","2010-05-21 15:51:06","3","1534","<p>I am trying to catch the intent that is fired when someone clicks on a hyperlink to a web page in the Mms browser. I have this in the manifest:                                            </p><pre><code>        &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;data android:scheme=""http"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>However, when I click on <a href=""http://www.ibm.com"" rel=""nofollow"">http://www.ibm.com</a> it only launches Browser. Same when I do $ am start -a android.intent.action.VIEW -d <a href=""http://www.ibm.com"" rel=""nofollow"">http://www.ibm.com</a>in an adb shell. Any ideas what I am doing wrong?</p><p>Thanks very much,c</p>","320592","","","","","2010-05-21 20:43:14","How do you catch the intent for opening a web page?","<android>","1","1","1","",""
"2883635","1","3750159","","2010-05-21 16:03:09","30","16953","<p>When I change any .java file and build, the compilation takes 16 seconds. I don't understand why it should be so slow!?</p><p>I enabled verbose output for Andoroid.</p><pre><code>Window &gt; Preferences &gt; Android &gt; Build output &gt; Verbose.</code></pre><p>The result output (Console > Android) is:</p><pre><code>[19:46:10] Refreshing resource folders.[19:46:10] Starting incremental Pre Compiler: Checking resource changes.[19:46:10] Nothing to pre compile![19:46:10] Starting incremental Package build: Checking resource changes.[19:46:10] ignored resource ...\bin\.\classes.dex[19:46:10] processing ...\A.class[19:46:10] processing ...\B.class    ...[19:46:21] processing com/google/inject/util/Providers.class...[19:46:21] processing com/google/inject/util/Types.class...[19:46:24] Using default debug key to sign package[19:46:24] Packaging ...\bin\resources.ap_[19:46:24] Packaging classes.dex    ...[19:46:25] Packaging ...\annotations.jar[19:46:25] Build Success![19:46:25] Refreshing resource folders.[19:46:25] Starting incremental Pre Compiler: Checking resource changes.[19:46:26] Nothing to pre compile!</code></pre><p>The ""processing"" of .class files took 14 seconds. And it ""processed"" all files, even from all .jar files linked. I think some thing wrong goes here, as only one .java file was changed.</p><p>What can I do to improve the compilation speed?</p>","62192","","","","","2013-09-07 07:09:55","Android compilation is slow (using Eclipse)","<android><performance><compilation>","5","4","11","",""
"2883652","1","","","2010-05-21 16:05:44","0","166","<p>I'm doing a map application for the android phone but kept running into these errors when i run it.... can anyone help?? thank you!</p><p>Problems occurred when invoking code from plug-in: ""org.eclipse.ui.workbench"". </p><p>and</p><p>Error Mon Apr 12 23:10:58 EDT 2010 Resource is out of sync with the file system: '/GoogleMaps/res/layout/main.xml'. org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/GoogleMaps/res/layout/main.xml'. at org.eclipse.core.internal.resources.File.checkSynchronized(File.java:104) </p><p>My main file:</p>","345525","","","","","2010-05-22 13:10:09","android map application error","<android><map>","1","0","","",""
"2884501","1","2888594","","2010-05-21 18:17:43","17","12480","<p>I'm learning about using Custom Views from the following:</p><p><a href=""http://developer.android.com/guide/topics/ui/custom-components.html#modifying"">http://developer.android.com/guide/topics/ui/custom-components.html#modifying</a></p><p>The description says:</p><blockquote>  <p>Class Initialization  As always, the  super is called first. Furthermore,  this is not a default constructor, but  a parameterized one. The EditText is  created with these parameters when it  is inflated from an XML layout file,  thus, our constructor needs to both  take them and pass them to the  superclass constructor as well.</p></blockquote><p>Is there a better description?  I've been trying to figure out what the constructor(s) should look like and I've come up with 4 possible choices (see example at end of post).  I'm not sure what these 4 choices do (or don't do), why I should implement them, or what the parameters mean.  Is there a description of these?  </p><pre><code>public MyCustomView(){    super();}public MyCustomView(Context context){    super(context);}public MyCustomView(Context context, AttributeSet attrs){    super(context, attrs);} public MyCustomView(Context context, AttributeSet attrs, Map params){    super(context, attrs, params);} </code></pre>","329999","","72882","","2013-01-07 22:18:36","2013-01-07 22:18:36","Android Custom View Constructor","<xml><android><custom-view>","2","0","7","",""
"2884554","1","","","2010-05-21 18:25:39","0","565","<p>Ey guys,</p><p>I am wondering if it is possible to retrieve device's phone number via the Android API(specifically 1.5 API). Thanks in advance!</p>","347339","","","","","2010-05-21 20:46:53","Possible to Retrieve Device's Phone Number Automatically In Android?","<android><numbers><phone>","1","0","","",""
"2884620","1","9312403","","2010-05-21 18:36:23","10","23193","<p>I wish to simulate camera in the android emulator using the webcam. Basically I need to only take photos with the camera in the emulator (live preview is not needed i.e if it makes it any easier)</p><p>I followed the tutorial <a href=""http://www.tomgibara.com/android/camera-source"">here</a> which is the only one I could find that was close to my requirements </p><p>But many of the libraries used in that tutorial(like android.hardware.CameraDevice) are not available in present sdk and are replaced by new libraries(like android.hardware.camera).</p><p>Any help on how to do this in the present sdk(2.1 or 2.2) would be much appreciated.</p>","323404","","","","","2012-05-31 19:47:00","Using Camera in the Android emulator","<android><camera><emulator><simulation>","6","0","3","",""
"2885019","1","","","2010-05-21 19:33:05","1","276","<p>Looking to do iphone, android, and possibly windows phone development on a Mac Pro.  What are the pluses and minuses of using a Mac Pro and a dual boot.  Unlike most, Windows 7 will be the primary OS since most supporting software will be done with Visual Studio 08/10 over the next year.  I have found driver issues from a few years ago.  Do any of these issues still exist?</p>","324505","","21234","","2010-12-05 20:11:57","2010-12-05 20:11:57","Windows development on a Mac Pro","<android><osx><windows-7>","1","0","","",""
"2885170","1","","","2010-05-21 19:58:42","1","800","<p>I have an Android game that has an activity for the menu, and then another activity for the game that creates a SurfaceView and Thread to deal with canvas drawing and game logic. When you exit the game and start it up again too much or if you open and close the keyboard (thus restarting the activity), the game runs out of memory, usually when loading a bitmap:</p><pre><code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></pre><p>How can I keep all my images in memory without loading them again when the game changes state, or how can I release them from memory and let them reload when the game is restarted?</p>","63887","","","","","2013-01-02 04:11:57","My Android game runs out of memory when it is closed and opened and couple times","<java><android><memory><bitmap>","3","0","","",""
"2885372","1","","","2010-05-21 20:33:13","1","490","<p>Is it possible to create a ColorDrawable object without using xml?  I would like to be able to change the backgroundColor of a view programmatically, using setBackgroundColor() or setBackgroundDrawable() or setBackgroundResource(), but I want to be able to specify the RGB values in code, not XML.  Is this possible?</p>","322636","","","","","2012-10-22 12:17:21","Android: Create a ColorDrawable object without using xml","<android><resources>","2","0","","",""
"2885537","1","","","2010-05-21 20:58:54","5","986","<p>I've started to develop in Android 2 weeks ago and until now, I like it!Currently I am working on a project where I have to display an individual map (not a google maps view, I'd like to display the map of a building's interior) with which the user can interact(mark positions, etc.).Is there a framework or an existing app that I could use? Of course I searched the internet but could not find anything.Perhaps it is in some way possible to use the google maps API?I hope you can help me, thanks in advance!</p>","347471","","1869904","","2012-12-24 08:29:20","2012-12-24 08:29:20","Framework/App for custom maps(not general google maps)","<android><google-maps><maps>","1","0","2","",""
"2885813","1","","","2010-05-21 21:47:22","0","308","<p>So I did the Notepadv1 tutorial.  It worked great. No problems.  I would however like some explanation on why the mNoteNumber remembers the last number of the item I created.</p><p>So the class starts as follows:</p><pre><code>public class Notepadv1 extends ListActivity {     private int mNoteNumber = 1;</code></pre><p>That's fine, I understand that.  The only other time the mNoteNumber variable is used is when you add an item it creates a note with that number and then increments it to the next number as follows:</p><pre><code>private void createNote() { String noteName = ""Note "" + mNoteNumber++;</code></pre><p>Those are the only two references to the variable mNoteNumber.  When I press the Home button and then reopen the app, I add a new note but instead of adding a second ""Note 1"" it remembers that the last note I added as ""Note 3"" so it makes ""Note 4"".  So I don't get it.  Does Java/Android remember the last state of variables?</p><p>If anyone could give me some explanation that would be great THANKS!</p>","347503","","1228","","2013-08-15 14:45:23","2013-08-15 14:45:23","Android Notepadv1 Tutorial - Persistent mNoteNumber?","<java><android>","1","0","","",""
"2885852","1","2889844","","2010-05-21 21:54:46","4","3710","<p>I am one step away from making the method described here:<a href=""http://stackoverflow.com/questions/2761443/targeting-android-with-scala-2-8-trunk-builds"">http://stackoverflow.com/questions/2761443/targeting-android-with-scala-2-8-trunk-builds</a></p><p>work with a single project (vs one project for scala and one for android). </p><p>I've come across a problem. Using this input file (arguments to) proguard:</p><pre><code>-injars bin;lib/scala-library.jar(!META-INF/MANIFEST.MF,!library.properties)-outjar lib/scandroid.jar-libraryjars lib/android.jar-dontwarn-dontoptimize-dontobfuscate-dontskipnonpubliclibraryclasses-dontskipnonpubliclibraryclassmembers-keepattributes Exceptions,InnerClasses,Signature,Deprecated,                SourceFile,LineNumberTable,*Annotation*,EnclosingMethod-keep public class org.scala.jeb.** { public protected *; }-keep public class org.xml.sax.EntityResolver { public protected *; }</code></pre><p>Proguard successfully builds scandroid.jar, however it appears to have included the generated R classes that the android resource builder generates and compiles. In this case, they are located in bin/org/jeb/R*.class. This is not what I want. The android dalvik converter cannot build because it thinks there is a duplicate of the R class (it's in scandroid and also the R*.class files). How can I modify the above proguard arguments to exclude the R*.class files from the scandroid.jar so the dalvik converter is happy?Edit: I should note that I tried adding ;bin/org/jeb/R.class;etc... to the -libraryjars argument, and that only seemed to cause it to complain about duplicate classes, and in addition proguard decided to exclude my scala class files too.</p>","278966","","","","","2013-05-01 00:02:52","How to exclude R*.class files from a proguard build","<android><eclipse><scala><proguard>","2","2","1","",""
"2886053","1","4612594","","2010-05-21 22:38:34","0","1542","<p>my application objective is to save location updates every ,let say, 20 minuets .</p><p>I used service and it worked fine , but when i lock the screen or it is locked automatically the service stop running .when i unlock it , service runs again.</p><p><strong>highlight on my code:</strong></p><p>Service()</p><pre><code>onCreat(){   call timer(); }timer(){   code }</code></pre><p>How to make my code run all the time in all conditions?</p>","347520","","347520","","2010-05-22 14:19:00","2011-01-06 07:00:59","How to make Android Service run even when the device is not awake?","<android><android-service><android-location>","2","0","","",""
"2886140","1","","","2010-05-21 23:02:51","9","2489","<p>I have the following <code>LinearLayout</code>. What I don't understand is if I set the background to another image, the padding information are reset. Is there a way to prevent this?</p><pre><code>&lt;LinearLayout android:id=""@+id/aPanel""    android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:background=""@drawable/bkground""    android:paddingLeft=""15dp"" android:paddingRight=""15dp""&gt;      &lt;!-- some children here --&gt;     &lt;/LinearLayout&gt;</code></pre><p>I see the position of the children get shifted when I change the background drawable of the <code>LinearLayout</code> <em>aPanel</em>.</p>","286802","","493939","","2012-05-06 08:56:45","2013-02-17 08:34:59","Does changing the background also change the padding of a LinearLayout?","<android><background><padding><android-linearlayout>","3","2","1","",""
"2886173","1","","","2010-05-21 23:12:14","0","555","<p>I want to deploy my application with Android 2.1 features. I placed an application icon in PNG format in the drawable-ldpi,and drawable-hdpi folders. When I installed to the device, it is not showing the application icon on the home screen of the device.</p><p>Please help me how to solve this issue?</p>","341443","","15168","","2010-05-21 23:37:21","2013-03-27 21:08:55","Application icon not transferred to Android device","<android><android-emulator>","1","3","","",""
"2886382","1","2886564","","2010-05-22 00:17:23","2","252","<p>I have a square grid, for a turn based game ( grid is similar to the chess board ), but the moves in the games are different based on whether you have lapped your opponent pawn at least once or not.</p><p>i.e if you have not lapped (beaten any of the opponents pawns) in the outer most grid as below </p><p><img src=""http://img17.imageshack.us/img17/4508/squaregrid7x7home.png"" alt=""alt text""> </p><p>if you have lapped your opponent pawn once at least, then you get to reach home,this way.Any player having all his pawns reaching ""home"" first wins.</p><p><img src=""http://img249.imageshack.us/img249/318/squaregrid7x7movesimple.png"" alt=""alt text""></p><p>The ones in yellow are safe-houses, i.e both the opponent pawn and the player's pawn get to stay in the same grid, this is not considered to be lapping ( the opponent ).The lapped pawn will return to its start point.</p><p>Now the question is, what is the effective way to store the paths for the all the pawns.we will have 4 pawns for the player and 4 opponent pawns.</p><p>Is there any pattern to store such static information, in a elegant way ?</p><p>Thanks for your time</p>","214626","","","","","2010-05-22 01:25:47","How to store the path of a game pawn in a turn based game?","<java><android><design-patterns>","1","2","1","",""
"2886407","1","2893414","","2010-05-22 00:27:02","8","1621","<p>I have a Button with an OnClickListener. For illustrative purposes, consider a button that shows a modal dialog:</p><pre><code>public class SomeActivity ... {  protected void onCreate(Bundle state) {    super.onCreate(state);    findViewById(R.id.ok_button).setOnClickListener(      new View.OnClickListener() {        public void onClick(View v) {          // This should block input          new AlertDialog.Builder(SomeActivity.this)            .setCancelable(true)            .show();      }    });}</code></pre><p>Under normal usage, the alert dialog appears and blocks further input. Users must dismiss the dialog before they can tap the button again.</p><p>But sometimes the button's OnClickListener is called twice before the dialog appears. You can duplicate this fairly easily by tapping really fast on the button. I generally have to try several times before it happens, but sooner or later I'll trigger multiple onClick(...) calls before the dialog blocks input.</p><p>I see this behavior in Android 2.1 on the Motorola Droid phone. We've received 4 crash reports in the Market, indicating this occasionally happens to people.</p><p>Depending on what our OnClickListeners do, this causes all sorts of havoc. How can we guarantee that blocking dialogs actually block input after the first tap?</p>","40257","","","","","2010-05-23 21:03:27","Dealing with rapid tapping on Buttons","<android>","2","1","2","",""
"2886459","1","2887413","","2010-05-22 00:43:47","0","141","<p>I was wondering if its possible to reference one android project from another android project.  I have two projects, test1 and test2.  I have added test2 in the project properties of test1 under the projects tab.  Unfortunately it keeps throwing a NoClassDefFoundError.  Also, would the second android project (test2) be installed as a separate apk on the phone or would it be part of the encapsulating android project (test1) ?</p><p>Thanks very much!</p>","347576","","","","","2010-05-22 08:14:30","Interdependent android projects","<android><projects>","2","0","","",""
"2886545","1","2886596","","2010-05-22 01:14:46","0","288","<p>Anyone have any idea what this is or where I can get it? I thought it would just be some function on the activity or something but all I can find is an API key for google maps when I try to search for help with this. Any ideas?</p>","325127","","527702","","2013-05-19 01:49:35","2013-05-19 01:49:35","Android 3rd Party Library - Asking for my application's API Key","<android><api><key><api-key>","1","0","","",""
"2886556","1","2887554","","2010-05-22 01:21:18","22","6737","<p>I read here ( <a href=""http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html"">http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html</a> ) what intent-filter is required to handle the ""share link"" intent that the android web browser sends. I have placed this inside an  block in my AndroidManifest.xml like so:</p><pre><code>    &lt;activity android:name="".ShareLink""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""text/plain"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data/&gt;    &lt;/activity&gt;</code></pre><p>I cannot for the life of me get this to be triggered though. When I share a link in the android browser, the emulator log shows it's creating a chooser intent, but doesn't give the details of the intent the chooser is acting on. No chooser window pops up, and the intent gets handled by the SMS application.</p><p>I have also tried kicking off the intent manually:</p><pre><code>adb shell am start -D -a android.intent.action.SEND -c android.intent.category.DEFAULT -t text/plain -d http://google.com/</code></pre><p>but the response I get is:</p><pre><code>Starting: Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain }Error: Activity not started, unable to resolve Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain flg=0x10000000 }</code></pre><p>Can anyone tell me what I'm doing wrong? My main (launcher) activity works fine, so I assume there is no issue with installation on the emulator.</p>","144135","","","","","2010-05-22 09:24:39","How do I handle the browser's ""share page"" intent in android?","<android><android-intent>","1","0","5","",""
"2886599","1","2886621","","2010-05-22 01:41:27","1","2528","<p>The app I am working on needs to read a JSON file that may be anywhere from 1.5 to 3 MB in size. It seems to have no problem opening the file and converting the data to a string, but when it attempts to convert the string to a JSONArray, OutOfMemoryErrors are thrown. The exceptions look something like this: </p><pre><code>E/dalvikvm-heap( 5307): Out of memory on a 280-byte allocation.W/dalvikvm( 5307): Exception thrown (Ljava/lang/OutOfMemoryError;) while throwing internal exception (Ljava/lang/OutOfMemoryError;)</code></pre><p>One strange thing about this is that the crash only occurs every 2nd or 3rd time the app is run, leaving me to believe that the memory consumed by the app is not being garbage collected each time the app closes. </p><p>Any insight into how I might get around this issue would be greatly appreciated. I am open to the idea of loading the file in chunks, but I'm not quite sure what the best approach is for such a task. </p><p>Thank you</p>","230561","","","","","2012-11-30 02:37:51","Android OutOfMemoryError - Loading JSON File","<java><android><json><crash><memory-management>","3","2","2","",""
"2886827","1","","","2010-05-22 03:29:00","1","172","<p>I am adding a local database as a cache to a remote web service in my android application to answer queries. I used ArrayAdapters before for list views to display the results from the web service. Now with a database cache, the result could be either a Cursor(from database) or a List(from web), which means the adapter can be CursorAdapter or ArrayAdapter too. Creating two adapters for one query doesn't seem to be a good idea. So I am wondering what would be the best way to refactor my current code to add this database feature?  </p><p>Thanks,</p>","109704","","","","","2010-09-13 04:44:01","Android: making a custom ListView independent of adapters?","<android>","1","0","","",""
"2887119","1","2887639","","2010-05-22 05:57:41","25","25478","<p>Is it possible to take a csv file stored in the res/raw resource directory and use it to populate a table in the sqlite3 database?</p><p>My thought was that, if there was a way to do a bulk import for the entire file into the table then that would be cleaner and faster than iterating over each line in the file and executing individual insert statements...</p><p>I've found that there is a sqlite import command that allows this: <a href=""http://stackoverflow.com/questions/1045910/how-can-i-import-load-a-sql-or-csv-file-into-sqlite"">http://stackoverflow.com/questions/1045910/how-can-i-import-load-a-sql-or-csv-file-into-sqlite</a></p><p>...but I'm having trouble applying those statements in my Android application. My first thought was to try something like the following...but no luck:</p><pre><code>db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT)"");db.execSQL("".mode csv"");db.execSQL("".import res/raw/MyFile.csv "" + TABLE_NAME); </code></pre><p>Is this possible?</p><p>Should I be trying a different approach to populate my database?</p><p>UPDATE: I'm marking Josef's response  as the answer (bulk insert using transactions) because it works fine and directly answers my question based on my title (thanks Josef). However, I'm am still looking for a way to do a bulk insert in an Android app from csv file into a sqlite3 table using the import statement.  If you know how to do this please respond.</p><p>Thanks for you answers!</p>","176728","","176728","","2010-05-26 04:14:24","2010-11-18 00:04:25","Populate Android Database From CSV file?","<database><android><sqlite><import><sqlite3>","2","0","25","",""
"2887368","1","2888262","","2010-05-22 07:56:01","2","3590","<p>I have been looking it up and I just cant seem to wrap myself around the onCreate and Bundles.  I understand that the onCreate is called when the program starts but its how the Bundles get passed around and how they are pertinent.  Can anyone try to put this into plain english because I cant seem to find it well described.</p><p>Thanks</p>","336861","","","","","2010-05-22 13:29:56","Can you please explain onCreate and Bundles?","<android><bundle><oncreate>","1","0","1","",""
"2887410","1","","","2010-05-22 08:12:18","2","1791","<p>I have a Listview in my application. Listview rows are clickable. I have introduced a seek bar in each row of a Listview. Despite settings android:clickable=""false"" for Seekbar in layout xml, I am still able to click on it and move seek bar as desired. I don't want Seekbar to be clickbale but I do want Listview row to clickable.</p><p>Any pointers will be appreciated.</p><p>Here's my layout file</p><pre><code>android:progressDrawable=""@drawable/slider_range""        android:thumb=""@drawable/slider_thumb""        android:layout_width=""80dip""        android:layout_height=""12dip""        android:focusable=""false""        android:clickable=""false""        android:longClickable=""false""</code></pre>","248132","","248132","","2010-05-22 08:51:36","2012-04-26 21:12:04","Unclickable Seekbar in android listview","<android>","3","1","0","",""
"2887436","1","2887443","","2010-05-22 08:25:09","67","44990","<p>I moved my Android project to a laptop and now I get this when I hit Debug. Sounds like this is a bug? This shouldn't happen via Eclipse as far as I know.</p><pre><code>Re-installation failed due to different application signatures.</code></pre><p><strong>The weirdest thing is this happened after I upgraded sdk/adt and Eclipse to support SDK 2.2</strong> It was working fine earlier, and now it doesn't, so it might be a bug.</p>","243782","","243782","","2010-05-22 22:37:27","2013-05-03 12:32:36","Re-installation failed due to different application signatures","<eclipse><android>","11","4","14","",""
"2887481","1","","","2010-05-22 08:45:50","0","790","<p>I have some questions regarding database in android.</p><ol><li><p>In my project, I would like to create a database with single table. I would also like to insert data on this table from word or excel document. is it possible? if so please how can I do it? some code snippets would be of great help.</p></li><li><p>I have four different activities which I would like them to interact with this single table. the first is the main activity and its purpose is just to launch the other three activities according to user choice. so it has no interaction with the DB. but the other three activities will read from the table whenever called. Can you please tell me how to call the dbhelper on these activities? I am unable to do this and I am currently creating one db per each activity which is not the optimal way.</p></li></ol>","347723","","157882","","2010-05-22 10:43:38","2010-05-22 10:43:38","sqlite database help","<java><android><sqlite>","1","0","","",""
"2887807","1","","","2010-05-22 11:00:46","0","656","<p>Is it possible that the Android browser renders the HTML list box, such as:</p><p>    item 1    item 2    item 3    item 4    All</p><p>as a dropdown? I can't seem to get it to display a proper multiline listbox. Anyone knows what the trick is?</p>","225480","","","","","2010-09-15 20:51:48","Android 1.6 Browser List box HTML element","<html><android><browser><listbox>","1","0","","",""
"2888043","1","2888066","","2010-05-22 12:20:17","4","4026","<p>I am developing a game. In which, i want do set different vibration intensities for different events. I just want know if its really possible to control the vibration intensity and duration. Any advice or reference links, could be very helpful. Thanks in advance.</p>","347783","","","","","2013-12-31 15:01:09","controlling vibration intensity in android phones? is it possible?","<java><android>","3","0","","",""
"2888104","1","2888167","","2010-05-22 12:44:03","2","346","<p>I will be releasing two applications soon, one for my company and one for me. Publishing app on my own is straightforward, but I'm not sure which account to use for the company.</p><p>What practice do you use in your company?</p><p>I only see one solution, creating a special google account like android@company.com shared by the company Android devs.</p>","97976","","","","","2010-05-22 13:02:58","Google account to use for releasing company app on the Android Market","<android>","1","0","","",""
"2888127","1","2888606","","2010-05-22 12:51:16","5","3486","<p>I have been developing android apps out of hobby and fun. I want to get more serious about android development. One particular thing that I am very keen on doing (or atleast trying my hand at) is andoroid ROM development for specific handsets. Like, maybe outdated HTC Touch. (Elf/Elfin).</p><p>I am at a loss to understand, what does it take to get started in right direction and what does it entails? I would really appreciate your help if you could point me to some resources which would highlight ROM Development for Android specifically. (Fundamentals of ROM development irrespective of OS would help too).</p><p>Cheers  </p>","57847","","","","","2011-09-20 03:46:16","Android ROM Development. What does it take?","<android><mobile>","1","0","3","",""
"2888200","1","2888692","","2010-05-22 13:12:19","2","1155","<p>How would I force the current thread to wait until another has finished before continuing.</p><p>In my program the user selects a <code>MODE</code> from an <code>AlertDialog</code>, I want to halt executing of the program before continuing as the mode holds important configuration for the gameplay.</p><pre><code>        new AlertDialog.Builder(this)    .setItems(R.array.game_modes, new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            switch (which) {            case 0:                setMode(TRAINING_MODE);            case 1:                setMode(QUIZ_MODE);            default:                setMode(TRAINING_MODE);                break;            }            //continue loading the rest of onCreate();            contineOnCreate();        }    })    .create().show();</code></pre><p>If this is impossible can anyone give a possible solution?</p>","248521","","750613","","2012-06-28 10:34:32","2012-06-28 10:34:32","Waiting for DialogActivity to return before continuing executing of the main thread","<android><android-alertdialog>","1","4","0","",""
"2888230","1","2888289","","2010-05-22 13:20:08","2","1644","<p>How do I go to previous screen from current screen in Android app? I know there is a back button on phone, but it takes me to beginning screen of my app and I want my buttons on app to work for going back to previous screen. </p>","203018","","","","","2010-05-22 13:43:03","how to go on previous screen from current screen in Android app","<android><activity>","1","0","3","",""
"2888508","1","2888708","","2010-05-22 14:46:30","83","122848","<p>How to change the font in a <code>TextView</code>, as default it's shown up as Arial? How to change it to <code>Helvetica</code>?</p>","267269","","493939","","2012-05-06 06:17:59","2014-01-22 16:12:14","How to change the font on the TextView?","<android><fonts><textview>","9","1","24","",""
"2888557","1","","","2010-05-22 14:59:26","-1","476","<p>Can someone explain to me the concept behind using bluetooth?</p><p>My project in my studies is to make an android app using bluetooth, SQLLIGHT and google app the app itself is a very easy one but I just dont get the tools I need to use : </p><p>How does the bluetooth works? Is there a simple example?the concept behind android GUI (I already made one but I think I am not fully understood his power)?</p><p>note : I am using v 2.1 </p>","346447","","1465910","","2012-09-29 10:16:03","2012-09-29 10:16:03","android bluetooth","<android><bluetooth>","1","0","","",""
"2888713","1","2888902","","2010-05-22 15:45:00","1","2470","<p>Before making this question, I have searched and read these ones:<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><a href=""http://stackoverflow.com/questions/1409623/android-issue-with-lazy-loading-images-into-a-listview"">http://stackoverflow.com/questions/1409623/android-issue-with-lazy-loading-images-into-a-listview</a></p><p>My problem is I have a <code>ListView</code>, where:</p><ul><li>Each row contains an <code>ImageView</code>, whosecontent is to be loaded from theinternet</li><li>Each row's view is recycled as inApiDemo's List14</li></ul><p>What I want ultimately:</p><ul><li>Load images lazily, only when the userscrolls to them</li><li>Load images on different thread(s) tomaintain responsiveness</li></ul><p>My current approach:</p><ul><li>In the adapter's <code>getView()</code> method, apart fromsetting up other child views, I launch anew thread that loads the Bitmap fromthe internet. When that loading threadfinishes, it returns the <code>Bitmap</code> to be set on the <code>ImageView</code> (I do this using <code>AsyncTask</code> or <code>Handler</code>).</li><li>Because I recycle <code>ImageView</code>s, it maybe the case that I first want to seta view with <code>Bitmap#1</code>, then later wantto set it to <code>Bitmap#2</code> when the userscrolls down. <code>Bitmap#1</code> may happen totake longer than <code>Bitmap#2</code> to load, soit may end up overwriting <code>Bitmap#2</code> onthe view. I solve this by maintaininga <code>WeakHashMap</code> that remembers the last <code>Bitmap</code> I wantto set for that view.</li></ul><p>Below is somewhat a pseudocode for my current approach. I've ommitted other details like caching, just to keep the thing clear.</p><pre><code>public class ImageLoader {    // keeps track of the last Bitmap we want to set for this ImageView    private static final WeakHashMap&lt;ImageView, AsyncTask&gt; assignments                                    = new WeakHashMap&lt;ImageView, AsyncTask&gt;();    /** Asynchronously sets an ImageView to some Bitmap loaded from the internet */    public static void setImageAsync(final ImageView imageView, final String imageUrl) {        // cancel whatever previous task        AsyncTask oldTask = assignments.get(imageView);        if (oldTask != null) {            oldTask.cancel(true);        }        // prepare to launch a new task to load this new image        AsyncTask&lt;String, Integer, Bitmap&gt; newTask = new AsyncTask&lt;String, Integer, Bitmap&gt;() {            protected void onPreExecute() {                // set ImageView to some ""loading..."" image            }            protected Bitmap doInBackground(String... urls) {                return loadFromInternet(imageUrl);            }            protected void onPostExecute(Bitmap bitmap) {                // set Bitmap if successfully loaded, or an ""error"" image                if (bitmap != null) {                    imageView.setImageBitmap(bitmap);                } else {                    imageView.setImageResource(R.drawable.error);                }            }        };        newTask.execute();        // mark this as the latest Bitmap we want to set for this ImageView        assignments.put(imageView, newTask);    }    /** returns (Bitmap on success | null on error) */    private Bitmap loadFromInternet(String imageUrl) {}}</code></pre><p>Problem I still have: what if the Activity gets destroyed while some images are still loading?</p><ul><li>Is there any risk when the loadingthread calls back to the ImageViewlater, when the Activity is alreadydestroyed?</li><li>Moreover, <code>AsyncTask</code> has some globalthread-pool underneath, so if lengthytasks are not canceled when they'renot needed anymore, I may end upwasting time loading things users<br>don't see. My current design ofkeeping this thing globally is toougly, and may eventually cause someleaks that are beyond myunderstanding. Instead of making<code>ImageLoader</code> a singleton like this,I'm thinking of actually creatingseparate <code>ImageLoader</code> objects fordifferent <code>Activities</code>, then when an<code>Activity</code> gets destroyed, all its<code>AsyncTask</code> will be canceled. Is thistoo awkward?</li></ul><p>Anyway, I wonder if there is a safe and standard way of doing this in Android. In addition, I don't know iPhone but is there a similar problem there and do they have a standard way to do this kind of task?</p><p>Many thanks.</p>","159759","","","","","2012-12-28 01:07:36","Safe, standard way to load images in ListView on a different thread?","<android><listview><multithreading><imageview><android-asynctask>","1","0","3","",""
"2888738","1","2888790","","2010-05-22 15:53:15","1","122","<p>I have an android app for which i need to ensure that it has no design/interface issues on both Motorola Droid and HTC touch-screens.Now my question is that do i have to have both devices available for testing? If not, then is there an alternate? </p>","2355649","","","","","2010-05-22 16:07:55","Do i have to have both Droid and HTC to test my android app?","<android>","1","0","","",""
"2888780","1","2888892","","2010-05-22 16:03:46","14","13846","<p>LEts say you have a normal textview, with ""Stackoverflow"" written in it, I would like to know if it it possible to rotate the textview about -90°, to have the S at the bottom and the W at the top of the screen?of course, i could write my text in an image, rotate it and use it that way, but im interested in text right now.thank you</p>","263521","","","","","2013-06-08 17:22:36","Is it possible to write vertically in a textview in android?","<android><textview>","4","1","6","",""
"2888896","1","4056896","","2010-05-22 16:45:57","12","2258","<p>I want to add an entire medical dictionary to my android phone (Moto Droid). I would like to be able to send text messages and have the medical words be in the predictable text.</p><p>I've been trying to write a small app that would accomplish this, but everything I try the app crashes on startup. I've never written an app for a mobile platform so that is a first for me. Here is what is not working properly.</p><pre><code>public class WordAdd extends Activity {/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    UserDictionary.Words.addWord( this , ""newMedicalWord"", 1, UserDictionary.Words.LOCALE_TYPE_CURRENT);}</code></pre><p>}</p><p>It seems so simple to do, yet I am so stuck. Thanks for any help you can provide.</p><p><strong>EDIT:</strong> I should mention that I am getting this error for Android 2.1 in the AVD (virtual device).</p><p><strong>EDIT 2:</strong> <a href=""http://developer.android.com/reference/android/provider/UserDictionary.html"">User Dictionary</a> is found in the Android API. <a href=""http://developer.android.com/reference/android/provider/UserDictionary.Words.html"">addWord</a> is a static method. I don't declare UserDictionary because I just use the one static method. It's been ages since I developed anything in Java and this is my first attempt at any mobile development, so I don't know if I am doing something wrong.</p>","256048","","256048","","2010-05-29 02:41:40","2012-02-27 11:05:24","Add Words to Android's UserDictionary","<android>","3","7","5","",""
"2888943","1","2889310","","2010-05-22 16:58:51","1","2852","<p>I'm making an android program that retrieves content of a webpage using HttpURLConnection. I'm new to both Java and Android.</p><p>Problem is: Reader reads whole page source, but in the last while iteration it doesn't append to stringBuffer that last part. </p><p>Using debbuger I have determined that, in the last loop iteration, string buff is created, but stringBuffer just doesnt append it.</p><p>I need to parse retrieved content. Is there any better way to handle the content for parsing than using strings. I've read on numerous other sites that string size in Java is limited only by available heap size. I've tried with StringBuilder too.</p><p>Anyone know what could be the problem. Btw feel free to suggest any improvements to the code. </p><p>Thanks!</p><pre><code>URL u;    try {        u = new URL(""http://feeds.timesonline.co.uk/c/32313/f/440134/index.rss"");        HttpURLConnection c = (HttpURLConnection) u.openConnection();        c.setRequestProperty(""User-agent"",""Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)"");        c.setRequestMethod(""GET"");        c.setDoOutput(true);       c.setReadTimeout(3000);          c.connect();        StringBuffer stringBuffer = new StringBuffer("""");        InputStream in = c.getInputStream();        InputStreamReader inp = new InputStreamReader(in);        BufferedReader reader = new BufferedReader(inp);        char[] buffer = new char[3072];        int len1 = 0;        while ( (len1 = reader.read(buffer)) != -1 )         {            String buff = new String(buffer,0,len1);            stringBuffer.append(buff);        }        String stranica = new String(stringBuffer);        c.disconnect();        reader.close();        inp.close();        in.close();</code></pre>","347891","","347891","","2010-05-22 17:25:47","2010-05-22 18:42:29","StringBuffer wont read whole stream into a string (JAVA/Android)","<java><android><string><httpurlconnection><bufferedreader>","2","3","","",""
"2889203","1","","","2010-05-22 18:14:02","10","14988","<p>This is really starting to drive me crazy.</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+/textview""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:text=""@string/hello""/&gt; </code></pre><p>Produces the following error message: ""<code>Error: no resource found that matches the given name (at 'id' with value '@id+/textview')</code>.</p><p>This is copy and pasted from the Android hello world<a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">example</a>.</p>","347926","","750613","","2012-06-28 10:33:11","2013-01-02 07:39:39","No resource found that matches given name in main.xml","<android>","3","0","","",""
"2889318","1","2889726","","2010-05-22 18:44:04","0","602","<p><em>For anyone who's wondering, the gallery is <a href=""http://www.spore.com/sporepedia"" rel=""nofollow"">http://www.spore.com/sporepedia</a>.</em></p><p>My app uses the Spore API to get the 100 newest creations, then displays them in a GridView. The text data about the creations is easy to store, but the images present a problem.</p><p>As far as I know, I can either keep the images in a Hashtable or grab them every time they are viewed. Neither of these will work - the Hashtable quickly presents an OutOfMemoryError, and the constant reloading causes a lot of load on the server and a lot of lag on the client.</p><p>Is there a better way to store the images?</p>","347947","","","","","2010-05-22 20:55:44","Giant online image gallery - How do I avoid OutOfMemoryError?","<android>","1","0","","",""
"2889332","1","2889541","","2010-05-22 18:48:24","1","113","<p>I have the following code:</p><pre><code>    /** Open a browser on the URL specified in the text box */private void openBrowser() {    Uri uri = Uri.parse(urlText.getText().toString());    Intent intent = new Intent(Intent.ACTION_VIEW, uri);    startActivity(intent);}</code></pre><p>When I input ""http://www.google.com"" to the textbox, it works fine. However, when I try something like ""www.google.com"" it crashes with:</p><blockquote>  <p>No Activity found to handle Intent {  act=android.intent.action.VIEW  dat=www.google.com }</p></blockquote><p>Am I using Uri wrong? Is there a way to extract full address from it? Or am I supposed to write code that adds http manually? e.g, if not starts with http://, add http://.</p><p>Thanks!</p>","126574","","","","","2010-05-22 19:49:24","Starting a browser from a textbox via Intent - Is http:// required?","<android>","1","0","","",""
"2889388","1","2889534","","2010-05-22 19:00:55","2","2534","<p>In an Android app, I am using one static instance of org.apache.http.impl.client.DefaultHttpClient and sharing that instance in all activities and services of the app, so that this client may be used to log in once to a remote server and all subsequent user requests to that remote server will remain authenticated.</p><p>Every activity or Service that makes a GET or POST to this remote server calls the same method : MyUtilityClass.gettHttpClient()</p><p>Do I need to worry about synchronization of this httpclient? If so, what is the best way to handle this?</p>","268648","","","","","2011-04-01 11:58:57","Sharing DefaultHttpClient in Android. To synchronize or not to synchronize?","<android><httpclient>","3","0","1","",""
"2889530","1","","","2010-05-22 19:45:12","8","8802","<p>I'd like to check for memory leaks in my Android app using the <code>DDMS</code> feature in <code>Eclipse</code>. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.</p><p>However, when I connect my Droid to the PC, the device shows up just fine in DDMS. The logcat is generated correctly, and I can view the file structure. However, threads do not display. I get ""no client selected"" in the Threads pane, and there is no drop-down icon next to the device listing.</p><p>Do I need to change some particular setting in Eclipse? Is this maybe a driver issue? </p>","242869","","750613","","2012-06-28 10:30:49","2014-01-18 20:29:56","DDMS Not Showing Threads From Device","<android><eclipse><ddms>","4","0","2","",""
"2889573","1","","","2010-05-22 20:00:00","1","3251","<p>I need a sample code or tutorial for accessing phone images/media through content provider ?</p><p>I know the following, what next ?</p><pre><code>ContentResolver cr = mContext.getContentResolver();Cursor cursor = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);</code></pre>","347982","","750613","","2012-06-28 10:30:12","2012-06-28 10:30:12","accessing phone images through content provider in android","<android><image><context><media><android-contentprovider>","1","2","1","",""
"2889670","1","2889725","","2010-05-22 20:39:01","4","954","<p>I'm searched adobe and android developers sites, but can't find any details on this.</p><p>Is it possible to use Flash as a part of my app? E.g. like a widget/GUI element? Or it's integrated in browser only and can't be simple accessible?</p><p>I know, Adobe AIR apps are supported as standalone .apk. So it must be some API/SDK (from Google) to connect with Flash player.</p><p>Is there any details, how to program it (more clear: launch swf from my app and interact with it)?</p><p>Thank you!</p>","140592","","750613","","2012-06-28 10:29:44","2012-06-28 10:29:44","How Android 2.2 interacting with Flash 10.1 (how to use flash from my app)?","<android><flash><air><flashplayer-10><android-2.2-froyo>","2","0","3","",""
"2889689","1","","","2010-05-22 20:45:07","0","657","<p>**Hello, I am trying to retrieve the 2nd value from a Arraylist/ArrayAdapter that I have populated.  I am new to Array so please correct me if I am wrong </p><p>Q1. I created the Array Favorite. What I think what I created is an Array with two set of value call Detail | Value. example Detail=""Yasmin"",Value=""8"". Is this correct?</p><p>Q2.  I have assign the Favorite Array to the mFavlist listview.  During the OnItemClick I can return the label ""Yasmin"" by the position of the listview.  What I would like to do is return the value of ""8"".  What would be the best way to do this?</p><p>Please let me know if I am on the right track via the array and  adapter**</p><pre><code>import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.AdapterView.OnItemClickListener;public class lister extends Activity {    /** Called when the activity is first created. */        TextView txHomeTeam;        protected ListView mFavlist;        protected ArrayList&lt;Favorite&gt; fakeFavs = new ArrayList&lt;Favorite&gt;();@Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);       this.setContentView(R.layout.main);        this.txHomeTeam = (TextView)this.findViewById(R.id.title);        fakeFavs.add(new Favorite(""John"", ""1""));        fakeFavs.add(new Favorite(""Yasmin"", ""8""));        fakeFavs.add(new Favorite(""Jack"", ""10""));        //this.mFavlist = (ListView) this.findViewById(R.id.list_favorites);        this.mFavlist = (ListView) this.findViewById(R.id.list_favorites);        initListView();        mFavlist.setTextFilterEnabled(true);        mFavlist.setOnItemClickListener(new OnItemClickListener() {                        @Override                        public void onItemClick(AdapterView arg0, View view,                                           int position, long id) {                                // user clicked a list item,     //and read the value from &lt;Favorite&gt;.value                                //txHomeTeam.setText=????                                }        });    }   public void refreshFavListItems() {            mFavlist.setAdapter(new ArrayAdapter&lt;Favorite&gt;(this,                            android.R.layout.simple_list_item_1, fakeFavs));    }    public void initListView() {        /* Loads the items to the ListView. */        refreshFavListItems();    }protected class Favorite {        protected String Detail;        protected String value;        protected Favorite(String Detail, String value) {                this.Detail = Detail;                this.value = value;        }        public String toString() {                return Detail;        }}}</code></pre>","123759","","123759","","2010-05-23 01:04:27","2010-05-23 14:40:48","onListItemClick with Mulitple Value/Retrieving Value","<android><listview>","1","2","","",""
"2889793","1","","","2010-05-22 21:14:38","33","23573","<p>I have a <code>ListView</code> with custom rows.  When any of these rows isclicked, the ListView's data is regenerated.  I'd like the list toscroll back to the top when this happens.</p><p>I initially tried using <code>setSelection(0)</code> in each row's <code>OnClickListener</code>to achieve this but was unsuccessful (I believe because the <code>ListView</code>loses its scroll position when its data is invalidated - so my call tosetSelection is undone.  I still don't understand how the ListViewdecides where to scroll to after invalidation, though).</p><p>The only working solution I know of was given by Romain Guy here:<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/127ca57414035301"">http://groups.google.com/group/android-developers/browse_thread/thread/127ca57414035301</a></p><p>It involves (<code>View.post</code>)ing the call to <code>_listView.setSelection(0)</code>.  Ifound this to perform quite poorly.The newly generated list shows up with its scroll location unchangedand there is a considerable delay before it scrolls back to the top.</p><p>Is there any better way to achieve this functionality?</p><p>Any help would be much appreciated.</p><p>Thanks!</p>","348010","","82118","","2010-07-22 20:20:06","2014-03-03 23:17:36","Android ListView scrolling to top","<android><listview>","5","0","12","",""
"2889821","1","2892876","","2010-05-22 21:25:32","2","1466","<p>I was wondering why the fog i use in opengl es on my android phone isn't transparent when i set the colors alpha to 0. I set the background to transparent and it works fine and the Color class or the toFloatBuffer() method are working fine for my meshes but when i set the fog color to transparent then this fact is ignored. here is the basic code i use for fog in the <code>onSurfaceCreated()</code> method of my renderer:</p><pre><code>gl.glFogf(GL10.GL_FOG_MODE, GL10.GL_LINEAR);gl.glFogf(GL10.GL_FOG_START, 4.0f);gl.glFogf(GL10.GL_FOG_END, 10.0f);gl.glFogfv(GL10.GL_FOG_COLOR, new Color(0,0,0,0).toFloatBuffer());gl.glEnable(GL10.GL_FOG);</code></pre>","165106","","750613","","2012-06-28 10:29:03","2012-06-28 10:29:03","opengl es transparent fog in android","<android><opengl-es><colors><transparency>","1","0","","",""
"2890346","1","2890491","","2010-05-23 01:01:44","5","5025","<p>So i want to pass a LinkedHashMap to an intent.</p><pre><code>//SEND THE MAPIntent singlechannel = new Intent(getBaseContext(),singlechannel.class);singlechannel.putExtra(""db"",shows1);//perase tostartActivity(singlechannel);//GET THE MAPLinkedHashMap&lt;String,String&gt; db = new LinkedHashMap&lt;String,String&gt;();   db=(LinkedHashMap&lt;String,String&gt;) getIntent().getSerializableExtra(""db"");</code></pre><p>This one Worked Like a charm with HashMap.But with LinkedHashMap i got a problem i got a runtime error here</p><pre><code>  db=(LinkedHashMap&lt;String,String&gt;) getIntent().getSerializableExtra(""db"");</code></pre><p>I get no error with HashMap.</p><p>I also got a warning ""Type safety: Unchecked cast from Serializable to LinkedHashMap""But i had this warning with HashMap too.Any ideas.Any help is much appreciated</p><p>Also I just saw this.<a href=""https://issues.apache.org/jira/browse/HARMONY-6498"">https://issues.apache.org/jira/browse/HARMONY-6498</a> </p>","348058","","348058","","2010-05-23 02:50:05","2010-05-23 04:22:21","serialize/deserialize a LinkedHashMap (android) java","<java><android><serialization><linkedhashmap>","2","3","1","",""
"2890529","1","2891662","","2010-05-23 02:44:38","3","2851","<p>I've got a ListActivity and ListView and I've bound some data to it. The data shows up fine, and I've also registered a context menu for the view. When I display the list items as just a simple TextView, it works fine:</p><pre><code>&lt;TextView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/nametext""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;</code></pre><p>However when I try something a bit more complex, like show the name and a CheckBox, the menu never shows up:</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/nametext""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;    &lt;CheckBox        android:id=""@+id/namecheckbox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Can long-presses work on more complex elements? I'm building on 2.1.</p><p>(edit)</p><p>Registering with this on the ListActivity:</p><pre><code>registerForContextMenu(getListView());</code></pre><p>The code I posted is the item template for the list.</p>","92371","","92371","","2010-05-23 06:14:55","2013-01-23 13:52:12","Android: Context menu doesn't show up for ListView with members defined by LinearLayout?","<java><android><listview>","5","0","1","",""
"2890617","1","2891683","","2010-05-23 03:44:20","2","465","<p>I see some answers here prefer views over activities as contents of tabs. Correct me if I am wrong. My understanding is that by switching out views, it's possible to keep the navigation flow inside a tab (more user friendly, I think). But I wonder how to manage the view stack then in case of the back button events. Also this could cause one giant Activity with large amount of views, which might not be good. </p><p>So I wish to know why exactly views as contents is preferred before I change my current application to this. </p><p>Thanks, </p>","109704","","","","","2010-05-23 12:21:21","Android: stack management for views in a tab?","<android><android-tabhost>","1","0","","",""
"2890717","1","","","2010-05-23 05:06:32","2","480","<p>Has anyone seen that their applications built against Android 2.0 (<code>minSdkVersion=""5""</code>) are not showing up at all in the market for 2.2 devices? Does anyone know a workaround (aside from building for 2.2).</p><p>Thanks,Craig</p>","348136","","750613","","2012-06-28 10:27:19","2012-06-28 10:27:19","Android 2.0 App not available on 2.2 devices","<android><android-manifest><google-play>","3","3","3","",""
"2890985","1","","","2010-05-23 07:40:45","1","567","<p>I am writing an application where I have to parse multiple xml files as a response from a server. Till now, I have written different xml parser classes for each xml depepending on the tags present in different xmls ? Can I combine all xml parser classes and write a single xml parser that handles all different tags in different xmls ? Will it work ? Will combining xml parser classes add an overhead because xml parser will check for every tag irrespective of whether that is part of file or not ?</p><p>Please help.</p>","248132","","248132","","2010-05-23 07:55:47","2010-10-08 03:07:28","Parsing mutiple xml files in android","<xml><android><saxparser>","0","3","","",""
"2891157","1","2891735","","2010-05-23 09:06:25","6","1820","<p>You can move between fields with the track ball.As the title says I am looking forward to know how to I set the tabbing order of controls in Android?</p>","243782","","","","","2010-05-23 12:36:30","How do I set the tabbing order of controls in Android?","<android><tabbing>","1","0","","",""
"2891163","1","","","2010-05-23 09:10:48","2","948","<p>I'm trying to update body of all sms on Android device with </p><pre><code>getContentResolver().update(Uri.parse(""content://sms""), values.....</code></pre><p>query but after request done, also updates message creation/received time.</p><p>How i can update message but leave old message date?</p><p>I have tried send to update query</p><pre><code>ContentValues values = sms values oject;values.put(""body"", updatedBody);values.put(""date"", oldValues.getAsString(""date""));</code></pre><p>but it does not help.</p>","348192","","","","","2010-05-24 06:54:22","update SMS body, but not Date","<android><sms>","1","2","","",""
"2891186","1","2891780","","2010-05-23 09:19:44","2","159","<p>As you know we can get thast Last Known Location, but how do we get the time when that has changed?</p>","243782","","","","","2010-05-23 12:52:05","How do I get the time when the Location has been updated in Android?","<android><geolocation><android-sdk-2.1>","1","2","","",""
"2891282","1","","","2010-05-23 09:59:01","2","564","<p>Could you advise how to keep TabHost with all tabs at portrait screen orientation and at the same time listen for configChanges = orientation? I am going to show another activity when orientation is changed.</p><p>Seems to me configChanges (orientation) event does not fire when screenOrientation is set to portrait mode.</p><p>Thanks for any help.</p>","331565","","331565","","2010-05-23 10:04:59","2012-05-25 18:16:42","How to keep TabHost at portrait orientation and listen for configChanges (orientation)","<android><activity><orientation>","1","0","","",""
"2891312","1","3110118","","2010-05-23 10:13:09","3","9744","<p>Is the Froyo (Android 2.2) source code available? I've browsed the Android code repository using gitweb and haven't found an Android 2.2 tag or a froyo head.</p>","143378","","995926","","2012-05-05 13:29:17","2013-03-23 09:20:38","Froyo (Android 2.2) source code","<android><android-2.2-froyo>","1","1","0","",""
"2891337","1","10222999","","2010-05-23 10:21:45","9","9505","<p>I would like to unlock screen and switching it on to show a popup on an event trigger. I am able to unlock the screen using</p><p><code>newKeyguardLock = km.newKeyguardLock(HANDSFREE);newKeyguardLock.disableKeyguard();</code></p><p>on KeyGuardService but I cannot turn on the screen. I am using</p><p><code>wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, HANDSFREE); wl.acquire();</code></p><p>but with no success. The screen still remains off.How can I achieve this?Thanks in advance.</p><p>Tobia Loschiavo</p>","269585","","","","","2012-06-28 10:23:12","Turning on screen programmatically","<android><screen><locking>","3","0","1","",""
"2891389","1","","","2010-05-23 10:40:30","6","9777","<p>My app has been running okay until the recent Froyo update. After installing the Android 2.2 SDK, I can compile my code without any errors. However, when I run it, it just force closes:</p><p>Here's the log:</p><pre><code>05-23 10:15:13.463: DEBUG/AndroidRuntime(423): &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;05-23 10:15:13.463: DEBUG/AndroidRuntime(423): CheckJNI is ON05-23 10:15:14.193: DEBUG/AndroidRuntime(423): --- registering native functions ---05-23 10:15:15.293: DEBUG/AndroidRuntime(423): Shutting down VM05-23 10:15:15.303: DEBUG/dalvikvm(423): Debugger has detached; object registry had 1 entries05-23 10:15:15.333: INFO/AndroidRuntime(423): NOTE: attach of thread 'Binder Thread #3' failed05-23 10:15:16.003: DEBUG/AndroidRuntime(431): &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;05-23 10:15:16.013: DEBUG/AndroidRuntime(431): CheckJNI is ON05-23 10:15:16.273: DEBUG/AndroidRuntime(431): --- registering native functions ---05-23 10:15:17.392: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.handyapps.easymoney/.EasyMoney }05-23 10:15:17.602: DEBUG/AndroidRuntime(431): Shutting down VM05-23 10:15:17.662: DEBUG/dalvikvm(431): Debugger has detached; object registry had 1 entries05-23 10:15:17.742: INFO/AndroidRuntime(431): NOTE: attach of thread 'Binder Thread #3' failed05-23 10:15:17.912: INFO/ActivityManager(59): Start proc com.handyapps.easymoney for activity com.handyapps.easymoney/.EasyMoney: pid=438 uid=10035 gids={1006, 1015}05-23 10:15:19.032: DEBUG/AndroidRuntime(438): Shutting down VM05-23 10:15:19.032: WARN/dalvikvm(438): threadid=1: thread exiting with uncaught exception (group=0x4001d800)05-23 10:15:19.062: ERROR/AndroidRuntime(438): FATAL EXCEPTION: main05-23 10:15:19.062: ERROR/AndroidRuntime(438): java.lang.RuntimeException: Unable to instantiate application com.handyapps.easymoney.EasyMoney: java.lang.ClassCastException: com.handyapps.easymoney.EasyMoney05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread.access$3000(ActivityThread.java:125)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.os.Handler.dispatchMessage(Handler.java:99)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.os.Looper.loop(Looper.java:123)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread.main(ActivityThread.java:4627)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at java.lang.reflect.Method.invokeNative(Native Method)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at java.lang.reflect.Method.invoke(Method.java:521)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at dalvik.system.NativeStart.main(Native Method)05-23 10:15:19.062: ERROR/AndroidRuntime(438): Caused by: java.lang.ClassCastException: com.handyapps.easymoney.EasyMoney05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)05-23 10:15:19.062: ERROR/AndroidRuntime(438):     ... 11 more05-23 10:15:19.082: WARN/ActivityManager(59):   Force finishing activity com.handyapps.easymoney/.EasyMoney05-23 10:15:19.592: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{450018f0 com.handyapps.easymoney/.EasyMoney}</code></pre><p><strong>//////////////THE ANDROID MANIFEST FILE////</strong></p><p> </p><pre><code>&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;&lt;uses-permission android:name=""android.permission.CAMERA""/&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;uses-feature android:name=""android.hardware.camera"" /&gt;&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4"" /&gt;    &lt;application android:icon=""@drawable/icon""     android:name=""@string/app_name""  android:label=""@string/app_name""     android:debuggable=""false""&gt;    &lt;activity android:name="".EasyMoney""    android:label=""@string/app_name""     android:theme=""@android:style/Theme.NoTitleBar""     android:launchMode=""singleTask""     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="".TranList"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".TranEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".BillReminderEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".BillReminderList"" android:launchMode=""singleTop"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".BudgetList"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".BudgetEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".Search"" android:theme=""@style/CustomDialogTheme"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".PasscodeEntry"" android:theme=""@style/CustomDialogTheme"" android:windowSoftInputMode=""stateAlwaysHidden"" android:screenOrientation=""portrait""/&gt;    &lt;activity android:name="".AccountList"" android:theme=""@android:style/Theme.Light.NoTitleBar""&gt;    &lt;/activity&gt;    &lt;activity android:name="".AccountEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".UserSettingsEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".CurrencySettingsEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".DisplaySettingsEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".BackupSettingsEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".CategoryList"" android:theme=""@android:style/Theme.Light.NoTitleBar"" /&gt;    &lt;activity android:name="".CategoryEdit"" android:theme=""@android:style/Theme.Light.NoTitleBar"" android:windowSoftInputMode=""stateAlwaysHidden""/&gt;    &lt;activity android:name="".ExpenseByCategory"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".BalanceReport"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".MonthlyExpenseReport"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".MonthlyIncomeReport"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".MonthlyCashflowReport"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".PhotoList"" android:theme=""@android:style/Theme.Light.NoTitleBar"" /&gt;    &lt;activity android:name="".ExpenseByPayee"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;activity android:name="".ExpenseBySubCategory"" android:theme=""@android:style/Theme.Light.NoTitleBar""/&gt;    &lt;service android:name=""StartAlarm_Service""&gt;    &lt;intent-filter&gt;    &lt;action android:name=""com.handyapps.easymoney.StartAlarm_Service"" /&gt;    &lt;/intent-filter&gt;&lt;/service&gt;&lt;service android:name="".AlarmService_Service"" android:process="":remote"" /&gt;&lt;receiver android:name=""StartupIntentReceiver""&gt;&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;&lt;category android:name=""android.intent.category.HOME"" /&gt;&lt;/intent-filter&gt;&lt;/receiver&gt;&lt;receiver android:name="".WidgetProvider"" android:label=""@string/widget_name""&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/widget"" /&gt;    &lt;/receiver&gt;    &lt;receiver        android:name="".WidgetProvider"" android:label=""@string/widget_name""&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;                &lt;data android:scheme=""easymoney_widget"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data            android:name=""android.appwidget.provider""            android:resource=""@xml/widget"" /&gt;    &lt;/receiver&gt;    &lt;receiver android:name="".WidgetProvider""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.handyapps.easymoney.WIDGET_CONTROL"" /&gt;            &lt;data android:scheme=""easymoney_widget"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;</code></pre><p> </p><p>The main startup class is com.handyapps.easymoney.EasyMoney. I placed a breakpoint at the start of the onCreate() method but I discovered it didn't even reach there. Somehow, the application just couldn't be loaded in Android 2.2... but it works perfectly fine for all the previous Android versions. Been trying to find the cause for the past 2 days but am totally stumped!!</p>","348224","","750613","","2012-06-28 10:22:13","2012-06-28 10:22:13","App cannot start at all in Android 2.2 (Froyo)","<android><android-sdk-2.2><android-2.2-froyo>","2","2","1","",""
"2891488","1","2893943","","2010-05-23 11:20:22","0","135","<p>I have to manage XML documents and Strings in my app.</p><p>In terms of efficiency and memory usage, will a collection like <code>ArrayList</code> be much more expensive than <code>String[]</code>? Also, I could store the content as a regular String or XML. Is working with XML also more expensive? (When I say expensive, I am referring to the use of system resources.)</p><p>Those Strings will include xml's.. all i gonna do is pass them to another appz and those appz will deal with them.. nothing more..the ArrayList will hold dynamiclly around 20 Strings each.. and ill will need to 'for each' it, get the content of the string and send it to another app.</p><p>If there are differences, are they significant?</p><p>Thanks,Ray.</p>","260511","","260511","","2010-05-24 06:26:58","2010-05-24 06:26:58","Efficiency questions","<android>","1","2","","",""
"2891515","1","","","2010-05-23 11:29:41","1","1031","<p>How can I had to class layout in R another XML file?</p><p>It should be automatic as I had new resources to res, but it's not.Someone knows what I did wrong?</p><p>I open an activity and now I want to open another activity that will work with another XMLexample.I have menu and main.xml.Now I want to go for another activity called gamescreen using this method:</p><pre><code>newGameButton.setOnClickListener(new OnClickListener() {            public void onClick(View view) {                Intent i = = new Intent(this, gameScreen.class);                startActivity(i);            }}</code></pre><p>I want to move to another ""page"" to another activity called gameScreen which should be associated to the XML called gameScreen.xml.</p><p>But in its onCreate:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.gameScreen);</code></pre><p>}</p><p>and gameScreen is not a member of the R file.</p><p>The main problem is that when I add resource to layout for example newxmlfile.xmlthe R file doesn't do any work and stays in this state.</p><pre><code>public static final class layout {    public static final int main=0x7f030000;}where it should have been:public static final class layout {    public static final int main=0x7f030000;    public static final int newxmlfile=0x7f031000;}</code></pre>","346447","","63550","","2010-06-25 09:03:51","2010-09-05 11:47:21","Reference to XML file is not a member of the R file","<android><android-manifest>","5","2","","",""
"2891745","1","2891763","","2010-05-23 12:40:18","0","577","<p>I was wondering what the simplest program for sending an object from my Android phone to my computer wirelessly (via LAN) would be. I have created Java RMI programs with a server and multiple clients, so I have a grasp of the concept. However with android I'm just not sure where to start.</p><p>What I am aiming to do is send some sort of information (could simply be text) to my computer and my computer will do an action. I have the GUI interface's and the actions to be carried out all worked out, just the sending of some sort of information is getting me.</p><p>Could anyone help me out?</p>","348261","","14343","","2010-07-14 23:45:48","2010-07-14 23:45:48","Sending a Java object from my Android phone to my Computer","<android><wireless><lan>","1","0","","",""
"2891748","1","","","2010-05-23 12:41:26","3","5960","<p>What should I do to use custom checkboxes if I add my checkboxes dynamically in my code? (On the java code not on the XML files.) I'm following <a href=""http://www.anddev.org/novice-tutorials-f8/tutorial-change-look-of-checkbox-t4553.html"" rel=""nofollow"">this tutorial</a>, but using it I can't achieve my goal.</p><p>For example, I have a <code>tableLayout</code> and I want to add a checkbox for each new row I have.</p><p>Thank you all.</p>","341150","","41981","","2010-05-23 13:04:08","2013-07-29 14:23:32","Android: Dynamically add custom checkboxes to a tableLayout","<android><layout><checkbox>","2","0","","",""
"2892160","1","3105561","","2010-05-23 14:45:50","4","1892","<p>I have been trying to turn off the backlight of the buttons in my application using the UiModeManager's nightmode function. The default Desk Clock application (Nexus One) turns off the backlight when it is dimmed, and I want to do this as well.</p><p>I've tried using the following code:</p><blockquote>  <p>UiModeManager mgr = (UiModeManager)  getSystemService(UI_MODE_SERVICE);  mgr.setNightMode(UiModeManager.MODE_NIGHT_YES);</p></blockquote><p>The UiModeManager.setNightMode(int mode) documentation says this:</p><blockquote>  <p>Sets the night mode. Changes to the  night mode are only effective when the  car or desk mode is enabled on a  device.</p></blockquote><p>Does that mean that the device has to be physically in a desk dock? I can set the device to car mode using the UiModeManager.enableCarMode(int flags) method. This works fine, but it doesn't turn off the lights, it only dims the screen's backlight.</p><p>Is there a way to set the device into desk mode without using a physical desk dock? As the FroYo source code is not yet released, I cannot look at the build-in Desk Clock application.</p><p>Thanks in advantage.</p>","236130","","995926","","2012-05-05 13:30:47","2012-05-05 13:30:47","UiModeManager - NightMode (Froyo)","<android><android-2.2-froyo>","1","1","3","",""
"2892176","1","2892282","","2010-05-23 14:50:16","2","2412","<p>I've run into an early problem with developing for android. I've made my own custom View (which works well). In the beginning i just added it to the layout programmatically, but i figured i could try putting it into the XML layout instead (for consistency).</p><p>So what i got is this:</p><p>main.xml:</p><pre><code>[...]&lt;sailmeter.gui.CompassViewandroid:id=""@+id/compassview1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@id/widget55""android:background=""@color/white""/&gt;[...]</code></pre><p>CompassView.java:</p><pre><code>public class CompassView extends View { protected void onDraw(Canvas canvas) { [...] }public void setBearing(float bearing) { [...] }}</code></pre><p>SailMeter.java (activity class):</p><pre><code>public class SailMeter extends Activity implements PropertyChangeListener {public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);compassview = (CompassView) findViewById(R.id.compassview1); //Line 51 in SailmMeter.java[...]}}</code></pre><p>(Theres obviously more, but you get the point)</p><p>Now, this is the stacktrace:</p><pre><code>05-23 16:32:01.991: ERROR/AndroidRuntime(10742): Uncaught handler: thread main exiting due to uncaught exception  05-23 16:32:02.051: ERROR/AndroidRuntime(10742): java.lang.RuntimeException: Unable to start activity ComponentInfo{sailmeter.gui/sailmeter.gui.SailMeter}:   java.lang.ClassCastException: android.view.View05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.os.Handler.dispatchMessage(Handler.java:99)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.os.Looper.loop(Looper.java:123)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread.main(ActivityThread.java:4595)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at java.lang.reflect.Method.invokeNative(Native Method)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at java.lang.reflect.Method.invoke(Method.java:521)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at dalvik.system.NativeStart.main(Native Method)05-23 16:32:02.051: ERROR/AndroidRuntime(10742): Caused by: java.lang.ClassCastException: android.view.View05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at sailmeter.gui.SailMeter.onCreate(SailMeter.java:51)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)05-23 16:32:02.051: ERROR/AndroidRuntime(10742):     ... 11 more</code></pre><p>Why cant i cast my custom view? I need it to be that type since it has a few extra methods in it that i want to access. Should i restructure it and have another class handle the logic, and then just having the view being a view? I'd really like this to work though.</p><p>Thanks for any help.</p>","348307","","348307","","2010-05-23 14:55:47","2014-03-27 07:45:13","ClassCastException when casting custom View subclass","<android>","3","1","","",""
"2892291","1","2898980","","2010-05-23 15:20:24","1","1970","<p>I have a very simple GLRenderer subclass that draws a bunch of polygons on the screen. On my Nexus One with 2.1 installed, I see exactly what I expect. On my G1 with 1.6 installed, I only get the glClearColor displayed. I can alter the color, and see that my onDrawFrame function is at least partially functioning.</p><p>I can't fathom a good explanation, so I'm pasting my onDrawFrame code:</p><pre><code>public void onDrawFrame(GL10 gl) {    gl.glClearColor(1.0f, 1.00f, 1.0f, 1.0f);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    gl.glScalef(zoomLevel, zoomLevel, 1.0f);    gl.glTranslatef(offsetX, offsetY, -1);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, boothVerticies);    int i = 0;    for (Polygon b : allPolygons) {        if (b.indicies != null) {            gl.glColor4f(0.6f, 0.6f, 0.6f, 1.0f);            gl.glDrawElements(GL10.GL_TRIANGLE_FAN, b.numberOfVerticies, GL10.GL_UNSIGNED_SHORT, b.indicies);            gl.glColor4f(0.0f, 0.0f, 0.0f, 1.0f);            gl.glDrawElements(GL10.GL_LINE_LOOP, b.numberOfVerticies, GL10.GL_UNSIGNED_SHORT, b.indicies);            if (i++ &gt; 20) break;        }    }}</code></pre><p>My Polygon structure has a ShortBuffer called indicies, and numberOfVerticies tracks the number of points in the polygon.</p><p>Does anyone have any ideas why this might work well on my Nexus One, but not on the G1?</p>","457","","","","","2010-05-24 17:40:49","Android OpenGL glDrawElements works on 2.1, but not 1.6","<android><opengl-es><glsurfaceview>","1","0","1","",""
"2892318","1","","","2010-05-23 15:26:15","0","417","<p>I'm looking for a way to add a new custom menu item to the SMS interface. The idea is add an option like ""<strong>Insert predefined message</strong>"", and control the predefined message from other application.</p><p>Is this possible?</p>","348330","","750613","","2012-06-28 10:19:33","2012-06-28 10:19:33","Add menu option to SMS interface","<android><sms>","1","0","","",""
"2892392","1","2892422","","2010-05-23 15:48:16","0","973","<p>I start the Method Profiler for a process, then leave it run for about 5-10 secs, then I stop it. I see a progress that a file is pulled from the sdcard, than I get this Exception</p><p>The trance file is 8.2MB</p><pre><code>[2010-05-23 18:45:42] Traceview: Exception in thread ""main"" java.lang.OutOfMemoryError: Java heap space[2010-05-23 18:45:42] Traceview:    at java.util.Arrays.copyOf(Unknown Source)[2010-05-23 18:45:42] Traceview:    at java.util.Arrays.copyOf(Unknown Source)[2010-05-23 18:45:42] Traceview:    at java.util.ArrayList.toArray(Unknown Source)[2010-05-23 18:45:42] Traceview:    at java.util.Collections.sort(Unknown Source)[2010-05-23 18:45:42] Traceview:    at com.android.traceview.TimeLineView.setData(TimeLineView.java:370)[2010-05-23 18:45:42] Traceview:    at com.android.traceview.TimeLineView.&lt;init&gt;(TimeLineView.java:316)[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.createContents(MainWindow.java:95)[2010-05-23 18:45:42] Traceview:    at org.eclipse.jface.window.Window.create(Window.java:431)[2010-05-23 18:45:42] Traceview:    at org.eclipse.jface.window.Window.open(Window.java:790)[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.run(MainWindow.java:60)[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.main(MainWindow.java:224)</code></pre><p>What I am doing wrong?</p>","243782","","","","","2010-05-23 15:57:08","Explain to me how the Method Profiler works in the DDMS, I get heap space error","<android>","1","0","","",""
"2892615","1","6095753","","2010-05-23 16:58:58","35","18351","<p>I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying</p><p>How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised?</p>","243782","","243782","","2010-05-28 08:47:22","2013-01-11 16:38:16","How to remove auto focus/keyboard popup of a field when the screen shows up?","<android>","5","0","5","",""
"2892709","1","2892841","","2010-05-23 17:32:19","1","938","<p>I am writing an Android app, part of which will be a survey involving multiple pages of checkbox question and answers. I have created an activity to display the question and options (from the DB) and what I want to do now is when i press the ""Next"" button it should just reload the current activity with the next question set from the database.</p><p>(the activity starts with <code>survey.getNextQuestion()</code> - so its just a case of refreshing the activity so it updates)</p><p>Im sure this is a simple thing to do -any ideas?</p><p>Thanks</p>","258813","","750613","","2012-06-28 10:18:53","2012-06-28 10:18:53","Re-load Android activity data","<java><android><activity>","2","0","","",""
"2892851","1","","","2010-05-23 18:10:35","2","276","<p>I've used the code from the PDF rendering question </p><p><a href=""http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android"">http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android</a></p><p>And it works! Props to the answerer, but my question is about doing that same thing but also sending a keyword to search in the pdf. I have no idea how to do this, should I set a flag? Any help would be greatly appreciated.</p>","348410","","","","","2010-05-23 19:47:31","How to search a pdf after opening it from a new intent?","<android>","1","0","","",""
"2892875","1","","","2010-05-23 18:17:20","0","334","<p>what i'm trying to achieve is #1 but what i get is #2</p><p><a href=""http://s48.radikal.ru/i120/1005/ff/6e439e04bbc8.jpg"" rel=""nofollow"">http://s48.radikal.ru/i120/1005/ff/6e439e04bbc8.jpg</a></p><p>it seems linear layout stacks with height of it's first element and shrinks second's element height to that.</p><p>the xml for those is the following:<code><pre>&lt;?xml version=""1.0"" encoding=""utf-8""?>&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:background=""#FFFFEE""> &lt;ImageView   android:id=""@+id/thumb""  android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:src=""@drawable/example""     android:layout_weight=""5"" /> &lt;TextView  android:id=""@+id/text""   android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""2""     android:text=""Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa. Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa. Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa. Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa. Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa. Aaa aaaaa aaa aaaaa, aaaaaaa aaa aaa a, aaa aa aaaaaaa aaa aa."" />&lt;/LinearLayout></code></pre></p>","348417","","348417","","2010-05-26 16:59:52","2010-05-26 16:59:52","android linear layout solution","<java><android><layout>","1","1","","",""
"2892913","1","2892922","","2010-05-23 18:30:22","5","891","<p>I've noticed that changing the background color of an android widget (<strong>ex. Button or TextView</strong>) by program:</p><pre><code>myButton.setBackgroundColor(Color.BLUE);</code></pre><p>makes it to loose its 3D shape, border, and shadows effects, and then appears like a ugly flat square. What am I missing?</p><p>Sorry for the very naive question but I couldn't get it right although tried for a time.</p>","286335","","750613","","2012-06-28 10:17:01","2012-06-28 10:17:01","Does changing background color in android destroy the widget's appearance?","<android><widget><background-color>","2","0","1","",""
"2893230","1","","","2010-05-23 20:05:20","0","183","<p>I want to create an activity, which shows a question with 4 answers, and at the bottom of the screen i want to place a timer.</p><p>I have already found timer example, and i created a question with the answers. the problem that they are 2 different projects and activities, and i am looking for the best way to implement it. i think i can't show 2 activities on one screen, but i can show 2 views or shell i use the ViewGroup, or maybe to copy-paste one of the activities code to another ( its the easiest way but probably the most ugliest way to implement it).please tell me what is the best way, that i will study and not to waste time to study all the ways and only then to choose one of them.</p>","348461","","331473","","2011-11-24 13:41:05","2011-11-24 13:41:05","android: how to create multiply views screen?","<android>","1","0","","",""
"2893273","1","2893360","","2010-05-23 20:15:38","13","3831","<p>I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks.</p><p>This obviously depends on both the machine running the emulator, and the specific device in question, but I'm talking rough numbers here.</p><p>This question is a <a href=""http://stackoverflow.com/questions/103366/how-well-does-the-android-phone-emulator-reflect-the-performance"">duplicate</a>, but since that post is heavily outdated, I figured it's irrelevant by now.</p>","311953","","","","","2010-09-01 05:26:56","How does Android emulator performance compare to real device performance?","<android><performance><android-emulator>","3","0","6","",""
"2893350","1","2921657","","2010-05-23 20:36:15","54","17001","<p>I have just written a game for the <a href=""http://en.wikipedia.org/wiki/Google_Play"" rel=""nofollow"">Google Play</a> and would like to remind my customers to leave feeback on the market for the application (especially the demo version). Is there any way to launch the market intent in a mode that will take the user to the feedback / comments section of the page?</p><p>I already use this approach for linking my demo to the paid application... </p><pre><code>Intent goToMarket = null;goToMarket = new Intent(                   Intent.ACTION_VIEW,                   Uri.parse(""market://details?id=com.paulmaidment.games.flagsoftheworld""));startActivity(goToMarket);</code></pre><p>Is there a best practice?</p><p>Additionally, is there any way to track referalls from my demo application so that I can try to calculate some kind of a conversion rate? (that is, how effective the demo application is at generating sales.)</p>","159882","","2581872","","2014-01-12 20:50:35","2014-01-12 20:50:35","How to launch the Google Play intent in 'Give Feedback' mode on Android?","<android><android-intent><google-play>","3","0","24","",""
"2893364","1","","","2010-05-23 20:40:06","9","10676","<p>How can i parse a local XML file in the assets folder using pull parser? I can't get pull parser to work. It always throws an io exception. I think I can't get the path to the file, or connecting to the file.</p>","209784","","14419","","2011-10-15 00:41:11","2011-10-15 00:41:11","xml pull parser assets xml","<xml><android><ioexception><xmlpullparser>","1","1","5","",""
"2893423","1","","","2010-05-23 21:00:28","0","1212","<p>Is there a way to simulate speed on Android emulator? </p><p><strong>[edit]</strong>The purpose of this to test the getSpeed() method</p><p><strong>Example:</strong> I would like to set the device is going at 20 miles an hour.</p>","331916","","750613","","2012-06-28 10:16:09","2012-06-28 10:16:09","How to simulate speed on Android emulator?","<android><android-emulator>","2","2","","",""
"2893613","1","","","2010-05-23 21:48:32","0","910","<p>I am new to Android development.</p><p>I have developed a very simple widget that was meant to interact with the user via an ImageButton.</p><p>What I am trying to do now is as follows. When a user taps the button (after adding the widget to their home screen), I want the phone to dial a certain telephone number.A sort of speed dial for your home screen.</p><p>Unfortunately when I tap the button nothing happens.</p><p>This is the body of my SpeedDialAppWidgetProvider.onUpdate method:</p><pre><code> Log.d("""", ""beginning of onUpdate""); final int N = appWidgetIds.length;    for (int i=0; i&lt;N; i++) {        int appWidgetId = appWidgetIds[i];       Log.d("""", ""dealing with appWidgetId: "" + appWidgetId);        // Create an Intent to launch ExampleActivity        Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse(""tel:1234567""));        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, dialIntent, 0);        Log.d("""", ""pendingIntent classname "" + pendingIntent.getClass().getName());        // Get the layout for the App Widget and attach an on-click listener to the button        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.speed_dial_appwidget);        remoteViews.setOnClickPendingIntent(R.id.dial_icon, pendingIntent);        Log.d("""", ""remoteViews classname "" + remoteViews.getClass().getName());        // Tell the AppWidgetManager to perform an update on the current App Widget        appWidgetManager.updateAppWidget(appWidgetId, remoteViews);           Log.d("""", ""end of onUpdate"");</code></pre><p>I can see the method is called and the result of the logging makes sense.</p><p>The speed_dial_appwidget.xml file is 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""androidrientation=""vertical""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;ImageButton id=""@+id/dial_icon""android:src=""@drawable/speed_dial""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt; &lt;/LinearLayout&gt;</code></pre><p>Can you please help me with this?</p><p>Thanks in advance,Dan</p><hr><p>Thanks for your answer.</p><p>Your point was valid. I then added this to my manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;</code></pre><p>But that didn't help.</p><p>The only errors I get are:</p><pre><code>05-23 18:41:08.932: ERROR/ActivityThread(655): Failed to find provider info for android.server.checkin05-23 18:41:11.761: ERROR/ActivityThread(655): Failed to find provider info for android.server.checkin05-23 18:41:14.372: ERROR/ActivityThread(655): Failed to find provider info for android.server.checkin05-23 18:41:14.781: ERROR/ActivityThread(655): Failed to find provider info for android.server.checkin05-23 18:41:43.892: ERROR/ActivityThread(676): Performing pause of activity that is not resumed: {com.android.launcher/com.android.launcher.Launcher}05-23 18:41:43.892: ERROR/ActivityThread(676): java.lang.RuntimeException: Performing pause of activity that is not resumed: {com.android.launcher/com.android.launcher.Launcher}05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2809)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2797)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2780)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread.access$2000(ActivityThread.java:112)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.os.Handler.dispatchMessage(Handler.java:99)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.os.Looper.loop(Looper.java:123)05-23 18:41:43.892: ERROR/ActivityThread(676):     at android.app.ActivityThread.main(ActivityThread.java:3948)05-23 18:41:43.892: ERROR/ActivityThread(676):     at java.lang.reflect.Method.invokeNative(Native Method)05-23 18:41:43.892: ERROR/ActivityThread(676):     at java.lang.reflect.Method.invoke(Method.java:521)05-23 18:41:43.892: ERROR/ActivityThread(676):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)05-23 18:41:43.892: ERROR/ActivityThread(676):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)05-23 18:41:43.892: ERROR/ActivityThread(676):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>The strange thing is: even before adding the uses-permission tag, I didn't see any error message about not having enough permission.</p><p>I don't understand.</p>","348510","","419","","2011-09-26 21:59:28","2011-09-26 21:59:28","Android - I can't make a widget clickable to launch an intent","<android>","1","1","","",""
"2893815","1","2893868","","2010-05-23 22:47:34","12","6677","<p>I am using Android emulator with AVD of Android 2.1 and I have the following problem: Trying to load a URL in a WebView using <strong>webView.loadUrl</strong> causes it to open in the browser instead. </p><p>Note: I am talking about the initial opening, <strong>not</strong> the issue in which links from the WebView open in a browser, though, perhaps it is somehow connected.</p><p>I've tried several things:</p><ul><li>I've removed <strong><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></strong> from the manifest. That actually made it work correctly, i.e, load the html into the webview. However, as one would expect, the only thing it loaded is ""unable to connect the internet"" error page.</li><li>I've debugged the project to make sure and indeed at <strong>loadUrl</strong> function, it opens Android browser. The CatLog at this point is as such:</li></ul><blockquote>  <p>05-23 22:54:06.858:  INFO/ActivityManager(51): Starting  activity: Intent {  act=android.intent.action.VIEW  cat=[android.intent.category.BROWSABLE]  dat=http://m.walla.co.il/ErrorPage.aspx?ReturnUrl=/Default.aspx  cmp=com.android.browser/.BrowserActivity  }</p></blockquote><ul><li>I've tried downloading a real <a href=""http://media.pragprog.com/titles/eband2/code/eband2-code.zip"">sample</a> project (""Hello Android"" book source files, project - BrowserView). However, it didn't work just the same.</li><li>I've created a new project and followed the directions at Google's <a href=""http://developer.android.com/guide/tutorials/views/hello-webview.html"">official tutorial</a> of using WebView and got the same result.</li></ul><p>I haven't find anyone else complaining about it. Why does it happen? </p><p>Thanks,Vitaly</p>","126574","","126574","","2010-05-23 22:56:17","2013-06-17 08:04:37","""Hello, WebView"" tutorial opens the requested address in Android browser and not in my webview","<android><android-emulator><webview>","1","0","2","",""
"2893847","1","2893895","","2010-05-23 22:59:15","7","4640","<p>I'm embarking on a GUI Activity composed of a viewflipper, which I would like to contain 10 linearlayout layouts. </p><p>Is it advisable to put all of my layouts into the same XML resource/layout file?</p><p>If not, is there a more organized approach to coding a viewflipper with many layouts? </p><p>Will having everything in the same file come at a significant performance cost?</p>","268803","","","","","2010-10-12 11:18:59","Best practice for viewflipper containing 10 linearlayouts?","<android><layout><activity><viewflipper>","1","0","7","",""
"2893851","1","3304163","","2010-05-23 23:00:54","10","11859","<p>I made a small webpage with a scrollable div. When I load it in a browser, it works fine. But when I load it in a webview inside Android, it doesn't let me scroll the div. Is there a workaround for this or do I have to use a different design? I am talking about websites like <a href=""http://www.domedia.org/oveklykken/css-div-scroll.php"">this</a>.</p>","184046","","184046","","2010-05-23 23:06:19","2012-10-26 05:04:55","Android::Webview removes scrollbar for a DIV","<css><android><webkit>","2","0","2","",""
"2894021","1","","","2010-05-23 23:53:02","1","710","<p>Essentially, I just want to change the home button from just hiding my app to killing the activity that is on the screen. </p><p>I thought about writing a broadcast receiver that kills the activity, but I'm not sure how to kill the activity from the receiver. </p><p>How do I change the functionality of the home button to ""finish"" the specific activity? </p><p>Thanks</p>","358894","","","","","2010-08-30 11:54:26","How do I overwrite the functionality of the home button?","<android><broadcastreceiver>","2","2","","",""
"2894367","1","2896309","","2010-05-24 01:50:31","0","663","<p>I have a simple custom adapter.  I need to set the  starting position to different positions at different times.  When using a standard listadapter, I can simply use myCursor.moveToPosition( i ).  A custom adapter using getview does not work that way.  Can anyone tell me how to move the current list to the position I want?</p>","158757","","","","","2010-05-24 10:42:28","Android how can you implement moveToPosition with a Custom Adapter","<android><adapter>","1","1","","",""
"2894628","1","","","2010-05-24 03:45:19","2","822","<p>Im trying to force my phone to go to sleep as soon as i turn my screen off, but whenever i install with adb, packagemanager informs me that it wont grant the permission i need, so my service throws an exception.  I was able to install another app called power save mode toggle which has the same permission, and it seems to work, so i should be able to get this to work, right?</p>","348634","","","","","2011-08-16 20:23:44","PackageManager: Not granting permission","<android><permissions>","1","2","","",""
"2894633","1","2894915","","2010-05-24 03:46:27","0","810","<p>I am a newbie to Android and Java and want to write a function that will display a list based on a variable that I pass to the function. </p><p>The function is below and the code below creates an array out of a string called type, but what I want to do is pass it a variable string and have it build a list based on that string. </p><p>So if I wanted the type list I would say <code>list_it(""type"")</code></p><p>But if I try something like <code>getResources().getStringArray(R.array.thelist);</code> it doesn't work.</p><p>Can someone point me in the right direction?</p><pre><code>public void list_it(String thelist){    String[] types = getResources().getStringArray(R.array.type);      ArrayAdapter&lt;String&gt; mAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item1, types);      setListAdapter(mAdapter);      ListView lv = getListView();      lv.setTextFilterEnabled(true);}</code></pre>","282475","","759866","","2014-02-07 07:48:05","2014-02-07 07:48:05","Passing variable string to create arrays (Android)","<java><android>","1","0","","",""
"2894651","1","2895985","","2010-05-24 03:51:14","3","735","<p>I have a ViewFlipper which contains a few linear layouts. </p><p>I need to allow the user to flip through them. </p><p>I've seen other apps which have arrow/triangle indicators on either side of the screen, which, when pressed, flips to the next view in the set. </p><p>I'd like to add these to my Activity. </p>","268803","","","","","2010-05-24 09:37:52","How to get right/left arrows on Activity to indicate more screens to the right/left?","<android><scrolling><activity><viewflipper>","1","0","1","",""
"2894743","1","","","2010-05-24 04:34:48","3","676","<p>My problem is our game can switch into menu and setting mode instantly but it will need 4-6 seconds to load texture, init GL render mode eventually I just used 6 simple textures to create 6 sprites in game.</p><p>Please help me answer two questions:1. How can I preload our assets in android os to start our game quicker?2. In order to use a trick to create instance switch between activity, how can I retain my activity with GLSurfaceView state? </p><p>I order to help you understanding my situation, please read the following code:</p><p>The game using 3 activities as you can see in following configuration:</p><pre><code> &lt;application android:label=""@string/app_name""  android:icon=""@drawable/icon"" android:allowBackup=""true""&gt;  &lt;activity android:name="".Menu"" android:screenOrientation=""portrait""   android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""  android:launchMode=""singleTop""&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="".ReTouch"" android:screenOrientation=""portrait"" /&gt;  &lt;activity android:name="".Preference"" android:screenOrientation=""portrait"" android:theme=""@android:style/Theme.NoTitleBar.Fullscreen"" /&gt; &lt;/application&gt;</code></pre><p>My .ReTouch class is a class that extended from RokonActivity (I am using rokon engine for my game), this engine will create a GLSurefaceView to render my game in OpenGL ES You can get RokonAcitivity's source code here: <a href=""http://code.google.com/p/rokon/source/browse/tags/release/1.1.1/src/com/stickycoding/Rokon/RokonActivity.java"" rel=""nofollow"">http://code.google.com/p/rokon/source/browse/tags/release/1.1.1/src/com/stickycoding/Rokon/RokonActivity.java</a></p><pre><code> public class ReTouch extends RokonActivity { public static final int REPLAY_DELAY_INTERVAL = 1000; private ReTouchGameBoard reTouchGame;</code></pre><p>and .Menu, .Preference are two normal standard activity in an android application.</p><p>I am using this method to start and switch between activities:</p><pre><code>  playButton.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    soundPool.play(soundId, 1, 1, 1, 0, 1);    startActivity(new Intent(Menu.this, ReTouch.class));   }  });  settingButton.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    soundPool.play(soundId, 1, 1, 1, 0, 1);    startActivity(new Intent(Menu.this, Preference.class));   }  });  quitButton.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    soundPool.play(soundId, 1, 1, 1, 0, 1);    finish();   }  });</code></pre>","348639","","","","","2011-11-22 19:03:27","How to retain the state of a activity that has a GLSurfaceView","<android><glsurfaceview>","1","0","1","",""
"2894763","1","3030026","","2010-05-24 04:42:18","5","835","<p>I have put some instructions in onLowMemory() callback and want to test the same. Is there a ""direct"" way to test onLowMemory function of the application subclass?</p><p>Or will I have to just overload the phone by starting many apps and doing memory intensive tasks?</p><p>Thanks.</p>","236128","","236128","","2010-05-24 11:24:51","2010-06-12 20:44:19","How to emulate onLowMemory()?","<android><unit-testing>","1","0","3","",""
"2894934","1","2895779","","2010-05-24 05:31:34","4","1222","<p>I have an application which is of size 130MB. when i try to install its displaying insufficient memory error. but i have around 170MB left in available space in internal memory. How can i Install this app? The size of the app is large because it contains many media files. In Motorolla droid its getting installed. but on Nexus One its giving this error.</p>","348686","","","","","2010-05-24 08:48:14","Installing a large size apk application on Android phone","<android>","1","1","3","",""
"2895065","1","3897597","","2010-05-24 06:05:38","90","21682","<p>The declaration of <code>android.graphics.Bitmap.createScaledBitmap</code> is</p><pre><code>public static Bitmap createScaledBitmap  (Bitmap src, int dstWidth, int dstHeight, boolean filter)</code></pre><p>However, the documentation doesn't explain any of the parameters.  All of them are pretty obvious except for <code>boolean filter</code>.  Does anyone know what it does?</p>","8453","","","","","2011-09-12 18:07:33","What does the filter parameter to createScaledBitmap do?","<android><scaling>","3","0","11","",""
"2895367","1","","","2010-05-24 07:16:23","8","52841","<p>I have a simple Android application, with 3 buttons. When i click on the 1st button, i wanna change the background color of the layout (which is now white... i wanna change in other color, when i press the button). How can i do this?</p><p>On that button, i have a myClickHndler event</p><pre><code>    public void myClickHandler(View view) {    switch (view.getId()) {    case R.id.Button01:        text.setText(""Button 1 was clicked"");        break;    case R.id.Button03:        //text.setText(""Button 3 was clicked"");                    .................... // ?        break;    }}</code></pre><p>Thanks!</p>","300590","","236128","","2010-05-24 08:19:26","2014-02-03 06:36:32","change background color of the layout in Android","<android>","4","1","6","",""
"2895371","1","","","2010-05-24 07:17:43","3","3384","<p>I have some piece of code which uses JNI. I can debug code wrote in Java directly in Eclipse (using ADT). I even have a script, which help me debug native code with gdb. However this is not very comfortable way for doing this.</p><p>Is it possible to configure Eclipse to use gdb (I guess gdbserver) for debbuging android native applications? Do you know where I could find any description of this?</p>","338581","","338581","","2010-05-24 07:29:19","2011-03-18 12:18:28","debugging native code (C++) using gdb on android with Eclipse. Is it possible?","<android><debugging><gdb><jni><gdbserver>","1","0","1","",""
"2895385","1","","","2010-05-24 07:21:19","2","981","<p>In Android, how do I close <code>TabWidget</code> when a tab is selected?</p><p>I want close the <code>TabWidget</code> where some tab is selected.</p>","345691","","447156","","2011-11-14 07:49:22","2011-11-14 07:49:22","How to close TabWidget when a tab is selected in Android","<android><tabs>","1","0","","",""
"2895414","1","2896156","","2010-05-24 07:25:23","0","775","<p>I am using following code in preferences page in android to show a list of items. The list and values are located in a file at location ""app/res/xml/time.xml""</p><pre><code> &lt;ListPreference           android:title=""Time unit list""           android:summary=""Select the time unit""           android:dependency=""Main_Option""           android:key=""listPref""           android:defaultValue=""1""           android:entries=""?xml:time/timet""           android:entryValues=""@xml:time/timet_values"" /&gt;</code></pre><p>The code for the time.xml is as follow:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string-array name=""timet""&gt;        &lt;item&gt;seconds&lt;/item&gt;        &lt;item&gt;minutes&lt;/item&gt;        &lt;item&gt;hours&lt;/item&gt;    &lt;/string-array&gt;    &lt;string-array name=""timet_values""&gt;        &lt;item&gt;3600&lt;/item&gt;        &lt;item&gt;60&lt;/item&gt;        &lt;item&gt;1&lt;/item&gt;    &lt;/string-array&gt;&lt;/resources&gt;</code></pre><p>I am not able to reference these values in my preference xml file. (The code snippet above).  It gives an error. How can I specify packaged path for the List preferences entry and entry_values</p><p>Any help is appreciated.Cheers</p>","57847","","1064959","","2011-12-08 02:52:55","2011-12-08 02:52:55","Specifiy package path for Android:entries","<xml><android><preferences>","1","0","","",""
"2895531","1","2895588","","2010-05-24 07:53:05","0","2560","<p>I'd like to install my app on Motorola Android as a testing. how to? Please share me any step by step link</p>","305732","","","","","2010-05-24 08:04:55","how to install my app on Motorola Android","<android><install><motorola>","1","0","","",""
"2895640","1","2895679","","2010-05-24 08:13:52","2","1117","<p>Hi I am new to android. I need to list available files in device or SDCard in the android emulator 1.5.Thanks in advance.</p>","324223","","","","","2012-10-01 20:19:36","file explorer in android","<android>","4","0","","2012-10-01 22:20:28",""
"2895853","1","2896105","","2010-05-24 09:06:09","7","6933","<p>Using the <a href=""http://developer.android.com/guide/topics/data/data-storage.html"">data-storage page in the docs</a>, I've tried to store some data to the SD-Card.This is my code:</p><pre><code>    // Path to write files to    String path = Environment.getExternalStorageDirectory().getAbsolutePath() +                  ""/Android/data/""+ctxt.getString(R.string.package_name)+""/files/"";    String fname = ""mytest.txt"";    // Current state of the external media    String extState = Environment.getExternalStorageState();    // External media can be written onto    if (extState.equals(Environment.MEDIA_MOUNTED))    {        try {            // Make sure the path exists            boolean exists = (new File(path)).exists();              if (!exists){ new File(path).mkdirs(); }              // Open output stream            FileOutputStream fOut = new FileOutputStream(path + fname);            fOut.write(""Test"".getBytes());            // Close output stream            fOut.flush();            fOut.close();        } catch (IOException ioe) {            ioe.printStackTrace();        }</code></pre><p>When I create the new FileOutputStream I get a FileNotFound exception. I have also noticed that ""mkdirs()"" does not seem to create the directory.</p><p>Can anyone tell me what I'm doing wrong?</p><p>I'm testing on an AVD with a 2GB sd card and ""hw.sdCard: yes"", the File Explorer of DDMS in Eclipse tells me that the only directory on the sdcard is ""LOST.DIR"".</p>","339177","","79125","","2011-02-21 23:27:29","2012-06-26 08:49:39","Storing data on SD Card in Android","<android><sd-card>","2","0","3","",""
"2895925","1","2896229","","2010-05-24 09:24:56","1","4034","<p>I have a TabHost with 4-5 tabs. I want to have a similar bottom for all the tabs. Is there any way we can add a bottom to all the tabs? Or do I need to place the xml code in every layout file. </p><p>Please let me know if any one has the solution.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-05-24 10:27:52","Common bottom layout in all the tabs of TabHost in Android?","<android><common><android-tabhost>","1","0","1","",""
"2896037","1","","","2010-05-24 09:47:25","2","217","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3579693/android-tutorials"">android tutorials</a>  </p></blockquote><p>Well,Hello Everyone.I'am just 14 years old.I want to be a part of Android's Development.But were do I start.What should I learn? What are necessary Qualification to be a Part of Android's Development.</p><p>Things what I know</p><p>Basic PHP,HTML,PhotoShop,Video Editing,Basic Security and Fraud related matters,Some Microsoft Office Tools,Maya(Modelling only),Web Development,Dreamweaver,Blogging andPawno (For Game Scripts..C Based Language)</p><p>I hope that's all.I do things (for programming)without knowing about the basics it has.I feel difficult to understand the guides in android.com .I want a Step by Step guide.</p><p>Thank you,Lavan</p>","348812","","","","","2010-05-24 10:21:59","New to Android I want to know more about it","<android>","2","1","","2011-12-18 07:07:40",""
"2896080","1","2896595","","2010-05-24 09:56:27","1","2939","<p>I am trying to call a push notification background service from BroadcastReceiver class, but my application crashes.  The code is given below:</p><pre><code>public class AlarmReceiver extends BroadcastReceiver {    static int count=1;    @Override    public void onReceive(Context context, Intent intent) {        Intent myIntent=new Intent(context,NotifyService.class);        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(myIntent);      }} </code></pre><p>The manifest entry: </p><pre><code>&lt;receiver android:name="".AlarmReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.BOOT_COMPLETED""/&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;&lt;service android:name="".NotifyService""&gt;&lt;/service&gt;</code></pre><p>The error:</p><pre><code>05-24 15:17:00.042: ERROR/AndroidRuntime(424): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.alarm/com.android.alarm.NotifyService}; have you declared this activity in your AndroidManifest.xml?</code></pre><p>When I call this service through an Activity it's working, but my goal is to call this service from a BroadcastReceiver.</p>","304961","","3171","","2010-05-24 10:24:26","2011-05-11 06:15:09","Calling background service from BroadcastReceiver","<android>","2","0","2","",""
"2896122","1","2896228","","2010-05-24 10:07:00","3","2938","<p>I have a frame of 22 bytes. The frame is the input stream from an accelerometer via bluetooth. The acceleromter readings are a 16 bit number split over two bytes. </p><p>When i try to merge the bytes with buffer[1] + buffer[2], rather than adding the bytes, it just puts the results side by side. so 1+2 = 12.</p><p>Could someone tell me how to combine these two bytes to obtain the original number. (btw the bytes are sent little endian)</p><p>Thanks</p>","348824","","","","","2014-01-22 03:03:14","Merge two bytes in java/android","<android><byte><multibyte>","2","2","","",""
"2896253","1","2896510","","2010-05-24 10:33:44","3","22693","<p>Eclipse is marking findViewById(int) as undefined; it was doing the same thing for getResources(), but I was able to get around that by calling context.getResources() instead (as seen below) and can't seem to find a similar workaround for findViewById.  Here is the code:</p><pre><code>package com.myapp.android.MyWidget;import android.appwidget.AppWidgetProvider;import android.appwidget.AppWidgetManager;import android.content.Context;import android.content.ComponentName;import android.content.pm.PackageManager;import android.content.res.Resources;import android.util.Log;import android.view.View;import android.widget.RemoteViews;import android.widget.Button;import android.os.Bundle;public class MyWidget extends AppWidgetProvider { private static String[] states; @Override public void onEnabled(Context context) {  final Button button = (Button) findViewById(R.id.widget_state_button);  states = context.getResources().getStringArray(R.array.states); }</code></pre><p>Is there another package I need to import for findViewById?  Thanks in advance.</p>","202870","","","","","2011-09-19 21:55:38","findViewById undefined","<android><android-widget>","2","0","","",""
"2896278","1","","","2010-05-24 10:38:03","0","352","<p>I have an app which has MainActivity(without gui.. please just flow with it:) )</p><p>now this MainActivity running a service, this service using sendBroadcast() in order to comunnicate with the MainActivity..now ofcourse i need to <strong>registerReceiver</strong> in the <strong>onResume</strong>() of the MainActivity.</p><p>but i also need to add <strong>unregisterReceiver</strong>(receiver) in the <strong>onDestroy</strong>() of the MainActivity.</p><p>problem is: when i first start that app i need it to up the service, and i dont want the user to lose focus, so i press <strong>finish</strong>() after i`am starting the service.. but then auto invoked also unregisterReceiver(receiver).. and this is not good for me.. i get error it's said it couldnt find any registerd reciver.</p><p>so i fixed it by delete this line.. but i am sure its going to 'revenege' me in the future, when/where could i have problem if i wont use unregisterReceiver(receiver)..  at the onDestroy()</p><p>mybe i should remove it (instead of delete it) to onPause()?</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-05-24 11:07:04","handling broadcast reciver","<android>","1","0","","",""
"2896499","1","2896579","","2010-05-24 11:12:52","0","749","<p>I am working on an application and one feature that would make it really useful is the ability to share some information, but the other device may not be expecting the data to be sent.</p><p>For example, if I am reading a really good book, and I realize that a friend may like it, I could use an application to send the data to him, so he could order the book from Amazon.</p><p>But, since he isn't expecting the data, I would hate for the application to be polling a server every so often, as that will be needlessly draining the battery.</p><p>Ideally it would be great if there was a way to make a phone call to the target device, send a data packet and end the call.</p><p>If it could be done and prevent the phone from ringing, then it would be very useful to me.</p><p>I am curious if there is some way to send data between devices without polling.</p>","67566","","","","","2010-05-24 11:32:40","How to pass data to another droid device when the other device isn't expecting it","<android><design>","1","0","1","",""
"2896686","1","2896978","","2010-05-24 11:43:25","1","2827","<p>I have following code:</p><pre><code>public class readSensorsData extends Activity implements SensorListener {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    sm = (SensorManager) getSystemService(SENSOR_SERVICE);     }@Override   public void onSensorChanged(int sensor, float[] values) {    synchronized (this) {        if (sensor == SensorManager.SENSOR_ORIENTATION) {        //get orientation               }        if (sensor == SensorManager.SENSOR_ACCELEROMETER) {         //get acceleration             }                        }         if (sensor == SensorManager.SENSOR_MAGNETIC_FIELD) {         //get magnetic fiels             }          Bundle bundle = new Bundle(); //results from activity     bundle.putFloatArray(""acceleration"", array);     Intent mIntent = new Intent();     mIntent.putExtras(bundle);     setResult(RESULT_OK, mIntent);     finish();        }  public void onAccuracyChanged(int sensor, int accuracy) {  }@Overrideprotected void onResume() {    super.onResume();    sm.registerListener(this,             SensorManager.SENSOR_ORIENTATION |      SensorManager.SENSOR_ACCELEROMETER |      SensorManager.SENSOR_MAGNETIC_FIELD,            SensorManager.SENSOR_DELAY_NORMAL);}@Overrideprotected void onStop() {    sm.unregisterListener(this);    super.onStop();  }}</code></pre><p>code is working but here goes my problem: when I call it from main activity in this way:</p><pre><code>     Intent i = new Intent(this, readSensorsData.class);  startActivityForResult(i, 1); //1 is for sensors          for(int j=0;j&lt;10;j++)     {                 //do sth else here!!!!      try {        Thread.sleep(1000);      } catch (InterruptedException e) {e.printStackTrace();}      //here code for showing result from sensor activity     } </code></pre><p>then i can see 10 times result of 'doing sth else!!!' and when loop is over i can see then result from activity. So sensor activity waits for some reason and then when main activity has nothing to do, sensors are doing their job.</p><p>of course I have well implemented: onActivityResult(int requestCode, int resultCode, Intent intent)</p><p>I want to read sensord data directly, not using listeners, is it possible? </p>","325943","","2603921","","2014-01-06 08:00:47","2014-01-06 08:00:47","Obtaining data from Android sensors without Listeners","<android><activity><sensor>","1","0","1","",""
"2896733","1","","","2010-05-24 11:52:24","4","21264","<p>In my Android application, I want to rename the file name at runtime. How can I do it?</p><p>This is my code:</p><pre><code>String[] command = {"" mv"", ""sun moon.jpg"","" sun_moon,jpg""};try{    Process process = Runtime.getRuntime().exec(command);} catch (IOException e){    Toast.makeText(this, """"+e, Toast.LENGTH_LONG).show();}</code></pre><p>I also used renameTo(File f) method but it does not work.</p>","316451","","23118","","2013-03-25 09:46:07","2013-03-25 09:46:07","How to rename a file on sdcard with Android application?","<android><runtime><filenames><rename>","1","1","2","",""
"2896857","1","","","2010-05-24 12:12:20","4","1393","<p>I'm planning on building an application where audio media is going to be streamed to the mobile phone for the user to listen.</p><p><strong>The targets are smartphones: iPhone/Blackberry/Android/(J2ME ?).</strong></p><p>I see that streaming on iPhone has to be done with <code>HTTP</code> Live streaming, but I don't see it supported by other platforms.</p><p>Should I broadcast the streams via <code>rstp</code> ? <code>http</code> ? Is there any way to use a unified solution for all the different mobile platform ? If anyone already had to go through this, help would be greatly appreciated.</p>","348923","","981914","","2013-05-24 10:41:35","2013-05-24 10:41:35","Streaming audio to mobile phones, what technology to use?","<iphone><android><blackberry><streaming><audio-streaming>","6","0","1","",""
"2897063","1","","","2010-05-24 12:50:19","1","574","<p>when i do the fallowing i get screamed on :</p><pre><code>Button newGameButton = (Button) this.findViewById(R.id.newGameButton);    newGameButton.setOnClickListener(new OnClickListener() {        public  void onClick(View view) {            startActivity(new Intent(this,gameScreen.class));        }    });</code></pre><p>apparently my this is not the one needed how can i fix this err?</p>","346447","","12183","","2010-05-24 12:58:22","2010-05-24 14:12:55","Creating a new Intent results in a error","<android><android-widget>","5","2","","",""
"2897245","1","2897331","","2010-05-24 13:21:23","1","894","<p>I am trying out the (latest) Android SDK, and noticed some strange behavior.</p><p>I've written a skeletal SurfaceView app: Activity, SurfaceView and a rendering thread. It doesn't actually do any painting, and only writes out the framerate to logcat once a second. When it runs in portrait mode, I get around 60 fps. However, when I flip it to landscape the framerate drops to about 30 fps.</p><p>I have also tested it on the LunarLender sample, and got similiar results. All of the testing are done on the emulator, since I don't have a physical device.</p><p>What's it all about? I can't seem to find any mentioning to this on Google, have anyone else experienced that? Is it just an emulator quirk or does it apply to physical hardware too?</p>","311953","","","","","2013-09-25 22:49:12","Android: Frame rate drops in landscape mode","<android><android-emulator><frame-rate><surfaceview>","1","1","","",""
"2897642","1","","","2010-05-24 14:21:21","0","377","<p>my ANDROID app presents a listview, from a database cursor and XML, that needs to replace the values in a column with various words based on the integer value contained in the cursor.  For example, if the value is -1, replace it with the word ""Invalid"", but if the value is >= 0 then just display the value.</p><p>I was under the impression this could magically be done via XML...  TIA.</p>","349029","","226897","","2010-05-24 15:36:44","2010-05-24 15:36:44","Listview...how to conditionally replace a value with a string","<java><android><listview><conditional-formatting>","2","2","","",""
"2897663","1","","","2010-05-24 14:24:04","0","794","<p>Hi i have HTC dev phone with Firmware 1.6 now i want to downgrade to 1.5.</p><p>i follow steps which are given in this link </p><p><a href=""http://androidandme.com/2009/10/beginners/guides/how-to-manually-install-the-official-t-mobile-android-1-6-on-your-g1/"" rel=""nofollow"">http://androidandme.com/2009/10/beginners/guides/how-to-manually-install-the-official-t-mobile-android-1-6-on-your-g1/</a></p><p>but not get any result any one have solution for it than share here to downgrade Android os version.</p>","193583","","","","","2010-05-24 14:27:42","downgrade android OS 1.6 to 1.5","<android><version><operating-system><downgrade>","1","1","","",""
"2898053","1","2898117","","2010-05-24 15:22:59","44","40905","<p>Sorry for being impatient, but I can't find the offline docs for android. Can someone provide a link?</p>","95876","","759866","","2014-02-04 16:04:02","2014-02-04 16:04:02","Android offline documentation and sample codes","<android><documentation><offline>","9","0","3","2013-05-03 16:28:29",""
"2898064","1","2898169","","2010-05-24 15:24:54","4","219","<p>(I am coming from an iPhone experience)</p><p>When we create an iPhone app, Apple gives us a http URL that we can put on web pages that when clicked will open iTunes and give the user a chance to buy on their desktop.</p><p>As Android has no ""iTunes"" Windows/Mac application on the desktop, what do I link to on my Web pages/email marketing so that users can go and buy the Android apps we are writing?</p><p>Ian</p>","172861","","","","","2010-05-24 19:32:41","iPhone to Android Market","<iphone><android><google-play>","2","0","","2012-08-08 14:02:25",""
"2898131","1","","","2010-05-24 15:34:10","1","672","<p><br/>Firstly I must say I'm green as grass in opengl subject. <br/>I'm writing simple 2-d game for android using opengl-es. I use GL11Ext.glDrawTexfOES() to draw the textures (just like in one sample code named 'sprite-method-test'), and gl.glColor4f to color them (and set transparency). But I'm completely helpless if I need apply some brightness or contrast to the rendering texture. <br/>I really appreciate any help. </p>","248190","","","","","2010-05-24 15:34:10","Changing texture brightness on Android in Opengl-es","<android><opengl-es>","0","0","","",""
"2898214","1","","","2010-05-24 15:46:20","0","3761","<p>I'm looking to be able to open up a new view or activity when I click on an item in my ListView.</p><p>Currently I have a list of restaurants, and when i click on a particular restaurant I want it to open up another screen that will show its address, google map etc.</p><p>What I need help with is knowing how to set click events on the items in the list.At the moment I dont have a database of the items, they're just Strings.Can someone help me with getting me to this stage?</p><p>Thanks alot. </p><pre><code>package com.example.androidrestaurant;</code></pre><p>import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.TextView;import android.app.ListActivity;</p><p>public class Dundrum extends ListActivity {    TextView selection;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1, DUNDRUM));    getListView().setTextFilterEnabled(true);  }</code></pre><p>static final String[] DUNDRUM = new String[] {</p><pre><code>    ""Ananda"",    ""Brambles Cafe"", ""Brannigans"", ""Buona Sera"",    ""Cafe Mao"", ""Cafe Mimo"",    ""Dante"", ""Douglas &amp; Kaldi Terrace Cafe"",    ""Eddie Rockets"",    ""Frango's World Cuisine"",    ""Nando's"",    ""Overends Restaurant @ Airfield House"",    ""Pizza Hut"",    ""Roly Saul"",    ""Siam Thai"",""Smokey Joes"",""Sohag Tandoori"",    ""TGI Friday"",""The Rockfield Lounge"", ""Winters Bar"" };};</code></pre>","314610","","314610","","2010-05-24 16:41:02","2012-10-28 18:01:11","Android: how to set click events on ListView?","<android><listview><listadapter>","2","0","","",""
"2898350","1","2899265","","2010-05-24 16:06:56","0","237","<p>Has anyone else noticed behavior specific to the HTC Incredible that might result in an app keeping the device awake and busy? I've received reports that my app is responsible for keeping the device awake and draining the battery, but only from HTC Incredible users. </p><p>My app responds to a number of Intents that might be related. It has a service that starts on boot, and it also responds to changes in network connectivity. I do use a WakeLock, but I'm careful to release it when I'm done processing, and the WakeLock times out after a couple minutes whether I'm done or not.</p><p>I've heard that the Incredible may have some connectivity problems, or that some of them do. Could it be that the network is going up and down frequently, triggering my app?</p><p>Any other ideas? I've asked a user to send me their logs with aLogCat. If they're willing, that may help narrow down the cause.</p>","301145","","148765","","2010-05-24 18:27:10","2010-05-24 18:27:10","I'm getting reports that my app is draining the battery, but only on HTC Incredible","<android><battery>","2","0","","",""
"2898632","1","","","2010-05-24 16:51:43","1","1180","<p>Greetings,</p><p>I'm trying to write a clock widget that displays Epoch time and I need it to update every second.  Currently I'm doing this using a Service that uses a Handler:</p><pre><code> public class EpochService extends Service { private static final String TAG = ""EpochService""; // the time private static long mTime; // ui components private static RemoteViews mViews; private static ComponentName mComponent; private static AppWidgetManager mManager; // handler private static Handler mHandler = new Handler(); @Override public void onStart(Intent intent, int id){  Log.i(TAG, ""start"");  // register the receiver  IntentFilter filter = new IntentFilter();  filter.addAction(Intent.ACTION_SCREEN_OFF);  filter.addAction(Intent.ACTION_SCREEN_ON);  registerReceiver(mIntentReceiver, filter);  // set up ui  mViews = new RemoteViews(this.getPackageName(), R.layout.main);  mManager = AppWidgetManager.getInstance(this);  mComponent = new ComponentName(this, Clock.class);  // start  mHandler.removeCallbacks(mEpochTimerTask);  mHandler.postDelayed(mEpochTimerTask, 1000); } @Override public void onDestroy(){  // unregister receiver to prevent memory leak  mHandler.removeCallbacks(mEpochTimerTask);  unregisterReceiver(mIntentReceiver); } @Override public IBinder onBind(Intent intent) {  return null; } /**  * The broadcast receiver - handles screen off events to stop drawing  */ private static BroadcastReceiver mIntentReceiver = new BroadcastReceiver(){  @Override  public void onReceive(Context context, Intent intent) {   if(intent.getAction().equals(Intent.ACTION_SCREEN_OFF)){    Log.i(TAG, ""stop drawing"");    mHandler.removeCallbacks(mEpochTimerTask);   }   else {    Log.i(TAG, ""start drawing"");    mHandler.removeCallbacks(mEpochTimerTask);    mHandler.postDelayed(mEpochTimerTask, 1000);   }  } }; /**  * Run the Epoch Timer  */ private static Runnable mEpochTimerTask = new Runnable(){  @Override  public void run() {   Log.i(TAG, ""run"");   mTime = System.currentTimeMillis() / 1000;   mViews.setTextViewText(R.id.time, Long.toString(mTime));   mManager.updateAppWidget(mComponent, mViews);   mHandler.postAtTime(mEpochTimerTask, SystemClock.uptimeMillis() + 1000);  } };}</code></pre><p>The problem I'm having is that over time, my home screen appears to get noticeably laggy.  I'm fairly new to Android so I'm not sure if what I'm doing is the correct approach or if there's a better way to achieve this (maybe with AsyncTask?).  Is there a way to update a widget frequently without suffering from UI lag?  If I need to post more code, please let me know.  My widget simply starts and stops this service, and my appwidget-provder has android:updatePeriodMillis=""0"".</p><p>Thanks in advance for the help.</p>","349138","","","","","2010-05-24 16:59:41","Frequent Android Widget Updates","<android>","1","0","","",""
"2898697","1","2903157","","2010-05-24 17:00:15","1","2483","<p>I am receiving an inflation error when pressing the Menu button and adding a menu item in the <code>onCreateOptionsMenu</code> method. I've included some of the error below.</p><p>The code is as follows, and works if I try it on its own and not as part of my activity as a whole. I don't think it's feasible to paste in the whole of my activity here (I have no idea which bit could be causing this), so am wondering if anyone has experienced this before?</p><pre><code>public boolean onCreateOptionsMenu(Menu m) {    Log.d(TAG, ""Menu Create"");    this.menu = m;    m.add(0, 0, 0, ""HAZAH!"");    return true;}</code></pre><hr><p><code>05-24 17:18:47.963: ERROR/AndroidRuntime(1658): android.view.InflateException: Binary XML file line #17: Error inflating class com.android.internal.view.menu.IconMenuItemView05-24 17:18:47.963: ERROR/AndroidRuntime(1658):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)05-24 17:18:47.963: ERROR/AndroidRuntime(1658):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)05-24 17:18:47.963: ERROR/AndroidRuntime(1658):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)</code></p><p><code>05-24 17:18:47.963: ERROR/AndroidRuntime(1658): Caused by: java.lang.reflect.InvocationTargetException05-24 17:18:47.963: ERROR/AndroidRuntime(1658):     at com.android.internal.view.menu.IconMenuItemView.&lt;init&gt;(IconMenuItemView.java:86)</code></p><p><code>05-24 17:18:47.963: ERROR/AndroidRuntime(1658): Caused by: java.lang.reflect.InvocationTargetException05-24 17:18:47.963: ERROR/AndroidRuntime(1658):     at com.android.internal.view.menu.IconMenuItemView.&lt;init&gt;(IconMenuItemView.java:86)</code></p><hr><p>If I try pressing Menu with the debugger attached I see it stop here:</p><pre><code>Suspended (exception InflateException)ViewRoot.deliverKeyEventToViewHierarchy(KeyEvent, boolean) line: 2425   </code></pre><p>Thanks.</p>","172749","","","","","2011-04-13 11:12:29","Android: What could cause an Options Menu inflation error?","<android><menu><inflate><options-menu>","3","2","","",""
"2898813","1","","","2010-05-24 17:14:11","1","544","<p>I'm new to both java and the android so I apologize if I'm missing something obvious.</p><p>I'm trying to allow a user to stay logged in to an application. What is the best way to do this? Can anybody point me to a tutorial? I've searched the web and can't seem to find anything.</p><p>Thanks!</p>","349159","","","","","2010-05-24 17:54:16","Staying logged in to an Android App","<android><login><autologin>","1","0","","",""
"2898823","1","2898947","","2010-05-24 17:15:52","8","38894","<p>I have a MySql database with some sports results in it. I want to write an Android application to display these data on mobile phones.</p><p>I´ve searched on the internet for this issue, and I think it is not possible to have a direct connection between the MySql database and the Android application. (Is this right?)</p><p>So my question is the following:How can I have access in the android application to the MySql database in order to display some of the data?</p>","349160","","254477","","2013-09-20 12:12:31","2013-12-05 12:37:11","How to get from a MySql server to an Android app?","<mysql><database><android><connection>","5","0","7","",""
"2899035","1","2899298","","2010-05-24 17:51:22","5","2120","<p>I have a ListView in Android that needs to have the ability to be manually reordered. An example would be within Android's Music Player application, when you can change the order of tracks in a playlist. I know how to programmatically change the order of a ListView, but not how to do it in regards to a touch and slide approach that can be found in the Music Player application.</p><p>Thanks in advance,</p><p>groomsy.</p>","349179","","","","","2010-05-24 18:29:49","How can you manually reorder a ListView in Android?","<android><listview><reorder>","1","0","","",""
"2899079","1","2906293","","2010-05-24 17:58:10","35","31096","<p>For my app, Transdroid, I am connecting to remote servers via HTTP and optionally securely via HTTPS. For these HTTPS connections with the HttpClient I am using a custom SSL socket factory implementation to make sure self-signed certificates are working. Basically, I accept everything and ignore every checking of any certificate.</p><p>This has been working fine for some time now, but it no longer work for Android 2.2 FroYo. When trying to connect, it will return an exception:</p><pre><code>java.io.IOException: SSL handshake failure: I/O error during system call, Broken pipe</code></pre><p>Here is how I initialize the HttpClient:</p><pre><code>    SchemeRegistry registry = new SchemeRegistry();    registry.register(new Scheme(""http"", new PlainSocketFactory(), 80));    registry.register(new Scheme(""https"", (trustAll ? new FakeSocketFactory() : SSLSocketFactory.getSocketFactory()), 443));    client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams);</code></pre><p>I make use of a FakeSocketFactory and FakeTrustManager, of which the source can be found here: <a href=""http://code.google.com/p/transdroid/source/browse/#svn/trunk/src/org/transdroid/util"">http://code.google.com/p/transdroid/source/browse/#svn/trunk/src/org/transdroid/util</a></p><p>Again, I don't understand why it suddenly stopped work, or even what the error 'Broken pipe' means. I have seen messages on Twitter that Seesmic and Twidroid fail with SSL enabled on FroYo as well, but am unsure if it's related.</p><p>Thanks for any directions/help!</p>","243165","","995926","","2012-05-05 13:31:35","2012-05-05 13:31:35","Custom SSL handling stopped working on Android 2.2 FroYo","<android><ssl><android-2.2-froyo>","2","0","35","",""
"2899139","1","2899242","","2010-05-24 18:07:37","6","4045","<p>I'm using OpenGL to render a game view in my android application. The game is turn based and I wish to add some buttons to the interface. I'd prefer to use standard Android widgets, structured in an XML-generated layout (or, if I have to, a hardcoded layout) and put the OpenGL view in its own window as part of that layout.</p><p>So in regards to this, I have 3 questions:</p><p>1: Is such a thing possible? I've done a few half-hearted tries, but have had no luck so far.</p><p>2: Is such a thing advisable? Does it carry a significant performance penalty, for example, over using OpenGL-based homebrew widgetry?</p><p>3: Is it possible to pass particular arguments to instances created in XML layouts? For example, my current OpenGL view has three arguments in its constructor; is it somehow possible for me to invoke that particular constructor with particular parameters when it's part of a layout?</p>","349189","","","","","2012-03-05 10:37:16","OpenGL and layouts","<android><opengl-es>","2","0","1","",""
"2899392","1","","","2010-05-24 18:45:55","1","4998","<p>I am trying to access a Webservice with kSOAP2 on an Android Phone. I think the connection is being established, but the server won't answer my request since I'm not providing a SOAP Action Header which seems to be required in SOAP Version 1.1(please correct me if I'm wrong here) which I have to use since the server does not support Version 1.2 .The concrete Faultcode which is returning in the request looks like this:</p><pre><code>faultactor  null    faultcode   ""S:Server"" (id=830064966432)    faultstring ""String index out of range: -11"" (id=830064966736)</code></pre><p>The errorcode which is generated on the server (I'm running it on a localhost) looks like this:</p><pre><code>4.05.2010 20:20:29 com.sun.xml.internal.ws.transport.http.HttpAdapter fixQuotesAroundSoapActionWARNUNG: Received WS-I BP non-conformant Unquoted SoapAction HTTP header: http://server.contextlayer.bscwi.de/createContext24.05.2010 20:20:29 com.sun.xml.internal.ws.server.sei.EndpointMethodHandler invokeSCHWERWIEGEND: String index out of range: -11java.lang.StringIndexOutOfBoundsException: String index out of range: -11    at java.lang.String.substring(Unknown Source)    at de.bscwi.contextlayer.xml.XmlValidator.isValid(XmlValidator.java:41)    at de.bscwi.contextlayer.server.ContextWS.createContext(ContextWS.java:45)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)    at java.lang.reflect.Method.invoke(Unknown Source)    at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(Unknown Source)    at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(Unknown Source)    at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(Unknown Source)    at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(Unknown Source)    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)    at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(Unknown Source)    at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(Unknown Source)    at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(Unknown Source)    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(Unknown Source)    at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(Unknown Source)    at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)    at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)    at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)    at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)    at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)    at java.lang.Thread.run(Unknown Source)</code></pre><p>The relevant part of the WSDL (at least that's what I'm thinking) looks like this:</p><pre><code>&lt;operation name=""createContext""&gt;&lt;soap:operation soapAction=""""/&gt;-&lt;input&gt;&lt;soap:body use=""literal"" namespace=""http://server.contextlayer.bscwi.de/""/&gt;&lt;/input&gt;-&lt;output&gt;&lt;soap:body use=""literal"" namespace=""http://server.contextlayer.bscwi.de/""/&gt;&lt;/output&gt;&lt;/operation&gt;    </code></pre><p>In my code I'm adding a Header, but it seems like I'm doing it wrong:</p><pre><code>private static final String SOAP_ACTION  = """";//...SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);soapEnvelope.setOutputSoapObject(Request);AndroidHttpTransport aht = new AndroidHttpTransport (URL);//...aht.call(SOAP_ACTION, soapEnvelope);        SoapPrimitive resultString = (SoapPrimitive) soapEnvelope.getResponse();</code></pre><p>Any advice would be great since I'm running out of ideas..Thanks folks!</p>","345925","","","","","2013-05-18 14:05:06","kSOAP2 and SOAPAction on Android","<android><action><ksoap2>","1","0","","",""
"2899469","1","2899638","","2010-05-24 18:58:45","0","447","<p>I have a TabLayout containing tabs as intents to activities.I want to set custom menu items for each tab, but the onCreateOptionsMenu version called is the Host's version.How can I make the menu items created by each activity on its own.</p>","267929","","126562","","2010-05-24 19:04:10","2011-08-10 07:02:50","TabLayout custom menu","<android><android-widget>","3","0","1","",""
"2899621","1","2899664","","2010-05-24 19:21:48","0","557","<p>How can I check for GPS support in-App to add a feature for those with Location services enabled?</p><p>My concern is, I know I'd have to specify the  tag in the manifest to declare that the app uses location services, but I still want the app to function for those without. I just want to check and, if the service is available, use it; otherwise just ignore that one feature.</p><p>Thanks.</p>","124732","","","","","2010-05-24 19:27:45","How can I check for GPS support in-App to add a feature for those with Location services enabled?","<android><geolocation><android-manifest>","1","0","","",""
"2899631","1","2899683","","2010-05-24 19:23:14","1","815","<p>Is there a permission to allow one app to read the (private) data/data//files/... files of another application? If not, how do backup programs like MyBackup work?</p><p>C</p>","320592","","","","","2010-05-25 05:44:35","Permission to read another app's data?","<android><security>","2","0","","",""
"2899734","1","2899747","","2010-05-24 19:38:13","6","3260","<p>I uploaded an app onto the android market, but i found a bug in it and want to remove it for now. How can I do that?</p><p><strong>Solution as mentioned below</strong>: From the developer console, click the link for your app. Scroll to the bottom, there are 2 buttons - ""Unpublish"" and ""Save"". Click ""Unpublish""</p>","151501","","151501","","2010-05-24 20:41:44","2012-05-19 13:30:25","How do you remove your own app from the android market","<android><google-play>","1","0","","",""
"2900023","1","2900144","","2010-05-24 20:17:43","77","48854","<p>Is it possible to change the language of an app programmatically while still using Android resources?</p><p>If not, is it possible to request a resource in an specific language?</p><p>I would like to let the user change the language of the app from the app.</p>","143378","","","","","2013-12-09 10:17:05","Change language programatically in Android","<android><localization><resources>","10","1","57","",""
"2900288","1","2900826","","2010-05-24 21:00:25","2","611","<p>I'm working through the 'notepad' tutorial given in the developer's guide: <a href=""http://developer.android.com/guide/tutorials/notepad/index.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/notepad/index.html</a></p><p>For some reason, even when i'm using their solution files, the context menu does not come up with i 'click and hold' on a list entry.</p><p>The class extends ListActivity, and calls ""registerForContextMenu(getListView());""</p><p>but I never see the context menu fire.</p><p>Any idea what's wrong with it?</p>","157983","","","","","2012-11-26 01:32:32","Why doesn't the context menu work in the ""Notepad"" tutorial?","<android>","2","1","","",""
"2900304","1","2900330","","2010-05-24 21:03:48","0","3610","<p>I am creating lists in my android app and would like to capture the text of the list item that is clicked but I want to do it in a seperate function so I only have to write the code once. And I want to be able to compare the string to another sting. </p><p>What is the best way to do this?</p>","282475","","","","","2010-05-24 21:07:21","Get text from listview onclick (Android)","<android><listview>","1","0","","",""
"2900318","1","2900364","","2010-05-24 21:05:58","0","466","<p>First of all I'm a newbie when it comes to Android programming. So if this question is totally stupid please delete it ASAP :-).</p><p>Question: </p><p>I'm going to draw a grid of 10x10 PNG images. Each image is 32x32 px. All of the images are unique. I'm thinking that the easiest way seems to be to put each image in an ImageView. </p><p>If adding all ImageView's to the layout would this give me some kind of performance hit?</p><p>Would there be any smarter way to draw these images?</p><p>Thanks.</p><p>/ Henrik</p>","226342","","","","","2010-05-24 21:11:29","Smartest way to draw 100+ images on screen","<android><performance><android-image>","1","0","","",""
"2900404","1","","","2010-05-24 21:17:36","1","1481","<p>I have a layout problem which I can't fix. I've looked through many posts on here, and mine seems to be unique enough to post a question.</p><p>I've created a custom Dialog which programmatically creates a 3 row table. The top and bottom rows have text, while the middle row contains a ScrollView, which contains a LinearLayout. That LinearLayout then contains some number of views (TextView in this example). Since I'm doing this programmatically, see the XML pseudocode below, and the actual code below that.</p><p>What I would like to happen, is that when the height of the contained content in the LinearLayout gets too big, the ScrollView does its job, and the header and footer TextView's are always visible. </p><p><strong>The problem is that when the dialog gets big enough, the ScrollView appears to take over the whole dialog, and my footer TextView disappears off the screen. What can I do to make sure the footer TextView never disappears, but the ScrollView can still function?</strong></p><p>See the following image links:</p><p>Footer visible on the left, gone on the right:</p><p><a href=""http://img690.imageshack.us/i/screenshotss.png/"" rel=""nofollow"">http://img690.imageshack.us/i/screenshotss.png/</a></p><pre><code>&lt;TableLayout&gt;    &lt;TableRow&gt;        &lt;TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;ScrollView&gt;            &lt;LinearLayout&gt;                &lt;TextView/&gt;                &lt;TextView/&gt;                &lt;TextView/&gt;                ...            &lt;/LinearLayout&gt;        &lt;/ScrollView&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Here's the code:</p><pre><code>public class DialogScrollTest extends Dialog {    public DialogScrollTest(Context ctx){        super(ctx);        setTitle("""");        requestWindowFeature(Window.FEATURE_NO_TITLE);         TableLayout table = new TableLayout(ctx);               TableRow row;               TextView text;        row = new TableRow(ctx);        {            text = new TextView(ctx);            text.setText(""TestTop"");            row.addView(text);        }        table.addView(row);        row = new TableRow(ctx);        {            ScrollView scroll = new ScrollView(ctx);            {                   LinearLayout linear = new LinearLayout(ctx);                linear.setOrientation(LinearLayout.VERTICAL);                for(int t=0; t&lt;32; ++t){                    text = new TextView(ctx);                    text.setText(""TestScroll"");                    linear.addView(text);                                   }                scroll.addView(linear);            }                   row.addView(scroll);        }        table.addView(row);        row = new TableRow(ctx);        {            text = new TextView(ctx);            text.setText(""TestBottom"");            row.addView(text);        }        table.addView(row);        this.setContentView(table);    }   }</code></pre>","345651","","","","","2010-05-24 21:22:03","Layout problem: scrollview inside a table, inside a custom dialog","<android><android-widget>","1","0","","",""
"2900509","1","3507619","","2010-05-24 21:37:09","32","52066","<p>What is the best way to implement action bar like twitter sample UI Pattern.</p><p>Twitter for Android: A closer look at Android’s evolving UI patternsPattern 4: Action Bar<a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"">http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html</a></p>","349352","","209981","","2011-07-08 21:16:33","2012-10-05 20:42:58","Android action bar like twitter sample","<android><user-interface><twitter><android-actionbar>","7","1","45","",""
"2901150","1","2901206","","2010-05-24 23:49:45","3","679","<p>i am developing an application for android and would like for my users to be able to post some information from my application to their twitter feed. i know how to make this work by building a VIEW intent and forwarding the user to the android built-in web browser (thanks to stack overflow!) However, now that there is an official Twitter application, I would like to be able to use the twitter applications activity (if it is installed) to make the post. However, I can not find any developer documentation on what the Twitter Intent for Android is called. Can someone provide a short snippet of sample code that includes that text of the Intent to use? </p>","349423","","244296","","2010-05-25 00:11:45","2011-01-13 06:31:18","twitter's officially supported android application","<android><twitter>","3","0","2","",""
"2901187","1","2901204","","2010-05-24 23:59:02","2","14022","<p>I am new to Android and have been working on an app that needs to get all of the user's contact's phone numbers.  Apparently the code I have does not work with the 2.1 SDK.  So far here is the code I am using:</p><pre><code>String[] projection = new String[] { Phone.NUMBER };Cursor c = managedQuery( Phone.CONTENT_URI, projection, null, null, null );int colIndex = -1;try {    colIndex = c.getColumnIndexOrThrow( Phone.NUMBER );} catch( Exception e ) {    print( e.getMessage() ); }print( ""Column Index = "" + colIndex ); //count is equal to 3for( int i = 0; i &lt; count; i++ ){    try {        print( c.getString( 2 ) ); //the 2 used to be colIndex    } catch ( Exception e ) {        print( e.getMessage() );     }}</code></pre><p>It seems that no matter what I pass into c.getString() it keeps telling me that I passed in -1.  But I even hardcoded the 2, and it says the same thing.  Any help would be much appreciated.</p>","349451","","","","","2013-11-30 14:40:29","Android 2.1 How to get Phone Numbers of contacts","<java><android><android-sdk-2.1>","2","1","","",""
"2901333","1","","","2010-05-25 00:51:00","1","3444","<p>for an application I need to place some objects at the exact position that I want to have them and therefore I need to use AbsoluteLayout this time.</p><p>I want to add buttons dynamically exactly like in the following XML - but during runtime.</p><pre><code>&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button      android:id=""@+id/backbutton""     android:text=""TEST123""     android:layout_x=""120px""     android:layout_y=""120px""     android:layout_width=""100px""     android:layout_height=""100px"" /&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>How can I archive this? I tried it with the following code to add a button, but I haven't found a function so far to set layout_x and layout_y. How can I do this? Thanks.</p><pre><code>AbsoluteLayout al = new AbsoluteLayout(this);Button t = new Button(this);t.setHeight(300);t.setWidth(300);t.setText(""TEST123"");// x y ???setContentView(al);</code></pre>","331556","","","","","2012-03-26 08:39:55","dynamic layout change during runtime","<android><absolutelayout>","2","0","","",""
"2901342","1","2903364","","2010-05-25 00:53:40","1","7007","<p>I am trying to display all the images stored in SD card in a Gallery View. </p><p>I have tried using the content provider (android.provider.MediaStore.images.Media class),  but seem to be getting stuck at a point. Not sure if this is the way to go about it.</p><p>Here is my code so far:</p><pre><code>        String[] colsNeeded = new String[]{Media._ID, Media.TITLE};    Uri mMedia = Media.EXTERNAL_CONTENT_URI;    //Create a cursor using the URI &amp; column names needd    Cursor c = managedQuery(mMedia, colsNeeded, null, null, Media.DATE_TAKEN + "" ASC"");    //What kind of adapter should I create here     //that contains images from the cursor??     SpinnerAdapter sa = null; //This is the point I get stuck    //Set the adapter of the gallery view    Gallery galleryPetPhotos = (Gallery)findViewById(R.id.GalleryPetPhotos);    galleryPetPhotos.setAdapter(sa);</code></pre><p>Just a nudge in the right direction would be greatly appreciated. </p>","289918","","1765573","","2013-07-26 14:20:51","2013-07-26 14:20:51","How to display images from SD card in a GalleryView","<android><android-sdcard>","1","0","2","",""
"2901476","1","2903058","","2010-05-25 01:42:19","1","281","<p>I've been trying to create an android-application the last couple of weeks, and mostly everything has worked out great, but there is one thing that I was wondering about, and that is pluginability trough the use of intents.</p><p>What I'm trying to create is basically a comic-reader. As of the version I use now, I open the application and get a list of commics that are my favourites, then I enter one to get a detailed view, and finally I enter a page. This is managed trough 3 activities. List, Details and Page. However, as of now the application can only read comics of one source (a specialiced xml-feed comming from my server), and I was hoping to be able to expand this a litle (also, the page-activity and some other stuff needs to be cleaned up in, so I'm thinking about remaking from scratch, and just take the first go as a learning-round). And I came up with an idea which I think sounds great, but I don't know if it's possible, but this is what I'm thinking about:</p><ol><li>The user enters the application and get an (first time empty) list of comics.</li><li>The user hits a button to find comics, this launces an intent that says something like ""find comic"" or something like that. This should cause the system to display all matching activities. This would make it possible to provide different comic-providers trough different applications.</li><li>Another activity kicks in and might displays some options to the user (for instance a file-browser), or might not (in the example of an xml-feed, which should just load).</li><li>The list is returned to the first activity and displayed to the user. The second (find) activity is closed.</li><li>The user picks a comic from the list. This should open some details-activity. The details-activity should receive a key which corresponds to the comic selected. This should be unique amongst the comic-providers. The details-view should get it's data trough some cind of content-provider, or an activity (whichever is most suited, if one of them is).</li><li>The user can select a page. This should be the same routine as step 5.</li></ol><p>My question is, is this possible in the android system, and if it is, is it a bad idea? And also, is there any better way to achieve more or less the same thing?</p>","213323","","","","","2010-05-25 08:25:04","Android pluginable application","<android><modularity>","1","0","","",""
"2901718","1","2902369","","2010-05-25 03:04:32","1","267","<p>im developing an Android application for twitter that will sync data coming from the people you follow.</p><p>The problem is that:</p><pre><code>http://api.twitter.com/1/statuses/friends.json</code></pre><p>provides me the last 100 persons ive followed and i wanted to display only 20 for each 'page'.</p><p>I believe that the 'cursor' parameter doesnt do what i need, so i'm trying to figure out a way to store it.</p><p>Can you guys give me enlightenment?</p><p>Thanks in advance</p>","2443607","","","","","2010-05-25 06:05:10","Pagination - Twitter's people you follow","<android><json><api><twitter>","1","0","","",""
"2901722","1","","","2010-05-25 03:05:23","2","497","<p>I know how to get the API level, android.os.Build.VERSION.SDK_INT, but there are also several revisions of each level release, e.g. for 2.1 there's rev 1 and 2. How do I determine the revision of a build?</p><p>The reason i'd like to know this is that I have a workaround for a bug in Android 2.1 (and 2.2), and this workaround will break the moment the corresponding bug is fixed. So right now i'm in the odd position of hoping that the bug won't be fixed (at least not until I can find an answer to above question).</p>","311681","","","","","2010-05-25 08:06:53","How do I determine the revision number of an Android build?","<android><revision>","1","0","","",""
"2901767","1","2915383","","2010-05-25 03:17:25","11","5131","<p>My logcat window in Eclipse only displays the first few lines of the StackTrace for each exception. This means that I often can't see where an exception occured. Is there any way to change this setting?</p>","165495","","165495","","2010-05-25 03:30:04","2012-11-27 18:35:09","Eclipse Logcat window cuts off exception stack traces","<android><eclipse><logcat>","3","3","2","",""
"2901859","1","2904762","","2010-05-25 03:42:34","2","5790","<p><strong>NOTE: Must work on Android 1.5 - ContactsContract does not</strong></p><p>Simple enough question.  I need to know the best way to get the same list of contacts that show up when a user presses the Contacts button.</p><p>You would think something like this would work:</p><pre><code>//For ContactsIntent pickIntent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);this.startActivityForResult(pickIntent, RESULT);//For PhonesIntent pickIntent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI);this.startActivityForResult(pickIntent, RESULT);</code></pre><p>The problem is that does not include secondary google accounts or Exchange contacts.  By secondary accounts, in Android you can add additional gmail accounts to have the mail/contacts synced.  The above intent will not list those additional contacts.</p><p>I am also told that on the HTC Desire you can add contacts to the phone that do not get synced up to Google.  These contacts also do not show up.</p><p>So how do I get a real list of contacts so I can create my own list activity that works properly where the Google intent does not.</p><p><strong>NOTE: Must work on Android 1.5 - ContactsContract does not</strong></p>","242904","","242904","","2010-05-25 12:18:45","2014-01-01 09:13:07","Getting a list of all phone contacts?","<android>","4","0","1","",""
"2902089","1","2904953","","2010-05-25 04:52:53","1","1382","<p>How to open a text file in android.I am using android 1.5 emulator and eclipse ide.I try to push files to the device emulator.In Eclipse ide android file explorer has the text file and image files in the sdcard.In the Emulator Image files are in the Gallery.How can i see the text file in the android emulator.</p>","324223","","","","","2011-07-17 21:01:17","open text file in android emulator","<android>","1","0","1","",""
"2902134","1","2902810","","2010-05-25 05:03:39","-2","1014","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2869338/where-to-start-to-learn-android"">Where to start to learn Android?</a>  </p></blockquote><p>i am a beginner with Android. I want to learn more about this new revolution.</p><p>Kindly help me with links that will help me learn creating applications for Android.</p><p>Please share if you have some simple source-code sites with you.Also show me a forum having high activity with Android users...</p><p>thank you !</p>","333239","","","","","2010-05-25 07:36:10","Start Learning Android","<android><android-emulator><android-manifest>","2","0","1","2011-09-24 17:05:38",""
"2902180","1","2902197","","2010-05-25 05:14:56","0","525","<p>I have downloaded the android source code (1.5 Gb and appx. 5 Gb after extracting).My intention is to compile this.1) Do i need a toolchain for arm ..if yes which one will be suitable.2) to run simulator and to be able to debug on workstation do i need to have any specific PC -linux toolchain .</p>","275056","","","","","2010-08-23 06:28:41","Compiling Android scource code on ubuntu 9.10","<android>","2","0","","",""
"2902200","1","","","2010-05-25 05:21:46","0","1182","<p>I have create a listView with rounded cornered background. Now while i select the first item in the listview, the selector shape was not top rounded rect. Likewise while i select the last item in listview, the selector shape was not bottom rounded rect. If i apply rounded rect to the selector all listview item selection will be rounded rect shape. So that i want the selector shape to be matched with the listview's rounded rect background.</p><p>Please help me to solve this issue.</p>","349579","","","","","2011-09-19 16:05:14","ListView rounded Selector","<android>","1","1","1","",""
"2902222","1","6085252","","2010-05-25 05:26:31","2","2688","<p>I am adding a glow animation effect to a logo. So far, I have managed to get the glow image behind the logo, using a LayeredDrawable, but I can't figure out how to animate it. I have found that AlphaAnimation would achieve the desired effect, but unfortunately I can only apply it on Views, not Drawables. How can I achieve this effect?</p>","165495","","","","","2011-05-22 00:46:13","Apply an Animation on a Drawable in Android","<android><animation><drawable>","2","0","1","",""
"2902232","1","","","2010-05-25 05:28:39","1","6356","<p>I've been playing with android's thumbnails for a while now, and I've seen some inconsistencies that make me want to scream. My goal is to have a simple list of all Images (and a separate list for video) with the thumbnail and filename.</p><p>Device: HTC Evo (fresh from Google I/o)</p><p>First off: <a href=""http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-of-images.html"" rel=""nofollow"">http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-of-images.html</a></p><p>That code doesn't seem to work at all, thumbnails are duplicated... some with the ""mirror"" effect and some without. Also some won't load and just display a black square. I've tried rebuilding the thumbnails by deleting the ""alblum thumbs"" directory from the SD card. HTC's gallery application seem to show everything fine.</p><p>This approach seems to work:</p><pre><code>Bitmap thumb = MediaStore.Images.Thumbnails.getThumbnail(    getContentResolver(),    id, MediaStore.Video.Thumbnails.MICRO_KIND, null);imageView.setImageBitmap(curThumb);</code></pre><p>where id is the <em>original</em> images id and imageView is some image view. This is great! But, strangely, way too slow to be used inside a SimpleViewBinder. Next approach:</p><pre><code>String [] proj = {MediaStore.Images.Thumbnails._ID};Cursor c = managedQuery(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,    proj, MediaStore.Images.Thumbnails.IMAGE_ID + ""="" +id ,    null, null);if (c != null &amp;&amp; c.moveToFirst()) {    Uri thumb = Uri.withAppendedPath(mThumbUri,c.getLong(0)+"""");    imageView.setImageURI(thumb);}</code></pre><p>I should explain that I feel the needed WHERE condition is required because there doesn't seem to be any guarantee that your uri will have the same ID for both a thumbnail and its parent image.  This works for all of the current images, but as soon as I start adding pictures with the camera they show up as blank! Debugging shows a dreaded:</p><pre><code>SkImageDecoder::Factory returned null</code></pre><p>error and the URI is returned as invalid. These are the same images that work with the previous call. Can anyone either catch my logical failure or point me to some working code?</p>","136903","","","","","2011-05-09 10:36:36","Android media thumbnails. Serious issues?","<android><media><thumbnails>","3","1","2","",""
"2902382","1","2902895","","2010-05-25 06:09:01","6","1806","<p>I'm wondering what color-scheme is more energy-saving for <a href=""http://en.wikipedia.org/wiki/AMOLED"" rel=""nofollow"">AMOLED</a> display?  </p><p>I've already decided to manage c-scheme according to <a href=""http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_LIGHT"" rel=""nofollow"">ambient light</a>, thanks to <a href=""http://stackoverflow.com/questions/498698/white-light-vs-black-dark-backgrounds-health-effects/498885#498885"">this post</a>:</p><blockquote>  <p>Somewhat-proof, the link posted by nickf: <a href=""http://www.ironicsans.com/owmyeyes/"" rel=""nofollow"">Ironic Sans: Ow My Eyes</a>. If you read that in a well lit room, the black-on-white will be the most pleasant to read. If you read it in a dark room, the white-on-black will be nicer.</p></blockquote><p>But if I want to save battery power, should I use bright content with dark background or vice versa?</p><p>Is it possible anyway (<a href=""http://forums.anandtech.com/showthread.php?t=1587313"" rel=""nofollow"">they say it's not working for simple LCD</a>)?</p>","67407","","984393","","2012-08-08 22:01:18","2012-08-08 22:01:18","Android Nexus One - Can I save energy with color scheme?","<android><hardware><color-scheme><power-management><nexus-one>","4","0","1","",""
"2902560","1","","","2010-05-25 06:47:39","5","9704","<p>Is there any way that I can convert a base64 String to image in Android. I am receiving this base64 String in a xml from the server connected through socket.</p>","291977","","139010","","2012-04-06 20:23:00","2012-07-09 01:13:58","converting base64 String to image in android","<android><image><base64>","3","1","1","",""
"2902564","1","2904967","","2010-05-25 06:48:44","12","757","<p>The application I am developing is in large parts a background-only Service BUT requires some settings that the user must add. Is there a way to integrate applications with the common Settings application/view/activity?</p>","105040","","","","","2010-05-25 13:19:16","Adding settings to Settings","<android>","1","1","3","",""
"2902586","1","","","2010-05-25 06:53:01","0","210","<p>I'm very new to Android development.</p><p>I want to run an Android application on Windows using eclipse that has been already developed on Linux OS. I tried to copy the source/res and menifest file of Android application form linux and started creating a new project on windows. I tried to replace the source/res and menifest of newly created Project on windows with one on linux. It was unable to generate R.java file.</p><p>I wonder if java is portable accross platform then why I couldn't create and compile a new project on Windows from Linux.</p><p>Thanx in advance.</p>","349631","","","","","2012-08-08 14:33:52","Running android application on windows, developed on linux","<android>","2","1","","",""
"2902640","1","2902701","","2010-05-25 07:03:26","2","19670","<p>this is a really simple question on which I've found no answer :/How can I quickly access the screen resolution (width, height) as integer values?</p><p>I've tried this one, but it always shows zero on my emulator:</p><pre><code>DisplayMetrics dm = new DisplayMetrics();int width = dm.widthPixels / 2;</code></pre><p>In my case I want to dynamically create a table with tableRows, each containing two cols. This cols all shall fill half of the screen in width.</p><p>Can someone give me a hint?</p>","317301","","","","","2012-11-09 02:50:16","Android: Get the screen resolution / pixels as integer values","<android><resolution>","4","1","4","",""
"2902689","1","","","2010-05-25 07:12:18","38","75214","<p>I am new to Android development.</p><p>I need to read a text file from the SD card and display that text file.Is there any way to view a text file directly in Android or else how can I read and display the contents of a text file?</p>","349664","","795446","","2011-07-01 08:07:12","2013-06-21 06:16:19","How can I read a text file from the SD card in Android?","<android><android-sdcard>","2","1","13","",""
"2902886","1","","","2010-05-25 07:50:00","7","5700","<p>While I tested my application on an Android Device turning my Android phone from landscape to portrait, results in all the list items in my list view are disappearing. </p><p>Why?</p><p>How to manage?</p>","305732","","114066","","2012-01-27 08:41:31","2012-01-27 08:41:31","Changing Orientation, losing all my list items","<android><orientation><android-listview>","2","1","1","",""
"2903208","1","2920269","","2010-05-25 08:51:51","0","158","<p>I am trying to login on my website using MyspaceId running on Android web browser.  It works fine on iphone browser but fails on Android browser and following error occurs:</p><p>ErrorCode: -6Description: The connection to the server was unsuccessful.FailingURL:  <a href=""https://secure.myspace.com/index.cfm?fuseaction=login.simpleform&amp;featureName=openID&amp;d=MIHfBgkrBgEEAYI3WAOggdEwgc4GCisGAQQBgjdYAwGggb8wgbwCAwIAAQICZgMCAgDABAi+cGiJgCM0cAQQqDTKk4CgnUNV0jUUBwAn8QSBkLASYTcIT/vVoNc9rfSbyRzYKg21qDUwu9ugby+cNgptULSOE/mgKGwdMHj++T7ccVyCOpdPo6bTq38vXESwl3L0aeSIi4Rj6jd0mjOfKiQFcFifjVdnF8jPHlIH5ciWiWq9AKrcDipGxhyqqkb2aufNKkuHvkf+q+Zb1x9Df2cMh2X7UhSNS2ZpJ9fkOZe+uQ=="" rel=""nofollow"">https://secure.myspace.com/index.cfm?fuseaction=login.simpleform&amp;featureName=openID&amp;d=MIHfBgkrBgEEAYI3WAOggdEwgc4GCisGAQQBgjdYAwGggb8wgbwCAwIAAQICZgMCAgDABAi+cGiJgCM0cAQQqDTKk4CgnUNV0jUUBwAn8QSBkLASYTcIT/vVoNc9rfSbyRzYKg21qDUwu9ugby+cNgptULSOE/mgKGwdMHj++T7ccVyCOpdPo6bTq38vXESwl3L0aeSIi4Rj6jd0mjOfKiQFcFifjVdnF8jPHlIH5ciWiWq9AKrcDipGxhyqqkb2aufNKkuHvkf+q+Zb1x9Df2cMh2X7UhSNS2ZpJ9fkOZe+uQ==</a></p><p>The most strange part is that it works fine on Android if I use wifi connection. But it fails only if the wifi is disabled and network carrier connection (Edge) is enabled.</p>","278194","","","","","2010-05-27 10:25:07","unable to login using myspaceid on Android browser?","<php><android><myspace>","1","2","","",""
"2903260","1","","","2010-05-25 09:02:01","13","6092","<p>I've hit a bit of a wall. Any help would be appreciated. I have an app that I want to use DexClassLoader to load another apk file.</p><p>Here is my code:</p><pre><code>DexClassLoader dLoader = new DexClassLoader(""/sdcard/download/test.apk"",""/sdcard/download"",null,ClassLoader.getSystemClassLoader().getParent());Class calledClass = dLoader.loadClass(""com.test.classname"");Intent it=new Intent(this, calledClass);it.setClassName(""com.test"", ""com.test.classname"");startActivity(it);</code></pre><p>Now I had already installed test.apk so when I ran the above code itworked fine and launched the application. However I want to be able torun this without test.apk being installed already (as that woulddefeat the entire point of the application) . So I uninstalled it andwhen I ran the my app again I get this error:</p><pre><code>android.content.ActivityNotFoundException: Unable to find explicitactivity class {com.test/com.test.classname}; have you declared thisactivity in your AndroidManifest.xml.</code></pre><p>So I'm a bit stumped here. This activity is declared in the Manifestof the apk I am trying to run. I can't declare it in my applicationsManifest. Any ideas?</p><p>Thanks,Craig </p>","349742","","3171","","2010-05-25 09:07:31","2011-04-29 01:44:28","Android- Using DexClassLoader to load apk file","<android>","2","0","12","",""
"2903295","1","2906235","","2010-05-25 09:06:51","4","2388","<p>I would have assumed that <code>GL_FIXED</code> was faster, but the iPhone docs actually say to use <code>GL_FLOAT</code> because <code>GL_FIXED</code> has to be converted to <code>GL_FLOAT</code>. Is it the same on Android? I suppose it varies by phone, but what about recent popular ones (Nexus One, Droid/Milestone, etc.)?</p><p>Bonus points: This appears to be completely undocumented (e.g. search google for <code>GL_FIXED</code>!) but where is the 'point' in <code>GL_FIXED</code>? I.e. how much is <code>(GL_FIXED)1</code> worth?</p>","265521","","","","","2010-05-25 15:48:42","Is it better to use GL_FIXED or GL_FLOAT on Android","<android><performance><opengl-es><fixed-point>","2","0","","",""
"2903411","1","2903431","","2010-05-25 09:28:08","5","452","<p>I currently have an array of around 8 - 10 numbers that changes on a periodic basis.</p><p>So around every 5 - 10 seconds the numbers get updated.</p><p>I need to get the top 3 numbers in the array every 10 seconds.</p><p>This is all done on a mobile device.</p><p>The array is the RSSI of the currently scanned access points, so in my office its usually around 10 but out in field testing it could increase to around 50.</p><p>At the minute I iterate through the array 3 times and each time I take out the three highest numbers and place them in three previously declared variables.</p><p>My question is what should I look to do to increase speed and efficiency in this instance?</p>","243999","","203907","","2011-04-19 07:18:11","2011-04-19 07:18:11","Quickest and most efficient method to search top 3 numbers?","<java><android><arrays><list><collections>","5","5","","",""
"2903476","1","","","2010-05-25 09:36:37","0","354","<p>I have a multithreded app where background threads are used to load data over network or from disk/db. Every once in a while user will perform some action e.g. fetch news over network, which will spawn a background AsyncTask, but for some reason user will quit the app (press back button so that activity gets destroyed). In most such scenarios, I make appropriate checks in the background thread after it returns from n/w i/o, so that it won't crash by accessing members of the activity that is destroyed by now. However some corner cases are left where crashes happen, because the background thread would access some member of activity that is now null. </p><p>Do other Android developers have some generic/recommended framework to handle such scenarios?</p><p>These are the times when I wish android would have guaranteed termination of all threads when activity destroys (in the same way that regular linux process cleans up when it's quit)... but I guess Android devs had good reasons for not exposing process lifetimes through the api.</p>","174527","","","","","2010-11-21 12:11:52","handling activity destruction in multithreaded android app","<android><multithreading>","1","0","","",""
"2903756","1","","","2010-05-25 10:21:13","0","3628","<p>Im facing some problems on xml parsing with android. The problem is that the xml from the server comes in ""ISO-8859-1"" set with setEncoding (i get <code>&lt;?xml version=""1.0"" encoding=""ISO-8859-1""?&gt;</code>) format and the android device seems that its ignoring that encoding.</p><p>For example this is part of the original xml that comes from the server:</p><pre><code>&lt;Result Filename=""Pautas para la Presentación RUP Iteraciones de Construcción.ppt""&gt;        &lt;Path&gt;C:\Documents and Settings\zashael\My Documents\PFC\RUP\Pautas para la Presentación RUP Iteraciones de Construcción.ppt&lt;/Path&gt;        &lt;Hostname&gt;computer_1&lt;/Hostname&gt;        &lt;IP&gt;192.168.0.5:27960&lt;/IP&gt;        &lt;ModDate&gt;01-ene-1601 2:06:34&lt;/ModDate&gt;        &lt;Size&gt;33.280 bytes&lt;/Size&gt;    &lt;/Result&gt;</code></pre><p>And this is what i get on the phone before parsing the xml:</p><pre><code>&lt;/Result&gt; &lt;Result Filename=""Pautas para la Presentaciï¿½n RUP Fase Inicio.ppt""&gt;     &lt;Path&gt;C:\Documents and Settings\zashael\My Documents\PFC\RUP\Pautas para la Presentaciï¿½n RUP Fase Inicio.ppt&lt;/Path&gt;     &lt;Hostname&gt;computer_1&lt;/Hostname&gt;     &lt;IP&gt;192.168.0.5:27960&lt;/IP&gt;     &lt;ModDate&gt;01-ene-1601 1:32:06&lt;/ModDate&gt;    &lt;Size&gt;26.624 bytes&lt;/Size&gt; &lt;/Result&gt;</code></pre><p>As you can see there is a problem with the word <em>""presentación""</em>.</p><p>This is the part of code where i recieve the file, and then send it to the parser:</p><pre><code>do                    {                        auxMessage = ois.readObject();                        if (auxMessage instanceof ComConstants)                        {                            receivedMessage = (ComConstants) auxMessage;                            Log.d(""Client"", ""Client has Search Results"");                          //Charset charset = Charset.forName(""ISO-8859-1"");                          //CharsetDecoder decoder = charset.newDecoder();                          //CharsetEncoder encoder = charset.newEncoder();                             String test;                            test = new String(                                    receivedMessage.fileContent, 0,                                    receivedMessage.okBytes);                            if (finalMessage == null) {                                finalMessage = test;                            }                            else {                                                          finalMessage += test;                            }                         /*try { // Convert a string to ISO-LATIN-1 bytes in a ByteBuffer                              // The new ByteBuffer is ready to be read.                              ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(finalMessage));                              // Convert ISO-LATIN-1 bytes in a ByteBuffer to a character ByteBuffer and then to a string.                              // The new ByteBuffer is ready to be read.                              CharBuffer cbuf = decoder.decode(bbuf);                              String s = cbuf.toString();                             finalMessage = s;                             }                          catch (CharacterCodingException e) { }                          }*/                        }                         else                        {                            Log.d(""Client"", ""Unexpected message ""                                    + auxMessage.getClass().getName());                             break;                        }                    } while (!receivedMessage.lastMessage);                    //test encoding                    //String s = finalMessage;                    //finalMessage = new  String(s.getBytes(""ISO-8859-1""));                    System.out.println(""antes de parsear"" + finalMessage);                    SaxParser sap = new SaxParser(finalMessage);</code></pre><p>And this is my parser code:</p><pre><code>package citic.android.remoteir;import java.io.IOException;import java.io.StringReader;import java.util.ArrayList;import java.util.Iterator;import javax.xml.parsers.ParserConfigurationException;import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.Attributes;import org.xml.sax.InputSource;import org.xml.sax.SAXException;import org.xml.sax.XMLReader;import org.xml.sax.helpers.DefaultHandler;    public class SaxParser extends DefaultHandler{        @SuppressWarnings(""unchecked"")        ArrayList myResults;        private String tempVal;        private SearchResult tempResults;        @SuppressWarnings(""unchecked"")        public SaxParser(String xmlString){            myResults = new ArrayList();            parseDocument(xmlString);            /* In order to test */             printData();        }        @SuppressWarnings(""unchecked"")        public ArrayList getResults(){            return myResults;        }        private void parseDocument(String xmlString) {            try {                SAXParserFactory spf = SAXParserFactory.newInstance();                spf.setFeature(""http://xml.org/sax/features/namespaces"",false);                spf.setFeature(""http://xml.org/sax/features/namespace-prefixes"",true);                 SAXParser sp = spf.newSAXParser();                XMLReader xmlReader = sp.getXMLReader();                xmlReader.setContentHandler(this);                StringReader sr = new StringReader(xmlString);                InputSource is = new InputSource(sr);                is.setEncoding(""ISO-8859-1"");                xmlReader.parse(is);            }catch(SAXException se) {                se.printStackTrace();            }catch(ParserConfigurationException pce) {                pce.printStackTrace();            }catch (IOException ie) {                ie.printStackTrace();            }        }        @SuppressWarnings(""unchecked"")        private void printData(){        System.out.println(""No of Results '"" + myResults.size() + ""'."");        Iterator it = myResults.iterator();        while(it.hasNext()) {            System.out.println(((SearchResult) it.next()).toString());            //System.out.println(it.next().toString());        }    }        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {            tempVal = """";            if(qName.equalsIgnoreCase(""Result"")) {                tempResults = new SearchResult();                tempResults.setName(attributes.getValue(""Filename""));            }        }        public void characters(char[] ch, int start, int length) throws SAXException {            tempVal = new String(ch,start,length);        }        @SuppressWarnings(""unchecked"")        public void endElement(String uri, String localName, String qName) throws SAXException {            if(qName.equalsIgnoreCase(""Result"")) {                myResults.add(tempResults);            }else if (qName.equalsIgnoreCase(""Hostname"")) {                tempResults.setHostname(tempVal);            }else if (qName.equalsIgnoreCase(""IP"")) {                tempResults.setIpad(tempVal);            }else if (qName.equalsIgnoreCase(""Path"")) {                tempResults.setPath(tempVal);            /*}else if (qName.equalsIgnoreCase(""Author"")) {                tempResults.setHostname(tempVal);            }else if (qName.equalsIgnoreCase(""File"")) {                tempResults.setIpad(tempVal);            */}else if (qName.equalsIgnoreCase(""ModDate"")) {                tempResults.setModDate(tempVal);            }else if (qName.equalsIgnoreCase(""Size"")) {                tempResults.setSize((tempVal));                 }               }}</code></pre><p>I dont know what to do. I tried setting the string i create after recieving the xml bytes to ISO encoding, but the only thing i got was a <em>""square""</em> instead of <em>""ón""</em>.</p><p>Than you!</p>","349797","","","","","2010-06-29 19:07:15","Android: SaxParser problems using ISO-8859-1 encoding","<xml><android><parsing><sax>","1","0","2","",""
"2903769","1","2903821","","2010-05-25 10:23:25","0","384","<p>How do I upload media to local storage of emulator device?  </p>","95876","","918414","","2013-02-11 02:36:02","2013-02-11 02:36:02","Eclipse ADT plugin","<android><eclipse-plugin><android-emulator><adt>","1","0","","",""
"2903780","1","2905003","","2010-05-25 10:25:32","5","1290","<p>I am required to use custom fonts in my application. </p><p>Problem: For <code>ListViews</code> that contain rows with Multi-Line TextViews having <code>ellipsize</code> property set to true, I can see some illegible characters after the ellipsis. Apparently Android pads the String(in TextView) with some characters(ZERO WIDTH NO BREAK-SPACE) unknown to my custom font.  </p><p>Single line TextView seem to work just fine.</p><p>What is the best way to hide these characters or remove the padding? Also, is there any variant of Helvetica font, freely available that would have ZERO WIDTH NO BREAK-SPACE character?</p><p>Thanks.</p>","236128","","236128","","2010-05-25 11:48:28","2010-05-25 13:25:28","Custom fonts, ellipsis on MultiLine TextViews, Glyphs and glitches","<android><fonts>","1","2","","",""
"2903865","1","2904369","","2010-05-25 10:44:18","0","862","<p>i am making a app which takes photo on button click</p><p>i have camera.java which operates camera and takes photo</p><p>how to i call it on the below  event?</p><p>public void onClick(DialogInterface arg0, int arg1) {</p><p>setContentView(R.layout.startcamera);             </p><pre><code>            }</code></pre><p>Camera .java</p><p>package neuro.com;</p><p>import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;</p><p>import android.app.Activity; import android.hardware.Camera; import android.hardware.Camera.PictureCallback; import android.hardware.Camera.ShutterCallback; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.FrameLayout;</p><p>public class CameraDemo extends Activity {    private static final String TAG = ""CameraDemo"";    Camera camera;    Preview preview;    Button buttonClick;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.startcamera);    preview = new Preview(this);    ((FrameLayout) findViewById(R.id.preview)).addView(preview);    buttonClick = (Button) findViewById(R.id.buttonClick);    buttonClick.setOnClickListener( new OnClickListener() {        public void onClick(View v) {            preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);        }    });    Log.d(TAG, ""onCreate'd"");}ShutterCallback shutterCallback = new ShutterCallback() {    public void onShutter() {        Log.d(TAG, ""onShutter'd"");    }};/** Handles data for raw picture */PictureCallback rawCallback = new PictureCallback() {    public void onPictureTaken(byte[] data, Camera camera) {        Log.d(TAG, ""onPictureTaken - raw"");    }};/** Handles data for jpeg picture */PictureCallback jpegCallback = new PictureCallback() {    public void onPictureTaken(byte[] data, Camera camera) {        FileOutputStream outStream = null;        try {            // write to local sandbox file system</code></pre><p>//              outStream = CameraDemo.this.openFileOutput(String.format(""%d.jpg"", System.currentTimeMillis()), 0);                 // Or write to sdcard                outStream = new FileOutputStream(String.format(""/sdcard/%d.jpg"", System.currentTimeMillis()));<br>                outStream.write(data);                outStream.close();                Log.d(TAG, ""onPictureTaken - wrote bytes: "" + data.length);            } catch (FileNotFoundException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            } finally {            }            Log.d(TAG, ""onPictureTaken - jpeg"");        }    };</p><p>}</p>","164850","","","","","2010-05-25 12:15:43","how to access camera.java in on cick event?","<android>","1","1","","",""
"2903961","1","2904097","","2010-05-25 11:01:36","1","11241","<p>I need to get an item's position in spinner knowing it's ID. I've tried to do it with Spinner and SpinnerAdapter classes but there are no corresponding methods there.</p><p>Thanks, </p><p>Aleksander</p>","218783","","","","","2012-10-25 08:54:10","How to get an item's position from item's ID in android spinner?","<android>","6","0","","",""
"2904146","1","2905031","","2010-05-25 11:36:57","0","1179","<p>My question:Before I go and use an OnLongClickListener, is there a better way to pass the ""what was clicked to create this context menu"" information when your list view has a custom adapter?</p><p>Here are some details:</p><p>Normally, my code can just do something like this:</p><pre><code>public boolean onContextItemSelected(MenuItem item) {    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();</code></pre><p>and then go on and be happy.</p><p>However, ever since I introduced a custom adapter, item.getMenuInfo() is null. This is a big problem, because my code no longer knows which item was clicked. (My custom Adapter makes each list row a checkbox and a text view)</p><p>I tried this but failed:Created my own special AdapterContextMenuInfo (called ""HasAViewMenuInfo""), but when I pass it in this method, it ends up being null in the menu</p><pre><code>public void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, new HasAViewMenuInfo(v));</code></pre>","108495","","","","","2010-05-25 13:28:33","Why is MenuItem.AdapterContextMenuInfo null when my list view has a custom adapter?","<android>","1","0","","",""
"2904269","1","2904643","","2010-05-25 11:53:46","1","741","<p>I want to send some information from PHP to Java. Why? Because I have a database on my server, and I get information from my database using PHP scripts.</p><p>Now I want to send that information to my client in Java. How can I do that?</p><p>I send information from Java to PHP by POST, and it works well, but I don't know how can I do the reverse.</p><p>Can you help me?</p><p>I saw this code, from a GET connection in Java... is it correct? </p><pre><code>public String HttpClientTutorial(){    String url = ""http://testes.neoscopio.com/myrepo/send.php"";       InputStream content = null;         try {           HttpClient httpclient = new DefaultHttpClient();           HttpResponse response = httpclient.execute(new HttpGet(url));          content = response.getEntity().getContent();         } catch (Exception e) {           Log.e(""[GET REQUEST]"", ""Network exception"", e);         }    String response = content.toString();  return response;}</code></pre><p>P.S: I'm an android developer, not a Java developer...</p>","309897","","75801","","2010-05-25 12:51:48","2012-06-28 14:59:34","Send information from PHP to Java","<java><php><android>","1","2","2","",""
"2904386","1","3288430","","2010-05-25 12:10:28","1","1705","<p>I'm trying to force Webkit to use proxy definde in APN.</p><p>My proxy configuration:</p><pre><code>APN: wapPROXY: 192.168.6.102PORT: 8080USER: wapPASSWORD: wap`</code></pre><p>Currently all connections made by Webkit are blocked on firewall.  Is there way to use proxy from phone profile?</p>","296427","","296427","","2010-11-08 19:01:32","2010-11-08 19:01:32","How to enforce webkit to use system APN proxy in Android?","<android><proxy><webkit><apn>","1","0","2","",""
"2904507","1","2904653","","2010-05-25 12:26:53","6","20345","<p>I know that google goggles will translate a picture to text. What I want to do is allow the user to take a picture (no problem), translate that picture to text(?) and then do some processing on the text (no problem).</p><p>Is there any API on android that allows this? or is there any way to programtically communicate with google goggles? I would hate to have the user use goggles then select the saved file with my app.....</p>","335577","","148765","","2010-05-25 12:56:50","2013-01-01 07:11:49","Translate a picture to text on Android?","<android><ocr>","1","1","9","",""
"2904761","1","","","2010-05-25 12:55:09","22","11837","<p>Any idea how to fix this issue?  I'm using Eclipse and it seems to occur even when I create a new android project. :(</p><pre><code># A fatal error has been detected by the Java Runtime Environment:##  Internal Error (classFileParser.cpp:3174), pid=3944, tid=3256#  Error: ShouldNotReachHere()## JRE version: 6.0_18-b07</code></pre>","349917","","349917","","2010-05-25 13:10:11","2014-04-13 01:46:17","ShouldNotReachhere classFileParser ANDROID","<android><fatal-error>","8","1","2","",""
"2904916","1","2904939","","2010-05-25 13:13:41","0","65","<p>Kinda like in the format of a class-dump result but in Java, I already have the Android.jar file and I would like to dump a clean listing of classes and methods for each .class file. How do I do this?p.s. HTML documents seem too messy and hard to parse.</p>","184427","","184427","","2010-05-25 13:23:38","2010-05-25 14:07:27","How do I produce a clean listing of APIs for Android SDK?","<android><document>","1","0","","",""
"2904982","1","","","2010-05-25 13:22:53","3","1018","<p>I need to use volume buttons in my application while sleep mode is active( black screen, locked).I am using onDispachKeyEvent to capture volume buttons and it works perfectly while in normal state.In music player if you close the screen, you can still change volume. Any idea how is done ?</p><p>Thanks</p>","225691","","","","","2011-03-03 22:04:28","Using volume buttons while in sleep mode ( music player style )","<android>","1","1","2","",""
"2905015","1","2905492","","2010-05-25 13:26:33","1","500","<p>I have a class, MyService. This is my Android service. I wanna generate two random numbers, and this service should return the sum of these numbers. How can i do that? So , i should generate the numbers in </p><pre><code> public void onStart(Intent intent, int startid) {  //Toast.makeText(this, ""My Service Started"", Toast.LENGTH_LONG).show();  // here i generate the numbers (random) and i compute the sum , nr1+nr2. }</code></pre><p>Then, how can i return the result to the main activity, and display the sum of the numbers as an alert (for example), or in an edit box when a button is pressed? So, in the main class i have</p><pre><code>    public void onClick(View src) {  switch (src.getId()) {                //start the service  case R.id.buttonStart:    Log.d(TAG, ""onClick: starting srvice"");   startService(new Intent(this, MyService.class));   break;  case R.id.buttonStop:   Log.d(TAG, ""onClick: stopping srvice"");   stopService(new Intent(this, MyService.class));   break;  }</code></pre><p>The question is how/where can i return the result of that service (that nr1+nr2), and how should i display the result?</p><p>Thanks!</p>","300590","","","","","2010-05-25 14:18:28","android service question","<android><eclipse><android-emulator>","1","0","1","",""
"2905065","1","2905245","","2010-05-25 13:33:17","3","3485","<p>Hi I am new to android. In my application if user selects the button in the alertDialog I need to open a new screen and I have to display some message on that screen. How to open a new screen?</p>","324223","","","","","2012-11-21 10:18:08","Open new Screen in Android?","<android>","4","0","","",""
"2905224","1","2905248","","2010-05-25 13:49:17","6","628","<p>I'm just starting out on android and my java is verry rusty. I can't remember ever seeing a function nested in another function like this before. Could somebody explain to me exactly what final does and explain why you would nest a function in another like this?  </p><pre><code>private final Handler handler = new Handler() {        @Override        public void handleMessage(final Message msg) {            Log.v(Constants.LOGTAG, "" "" + ReviewList.CLASSTAG + "" worker thread done, setup ReviewAdapter"");            progressDialog.dismiss();            if ((reviews == null) || (reviews.size() == 0)) {                empty.setText(""No Data"");            } else {                reviewAdapter = new ReviewAdapter(ReviewList.this, reviews);                setListAdapter(reviewAdapter);            }        }    };   </code></pre>","264273","","","","","2010-05-26 20:57:55","Can Somebody Explain this java code","<java><android>","5","0","3","",""
"2905240","1","2905394","","2010-05-25 13:50:42","3","1342","<p>I want to write an App that monitors my paired bluetooth connection in the following way:</p><p>If a file comes from a paired source it should be stored. If no file was passed and the bluetooth connection breaks down, my app shall store a dummy file.</p><p>Storing a file works great, my main issue is how to run this whole thing without having an activity on my display....</p><p>I read much about services, but mostly it is said that a service is depending on an activity/app...is that right?</p><p>Is there any other possibility to realize something like that? What about broadcast receivers? How can I programm this functionality?</p><p>I'm looking forward to read your (creative) answers ;-)nice greetings, poeschlorn</p>","317301","","","","","2011-11-17 09:21:46","Android: Shut down / loss of bluetooth connection or file receive -> Do something","<android><service><bluetooth><broadcastreceiver>","1","0","1","",""
"2905251","1","","","2010-05-25 13:51:52","0","757","<pre><code> public void onListItemClick(ListView l, View v, int position, long id){    if(position == 0){        setContentView(R.layout.cuisine);    }}</code></pre><p>I have an array of Strings and i'm using the above method to try and open up a new xml file called 'cuisine' when it is clicked. but it keeps failing!</p><p>Have I done this right, or what am I doing wrong?</p><p>Thanks.</p><p>Ok from looking at similar problems on the web, people have said to get the onListItemClick() to start a new activity and using that new activity to then open up the new view?</p><p>So what i've done is this...</p><pre><code> protected void onListItemClick(ListView l, View v, int position, long id){    Intent dundrumIntent = new Intent(v.getContext(), DundrumSelector.class);    dundrumIntent.putExtra(""position"", position);    startActivityForResult(dundrumIntent, 0);}</code></pre><p>and then </p><pre><code>import android.app.Activity;</code></pre><p>import android.os.Bundle;</p><p>public class DundrumSelector extends Activity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);</p><pre><code>    int position = getIntent().getExtras().getInt(""position"");    if(position == 0){        setContentView(R.layout.cuisine);    }}</code></pre><p>}</p><p>Yet i'm still getting the same problem. The program crashes when I click on an item in the listView. And yes i've added the activity to the manifest.</p><p>Does anyone have a resolution to this as alot of people seem to be having the same problem.</p><p>Thanks alot.</p>","314610","","314610","","2010-05-25 14:27:13","2010-12-28 06:54:22","Android: onListItemClick not opening up the .xml file","<android><listview><listitem>","2","1","","",""
"2905272","1","3125517","","2010-05-25 13:55:18","3","363","<p>How do I write a unit test to determine that the layout used in <code>setContentView(int layoutId)</code> has been called and corresponds to the proper layout for a given activity?</p>","35501","","","","","2010-06-26 21:11:42","How to test a call to setContentView?","<android><unit-testing><layout><activity>","1","0","1","",""
"2905302","1","","","2010-05-25 13:58:39","0","174","<p>I want to extract ""To"" and ""Subject"" from email clent which is already configured in android emulator.</p><p>so, is any api to extract or to get all email attributes?</p><p>Thanx in advance,</p>","285163","","","","","2010-09-22 13:52:59","how to extract to, subject etc fron email in android emulator?","<java><android><android-emulator>","1","0","","",""
"2905542","1","2905627","","2010-05-25 14:23:47","24","17392","<p>On the iPhone, you can add a numbered badge to the application icon. On BlackBerry, I've successfully painted an image onto the application's icon while in the program. I want to do this for Android as well. I don't want to use the notification bar, as it's not something that needs to be notified instantly. Instead, I just want the user to be able to see how many new messages are in the application just by looking at the application icon.</p>","349179","","85950","","2013-02-01 20:52:37","2014-03-25 11:33:31","Is there a way to add a badge to an application icon in Android?","<android><icons><badge>","4","1","10","",""
"2905738","1","","","2010-05-25 14:46:53","0","1197","<p>I installed the latest version of the Android NDK (r4) on Windows, plus a fresh installation of cygwin with the required packages, latest Android SDK, Eclipse + Android plugins.</p><p>Whenever I try to build any of the JNI code from cygwin (Be it the samples from the NDK, or a <a href=""http://fixnum.org/blog/2010/android_ndk/"" rel=""nofollow"">custom project</a>), I'm getting:</p><pre><code>$ make APP=demoAndroid NDK: Building for application 'demo'Compile thumb  : demo_lib &lt;= apps/demo/project/jni/demo.ccc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/local/include: not a directorycc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include: not a directorymake: *** [out/apps/demo/armeabi/objs/dmeo_lib/demo.o] Error 1</code></pre><p>My name is not David, and I don't have a G drive.</p><p>Seems like this path is somehow hard-coded into this release. I tried looking for the string <code>g/David</code> in the NDK directory. It appears in many of the binaries, some <code>.info</code> files, as comment in some headers, and in two <code>mkheaders.conf</code> files:</p><pre><code>&lt;NDK&gt;\build\prebuilt\windows\arm-eabi-4.2.1\lib\gcc\arm-eabi\4.2.1\install-tools\mkheaders.conf:SYSTEM_HEADER_DIR=""/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include""</code></pre><p>and</p><pre><code>&lt;NDK&gt;\build\prebuilt\windows\arm-eabi-4.4.0\lib\gcc\arm-eabi\4.4.0\install-tools\mkheaders.conf:SYSTEM_HEADER_DIR=""/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm${sysroot_headers_suffix}/usr/include""</code></pre><p>I changed both files to point to the correct path, but I get exactly the same error (with the original path).</p><p>I have limited experience with cygwin, unix, or make. Any ideas?</p>","311953","","","","","2010-10-27 12:25:35","Android NDK keeps looking for ""g/David/...""","<android><cygwin><make><android-ndk>","3","0","1","",""
"2905827","1","9871212","","2010-05-25 14:56:56","2","1591","<p>I want to install the Photoshop mobile on my emulator. I need to do test the Photoshop.com Mobile integration for image editing. But I dont know how to do that. I cannot access the market from the emulator.Can anyone tell me how I can install it on my simulator. </p>","285550","","","","","2012-03-26 11:24:17","How to install a free market application on an android simulator","<android><install><emulator>","5","0","1","",""
"2905931","1","","","2010-05-25 15:10:20","8","3058","<p>I'm tried to determine the ""best"" way to scroll a background comprised of tiled Bitmaps on an Android SurfaceView.  I've actually been successful in doing so, but wanted to determine if there is a more efficient technique, or if my technique might not work on all Android phones.</p><p>Basically, I create a new, mutable Bitmap to be slightly larger than the dimensions of my SurfaceView.  Specifically, my Bitmap accomodates an extra line of tiles on the top, bottom, left, and right.  I create a canvas around my new bitmap, and draw my bitmap tiles to it.  Then, I can scroll up to a tile in any direction simply by drawing a ""Surfaceview-sized"" subset of my background Bitmap to the SurfaceHolder's canvas.</p><p>My questions are:</p><ol><li><p>Is there a better bit blit technique than drawing a background bitmap to the canvas of my SurfaceHolder?  </p></li><li><p>What is the best course of action when I scroll to the edge of my background bitmap, and wish to shift the map one tile length?As I see it, my options are to:</p></li></ol><p>a.  Redraw all the tiles in my background individually, shifted a tile length in one direction.  (This strikes me as being inefficient, as it would entail many small Bitmap draws).</p><p>b.  Simply make the background bitmap so large that it will encompass the entire scrolling world.  (This could require an extremely large bitmap, yet it would only need to be created once.)</p><p>c.  Copy the background bitmap, draw it onto itself but shifted a tile length in the direction we are scrolling, and draw the newly revealed row or column of tiles with a few individual bitmap draws.  (Here I am making the assumption that one large bitmap draw is more efficient than multiple small ones covering the same expanse.)</p><p>Thank you for reading all this, and I would be most grateful for any advice.</p>","350042","","","","","2012-11-13 16:53:13","Android scrolling background of bitmap tiles","<android>","4","0","2","",""
"2905963","1","","","2010-05-25 15:14:34","5","3246","<p>I want to created a wrapping text ontop of google maps api.  I have been able to do this with a lot of code, but have been working on a better way.  My latest attempt is to use the StaticLayout class and the text is wrapping, but I do not know how to position it...no matter what I try it is always starting in the top left corner of the screen....</p>","341447","","","","","2012-04-05 14:26:01","How to position StaticLayout in android?","<android><drawtext>","3","0","","",""
"2905964","1","2906163","","2010-05-25 15:14:55","0","338","<p>I have  Imagebutton  or  image  view in Main.xml</p><p>How can i assign result URI to ImageView or ImageButton?</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent data) {  if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 0) {    String result = data.toURI();}}public void onClick(DialogInterface arg0, int arg1) {                Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");                startActivityForResult(intent, 0);            }</code></pre>","164850","","243782","","2010-05-25 15:36:59","2010-05-25 15:38:15","How can i assign result URI from image Capture to ImageView or ImageButton?","<android>","1","0","","",""
"2905967","1","2906093","","2010-05-25 15:15:15","4","1614","<p>I want to know what kind of users are using my app. </p><p>I think I need the device id, the network type, the network provider name and its ip address. is there any framework to do this thing? And of course I will ask user to enable it before I can do it and leave an option to disable it when user want to toggle it off.</p>","238061","","238061","","2010-05-25 15:25:51","2012-04-03 12:48:26","How to track and analysis android app?","<android><analytics>","5","2","3","",""
"2905969","1","2906432","","2010-05-25 15:15:47","0","312","<p>I have the following questions, please if you know the answers share it with me.</p><ul><li>How can I transform my working Java code to NDK? (it's an algoritm not activity)</li><li>I am able to access the database from NDK?</li><li>Will a backtracking algorithm with 10 millions of iterations run faster if was written with NDK?</li></ul>","243782","","","","","2010-05-25 16:17:20","Some questions about using NDK for faster programming results","<android><android-ndk>","1","0","","",""
"2906158","1","3006198","","2010-05-25 15:37:26","1","2233","<p>Our company is making a mobile version of our website. We have several product videos we want to show on the mobile version.</p><p>When I try to use </p><pre><code>&lt;a href=""video.wmv""&gt;video&lt;/a&gt; </code></pre><p>I get sound playing but a black screen on my htc incredible android os phone.</p><p>I'm thinking that the video is playing but in a different browser window. I need it to display all in one window without having to switch to a different window.</p><p>I tried the html embed tags and get no video or sound at all, from what I've read these tags are not very realiable cross browser.</p><p>I also just tried the html5 video tags below. I get an icon identifying that it's a video file but it doesn't play.</p><pre><code>&lt;video src=""video.wmv"" controls=""controls""&gt;      your browser does not support the video tag&lt;/video&gt;</code></pre><p>Is there a special format the video file needs to be in? Should I be using the href or embed tags, what other options do I have?</p><p>If it helps to know, I'm using the mobile doctype on my webpages.</p><p>Thanks</p>","110083","","110083","","2010-05-25 16:56:41","2010-06-09 13:25:10","How to add video into a webpage for mobile web browsers","<html><android><xhtml><video><mobile>","3","0","","",""
"2906219","1","2906383","","2010-05-25 15:45:40","0","1758","<p>I get this error on my Android emulator:</p><p>SorryThe application has stopped unexpectedly.  Please try again. [Force Close]</p><p>I think the code that is creating the error is this:<strong>HttpClient client = new HttpClient();</strong></p><p>I have imported the following from JARS:</p><pre><code>import org.apache.commons.httpclient.HttpClient;import org.apache.commons.httpclient.HttpStatus;import org.apache.commons.httpclient.methods.PostMethod;</code></pre><p>Any idea?  Is there a way to get more details on what the error is?  The message described above isn't very helpful...</p><p><strong>Stacktrace:</strong></p><p>I've looked at this and I think this is the problem.  (it was too long to post all on here..)</p><p>E/dalvikvm(  757): Could not find class 'org.apache.commons.httpclient.HttpClient', referenced from method com.projectNoble.androidClient.serverComms.initCommunication</p><p>W/dalvikvm(  757): VFY: unable to resolve new-instance 46 (Lorg/apache/commons/httpclient/HttpClient;) in Lcom/projectNoble/androidClient/serverComms;</p><p>W/dalvikvm(  757): VFY:  rejecting opcode 0x22 at 0x0000</p><p>W/dalvikvm(  757): VFY:  rejected Lcom/projectNoble/androidClient/serverComms;.initCommunication ()Ljava/lang/String;</p><p>W/dalvikvm(  757): Verifier rejected class Lcom/projectNoble/androidClient/serverComms;</p><p>D/AndroidRuntime(  757): Shutting down VM</p><p><strong>Source Code</strong></p><p>Can be found at bottom of this page:<a href=""http://hc.apache.org/httpclient-3.x/tutorial.html"" rel=""nofollow"">http://hc.apache.org/httpclient-3.x/tutorial.html</a></p>","262894","","262894","","2010-05-25 16:10:57","2010-05-25 16:10:57","HTTPClient causing app to force close","<android><android-emulator><httpclient>","2","5","","",""
"2906258","1","2906317","","2010-05-25 15:52:17","0","4615","<p>I use loadData method to load some html content into a webview, but when it encounters something like this :<br>    <code>&lt;a href=""http://www.anywebsite.fr/""&gt;some text&lt;/a&gt;&lt;img src=""http://www.anotherwebsite.fr/thewantedpicture"" width=""1"" height=""1"" border=""0"" alt="""" style=""border:none !important; margin:0px !important;"" /&gt;</code><br>I only get this in the application :<br><a href=""http://www.anywebsite.fr/"" rel=""nofollow"">some text</a><br>And if I'm not mistaken, this should also display the picture ?If someone has any lead, thanks...</p>","263521","","","","","2012-01-19 12:54:57","webview loaddata in android does not load a picture from img src","<android><webview><image><src>","2","0","","",""
"2906396","1","","","2010-05-25 16:12:30","3","204","<p>I tested this on my Motorola Droid, and it worked as intended.  However, I'm concerned that this might be:</p><ol><li>Terribly inefficient.</li><li>Not guaranteed to work on all Android phones.</li></ol><p>Code:</p><pre><code>/* Create a simple 100 by 100 bitmap */Bitmap myBitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);/* Create a canvas with which to draw on my bitmap */Canvas myCanvas = new Canvas(myBitmap);/* Draw a subset of my bitmap onto itself, with the source rectangle and destination rectangle overlapping */Rect sourceRect = new Rect(10, 0, 99, 99);Rect destRect = new Rect(0, 0, 89, 99);myCanvas.drawBitmap(myBitmap, sourceRect, destRect, null);</code></pre><p>As I said, this seemed to work fine in my testing, but when performing bit blits on other platforms, I haven't always been able to guarantee that it's safe, memory and performance-wise, to copy one grpahics region to another when the source and destinations intersect.</p><p>I'd welcome any insight into this.</p>","350042","","128421","","2012-10-26 06:25:05","2012-10-26 06:25:05","Is it safe to draw part of an Android bitmap onto itself with some overlap?","<android>","0","0","","",""
"2906547","1","","","2010-05-25 16:34:05","2","163","<p>Is it possible to programmatically retrieve the desktop icons within a WallpaperService ?</p>","406345","","65977","","2010-07-30 04:35:22","2011-08-24 04:33:39","Desktop Icon Locations available to Live Wallpapers? (android)","<android>","1","1","3","",""
"2906558","1","4905052","","2010-05-25 16:35:10","1","2628","<p>When starting my emulator from Eclipse or from the command line (Win7x32), I see no emulator window popup and the process hangs.</p><p>From the command-line, with <code>-verbose</code>, I see logs until the two lines:</p><pre><code>emulator: using 'winaudio' audio input backendemulator: using 'winaudio' audio output backend</code></pre><p>... and then nothing. </p><p>When I start from the command line with <code>-verbose</code> and <code>-noaudio</code> options, the emulator starts up.</p><p>I can modify the Eclipse avd startup settings to have -noaudio, but I'd like to find a way to get audio working.</p><p>The commands <code>emulator -help-audio-in</code> and <code>emulator -help-audio-out</code> show <code>winaudio</code> and <code>winaudio</code> &amp; <code>sdl</code>, available, respectively.</p><p>Does anyone have pointers as to how to get audio working with my emulator?</p><p><strong>Edit</strong>After this happened again, I discovered it was a faulty audio driver - basically a Windows audio driver issue.  Reinstalling the driver (and removing any usb-attached audio hardware like webcams, etc.) allowed the emulator to start w/o hanging @ winaudio statements.</p>","350094","","350094","","2011-01-18 15:02:44","2012-12-04 01:16:04","Audio not working in the android emulator (win7)","<android><android-emulator>","1","0","","",""
"2906618","1","2906727","","2010-05-25 16:45:11","2","1335","<p>I have an Android Service. When a phone boots up, a broadcast receiver receives a notification and it schedules the service to run repeatedly at a gap of X minutes. Henceforth After every X minutes another broadcast receiver gets those notifications and kicks the service off, which does it's job and quits. So far so good.</p><p>Now I want those X minutes to be configurable. I have a perf.xml similar to what is given at the link below. This XML captures all my preferences along with that of service timer.<a href=""http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html"" rel=""nofollow"">http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html</a></p><p>Now when user changes preferences; how can I reschedule the alarm? Is there a way I can set a listener on preferences change? I have used only XML files to speficy preferences screen.</p><p>Any ideas will be welcome.</p><p>Cheers</p>","57847","","","","","2012-03-21 14:52:40","How to reschedule Alarm Manager on Preference Change","<android><service><preferences><alarmmanager>","1","0","1","",""
"2906755","1","2906786","","2010-05-25 17:05:01","1","457","<p>I have an application which has a directory created into SDCard where I save photos. I would like to know how much space is using that dir on SDCard in order to show that info to the user.</p>","258863","","677022","","2011-04-26 19:51:10","2011-04-26 19:51:10","Android: how to get storage used by an application","<android><storage>","1","0","","",""
"2906905","1","","","2010-05-25 17:26:25","0","1068","<p>When I use ListView to display a array of my object, I can use the following code:</p><pre><code>MyObject[] myObject;...  ArrayAdapter&lt;MyObject&gt; itemList = new ArrayAdapter&lt;MyObject&gt;(this, R.layout.list, myObject);   setListAdapter(itemList);</code></pre><p>In case that the input is a list:</p><pre><code>List&lt;MyObject&gt; myobject;</code></pre><p>How can I assign it to ListAdapter? Please advise, Thx!</p>","346158","","60261","","2010-05-25 17:46:42","2010-05-25 21:04:41","How to display List<> using ListView?","<android><list><listview>","2","0","","",""
"2906925","1","7923530","","2010-05-25 17:29:05","57","65648","<p>I need to be able to use one object in multiple activities within my app, and it needs to be the SAME object. What is the best way to do this? </p><p>I have tried making the object ""public static"" so it can be accessed by other activities but for some reason this just isn't cutting it. Are there any other ways of doing this?</p>","339428","","83509","","2011-05-30 07:04:32","2013-09-17 12:42:06","Android: How do i pass an object from one activity to another?","<android><object><activity>","6","0","26","2013-11-18 06:59:38",""
"2907025","1","","","2010-05-25 17:40:49","1","754","<p>Has anyone else had this problem?</p><p>I have a game, and the Ads show at the top of the phone above my game view.  When I'm tapping away on the game, the ads just stay the same.  BUT, if I don't touch anything and wait the 15 seconds, as is set in my Interval, THEN the ad changes (usually).</p><p>I don't get any error reports.  There's nothing to indicate that this shouldn't be working just fine, but I have no idea why my ads aren't refreshing or rotating while I'm interacting with the other View in my application.</p><p>Any direction or thoughts would be helpful, thank you!</p>","179518","","165260","","2010-05-26 11:26:52","2010-05-26 11:26:52","AdMob ads on Android app are not rotating / refreshing","<android><admob><ads-api>","0","0","0","",""
"2907201","1","","","2010-05-25 18:00:59","0","2356","<p>I would like change the width of a Horizontal Progressbar programmatically (initial size is set in XML using RelativeLayout...but I would like to dynamically change it based on certain values).</p><p>I have tried setMinimumWidth(50) in my code, but that did not make a difference.  I have also tried setting 'android:layout_width=""wrap_content"", but that did not work either.</p><p>Here is my XML:</p><pre><code>&lt;ProgressBar android:id=""@+id/progress_horizontal""     style=""?android:attr/progressBarStyleHorizontal""     android:layout_width=""100dip""     android:layout_height=""wrap_content"" /&gt;</code></pre><p>Thanks in advance for any assistance!</p>","380686","","380686","","2010-05-25 21:14:07","2010-05-25 21:54:42","Unable to programmatically change width of horizontal progressbar","<android>","2","0","","",""
"2907335","1","2907413","","2010-05-25 18:20:38","116","64737","<p>I want to disable the orange highlight that occurs when touching a listView row. So far in my xml I have tried the following:</p><pre><code>android:focusable=""false""android:focusableInTouchMode=""false""android:clickable=""false""</code></pre><p>More information: I want there to be zero difference when a user touches the screen on this listView object.</p>","192549","","192549","","2010-05-25 23:40:22","2014-01-19 04:29:33","Android: disabling highlight on listView click","<android><listview><highlighting>","11","0","39","",""
"2907464","1","","","2010-05-25 18:38:29","6","2764","<p>I was wondering if there is any 3D scene graph toolkit available or at least in development for Android? I could not find anything, assuming that all existing solutions for Java won't run on the Android platform.</p>","350206","","","","","2011-05-01 12:46:47","3D Scene graph toolkits for Android","<android><scenegraph>","4","0","2","",""
"2907786","1","2908287","","2010-05-25 19:16:58","8","3489","<p>I have an ImageView at the top of my display that looks like the following:</p><pre><code>+----------------------------------------------+¦ ImageView    +--------------+                ¦¦              ¦              ¦                ¦¦              ¦ Actual image ¦                ¦¦              ¦              ¦                ¦¦              ¦              ¦                ¦¦              ¦              ¦                ¦¦              +--------------+                ¦+----------------------------------------------+</code></pre><p>Below this, I have a series of Buttons and TextViews.. </p><p>I would like the ImageView's height to dynamically increase depending on the max height of the screen. I'm aligning the layout containing the buttons along the bottom of edge of the screen, and I would like the rest of the screen taken up by the above ImageView.</p><p>Also, since the ImageView contains a centered image, I would also like to set min height, and a scrollbar if the screen is too small to display the imageview and the buttons below.</p><p>Thanks!</p><p>Is this possible?</p>","350237","","","","","2010-05-25 20:35:57","How can I specify a dynamic height for an ImageView?","<android><android-layout>","2","1","1","",""
"2908465","1","","","2010-05-25 20:56:56","1","318","<p>i have problems with this, recently i have also problem with just taking 1 photo...do you know how to solve it? any working code?</p><p>i'm doing it like that:</p><pre><code>            mCamera = Camera.open();    Log.e(TAG, ""onCreate"");    mCamera.takePicture(null, mPictureCallback, mPictureCallback);            Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {    public void onPictureTaken(byte[] imageData, Camera c)     {        if (imageData != null) {            //process photo        }                       }};</code></pre><p>in onDestroy() i release the camera</p><p>on simulator it works, on telephone - 1st time runs without problems but no picture, second and next times - 'force close' - looks like camera is not released ...</p>","325943","","","","","2010-05-25 20:56:56","how to get series of pictures?","<android><camera><image>","0","3","0","",""
"2908502","1","","","2010-05-25 21:01:08","0","642","<p>I have extended an ArrayAdapter to manage a ListView using a certain tamplate (made of 1 ImageView and 1 TextView contained in a RelativeLayout) as row of the list.</p><p>Anyway I am now facing some optimization issues. As you guys know, not all the rows are rendered at any 1 time but rather you get the rows progressively rendered when the user scrolls the list and they actually appear on the screen. Basically my problme is this:</p><p>when the list is scrolled really rapidly, the rendering engine cannot keep up with the speed and, although the images to display are cached, the placement of the images in the ImageViews of the visible rows take some time. </p><p>To be honest I was expecting the getView method to be really fast but apparently when it comes to images there are some tricks to know. Any1 wanna share ??</p><p>cheers ;)   </p>","87624","","","","","2010-07-02 01:51:41","ListView and images displaced in the getView method","<android>","1","3","","",""
"2908530","1","2908552","","2010-05-25 21:05:30","13","30768","<p>I would like to use Android phones as a way to do some processing and visualization of a sensor that would be attached to the USB port on the phone. The sensor would plug into the micro/mini USB, and then I would need to read the incoming data from the USB serial port.</p><p>Is this possible?  I have heard of people using Android to steer robots and other applications, but I have never seen Android being used as a host for a USB sensor. I can't seem to find any official documentation on the subject either, but it seems like it would be a very useful tool. Any thoughts, links, or information on this matter?  Thanks.</p>","234933","","","","","2014-02-07 19:37:56","External USB devices to Android phones?","<android><usb><external>","6","2","9","",""
"2908774","1","","","2010-05-25 21:47:08","0","4954","<p>I have made a simple punch in / punch out time clock application. I want to add the user the option of making a shortcut on the homescreen that will toggle the state of the app(time out / time in) but I don't want this shortcut to open up the app on the screen at all. </p><p>here is my setupShortcut()</p><pre><code>private void setupShortcut() {    Intent shortcutIntent = new Intent(this, Toggle.class);   // shortcutIntent.setClassName(this, Toggle.class.getName());      shortcutIntent.putExtra(EXTRA_KEY, ""ToggleShortcut"");      shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);      Intent intent = new Intent();    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);     intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, ""ToggleShortcut"");    Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this,  R.drawable.app_sample_code);    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);    setResult(RESULT_OK, intent);}</code></pre><p>Toggle.class is an activity that toggles the state for me. In the manifest I have these settings on it</p><pre><code>&lt;activity android:name="".Toggle"" android:exported=""true"" android:theme=""@android:style/Theme.Translucent.NoTitleBar""&gt;</code></pre><p>As it is now I can create a shortcut on the home screen then press it. The first time I press it it starts the Toggle activity and completes it fine, but it also opens up the TimeClock activity on the screen. If I then hit the back button I go back to the home. I can now press this shortcut and it will start the Toggle activity and not change the screen. Before I added: shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);  It would open up the TimeClock activity every time. Now it is just the first time. But I want it to never show anything on the screen when the Toggle shortcut is pressed. Does anyone have any idea of how to get rid of that?</p>","277215","","","","","2011-09-08 08:58:58","Android Launcher Shortcuts","<android><shortcut><homescreen><launcher>","2","0","1","",""
"2909080","1","2909114","","2010-05-25 22:50:16","3","18157","<p>I have a website that is using the viewport META tag to tell mobile browsers how to display content (  ).  Viewing the page in the Android browser looks correct (and iPhone, etc).</p><p>When I load the page into a WebView component in an android Application, the WebView ignores the ""VIEWPORT"" tag, and renders the page at ""full"" resolution, which is zoomed-in in this case.   </p>","350406","","","","","2013-08-19 12:44:04","Android WebView seems to ignore ""viewport"" information on web pages","<android><html5><webview>","7","0","4","",""
"2909205","1","","","2010-05-25 23:20:28","2","1323","<p>My app polls a server every 15 seconds to see if there are any new items to display, then downloads the new items and disposes of the old items so that there are always exactly 100 items in the GridView. Unfortunately, this process can be confusing to the user if they see a page of images change without knowing where the items went.</p><p>My idea is that there could be some kind of animation (such as the new items being inserted at the top and pushing the older ones down the list) to show what action is happening. Unfortunately, I have no clue how to make this animation happen.</p><p>Is my idea even possible? How would I accomplish this?</p>","347947","","244296","","2010-05-25 23:30:01","2011-05-07 09:08:21","Any way to animate new elements in a GridView being added?","<android>","2","0","1","",""
"2909247","1","","","2010-05-25 23:33:40","2","2095","<p>I am trying to figure out what is the correct (new) approach for handling the Intent.ACTION_MEDIA_BUTTON in Froyo. In pre 2.2 days we had to register a BroadcastReceiver (either permanently or at run-time) and the Media Button events would arrive, as long as no other application intercepts them and aborts the broadcast.</p><p>Froyo seems to still somewhat support that model (at least for the wired headset), but it also introduces the registerMediaButtonEventReceiver, and unregisterMediaButtonEventReceiver  methods that seem to control the ""transport focus"" between applications.</p><p>During my experiments, using registerMediaButtonEventReceiver does cause both the bluetooth and the wired headset button presses to be routed to the application's broadcast receiver (the app gets the ""transport focus""), but it looks like any change in the audio routing (for example  unplugging the headset) shits the focus back to the default media player.</p><p>What is the logic behind the implementation in Android 2.2? What is correct way to handle transport controls? Do we have to detect the change in the audio routing and try to re-gain the focus? </p><p>This is an issue that any 3rd party media player on the Android platform has to deal with, so I hope that somebody (probably a Google Engineer) can provide some guidelines that we can all follow. Having a standard approach may make headset button controls a bit more predictable for the end users. </p><p>Stefan</p>","270678","","","","","2011-09-14 06:46:15","Any guidelines for handling the Headset and Bluetooth AVRC transport controls in Android 2.2","<android><headset>","3","0","2","",""
"2909249","1","2910995","","2010-05-25 23:33:47","13","12243","<p>Default spinners on the iPhone look a lot better than on Android.  It looks like at least one Android app (UrbanSpoon) has been able to replicate this control, and it's awesome: <a href=""http://www.urbanspoon.com/android"" rel=""nofollow"">http://www.urbanspoon.com/android</a></p><p>Anyone have any ideas on how to create this?  Code would be helpful.</p>","10505","","10505","","2013-10-07 23:53:03","2013-10-07 23:53:03","How can we create iPhone-like spinners in android?","<android><user-interface><spinner>","2","3","11","",""
"2909280","1","2909460","","2010-05-25 23:42:02","3","1398","<p>What is the simplest way to fetch an image from a url in an android program?</p>","231463","","","","","2010-06-09 13:31:02","Android image fetching","<android>","2","0","3","",""
"2909311","1","","","2010-05-25 23:51:01","77","43520","<p>I have a list of records in a listview that I want the user to be able to re-sort using a drag and drop method.  I have seen this implemented in other apps, but I have not found a tutorial for it.  It must be something that others need as well.  Can anyone point me to some code for doing this?</p>","158757","","","","","2013-11-02 15:52:36","Android List View Drag and Drop sort","<android><listview>","3","4","56","",""
"2909314","1","3034994","","2010-05-25 23:51:59","3","616","<p>Most of the questions on SO has been too generic, comparing iPhone, Android and Blackberry all at once. I want to ask your experience between developing on Android and Blackberry.</p><p>From your experience as Java programmer:</p><ul><li>Which platform do you enjoy developing on the most? </li><li>Which API do you find is well written and fun to code? </li><li>Which development platform that is fun to work with? </li><li>Which platform do you find most stable and less issues with? </li></ul><p>Android or Blackberry? Any other noteworthy checklists to share to Java programmers that want to choose whether to develop on Android or Blackberry?</p><p>Thank you for sharing your experience with us here.</p>","141186","","","","","2010-06-14 04:45:31","Java mobile: Android or Blackberry?","<java><android><blackberry>","1","6","2","2012-08-08 15:12:42",""
"2909336","1","2909466","","2010-05-25 23:58:35","2","453","<p>I am creating a widget that you can assign a contact to onClick. I used the method that is described <a href=""http://stackoverflow.com/questions/866769/how-to-call-android-contacts-list"">here</a>. This works great on standard Android phones such as the Motorola Droid, HTC Nexus One and HTC G1. The problem is for users who are using devices such as the HTC Incredible or HTC Droid Eris (Both running Sense UI) and I imagine on other phones who's OS deviates from the vanilla flavor of Android.</p><p>Using my current method I thought that the device's OS would hook into whatever that manufacture chose to use for their Contact system however users are being sent to a random list of numbers, not their Contact list. Does anyone have a suggestion on how to get those Contacts or is this just another example of the Android fragmentation issue? Any help or insight is greatly appreciated. </p>","317862","","","","","2010-09-30 06:36:21","Call Contact list on non-standard Android phones","<android>","1","0","","",""
"2909424","1","","","2010-05-26 00:22:24","17","13995","<p>I want to limit my text view to have maximum of 5 lines, so I did:</p><pre><code>&lt;TextView    android:id=""@+id/text""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""      android:maxLines=""5"" /&gt;</code></pre><p>But when I try to configure it to add '...' when the text is truncated, I add android:ellipsize=""end"".  I do see the ... but then my TextView only has a max line of 2, instead of 5.</p><p>Can you please suggest how can I make the text view of maximum line of 5 and add '...' when it get truncated?</p><p>Thank you.</p>","286802","","885306","","2014-03-21 02:57:51","2014-03-21 02:57:51","How to set maxLines and ellipsize of a TextView at the same time","<android>","4","3","10","",""
"2909551","1","2909700","","2010-05-26 00:58:26","2","5363","<p>I've been looking at using a WebView to display an HTML5 webpage, where the novel features of the mobile device (GPS, compass, accelerometer, camera, etc) can be fed back into the web page.</p><p>I was wondering if there were any good tutorials showing these functions interacting with the webview.</p><p>So far I've found ways for the WebView to send javascript commands to the web page, but those interactions haven't been triggered from outside the web view (such as upon receiving an intent from the GPS or accelerometer).</p><p>Note: The HTML5 Geolocation API is not what I'm interested in.  I'm interested in the web page &lt;-> WebView interactions, as noted here: <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>","231768","","1228","","2013-08-15 14:45:25","2013-08-15 14:45:25","Android interacting with HTML5 tutorial?","<android><html5>","1","0","3","",""
"2909638","1","2911447","","2010-05-26 01:28:59","2","291","<p>In the contacts app, from 2.0+ , in the list you can see a border around each contact image.</p><p>(look at the image)<a href=""http://thetech24.com/wp-content/uploads/2009/10/Google-Android-2_0_thetech24.com.jpg"" rel=""nofollow"">http://thetech24.com/wp-content/uploads/2009/10/Google-Android-2_0_thetech24.com.jpg</a></p><p>I have looked around the source code for the contacts app ( [http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=summary][1] ) but coundnt find it.</p><p>Thanks</p><pre><code>[1]: http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=summary</code></pre>","332432","","","","","2010-05-26 08:57:52","android - looking for image that goes around a contact in the contacts aplication","<android><image>","1","0","","",""
"2909682","1","2909707","","2010-05-26 01:43:48","0","1797","<p>Ok, so I've got an andoid phone with a bunch of icons up the top, looks like app notifications go on the left, system icons go on the right.</p><p>Most of the system icons seem reasonably intuitive, service, 3g, wireless etc.</p><p>I've recently gotten a new one that looks like a phone being tilted / shaken and have absolutely no idea what it means.</p><p>Is there a reference site where I can look this thing up?</p>","77528","","","","","2010-05-26 02:02:41","How do I find out what android system icons mean?","<android><documentation><reference><user><icons>","1","0","","2010-05-26 08:50:41",""
"2909801","1","","","2010-05-26 02:31:32","2","4033","<p>I understand that SQLite stores dates as long integers. When I read rows using the standard method (i.e. using the query() method that reads data into a cursor), the result is a date string that includes the time:</p><pre><code>2010-05-25 19:52:04</code></pre><p>If I want a different format, I have to parse the string back into a date - possible, but a bit backwards. </p><p>By using a ViewBinder (as suggested in <a href=""http://stackoverflow.com/questions/2117565/displaying-dates-in-localized-format-on-android"">this question</a>), I can pretty much do anything I want, but the date is already a string at the time the overridden method executes.</p><p>The accepted answer to the above question also suggests that storing dates as longs would help avoid this problem. I don't want to do that, just in case I want to interpret my data with something else than this application. Maybe I want to expose it via a provider.</p><p>To make matters worse, a DateFormat instance obtained via </p><pre><code>android.text.format.DateFormat.getDateFormat(getApplicationContext())</code></pre><p>cannot parse such a date string that is returned by the cursor. There is actually no static method that can do that - it is a one-way transformation, apparently an oversight.</p><p>Is there a way to handle this in the database adapter instead, i.e. controlling the date format that the cursor contains, so that I don't have to change the schema, and don't have to parse the default output back into a Date type?</p><p>The answers so far suggest that I should do the output formatting in the database. I don't want to do that for multiple reasons, most notably because I cannot format dates based on the user's locale that way (not easily, that is).</p>","58880","","58880","","2010-05-26 03:33:42","2014-01-12 17:13:01","The Date type and the Android database","<database><android><sqlite><date>","3","0","","",""
"2909893","1","5168915","","2010-05-26 03:10:28","7","2380","<p>I have activities A and B. The A is the one with LAUNCHER intent-filter (i.e. the activity that is started when we click the app icon on home screen). </p><p>A launches B using <code>startActivity(new Intent(A.this, B.class))</code>.</p><p>When the user has the B activity open, and then put my application into the background, and later my application's process is killed, when the user starts my application again, B is opened instead of A.</p><p>This caused a force close in my app, because A is the activity that initializes the resources my app needs, and when B tried to access the uninitialized resources, B crashes.</p><p>Do you have any suggestions what should I do in this situation?</p>","11238","","","","","2011-03-02 14:32:17","Android: How to make launcher always open the main activity instead of child activity? (or otherwise)","<android><stack><activity><task>","2","0","5","",""
"2910098","1","2910119","","2010-05-26 04:40:59","0","1016","<p>I am working on a Android app and I have a dilemma.  I have a list of Objects.  I have to update each of these objects with a database.  I have 2 methods:</p><p><strong>Method 1:</strong>    I can loop through the Objects.  For each object I can connect to the server, update it, and then move on to the next Object, and so forth.</p><p><strong>Method 2:</strong>    I can store the Objects in a list, send the whole list to the server, update it on the server side, then return a list of updated objects.</p><p>My questions are:</p><ol><li>Which method is faster?</li><li>Which method is easier on the phone's battery?</li></ol><p>By the way, Method 1 is easier for me to code :).  Thank you.</p>","349451","","49478","","2010-05-26 04:44:52","2010-05-26 04:49:56","Best way to access database from android","<java><php><database><android>","2","0","","",""
"2910107","1","","","2010-05-26 04:43:57","4","573","<p>I have a WebView that loads HTML that contains an &lt;embed&gt;. When loading in stock android (G1, NexusOne, Ion, etc) it looks fine and can be clicked on to watch it in the YouTube app. But when loading it using either the HTC EVO or Incredible (both Sense UI phones ) the space where the  content should be is completely blank. </p><p>Try this code below... Any ideas? I'm stumped. Certainly looks like an HTC Sense bug?</p><pre><code>WebView wv = (WebView) findViewById(R.id.wv1);wv.getSettings().setJavaScriptEnabled(true);wv.getSettings().setBuiltInZoomControls(true);wv.getSettings().setPluginsEnabled(true);wv.loadData(""&lt;html&gt;&lt;body&gt;    Here is the test embed:    &lt;embed src=\""http://www.youtube.com/v/-ptYTGTNiyQ\""         type=\""application/x-shockwave-flash\"" width=\""280\""        height=\""170\""&gt;&lt;/embed&gt;&lt;/body&gt;&lt;/html&gt;"",""text/html"", ""UTF-8"");</code></pre><p>In my testing, this will run fine on all Android versions, without SenseUI, but it shows blank for what looks like any SenseUI phone, so the user can't click on it.</p>","257262","","235654","","2010-05-26 11:12:44","2011-07-15 16:50:57","<embed> in HTML loaded by Webview Broken in Sense UI","<android><webview><htcsense>","1","0","","",""
"2910292","1","2910315","","2010-05-26 05:34:06","2","2939","<p>I am trying to play video files from http urls in my app. Why is that my app plays only certain mp4 files (I tried 512k mp4 and it worked), and doesn't play some others?</p><p>Here's the snippet of my code:</p><pre><code>    mVideoView.setVideoPath(myVideoURL);    mVideoView.setMediaController(new MediaController(this));    mVideoView.seekTo(currentPosition);    mVideoView.requestFocus(); </code></pre><p>ThanksChris</p>","321927","","","","","2010-05-26 05:40:39","Android - Playing Mp4","<android><mp4><videoview>","1","1","3","",""
"2910580","1","","","2010-05-26 06:34:08","1","2118","<p>Is it Possible to Display some text say a story, in an ANDROID app which also enables the user to select some text and perform some operations on that text..</p><p>the main idea is to display some text and when the user selects some text(a word or a sentence) i need to get that text for some further operation on that text.</p><p>we cant use text view as you cant select text in textview,and we cant use editview because the user should not be able to edit the contents of the text.</p>","350592","","","","","2010-05-26 20:16:30","Select Text In Android","<android><text><selectable>","2","0","2","",""
"2910829","1","2911062","","2010-05-26 07:19:28","0","2739","<p>Hi I am new to Android. I push files to Android device emulator. Image files are in Gallery and audio files are in Music. How can I view the text file in the android device emulator.( I heard  android doesn’t come with Text Editor form stack overflow). I don’t want to open Text file I need to find if the text file is in the device or not. My file explore application list the available file in the sdcard. It lists the text file name also but in the device emulator how can I find the text file?????  </p>","314427","","","","","2012-11-26 08:23:05","How to find text file in android emulator?","<android>","2","1","1","",""
"2910894","1","2911235","","2010-05-26 07:29:12","0","166","<p>I receive updates from my GPS in this way:</p><pre><code>lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0, locationListener);</code></pre><p>In my onLocationChanged(Location loc)-method I want now to abort updating GPS data by specific criteria...</p><p>So how can I undo/disable the requestLocationUpdates(...) ?</p><p>Nice greetings,poeschlorn</p>","317301","","","","","2010-05-26 08:27:29","Manually abort GPS updating in Android","<android><gps>","1","0","","",""
"2911124","1","","","2010-05-26 08:09:25","3","854","<p>What's the best way to list all pictures in an Android device?</p><p>I'm not looking to let the user pick one (I believe there's an intent for that), I just want to list them all programmatically.</p><p>A pseudo-code example would be much appreciated.</p>","143378","","","","","2010-05-26 08:19:07","List all pictures in an Android device","<android>","0","0","","",""
"2911133","1","2916399","","2010-05-26 08:11:06","0","220","<p>Is there any possibility to give a alert dialog at the time of open a file in android.I need to ask an alert dialog if the user try to open any file from the SDCard file (or) Phone Gallery files. ???</p>","324223","","","","","2010-05-26 20:11:11","Is there any possibility to give a alert dialog at the time of open a file in android?","<android>","1","1","","",""
"2911326","1","","","2010-05-26 08:39:39","1","1107","<p>I am modifying the source code here: <a href=""http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/"" rel=""nofollow"">http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/</a></p><p>I get this error: non-static method getContentCharSet(org.apache.http.HttpEntity) cannot be referenced from a static context        String charset = getContentCharSet(entity);</p><p>This error is line 13 on the second box.</p><p>Any ideas?  I have been really struggling with this code :-(</p>","262894","","","","","2010-05-26 09:23:03","non-static method cannot be referenced from a static context","<android><httpclient>","5","0","","",""
"2911338","1","2912600","","2010-05-26 08:42:10","1","373","<p>I think my question is fairly clear, I would like to know if every kind of view can support zoom.I know that some have built in zoom controls like the <code>MapView</code> and the <code>WebView</code>, but how about a <code>LinearLayout</code> with some <code>TextView</code>s and <code>ImageView</code>s?</p><p>I will edit this post to have a list of the answers.</p>","263521","","","","","2010-05-26 11:46:27","which view/widget can support zooming in android?","<android><view><zoom>","1","0","","",""
"2911353","1","","","2010-05-26 08:43:42","0","6348","<pre><code>    ActivityManager am = (ActivityManager)this.getSystemService(this.ACTIVITY_SERVICE);  try {   clearMethod = am.getClass()     .getMethod(""clearApplicationUserData"", String.class,       IPackageDataObserver.class);  } catch (Exception e) {   Log.e(""Error"", ""Android Error"",e);   clearMethod = null;  }   if(clearMethod!=null){   try {    clearMethod.invoke(am,""com.android.browser"",new ClearUserDataObserver());   } catch (Exception e) {    Log.e(""Error"", ""Android Exception"",e);   }   }Exception 05-26 08:34:13.056: ERROR/Error(739): java.lang.reflect.InvocationTargetException05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityManager.clearApplicationUserData(ActivityManager.java:475)05-26 08:34:13.056: ERROR/Error(739):     at java.lang.reflect.Method.invokeNative(Native Method)05-26 08:34:13.056: ERROR/Error(739):     at java.lang.reflect.Method.invoke(Method.java:521)05-26 08:34:13.056: ERROR/Error(739):     at com.iwidsets.clear.manager.AndClear.onCreate(AndClear.java:34)05-26 08:34:13.056: ERROR/Error(739):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)05-26 08:34:13.056: ERROR/Error(739):     at android.os.Handler.dispatchMessage(Handler.java:99)05-26 08:34:13.056: ERROR/Error(739):     at android.os.Looper.loop(Looper.java:123)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityThread.main(ActivityThread.java:4203)05-26 08:34:13.056: ERROR/Error(739):     at java.lang.reflect.Method.invokeNative(Native Method)05-26 08:34:13.056: ERROR/Error(739):     at java.lang.reflect.Method.invoke(Method.java:521)05-26 08:34:13.056: ERROR/Error(739):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)05-26 08:34:13.056: ERROR/Error(739):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)05-26 08:34:13.056: ERROR/Error(739):     at dalvik.system.NativeStart.main(Native Method)05-26 08:34:13.056: ERROR/Error(739): Caused by: java.lang.SecurityException: 739 does not have permission:android.permission.CLEAR_APP_USER_DATA to clear datafor process:com.android.browser05-26 08:34:13.056: ERROR/Error(739):     at android.os.Parcel.readException(Parcel.java:1218)05-26 08:34:13.056: ERROR/Error(739):     at android.os.Parcel.readException(Parcel.java:1206)05-26 08:34:13.056: ERROR/Error(739):     at android.app.ActivityManagerProxy.clearApplicationUserData(ActivityManagerNative.java:2016)05-26 08:34:13.056: ERROR/Error(739):     ... 17 more</code></pre><hr><p>This is my androidManifest.xml 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.iwidsets.clear.manager""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".AndClear""                  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=""4"" /&gt;&lt;uses-permission android:name=""android.permission.CLEAR_APP_USER_DATA""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.CLEAR_APP_CACHE""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","350694","","50776","","2012-01-16 05:47:39","2012-01-16 05:47:39","android throw InvocationTargetException,How to modify the error","<android>","3","1","","",""
"2911379","1","2911421","","2010-05-26 08:47:01","5","15423","<p>Video tags like below plays fine with iPhone, but not Android:</p><pre><code>&lt;video id=""video"" width=""320"" height=""240"" poster=""video/placeholder.jpg"" autobuffer controls&gt;  &lt;source src=""pr6.mp4"" type='video/mp4; codecs=""avc1.42E01E, mp4a.40.2""'&gt;  &lt;source src=""pr6.ogv"" type='video/ogg; codecs=""theora, vorbis""'&gt;&lt;/video&gt;</code></pre><p>With the above code, Android can't even click the clip. It would just see the poster image.</p><p>Video tag like below however works with Android:</p><pre><code>&lt;video src=""vpr6.mp4"" poster=""video/placeholder.jpg"" onclick=""this.play();""/&gt;</code></pre><p>However, I still need to multiple sources capability (for Firefox ogv support…). Below code does not work (nor do they work if I stick the javascript into the source tags):</p><pre><code>&lt;video id=""video"" width=""320"" height=""240"" autobuffer controls onclick=""this.play();""&gt;  &lt;source src=""pr6.mp4"" type='video/mp4; codecs=""avc1.42E01E, mp4a.40.2""'&gt;  &lt;source src=""pr6.ogv"" type='video/ogg; codecs=""theora, vorbis""'&gt;&lt;/video&gt;</code></pre><p>With above code, the clip is clickable in Android, but still does nothing.</p><p>Can anyone help?</p>","350625","","","","","2010-12-29 02:09:31","HTML5 <video> element on Android does not play","<android><video><html5>","1","4","6","",""
"2911551","1","2912060","","2010-05-26 09:15:08","1","1504","<p>I have a listview which includes 2 textviews and 1 imageview. Now, the image in imageview will be set on certain conditions otherwise it should be left blank with no image. </p><p>The problem is the images are not coming in proper rows. Say, for eg the image should be displayed at row 3 but its displayed at row 4. And, in some cases each row will have the same image.</p><p>Has someone faced this kind of an issue? I am really clueless about the reason behind this. Can anyone point out the problem?</p><hr><pre><code>private static class VilleAdapter extends BaseAdapter {    private LayoutInflater mInflater = null;    // private Context context = null;    public VilleAdapter(Context context) {        // Cache the LayoutInflate to avoid asking for a new one each time.        mInflater = LayoutInflater.from(context);    }    /**     * 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 BabbleMainListParse.getNumOfBabbles();        return VilleMainListParse.getVilleCount();    }    /**     * 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.villerow, parent,false);            // Creates a ViewHolder and store references to the two children            // views            // we want to bind data to.            holder = new ViewHolder();            holder.txtVilleListTitle = (TextView) convertView.findViewById(R.id.txtVilleListTitle);            holder.txtVilleDescription = (TextView) convertView.findViewById(R.id.txtVilleDescription);            holder.imgvillepwd = (ImageView) convertView.findViewById(R.id.imgvillepwd);            convertView.setTag(holder);        }        else         {            // Get the ViewHolder back to get fast access to the TextView            holder = (ViewHolder) convertView.getTag();        }        // Bind the data efficiently with the holder.        holder.txtVilleListTitle.setText(VilleMainListParse.getMsgTitle(position));        if(VilleMainListParse.getMsgDesc(position).length() &gt; 30)        {            String temp = VilleMainListParse.getMsgDesc(position).substring(0, 30);            temp = temp +""....."";            holder.txtVilleDescription.setText(temp);        }        else            holder.txtVilleDescription.setText(VilleMainListParse.getMsgDesc(position));        if(!VilleMainListParse.getPwd(position).equals(""""))        {            if(VilleMainListParse.getUnlock(position))            {                holder.imgvillepwd.setBackgroundResource(R.drawable.lock);            }               else if(!VilleMainListParse.getUnlock(position))            {                holder.imgvillepwd.setBackgroundResource(R.drawable.lock_open);            }        }        return convertView;    }    static class ViewHolder    {        TextView txtVilleListTitle;        TextView txtVilleDescription;        ImageView imgvillepwd;    }}</code></pre><p>The above code is only of the Adapter. There is a login screen initially when the login button is clicked the data is loaded from the internet and then this listview is loaded with this data. This data is loaded properly initially. </p><p>Can someone let me know what is the problem with this code?</p>","261566","","1288","","2012-08-08 15:33:19","2012-08-08 15:33:19","How do I set an image in imageview inside ListView in Android?","<android><image><listview>","2","0","1","",""
"2911583","1","2929024","","2010-05-26 09:21:22","5","929","<p>I have a question on accessing already existing paired bluetooth connections...</p><p>How can a remote service detect an <b>already paired</b> connection and await a file transfer from it?</p><p>In all comments on stackoverflow, on tutorials, ebooks or on google there is always shown how to create a <b>new</b> connection using sockets and so on, but no word about accessing to an existing one.</p><p>Is it possible at all? If yes, can you also tell/show me how?At the moment I have no clue how to get started with it.</p><p>Would be great if someone can help me get started :)</p>","317301","","","","","2010-06-01 07:39:21","Android: Access to an already paired connection","<android><bluetooth>","1","0","1","",""
"2911731","1","5126887","","2010-05-26 09:41:42","7","10984","<p>In my app, I want a functionality to create calendar event. I open ""new calendar event"" activity like this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_EDIT);intent.setType(""vnd.android.cursor.item/event"");intent.putExtra(""title"", ""Some title"");intent.putExtra(""description"", ""Some description"");intent.putExtra(""beginTime"", eventStartInMillis);intent.putExtra(""endTime"", eventEndInMillis);startActivity(intent);</code></pre><p>It works perfectly on stock Android. On HTC Sense, I have only one issue - end time is not set correctly, it's always one hour after begin time. What can be the problem?</p>","243225","","","","","2011-12-15 11:44:40","Intent that opens ""new calendar event"" activity","<android><calendar><android-intent>","2","3","3","",""
"2911786","1","","","2010-05-26 09:47:59","0","1004","<p>i'm looking to show detail about sensors in an Actvity but when i put my app in to my phone i manage to view only details about the accellerometer, but the program says that i have 4 sensors: Accellerometer, Magnetic field, Orientation and Temperature.</p><p>I'm using Android 1.6 and a htc Tattoo for testing.</p><p>This is my code:<code>public class SensorInfo extends Activity {    private SensorManager mSensorManager;    TextView mTextAcc,mTextGyr,mTextLig,mTextMag,mTextOri,     mTextPre,mTextPro,mTextTem,     mSensorsTotTitle,mSensorAvailablesTitle,mTextAccTitle,mTextGyrTitle,mTextLigTitle,mTextMagTitle,mTextOriTitle,     mTextPreTitle,mTextProTitle,mTextTemTitle;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.detaillayout);     // Get the texts fields of the layout and setup to invisible        setTextViews();</p><pre><code>    // Get the SensorManager     mSensorManager= (SensorManager) getSystemService(SENSOR_SERVICE);    // List of Sensors Available    List&lt;Sensor&gt; msensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);    // Print Sensor Details    Sensor sens;    int type,i;    String text = new String("""");    // Do the list of available sensors on a String and print detail about each sensor    for (i=0;i&lt;msensorList.size();i++){        sens = msensorList.get(i);        type    = sens.getType();        text = "" - ""+getString(R.string.power)+"" ""+String.valueOf(sens.getPower())+""mA\n"";        text+= "" - ""+getString(R.string.resolution)+"" ""+String.valueOf(sens.getResolution())+""\n"";        text+= "" - ""+getString(R.string.maxrange)+"" ""+String.valueOf(sens.getMaximumRange ())+""\n"";        text+= "" - ""+getString(R.string.vendor)+"" ""+sens.getVendor()+""\n"";        text+= "" - ""+getString(R.string.version)+"" ""+String.valueOf(sens.getVersion());        switch(type) {      // Check the type of Sensor that generate the event and show is resolution        case Sensor.TYPE_ACCELEROMETER:            mTextAccTitle.setVisibility(0);            mTextAccTitle.setMaxHeight(30);            mTextAcc.setVisibility(0);            mTextAcc.setMaxHeight(100);            mTextAcc.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_GYROSCOPE:            mTextGyrTitle.setVisibility(0);            mTextGyr.setVisibility(0);            mTextGyr.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_LIGHT:            mTextLigTitle.setVisibility(0);            mTextLig.setVisibility(0);            mTextLig.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_MAGNETIC_FIELD:            mTextMagTitle.setVisibility(0);            mTextMag.setVisibility(0);            mTextMag.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_ORIENTATION:            mTextOriTitle.setVisibility(0);            mTextOri.setVisibility(0);            mTextOri.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_PRESSURE:            mTextPreTitle.setVisibility(0);            mTextPre.setVisibility(0);            mTextPre.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_PROXIMITY:            mTextProTitle.setVisibility(0);            mTextPro.setVisibility(0);            mTextPro.setText(text); // Print data of the Sensor            break;        case Sensor.TYPE_TEMPERATURE:            mTextTemTitle.setVisibility(0);            mTextTem.setVisibility(0);            mTextTem.setText(text); // Print data of the Sensor            break;        }    }}// Get the texts fields of the layout and setup to invisiblevoid setTextViews(){    mTextAccTitle       = (TextView) findViewById(R.id.sensorAccTitle);    mTextAccTitle.setVisibility(4);    mTextAccTitle.setMaxHeight(0);    mTextAcc            = (TextView) findViewById(R.id.sensorAcc);    mTextAcc.setMaxHeight(0);    mTextAcc.setVisibility(4);    mTextGyrTitle       = (TextView) findViewById(R.id.sensorGyrTitle);    mTextGyrTitle.setVisibility(4);    mTextGyrTitle.setMaxHeight(0);    mTextGyr            = (TextView) findViewById(R.id.sensorGyr);    mTextGyr.setVisibility(4);    mTextGyrTitle.setMaxHeight(0);    mTextLigTitle       = (TextView) findViewById(R.id.sensorLigTitle);    mTextLigTitle.setVisibility(4);    mTextLigTitle.setMaxHeight(0);    mTextLig            = (TextView) findViewById(R.id.sensorLig);    mTextLig.setVisibility(4);    mTextLig.setMaxHeight(0);    mTextMagTitle       = (TextView) findViewById(R.id.sensorMagTitle);    mTextMagTitle.setVisibility(4);    mTextMagTitle.setMaxHeight(0);    mTextMag            = (TextView) findViewById(R.id.sensorMag);    mTextMag.setVisibility(4);    mTextMag.setMaxHeight(0);    mTextOriTitle       = (TextView) findViewById(R.id.sensorOriTitle);    mTextOriTitle.setVisibility(4);    mTextOriTitle.setMaxHeight(0);    mTextOri            = (TextView) findViewById(R.id.sensorOri);    mTextOri.setVisibility(4);    mTextOri.setMaxHeight(0);    mTextPreTitle       = (TextView) findViewById(R.id.sensorPreTitle);    mTextPreTitle.setVisibility(4);    mTextPreTitle.setMaxHeight(0);    mTextPre            = (TextView) findViewById(R.id.sensorPre);    mTextPre.setVisibility(4);    mTextPre.setMaxHeight(0);    mTextProTitle       = (TextView) findViewById(R.id.sensorProTitle);    mTextProTitle.setVisibility(4);    mTextProTitle.setMaxHeight(0);    mTextPro            = (TextView) findViewById(R.id.sensorPro);    mTextPro.setVisibility(4);    mTextPro.setMaxHeight(0);    mTextTemTitle       = (TextView) findViewById(R.id.sensorTemTitle);    mTextTemTitle.setVisibility(4);    mTextTemTitle.setMaxHeight(0);    mTextTem            = (TextView) findViewById(R.id.sensorTem);    mTextTem.setVisibility(4);    mTextTem.setMaxHeight(0);}</code></pre><p>}</code></p><p>Tank'sValerio From Italy</p>","314554","","","","","2011-02-08 16:10:04","Problem Showing Sensors Details","<android><sensor>","1","0","1","",""
"2911809","1","","","2010-05-26 09:50:24","3","1229","<p>I need to split the Android screen into two parts and run 2 applications (app A and app B) simultaneously. App A will run on screen 1 and App B will run on screen 2. Both are visible to the users. I need to implement this thing in the Android Framework. I do not know much about the android framework and this is urgent and should be done on android 2.1Is this possible, if yes please explain the procedure to achieve this.</p><p>Thanks in advance.</p>","332158","","","","","2011-03-14 12:49:11","split the screen into two parts","<android>","1","4","1","",""
"2911925","1","2912009","","2010-05-26 10:08:46","1","904","<p>For example,</p><p>In an ActivityA there's a button to create an Intent that will start ActivityB in a new task, like this:</p><pre><code>Intent i = new Intent(this, ActivityB.class);i.setData(Uri.parse(""http://www.google.com""));long timestamp = System.currentTimeMillis();i.putExtra(""ts"", timestamp);i.addFlag(Intent.FLAG_ACTIVITY_NEW_TASK);Log.d(TAG, ""Sending: "" + timestamp);startActivity(i);</code></pre><p>Then in ActivityB's onResume() method, there's this code to check the timestamp:</p><pre><code>long timestamp = getIntent().getExtras().getLong(""ts"");Log.d(TAG, ""Receiving: "" + timestamp);</code></pre><p>Now the first time I invoke ActivityB from ActivityA I get the following logs:</p><pre><code>Sending: 120006000Receiving: 120006000</code></pre><p>Then if I left ActivityB running in the background (by pressing Home button), and start ActivityA then invoke ActivityB again, the following is printed:</p><pre><code>Sending: 120013000Receiving: 120006000</code></pre><p>It seems although ActivityB is brought to front by the new Intent. The extra field in the intent is being left behind.</p><p>Is this a bug or an intended behavior?</p>","350661","","","","","2010-05-26 10:21:41","Activity ignore intent's extra fields","<android><android-intent>","2","0","","",""
"2912054","1","2923196","","2010-05-26 10:26:09","22","33503","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">Android - How do I do a lazy load of images in ListView</a>  </p></blockquote><p>I am working on the listview with the custom adapter. I want to load the images  and text view on it. The images are load from the internet urls. I just want to show the images which are visible list item to hte user. I refered the <a href=""http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/activity/BooksAdapter.java"">Shelves opensource project example from romainguy</a>, but its to complicated to understand the code. For a beginner level, I just want to know how to handle the tag between the adapter and activity. From the <a href=""http://www.androidguys.com/2008/07/22/fancy-listviews-part-three/"">commonsware</a> <a href=""http://github.com/commonsguy/cwac-thumbnail/tree"">example</a> I can set the tag on adapter, but can't show the corresponding image at the idle state of the listview. Please help me with your ideas. Sample codes are more understandable. </p><p>Thanks.</p><p>EDIT:</p><p>The combination of <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"">Efficient</a> and <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List13.html"">Slow</a> Adapter in ApiDemos is more helpful to understand.</p><p>changes done on efficient adapter example like this:</p><pre><code>public class List14 extends ListActivity implements ListView.OnScrollListener {// private TextView mStatus;private static boolean mBusy = false;static ViewHolder holder;public 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.        // 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();        }        if (!mBusy) {            holder.icon.setImageBitmap(mIcon1);            // Null tag means the view has the correct data            holder.icon.setTag(null);        } else {            holder.icon.setImageBitmap(mIcon2);            // Non-null tag means the view still needs to load it's data            holder.icon.setTag(this);        }        holder.text.setText(DATA[position]);        // Bind the data efficiently with the holder.        // holder.text.setText(DATA[position]);        return convertView;    }    static class ViewHolder {        TextView text;        ImageView icon;    }}private Bitmap mIcon1;private Bitmap mIcon2;@Overridepublic void onCreate(Bundle savedInstanceState) {    mIcon1 = BitmapFactory.decodeResource(this.getResources(),            R.drawable.icon48x48_1);    mIcon2 = BitmapFactory.decodeResource(this.getResources(),            R.drawable.icon48x48_2);    super.onCreate(savedInstanceState);    setListAdapter(new EfficientAdapter(this));    getListView().setOnScrollListener(this);}public void onScroll(AbsListView view, int firstVisibleItem,        int visibleItemCount, int totalItemCount) {}public void onScrollStateChanged(AbsListView view, int scrollState) {    switch (scrollState) {    case OnScrollListener.SCROLL_STATE_IDLE:        mBusy = false;        int first = view.getFirstVisiblePosition();        int count = view.getChildCount();        for (int i = 0; i &lt; count; i++) {            holder.icon = (ImageView) view.getChildAt(i).findViewById(                    R.id.icon);            if (holder.icon.getTag() != null) {                holder.icon.setImageBitmap(mIcon1);                holder.icon.setTag(null);            }         }        // mStatus.setText(""Idle"");        break;    case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:        mBusy = true;        // mStatus.setText(""Touch scroll"");        break;    case OnScrollListener.SCROLL_STATE_FLING:        mBusy = true;        // mStatus.setText(""Fling"");        break;    }}private static final String[] DATA = { ""Abbaye de Belloc"",        ""Abbaye du Mont des Cats"", ""Abertam"", ""Abondance"", ""Ackawi"",        ""Acorn"", ""Adelost"", ""Affidelice au Chablis"", ""Afuega'l Pitu""};}</code></pre><p>It works fine now. But when the scrolling state its not reloading the image properly. some interval of items not shows the images2. that is the correct order of the images are loading. But not in all items of list. Mismatches happening between solid item intervals. how to correct it?</p>","267269","","47680","","2011-07-18 20:36:13","2012-07-18 00:14:37","Lazy Load images on Listview in android(Beginner Level)?","<android><listview><android-lazyadapter><android-lazyloading>","5","0","22","2012-07-02 23:55:51",""
"2912082","1","3158271","","2010-05-26 10:31:03","7","2722","<p>I have implemented Section Indexer for an Adapter class which extends BaseAdapter.Now for the first launch Section Indexer is showing an overlay correctly. But when the contents of the list gets updated the Section Overlay does not get updated and gives ArrayOutOfBoundException. For one fix what i did is i made listview.setFastScrollEnabled(false); update the adapter contents; and then listview.setFastScrollEnabled(true);Now what happens is overlay gets updated but the Overlay is coming to the left top of the listview. How can I fix this.</p>","348686","","","","","2012-02-08 13:12:01","Section Indexer Overlay is not updating as the adapter's data changes","<android>","4","2","3","",""
"2912208","1","2912352","","2010-05-26 10:51:01","2","440","<p>I have a longer sentence >200 characters. I need to show on the screen having parts of them in different color, like highlighting search results, each with different color. The text should auto wrap with screen width, and have no break sections between parts. I meant with this that I can put sections on a new line. They will have to continue the previous section, only wrap when the screen is off.</p><p>The best would be an EditText, as I need to allow editing also, but I am wondering I am able to change the color of various sentence parts, or just as a whole. </p><p>What do you think, with what UI elements can I achieve this view?</p>","243782","","243782","","2010-05-26 10:58:29","2010-05-26 13:50:30","What options I have to show a sentence parts with different color?","<android>","2","0","1","",""
"2912209","1","2912503","","2010-05-26 10:51:19","1","4295","<p>I am new to android. I need to create an auto startup application. That application will control the files( if we open a image file from Gallery (or) mail attachments, on that time our application give a alert dialog to the user). Please guide to how to create an auto startup application to control all the file format in the android emulator.</p>","324223","","","","","2010-05-26 13:37:00","how to create startup application in android?","<android>","3","2","3","",""
"2912212","1","2965631","","2010-05-26 10:51:39","-1","365","<p>I got all excited with the leaked froyo update.zip that hit the net a few days ago, and installed it on my phone.  Since then I've had many issues, the big one being ADB not discovering my phone.  I'd like to revert my phone back, but can't find a signed update.zip on the nets that will do it.</p><p>Does anyone know how I can revert my N1 from FRF50, back to ERE27?  My phone is not rooted.</p>","350811","","995926","Roger Pate","2012-05-05 13:31:54","2012-05-05 13:31:54","How do I revert from FRF50 back to ERE27?","<android><android-2.2-froyo>","1","4","","2010-06-08 09:46:06",""
"2912313","1","2912408","","2010-05-26 11:09:02","2","614","<p>I'm currently using a Timer and TimerTask to perform some work every 30 seconds.</p><p>My problem is that after each time I do this work I want to increment the interval time of the Timer.</p><p>So for example it starts off with 30 seconds between the timer firing but I want to add 10 seconds to the interval then so that the next time the Timer takes 40 seconds before it fires.</p><p>Here is my previous code:</p><hr><pre><code>  public void StartScanning() {    scanTask = new TimerTask() {        public void run() {                handler.post(new Runnable() {                        public void run() {                            wifiManager.startScan();                            scanCount++;                                        if(SCAN_INTERVAL_TIME &lt;= SCAN_MAX_INTERVAL){                                SCAN_INTERVAL_TIME = SCAN_INTERVAL_TIME + SCAN_INCREASE_INTERVAL;                                t.schedule(scanTask, 0, SCAN_INTERVAL_TIME);                            }                        }               });        }};        Log.d(""SCAN_INTERVAL_TIME ** "", ""SCAN_INTERVAL_TIME ** = "" + SCAN_INTERVAL_TIME);        t.schedule(scanTask, 0, SCAN_INTERVAL_TIME);}</code></pre><hr><p>REFACTORED CODE</p><hr><pre><code>@Overridepublic void StartScanning() {        t.schedule(new ScanTask(),SCAN_INTERVAL_TIME);}class ScanTask extends TimerTask{    @Override    public void run() {        wifiManager.startScan();        scanCount++;           if(SCAN_INTERVAL_TIME &lt; SCAN_MAX_INTERVAL)        SCAN_INTERVAL_TIME = SCAN_INTERVAL_TIME + SCAN_INCREASE_INTERVAL;        t.schedule(new ScanTask(), SCAN_INTERVAL_TIME);    }}</code></pre><p>It works now but is creating a new ScanTask() every time wasteful?</p>","243999","","243999","","2010-05-26 12:51:38","2010-05-26 12:51:38","Incremental Timer","<java><android><timer><increment>","1","0","2","",""
"2912320","1","","","2010-05-26 11:10:32","9","32241","<p>Using Android Shapes in xml I have defined a gradient which I use as the background for a button.</p><p>This all works nice, but there's no edge surrounding the button. I would like it to look similar to the normal Android button but I need more flexibility to control the color and look.</p><p>The shape is defined 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=""#FFFFFF""         android:endColor=""#00FF00""        android:angle=""270"" /&gt;    &lt;corners android:radius=""3dp"" /&gt;    &lt;stroke android:width=""5px"" color=""#000000"" /&gt;&lt;/shape&gt;</code></pre><p>I would expect the border to be set in the xml. Why doesn't ""stroke"" fix it? Stroke doesn't seem to do anything.I checked the Android Developer spec, but couldn't find the answer there:<a href=""http://developer.android.com/guide/topics/resources/drawable-resource.html"">http://developer.android.com/guide/topics/resources/drawable-resource.html</a></p><p>I have also looked through all the properties of the Android Button, but as expected there's no such parameter, probably since it's built into the normal Android button. Btw, I checked ImageButton properties too.</p><p>Can someone please help?I know there's the alternative to make an image with proper edges and use an ImageButton, but there really should be a way to fix this programmatically.</p><p>Thanks!Anna</p>","350823","","235654","","2010-05-26 11:25:28","2012-10-20 01:38:12","Custom Buttons in Android: How to get border/edge/frame when I read the background from xml?","<android>","5","2","4","",""
"2912356","1","2912450","","2010-05-26 11:16:34","0","172","<p>I need to knowingly isolate each row of the vCard and get its value.</p><p>For instance, I want to get ""5555"" from X-CUSTOMFIELD.</p><p>So far, my thoughts are:</p><p><code>""X-CUSTOMFIELD;\\d+""</code></p><p>I have been looking at some tutorials and I am a little confused with what function to use?  What would my regex above return?  Would it give me the whole line or just the numerical part (5555)?</p><p>I was thinking I i get the whole row, I can use substring to get the digits?</p><pre><code>BEGIN:VCARDVERSION:2.1N:Last;First;FN:First LastTEL;HOME;VOICE:111111TEL;MOBILE;VOICE:222222X-CUSTOMFIELD;5555END:VCARD</code></pre>","350830","","20938","","2010-05-26 12:26:55","2010-05-26 12:26:55","Getting specific values with regex","<java><android><regex>","5","1","","",""
"2912375","1","2912622","","2010-05-26 11:19:32","7","11737","<p>Is there a way I can specify an input mask to the EditText control in Android?</p><p>I want be able to specify something like ### - ## - #### for a Social Security Number. This will cause any invalid input to be rejected automatically (example, I type alphabetical characters instead of numeric digits).</p><p>I realize that I can add an OnKeyListener and manually check for validity. But this is tedious and I will have to handle various edge cases.</p><p>Buzzy</p>","38070","","","","","2013-07-22 12:46:02","Masked Input Using EditText Widget in Android","<android><mask><edittext>","3","2","1","",""
"2912609","1","2925892","","2010-05-26 11:47:42","16","10489","<p><strong>Re-worded question</strong>: When using a custom thumb drawable with a <code>SeekBar</code> view, the thumb drawable is clipped at the left and right edges of the view.</p><p>hi created a custom music player.But when i play the song the player head appears cut off at both sides.I haven't written any code to modify its default positon.Have no idea how to do.</p><p><a href=""http://www.freeimagehosting.net/image.php?eb2dc1e342.jpg"">http://www.freeimagehosting.net/image.php?eb2dc1e342.jpg</a></p>","286831","","515455","","2012-05-30 08:36:17","2013-01-14 18:08:12","Android SeekBar thumb gets clipped/cut off","<android><seekbar><thumb>","4","0","7","",""
"2912848","1","","","2010-05-26 12:23:15","0","617","<p>I have an image and text files in the (SDCard) android emulator. Emulator shows the image files in the gallery. How and where can we view the available text file in the android emulator? </p>","349664","","","","","2010-05-26 12:40:52","How to view the available text file in the sdcard in android?","<android>","1","0","","",""
"2912887","1","2914978","","2010-05-26 12:29:14","1","1162","<p>I have recently updated my Android SDK to include support for Android 2.2 (API level 8). The app that I'm building integrates with the Quick Search Box (QSB) home screen widget, which I can't seem to find in this version (using both vanilla 2.2 and the Google APIs version). I was kind of excited when they announced that they have improved its functionality, but it seems there's no way for me to observe it.</p><p>Is this normal? Are others experiencing the same issue? Or is this somehow related to my setup (running Archlinux and installed the Android SDK from the repositories).</p>","180784","","","","","2010-05-26 16:38:39","Android 2.2 AVD: no Quick Search Box?","<android><android-emulator><android-2.2-froyo>","2","2","","",""
"2912897","1","","","2010-05-26 12:30:22","9","7742","<p>I am building an Android hello world application in Netbeans. It's building properly and I am able to run in the emulator also. </p><p>But when creating and running the Junit test I get a <code>java.lang.NoClassDefFoundError</code>.</p><p>How can I fix this problem?</p>","350900","","157882","","2010-05-26 13:04:01","2013-07-03 16:24:22","java.lang.NoClassDefFoundError while running JUnit test in Netbeans","<java><android><junit>","5","1","","",""
"2913413","1","","","2010-05-26 13:34:16","0","927","<p>I have been struggling quite a lot with our beloved MediaPlayer class...Specifically I want to simply play sounds from some Files... I am getting two specific types of errors actually, and not continuesly but it seems like random... Sometimes 10 files are played rigth away with no errors, then the MediPlayer seems to stop accepting another File...Ok the  first error :</p><pre><code>- 05-26 15:02:00.916: ERROR/MediaPlayer(25793): error (1, -4)- 05-26 15:02:00.916: ERROR/setupplayer(25793): java.io.IOException: Prepare failed.: status=0x1</code></pre><p>Well for this one I have seen several solutions :use </p><pre><code>mp.setDataSource(ins.getFD()); (with ins being an inputstream to my File)</code></pre><p>and/or to use</p><pre><code>mp.setDataSource(ins.getFD(), 0, f.length());</code></pre><p>Both unfortunately won't solve the problem, and I would simply LOVE to know what the very exhaustive error(1,-4) is... And where can I find the codes of the States of the MediaPlayer ?Also I have tried using prepareAsync() instead of prepare() but to be honest it doesn't seem to make any difference at all..The second error is the Exception which is thrown :</p><pre><code>05-26 15:17:30.456: ERROR/playNextPlayer(27303): Error caught : java.lang.IllegalStateException</code></pre><p>Which, I guess, might be related to the first error/problem ?</p>","162147","","","","","2011-12-09 16:57:30","Regarding IllegalStateExceptions, MediaPlayer, failed prepares and State codes","<android><media-player><ioexception>","1","3","","",""
"2913511","1","","","2010-05-26 13:46:26","2","1425","<p>I've heard about web scraping software that can take data from a webpage. i'm building an android app and I want to take information from this site www.menupages.ie</p><p>All I need is the names of the restaurants, and typing them in myself would be very tedious. </p><p>Can someone tell me how i'd go about doing this in eclipse, what methods i need etc. I dont know anything about it.</p><p>Thanks alot.</p>","314610","","","","","2012-07-24 19:53:11","Web scraping advice/help with java for android app!","<android><web-scraping>","1","1","","",""
"2913540","1","2913638","","2010-05-26 13:50:34","0","772","<p>How would i remove the focus from an activity which has just being installed/started, </p><p>so the user's focus will remine on the previouse one? (while the new activity remine in the stack and will work in the background)</p><p>the prob is that when i start this new background activity, until i wont press back or home, the ui is stuck. and i would like to fix that some how</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-05-26 20:31:28","2010-05-26 20:31:28","Remove focus from the current activity","<android>","1","0","","",""
"2913719","1","","","2010-05-26 14:13:59","0","520","<p>I'm getting the following error whenever I try to run a test.  I have also tried to load some of the samples and test them, but I get the same error.</p><p>This is generated following the tutorials found <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">here</a></p><p>Thanks for any help</p><pre><code>java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=ca.imt.helloandroid.HelloAndroid/ca.imt.helloandroid.HelloAndroid }at android.app.Instrumentation.startActivitySync(Instrumentation.java:371)at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:120)at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:98)at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)at ca.imt.helloandroid.test.HelloAndroidTest.setUp(HelloAndroidTest.java:24)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>","350989","","","","","2010-10-04 14:08:02","Error running helloworldtest from the tutorial","<android><testing><activity><android-intent><resolve>","2","0","","",""
"2913943","1","","","2010-05-26 14:39:06","0","521","<p>Can I temporarily disable automatic orientation changes in my Activity? I want to do this when my app does some background internet communication.</p>","243225","","","","","2010-05-26 14:47:18","Can I temporarily disable automatic orientation changes in my Activity?","<android>","1","0","","",""
"2914009","1","","","2010-05-26 14:46:05","1","514","<p>It seems that android Menu doesn't work on SurfaceView.  Menu cannotrender when the view is the SurfaceView.</p><p>Anybody have the same problems ?</p><p>Thank you~~</p>","346955","","","","","2010-11-13 19:03:14","SurfaceView and Menu created","<android><android-widget>","1","0","","",""
"2914073","1","2921033","","2010-05-26 14:55:34","0","2366","<p>I've created a custom listview which looks the twitter timeline and contains posts. The following function gets a list of posts from server, parses them and adds them to the list used to populate the listview.</p><pre><code>public void populateTimeline(){        Thread populate = new Thread(){            public void run(){                Looper.prepare();                InputStream data = getData(serviceURL);  //gets a jsonarray of posts from server  $ post_list                if(data!= null)                    try {                            String jsonString = responsetoString(data);                            Log.d(TAG, jsonString);                            PostList list = getPostList(jsonString);                            List &lt;PostContainer&gt; post_list = list.getPostContainterList();                             PostContainer pc;                            for (int i = 0; i &lt; post_list.size(); i++) {                                            pc = post_list.get(i);                                mObjectList.add(pc.getPost()); //Adding each post to the list                                Log.d(TAG, pc.post.username);                                Log.d(TAG, pc.post.message);                            }                    } catch (Exception e) {                        Log.d(TAG, ""Exception"" + e.getMessage());                        e.printStackTrace();                    }                Looper.loop();                          }        };        populate.start();    }</code></pre><p>After calling this function, the list adapter was notified of change in data set by calling</p><pre><code>adapter.notifyDataSetChanged();</code></pre><p>in the main thread. But the listview doesn't updated. For trail purpose I added a button on top of list view andcalled the populateTimeline() again and then notifyDataSetChanged() when the button was clicked. Surprisingly all the posts pop up in the ListView this time.</p><p>What should be done so as to update the listview without the button click?</p>","323404","","323404","","2010-05-26 15:27:05","2010-05-27 12:31:24","ListView not getting updated on calling notifyDataSetChanged()","<android><listview>","2","0","1","",""
"2914105","1","2914769","","2010-05-26 14:58:58","32","53111","<p>I was trying to change my default/main/startup (whatever you call it) activity by editing the <code>androidmanifest.xml</code> file. All i did was change the <code>android:name</code> property. however, this completely broke the entire app. when i try to install it fails and reads</p><blockquote>  <p>Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES</p></blockquote><p>when i tried to change it back to its previous state, it was still giving me the same error... what have i done!?!?!</p>","339428","","1860929","","2014-02-28 21:06:52","2014-02-28 21:06:52","android: what is INSTALL_PARSE_FAILED_NO_CERTIFICATES error?","<android><installation>","9","0","11","",""
"2914151","1","2914275","","2010-05-26 15:05:16","2","2049","<p>Has anyone used DTLS on Android or is there an open source Java implementation that supports DTLS? </p><p>What are my other options for securing UDP traffic on Android? </p>","306346","","213269","","2012-02-05 19:51:01","2013-11-08 17:18:57","Datagram Transport Layer Security (DTLS) on Android/Java","<java><android><udp><datagram><dtls>","2","0","3","",""
"2914159","1","2914191","","2010-05-26 15:05:52","1","827","<p>Is it the SensorManager API that i have to use to measure steps? Any sample code or tutorial?</p>","2355649","","","","","2010-12-20 17:46:57","How can i measure steps while walking or jogging with Android?","<android>","1","0","","",""
"2914188","1","2914416","","2010-05-26 15:09:12","2","6880","<p>I've been contemplating (re)building an app on iPad for some time, where I would use objective-C and <a href=""http://dsmi.tobw.net/"" rel=""nofollow"">DSMI</a> to send MIDI signals to a host computer. This is not bad (I mean, except for actually writing the app).</p><p>Now I'm contemplating perhaps developing the app for Android tablets (TBA). </p><p><strong>In Java, what options are available for MIDI message communication?</strong> I'm quite familiar with javax.sound.midi, but then I would need a virtual MIDI port to send messages to the host.</p><p>On the other hand, <strong>if the app were done in Adobe AIR, what options would I have available</strong> for communicating with MIDI?</p><p>Obviously another option is to send/receive messages over a TCP/IP socket to a Java host, and talk that way, but it sounds a tad cumbersome... or perhaps not? DSMI does use a host program, after all.</p>","8047","","8047","","2010-05-26 15:24:24","2012-05-16 07:59:40","MIDI on Android: Java and/or AIR libraries","<android><midi>","1","0","3","",""
"2914371","1","2914757","","2010-05-26 15:28:03","7","486","<p>I have a project that is just using Android 1.5 for programming, but with the proliferation of other handsets and some cool features in Android 2.2, we'd like to support the features without losing support for 1.5 or forking a new code base. Is it possible to do with Android SDK?</p><p>I do have some sense of the ""ugly"" way to do it, as in keeping the same code base but have a build system that builds different versions for the platforms and keep different Java files around that get added in our out of the build based on which version is selected. I'm hoping someone else has solved the problem based on the many versions of apps in the market that run on multiple Android versions.</p>","18501","","","","","2010-05-26 16:12:16","Is there a way to use features in Android 2.1/2.2 while keeping a minSDK version to 3?","<android>","1","1","3","","2010-05-26 15:28:03"
"2914388","1","2925926","","2010-05-26 15:29:06","2","6827","<p>The error ""error parsing XML: unbound prefix"" shows up on my main layout: main.xml when I first open Eclipse. To make the error go away, all I  have to do is make a modification to the file, then undo it, then hit save (have to make a change in order to be able to save file and thus trigger the new syntax check). </p><p>My environment is: </p><pre><code>Fedora Eclipse PlatformVersion: 3.4.2Based on build id:  20090211-1700</code></pre><p>My target is Android API level 5. </p><p>The first time I saw the error I spent a long time trying to track down ""the problem"" but later realized there isn't really a problem, it's just a phantom error. </p><p>Screenshot: <a href=""http://i50.tinypic.com/2i89iee.jpg"" rel=""nofollow"">http://i50.tinypic.com/2i89iee.jpg</a></p><p>Who should I report this to? </p>","268803","","102703","","2010-05-28 00:22:00","2012-11-14 07:29:28","phantom error ""error parsing XML: unbound prefix""","<xml><android><eclipse><syntax>","4","1","","",""
"2914424","1","2917115","","2010-05-26 15:32:51","1","1158","<p>I'm wondering how fast I can take pictures one after another withoud surprises from the phone (like fx: 'force close;)</p><p>Does any of you know that time? </p><p>I know that 500 milisec is safe time. When i experiment with 100, 200, 300 milisec there is error but who knows, maybe i do sth wrong.</p>","325943","","","","","2010-09-07 23:53:18","How big is interval between taking pictures in Android phone?","<android><camera><frequency><photos>","3","0","2","",""
"2914446","1","2926969","","2010-05-26 15:35:02","0","490","<p>I was wondering is it possible to get a notification of when a new configured network is added to the WifiManager in Android?</p><p>I know you can get the current list of configured networks</p><p><a href=""http://developer.android.com/intl/de/reference/android/net/wifi/WifiManager.html#getConfiguredNetworks%28%29"" rel=""nofollow"">getConfiguredNetworks</a></p><p>But is it possible to get notification of when a new one is added?</p><p>I dont see anything in the WifiManager that would be helpful.</p><p>Has anyone any other ideas? Or insight into how this could be achieved?</p>","243999","","","","","2010-06-02 05:29:25","Android - Get Notified when a new access point is added?","<android><wifi><notifications><wifimanager>","2","0","","",""
"2914506","1","","","2010-05-26 15:42:24","0","1678","<p>I am attempting to follow the Google Map View under the views tutorial for the Android.  I have followed step by step but still only see grey blocks when viewed.</p><p><strong>First:</strong> I created a Virtual Device using ""Google API's(Google Inc.) Platform 2.2 API Level 8""<strong>Second:</strong> When creating my project I selected ""Google API's Google Inc. Platform 2.2 API Level 8"".<strong>Third:</strong> I obtained the SDK Debug Certificate<strong>Fouth:</strong> Began Coding.<strong>Main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;com.google.android.maps.MapView xmlns: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=""0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ"" </code></pre><p>/></p><p><strong>HelloGoogleMaps.java</strong></p><pre><code>package com.example.googlemap;import android.app.Activity;import android.os.Bundle;import com.google.android.maps.MapView;import com.google.android.maps.MapActivity;public class HelloGoogleMaps extends MapActivity {@Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);}@Override protected boolean isRouteDisplayed() {     return false; }}</code></pre><p><strong>HelloGoogleMaps Manifest:</strong></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.googlemap""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;activity android:name="".HelloGoogleMaps"" 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-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;  &lt;/manifest&gt; </code></pre><p>Any thoughts??</p><p>Thanks!</p>","351099","","351099","","2010-05-26 15:48:10","2013-03-28 18:24:31","Google Map only showing Grey Blocks on load - Debug Cert has been obtained","<android><google-maps>","2","0","","",""
"2914525","1","2914847","","2010-05-26 15:44:45","10","4788","<p>Is is bad practice to pass the Context to a constructor and save it as a private variable for internal use?  The other option is to pass the Context as a parameter to methods that need it.</p><p>Which is the better option?I have a feeling that passing to the constructor might result in memory leaks accidentally.</p>","248521","","","","","2012-01-06 23:39:44","Passing Activity Context to constructors to use internally - is this bad","<android>","3","1","3","",""
"2914645","1","2915426","","2010-05-26 15:58:41","1","3225","<p>while testing, if i load a new version of my application onto my phone, the icon shown in the launcher isn't refreshed.  is there any way to tell the launcher to reload its icons?</p>","310300","","","","","2011-11-04 18:27:38","how do i tell the android launcher to reload its icons?","<android>","3","0","1","",""
"2914681","1","2915152","","2010-05-26 16:02:52","3","999","<p>In Android, how can I send a long press from an <code>InstrumentationTestCase</code>? I'd like for instance to do a <code>sendKeys(KEYCODE_DPAD_CENTER)</code> but make that a long click.</p>","35501","","","","","2010-05-26 17:03:28","How do you send a long press from an InstrumentationTestCase?","<android><unit-testing><keyevent>","1","0","1","",""
"2914741","1","2916525","","2010-05-26 16:10:21","12","32567","<p>I am trying to assign relative widths to columns in a ListView that is in a TabHost, using layout_weight as suggested <a href=""http://andmobidev.blogspot.com/2010/01/setting-width-of-view-using-percentage.html"" rel=""nofollow"">here</a>:</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;TableLayout                android:id=""@+id/triplist""               android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:paddingTop=""4px""&gt;              &lt;TableRow&gt;                 &lt;ListView android:id=""@+id/triplistview""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""/&gt;              &lt;/TableRow&gt;              &lt;TableRow&gt;                 &lt;Button android:id=""@+id/newtripbutton""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""Add Trip""/&gt;              &lt;/TableRow&gt;[other tabs ...]</code></pre><p>My row definition has 4 columns that I would like to size as follows:</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:weightSum=""1.0""   android:padding=""4px""&gt;      &lt;TextView android:id=""@+id/rowtripdate""      android:layout_weight="".2""      android:layout_width=""0dip""      android:layout_height=""wrap_content""      android:inputType=""date""/&gt;   &lt;TextView android:id=""@+id/rowodostart""      android:layout_weight="".2""      android:layout_width=""0dip""      android:layout_height=""wrap_content""/&gt;   &lt;TextView android:id=""@+id/rowodoend""      android:layout_weight="".2""      android:layout_width=""0dip""      android:layout_height=""wrap_content""/&gt;   &lt;TextView android:id=""@+id/rowcomment""      android:layout_weight="".4""      android:layout_width=""0dip""      android:layout_height=""wrap_content""&gt;</code></pre><p></p><p>Unfortunately, it seems to want to fit all the columns into the space that the button occupies, as opposed to the width of the screen. Or maybe there is another constraint that I do not understand. I'd appreciate your help.</p><p><img src=""http://heeroz.com/layoutprob.png"" alt=""alt text""></p>","58880","","58880","","2010-05-26 16:41:50","2010-05-26 20:26:59","Android layout issue - relative widths in percent using weight","<android><layout>","2","0","6","",""
"2914881","1","2914999","","2010-05-26 16:26:13","8","5116","<p>Working with android I realized that implicit intents are good choice in most of cases due to their's flexibility. But what's about explicit intents? What are benefits of using them? What are common cases when it's a good practice to use them?</p>","218783","","","","","2013-11-09 21:44:40","Android implicit intents VS explicit intents","<android>","3","0","3","",""
"2914921","1","2916829","","2010-05-26 16:31:36","30","9828","<p>I have followed the <a href=""http://developer.android.com/reference/android/app/Service.html#LocalServiceSample"">Local Service example</a> provided by Google, but my <code>Context::bindService(...)</code> always returns false and there is <code>ServiceConnection::onServiceConnected</code> is also never called.</p><p>I understand that <code>Context::bindService()</code> returns immediately, but my <code>ServiceConnection</code> object is never triggered.</p><p>I don't know if these apply</p><ol><li>My activity is running inside a tabHost and I was wondering if that can affect service binding in any way.</li><li>The Service itself may have a problem, but I can call start service to the same service with the same <code>Intent</code> and it works as expected.</li></ol><p>Does anyone have experience with this? Please help me out.</p><p>Thanks,P.S. I am targeting Android 1.6</p>","332738","","","","","2013-12-15 16:21:25","Android Context.bindService always returns false and ServiceConnection object is never triggered","<java><android><service>","2","1","8","",""
"2915001","1","","","2010-05-26 16:42:04","2","1185","<p>I have an app which I have just updated to froyo to take advantage of the move to SD card feature. I am now trying to upload the update to the market but I keep getting the following error: ""The file is invalid: W/ResourceType( 7193): Bad string block: last string is not 0- terminated ERROR getting 'android:label' attribute: attribute is not a string value"". I changed the value in the manifest from ""android:label=""@string/app_name"" "" to ""android:label=""test"" "" and uploaded it, then it started complaining about the icon, saying that it wasn't a string. Anyone have any ideas? The application part of my manifest is shown below and I'm properly confused. The app compiles into an APK, it even installs and runs fine on my N1 (installing from SD card) it just won't upload to the market.           Any help would be greatly appreciated, I have absolutely no idea what's wrong, seems like I've tried everything I can think of including re-installing eclipse. Cheers Steve </p>","351156","","","","","2010-09-07 01:03:41","Android Market Publishing Issues","<android><manifest><google-play>","1","0","0","",""
"2915150","1","","","2010-05-26 17:03:10","11","15470","<p>I am attempting to shoehorn an existing SDK onto an android device and one of the dependencies of said SDK is Apache log4j. I am able to load my test program onto the android emulator but when the log4j object ""PropertySetter"" is called the program fails with a verification exception. Is there a way to ameliorate this issue?</p>","302125","","","","","2013-03-29 10:43:23","log4j support in Android","<android><apache><log4j><android-emulator>","6","2","7","",""
"2915325","1","","","2010-05-26 17:29:58","0","1230","<p>I have a custom view that works fine and I'm trying to get gestures into it. The most common technique I see is to add XML, such as this (from Android docs:</p><pre><code>&lt;android.gesture.GestureOverlayView  android:id=""@+id/myGestures""  android:layout_width=""fill_parent""  android:layout_height=""0dip""  android:layout_weight=""1.0""  /&gt;</code></pre><p>My view is within a RelativeView and when I attempt to reference this GetureOverlayView, I get an exception.</p><p>I've also tried to connect within my existing custom view class, like this:</p><pre><code>mGestures = new GestureOverlayView(context, attrs);mGestures.addOnGesturePerformedListener(this);</code></pre><p>But the callbacks are never invoked.</p><p>Can someone point out my errors, suggest a better way that will allow me to get gesture callbacks and/or suggest diagnostic approaches?</p>","351201","","351201","","2010-05-26 18:16:43","2010-06-20 20:31:33","How do I programmatically add an Android Gestures view to a custom view?","<android><gestures>","1","1","2","",""
"2915410","1","2915439","","2010-05-26 17:44:17","8","6613","<p>I am C++ developer interested in Android. As I understand the only possibility to develop applications for Android is Java. There is NDK also, but as I can see it is just something like JNI for Java. Is it mandatory to learn Java or to have deep knowledge in Java then try Android SDK, or it would be possible to learn Java while developing for Android. </p><p>Thank you.</p>","","MigNix","2598","","2010-05-26 17:49:16","2012-02-23 13:46:52","Is deep Java knowledge needed for Android?","<java><android><android-ndk>","10","3","2","2012-08-08 17:05:26",""
"2915865","1","2915935","","2010-05-26 18:56:58","0","1485","<p>Whenever I add an EditText widget to the layout of my home screen widget (confusing how the term ""widget"" is being used twice in the Android lexicon :-/ ), I receive the ""Problem Loading Widget"" error box.</p><p>Here is the layout I'm attempting; if you remove the EditText, it works...</p><p>&lt;</p><blockquote>  <p>RelativeLayout          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          xmlns:android=""http://schemas.android.com/apk/res/android""></p><pre><code>        &lt;Button                android:id=""@+id/button_generate""                android:layout_width=""54px""                android:layout_height=""54px""                android:text=""Generate""                android:textSize=""10sp""                android:gravity=""center""                android:layout_alignParentTop=""true""                android:layout_toRightOf=""@+id/edittext_key""&gt;        &lt;/Button&gt;           &lt;TextView                android:id=""@+id/textview_hash""                android:layout_width=""75px""                android:layout_height=""45px""                android:text=""Password""                android:textSize=""11sp""                android:gravity=""left""                android:layout_alignParentTop=""true""                android:layout_toLeftOf=""@+id/edittext_key""&gt;        &lt;/TextView&gt;        &lt;EditText                android:id=""@+id/edittext_data2""                android:layout_width=""200px""                android:layout_height=""50px""                android:textSize=""12sp""                android:layout_marginTop=""20px""                android:layout_alignParentTop=""true""                android:layout_centerHorizontal=""true""&gt;        &lt;/EditText&gt; &lt;/RelativeLayout&gt;</code></pre></blockquote><p>Now, the Google Search home screen widget has an EditText, so it's obviously legal to implement.  Any thoughts on why this is not working?</p>","351272","","","","","2010-05-26 19:06:41","Android Home Screen Widget Failing with EditText","<android>","1","2","1","",""
"2916044","1","2916242","","2010-05-26 19:19:34","0","826","<p>I'm wondering if there is any news about a ""Android Dev Phone 3""? Is an updated hardware of the ""Android Dev Phone 2"" that is coming soon? (probably an unlocked version of the Nexus One)</p>","1406","","","","","2010-07-22 10:07:21","Android Dev Phone 3?","<android>","3","1","","2012-08-08 17:31:50",""
"2916108","1","2916712","","2010-05-26 19:29:04","13","35971","<p>This was my original question:</p><blockquote>  <p>I want to be able to open a pdf file  in my app using the android's built in  pdf viewer app, but i dont know how to  start other apps. I'm sure i have to  call start activity, i just dont know  how to identify the app im opening and  how to pass the file to that specific  app.</p>    <p>Anyone have a clue?</p></blockquote><p>I just learned that the pdf viewer i have on my phone is actually made by HTC and that Adobe just barely released their android pdf viewer (which is great). So the new question is this: how do i verify that the user has installed adobe's viewer, and then how do i open the file in that app from my app?</p>","339428","","339428","","2010-05-26 20:39:46","2014-04-16 14:33:39","android: open a pdf from my app using the built in pdf viewer","<android><pdf><workflow-activity>","6","6","3","",""
"2916347","1","2916406","","2010-05-26 20:04:51","0","929","<p>Is it possible to switch from a TableLayout to an ExpandableListView?  How?  I tried using ViewFlipper but the fact that ExpandableListView doesn't use XML threw a wrench in it.</p><p>Please help!</p>","351338","","","","","2010-05-26 20:12:22","Android - TableLayout to ExpandableListView","<android><view><tablelayout><expandablelistview>","1","0","","",""
"2916542","1","","","2010-05-26 20:30:12","6","10503","<p>Basically looking for a JQuery plugin with better Android browser support than JQTouch.  Or even an alternative Javascript framework with better mobile support.</p>","351360","","","","","2012-11-08 16:43:34","Is there a JQuery alternative to JQTouch with better Android Support?","<javascript><jquery><iphone><android><jqtouch>","6","2","4","",""
"2916709","1","","","2010-05-26 20:52:14","1","239","<p>Anyone know of good code examples of how to make lists look different than your everyday average black list or more graphically pleasing than you usually see in android apps.  I've looked through google code but haven't found too many.  I'm looking for different and eye catching lists.  I hope this question isn't too generic.  Also i'm open to anything, code, examples, blog posts, etc, you name it.  I've really struggled with lists and making them look more snazzy.  I'm talking more the code level not the graphics or icons used. </p>","202064","","","","","2010-11-15 04:04:42","Where are graphically pleasing examples of Lists","<android><listactivity><listadapter>","1","2","","","2010-06-09 22:42:22"
"2917049","1","2917159","","2010-05-26 21:45:56","7","12342","<p>I have been having a problem with a notification not opening/going to the correct activity when it has been clicked.</p><p>My notification code (located in a class which extends Service):</p><pre><code>Context context = getApplicationContext();    CharSequence contentTitle = ""Notification"";    CharSequence contentText = ""New Notification"";    final Notification notifyDetails =        new Notification(R.drawable.icon, ""Consider yourself notified"", System.currentTimeMillis());    Intent notifyIntent = new Intent(context, MainActivity.class);    PendingIntent intent =          PendingIntent.getActivity(context, 0,          notifyIntent,  PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL);    notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);    ((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails);</code></pre><p>If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch.</p><p>If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen.</p><p>What am I doing wrong? How do I specify the activity that will be pulled up?</p>","351414","","","","","2013-06-15 18:33:46","Android Status Bar Notifications - Opening the correct activity when selecting a notification","<android><activity><notifications>","1","0","4","",""
"2917184","1","2927001","","2010-05-26 22:08:59","4","3255","<p>Is there a way in Android to force output through the phone speaker, even if a headphone is plugged into the jack? I know there has to be a way because when you are talking on the phone, you can put someone on speaker phone, even if there is headphones plugged into the jack. </p>","98094","","","","","2010-05-28 06:26:18","Forcing sound output through speaker in Android","<java><android>","1","0","1","",""
"2917480","1","","","2010-05-26 23:07:35","4","5440","<p>I am using the following xml to limit input to digits only in an EditText widget. The android:digits attribute uses the below array resource. Everything works great except for the fact that I can't enter the number 4 even though its in the array. Any Ideas? </p><pre><code>&lt;EditText    android:id=""@+id/mynumber""      android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:textSize=""40dp""    android:textStyle=""bold""    android:gravity=""center_horizontal""    android:layout_centerHorizontal=""true""    android:textColor=""#aaffaa""    android:numeric=""integer""    android:digits=""@array/digits""    android:background=""#00000000""    android:inputType=""phone""    android:focusable=""true""    android:singleLine=""true"" /&gt;</code></pre><p>String array resource excerpt:</p><pre><code>&lt;string-array name=""digits""&gt;  &lt;item&gt;0&lt;/item&gt;  &lt;item&gt;1&lt;/item&gt;  &lt;item&gt;2&lt;/item&gt;  &lt;item&gt;3&lt;/item&gt;  &lt;item&gt;4&lt;/item&gt;  &lt;item&gt;5&lt;/item&gt;  &lt;item&gt;6&lt;/item&gt;  &lt;item&gt;7&lt;/item&gt;  &lt;item&gt;8&lt;/item&gt;  &lt;item&gt;9&lt;/item&gt;&lt;/string-array&gt;</code></pre>","244190","","102703","","2010-05-28 06:30:13","2012-02-10 00:45:10","android:digits Problem","<android>","1","4","0","",""
"2917709","1","2927064","","2010-05-27 00:13:21","0","1267","<p>I have images uploaded on the simulated sdcard on my emulator. I downloaded them from the browser, using the long-click on each image.  </p><p>When I look at the file explorer in the DDMS perspective, I see that they are in the directory <strong>sdcard/download</strong>. </p><p>Now if I want to download some audio files and use them in an app to, say list the title of all audio files, will they go in the same directory? (I am trying to push the audio files manually from my computer to the emulator).</p><p>This doesn't seem right. Shouldn't the media files of different types (pictures, audio, video) go into different directories?</p><p>Also, thinking this through a little, how is something like this related to the physical directory on the sdcard?</p><pre><code> Uri mMedia = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;</code></pre><p>Thanks!</p>","289918","","","","","2010-05-28 06:40:17","Organizing files on sdcard into directories","<android><android-sdcard>","1","0","1","",""
"2917759","1","","","2010-05-27 00:29:28","1","525","<p>I have a smartQ V5 device running Android ( 1.6, I think)Q: I can not do simple unix things (find, more, ... ) on this device.they are not there. Do I aomehow downlooad them? apt-get is not thereeither; is there an alternative?</p>","351497","","","","","2012-02-13 16:45:39","unix utilities under Android","<android>","2","3","","",""
"2917762","1","2917873","","2010-05-27 00:30:30","6","8603","<p>I am using the AudioRecord class to analize raw pcm bytes as it comes in the mic.</p><p>So thats working nicely. Now i need convert the pcm bytes into decibel.</p><p>I have a formula that takes sound presure in Pa into db.</p><p>db = 20 * log10(Pa/ref Pa)</p><p>So the question is the bytes i am getting from audiorecorder from the buffer what is it is it amplitude pascal sound pressure or what.</p><p>I tried to putting the value into te formula but it comes back with very hight db so i do not think its right</p><p>thanks</p>","106955","","","","","2011-11-11 19:43:28","Android PCM Bytes","<android><audio>","5","2","3","",""
"2917846","1","2918369","","2010-05-27 00:53:08","1","93","<p>The LogCat output in eclipse suddenly started weird. It sometimes shows all the output as expected. Other times it just doesn't show anything - is <strong>completely blank</strong>.</p><p>After some internet research, I thought Mylyn plugin might be responsible. So I tried de-selecting ""Mylyn Tasks UI"" &amp; ""Mylyn Team UI"" on eclipse Window --> Preferences --> General --> Startup and Shutdown --> programs that are started at startup. </p><p>No Luck. Has anyone else encountered &amp; solved this problem?</p>","289918","","","","","2010-05-27 03:59:10","LogCat acting patchy","<android>","1","0","","",""
"2917847","1","2918007","","2010-05-27 00:53:13","11","2588","<p>I'm looking for advice to speed up serialization performance, specifically when using the Google Android. For a project I am working on, I am trying to relay a couple hundred objects from a server to the Android app, and am going through various stages to get the performance I need.</p><p>First I tried a terrible XML parser that I hacked together using Scanner specifically for this project, and that caused unbelievably slow performance when loading the objects (~5 minutes for a 300KB file). I then moved away from that and made my classes implement Serializable and wrote the ArrayList of objects I had to a file. Reading that file into the objects the Android, with the file already downloaded mind you, was taking ~15-30 seconds for the ~100KB serialized file. I still find this completely unacceptable for an Android app, as my app requires loading the data when starting the application. </p><p>I have read briefly about Externalizable and how it can increase performance, but I am not sure as to how one implements it with nested classes. Right now, I am trying to store an ArrayList of the following class, with the nested classes below it.</p><pre><code>public class MealMenu implements Serializable{private String commonsName;private long startMillis, endMillis, modMillis;private ArrayList&lt;Venue&gt; venues;private String mealName;}</code></pre><p>And the Venue class:</p><pre><code>public class Venue implements Serializable{private String name;private ArrayList&lt;FoodItem&gt; foodItems;}</code></pre><p>And the  FoodItem class:</p><pre><code>public class FoodItem implements Serializable{private String name;private boolean vegan;private boolean vegetarian;}</code></pre><p>IF Externalizable is the way to go to increase performance, is there any information as to how java calls the methods in the objects when you try to write it out? I am not sure if I need to implement it in the parent class, nor how I would go about serializing the nested objects within each object.</p>","3495046","","","","","2010-05-27 01:52:53","Serialization Performance and Google Android","<java><android><performance><serialization>","1","0","1","",""
"2917893","1","","","2010-05-27 01:12:14","1","1288","<p>I'm trying to make a simple timer.</p><pre><code>package com.anta40.reminder;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.os.Bundle;import android.widget.RadioGroup;import android.widget.TabHost;import android.widget.TextView;import android.widget.RadioGroup.OnCheckedChangeListener;import android.widget.TabHost.TabSpec;public class Reminder extends Activity{    public final int TIMER_DELAY = 1000;    public final int TIMER_ONE_MINUTE = 60000;     public final int TIMER_ONE_SECOND = 1000;    Timer timer;    TimerTask task;    TextView tv;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        timer = new Timer();        task = new TimerTask() {            @Override            public void run() {                tv = (TextView) findViewById(R.id.textview1);                tv.setText(""BOOM!!!!"");                tv.setVisibility(TextView.VISIBLE);                try {                    this.wait(TIMER_DELAY);                }                catch (InterruptedException e){                }                tv.setVisibility(TextView.INVISIBLE);            }        };        TabHost tabs=(TabHost)findViewById(R.id.tabhost);        tabs.setup();        TabSpec spec = tabs.newTabSpec(""tag1"");        spec.setContent(R.id.tab1);        spec.setIndicator(""Clock"");        tabs.addTab(spec);        spec=tabs.newTabSpec(""tag2"");        spec.setContent(R.id.tab2);        spec.setIndicator(""Settings"");        tabs.addTab(spec);        tabs.setCurrentTab(0);        RadioGroup rgroup = (RadioGroup) findViewById(R.id.rgroup);        rgroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {            @Override            public void onCheckedChanged(RadioGroup group, int checkedId) {                if (checkedId == R.id.om){                    timer.schedule(task, TIMER_DELAY, 3*TIMER_ONE_SECOND);                }                else if (checkedId == R.id.twm){                    timer.schedule(task, TIMER_DELAY, 6*TIMER_ONE_SECOND);                }                else if (checkedId == R.id.thm){                    timer.schedule(task, TIMER_DELAY, 9*TIMER_ONE_SECOND);                }            }        });    }}</code></pre><p>Each time I click a radio button, the timer should start, right?But why it doesn't start?</p>","132127","","","","","2010-05-27 02:11:24","Simple reminder for Android","<android><timer>","1","0","","",""
"2917943","1","2945054","","2010-05-27 01:29:37","3","1272","<p>I have a small doubt regarding network connection procedure in Android.</p><p>My scenario is like,I am connecting to remote server over TCP using 3G. After it got connected, I enabled Wi-Fi. Android has switched to WiFi. And, still connection is alive with server, means there is no connection drop.</p><p>Here, I want to know one thing.When N/W is switched from 3G to Wi-Fi, will Android (or any other) device change its IP address as well ?and if it changes its IP, will that old connection is valid ? (means, on new IP, there should be again new connection.)</p><p>Thanks in advance.</p>","269304","","","","","2010-05-31 17:25:49","Constant Connectivity through Wi-Fi and 3G in Android","<android><networking>","1","2","1","",""
"2917969","1","","","2010-05-27 01:40:24","1","2723","<p>I've been reading through the docs, and I cannot figure out how to cancel a ""drag"" on a Seekbar once the bar has been completed.</p><p>For example, when I drag the bar to the end, I want an event to happen. However, if I keep my finger on the screen and drag my finger past the SeekBar, it keeps firing off that event even after I reset the progress of the Seekbar. How can I prevent this action from happening?</p><p>Thanks</p>","358894","","","","","2013-07-12 12:25:38","How do I cancel a ""drag"" motion on an Android Seekbar?","<android><seekbar>","2","1","1","",""
"2918003","1","","","2010-05-27 01:50:54","0","859","<p>based on the <a href=""http://developer.android.com/resources/samples/SearchableDictionary/index.html"" rel=""nofollow"">Searchable Dictionary</a> sample I tried to put extra data to a different activity. </p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Spinner distance = (Spinner) findViewById(R.id.distanceSpinner);    ArrayAdapter&lt;CharSequence&gt; adapterDistance = ArrayAdapter.createFromResource(                this, R.array.distance, android.R.layout.simple_spinner_item);    adapterDistance.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    distance.setAdapter(adapterDistance);    Intent intent = getIntent();    if (Intent.ACTION_VIEW.equals(intent.getAction())) {                     // handles a click on a search suggestion; launches activity to show word         mapIntent = new Intent(this, Map.class);         mapIntent.setData(intent.getData());                  mapIntent.putExtra(""Distance"", distance.getSelectedItemPosition());            startActivity(mapIntent);            finish();        }}</code></pre><p>In my Map Class Distance is always zero because distance.getSelectedItemPostion() gets the initialized value.How can I putExtra data with a click on a search suggestion?Thanks</p>","351525","","351525","","2010-05-27 02:39:12","2010-05-30 04:25:17","How to putExtra() in Searchable Dictionary Example","<java><android>","1","0","","",""
"2918078","1","2918585","","2010-05-27 02:17:06","2","972","<p>I have an app with about 15 threads. Most do mundane tasks and sleep most of their lives. Others collect information and cache it in hashmaps. The hashmaps grow to a moderate size and level out. The number of keys and size of value remains constant, but the contents of the values changes (at 33 keys per second average).</p><p>When I start my app, I notice the garbage collection interval goes from minutes to once per second, and the amount of garbage is 700k+ each time. </p><p>In fact as I was writing this, it caused my phone to reboot with an error ""Referencetable Overflow"". </p><p>Here's my question: Are there any tricks to identifying which threads are producing the garbage, or even finding out more about what garbage they are producing? </p><pre><code>05-26 22:08:57.052 W/dalvikvm( 1031): ReferenceTable overflow (max=512)05-26 22:08:57.052 W/dalvikvm( 1031): Last 10 entries in JNI local reference table:05-26 22:08:57.052 W/dalvikvm( 1031):   502: 0x449904a8 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   503: 0x4494fda8 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   504: 0x44a172c8 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   505: 0x448c7900 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   506: 0x44842b18 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   507: 0x448e9eb8 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   508: 0x449c6ae0 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   509: 0x44998138 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   510: 0x44961ae0 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.052 W/dalvikvm( 1031):   511: 0x448ee470 cls=Ljava/lang/String; (28 bytes)05-26 22:08:57.060 W/dalvikvm( 1031): JNI local reference table summary (512 entries):05-26 22:08:57.060 W/dalvikvm( 1031):   487 of Ljava/lang/String; 28B (487 unique)05-26 22:08:57.060 W/dalvikvm( 1031):    25 of Ljava/lang/String; 36B (25 unique)05-26 22:08:57.060 W/dalvikvm( 1031): Memory held directly by native code is 14536 bytes05-26 22:08:57.068 E/dalvikvm( 1031): Failed adding to JNI local ref table (has 512 entries)05-26 22:08:57.068 I/dalvikvm( 1031): ""BT EventLoop"" prio=5 tid=81 RUNNABLE05-26 22:08:57.068 I/dalvikvm( 1031):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x447cd620 self=0x4d7b3805-26 22:08:57.068 I/dalvikvm( 1031):   | sysTid=1138 nice=0 sched=0/0 cgrp=default handle=421084005-26 22:08:57.068 I/dalvikvm( 1031):   at dalvik.system.NativeStart.run(Native Method)05-26 22:08:57.068 I/dalvikvm( 1031): 05-26 22:08:57.068 E/dalvikvm( 1031): VM aborting05-26 22:08:57.185 I/DEBUG   (  990): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***</code></pre>","268803","","268803","","2010-05-27 13:04:37","2010-08-12 07:31:05","How to tell which thread(s) are producing all the garbage?","<android><debugging><multithreading><garbage-collection><crash>","1","4","","",""
"2918089","1","","","2010-05-27 02:20:33","0","168","<p>I have want to layout an ImageView and then follow by a LinearLayout (to the right of it).</p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView android:id=""@+id/icon"" android:layout_width=""20px""        android:layout_height=""20px"" /&gt;    &lt;RelativeLayout android:id=""@+id/side"" android:layout_width=""fill_parent"" android:layout_weight=""1"" android:layout_width=""????""&gt;           // some children here     &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>How can I configure my side panel so that it either use 'wrap_content' if the height is > than the image view? if not, use the height of the image i.e. 20px?</p>","286802","","","","","2010-09-28 07:53:10","How to specify a LinearLayout to either wrap_content if it exceeds certain width","<android>","1","0","","",""
"2918102","1","","","2010-05-27 02:25:50","1","654","<p>I have a very simple application. There is a refresh button, everytime it is being clicked, the adapter will call notifyDataSetChanged() to update a ListView. However, I got IllegalStateException all the time. Any quick solution? Thanks.</p>","349470","","","","","2010-05-27 11:31:14","IllegalStateException when adapter.notifyDataSetChanged() is called","<android>","0","3","","",""
"2918387","1","2918510","","2010-05-27 04:04:12","0","4037","<p>I am a beginner in Android programming. I want to build a simple application with a main list view in the screen and two buttons at the bottom of the screen.</p><p>When more items are added to the list view, the list view should scroll without increasing the overall length of the list view.</p>","349470","","304673","","2010-05-27 04:32:36","2010-05-27 04:39:48","Fix buttons at the bottom of the screen","<android><list>","1","0","","",""
"2918436","1","2927154","","2010-05-27 04:21:56","1","202","<p>I know that you can setup accounts in Android 2.0+ and thats great but as i have recently found out, it can create duplication.</p><p>My phone(Sprint HTC hero 2.1-upadate1) comes with HTC Sense and thats great, it also has Peep pre-installed and it asked me when i setup the phone to add a twitter account, and so i did. I can now open peep and it all works, perfect.</p><p>But I decided i wanted to try the Twitter for Android app. I installed it and it also asked me to create a twitter account, not good. I did create the new account and the app worked just like it was supposed to.</p><p>Then when i go into my accounts i can see that i have two twitter accounts(the same one). Is this something that can be avoided in the programming or is this something that can be fixed with the os?</p><p>I also noticed the same for the facebook account. Is there something in the SDK that can prevent this...or combine the accounts after the fact? or is this all completely up to the developers.</p><p>If its up to the developers then i would really like to see some code/documentation so i can avoid such things.</p>","271531","","","","","2010-05-28 06:57:05","Android 2.0+ account duplication","<android><accounts>","1","2","","",""
"2918624","1","2918870","","2010-05-27 05:11:29","4","3549","<p>I'm just playing around with some code. I create an Activity and simply do something like this:</p><pre><code>long lo = currentTimeMillis();System.out.println(lo);lo *= 3;System.out.println(lo);SystemClock.setCurrentTimeMillis(lo);System.out.println( currentTimeMillis() );</code></pre><p>Yes, in my AndroidManifest.xml, I've added:</p><pre><code>&lt;uses-permission android:name=""android.permission.SET_TIME""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.SET_TIME_ZONE""&gt;&lt;/uses-permission&gt;</code></pre><p>Nothing changes. The SystemClock is never reset...it just keeps on ticking.The error that I'm getting just says that the permission ""SET_TIME"" was not granted to the program. Protection level 3.</p><p>The permissions are there...and in the API for 2.2 it says that this feature is supported now. I have no idea what I'm doing wrong.</p><p>If android.content.Intent; comes into play, please explain. I don't really understand what the idea behind intents!</p><p>Thanks for any help!</p>","158584","","","","","2011-05-16 10:28:17","Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. What am I doing wrong?","<android><time><permissions><operating-system>","3","1","1","",""
"2918649","1","","","2010-05-27 05:20:26","0","498","<p>I'm new to android.  I'm using webview in scrollview to display my local html page (html has text only). I created two buttons for zoomin and zoomout using behind function zoomIn() &amp; zoomOut() respectively.  These functions work fine. The problenm is, when I zoom in, some of the text goes out from both top and bottom and it doesn't appear when I scroll.</p><p>How can I resolve this?</p>","351599","","23897","","2010-05-27 05:28:28","2010-09-21 20:37:26","having trouble with zooming in android webview","<android>","1","0","","",""
"2918778","1","","","2010-05-27 05:55:12","0","772","<p>i m new in android i want to create application that gives option for create new profile (like meeting,outdore etc),manage profile(not location base it's manually)plz help me  </p>","820710","","820710","","2010-05-27 06:18:05","2014-02-03 21:45:31","[android]how can i create customize profile like meeting etc","<android><profile>","1","3","","",""
"2918912","1","","","2010-05-27 06:19:44","1","1388","<p>I have tried a lot, but I am not able to handle unknown call. Is it possible in Android SDK 2.0? I want to stop calling from unknown number - is it possible?</p>","820710","","121364","","2010-05-27 06:30:12","2010-05-27 06:30:12","Can I handle incomeing call in Android SDK 2.0?","<android>","0","5","","",""
"2918920","1","2919078","","2010-05-27 06:21:31","28","16342","<p>I need to decode HTML entities, e.g. from &amp;#246; to &#246;, and &amp;amp; to &amp;.</p><p><code>URLEncoder.decode(str)</code> does not do the job (convert from % notations). TextUtils has a HTMLencode, but not a HTMLdecode.</p><p>Are there any function for decoding HTML entities?</p>","351640","","842697","","2013-03-04 16:25:40","2013-03-04 16:25:40","Decode HTML entities in android","<html><android><decode>","1","1","7","",""
"2919135","1","","","2010-05-27 07:10:49","0","562","<p>how to set android default title bar at Bottom with image on it ?</p>","351682","","","","","2010-05-27 07:53:56","how to set android default title bar at Bottom with image on it?","<android>","1","1","","",""
"2919149","1","","","2010-05-27 07:13:31","6","6916","<p>How to install the application in <code>*.apk</code> file into the Android emulator? </p>","349664","","1968972","","2014-02-10 15:55:27","2014-02-25 14:19:28","How to install .apk file to emulator?","<android><installation>","5","0","3","",""
"2919216","1","2921457","","2010-05-27 07:25:53","0","630","<p>After sending an INVITE request I receive a trying answer, and immidietly after that I receive error 407 (proxy authentication required).After sending ACK &amp; another INVITE with the proxy header I receive session progress about 1/4 of the time! Other times it just sends 407 error again &amp; again.</p><p>Any ideas?</p>","297512","","1055764","","2013-07-05 08:43:02","2013-07-05 08:43:02","odd response after INVITE request, SIP","<android><sip><voip><proxy-authentication>","1","1","","",""
"2919358","1","2919616","","2010-05-27 07:56:04","7","19732","<p>I have this code to get the best available provider</p><pre><code>lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);locationListener = new MyLocationListener();Criteria criteria = new Criteria();criteria.setAccuracy(Criteria.ACCURACY_FINE);String provider = lm.getBestProvider(criteria, true);Location mostRecentLocation = lm.getLastKnownLocation(provider);if(mostRecentLocation != null) {    latid=mostRecentLocation.getLatitude();    longid=mostRecentLocation.getLongitude();}lm.requestLocationUpdates(provider, 1, 0, locationListener);</code></pre><p>and then the listener</p><pre><code>private class MyLocationListener implements LocationListener {@Overridepublic void onLocationChanged(Location loc) {  if (loc != null) {    latid = loc.getLatitude();    longid = loc.getLongitude();    // if(loc.hasAccuracy()==true){    accuracyd = loc.getAccuracy();    String providershown = loc.getProvider();        accuracy.setText(""Location Acquired. Accuracy:""      + Double.toString(accuracyd) + ""m\nProvider: ""+providershown);    accuracy.setBackgroundColor(Color.GREEN);    // }    userinfo=usernamevalue+""&amp;""+Double.toString(latid)+""&amp;""+Double.toString(longid);    submituserlocation(userinfo);   }}</code></pre><p>When I tested it to a device(htc magic) I found out that when gps is disabled it locks from the network immediately. When I enable the gps it doesnt take any data from the network and waits till it locks from the gps.<br>I would like to lock the position like the google maps that until they have a good gps signal they use the network to determine my location.<br>I though the best criteria would do that but what they do is pick a provider once.<br>Is there something wrong with my code or I have to do threads and timeouts etc to make it happen?</p>","338522","","281545","","2013-07-11 15:51:47","2014-04-03 11:06:33","android get location from best provider available","<android><location><provider>","2","2","6","",""
"2919414","1","","","2010-05-27 08:05:22","3","12535","<p>I've been trying to retrive the current network type, but no success</p><p>when i say network type: i refer to know this info:if the type is: <code>NETWORK_TYPE_IDEN</code> or <code>NETWORK_TYPE_UMTS</code>.. and so on..</p><p>i tried to use:</p><pre><code>NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();</code></pre><p>or  </p><pre><code>NetworkInfo mobNetInfo = connectivityManager.getNetworkInfo             (ConnectivityManager.TYPE_MOBILE); </code></pre><p>but no success.. </p><p>i am doing this coz i wanna know if the current network is IDEN, or if the current network is connected through wifi..</p>","273550","","35070","","2011-02-18 09:38:37","2013-11-13 22:05:38","Get Network type","<android>","6","0","6","",""
"2919606","1","2919721","","2010-05-27 08:39:41","0","4529","<p>Does anyone know a good step by step tutorial for using sqlite on Android?</p><p>I've found this: <a href=""http://developer.android.com/guide/topics/data/data-storage.html#db"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#db</a> and it ok to start with, but then it wants me to jump into other source code then its difficult to follow.</p><p>I've tried others on the web, one from screaming penguin and that just kept causing errors with JVM.</p><p>Advice greatly appreciated.</p><p>I need to:</p><ul><li>Create database, with several tables (auto id, declare type)</li><li>update</li><li>get</li></ul>","351740","","","","","2014-02-02 17:45:28","Using database in Android","<database><android>","5","0","","2012-08-08 15:48:49",""
"2919659","1","2927613","","2010-05-27 08:47:50","-1","431","<p>I've just updated my nexus one to 2.2. Now all of my (own and some from the market) apps throw exceptions and were closed.</p><p>It's weird, in the app I'm developing atm, there it displays only my start page with buttons, but when I tap on one button to fire an intent to another activity my app gets closed with an exception.</p><p>Yesterday before the update everything worked fine.</p><p>The same thing in my emulator:</p><p>I have two devices, one with API level 7 and one with level 8. Level 7 worked fine, but level 8 killed my app :(</p><p>What is the problem and how can I solve this? I'm desperatly trying to get it working again :(</p><p>I hope someone can help me fixing this</p>","317301","","40342","","2010-05-27 08:59:28","2010-05-28 08:37:08","Why do apps from Android 2.1 stop working with 2.2?","<android><android-2.2-froyo><android-version>","1","7","","",""
"2919778","1","2919808","","2010-05-27 09:07:55","5","8556","<p>I have a separate thread running to get data from the internet. After that, I would like to update the ListView in the main thread by calling adapter.notifyDataSetChanged(). But it does not work. Any workaround for that? Thanks.</p>","349470","","","","","2013-01-09 03:26:33","Update ListView in the main thread from another thread","<android>","3","0","5","",""
"2919889","1","2919929","","2010-05-27 09:24:21","1","647","<p>I am currently using a date and time picker to retrieve a user-submitted date and time, and then I set a control's text to the date and time selected. </p><p>I am using the following code:</p><pre><code>new DatePickerDialog(newlog3.this, d, calDT.get(Calendar.YEAR), calDT.get(Calendar.MONTH), calDT.get(Calendar.DAY_OF_MONTH)).show();new TimePickerDialog(newlog3.this, t, calDT.get(Calendar.HOUR_OF_DAY), calDT.get(Calendar.MINUTE), true).show();optCustom.setText(fmtDT.format(calDT.getTime())); </code></pre><p>Now, while the above code block does bring up the date and time widgets and sets the text, the code block is being executed in full before the user can select the date.. ie: It brings up the date box first, then the time box over that, and then updates the text, all without any user interaction. I would like the date widget to wait to execute the time selector until the date selection is done, and i would like the settext to execute only after the time widget is done. </p><p>How is this possible? Or is there is a more elegant solution that is escaping me?</p><p>Edit: This is the code for DatePickerDialog/TimePickerDialog which is located within the class:</p><pre><code> DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() {         public void onDateSet(DatePicker view, int year, int monthOfYear,                     int dayOfMonth) {             calDT.set(Calendar.YEAR, year);             calDT.set(Calendar.MONTH, monthOfYear);             calDT.set(Calendar.DAY_OF_MONTH, dayOfMonth);           //updateLabel();         }       };    TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() {         public void onTimeSet(TimePicker view, int hourOfDay,                              int minute) {             calDT.set(Calendar.HOUR_OF_DAY, hourOfDay);             calDT.set(Calendar.MINUTE, minute);           //updateLabel();         }       };  </code></pre><p>Thanks in advance</p>","350237","","350237","","2010-05-27 09:46:38","2010-05-27 10:06:31","Elegant solution to retrieve custom date and time?","<android>","1","0","2","",""
"2919957","1","2926291","","2010-05-27 09:35:45","1","462","<p>the Android ndk is hard to use for the old autoconf based code, so i employed scratchbox2/emdebian to have a complete build environment. can i build a shared library in  emdebian (arch is armel) and then use it in android? </p>","221794","","168868","","2011-10-20 22:10:22","2011-10-20 22:10:22","is it binary compatible for emdebian and android?","<android><android-ndk><binary-compatibility><scratchbox>","2","0","","",""
"2920099","1","2920176","","2010-05-27 10:01:40","1","323","<p>I am building an application where in I need to take the data (say inbox message) from an Android mobile phone store it in any database and then use the data from DB. Here I want the data from Android mobile to be directly stored in any DB. Can any one come out with a good idea?</p>","244884","","213269","","2011-12-14 01:53:47","2011-12-14 01:53:47","Storing data from Android mobile into a Database","<android><database>","1","0","","",""
"2920415","1","","","2010-05-27 10:49:51","1","5727","<p>I have followed the instructions on the Android website on how to download the latest android source code files but it gives errors when i run this command:</p><pre><code>repo init -u git://android2.git.kernel.org/platform/manifest.git</code></pre><p>It gives the following error:</p><pre><code>Getting repo ...from git://android.git.kernel.org/tools/repo.gitandroid.git.kernel.org[0: 199.6.1.176]: errno=Connection refusedandroid.git.kernel.org[0: 130.239.17.12]: errno=Connection refusedfatal: unable to connect a socket (Connection refused)</code></pre><p>On checking forums for its resolution, i was told that port 9418 was being blocked.I use Ubuntu 10.04 and ensured that the firewall wasnt blocking the port and also enabled the port and the above IP addresses.I also spoke to the networking peeps who ensured that no traffic from the internet is being blocked.I would be glad if i could get directions on how to proceed next.</p>","351850","","2331953","","2013-09-16 06:57:26","2014-03-24 19:32:05","Android Source code download error","<android><ubuntu>","2","1","","",""
"2920675","1","2920733","","2010-05-27 11:32:14","0","1067","<p>I am using a separate class with only static fields, to store current application data.It is partly populated from <code>sharedpreferences</code> on application startup. The rest is data like results of some action, used for further browsing these results (multiple activities that use the results).</p><p>I can go to the home screen, start other applications etc. and when I return to my own application it just works correctly.</p><p>However, since the new <code>Error Reporting</code> feature I get some bug reports all related to a <code>nullreference</code> error. The object that is <code>null</code> is a reference to the static field in the mentioned separate class. </p><p>Since I cannot reproduce the bug I am inclined to think this is due to the application getting killed due to low memory, and when it relaunches it calls the <code>oncreate</code> from the activity that the user was currently in. However all the static data in the separate class is not restored and thus it crashes.</p><p>I would like to know: Is there a way to force the application to ""restart"" completely, and not start with the last used activity if it gets killed? Or is that standard behaviour?Can I do this programmatically? Like when the static fields are null, restart app?</p>","107029","","","","","2010-05-27 11:42:19","Android: When application was killed, how to set entrypoint for new startup?","<android><kill><restart><entry-point>","1","0","","",""
"2920726","1","2921285","","2010-05-27 11:41:17","0","811","<p>I am trying to make a fraction: </p><p>I am using this is a text view but it is not rendering very nicely:</p><pre><code>""5""+'\u2044'+""9"";</code></pre><p>It does not turn the text into a nice fraction instead it sort of covers part of the numbers and squishes them together.</p><p>Any solutions or alternatives?</p>","248521","","","","","2010-05-27 13:00:56","Android - displaying fractions using unicode","<android>","1","0","1","",""
"2920750","1","2921304","","2010-05-27 11:44:54","1","215","<p>How to find when user clicks the ics file ? In android programmatically</p><p>Thanks in advance.....</p>","314427","","314427","","2010-05-27 12:01:56","2010-05-27 13:02:56","How to detect when ics file clicked","<android>","1","0","","",""
"2920798","1","2921199","","2010-05-27 11:51:21","1","368","<p>i am trying to display  STRING  <strong>my car name is ""abc""</strong> in textview.</p><p>it displays &qoute;abc&qoute; after running application.</p><p>i have tried decoding into "" and then assigning it to TextView but it always convert "" to &qoute;</p><p>can any one guide me how to solve this issue?</p><p>any help would be appriciated.</p>","249991","","","","","2010-05-27 12:49:30","android does not display """" inside TextView?","<android><textview>","2","0","","",""
"2920870","1","5152595","","2010-05-27 12:04:32","7","4116","<p>What are the steps required to use PocketSphinx on Android?</p><p>I have found various hints around the web that it is possible, but not real answers and hence I ask my question here.</p>","108495","","432021","","2014-02-17 21:17:10","2014-02-17 21:17:10","Pocket Sphinx on Android","<android><speech-recognition><cmusphinx>","3","1","3","",""
"2920901","1","2921580","","2010-05-27 12:08:32","3","903","<p>I have certain sound files and will like to develop an app which allows to set those sound files as ringtones. </p><p>Can someone let me know the way of implementing it? What are the API's that I need to use for this purpose? </p><p>Hope to get the reply soon.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-05-27 13:58:42","How to set the audio file as ringtone in Android?","<android><audio>","1","0","1","",""
"2920932","1","2921627","","2010-05-27 12:12:23","0","995","<p>I have my remote service which tries to run an activity from a different application this way:</p><pre><code>Intent i = new Intent(""ValidateActivity.intent.action.Launch"");i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(i);</code></pre><p>Now also in the remote service app I've added in the manifest these lines:</p><pre><code>          &lt;service android:name="".UdpListenerService""&gt;             &lt;intent-filter&gt;               &lt;action android:name=""com.something.IUdpListenerService"" /&gt;               &lt;category android:name=""android.intent.category.DEFAULT""/&gt;             &lt;/intent-filter&gt;          &lt;/service&gt;</code></pre><p>Now in the target activity's manifest(ValidateActivity) I've added these lines:</p><pre><code>         &lt;activity android:name=""com.something.ValidateActivity"" &gt;            &lt;intent-filter&gt;                     &lt;action android:name=""ValidateActivity.intent.action.Launch""/&gt;              &lt;category android:name=""android.intent.category.DEFAULT""/&gt;              &lt;/intent-filter&gt;          &lt;/activity&gt;</code></pre><p>I should mention that the target activity is in a different apk, and it has two packages:</p><ol><li>com.something (there I have my ValidateActivity)</li><li>com.test (there I have another activity, which is not relevant for this question).</li></ol><p>Now after I try to run it, I still get the error:</p><blockquote>  <p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.external/com.something.ValidateActivity}: java.lang.NullPointerException</p></blockquote>","273550","","1404505","","2012-12-04 09:20:57","2012-12-04 09:21:18","Remote service start activity from different application (apk)","<android><apk>","1","0","","2012-12-04 12:42:05",""
"2920937","1","","","2010-05-27 12:12:43","0","429","<p>Hi I am new to android. When the user try to open a *.ics mail attachment files from the browser, I have to give an alert message. Is it possible to give an alert to the browser from my application? Please Guide me to solve this..</p>","351928","","","","","2010-05-27 12:28:23","how to give alert to the browser from application?","<android>","1","0","","",""
"2921038","1","","","2010-05-27 12:25:29","6","1121","<p>i want to add themes to my android application. In the application, user will have options to changes theme of the application. Just like <a href=""http://www.openintents.org/en/node/19"">OIShopping List appplication</a>. Please help how do i implement this kind of structure to my application. </p><p>Any help, tutorials, guidance are highly appreciated.</p><p>thanks..</p>","152867","","","","","2012-04-05 12:31:31","Add different themes to the android application","<android><themes>","1","2","2","",""
"2921170","1","","","2010-05-27 12:45:56","0","698","<p>So I have som data that I have converted to a string. While I have found how to attach something from the SD-card to a mail, I cant figure out how to directly convert my string to a mail-attachment without involving the SD-card. In case it holds significance, I have read some data from a database, converted it to csv-format, and now wants to attach it as a csv-file.</p><p>Cheers,</p>","249871","","","","","2010-08-29 18:36:04","Converting string to email-attachment on android","<android><email><attachment>","1","3","0","",""
"2921308","1","2921488","","2010-05-27 13:03:26","3","885","<p>This question<a href=""http://stackoverflow.com/questions/2774446/contact-picker-in-a-dialog"">1</a> describes a way how to show list of phone numbers and select one of them if my app needs a phone number. But image if I have a huge contact list, it is not enough to just show list but possibility for filtering (by contact's name) is also needed. Is there a standard way to show phones list with picking possibility and with filtering possibility? (I wouldn't like to invent my own)</p><p>Is there a solution for the problem for sdk 2.0 and lower?</p>","120574","","120574","","2010-05-29 06:02:02","2010-05-29 06:02:02","Contact picker with search function","<android><contacts><picker>","1","0","1","",""
"2921641","1","2921832","","2010-05-27 13:45:27","0","1642","<p>after calling:</p><pre><code>result=bindService(new Intent(IUdpListenerService.class.getName()),            serviceConnection, Context.BIND_AUTO_CREATE);</code></pre><p>byt debugger: result return 'true'</p><p>the onServiceConnected isn't being called.</p><p>*ill mention that the remote service is installed in diffrent apk, and is being started by the command startService(..)</p><p>Okie.. this is new thing i just found out: onServiceConnected is being triggerd, but it takes time, so what happens here.. that when i use the instance of my interface -  it's still remine null, before onServiceConnected manage to be triggerd.. is that possible? – </p>","273550","","273550","","2010-05-27 14:35:33","2010-05-27 14:35:33","Can't bind to remote service","<android>","2","5","1","",""
"2921816","1","2922076","","2010-05-27 14:07:47","2","524","<p>I am fairly new to Android and this is my first post so I apologise in advance if I am breaking protocol or posting to the wrong board. Please feel free to move this post to somewhere more appropriate if required.</p><p>I am developing for the 160 Gb Archos 5 Internet tablet. Not ideal as a development platform I know, but customer requirements mean we have no choice. It is running Android 1.6. I have updated the device firmware to the most recent available. Updating the version of Android is not an option at this point.</p><p>Part of my app's requirement is to write information out to .txt files on the external storage directory so that these can be copied over the USB connection to a Windows XP PC using the Mobile media device (MTP) mode.</p><p>I have followed all instructions I have come across carefully, eg I check that the storage is available using the technique described at <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesExternal</a>. However, althoug the files are created succesfully on the device (I can browse them and open them using the device's File Explorer - they are fine), when I connect the device to a Windows XP computer none of the directories or files I created appear and the size of their parent files suggest they do not exist.</p><p>I have tried running over the ADB, checked logcat, tried a (signed) release version and even written a second test application which just creates a folder (this behaves the same, ie it creates the folder but this is not visible in Windows Explorer) - nothing anywhere gives me any suggestion as to what the problem might be. If anyone has heard of this before or has any ideas as to what else | could try to fix it please get in touch! We do not have any other devices to test on at the moment, although I hope to remedy this soon, customer permitting.</p><hr><p>It seems you were right molnarm - I downloaded some Ext2IFS drivers from <a href=""http://www.fs-driver.org/"" rel=""nofollow"">http://www.fs-driver.org/</a>, and I can now read and move my files.</p>","352042","","102937","","2013-09-16 15:30:22","2013-09-16 15:30:22","Created files on Archos 5 invisible on Windows Xp","<windows><android><archos>","1","0","0","",""
"2922077","1","2925789","","2010-05-27 14:36:59","0","504","<p><a href=""http://uploaded.to/file/ds1slp"" rel=""nofollow"">here</a></p><p>I uploaded my Android project made in Eclipse. The idea is that i have a service, which computes the sum of two random numbers. But when i press the OK Button, i don't see the result in that edit box... why? What i'm doing wrong? Please help</p><p>Thanks!</p><p>EDIT: The code:</p><p>//service class</p><pre><code> package service;import java.util.Random;import com.android.AplicatieSuma;import android.widget.EditText;import android.widget.TextView;public class ServiciuSuma {       public ServiciuSuma() { }    public int CalculateSum()    {        Random generator=new Random();        int n=generator.nextInt();        int m=generator.nextInt();        return n+m;    }}</code></pre><p>The Application class:</p><pre><code>package com.android;import android.app.*;import service.*;public class ApplicationSum extends Application {    public ServiciuSuma service = new ServiciuSuma();}</code></pre><p>and the main Activity class:</p><pre><code>package com.android;import com.android.R;import android.app.Activity;import android.content.Intent;import android.graphics.Color;import android.graphics.PorterDuffColorFilter;import android.graphics.drawable.Drawable;import android.graphics.PorterDuff;import android.os.Bundle;import android.provider.Settings;import android.view.View;import android.view.View.OnClickListener;import android.widget.EditText;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;public class Activitate extends Activity  {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);          View btn_ok = findViewById(R.id.btn_ok);        btn_ok.setOnClickListener(new OnClickListener()             {                public void onClick(View v)                 {                    CalculeazaSuma();                                   }            });    }    private void CalculeazaSuma()    {        AplicatieSuma appState = ((AplicatieSuma)this.getApplication());        EditText txt_amount = (EditText)findViewById(R.id.txt_amount);        txt_amount.setText(appState.service.CalculateSum());        //BindData();    }}</code></pre><p>So that edit text does not show the sum of the random generated numbers, by the service. What's wrong?</p><p>Thanks</p><p>EDIT:</p><p>the manifest xml 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""      android:versionCode=""1""      android:versionName=""1.0.1""&gt;      &lt;supports-screens          android:largeScreens=""true""          android:normalScreens=""true""          android:smallScreens=""true""          android:anyDensity=""true"" /&gt;    &lt;application android:name=""ApplicationSum"" android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:label=""@string/app_name"" android:name="".Activitate""&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""  android:targetSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre>","300590","","300590","","2010-05-27 16:34:49","2010-05-27 23:45:30","Android project problem","<android><eclipse>","3","4","","",""
"2922114","1","2922373","","2010-05-27 14:41:14","2","5621","<p>As far as I have read in the Internet and official documentation, it isn't possible to make a scrollable app widget. Also all my tries failed. I even tried to subclass TextView to implement my own scroll method, but nothing worked.</p><p>Are there any ways to achieve that?</p><p>Btw.... there are solutions if you use for example htc sense or home desktop ++, but i want to make it available to other users which don't use this</p>","","anon","584405","","2011-11-02 09:02:29","2014-03-28 05:51:24","How to make a scrollable app widget?","<android><appwidget>","3","3","1","",""
"2922210","1","2922340","","2010-05-27 14:54:52","12","24391","<p>I have a text file on my server. I want to open the text file from my Android App and then display the text in a TextView. I cannot find any examples of how to do a basic connection to a server and feed the data into a String.</p><p>Any help you can provide would be appreciated.</p>","300129","","","","","2013-05-30 18:27:40","Reading Text File From Server on Android","<android><http><file>","3","2","6","",""
"2922406","1","2923105","","2010-05-27 15:19:30","6","1217","<p>I have added Jacson libs to my android project and now I am getting such warnings in console: </p><blockquote>  <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></blockquote><p>I've tried to recompile libs, but it didn't help. Warnings are gone when I remove these libs from project. Everything is working fine on the device, but this annoys me ;)</p><p>Do you know any solution? I'm using Eclipse. </p>","58862","","","","","2010-08-28 06:50:25","Warning: This class was probably produced by a broken compiler","<android><jackson>","1","2","1","",""
"2922455","1","7232187","","2010-05-27 15:26:24","10","4050","<p>Is it possible to set the IP address of an interface in Android within an application? I can query the available interfaces and their current addresses using <code>java.net.NetworkInterface</code>, but this doesn't provide a facility to change these. Did I just miss something somewhere or is it not allowed?</p><p>I was hoping to be able to make my application either change or add an alias to one or more of the existing interfaces at runtime on an ""off the shelf"" device. (2.1/2.2). Ideally I'd like to do this for both IPv4 and v6 addresses.</p>","168175","","","","","2011-08-29 15:24:00","API for configuring static IP addresses in an android application","<android><networking><ipv6><ipv4>","1","0","7","",""
"2922764","1","2971261","","2010-05-27 16:05:43","4","639","<p>I know this question is not programming related, so for this I made community wiki. Developers are the best guys to answer the question.</p><p>I am addressed to those that do development on devices that runs on batteries, like phones, gadgets etc. Probably you are constantly develop for them, and therefor they are always plugged in and charged at 100%. We develop mainly for smartphones and we have devices that were always above 90% charged in the last month or so.</p><p>If a battery is always charged, it degrades it life cycle, so what steps you do to ensure decent battery drain to maximize the life of the batteries.</p>","243782","","","","","2010-07-07 04:23:54","How do you manage battery health of your development devices when is always plugged in?","<iphone><android><windows-mobile><mobile><battery>","6","3","","","2010-05-27 16:05:43"
"2922808","1","","","2010-05-27 16:13:06","2","1927","<p>If I create an  Options menu with menu.xml, can I change the menu buttons' standard text size, color etc? I would like to change text size, bold, and color.</p><p>I would like to avoid using themes and styles for this application.</p>","351300","","746010","","2012-01-29 05:37:29","2012-01-29 05:37:29","Change menu button using XML configuration","<android><xml><menu>","2","0","","",""
"2922860","1","2923451","","2010-05-27 16:19:13","1","1411","<p>I need to have a grid (created by program, not by xml) of equally sized buttons. They display text in different sizes.The problem is that when I change the text size to a smaller size,then the button automatically resizes to be smaller than the others.</p><p>Thanks, </p><p>Note: the grid is created adding *TableRow*s of buttons to a <em>TableLayout</em>. The buttons are created and added to a <em>TableRow</em></p><pre><code>tr.addView(bu, 36, 45);</code></pre>","286335","","","","","2010-05-27 17:39:07","How to change the button fontsize without changing button size (in android)?","<android><button><resize><font-size>","1","2","","",""
"2922897","1","","","2010-05-27 16:24:10","1","204","<p>How can you change application colors on the fly?</p><p>I am currently using the following to change the background:LinearLayout mScreen = (LinearLayout) findViewById(R.id.main);  mScreen.setBackgroundColor( mycolor ); </p><p>I tried to use Style's to change the text using:    @color/white</p><p>The problem is that Spinners/Buttons and Spinner-Popup-Lists all change to white text as well, making them unreadable.  I have over 20 Classes in my app that all need to be able to change color combination's.</p>","158757","","","","","2010-05-28 07:18:04","Android Simple way for User Color Selections","<android>","1","0","","",""
"2922906","1","","","2010-05-27 16:25:14","1","677","<p>i am trying to play a video via streaming in my android application. Video playing functionality works good but whenever changes the orientation of the phone...a white screen comes over the video view and audio keeps playing. And after turning back to original orientation, video starts playing normally..(with proper video and audio.).</p><p>Please help.. what should i do??</p><p>thanks... </p>","152867","","63034","","2010-05-27 16:28:10","2010-08-01 23:17:27","Issue with videoview on Android 2.1","<android>","1","2","1","",""
"2923265","1","2927296","","2010-05-27 17:14:07","16","17569","<p>I understand how to use intents and startActivity() when opening another activity within my own app, but how do you start a different app? specifically: </p><ul><li>How do you determine if the user has the needed app installed on their device?</li><li>How do you start that app?</li><li>How do you pass parameters to that app?</li><li>How do you find all this info out for a specific app (say Adobe reader, or google maps)?</li></ul>","339428","","1562548","","2013-11-11 09:19:16","2013-11-11 09:19:16","android: how do i open another app from my app?","<android><api><activity>","2","0","10","",""
"2923317","1","2923975","","2010-05-27 17:20:58","1","2720","<p>I just came across the limitation of VideoView of not being able to play mp4 video files that are wider than 320 pixels. I was wondering how can we overcome these limitations. I am trying to make my app as forgiving as possible, so other than using VideoViews is there another way to play these mp4 videos? </p><p>Chris</p>","321927","","","","","2010-05-27 18:51:33","Android - Different ways of playing video","<android><mp4><videoview>","1","1","2","",""
"2923343","1","3965189","","2010-05-27 17:24:10","3","992","<p>I know that the apps receive a ACTION_SHUTDOWN broadcast event when the device is shutting down. When an application receives the shutdown, is there still an opportunity to send data packets out, or does android block such attempts(or does the platform tear down the network stack before it can go out).</p>","328302","","","","","2010-10-19 03:42:42","Send data after ACTION_SHUTDOWN is received","<android>","1","1","2","",""
"2923345","1","","","2010-05-27 17:24:22","3","690","<p>Is there a way to check whether a TextView's text is truncated in my code?</p>","286802","","85950","","2013-08-06 01:18:59","2013-08-06 01:18:59","Is there a way to check ia TextView's text is truncated","<android><android-textview>","2","0","","",""
"2923729","1","2923745","","2010-05-27 18:18:46","3","6713","<p>I am relatively new to android. I have two applications A and B. I have an activity in A, lets name it x, that would launch the application B. Now the intent sent by x contains StringExtra that I want the Starting activity in B to use. Is there a way for the activity in B to do that?</p><p>Thanks!</p>","239850","","","","","2010-11-03 17:32:35","Using intent.getStringExtra from within an activity","<android><activity><android-intent><getstring>","2","0","","",""
"2923823","1","2923865","","2010-05-27 18:31:07","8","4412","<p>I have recently updated my app to a build tarket of SDK version 8 in order to include the App2SD feature for my users.</p><p>However I have had reports of devices on SDK 3 (1.5) having problems starting the application, with the following stack trace:</p><pre><code>...E/AndroidRuntime(10638): Caused by: android.content.res.Resources$NotFoundException: File      res/drawable/title_bar_shadow.9.png from drawable resource ID #0x7f020000E/AndroidRuntime(10638): at android.content.res.Resources.loadDrawable(Resources.java:1641)E/AndroidRuntime(10638): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)E/AndroidRuntime(10638): at android.view.View.&lt;init&gt;(View.java:1726)E/AndroidRuntime(10638): at android.view.View.&lt;init&gt;(View.java:1675)E/AndroidRuntime(10638): at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:271)E/AndroidRuntime(10638): at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)E/AndroidRuntime(10638): ... 26 moreE/AndroidRuntime(10638): Caused by: java.io.FileNotFoundException: res/drawable/title_bar_shadow.9.pngE/AndroidRuntime(10638): at android.content.res.AssetManager.openNonAssetNative(Native Method)E/AndroidRuntime(10638): at android.content.res.AssetManager.openNonAsset(AssetManager.java:392)E/AndroidRuntime(10638): at android.content.res.Resources.loadDrawable(Resources.java:1634)E/AndroidRuntime(10638): ... 31 more</code></pre><p>If i change the build target back to version 4 as it was previously this issue goes away, also if i remove any graphical resources from my XML files this issue goes away!</p><p>Any help would be much appreciated as i currently have a broken app on the market for many users.</p>","192065","","41688","","2011-05-26 14:47:00","2011-05-26 14:47:00","Android 2.2 SDK breaks compatibility with older phones","<android><android-2.2-froyo>","2","2","2","",""
"2924000","1","","","2010-05-27 18:55:08","0","3026","<p>I have written the android application and I want the application to send the call information whenever there is an incoming call and it ends. This way I would be sending all calls to the server  irrespective of size of the call log.</p><p>Here is the code </p><pre><code>public class PhoneInfo extends BroadcastReceiver {    private int incoming_call = 0;    private Cursor c;    Context context;    public void onReceive(Context con, Intent intent) {        c = con.getContentResolver().query(                android.provider.CallLog.Calls.CONTENT_URI, null, null, null,                android.provider.CallLog.Calls.DATE + "" DESC"");        context = con;        IncomingCallListener phoneListener = new IncomingCallListener();        TelephonyManager telephony = (TelephonyManager) con                .getSystemService(Context.TELEPHONY_SERVICE);        telephony.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);    }}public class IncomingCallListener extends PhoneStateListener {    public void onCallStateChanged(int state, String incomingNumber) {        switch (state) {        case TelephonyManager.CALL_STATE_IDLE:            if (incoming_call == 1) {                CollectSendCallInfo();                incoming_call = 0;            }            break;        case TelephonyManager.CALL_STATE_OFFHOOK:            break;        case TelephonyManager.CALL_STATE_RINGING:            incoming_call = 1;            break;        }    }    private void CollectSendCallInfo() {        int numberColumn = c                .getColumnIndex(android.provider.CallLog.Calls.NUMBER);        int dateColumn = c.getColumnIndex(android.provider.CallLog.Calls.DATE);        int typeColumn = c.getColumnIndex(android.provider.CallLog.Calls.TYPE);        int durationColumn = c                .getColumnIndex(android.provider.CallLog.Calls.DURATION);        ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();        try {            boolean moveToFirst = c.moveToFirst();        }        catch (Exception e) {            ; // could not move to the first row.            return;        }        int row_count = c.getCount();        int loop_index = 0;        int is_latest_call_read = 0;        String callerPhonenumber = c.getString(numberColumn);        int callDate = c.getInt(dateColumn);        int callType = c.getInt(typeColumn);        int duration = c.getInt(durationColumn);        while ((loop_index &lt; row_count) &amp;&amp; (is_latest_call_read != 1)) {            switch (callType) {            case android.provider.CallLog.Calls.INCOMING_TYPE:                is_latest_call_read = 1;                break;            case android.provider.CallLog.Calls.MISSED_TYPE:                break;            case android.provider.CallLog.Calls.OUTGOING_TYPE:                break;            }            loop_index++;            c.moveToNext();        }        SendCallInfo(callerPhonenumber, Integer.toString(duration),                Integer.toString(callDate));    }    private void SendCallInfo(String callerPhonenumber, String callDuration,            String callDate) {        JSONObject j = new JSONObject();        try {            j.put(""Caller"", callerPhonenumber);            j.put(""Duration"", callDuration);            j.put(""CallDate"", callDate);        } catch (JSONException e) {            Toast.makeText(context, ""Json object failure!"", Toast.LENGTH_LONG)                    .show();        }        String url = ""http://xxxxxx.xxx.xx/xxxx/xxx.php"";        Map&lt;String, String&gt; kvPairs = new HashMap&lt;String, String&gt;();        kvPairs.put(""phonecall"", j.toString());        HttpResponse re;        try {            re = doPost(url, kvPairs);            String temp;            try {                temp = EntityUtils.toString(re.getEntity());                if (temp.compareTo(""SUCCESS"") == 0) {                    ;                }                else                    ;            } catch (ParseException e1) {                Toast.makeText(context, ""Parse Exception in response!"",                        Toast.LENGTH_LONG).show();                e1.printStackTrace();            } catch (IOException e1) {                Toast.makeText(context, ""Io exception in response!"",                        Toast.LENGTH_LONG).show();                e1.printStackTrace();            }        } catch (ClientProtocolException e1) {            Toast.makeText(context, ""Client Protocol Exception!"",                    Toast.LENGTH_LONG).show();            e1.printStackTrace();        } catch (IOException e1) {            Toast.makeText(context, ""Client Protocol Io exception!"",                    Toast.LENGTH_LONG).show();            e1.printStackTrace();        }    }}</code></pre><p>and here is the 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.Friend"" android:versionCode=""1"" android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&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.ACCESS_LOCATION_EXTRA_COMMANDS""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.INSTALL_LOCATION_PROVIDER""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.SET_DEBUG_APP""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.READ_SMS""&gt;&lt;/uses-permission&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Friend"" 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="".LoginInfo"" android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;service android:exported=""true"" android:enabled=""true""            android:name="".GeoUpdateService""&gt;        &lt;/service&gt;        &lt;receiver android:name="".SmsInfo""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;        &lt;receiver android:name="".PhoneInfo""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PHONE_STATE""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>The application just crashes when there is an incoming call.. i have been able to log the information about incoming SMS, but this call info logging is failing.</p><p>Thanks for any help. </p>","352272","","201354","","2011-09-09 21:48:28","2011-09-09 21:48:28","Log call information whenever there is a phone call","<android><call><logging><phone>","1","2","2","",""
"2924346","1","2924393","","2010-05-27 19:45:26","6","728","<p>IF someone has to develop the same application for Android and iPhone, is it more difficult to develop in one platform than on the other? Does it take more time?</p><p>Lets think about the average app. Lists, text , buttons, fetch information from the internet.</p><p>Person has same experience on both platforms.</p><p>Thanks</p>","237115","","237115","","2010-05-27 19:52:16","2010-05-28 13:18:18","Android dev time vs iPhone dev time","<iphone><android><time>","5","2","2","",""
"2924676","1","2924920","","2010-05-27 20:33:37","8","8824","<p>I'm working on an app that will both record an audio file, and then have the option to play back that file once it's been recorded.  The UI has an EQ component that animates relative to the current amplitude of the recording.  I've got the animation working via the MediaRecorder.getMaxAmplitude() method, but can't find any means to do this with MediaPlayer.  I know it must be possible since there are music visualization Live Wallpapers by default that perform this functionality but I can't see any way that it's pulling that information when combing through AOSP.  Does anybody know how to make this work?</p>","110539","","","","","2013-08-16 12:51:02","How do I get the current volume/amplitude in an Android MediaPlayer?","<android>","3","0","5","",""
"2924861","1","","","2010-05-27 20:58:24","0","982","<p>I have made an Android app that shows a MapView with two overlays, one MyLocationOverlay and one custom overlay. I am programmatically zooming and panning to what I want the map to show. It also auto pans to my current location.</p><p>The auto pan is moving the map away from what I want to show.</p><p>So my question is simply: How can I disable the auto pan?</p><p>Thanks,Ola</p>","352369","","540393","","2012-04-18 11:31:07","2012-04-18 11:31:07","Android MapView: Disable auto zoom","<android><android-mapview><android-maps>","1","1","","",""
"2925054","1","2925368","","2010-05-27 21:23:45","186","79081","<p>Is it possible to implement the Model-View-Controller pattern in Java for Android? Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Android?</p>","200477","","1349442","","2014-02-16 23:58:24","2014-02-19 17:28:12","MVC pattern in Android?","<java><android><design-patterns><model-view-controller>","14","1","92","",""
"2925296","1","","","2010-05-27 21:57:59","0","165","<p>What would be the best way to write an app for the iPhone OS and the Android OS that allows access to a web blog (posted on blogspot.com)? Are there ways to manipulate the incoming data from the website to fit the UI of the phones, or will I have to re-do a lot of the blogs?</p><p>Any help would be nice! And thank you in advance!</p>","345526","","","","","2010-05-27 22:59:13","iPhone + Android App to view Blog","<iphone><android><blogs>","2","0","","",""
"2925529","1","2925624","","2010-05-27 22:40:39","5","3764","<p>I am including a class in my app that another developer has made freely available. His class has a different package.</p><p>Will this cause any issues on Android, the market, etc? Does every single class in the app need to be my own package?</p>","325011","","","","","2013-02-12 09:41:30","Multiple Packages in an Android App","<android><package>","3","0","1","",""
"2925625","1","","","2010-05-27 23:02:26","1","1096","<p>I have created a sliding drawer with a handle bar and a content pane.  There seems to be a single transparent pixel between the handle bar and the content pane.  how can i get rid of this.  here is my layout xml:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;SlidingDrawer android:id=""@+id/drawer"" visible=""visible"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:handle=""@+id/handle"" android:content=""@+id/content""  android:orientation=""vertical""&gt; &lt;RelativeLayout android:id=""@id/handle""  android:background=""@drawable/slider_gradient"" android:layout_width=""fill_parent""  android:orientation=""horizontal"" android:layout_height=""44dip""&gt;  &lt;ImageView android:id=""@+id/slider_icon""   android:layout_width=""44dip"" android:layout_height=""44dip""   android:layout_gravity=""left"" android:layout_alignParentLeft=""true""   android:src=""@drawable/icon""&gt;  &lt;/ImageView&gt;  &lt;TextView android:layout_width=""wrap_content""   android:layout_height=""wrap_content"" android:id=""@+id/selected_list_view""   android:textColor=""@android:color/black"" android:layout_toRightOf=""@id/slider_icon""   android:text="""" android:textSize=""18dip"" android:layout_alignBottom=""@id/slider_icon"" /&gt; &lt;/RelativeLayout&gt; &lt;FrameLayout android:id=""@id/content"" android:background=""@drawable/pulse_sub_row_gradient""  android:layout_width=""fill_parent"" android:orientation=""vertical""  android:layout_height=""wrap_content""&gt;  &lt;GridView android:id=""@+id/button_grid"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" android:numColumns=""auto_fit""   android:stretchMode=""columnWidth"" android:gravity=""center""&gt;  &lt;/GridView&gt; &lt;/FrameLayout&gt;&lt;/SlidingDrawer&gt;</code></pre>","352444","","","","","2011-08-12 10:54:36","Sliding drawer has 1 transparent pixel between handlebar & content pane","<android><layout><slidingdrawer>","2","0","","",""
"2925684","1","2925742","","2010-05-27 23:16:40","1","1083","<p>I have a ListView and an adapter in whick I create a linear layout and return as my created element.When this linear layout is just TextViews, the context menu appears normally,When I add a checkbox to the layout, the context menu isn't shown.Is there any solution to this problem ?</p>","267929","","","","","2011-08-30 18:34:01","Checkbox Context Menu","<android><android-widget>","1","0","1","",""
"2925933","1","2925978","","2010-05-28 00:23:16","2","2079","<p>I have built an application that I want to use as the foundation for a few other variants. The variants will come from assets / resource files and a unique AndroidManifest.xml. However, I want to be able to leave all the application code alone (modifying the package of all my classes, etc). I'm having a hard time figuring out how to do so.</p><p>My first thought was to simply have my main application in its own package, and then specify the specific application package in the manifest. However, this gives me issues with the generated R.java class, since it is generated to be in the main application's package.</p><p>Anyone have any thoughts on how to accomplish this? To have a code baseline, and the application variants happen in resources/assets and the manifest?</p>","325011","","","","","2010-05-28 00:36:35","Android Template Application?","<android><templates>","1","1","","",""
"2926098","1","2926424","","2010-05-28 01:15:07","3","1592","<p>I'm new to programming applications for the Android OS. As far as general architecture of the OS goes, I understand that processes are implemented as Linux processes and that each one is sandboxed.</p><p>However, I'm utterly confused on the IPCs and syscalls (if any) used. I know that the IBinder is a form of this; parcels are sent back and forth between processes and Bundles are array forms of parcels (?). But even that is still unfamiliar to me. Same with Intents. All in all, I don't understand what kinds of IPCs are implemented and how.</p><p>Could someone <strong>briefly</strong> explain to me the specific methods used by user level applications in Android OS to communicate with each other and the OS? I've done kernel programming and played with various IPCs in Linux (Ubuntu and Debian) so it would help immensely if this was all explained in relation to what I'm familiar with...</p><p>Thanks in advance!</p>","158584","","","","","2010-05-28 03:28:16","Can someone please explain to me the basic function of Intents in the Android OS?","<android><ipc><operating-system><android-intent>","3","0","4","",""
"2926293","1","2929070","","2010-05-28 02:18:30","2","3931","<p>In Android, <code>onContextItemSelected</code> has a single <code>MenuItem</code> argument and so it isn't clear how to identify the view selected. <a href=""http://developer.android.com/reference/android/view/MenuItem.html#getMenuInfo%28%29"" rel=""nofollow"">MenuItem.getMenuInfo</a> provides access to <a href=""http://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html"" rel=""nofollow"">Contextmenu.ContextMenuInfo</a>, but while both known subclasses provide access to the target view, there does not appear to be an accessor on the interface.</p><p>One alternative is to save the <code>View</code> provided in <code>onCreateContextMenu</code> in a private class variable which relies on <code>onCreateContextMenu</code> not being called again in the activity before <code>onContextItemSelected</code>. Another is to use the id of the <code>View</code> for the <code>itemId</code> argument of <a href=""http://developer.android.com/reference/android/view/Menu.html#add%28int,%20int,%20int,%20int%29"" rel=""nofollow"">ContextMenu.add</a>. If we do this, we would then need to identify the option selected from the context menu by using its (possibly internationalised) title.</p><p>What is the best method for identifying the <code>View</code> selected in <code>onContextSelected</code>?</p>","165495","","","","","2013-12-19 14:20:54","Identifying the view selected in a ContextMenu (Android)","<android>","5","1","2","",""
"2926298","1","","","2010-05-28 02:22:24","2","1222","<p>I am trying to add a new contact to my contact list using the new ContactContract API via my application. I have the following method based on the Contact Manager  example on android dev.</p><pre><code>    private static void addContactCore(Context context, String accountType, String accountName, String name, String phoneNumber, int phoneType) throws RemoteException, OperationApplicationException {    ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();    //Add contact type    ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)            .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType)            .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName)            .build());    //Add contact name    ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)            .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, (!name.toLowerCase().equals(""unavailable"") &amp;&amp; !name.equals("""")) ? name : phoneNumber)            .build());    //Add phone number    ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)            .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneNumber)            .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType)            .build());    //Add contact    context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);}</code></pre><p>In one example I have the flowing values for the parameters.accountType:com.googleaccountName:(my google account email)name:MikephoneNumber:5555555555phoneType:3</p><p>The call to the function returns normally without any exception being thrown however the contact is no where to be found in the contact manager on my phone. There is also no contact with that information on my phone already. Does anyone have any insight into what I might be doing wrong?</p>","345692","","","","","2012-05-13 08:33:07","Problem adding Contact with new API","<android><new-operator><contacts>","2","0","1","",""
"2926307","1","2928745","","2010-05-28 02:25:39","2","435","<p>I have an Android app that only needs internet access and would like to target API level 3 (1.5) to reach the broadest handset base. However, it appears that targeting API level 3 implicitly requires two additional permissions that are visible to users: modify sd card, and read phone state. </p><p>See: <a href=""http://stackoverflow.com/questions/1747178/android-permissions-phone-calls-read-phone-state-and-identity"">http://stackoverflow.com/questions/1747178/android-permissions-phone-calls-read-phone-state-and-identity</a>)</p><p>So the connundrum, do I target API level 4 and turn away users running 1.5, or do I target API level 3 and turn away users who are upset that my app is requesting so many permissions that it shouldn't need?</p><p>What is the smartest thing to do here? Are there really a lot of users still limited to API level 3?</p><p>I appreciate any wisdom offered! Thanks!</p>","268648","","114066","","2010-05-28 12:00:17","2010-06-01 20:42:48","Android Apps: What is the recommended targetSdk for broadest appeal?","<android><fragmentation>","3","0","1","",""
"2926354","1","","","2010-05-28 02:41:35","0","492","<p>I didn't nothing in the onResume of my Activity, but it still takes about 5 seconds between the onResume is called and the activity is really displayed. </p><p>What's happening under there?</p><p>Here is the code snip:</p><p>onResume:</p><pre><code>@Overrideprotected void onResume() {    Log.d(TAG, ""on resume &gt;&gt;&gt;"");    super.onResume();}</code></pre><p>logcat:</p><pre><code>05-28 10:36:05.621 D/LoginDialogActivity(  447): on resume &gt;&gt;&gt;05-28 10:36:06.231 I/ARMAssembler(   52): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x3e3358:0x3e33fc] in 5646001 ns05-28 10:36:10.690 I/ActivityManager(   52): Displayed activity com.aimi.appstore/.ui.activity.LoginDialogActivity: 5169 ms (total 5331 ms)</code></pre><p>AndroidManifest.xml:</p><pre><code>&lt;activity android:name="".ui.activity.LoginDialogActivity""        android:theme=""@android:style/Theme.Dialog"" /&gt;</code></pre>","234939","","950427","","2014-02-17 03:30:50","2014-02-17 03:37:02","What's happening between onResume() and the Activity being displayed?","<android>","1","5","","",""
"2926373","1","","","2010-05-28 02:49:58","0","267","<p>When we try to open an attachment file from the mail, the desktop browser asks to save / open the file. As like that I need to do in the android mobile browser. How it's possible to ask a question in the mobile browser at the time of open an attachment file (*.ics)? Can anyone help me to develop an application for this ???</p>","352528","","","","","2010-05-28 02:49:58","How to give an alert in the mobile browser?","<android>","0","3","","",""
"2926543","1","","","2010-05-28 03:51:33","2","1677","<p>I'm using autoLink=""web"" attribute in TextView to launch Browser.However, I want to launch the myActivity with WebView, when I click the links in TextView.Is is possible that catch the click event and invoke startActivity?</p><p>Thanks in advance,Jason</p>","352557","","","","","2010-05-28 08:47:58","Android Autolink to launch WebView","<android><url><browser><webview><textview>","1","0","1","",""
"2927012","1","2927067","","2010-05-28 06:29:35","5","33119","<p>I like to <strong>decrease/change</strong> the spinner size which include:</p><p><strong>1)</strong> the spinner object size.</p><p><strong>2)</strong> the font displayed , its size and color.</p><p><strong>3)</strong> when I open spinner the list view which is displayed, its font size and color.</p><p>thankx</p>","328518","","1722818","","2013-07-11 07:54:51","2013-07-11 07:54:58","How to change/decrease android spinner size","<android><spinner>","2","0","2","",""
"2927083","1","8759117","","2010-05-28 06:45:00","3","3515","<p>is there a methods to keep  mobile phone off using code, i have no idea about this,and hope someone give me some advice,or example , code,api</p><p>thank you</p>","233618","","","","","2012-01-06 14:12:06","How to realize the shutdown using code","<android>","2","3","3","",""
"2927084","1","2931237","","2010-05-28 06:45:22","3","5869","<p>Im trying to swipe left and right on a listview and get the viewflipper to swtich. Just like the remeberthemilk app and the default news and weather app on the nexus one (Swiping through news topics). Using various tutorials ive found , i came across on one stackoverflow that shows how to implement a swipe gesture</p><pre><code>    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 true;            // right to left swipe            if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {            }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                viewFlipper.setInAnimation(slideRightIn);                viewFlipper.setOutAnimation(slideRightOut);                viewFlipper.showPrevious();            }        } catch (Exception e) {            // nothing        }        return true;    }}</code></pre><p>And i got this working by doing </p><pre><code>  lstView.setOnTouchListener(gestureListener);</code></pre><p>However sometimes what would happen is the listview setOnItemClickListener would be fired when the person is swiping. How do i prevent this from happening, and only get the setOnItemClickListener fired when the user actually clicks on it list item and not just swiping on it.</p><p>Thanks,Faisal Abid</p>","117691","","","","","2013-05-21 13:00:50","Listview Swipe inside viewflipper","<android><listview>","3","0","3","",""
"2927332","1","2927468","","2010-05-28 07:33:57","2","447","<p>I've seen in applications a popup that prompts me what I do want to do with a text. I am prompted to choose from Send by SMS, Send by Email, Send by Bluetooth, Send by Fring etc.</p><p>How do I make such a popup, it seamed to be automatically built?<br>Also how do I tell what message to use?<br>And if needed how do I tell who the contact is? Maybe chooses the options based on the contact, (if has email, show email)</p>","243782","","114066","","2012-01-27 12:22:50","2012-01-27 12:22:50","How to raise an action picker with options of Send to via sms, email, etc","<android>","1","0","1","",""
"2927762","1","2927892","","2010-05-28 09:07:27","3","2741","<p>A new question about android and services. Currently I'm developing a App that should send images to a server. It should also be possible to send more images parallel. </p><p>I made a service that creates for every image a new image. The activity can bind to that service and gather information about the progress. I want to show the current status for every image in a notification (and when the user clicks a notification, an activity with the progress for that image should be shown).</p><p>But I get several problems with that approach. There are errors with binding, the notification pending event starts the activity completly new, so I lose information about currently sending images and so on.</p><p>Can someone plase tell me, how I could design such a problem in a appropriate way.</p><p>thx</p>","316353","","","","","2010-05-28 12:18:15","Android Service Multiple Thread Design","<android><design><service>","1","0","2","",""
"2928002","1","","","2010-05-28 09:49:03","39","48669","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue-while-loading-an-image-to-a-bitmap-object"">Android: Strange out of memory issue while loading an image to a Bitmap object</a>  </p></blockquote><p>i am downloading images from Url and displaying them. At download time it is giving <code>out of memory error : bitmap size exceeds VM budget</code>. I am using drawable. Code is below:</p><pre><code>HttpClient httpclient= new DefaultHttpClient();HttpResponse response=(HttpResponse)httpclient.execute(httpRequest);HttpEntity entity= response.getEntity();BufferedHttpEntity bufHttpEntity=new BufferedHttpEntity(entity);InputStream instream = bufHttpEntity.getContent();Bitmap bm = BitmapFactory.decodeStream(instream);Bitmap useThisBitmap = Bitmap.createScaledBitmap(bm,bm.getWidth(),bm.getHeight(), true);bm.recycle();BitmapDrawable bt= new BitmapDrawable(useThisBitmap);System.gc();</code></pre><p>Here is the error: <code>05-28 14:55:47.251: ERROR/AndroidRuntime(4188): java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></p>","304961","","263521","","2010-05-28 10:03:18","2012-09-28 15:02:44","OutOfMemoryError: bitmap size exceeds VM budget :- Android","<android><bitmap><out-of-memory>","7","9","16","2012-10-01 11:12:19",""
"2928101","1","2932030","","2010-05-28 10:05:44","62","63584","<p>I'm trying to apply a linear gradient to my ListView.This is the content of my drawable xml:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;gradient         android:startColor=""#3A3C39""         android:endColor=""#181818""        android:angle=""270""     /&gt;    &lt;corners android:radius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>So I apply it to my ListView with:</p><pre><code>android:background=""@drawable/shape_background_grey""</code></pre><p>It works but it looks very ""banded"" on emulator and on a real device too.</p><p>Is there any way to reduce this ""behaviour""?</p>","329692","","225647","","2012-09-29 23:22:01","2014-02-13 12:05:56","Android: Using linear gradient as background looks banded","<android><gradient><shape>","5","3","37","",""
"2928153","1","2930921","","2010-05-28 10:16:04","0","1245","<p>I'm creating mobile version of YouTube-like website. And i'm going to use Darwin Streaming Server for streaming low-res clips compressed with x264 and NeroAAC and hinted with MP4Box.</p><p>When i'm playing it with VLC player streaming works fine, as expected. When i'm trying to open URL with my HTC Hero, it switches to player mode, then starts ""loading video"" animation, then after some time it shows ""unable to connect to server"". Sample movies provided with DSS streamed fine regardless bitrate.</p><p>I tried few encoding options, but always the same result. I suspect nocabac and level=11 but it didn't changed nothing.</p><p>Is there some more specific encoding options for such type? </p><p>Thank You!</p>","433242","","433242","","2010-05-28 10:35:28","2010-05-28 16:53:20","Can't correctly stream x264 video to mobile via RTSP","<android><rtsp><aac><mencoder><x264>","1","2","2","",""
"2928184","1","","","2010-05-28 10:21:16","1","481","<p>The table ""credentials"" does show up in the adb shell.  I've checked logcat and it doesn't seem to report a problem...</p><pre><code>   private static final String DATABASE_CREATE =        ""create table credentials (_id integer primary key autoincrement, ""                + ""username text not null, password text not null, ""                + ""lastupdate text);""      + ""create table user (_id integer primary key autoincrement, ""                + ""firstname text not null, ""                + ""lastname text not null);""      + ""create table phone (_phoneid integer primary key autoincrement, ""                + ""userid integer not null, phonetype text not null, ""                + ""phonenumber text not null);""      + ""create table email (_emailid integer primary key autoincrement, ""                + ""userid integer not null, emailtype text not null, ""                + ""emailaddress text not null);""      + ""create table address (_addressid integer primary key autoincrement,""
                + ""userid integer not null, addresstype text not null, ""                + ""address text not null);""      + ""create table instantmessaging (_imid integer primary key autoincrement, ""                + ""userid integer not null, imtype text not null, ""                + ""imaccount text not null);"";</code></pre><p>I've been pouring over this and I bet its some silly syntax typo!  Or, at least I hope it is something trivial ;-)</p>","352783","","314488","","2012-02-10 05:32:47","2012-02-10 05:32:47","Only first table in create table statement being created","<android><sqlite><sqlite3>","3","0","","",""
"2928214","1","2929137","","2010-05-28 10:28:50","0","2455","<p>I guess many people already read this article:</p><p><a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-2/#comment-12368"" rel=""nofollow"">Using your own SQLite database in Android applications: <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-2/#comment-12368"" rel=""nofollow"">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-2/#comment-12368</a></a></p><p>However it's keep bringing IOException at</p><pre><code>while ((length = myInput.read(buffer))&gt;0){    myOutput.write(buffer, 0, length);}</code></pre><p>I’am trying to use a large DB file. <strong>It’s as big as >8MB</strong>I built it using sqlite3 in Mac OS X, inserted UTF-8 encoded strings (for I am using Korean),added android_meta table with ko_KR as locale, as instructed above.</p><p>However, When I debug, it keeps showing IOException at</p><pre><code>length=myInput.read(buffer)</code></pre><p>I suspect it’s caused by trying to read a big file. If not, I have no clue why.I tested the same code using much smaller text file, and it worked fine.</p><p><strong>Can anyone help me out on this? I’ve searched many places, but no place gave me the clear answer, or good solution.Good meaning efficient or easy.</strong></p><p>I will try use <strong>BufferedInput(Output)Stream</strong>, but if the simpler one cannot work, I don’t think this will work either.</p><p><strong>Can anyone explain the fundamental limits in file input/output in Android, and the right way around it, possibly?</strong>I will really appreciate anyone’s considerate answer. Thank you.</p><p>WITH MORE DETAIL:</p><pre><code>private void copyDataBase() throws IOException{     //Open your local db as the input stream     InputStream myInput = myContext.getAssets().open(DB_NAME);     // Path to the just created empty db     String outFileName = DB_PATH + DB_NAME;     //Open the empty db as the output stream     OutputStream myOutput = new FileOutputStream(outFileName);     //transfer bytes from the inputfile to the outputfile     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();    }</code></pre>","259765","","","","","2011-02-02 06:14:55","How to read LARGE Sqlite file to be copied into Android emulator, or device from assets folder?","<android><file><sqlite><input>","4","1","3","",""
"2928225","1","2929160","","2010-05-28 10:29:54","0","815","<p>When my server gaves apk file to user, I need to put some values In this file, for j2me platform I use JAD file, and put my values there:</p><p><code>MY_KEY: SomeKeyValueMY_KEY2: SomeKeyValue2</code></p><p>When j2me application starts on device, I can access this values through System.getProperty.</p><p>How can I do the same on android platform?</p>","309955","","309955","","2010-05-28 11:59:16","2010-05-28 13:05:35","J2ME JAD file analog in Android","<android><java-me><jad>","1","2","1","",""
"2928352","1","","","2010-05-28 10:54:55","5","4640","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3393918/how-to-implement-an-endless-gallery-in-android"">How to implement an endless gallery in Android?</a>  </p></blockquote><p>does anobody know how to make a gallery using the gallery widget instead of having edges let you cycle indefinitly.</p>","352809","","422060","","2012-06-13 08:37:24","2013-01-16 11:30:52","android gallery widget infinite scroll","<android><android-widget>","2","1","2","2013-01-16 13:57:51",""
"2928401","1","2928416","","2010-05-28 11:05:05","14","4285","<p>Here is how I setup my checked text view. How come no check box appeared?</p><p>I also added this but it had not effect:        listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);</p><pre><code> &lt;CheckedTextView android:id=""@+id/ctv_checktext"" android:layout_width=""fill_parent"" android:paddingLeft=""2px"" android:paddingRight=""2px"" android:paddingTop=""2px"" android:layout_height=""wrap_content"" /&gt;</code></pre>","108495","","593709","","2012-07-05 12:40:55","2012-07-05 12:40:55","My checkbox does not appear in my CheckedTextView","<android>","2","0","2","",""
"2928530","1","","","2010-05-28 11:29:03","0","287","<p>A checkedTextView shows a text box and a checkbox.</p><p>Is it possible for code to determine if only the checkbox part was clicked? </p><p>If so, the code could respond differently the user clicking the checkbox or the text view.</p>","108495","","","","","2010-05-28 11:47:32","Which part of the CheckedTextView was clicked?","<android>","1","0","","",""
"2928854","1","2929230","","2010-05-28 12:18:35","0","1178","<p>I'm pretty sure it's not viable to do what I'd like to based on some initial research, but I figured it couldn't hurt to ask the community of experts here in case someone knows a way.</p><p>I'd like to create a custom field for contacts that the user is able to edit from the main Contacts app; however, the user should only be allowed to select from a list of four specific values.  A short list of string values would be ideal, but an int with a min/max range would suffice.</p><p>I'm interested in knowing if it's possible either way, but also wondering if it make sense to go this route performance wise.  More specifically, would it be better to look up a contact (based on a phone number) each time a call or SMS message is received or better to store my own set of data (consisting of name, numbers, and the custom field) and just syncing contact info in a thread every so often?  Or syncing contacts the first time the app is run and then registering for changes using <code>ContentObserver</code>?</p><p>Here is a similar question with an <a href=""http://stackoverflow.com/questions/2733589/how-to-add-new-fields-to-the-contact"">answer that explains how to add a custom field to a contact</a>.</p><p>Thanks in advance.</p>","202870","","","","","2010-05-28 13:16:02","Possibility of a custom Contacts field with a set list of values and Contacts lookup performance","<android><performance><contacts>","1","0","","",""
"2928902","1","4981308","","2010-05-28 12:26:00","3","6850","<p>i am using followingexample of date picker</p><p><a href=""http://developer.android.com/guide/tutorials/views/hello-datepicker.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-datepicker.html</a></p><p>now i want to perform some functionality on clicking date picker cancel button but dont see cancel event inside datepickerdialog</p><p>can any one guide me how to achieve this.</p><p>any help would be appreciated.</p>","249991","","","","","2014-01-01 14:10:53","can we get cancel click listerner of datepicker dialog?","<android><datepicker>","6","0","2","",""
"2928904","1","2930648","","2010-05-28 12:26:04","7","18908","<p>I have a Imageview in main.xml, how to set the bitmap the to the imageView in main.xml i can assign bitmap to the local image view in the below code.</p><p>//Activates the Camera</p><pre><code>    Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");    startActivityForResult(intent, 1);</code></pre><p>//  get the bitmap data from the Camera</p><pre><code>     Bundle extras = data.getExtras();     Bitmap b = (Bitmap) extras.get(""data"");     int width = b.getWidth();     int height = b.getHeight();     ImageView img = new ImageView(this);     img.setImageBitmap(b);</code></pre><p>//Saves the  image</p><pre><code>     MediaStore.Images.Media.insertImage(getContentResolver(), b, timestamp, timestamp);</code></pre><p>// Set the View</p><pre><code>      setContentView(img);</code></pre>","164850","","","","","2013-06-04 12:36:02","how to set the bitmap the to the ImageView in main.xml captured from the camera?","<android><bitmap><imageview>","1","0","1","",""
"2928965","1","2929861","","2010-05-28 12:33:59","7","1849","<p>I'm trying to implement a menu in the footer of an app, similar to i.e. the Engadget app. As I understand, getting a standard TabLayout to work in this way is not trivial (if at all possible?). </p><p>As I see quite a few apps using this interface paradigm, I would assume there is a clever way of doing it. Currently, I'm defining the layout by adding an include line at the end of every layout. This works fine as far as rendering is concerned, but I have to add the onClickListeners to each activity. can we define clickListener through XML?</p><p>To sum up my question: What is the best way to implement a shared footer navigation accross several Activities?</p>","184844","","","","","2010-05-28 14:33:00","Best way to reuse a footer menu in Android","<android><menu><footer>","3","0","4","",""
"2928981","1","","","2010-05-28 12:37:36","0","103","<p>I have specified textSize=""3mm"" but when I run the code on the droid the text is much smaller.  I looks like the size has been specified in px.  I am using minSdk=4 and anydensity = ""true"".  So it seems like if I ask for 3mm I should get 3mm, right?</p><p>Thanks in advance.</p>","320354","","","","","2010-05-28 17:32:42","textSize gets scaled on droid but shouldn't be","<android>","2","0","","",""
"2929171","1","","","2010-05-28 13:06:32","1","625","<p>Can someone explain a couple of very simple concepts to me - I'm interested in mobile devices running android and how they are identified over networks. Some scenarios:</p><ul><li><strong>Device is connected over WiFi</strong> - presumably the device has a standard IP address as with any host and can communicate with any other android host over TCP/IP (assuming it knows the participating device's IP?</li><li><strong>Device is connected over bluetooth</strong> - how are devices identified in this case?</li><li><strong>Device is connected over mobile operator's network</strong> - this is the one I'm interested in and confused by - is there anyway for two or more devices to discover each other and communicate via the mobile operator's network? How does a device communicate with a backend server in this scenario? In other words, how do apps and devices communicate when <strong>not</strong> connected to a WiFi network?</li></ul><p>Thanks for any advice.. </p>","146588","","","","","2010-05-28 16:38:15","Android - modes of connectivity, device identification and device inter-communication?","<android><connectivity>","2","0","","",""
"2929248","1","","","2010-05-28 13:18:21","0","3857","<p>How to clear the cached image from memory programatically in android? i am iconic list view when i scroll its reloads the image.So its produce the  OutofMemoryError. i want clear the cache while gets this exception. how to do that? any help?</p><p>EDIT:i am just using this code on my program to loadimage:<a href=""http://ballardhack.wordpress.com/2010/04/10/loading-images-over-http-on-a-separate-thread-on-android/"" rel=""nofollow"">http://ballardhack.wordpress.com/2010/04/10/loading-images-over-http-on-a-separate-thread-on-android/</a></p>","267269","","267269","","2010-05-28 14:56:06","2011-01-02 19:22:55","how to clear the cached images in Android?","<android><listview><caching><android-lazyadapter>","3","1","3","",""
"2929393","1","2929777","","2010-05-28 13:34:05","6","14458","<p>I am currently learning about widgets in Android.</p><p>I want to create a WIFI widget that will display the SSID, the RSSI (Signal) level.</p><p>But I also want to be able to send it data from a service I am running that calculates the Quality of Sound over wifi.</p><p>Here is what I have after some reading and a quick tutorial:</p><hr><pre><code>public class WlanWidget extends AppWidgetProvider{RemoteViews remoteViews;AppWidgetManager appWidgetManager;ComponentName thisWidget;WifiManager wifiManager;public void onUpdate(Context context, AppWidgetManager appWidgetManager,        int[] appWidgetIds) {        Timer timer = new Timer();        timer.scheduleAtFixedRate(new WlanTimer(context, appWidgetManager), 1, 10000);}private class WlanTimer extends TimerTask{        RemoteViews remoteViews;        AppWidgetManager appWidgetManager;        ComponentName thisWidget;public WlanTimer(Context context, AppWidgetManager appWidgetManager) {        this.appWidgetManager = appWidgetManager;        remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);        thisWidget = new ComponentName(context, WlanWidget.class);        wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);}@Overridepublic void run() {        remoteViews.setTextViewText(R.id.widget_textview,        wifiManager.getConnectionInfo().getSSID());        appWidgetManager.updateAppWidget(thisWidget, remoteViews);}}</code></pre><hr><p>The above seems to work ok, it updates the SSID on the widget every 10 seconds.</p><p>However what is the most efficent way to get the information from my service that will be already running to update periodically on my widget?</p><p>Also is there a better approach to updating the the widget rather than using a timer and timertask? (Avoid polling)</p><p><strong>UPDATE</strong></p><p>As per Karan's suggestion I have added the following code in my Service:</p><hr><pre><code>RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);ComponentName thisWidget = new ComponentName( context, WlanWidget.class );remoteViews.setTextViewText(R.id.widget_QCLevel, "" "" + qcPercentage);AppWidgetManager.getInstance( context ).updateAppWidget( thisWidget, remoteViews );</code></pre><hr><p>This gets run everytime the RSSI level changes but it still never updates the TextView on my widget, any ideas why?</p><p><strong>EDIT</strong></p><p>Got it working, thanks Karan</p>","243999","","243999","","2010-05-28 15:50:01","2010-05-28 15:50:01","How to update a Widget dynamically (Not waiting 30 min for onUpdate to be called)?","<android><widget><dynamic>","2","1","8","",""
"2929562","1","2929927","","2010-05-28 13:53:48","33","9206","<p>I have one Application class to keep the global state of my application. But I'm unable to register it in Manifest file? Any idea how to do this?</p>","343679","","6391","","2010-08-15 03:55:24","2014-03-13 19:22:02","Register Application class in Manifest?","<android><android-manifest>","1","0","6","",""
"2930113","1","","","2010-05-28 15:03:47","-1","1875","<p>I am switching activities on tab clicks and successful at this. But, in one of my Activity class I am doing the following:` public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.main);</p><p>}<code>main.xml has the following:</code><pre><code>android:layout_width=""fill_parent""android:layout_height=""fill_parent""    android:background=""#BDBDBD""&gt;</code></pre><p><code>I want to change the background of this layout only and I want tabs to their as it is. But with the current</code>android:layout_height=""fill_parent""<code>in main.xml my background is overwriting the tabs which means I am unable to see tabs. and If I make</code>android:layout_height=""wrap_content""` I cannot see any change taking and tabs are still their.</p><p>Please help. </p><hr><p>Here is some information..screen2.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><p></p><p></p><p></p><p></p><p>screen1.xml    </p><pre><code>        &lt;FrameLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""#c6c3c6""    android:layout_gravity=""bottom""    android:paddingTop=""1dip""    android:paddingLeft=""1dip""    android:paddingRight=""1dip""&gt;    &lt;TabWidget    android:layout_gravity=""bottom""        android:id=""@android:id/tabs""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""/&gt;    &lt;/FrameLayout&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" &gt;                    &lt;/FrameLayout&gt;            &lt;/TabHost&gt;  </code></pre><p>MainActivity.java</p><pre><code>public class onstarAndroidMain extends TabActivity {public void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.screen1);addTabs();}private void addTabs(){Resources resources = getResources();TabHost tabs = (TabHost) findViewById(android.R.id.tabhost);tabs.setup();//tabspec defines the attributes of the tabTabSpec tab;tab = tabs.newTabSpec(""Screen1"");tab.setContent(new Intent(this, Screen1.class));tab.setIndicator(""Screen1"");tabs.addTab(tab);tabs.getTabWidget().getChildAt(0).getLayoutParams().height = 30;tab = tabs.newTabSpec(""Screen2"");tab.setContent(new Intent(this, Screen2.class));tab.setIndicator(""Screen2"");tabs.addTab(tab);tabs.getTabWidget().getChildAt(1).getLayoutParams().height = 30;tab = tabs.newTabSpec(""Screen3"");tab.setContent(new Intent(this, Screen3.class));tab.setIndicator(""Screen3"");tabs.addTab(tab);tabs.getTabWidget().getChildAt(2).getLayoutParams().height = 30;//sets the current tabtabs.setCurrentTab(0);//add the tabhost to the main content view}</code></pre><p>}</p><p>Screen2.java</p><pre><code>public class OnstarScreen2 extends Activity {@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);   setContentView(R.layout.screen2);       }</code></pre><p>Now whenever I click the screen2 tab and try to get the screen2.xml, my tabs are going below the screen2 layout. I dont know what to do. Basically what I want to achieve is that the tab should be always their at the bottom irrespective of what view is shown above them. they should not be overlapped with anything else. </p><p>screen2.xml has a scrollview and iside that I have a linearlayout which has a login form...but this form whenever is called just comes above the tabs...please help</p>","344201","","1288","","2011-09-15 02:35:11","2011-09-15 02:35:11","How to set the background color of new activity after clicking tabs","<android>","1","1","","",""
"2930350","1","2930400","","2010-05-28 15:38:33","1","476","<p>I would like to know, what limitations there are for how far one can go in terms of replacing UI components of current touch screen smart phones, in particular iPhone, Blackberry and android based phones.</p><p>What I would like to do is create a custom UI for dialing out and incoming calls. </p><p>I have some experience with Blackberry development. The theme builder for it, can be used to customize certain items on the incoming call screen, but it doesn't look like that you can increase the size of answer button. I know Blackberry also gives you access to all the phone APIs, but I'm not sure that you can create your own UI that can gain preference over the Blackberry incoming call screen. And if you try to customize the incoming call screen by adding any buttons to it, they would be rendered as pictures. </p><p>I could possibly design a complete UI for android, since different manufactures have different UI for android based phones. </p><p>Can I do what I want to do using iPhone, Blackberry or android? Or any other phone for that matter? I am guessing may be for Nokia phones using Qt, but I prefer the 3 platforms I listed. </p><p>Thanks for all your help. </p>","296919","","","","","2012-03-19 20:36:26","smart phone UI limitations","<iphone><android><blackberry><symbian>","2","0","1","",""
"2930695","1","2930884","","2010-05-28 16:19:34","0","1012","<p>I'm trying to figure out if it is possible to launch an intent within an ExpandableListView.  Basically one of the ""Groups"" is Phone Number and its child is the number.  I want the user to be able to click it and have it automatically call that number.  Is this possible?  How?</p><p>Here is my code to populate the ExpandableListView using a Map called ""data"".</p><pre><code>ExpandableListView myList = (ExpandableListView) findViewById(R.id.myList);                //ExpandableListAdapter adapter = new MyExpandableListAdapter(data);                List&lt;Map&lt;String, String&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, String&gt;&gt;();                List&lt;List&lt;Map&lt;String, String&gt;&gt;&gt; childData = new ArrayList&lt;List&lt;Map&lt;String, String&gt;&gt;&gt;();                Iterator it = data.entrySet().iterator();                while (it.hasNext())                 {                    //Get the key name and value for it                    Map.Entry pair = (Map.Entry)it.next();                    String keyName = (String) pair.getKey();                    String value = pair.getValue().toString();                    //Add the parents -- aka main categories                    Map&lt;String, String&gt; curGroupMap = new HashMap&lt;String, String&gt;();                    groupData.add(curGroupMap);                    curGroupMap.put(""NAME"", keyName);                    //Add the child data                    List&lt;Map&lt;String, String&gt;&gt; children = new ArrayList&lt;Map&lt;String, String&gt;&gt;();                    Map&lt;String, String&gt; curChildMap = new HashMap&lt;String, String&gt;();                    children.add(curChildMap);                    curChildMap.put(""NAME"", value);                    childData.add(children);                }                // Set up our adapter                mAdapter = new SimpleExpandableListAdapter(                        mContext,                        groupData,                        R.layout.exp_list_parent,                        new String[] { ""NAME"", ""IS_EVEN"" },                        new int[] { R.id.rowText1, R.id.rowText2  },                        childData,                        R.layout.exp_list_child,                        new String[] { ""NAME"", ""IS_EVEN"" },                        new int[] { R.id.rowText3, R.id.rowText4}                        );                myList.setAdapter(mAdapter);</code></pre>","351338","","82118","","2010-05-30 16:45:53","2010-05-30 16:45:53","Android - Launch Intent within ExpandableListView","<android><expandablelistview><android-intent>","1","0","1","",""
"2930742","1","2930844","","2010-05-28 16:25:37","1","7886","<p>Other than the brief article at android site:-</p><p><a href=""http://developer.android.com/resources/articles/contacts.html"" rel=""nofollow"">http://developer.android.com/resources/articles/contacts.html</a></p><p>I haven't seen any docs on using the new ContactsContract API. Can someone please direct me to an example/explanation of using it?</p>","289918","","","","","2010-05-28 16:42:42","Simple example of ContactsContract API","<android><contacts>","1","0","2","",""
"2930890","1","2931051","","2010-05-28 16:48:22","2","1329","<p>I'm developing a GPS tracking software on android. I need IPC to control the service from different activities. So I decide to develop a remote service with AIDL. This wasn't a big problem but now it's always running into the methods of the interface and not into those of my service class. Maybe someone could help me?</p><p>Here my AIDL file:</p><pre><code>package test.de.android.trackerinterface ITrackingServiceRemote {void startTracking(in long trackId);void stopTracking();void pauseTracking();void resumeTracking(in long trackId);long trackingState();}</code></pre><p>And the here a short version of my service class:</p><pre><code>public class TrackingService extends Service implements LocationListener{private LocationManager mLocationManager;private TrackDb db;private long trackId;private boolean isTracking = false;@Overridepublic void onCreate() {    super.onCreate();    mNotificationManager = (NotificationManager) this            .getSystemService(NOTIFICATION_SERVICE);    mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);    db = new TrackDb(this.getApplicationContext());}@Overridepublic void onStart(Intent intent, int startId) {       super.onStart(intent, startId);}@Overridepublic void onDestroy(){    //TODO    super.onDestroy();}@Overridepublic IBinder onBind(Intent intent){    return this.mBinder;}private IBinder mBinder = new ITrackingServiceRemote.Stub() {    public void startTracking(long trackId) throws RemoteException {        TrackingService.this.startTracking(trackId);    }    public void pauseTracking() throws RemoteException {        TrackingService.this.pauseTracking();    }    public void resumeTracking(long trackId) throws RemoteException {        TrackingService.this.resumeTracking(trackId);    }    public void stopTracking() throws RemoteException {        TrackingService.this.stopTracking();    }    public long trackingState() throws RemoteException {        long state = TrackingService.this.trackingState();        return state;    }};public synchronized void startTracking(long trackId) {    // request updates every 250 meters or 0 sec    this.trackId = trackId;    mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,            0, 250, this);    isTracking = true;}public synchronized long trackingState() {    if(isTracking){        return trackId;    } else        return -1;}public synchronized void stopTracking() {    if(isTracking){        mLocationManager.removeUpdates(this);        isTracking = false;     } else        Log.i(TAG, ""Could not stop because service is not tracking at the moment"");}public synchronized void resumeTracking(long trackId) {    if(!isTracking){        this.trackId = trackId;        mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                0, 250, this);        isTracking = true;    } else        Log.i(TAG, ""Could not resume because service is tracking already track "" + this.trackId);}public synchronized void pauseTracking() {    if(isTracking){        mLocationManager.removeUpdates(this);        isTracking = false;    } else        Log.i(TAG, ""Could not pause because service is not tracking at the moment"");}public void onLocationChanged(Location location) {//TODO}</code></pre><p>For easier access from the client I wrote a ServiceManager class which sets up the ServiceConnection and you can call the service methods. Here my code for this:</p><pre><code>public class TrackingServiceManager{private static final String TAG = ""TrackingServiceManager"";private ITrackingServiceRemote mService = null;private Context mContext;private Boolean isBound = false;private ServiceConnection mServiceConnection;public TrackingServiceManager(Context ctx){    this.mContext = ctx;}public void start(long trackId) {    if (isBound &amp;&amp; mService != null) {        try {            mService.startTracking(trackId);        } catch (RemoteException e) {            Log.e(TAG, ""Could not start tracking!"",e);        }    } else        Log.i(TAG, ""No Service bound! 1"");}public void stop(){    if (isBound &amp;&amp; mService != null) {        try {            mService.stopTracking();        } catch (RemoteException e) {            Log.e(TAG, ""Could not stop tracking!"",e);        }    } else        Log.i(TAG, ""No Service bound!"");}public void pause(){    if (isBound &amp;&amp; mService != null) {        try {            mService.pauseTracking();        } catch (RemoteException e) {            Log.e(TAG, ""Could not pause tracking!"",e);        }    } else        Log.i(TAG, ""No Service bound!"");}public void resume(long trackId){    if (isBound &amp;&amp; mService != null) {        try {            mService.resumeTracking(trackId);        } catch (RemoteException e) {            Log.e(TAG, ""Could not resume tracking!"",e);        }    } else        Log.i(TAG, ""No Service bound!"");}public float state(){    if (isBound &amp;&amp; mService != null) {        try {            return mService.trackingState();        } catch (RemoteException e) {            Log.e(TAG, ""Could not resume tracking!"",e);            return -1;        }    } else        Log.i(TAG, ""No Service bound!"");        return -1;}/** * Method for binding the Service with client  */public boolean connectService(){    mServiceConnection = new ServiceConnection() {        @Override        public void onServiceConnected(ComponentName name, IBinder service) {            TrackingServiceManager.this.mService = ITrackingServiceRemote.Stub.asInterface(service);            }        }        @Override        public void onServiceDisconnected(ComponentName name) {            if (mService != null) {                mService = null;            }        }    };        Intent mIntent = new Intent(""test.de.android.tracker.action.intent.TrackingService"");        this.isBound = this.mContext.bindService(mIntent, mServiceConnection, Context.BIND_AUTO_CREATE);        return this.isBound;}public void disconnectService(){        this.mContext.unbindService(mServiceConnection);        this.isBound = false;}}</code></pre><p>If i now try to call a method from an activity for example start(trackId) nothing happens. The binding is OK. When debugging it always runs into the startTracking() in the generated ITrackingServiceRemote.java file and not into my TrackingService class. Where is the problem? I can't find anything wrong.</p><p>Thanks in advance! </p><p>Tobias</p>","353048","","","","","2012-06-02 23:43:41","Android remote service doesn't call service methods","<android><service><aidl>","1","0","","",""
"2931077","1","","","2010-05-28 17:15:33","1","658","<p>I am switching activities on tab clicks and successful at this. But, in one of my Activity class I am doing the following: <code>public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main);}</code></p><p>main.xml has 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:background=""#BDBDBD""&gt;</code></pre><p></p><p>I want to change the background of this layout only and I want tabs to their as it is. But with the currentandroid:layout_height=""fill_parent""in main.xml my background is overwriting the tabs which means I am unable to see tabs. and If I makeandroid:layout_height=""wrap_content""` I cannot see any change taking and tabs are still their.</p>","344201","","","","","2011-04-02 00:38:31","How to set the background color of new activity after clicking tabs","<android>","1","0","","",""
"2931251","1","2931376","","2010-05-28 17:40:33","1","1400","<p>Is there any way to place a custom icon for each group item?  Like for phone I'd like to place a phone, for housing I'd like to place a house.  Here is my code, but it keeps throwing a Warning and locks up on me.</p><pre><code>ListView myList = (ListView) findViewById(R.id.myList);                //ExpandableListAdapter adapter = new MyExpandableListAdapter(data);                List&lt;Map&lt;String, Object&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();               // List&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt; childData = new ArrayList&lt;List&lt;Map&lt;String, String&gt;&gt;&gt;();                Iterator it = data.entrySet().iterator();                while (it.hasNext())                 {                    //Get the key name and value for it                    Map.Entry pair = (Map.Entry)it.next();                    String keyName = (String) pair.getKey();                    String value = pair.getValue().toString();                    //Add the parents -- aka main categories                    Map&lt;String, Object&gt; curGroupMap = new HashMap&lt;String, Object&gt;();                    groupData.add(curGroupMap);                    Log.i(""VAL"", keyName);                    if (keyName.equalsIgnoreCase(""Phone""))                        curGroupMap.put(""ICON"", findViewById(R.drawable.phone_icon));                    else if (keyName.equalsIgnoreCase(""Housing""))                        curGroupMap.put(""ICON"", findViewById(R.drawable.house_icon));                    else                        curGroupMap.put(""ICON"", findViewById(R.drawable.house_icon));                    curGroupMap.put(""NAME"", keyName);                    curGroupMap.put(""VALUE"", value);                }                // Set up our adapter                mAdapter = new SimpleAdapter(                        mContext,                        groupData,                        R.layout.exp_list_parent,                        new String[] { ""ICON"", ""NAME"", ""VALUE"" },                        new int[] { R.id.photoAlbumImg, R.id.rowText1, R.id.rowText2  }                        );                myList.setAdapter(mAdapter);</code></pre><p>The error i'm getting:</p><pre><code>    05-28 17:36:21.738: WARN/System.err(494): java.io.IOException: Is a directory05-28 17:36:21.809: WARN/System.err(494):     at org.apache.harmony.luni.platform.OSFileSystem.readImpl(Native Method)05-28 17:36:21.838: WARN/System.err(494):     at org.apache.harmony.luni.platform.OSFileSystem.read(OSFileSystem.java:158)05-28 17:36:21.851: WARN/System.err(494):     at java.io.FileInputStream.read(FileInputStream.java:319)05-28 17:36:21.879: WARN/System.err(494):     at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:183)05-28 17:36:21.908: WARN/System.err(494):     at java.io.BufferedInputStream.read(BufferedInputStream.java:346)05-28 17:36:21.918: WARN/System.err(494):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)05-28 17:36:21.937: WARN/System.err(494):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)05-28 17:36:21.948: WARN/System.err(494):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:271)05-28 17:36:21.958: WARN/System.err(494):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:296)05-28 17:36:21.978: WARN/System.err(494):     at android.graphics.drawable.Drawable.createFromPath(Drawable.java:801)05-28 17:36:21.988: WARN/System.err(494):     at android.widget.ImageView.resolveUri(ImageView.java:501)05-28 17:36:21.998: WARN/System.err(494):     at android.widget.ImageView.setImageURI(ImageView.java:289)</code></pre><p>Thanks in advance for your help!!</p>","351338","","351338","","2010-05-28 19:11:09","2010-05-28 19:11:09","Android - Custom Icons in ListView","<android><listview><icons>","2","0","","",""
"2931278","1","","","2010-05-28 17:45:17","2","8995","<p>I'm trying to find information on how to change the coordinate system for the canvas.  I have some vector data I'd like to draw to a canvas using things like circles and lines, but the data's coordinate system doesn't match the canvas coordinate system.  </p><p><strong>Is there a way to map the units I'm using to the screen's units?</strong></p><p>I'm drawing to an ImageView which isn't taking up the entire display.  </p><p><strong>If I have to do my own calculations prior to each drawing call, how to I find the width and height of my ImageView?</strong>  </p><p>The getWidth() and getHeight() calls I tried seem to be returning the entire canvas size and not the size of the ImageView which isn't helpful.  </p><p><strong>I see some matrix stuff, is that something that will work for me?</strong>  </p><p>I tried to use the ""public void scale(float sx, float sy)"", but that works more like a pixel level zoom rather than a vector scale function by expanding each pixel.  This means if the dimensions are increased to fit the screen, the line thickness is also increased.  </p><hr><p>Update:</p><p>After some research I'm starting to think there's no way to change coordinate systems to something else.  I'll need to map all my coordinates to the screen's pixel coordinates and do so by modifying each vector.  The getWidth() and getHeight() seem to be working better for me now.  I can say what was wrong, but I suspect I can't use these methods inside the constructor.  </p>","329999","","329999","","2010-06-01 17:40:03","2012-11-17 03:24:59","Android Canvas Coordinate System","<android><drawing><canvas><coordinate-systems>","3","1","1","",""
"2931281","1","","","2010-05-28 17:45:37","10","26718","<p>I have loaded a KML file onto an Android device. What's the easiest mechanism for loading an overlay of that KML file into Google Maps? I do not want to upload the KML file to the web but would rather open it locally.</p>","61654","","","","","2014-01-28 13:29:38","Open local KML File in Google Maps on Android","<android><google-maps><kml>","4","3","7","",""
"2931340","1","","","2010-05-28 17:54:35","0","425","<p>Ok so this is what i've got.</p><pre><code>Button anandabutton = (Button) findViewById(R.id.anandaAddressButton);anandabutton.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(),MapClass.class);        startActivityForResult(myIntent,0);    }});</code></pre><p>This method opens up my MapClass class which at the moment I just have set to show the location of one place.</p><p>But I have a load of buttons and rather than making a lot of different mapClass classes for each button, I am wondering can I just use the one class and depending on what button 'id' is pressed, it will check an 'if statement' and then put in the correct coordinates into the method to display the map. It would be a lot neater than coding up like 20-30 classes.</p><p>I'm not sure if i've explained that right so if not let me know.</p><p>Thanks for any help.</p><p>This is my map class now...</p><pre><code>public class MapClass extends MapActivity {MapView mapView;MapController mc;GeoPoint p;@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.map);    int button = getIntent().getExtras().getInt(""button"", -1);    switch(button){    case DundrumSelector.BUTTON1:        handleCoordinates(""53.288719"",""-6.241179"");        break;    case DundrumSelector.BUTTON2:        handleCoordinates(""53.288719"",""-6.241179"");        break;    }}private void handleCoordinates(String l, String b){    mapView = (MapView) findViewById(R.id.mapView);    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);    mc = mapView.getController();    String coordinates[] = {l, b};    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);    mapView.invalidate();}</code></pre><p>and then my other activity is </p><pre><code>public static final int BUTTON1 = R.id.anandaAddressButton;Button anandabutton = (Button) findViewById(R.id.anandaAddressButton);anandabutton.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(),MapClass.class);        myIntent.putExtra(""button"", BUTTON1);        startActivityForResult(myIntent,0);    }});</code></pre><p>For some reason when I try and click on any other item in the list other than BUTTON1 the program crashes. Ive had to take out BUTTON2, BUTTON3 etc because it just keeps crashing if i try and go into their view. but when i comment out this onClick method they all work fine?</p><p>Do either of you guys have any openions? Do u understand my problem?Thanks.</p>","314610","","314610","","2010-05-29 17:12:32","2010-05-29 17:12:32","Android: setting up a google map class. bit of advice required","<android><google-maps><button><onclick>","2","0","","",""
"2931366","1","2931392","","2010-05-28 17:57:48","20","15259","<p>We are beginning to learn Android, converting our iPhone apps over.</p><p>There is a rudimentary editor for layouts in Eclipse, but it's not very good. Is there a visual designer that would be on par with the iPhone ""Interface Builder"" ?</p>","172861","","","","","2012-06-21 05:42:01","Android Designer like ""Interface Builder""?","<android><layout><designer>","2","2","5","",""
"2931395","1","6313558","","2010-05-28 18:01:43","3","1029","<p>when my ListView is being filled by a custom Array Adapter, I check for a certain parameter in the current list item, and if it is false, I want to return an empty row. At the moment, I am doing this by inflating an empty xml file, but that creates ugly list item dividers when a number of items should not be shown, and is obviously not the best way ;-)!</p><pre><code>    if (list.get(position).equals(""i-dont-want-this-in-the-list-view"")){        View empty=inflater.inflate(R.layout.empty_row, parent, false);        return(empty);    }</code></pre><p>I have tried to return ""null"", but it clearly expects a View to be returned. Is there anything I could do without having to filter the list that is being used for the ListView beforehand (I want to keep it intact as I am doing other things with it, too).</p><p>Thanks, </p><p>Nick</p>","241189","","241189","","2011-03-18 20:49:22","2013-02-01 11:24:56","Return empty row in Custom ArrayAdapter?","<android><listview><listadapter>","5","0","1","",""
"2931676","1","2932331","","2010-05-28 18:47:13","2","833","<p>I've been told that Android OS stores all function calls in a stack. This can lead to many problems and cause the 'hiccups' during runtime, even if a program is functionalized properly, correct?</p><p>So the question is, how can we prevent this from happening? The obvious solution is to functionalize less, along with other sensible acts such as refraining from excessively/needlessly creating objects, performing static calls to functions that don't access fields, etc...</p><p>Is there another way though? Or can this only be done through careful code writing on the programmers' part? Does the JVM/JIT automatically optimize the bytecode during compile time to account for this??</p><p>Thanks a lot for your responses!!</p>","158584","","","","","2010-05-28 20:34:59","Ways to optimize Android App code based on function call stack?","<android><optimization><function><callstack>","1","1","","",""
"2931779","1","2932765","","2010-05-28 19:03:45","1","213","<p>Im the kinda of android developer thats fascinated with good looking tabs. Probably the best one ive seen so far is the one from the GoWalla app.</p><p>Does anyone have some initial thoughts about how they achieved that look?</p><p>Thanks</p>","2443607","","50776","","2012-10-25 11:36:54","2012-10-25 11:37:01","GoWalla application - Tabs","<android><tabs>","1","4","","",""
"2931953","1","2932177","","2010-05-28 19:36:49","16","2520","<p>How can I get rid of the gradient at the top of my screen (the very top of the blue in the screenshot below... below the notification bar)?</p><p><img src=""http://dl.dropbox.com/u/299320/device.png"" alt=""simple screenshot""></p>","76835","","76835","","2010-05-28 20:01:33","2011-08-13 20:12:26","Getting rid of the gradient at the top of an Activity (Android)","<android><gui>","1","0","14","",""
"2931968","1","","","2010-05-28 19:39:12","1","939","<p>I am building an application that uses the Facebook Graph API.</p><p>To get the access token I should send the following request</p><p><a href=""https://graph.facebook.com/oauth/authorize"" rel=""nofollow"">https://graph.facebook.com/oauth/authorize</a>?    client_id=...&amp;    redirect_uri=http://www.example.com/callback</p><p>It redirects to the redirect_uri with the code to be used as access token.</p><p>How can I capture that the HttpsURLConnection is redirected and how to get the code?</p><p>Is it possible or I need to have server that gets the access token?</p>","279637","","","","","2010-05-28 19:55:49","I want to know the HTTPSConnection redirected to which URL?","<android><facebook>","1","1","","",""
"2932362","1","","","2010-05-28 20:39:29","13","1904","<p>I've seen quite a few posts asking this question on SO but there doesn't seem to be a definitive answer (or at least an answer I like!)</p><p>I've got content protected behind basic auth (username/password) -- I can download it fine using the various HTTP download clases but for the life of me I can't sort out how to tell media player to stream it (and provide the authentication).  I saw one post that suggested it wasn't possible since the MediaPlayer is all native code and doesn't things like the Authenticator.</p><p>There are plenty of examples of how to first download to a cached copy and then play that back but....That sort of sucks (and the files maybe 100's of MB's).  I saw at least one proposal to download it in smalish chunks and then start &amp; stop the playback (redirecting to the new file) but that sort of sucks also since there would (I presume) be a stutter (I haven't tried it though)</p><p>The best idea I have at this point is to start downloading to a cache file and then when it's 'full enough' start up playback while I continue to fill the file.... I <em>hope</em> that this works (but again, haven't tried it).</p><p>Am I missing something obvious?  It's so painful to have all the various pieces almost working and I sort of convinced myself that there had to be a way to natively stream protected content (or have it take a already established &amp; qualified InputStream) but it appears no joy.</p><p>BTW I'm a Mac/iPhone guy and a newb at Android so I'm still fighting a bit of Java learning.... Excuse me if I'm missing something obvious.</p>","357100","","1288","","2011-05-18 15:37:01","2011-05-18 15:37:01","How to stream authenticated content with MediaPlayer on Android","<android><authentication><streaming><media-player>","2","4","4","",""
"2932469","1","2932527","","2010-05-28 20:56:40","1","18722","<p>I'm new in android development and I am trying out the WebView example in the official android site.</p><p><a href=""http://developer.android.com/guide/tutorials/views/hello-webview.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-webview.html</a></p><p>But I do everything they say...which is pretty simple: I create the project, edit the layout file, then I add the code, etc. No problems building...but when I launch the app in the simulator I just got a black screen. It is like if the Layout is empty...like if the WebView is not created.</p><p>What am I doing wrong?</p>","353261","","759866","","2014-02-15 16:19:37","2014-02-15 16:19:37","""Hello, WebView"" example","<android><webview><hello-world><android-webview>","2","0","2","",""
"2932739","1","2933181","","2010-05-28 21:47:30","0","2493","<p>I am trying to launch the Main Activity from a broadcast receiver. Can anyone guide me as to how I can do it? I always get ""Process is Bad"" message.</p><p>Thanks</p>","239850","","","","","2012-02-16 22:31:24","Starting an activity from Broadcast receiver in android","<android><activity><android-intent><broadcast><broadcastreceiver>","2","1","","",""
"2932791","1","2932913","","2010-05-28 21:57:33","1","1509","<p>I'm just getting my feet wet with Android and have built a UI that contains a TabHost with three tabs.  Each tab is powered by its own Activity.  The first Tab contains a listview with a prepopulated set of rows and is built from a custom ArrayAdapter.  </p><p>The problem I'm running into is that none of the ListView rows are tappable.  In other words, when I tap on them there is no orange selection.  If I use the scroll ball on my Nexus One it will select, but any touch gestures don't seem to be responding.</p><p>All the UI is being handled using XML files with a main.xml housing the TabHost -> LinearLayout -> TabWidget/FrameLayout and a nearby_activity.xml file containing my ListView UI</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/android:empty""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:text=""@string/nearby_no_events""   /&gt;    &lt;ListView     android:id=""@android:id/list""     android:layout_width=""fill_parent""     android:layout_height=""0dip""     android:layout_weight=""1.0""    android:choiceMode=""multipleChoice""    android:divider=""#d9d9d9""    android:dividerHeight=""1px""        android:cacheColorHint=""#eee""    /&gt;  &lt;/LinearLayout&gt;</code></pre><p>And the relevant code from my Activity that is set to show in the selected tab.</p><pre><code>public class NearbyActivity extends ListActivity{    private ArrayList&lt;Event&gt; m_events = null;    private EventAdapter m_adapter = null;    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.nearby_activity);            getEvents();        this.m_adapter = new EventAdapter(this, R.layout.eventrow, m_events);        setListAdapter(this.m_adapter);    }    private void getEvents()     {        m_events = new ArrayList&lt;Event&gt;();        for (int i = 0; i &lt; 100 ; i++)        {            Event e = new Event();            e.setEventName(""Event "" + i);            e.setVenueName(""Staples Center"");            e.setStartDate(new Date());            m_events.add(e);        }    }    private class EventAdapter extends ArrayAdapter&lt;Event&gt;    {        private ArrayList&lt;Event&gt; items;    public EventAdapter(Context context, int textViewResourceId, ArrayList&lt;Event&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.eventrow, null);      }      Event e = items.get(position);              if (e != null)       {        TextView nameText = (TextView)v.findViewById(R.id.eventName);        TextView venueNameText = (TextView)v.findViewById(R.id.venueName);        if (nameText != null)         {            nameText.setText(e.getEventName());                                    }        if(venueNameText != null)        {            venueNameText.setText(e.getVenueName());        }      }      return v;    }    }}</code></pre><p>My listview row's are populated by an XML file as well.  </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:orientation=""vertical""  android:padding=""4dip""&gt;  &lt;TextView    android:id=""@+id/eventName""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:inputType=""text""    android:singleLine=""true""    android:ellipsize=""marquee""    android:textSize=""18sp""    android:textColor=""#000""   /&gt;  &lt;TextView    android:id=""@+id/venueName""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@id/eventName""        android:layout_alignParentBottom=""true""    android:layout_marginRight=""55dip""        android:singleLine=""true""    android:ellipsize=""end""    android:scrollHorizontally=""true""    android:textSize=""13sp""    android:textColor=""#313131""    android:layout_alignWithParentIfMissing=""true""    android:gravity=""center_vertical""   /&gt;      &lt;/RelativeLayout&gt;</code></pre><p>Thanks for any help you can offer.</p>","54201","","","","","2010-05-28 22:35:56","ListView items not responding to tap","<java><android><listview><android-tabhost>","1","0","1","",""
"2932993","1","2934226","","2010-05-28 22:55:22","2","1275","<p>Does smomeone know how I set the scrollbar position in an EditView programmatically.</p><p>I'm appending the text during special events but I want the EditView to scroll down to the latest text added so it'll be visible. But default the scrollbar does not move automatically when appending text. </p><p>/ Henrik</p>","226342","","","","","2010-05-29 07:38:48","How to set text position programmatically in EditText class?","<android>","1","0","","",""
"2933054","1","","","2010-05-28 23:15:06","0","897","<p>I'm somewhat new to Android and am in the process of designing an application with a couple fairly complex views.  One of the views is intended to involve a complex view displaying information associated with model objects and segregated into several different views; the navigation of which is meant to be achieved using sliding effects (i.e. sliding one's finger across the screen to traverse from one screen to the next, etc).  The view itself will be used to host multiple sets of views for varying types of model objects, but with a general structure that is reused between them all.  As a rough example, the view might come up to display information about a person (the model object), displaying several details views:  a view for general information, a view displaying a list of hobbies, and a view displaying a list of other individuals associated with their social network.  The same general view, when given a model object representing a particular car would give several different views:  A general view with details, A view containing photo images for that vehicle, a view representing locations which it could be purchased from, and a view providing a list of related cars.  (NOTE:  This is not the real data involved, but is representative of the general intent for the view).  The subviews will NOT cover the entire screen real-estate and other features within the view should be both visible and able to be interacted with by the user.</p><p>The idea here is that there is a general view structure that is reusable and which will manage a set of subviews dynamically generated based upon the type of model object handed to the view.</p><p>I'm trying to determine the appropriate way to leverage the Android framework in order to best achieve this without violating the integrity of the framework.  Basically, I'm trying to determine how to componentize this larger view into reusable units (i.e. general view, model-specific sub-view controllers, and individual detail views).  To be more specific, I'm trying to determine if this view is best designed as a composite of several custom View classes or a composite of several Activity classes.  I've seen several examples of custom composite views, but they typically are used to compose simple views without complex controllers and without attention to the general Activity lifecycle (i.e. storing and retrieving data related to the model objects, as appropriate).  On the other hand, the only real example I've seen regarding a view comprised of a composite of Activities is the TabActivity itself, and that isn't customizable in the fashion that would be necessary for this.</p><p>Does anyone have any suggestions as to the appropriate way to structure my view to achieve the application framework I'm looking for?  Views?  Activities?  Something else?</p><p>Any guidance would be appreciated.  Thanks in advance.</p>","353320","","","","","2010-05-29 01:02:06","Composite Views and View Controllers","<android><architecture><view><structure><composite>","2","0","","",""
"2933219","1","","","2010-05-29 00:04:57","2","737","<p>When I comment out setContentView(boardView); in my Game.java my custom view in BoardView works fine and displays everything nicely... but onSizeChanged never gets called in BoardView.java... so I can't read the device width and height at runtime. If I leave setContentView uncommented onSizeChanged works... but the screen is blank!</p><p>I want to be able to read the screen width and height at runtime and set the sizes of my ImageViews at creation so they are the optimal size.</p><p>public class Game extends Activity implements OnClickListener{</p><p>private BoardView boardView;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    boardView = new BoardView(this);    setContentView(boardView);  // when this line disabled, it looks ok    boardView.requestFocus();}</code></pre><p>public class BoardView extends View { private final Game game; private float width; // width of one unit private float height; // height of one unit</p><p>public BoardView(Context context){  super(context);  this.game = (Game)context;  setFocusable(true);  setFocusableInTouchMode(true);</p><pre><code>    LinearLayout maincontainer = new LinearLayout(game);    maincontainer.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));    maincontainer.setGravity(Gravity.CENTER);    maincontainer.setOrientation(LinearLayout.VERTICAL);       maincontainer.setBackgroundColor(Color.BLACK);    LinearLayout innercontainer = new LinearLayout(game);    innercontainer.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    innercontainer.setGravity(Gravity.CENTER);    innercontainer.setOrientation(LinearLayout.HORIZONTAL);       // declare a new table    TableLayout layout = new TableLayout(game);    layout.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));     // build a grid of ImageViews in a TableLayout    for (int f=1; f&lt;=7; f++) {        TableRow tr = new TableRow(game);        for (int c=1; c&lt;=7; c++) {         ImageView b = new ImageView(game);         b.setImageResource(R.drawable.neworb);         b.setOnClickListener(game);                         tr.addView(b, 30,30);  // I'd like to not use fixed values here        } // for        layout.addView(tr);    } // for    innercontainer.addView(layout);    maincontainer.addView(innercontainer);    game.setContentView(maincontainer);</code></pre><p>}</p><p>@Override protected void onSizeChanged(int w, int h, int oldw, int oldh){  width = w/9f;  height = width;</p><p>super.onSizeChanged(w, h, oldw, oldh); }</p><p>}</p>","351469","","351469","","2010-06-02 22:56:47","2010-06-02 22:56:47","Why is my custom view not appearing?","<android>","1","0","","",""
"2933301","1","2933466","","2010-05-29 00:44:02","0","254","<p>I have a program that has items with 3 attributes.</p><p>Name(String) : Count(String) : Amount(String)</p><p>Currently I am writing the database when someone is trying to access a section then reading from the database. The writing is taking too long.</p><p>So my question is how can I perhaps create a nested array where I can say if name = carrot then print carrot['count'] and carrot['amount'].</p><p>I am very new to Java so some sample code would be great. Or any other suggestions that you may have as far as tackling this issue.</p>","282475","","","","","2010-05-29 02:12:43","String Storage and Retrieval in Android","<android><data-structures>","1","0","","",""
"2933406","1","","","2010-05-29 01:33:36","0","845","<p>I have an OnTouch and a setOnTouchListener that updates varibles which contain screen coord info. The problem is it doesnt seem to ever update them. On line 78, RGB.setText(test); it never changes from 0.0. If i were to move that line and the line above it into the onTouch it updates. any idea what is wrong? Thank you.</p><pre><code>package com.evankimia.huskybus;</code></pre><p>import com.test.huskybus.R;</p><p>import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.TextView;</p><p>public class HuskyBus extends Activity {</p><pre><code>TextView RGB;private CampusMap mCampusMap;private float startX = 0; //track x from one ACTION_MOVE to the nextprivate float startY = 0; //track y from one ACTION_MOVE to the nextfloat scrollByX = 0; //x amount to scroll byfloat scrollByY = 0; //y amount to scroll by    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            RGB = (TextView) findViewById(R.id.coordBox);            mCampusMap = (CampusMap) findViewById(R.id.map);            mCampusMap.setOnTouchListener(new OnTouchListener() {                                    @Override                                    public boolean onTouch(View v, MotionEvent event) {                                            // TODO Auto-generated method stub                                            switch (event.getAction()) {                    case MotionEvent.ACTION_DOWN:                            // Remember our initial down event location.                            startX = event.getRawX();                            startY = event.getRawY();                            break;                    case MotionEvent.ACTION_MOVE:                            float x = event.getRawX();                            float y = event.getRawY();                            // Calculate move update. This will happen many times                            // during the course of a single movement gesture.                            scrollByX = x - startX; //move update x increment                            scrollByY = y - startY; //move update y increment                            startX = x; //reset initial values to latest                            startY = y;                            mCampusMap.invalidate();                            break;            }//end switch                                            return false;                                    }                                    ;            }); //end onDraw?</code></pre><p>String test = """" + scrollByX;               RGB.setText(test);</p><pre><code>    } }</code></pre>","353355","","","","","2010-07-10 11:19:46","Problem accessing updated variables within OnTouch","<android><ontouchlistener>","1","0","","",""
"2933882","1","2934759","","2010-05-29 05:05:24","27","45134","<p>I have a simple program that draws the preview of the <code>Camera</code> into a <code>SurfaceView</code>. What I'm trying to do is using the <code>onPreviewFrame</code> method, which is invoked each time a new frame is drawn into the <code>SurfaceView</code>, in order to execute the <code>invalidate</code> method which is supposed to invoke the <code>onDraw</code> method. In fact, the <code>onDraw</code> method is being invoked, but nothing there is being printed (I guess the camera preview is overwriting the text I'm trying to draw).</p><p>This is a simplify version of the <code>SurfaceView</code> subclass I have:</p><pre><code>public class Superficie extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder mHolder; public Camera camera; Superficie(Context context) {  super(context);  mHolder = getHolder();  mHolder.addCallback(this);  mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(final SurfaceHolder holder) {  camera = Camera.open();  try {   camera.setPreviewDisplay(holder);   camera.setPreviewCallback(new PreviewCallback() {    public void onPreviewFrame(byte[] data, Camera arg1) {     invalidar();    }   });  } catch (IOException e) {} } public void invalidar(){  invalidate(); } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {  Camera.Parameters parameters = camera.getParameters();  parameters.setPreviewSize(w, h);  camera.setParameters(parameters);  camera.startPreview(); } @Override public void draw(Canvas canvas) {  super.draw(canvas);  // nothing gets drawn :(  Paint p = new Paint(Color.RED);  canvas.drawText(""PREVIEW"", canvas.getWidth() / 2,    canvas.getHeight() / 2, p); }}</code></pre>","244296","","","","","2013-05-16 15:04:35","How to draw an overlay on a SurfaceView used by Camera on Android?","<android><camera><surfaceview>","3","0","32","",""
"2933933","1","","","2010-05-29 05:28:03","2","1584","<p>I've written an RSS feed parser in Java (running on Android) and it parses some feeds perfectly, and others not at all.  I get the following error when it tries to parse Slashdot (http://rss.slashdot.org/Slashdot/slashdot)</p><pre><code>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: unbound prefix</code></pre><p>If I try to parse Wired (http://feeds.wired.com/wired/index)</p><pre><code>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: syntax error</code></pre><p>If I try to parse AndroidGuys (http://feeds.feedburner.com/androidguyscom)</p><pre><code>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: syntax error</code></pre><p>Here is some code for my parser.</p><pre><code>public void updateArticles(Context ctx, Feed feed, int numDaysToGet) {    try {        targetFlag = TARGET_ARTICLES;        tweetDB = new TweetMonsterDBAdapter(ctx);        tweetDB.open();        currentFeed = feed;        TimeZone.setDefault(TimeZone.getTimeZone(""UTC""));  // or ""Etc/GMT-1""        Date currentDate = new Date();        long dateInMillis = currentDate.getTime();        oldestDate.setTime(dateInMillis-(dayInMillis*numDaysToGet));        SAXParserFactory spf = SAXParserFactory.newInstance();        SAXParser sp = spf.newSAXParser();        XMLReader xr = sp.getXMLReader();        xr.setContentHandler(this);        xr.parse(new InputSource(currentFeed.url.openStream()));    } catch (IOException e) {        Log.e(""TweetMonster"", e.toString());    } catch (SAXException e) {        tweetDB.close();        Log.e(""TweetMonster"", e.toString());    } catch (ParserConfigurationException e) {        Log.e(""TweetMonster"", e.toString());    }    tweetDB.close();}</code></pre><p>It doesn't even get into my startElement method.</p>","326430","","","","","2011-03-22 18:58:30","Trouble parsing some RSS feeds using Java and Sax","<java><android><rss><parsing><sax>","2","0","","",""
"2934016","1","2934217","","2010-05-29 06:01:08","1","919","<p>In the microblogging application I am developing I wish to show an user image beside each post in the timeline. The images are small in size(max 50*50 dip) and are not more than 10 in number. I've two approaches in my mind. </p><p>1) Allow user to chose an <a href=""http://stackoverflow.com/questions/2507898/how-to-pick-a-image-from-gallery-for-my-app-in-android"">image from Gallery</a> on signing up. Send the image to the server and on subsequent signups load the image from the server. I'm worried whether this approach is doing too much unnecessary work.</p><p>2) The same method is same as above in first step but this time the image is not send to the server but a key value associated with the image is sent to the server. On subsequent signups, after obtaining the key from the server the specific image is loaded from gallery.</p><p>I am not sure whether the second approach is possible. Any corrections on this aspect would be much appreciated. </p><p>Also, Is it possible to store an image in SharedPreferences?</p><p>Any new approach to handle this problem better are welcome.</p>","323404","","","","","2010-05-29 07:34:25","How to handle images better in Android","<android><image><gallery><android-preferences>","1","0","","",""
"2934180","1","","","2010-05-29 07:18:13","1","1345","<p>Im new to android and am just trying to install the SDK. I have everything else done. When i run the SDK Setup.exe (ive added the ./tools to the path already.) It gives me the famous cannot fetch URL error.</p><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: Permission denied: connect</p><p>I tried the force http option and also manually adding a http:// version of the above url. It does not work at all. I am working on a windows 7 64 bit pc. Any help would be appreciated.Ramesh</p>","353460","","353460","","2010-05-29 07:43:05","2013-03-07 19:56:39","Android SDK Setup Problems","<android>","2","3","","",""
"2934185","1","","","2010-05-29 07:19:34","25","21481","<p>I put two projects into Eclipse, called Project1 and Project2.</p><p>Project1 is independent, but Project2 must be dependent to Project1.</p><p>When I build the Project2, the error msg comes like this: Error generating final archive: duplicate entry: AndroidManifest.xml</p>","313897","","21234","","2010-06-21 15:53:08","2013-12-09 21:38:07","How to fix ""Error generating final archive: duplicate entry: AndroidManifest.xml""","<android><android-manifest>","5","0","4","",""
"2934355","1","3208750","","2010-05-29 08:28:42","8","11664","<p>I just created my own ""Home"" to replace the stock android one or Sense.</p><p>All is working fine and I get all I want. My only problem is to replace to long press on home key ( that usually show the last 6 activities you launched) by my own launcher.</p><p>I successfully replace the long press on MENU button with this code:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {//Log.i(TAG,""Keycode: ""+keyCode);if (keyCode == KeyEvent.KEYCODE_MENU) {    // this tells the framework to start tracking for    // a long press and eventual key up. it will only    // do so if this is the first down (not a repeat).    event.startTracking();    return true;}(...)</code></pre><p>and this part part for the long press:</p><pre><code>  @Override    public boolean onKeyLongPress(int keyCode, KeyEvent event) {        //Log.i(TAG,""LONG""+keyCode);        Toast.makeText(Launcher.this,""LONG ""+keyCode, Toast.LENGTH_SHORT).show();        if (keyCode == KeyEvent.KEYCODE_MENU) {        (...)</code></pre><p>But the problem is that I wasn't able to replace  the KeyEvent.KEYCODE_MENU with KeyEvent.KEYCODE_HOME</p><p>is that something locked in the code that avoid user to use a Home long press?</p><p>Thank a lot for all the information you woulg give me.</p>","327402","","15825","","2010-10-11 08:17:45","2011-02-01 08:01:56","overriding the Home Key Long press in a category.HOME activity","<android><home>","2","0","5","",""
"2934548","1","2934979","","2010-05-29 09:48:19","3","4920","<p>Is their any way to apply a style resource to customize the Item Border in the Gallery Class with Android?</p><p>I'm trying to hide or change the color of the default Grey border but by the looks of things this isn't possible?</p><p>Any help or tips you can provide would be fantastic.</p><p>Appreciated,</p><p>Tom</p>","323347","","323347","","2010-05-29 11:22:05","2011-03-18 10:35:06","Applying a style to items in Android Gallery","<android><gallery>","1","0","1","",""
"2934552","1","2947335","","2010-05-29 09:49:11","1","2194","<p>Sorry my last question was not well formated. So I am deleting the content and re framing my question.</p><p>I liked @ChrisBunney answer to my question with an example to process image in another thread.</p><p>Here is proper code below</p><pre><code>public class TestActivity extends ListActivity {    int count =0;    List&lt;String&gt; listString = null;    String[] mString = null;       private RefreshHandler mRedrawHandler = new RefreshHandler();      class RefreshHandler extends Handler {            @Override            public void handleMessage(Message msg) {                TestActivity.this.updateUI();            }            public void sleep(long delayMillis) {              this.removeMessages(0);              sendMessageDelayed(obtainMessage(0), delayMillis);            }          };          private void updateUI(){              mRedrawHandler.sleep(1000);              listString.add(""Test ""+count++);              String[] mString = new String[listString.size()];              int i = 0;              for(String string : listString){                  mString[i++]= string;              }              if(null != mString &amp;&amp; mString.length&gt;0)              setListAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,mString ));          }          @Override           public void onCreate(Bundle icicle) {             super.onCreate(icicle);             setContentView(R.layout.main);            listString = new LinkedList&lt;String&gt;();            updateUI();          } }</code></pre><p>What I intend to do is call UI update from another thread.</p><p>This will be the modification to my above code file.</p><pre><code>private class HelperClass implements Runnable{            public void run() {                performSomeCalculation();            }            /*             * This code will populate the list as it is executed.             * As and when there is a new element in the list the UI is updated.             */            public void performSomeCalculation(){                //update list String                updateUI();            }/*/*           *            * The new update onCreate method calling another thread that populates the UI thread           *            */          @Override           public void onCreate(Bundle icicle) {             super.onCreate(icicle);             setContentView(R.layout.main);            listString = new LinkedList&lt;String&gt;();            //updateUI();            Thread thread = new Thread(new HelperClass());            thread.start();          }</code></pre><p>You can see in the above code I have created a HelperClass to perform some calculation , as and when there is ouput from the calculation thread it should update the UI thread.</p><p>I am working on it to make it work, if any one figures out plz update my post.</p><p>Thanks in advance.</p>","353497","","353497","","2010-05-31 12:15:41","2010-06-01 04:50:39","Android Cannot execute setListAdapter() user thread","<android>","2","3","1","",""
"2934642","1","3178817","","2010-05-29 10:25:42","1","2348","<p>I have a jpg image in my resource folder. Now i want it to be displayed in my WebView along with other text in HTML coming from a database field. How can i retrieve/display that jpg image?  </p>","2355649","","","","","2011-02-20 20:03:42","How can i retrieve a jpg image in my WebView in android","<android>","2","0","","",""
"2934658","1","","","2010-05-29 10:30:49","1","156","<p>I want to implement registration module in my android application.Can anyone please let me know the procedure.I mean, how can I use HttpRequestHandlerRegistry, SQLite connectivity etc</p><p>Thanks in advance.</p><p>Regards,serenity.</p>","353525","","","","","2010-05-29 10:30:49","How to implement Registration module in android applications?","<android>","0","0","","",""
"2934693","1","","","2010-05-29 10:45:54","4","1742","<p>I have an Android TextView where the view itself is limited to four lines. If the text exceeds this limit I want the end of the view to end with something like .. &lt;-- to notify that there is more text here so you can click and open in fullscreen for example. Not just suddenly stop in the middle of a sentence. Is there a quick fix for this?</p>","353528","","","","","2012-08-22 05:50:55","Android TextView","<android><textview>","1","0","","",""
"2934981","1","2935228","","2010-05-29 12:17:41","1","1578","<p>How to register a new MIME type in android? I am very much new to android. I need to download a *.ics file from the browser (Email attachment).but the browser response is unsupported file format.Can anyone help me ??? </p>","351928","","","","","2010-05-29 13:27:28","How to download *.ics file from the browser in android?","<android>","1","0","","",""
"2935006","1","","","2010-05-29 12:24:52","5","1961","<p>Since LOCK_PATTERN_ENABLED was moved to Settings.Secure in Froyo my app can no longer lock the screen...</p><p>Does anyone know a workaround for this? Any way that my app can instantly lock the screen? No matter if its the autolock pattern or some kind of custom lock screen...</p>","339177","","","","","2011-01-28 21:12:16","Locking an android phone (lock pattern or similar)","<android><locking><design-patterns>","1","0","2","",""
"2935030","1","2935071","","2010-05-29 12:33:00","-1","157","<p>I have set a value in spinner , from activity-1.now i am traversing to activity-2 and again coming back to activity-1, i am not getting the updated spinner value which i have selected previously  but i am getting default value(value at index 1) of spinner  . </p>","326686","","","","","2010-05-29 12:43:29","Android Spinner issue","<android>","1","0","","",""
"2935185","1","","","2010-05-29 13:13:31","0","984","<p>doesnt show the html format in outlook. please do reply me. sorry for the english</p><pre><code>private void sendEmail() {    try {          String value = ""&lt;table&gt;"" +          ""&lt;tr&gt;"" +          ""&lt;td&gt;&lt;b&gt;Name  &lt;/b&gt;&lt;/td&gt;"" +          ""&lt;td&gt;anroid&lt;/td&gt;"" +          ""&lt;/tr&gt;&lt;br&gt;"" +          ""&lt;tr&gt;"" +          ""&lt;td&gt;&lt;b&gt;Version&lt;/b&gt;&lt;/td&gt;"" +          ""&lt;td&gt;2.2&lt;/td&gt;"" +          ""&lt;/tr&gt;"" +          ""&lt;/table&gt;"";          Intent email_intent = new Intent(Intent.ACTION_SEND);          email_intent.setType(""text/html"");          email_intent.putExtra(Intent.EXTRA_SUBJECT, ""android Details"");          email_intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(value));          email_intent.setType(""vnd.android.cursor.dir/email"");          startActivity(Intent.createChooser(email_intent,""Sending mail..""));    }catch(Exception e) {    }}</code></pre>","313613","","358281","","2011-03-22 07:26:44","2012-09-03 07:42:10","Doesn't show the android email html format when receive outlook","<html><android><email>","2","2","","",""
"2935249","1","","","2010-05-29 13:34:14","3","2461","<p>Hey,I have an android devic, i wish to know when it is connected to the pc via java/.neti know its possible - the Samsung New PC Studio is doing it, when ever i connect an android device it lets me know. how can i achieve the same?</p>","353603","","","","","2010-05-29 14:01:27","Detected android device connected to PC","<java><.net><android><detect><connect>","1","0","1","",""
"2935325","1","","","2010-05-29 13:59:38","3","6538","<p>I am trying to figure out how to tell if a particular ipaddress is available in my android app during debugging ( I haven't tried this on an actual device ).</p><p>From reading it appears that InetAddress.isReachable should do this for me.</p><p>Initially I thought that I could code something like:</p><p>InetAddress address = InetAddress.getByAddress( new byte[] { (byte) 192, (byte) 168, (byte) 254, (byte) 10 );success = address.isReachable( 3000 );</p><p>This returns false even though I am reasonably sure it is a reachable address.</p><p>I found that if I changed this to 127, 0, 0, 1 it returned success.</p><p>My next attempt was same code, but I used the address I got from a ping of www.google.com ( 72.167.164.64 as of this writing ).  No success.</p><p>So then I tried a further example:</p><pre><code>int timeout = 2000;InetAddress[] addresses = InetAddress.getAllByName(""www.google.com"");for (InetAddress address : addresses){    if ( address.isReachable(timeout))    {       success = true; // just set a break point here    }}</code></pre><p>I am relatively new to Java and Android so I suspect I am missing something, but I can't find anything that would indicate what that is.</p>","104975","","","","","2010-05-30 14:29:48","Android Debugging InetAddress.isReachable","<java><android>","2","0","1","",""
"2935781","1","2936748","","2010-05-29 16:26:22","10","6170","<p>My application needs to update tab indicator dynamically, I'm trying to do this by invoke TabSpec.setIndicator(), but it doesn't work. Here is my code:</p><p>In onCreate method of TabActivity:</p><pre><code>tabHost = getTabHost(); TabSpec tabSpec = tabHost.newTabSpec(""abc"");tabSpec.setIndicator(""helloabc"");tabSpec.setContent(new MyViewFactory());tabHost.addTab(tabSpec);</code></pre><p>Now I need to change tab indicator to another string, for example, ""xyz""</p><pre><code>TabSpec tabSpec = MyTabActivity.getTabSpec();tabSpec.setIndicator(""xyz"");</code></pre><p>But it doesn't work. So I'd like to know how to change tab indicator after it is added to the tabhost? Many thanks.</p><p><strong>Solution</strong></p><p>Thanks to @CommonsWare, I make it by using TabWidget.getChildAt, here is my code for your convenience:</p><pre><code>TextView title = (TextView) tabHost.getTabWidget().getChildAt(tabId).findViewById(android.R.id.title)title.setText(""xyz"");</code></pre>","111896","","111896","","2010-05-30 03:39:07","2013-08-30 05:21:34","Modify tab indicator dynamically in Android","<android><android-tabhost>","3","1","4","",""
"2935783","1","","","2010-05-29 16:28:19","1","2536","<p>I want my Android program to be able to save an SMS on the user's inbox.<br>I already found <a href=""http://stackoverflow.com/q/642076/710951"">this question</a> which does exactly that, but this statement:</p><pre><code>getContentResolver().insert(Uri.parse(""content://sms/sent""), values);</code></pre><p>throws a <code>SecurityException</code>.</p><p>I already requested the <code>SMS_WRITE</code> permission in the manifest file.<br>Any ideas?</p>","353665","","710951","","2012-01-21 16:20:05","2012-01-21 16:26:49","android - Request correct permissions to save an SMS on Inbox","<android><sms>","3","2","","",""
"2935823","1","2936237","","2010-05-29 16:43:32","2","449","<p>Is there a simple way to tell the default media player to change track back or forward?</p><p>I want the ability to send commands to the system media player (Music) to change track back and forward from within my app.</p><p>Is there a simple way? Code examples or descriptive explanation please, I have not developed for Android before.</p><p>Update: Is it just the HTC Music that isn't part of the SDK or even the stock one? Either player would be fine if I could manage  way to change tracks.</p><p>The HTC Lock screen has some method of changing tracks in the music player. Is it possible I could get hold of this and use it?</p><p>Baksmali?</p>","353674","","353674","","2010-06-11 18:24:16","2013-12-25 04:43:26","Send music control keys from my app in android","<android>","2","0","","",""
"2935946","1","2937140","","2010-05-29 17:19:05","63","69650","<p>I want to send an image from the android client to the Django server using Http Post. The image is chosen from the gallery. At present, I am using list value name Pairs to send the necessary data to the server and receiving responses from Django in JSON. Can the same approach be used for images (with urls for images embedded in JSON responses)? </p><p>Also, which is a better method: accessing images remotely without downloading them from the server or downloading and storing them in a Bitmap array and using them locally? The images are few in number (&lt;10) and small in size (50*50 dip).</p><p>Any tutorial to tackle these problems would be much appreciated. </p><p>Edit: The images chosen from the gallery are sent to the server after scaling it to required size.  </p>","323404","","483520","","2013-02-17 20:51:40","2013-06-11 11:13:36","Sending images using Http Post","<android><django><http>","2","1","75","",""
"2936379","1","2936427","","2010-05-29 19:47:46","4","989","<p>I have years of experience with Microsoft .NET development (primarily C#) and have been working to come up to speed on Android and Java.  So far, I've built a small application with a couple screens and a working content provider.</p><p>All of the examples I've seen for developing content providers typically work with a single table, so I got the impression that this was the convention.</p><p>I built a couple more content providers for other tables and ran into the ""Unknown URI"" IllegalArgumentException when I tried to test them.  The exception is being thrown by one of my content providers, but not the one I was intending to call.</p><p>It appears that my application is using the first content provider in the AndroidManifest.xml file, which now has me wondering if I should only have a single content provider for the entire application.</p><p>Are there any best practices and/or examples for working with multiple tables in an Android application?  Should I have one content provider per table or only one for the entire application?  If the former, how do I resolve URIs to the proper provider?  If the latter, how do I keep my content provider code from being polluted with switch statements?</p>","92327","","","","","2012-06-30 04:07:43","In an Android application, should I have one content provider per table or only one for the entire application?","<java><android><android-contentprovider>","2","0","1","",""
"2936447","1","2936622","","2010-05-29 20:11:24","0","1618","<p>I've implemented a GridView based on <a href=""http://mytelcoit.com/2010/02/programming-android-create-icon-with-text-using-gridview-and-layout-inflater/"" rel=""nofollow"">this tutorial</a>. It works great unless open up the search dialog or rotate the screen then scroll around.</p><p>When the search dialog and virtual keyboard appear, the drawables for each of my grid items shift. I can click on them and they do what I expect, except the drawable is wrong.</p><p>The same problem happens when I go into landscape mode and scroll around. If I scroll down, up, the down again, the drawables are shuffled.</p><p>For better illustration, let's say I have three objects, each with an image.</p><ul><li>Obj A shows an Apple</li><li>Obj B shows a Banana</li><li>Obj C shows a Cantaloupe</li></ul><p>When the <em>shift</em> occurs I end up with:</p><ul><li>Obj A shows an Cantaloupe</li><li>Obj B shows a Banana</li><li>Obj C shows a Apple</li></ul><p>The problem isn't consistent between the two causes (search dialog and screen rotate n' scroll), but each cause itself is consistent. Scrolling around repeatedly reveals a pattern as does the search dialog appearing. How can I stop this from happening?</p>","175307","","","","","2010-05-29 21:10:47","GridView items are displaying the wrong drawables sometimes","<android><gridview>","1","0","","",""
"2936703","1","2936723","","2010-05-29 21:47:13","2","589","<p>On the iPhone/iPod touch, settings could be kept in the Settings.app. Can you do this in Android? Or must your settings be in the actual application?</p>","200477","","102536","","2013-03-25 17:38:09","2013-03-25 17:38:09","Where to put the Settings in Android?","<java><android><settings>","2","0","2","",""
"2936803","1","7940080","","2010-05-29 22:29:15","21","21735","<p>Several answers mention to use GradientDrawable.setDither(true) to draw smooth gradients in Android. That has no effect in my code. Any idea what I have to change to get a well looking gradient in my live wallpaper?</p><pre><code>GradientDrawable gradient = new GradientDrawable(Orientation.TL_BR, colors);gradient.setGradientType(GradientDrawable.RADIAL_GRADIENT);gradient.setGradientRadius(canvas.getWidth() * 2);gradient.setDither(true);ggradient.setGradientCenter(-0.1f, -0.1f);gradient.setBounds(cb);gradient.draw(canvas);</code></pre>","18633","","","","","2013-09-23 16:56:47","How to draw a smooth/dithered gradient on a canvas in Android","<android><gradient><dithering>","1","0","11","",""
"2936919","1","2937058","","2010-05-29 23:15:46","6","4804","<p>I'm setting out to create a settings activity for my app. I've defined a <code>PreferenceActivity</code> with a nice layout including a <code>ListPreference</code> object for the user to select a bluetooth device. <strong>I'm having trouble dynamically populating the list</strong>.</p><p><strong>I would like to populate <code>ListPreference</code> with values from an array adapter</strong> (which I'll create and populate with relevant bluetooth device names). </p><p>If this were a spinner View, I could just call <code>setAdapter()</code>. However with the <code>ListPreference</code> object I can't figure out how to attach an adapter (<code>findviewByID</code> won't cast from View To <code>ListPreference</code>, so I can't even get a handle to the object). </p><p>I would like to attach an adapter and then populate the adapter with values, which in turn would populate the <code>ListPreference</code> with values. </p>","268803","","","","","2013-07-03 10:00:36","Is it possible to load ListPreference items from an adapter?","<android><arrays><preferences><adapter>","4","0","2","",""
"2937086","1","2938209","","2010-05-30 00:27:11","18","26448","<p>I have the date of several events expressed in <strong>milliseconds</strong>[1], and I want to know which events are inside the current week and the current month, but I can't figure out how to obtain the first day (day/month/year) of the running week and convert it to milliseconds, the same for the first day of the month.</p><pre><code>[1]Since January 1, 1970, 00:00:00 GMT</code></pre>","353811","","453596","","2011-03-11 16:34:35","2012-12-21 06:38:16","How to get the first day of the current week and month?","<java><android><date>","6","3","6","",""
"2937216","1","","","2010-05-30 01:29:01","0","401","<p>I would like to intercept outgoing calls and pass them to a VOIP application.  I see that the Google Voice application has a feature for displaying a question before each call is actually initiated.  It provides the user with the choice:</p><ul><li>Initiate call via Google Voice</li><li>Initiate call via standard call</li></ul><p>I would like a way to do something similar with my application (so that not all calls have to be routed through it).  At the moment, I can intercept CALL events via a BroadcastReceiver, however, these are not allowed to open dialogs (thus making it possible to display the choice).</p><p>What is the best way of achieving this goal?</p>","1432","","","","","2010-05-30 04:04:43","How can I display a dialog box for making a choice before a CALL is processed in android?","<java><android>","1","0","","",""
"2937315","1","","","2010-05-30 02:28:01","0","876","<p>i'm trying to put a translucing texture on a face which uses points 1 to 4 (don't mind the numbers) on the following screenshot</p><p><img src=""http://img46.imageshack.us/img46/442/texturebug.png"" alt=""alt text""></p><p>Sadly as you can see the texture repeats herself in both dimensions, I tried to switch the TEXTURE_WRAP_S from REPEAT to CLAMP_to_EDGE but it doesn't change anything. Texture loading code is here :</p><pre><code>gl.glBindTexture(gl.GL_TEXTURE_2D, mTexture.get(4));        gl.glActiveTexture(4);              gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER,                gl.GL_LINEAR);        gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER,                gl.GL_LINEAR);        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);        gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA,                shadowbmp.width, shadowbmp.height, 0,                gl.GL_RGBA, gl.GL_UNSIGNED_SHORT_4_4_4_4,                shadowbmp.buffer);</code></pre><p>Texture coordinates are the following :</p><pre><code>float shadow_bot_text[] = {                                     0.0f, 0.0f,                    0.0f, 1.0f,                    1.0f, 0.0f,                    1.0f, 1.0f                    };</code></pre><p>Thanks</p>","155887","","1039608","","2013-03-19 17:03:01","2013-03-19 17:03:01","Texture repeats even with GL_CLAMP_TO_EDGE set","<android><opengl-es>","1","2","","",""
"2937365","1","","","2010-05-30 02:57:12","0","1475","<p>There are apparently at least three different techniques for changing screen brightness in the Android OS. Two of them no longer work post-cupcake and the third accepted technique evidently has a bug.</p><p>I would like to increase screen brightness at the start of a one-view activity then turn the brightness back to the user setting at the end of the activity. No buttons, no second view or second activity. Just a maxed brightness at start and a return to original brightness setting at the end of the activity.</p><p>The examples of the current technique using WindowManager.LayoutParams that I have located range from 2 lines of code </p><pre><code>WindowManager.LayoutParams lp = getWindow().getAttributes();lp.screenBrightness = 100 / 100.0f;getWindow().setAttributes(lp);</code></pre><p>to several pages of source code and numerous activities.</p><p>Is there a simple example of maxing the screen brightness at start that someone can provide a link to?</p>","351300","","746010","","2012-01-29 06:48:14","2014-02-17 12:55:26","Increasing screen brightness for activity","<android><screen><brightness>","2","0","","",""
"2937381","1","","","2010-05-30 03:05:08","4","6931","<p>Can anyone please mention how to resume the sync command?</p><p>I followed the following steps:$ repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b eclair$ repo sync</p><p>The sync took more than 6 hours and I had to terminate the sync myself due to shortgae of bandwidth. Is there any way I can resume the sync from the previous session? I can see that the following folders are created:</p><p>bionic.gitbootablebuild.gitcts.gitand many more....</p><p>I have access to free bandwidth only for 6 hours in a day, and I have to do the sync within this time.Any help is really appreciated.</p>","308131","","","","","2013-03-28 12:16:41","How to resume repo sync","<android><repository>","4","0","","",""
"2937393","1","2937441","","2010-05-30 03:13:56","0","910","<p>I'm having a hard time figuring out the best way to pass simple values from onPause and onResume in the Android activity lifecycle. I understand how to use get and put extra bundles for activity to activity data, but does that work for passing data between the same activity? Should i used SharedPreferences?</p>","350237","","","","","2010-05-30 03:41:30","What is the best way to carry data over between onPause & onResume?","<android>","1","0","","",""
"2937532","1","","","2010-05-30 04:27:47","4","15168","<p>I'm new to Android programming (and Eclipse IDE and Android emulator).  I've got Hello World and some of Notepad working, but I'm still constantly getting quite a few DDMS console log messages (shown below) about not being able to bind locals for debugger.  </p><pre><code>[2010-05-29 21:03:16 - ddms] Can't bind to local 8601 for debugger[2010-05-29 21:05:26 - Device] Failed to delete temporary package: device (emulator-5556) request rejected: device not found[2010-05-29 21:06:47 - ddms] Can't bind to local 8600 for debugger[2010-05-29 21:07:05 - ddms] Can't bind to local 8601 for debugger[2010-05-29 21:07:05 - ddms] Can't bind to local 8602 for debugger</code></pre><p>And so on. Is this a problem?  Can I get rid of these messages somehow?</p>","353853","","1146715","","2013-05-28 10:34:51","2013-08-11 12:45:54","Should I worry about DDMS console log messages ""Can't bind to local nnnn for debugger""?","<eclipse><android><android-emulator>","3","0","1","",""
"2937581","1","2938370","","2010-05-30 04:45:47","3","9421","<p>I have a ListView, which has a TextView and a RadioGroup with 4 RadioButtons as Children in each row. Now i can select a RadioButton in each row. But if i scroll the ListView, my Selection is gone or it does not show correctly. For example, i choose the RadioButton A in the first row, if i scroll through the ListView and then go back to the first row again, either none of the RadioButtons in the RadioGroup is checked or RadioButton C is checked instead of A. How can i fix this Problem? I have tried 7 days already, but still i find no solution. Can anybody help me? I'll be very appriciate of that.</p>","353857","","353857","","2010-06-06 12:44:46","2012-08-21 17:48:32","Android: How to make RadioGroup work correctly in a ListView?","<android><listview><radio-button>","1","3","4","",""
"2937783","1","2937788","","2010-05-30 06:41:44","3","1359","<p>For the API (Android SDK API version 8) functions whose definitions list character sequence parameters, I can feed the function String instead. Best part is that they work the same way, no hassle, no warnings.</p><p>Is there a difference between the two types? And more importantly, is there an inherent danger if I send the function a String instead of a character sequence???</p><p>Thanks for any clarifications!!! :D</p>","158584","","114066","","2010-05-31 07:04:06","2010-05-31 07:04:06","In Android OS or Java, what's the difference between a character sequence and a string?","<android><string><types>","1","0","2","",""
"2937924","1","","","2010-05-30 08:00:59","2","2356","<p>I am trying to play a <code>videoview</code> on top of another video view. The first video view is paused, while the second is playing.  It appears to work but no second video appears on the screen (though I hear the audio and see the controls that would normally appear on top).  I am assuming this is some sort of order issue.  Any thoughts.  By the way, I have no problem displaying other views on top of the main video view and having the video fill the background.</p>","353900","","3098658","","2014-01-21 13:44:11","2014-02-12 03:56:35","Android VideoView plays 2 videos at the same time","<android><videoview>","4","0","","",""
"2937972","1","","","2010-05-30 08:28:11","2","458","<p>I have been working on my app and it runs on the simulator fine.  I loaded it into my phone and now I have a problem.  It runs fine when I first start it and also if I pick home and then restart it; however, if I use the back arrow and then restart it it crashes on that time, but will work out the next time I start it.  I think it has to do with some kind of memory build up, but I verified onDestroy is being called, I figured that deletes everything my program created, right?</p>","341447","","","","","2010-06-12 15:26:13","Android app crashes on second run","<android><crash>","1","2","","",""
"2937995","1","2939519","","2010-05-30 08:44:51","2","332","<p>Currently I am using:</p><p>Algorithm_mode_padding=""RSA/ECB/PKCS1Padding""Provider=""BC""</p><p>I have heard that ECB can cause patterns in the output.  What is the most secure Algorithm, mode and padding for Android at the moment? I will be using this for license files.</p><p>Also, what is the best keysize to use when creating a new public and private key?</p>","248521","","","","","2010-11-16 15:06:35","What is the most secure encryption mode for Android?","<android>","1","0","","",""
"2938023","1","2938052","","2010-05-30 09:00:53","3","1808","<p>I'm writing my first location based android app, but got confused about some of the GPS service api. Here are some questions I have:</p><p>1) To get my current location, I called requestLocationUpdates() with a listener in the onCreate() method of one activity. But what happens when another activity starts and the current activity goes invisible? Is the GPS location update going to stop? If so, how do I keep it on after the activity is switched? </p><p>2) how accurate is the Location.getSpeed()? How is it computed? Can it tell the difference between on bicycle and on foot? </p><p>3) not really a question about android. How to calculate the coordinates of a location, say, 100m away from my current location?</p><p>4) To stop the GPS, I only need to remove all the listeners that have been registered to locationmanager?</p><p>Thanks a lot!</p>","109704","","","","","2011-02-05 23:17:33","Android: various questions about GPS","<android><gps>","3","0","6","",""
"2938164","1","","","2010-05-30 10:04:00","5","7223","<p>all, when i download large data from website, i got this error information:</p><pre><code>I/global  (20094): Default buffer size used in BufferedInputStream constructor.It would be better to be explicit if an 8k buffer is required.D/dalvikvm(20094): GC freed 6153 objects / 3650840 bytes in 335msI/dalvikvm-heap(20094): Forcing collection of SoftReferences for 3599051-byte allocationD/dalvikvm(20094): GC freed 320 objects / 11400 bytes in 144msE/dalvikvm-heap(20094): Out of memory on a 3599051-byte allocation.I/dalvikvm(20094): ""Thread-9"" prio=5 tid=17 RUNNABLEI/dalvikvm(20094):   | group=""main"" sCount=0 dsCount=0 s=0 obj=0x439b9480I/dalvikvm(20094):   | sysTid=25762 nice=0 sched=0/0 handle=4065496</code></pre><p>anyone can help me?</p>","353932","","536148","","2011-03-17 05:14:28","2011-03-17 05:14:28","android java.lang.OutOfMemoryError","<android><out-of-memory>","1","2","1","",""
"2938218","1","","","2010-05-30 10:29:53","2","521","<p>OK, I've got the code to allow me to index through the string resources. Now, how do I get the value of a specific resource item without knowing its name?</p><p>Here's the index loop:</p><pre><code>Field[] fLst = R.string.class.getFields();for(Field f : fLst){  Log.i(dbgTag, ""Field Entry: R.string."" + f.getName());}</code></pre><p>Thanks for your efforts ...</p>","353616","","224671","","2010-05-30 10:42:35","2010-05-30 12:11:31","Indexing through Android string resources","<java><android>","1","0","","",""
"2938288","1","","","2010-05-30 10:53:56","1","2332","<p>I am making an event application and user can set a reminder for events he wants.So i use the alarmManager to create alarms. I would like to put a cancel all option to my main activity so that i could cancel all the alarms created by my application.The usual method for canceling the alarm with the same intent doesnt really help cause i set tha alarms on a different activity than the one I want to cancel them in.So is there a way to cancel all the alarms created by my application?Thanks!</p>","338522","","12388","","2010-08-03 21:05:54","2010-08-03 21:05:54","Android canceling all alarm set","<android><android-alarms>","1","0","3","",""
"2938314","1","2938339","","2010-05-30 11:03:49","1","802","<p>I was trying to serialize an <code>ArrayList</code> which contains custom objects. </p><p>I'm serializing it in a <code>Servlet</code> (server side), and deserialize at the client side. (using <code>ObjectOutputStream</code> and <code>ObjectInputStream</code>)</p><p>It worked fine, when I work with <code>ArrayList&lt;String&gt;</code>.<br>But when I tried it with <code>ArrayList&lt;MyObject&gt;</code> I couldn't get any results in the client side, this is the exception:</p><pre><code>java.lang.ClassNotFoundException: web.MyObject</code></pre><p>Of course I have done this: </p><pre><code>public class MyObject implements Serializable { ... }</code></pre><p><code>MyObject</code> contains only <code>String</code> fields.</p><p>What have I done wrong?</p><p>Thanks,<br>Ray.</p>","260511","","155137","","2010-05-30 11:38:08","2010-05-30 11:38:08","Custom ArrayList serialization","<java><android><serialization><classnotfound>","1","2","","",""
"2938377","1","2938651","","2010-05-30 11:22:31","7","6052","<p>I can't seem to get my ImageView to display its source image in its original size. The ImageView looks like this:</p><pre><code>   &lt;ImageView  android:id=""@+id/Logo""  android:src=""@drawable/logo"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" &gt;&lt;/ImageView&gt;</code></pre><p>The source image is 140 pixels wide, yet on the Nexus One's screen, which is 480 pixels wide it uses up half of the width. Using absolute values in px or dp for the width and height changes nothing. The image also looks very antialiased from the upscaling. Why is this happening and how can I prevent it?</p>","213817","","","","","2010-05-30 12:40:30","Android: ImageView scales up source image","<android><size><resolution><scale><imageview>","1","0","","",""
"2938421","1","","","2010-05-30 11:33:34","5","3866","<p>I found in the Android documentation how to turn Bluetooth discoverability mode on:</p><pre><code>Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);startActivity(discoverableIntent);</code></pre><p>This will make the device discoverable for 300 seconds (<a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html#EnablingDiscoverability"">documentation</a>).</p><p>My question is: how to turn discoverability OFF before this timeout occurs? I'd like to replicate the corresponding setting in Settings|Wireless and networks|Bluetooth settings applet, that allows discoverability to be turned on and off with a click.</p><p>Any help?</p><p>Thanks ;)</p>","247095","","","","","2011-06-12 09:00:15","Disable Bluetooth discoverable mode on Android","<android><bluetooth>","3","0","2","",""
"2938434","1","","","2010-05-30 11:38:12","1","4191","<p>I'm a beginer in android. i'm doing small apllication,i have mainscreen and calling next screen by main screen. In nextscreen by selecting image in gallery i wanted to go back main screen by getting  image url how can do this please help me its urgent.</p>","353963","","844882","","2012-03-22 20:21:15","2012-03-22 20:21:51","android activity callback","<android>","1","2","","",""
"2938452","1","2939017","","2010-05-30 11:43:04","5","6332","<p>As part of an application that I'm developing for Android I'd like to show the user an edge-detected version of an image they have taken (something similar to the example below).</p><p><img src=""http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Valve_sobel_%283%29.PNG/300px-Valve_sobel_%283%29.PNG"" alt=""alt text""></p><p>To achieve this I've been looking at the Sobel operator and how to implement it in Java. However, many of the examples that I've found make use of objects and methods found in AWT (<a href=""http://forums.sun.com/thread.jspa?threadID=5346162"">like this example</a>) that isn't part of Android.</p><p>My question is then really, does Android provide any alternatives to the features of AWT that have been used in the above example? If we were to rewrite that example just using the libraries built into Android, how would we go about it?</p>","205877","","","","","2013-06-20 22:20:48","Sobel Edge Detection in Android","<android><image-processing><edge-detection>","3","2","4","",""
"2938502","1","2938787","","2010-05-30 11:59:37","84","76617","<p>I'm experienced with PHP, JavaScript and a lot of other scripting languages, but I don't have a lot of experience with Java or Android. I'm looking for a way to send POST data to a PHP script and display the result.</p>","348776","","630668","","2012-03-30 10:24:44","2013-07-15 22:16:00","Sending POST data in Android","<android><http-post>","8","0","51","",""
"2938640","1","2939322","","2010-05-30 12:38:31","1","4045","<p>Is it possible to change the sender number when sending an sms from my android program ?</p><p>Thanks</p>","353985","","","","","2013-10-29 02:05:18","change the sender number when sending sms","<android>","2","0","","",""
"2938799","1","2939336","","2010-05-30 13:28:02","7","7774","<p>I'm trying to build a calculator layout using TableLayout, but the last two rows aren't aligning with the rest of the layout. Is there something wrong with my layout XML?</p><p>What I'm trying to do would be easier to accomplish in HTML (<code>&lt;td&gt;</code> with <code>colspan</code> or <code>rowspan</code>), so should I try converting this into a WebView?</p><p>Code is as follows: (<a href=""http://img185.imageshack.us/img185/2043/calculatorandroidlayout.png"" rel=""nofollow"">Screenshot</a>)</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:id=""@+id/EditText01""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" /&gt;    &lt;TableLayout        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""        android:stretchColumns=""*""&gt;        &lt;TableRow            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""1""&gt;            &lt;Button                android:id=""@+id/Button08""                android:textSize=""16pt""                android:text=""^""                android:layout_weight=""1""                android:layout_height=""fill_parent""                android:layout_width=""wrap_content"" /&gt;            &lt;Button                android:id=""@+id/Button09""                android:text=""÷""                android:textSize=""16pt""                android:layout_height=""fill_parent""                android:layout_weight=""1""                android:layout_width=""wrap_content"" /&gt;            &lt;Button                android:id=""@+id/Button10""                android:text=""×""                android:textSize=""16pt""                android:layout_height=""fill_parent""                android:layout_weight=""1""                android:layout_width=""wrap_content"" /&gt;            &lt;Button                android:id=""@+id/Button11""                android:textSize=""16pt""                android:text=""-""                android:layout_weight=""1""                android:layout_height=""fill_parent""                android:layout_width=""wrap_content"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""2""&gt;            &lt;LinearLayout                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:orientation=""vertical""                android:layout_weight=""1""&gt;                &lt;Button                    android:id=""@+id/Button01""                    android:text=""7""                    android:textSize=""16pt""                    android:layout_weight=""1""                    android:layout_height=""wrap_content""                    android:layout_width=""fill_parent"" /&gt;                &lt;Button                    android:layout_height=""wrap_content""                    android:textSize=""16pt""                    android:text=""4""                    android:id=""@+id/Button05""                    android:layout_weight=""1""                    android:layout_width=""fill_parent"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout                android:layout_height=""fill_parent""                android:orientation=""vertical""                android:layout_weight=""1""                android:layout_width=""fill_parent""&gt;                &lt;Button                    android:id=""@+id/Button02""                    android:layout_height=""wrap_content""                    android:text=""8""                    android:textSize=""16pt""                    android:layout_weight=""1""                    android:layout_width=""fill_parent"" /&gt;                &lt;Button                    android:layout_height=""wrap_content""                    android:textSize=""16pt""                    android:text=""5""                    android:id=""@+id/Button06""                    android:layout_weight=""1""                    android:layout_width=""fill_parent"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout                android:layout_height=""fill_parent""                android:orientation=""vertical""                android:layout_weight=""1""                android:layout_width=""fill_parent""&gt;                &lt;Button                    android:id=""@+id/Button03""                    android:text=""9""                    android:textSize=""16pt""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:layout_weight=""1"" /&gt;                &lt;Button                    android:textSize=""16pt""                    android:text=""6""                    android:id=""@+id/Button07""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:layout_weight=""1"" /&gt;            &lt;/LinearLayout&gt;            &lt;Button                android:id=""@+id/Button04""                android:text=""+""                android:textSize=""16pt""                android:layout_height=""fill_parent""                android:layout_width=""fill_parent""                android:layout_weight=""1"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""2""&gt;            &lt;LinearLayout                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:orientation=""vertical""                android:layout_weight=""2""&gt;                &lt;LinearLayout                    android:layout_weight=""1""                    android:orientation=""horizontal""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""&gt;                    &lt;Button                        android:id=""@+id/Button02""                        android:textSize=""16pt""                        android:layout_weight=""1""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:text=""1"" /&gt;                    &lt;Button                        android:textSize=""16pt""                        android:id=""@+id/Button06""                        android:layout_weight=""1""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:text=""2"" /&gt;                &lt;/LinearLayout&gt;                &lt;Button                    android:id=""@+id/Button01""                    android:layout_height=""wrap_content""                    android:textSize=""16pt""                    android:layout_weight=""1""                    android:layout_width=""fill_parent""                    android:text=""0"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:orientation=""vertical""                android:layout_weight=""1""&gt;                &lt;Button                    android:id=""@+id/Button03""                    android:textSize=""16pt""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:layout_weight=""1""                    android:text=""3"" /&gt;                &lt;Button                    android:textSize=""16pt""                    android:id=""@+id/Button07""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:layout_weight=""1""                    android:text=""."" /&gt;            &lt;/LinearLayout&gt;            &lt;Button                android:id=""@+id/Button04""                android:textSize=""16pt""                android:layout_height=""fill_parent""                android:layout_width=""fill_parent""                android:layout_weight=""1""                android:text=""="" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre>","347947","","","","","2010-05-30 15:57:49","Need help with Android TableLayout alignment","<android><tablelayout>","1","4","1","",""
"2938834","1","","","2010-05-30 13:37:27","1","1161","<p>I have a listview with tickboxes, which uses an Adapter and which works well.</p><p>And I know how to make a whole list expandable.</p><p>But, it it possible to have just a single item expandable, or does it have to be the whole list?? If so, how is it done?</p>","330770","","","","","2010-08-11 19:24:24","Android - ListView with only 1 expandable item","<android><listview><android-arrayadapter><expandablelistview>","2","0","","",""
"2939270","1","2939357","","2010-05-30 15:41:05","5","413","<p>I am starting Android development. Which of the many Eclipse downloads do I need from <a href=""http://www.eclipse.org/downloads/"">http://www.eclipse.org/downloads/</a> ?</p><p>I am only ever going to do Android dev with Eclipse ever.</p><p>Platform: MAC 64 bit Snowleopard</p>","172861","","","","","2014-03-23 10:34:29","Which Eclipse for Android only?","<android><eclipse>","3","1","","",""
"2939278","1","4991193","","2010-05-30 15:43:33","3","1681","<p>A problem came up in my latest android programming project.The problem is I would like to change Activity that launches when the phone receives a call.Is it possible to add some text after the contact name when a call is received.I have search the web for something that could do that, and been looking in the API for hours and I cannot find anything, is it possible with reflection of something like that?I have made a class that listens to when the phone_state is receiving a call, and I can get the incomming number, but I would like to change the appearance on the screen.</p><p>// Thanks in advance</p>","354049","","","","","2011-04-21 06:45:26","Android: Change activity state when receiving a phone call","<android><phonecalls>","1","0","","",""
"2939332","1","2939405","","2010-05-30 15:56:52","9","37695","<p>I'm new to Android, I've followed the hello world tutorial through and have a basic idea of what's going on.  I'm particularly interested in the touch screen of my T-Mobile Pulse so just to get me started I want to be able to write the co-ordinates of a tocuh event on the screen, so say the user touched the co-ordinate 5,2 - a textview on the screen would display that.</p><p>At present I have a simple program that just loads an xml file which contains the textview I intend to write the co-ordinates in.</p><p>Thank you in advance, I did Google for help and searched stackoverflow but everything I found either went way over my head or wasn't suitable for this.  Cheers.</p>","354055","","","","","2014-03-07 15:47:39","Get the co-ordinates of a touch event on Android","<android><touchscreen>","4","0","4","",""
"2939365","1","2939592","","2010-05-30 16:05:47","0","293","<p>My application uses the following codes to connect to web site and download a web page for processing.</p><pre><code>HttpURLConnection c = (HttpURLConnection) url.openConnection();c.setRequestMethod(""GET"");c.setRequestProperty(""User-Agent"", ""Mozilla/3.0 (compatible; MSIE 4.0; Windows NT)"");c.setRequestProperty(""Accept-Language"", ""zh-hk"");c.setRequestProperty(""Connection"", ""Keep-Alive"");c.setConnectTimeout(6000); // mTimeout is in secondsintTries = 3;do {   c.connect();   if (c.getResponseCode() == 200) {      break;   }   else {      intTries --;   }       } while (intTries &gt; 0);</code></pre><p>The codes are run in main thread only. If WiFi is being used, it is nice and clean. If 3G connection is being used, sometimes, it cannot get connected OR application HANGS.</p><p>Is there any significant difference between handling WiFi and 3G ?</p><p>Thanks.</p>","351770","","200410","","2010-05-30 16:06:41","2010-05-30 17:28:53","Application HANGS UP if 3G connection is used (WiFi is OK)","<android>","1","0","","",""
"2939467","1","2940480","","2010-05-30 16:35:41","0","203","<p>Firstly this has turned out to be quite a long post so please bear with me as its not too difficult but you may need to clarify something with me if i haven't explained it correctly.So with some help the other day from guys on this forum, i managed to partially set up my 'mapClass' class, but i'm having trouble with it and its not running correctly so i would like some help if possible. I will post the code below so you can see.</p><p>What Ive got is a 'Dundrum' class which sets up the listView for an array of items.</p><p>Then ive got a 'dundrumSelector' class which I use to set up the setOnClickListener() methods on the listItems and link them to their correct views.</p><p>THIS IS MY DUNDDRUM SELECTOR CLASS....</p><pre><code>    public static final int BUTTON1 = R.id.anandaAddressButton;public static final int BUTTON2 = R.id.bramblesCafeAddressButton;public static final int BUTTON3 = R.id.brannigansAddressButton;</code></pre><blockquote>  <p>public void onCreate(Bundle savedInstanceState){          super.onCreate(savedInstanceState);</p></blockquote><pre><code>    int position = getIntent().getExtras().getInt(""position"");    if(position == 0){        setContentView(R.layout.ananda);    };    if(position == 1){        setContentView(R.layout.bramblescafe);    };    if(position == 2){        setContentView(R.layout.brannigans);</code></pre><blockquote><pre><code>Button anandabutton = (Button) findViewById(R.id.anandaAddressButton);anandabutton.setOnClickListener(new View.OnClickListener() {</code></pre></blockquote><pre><code>    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(),MapClass.class);        myIntent.putExtra(""button"", BUTTON1);        startActivityForResult(myIntent,0);    }});Button bramblesbutton = (Button) findViewById(R.id.bramblesCafeAddressButton);bramblesbutton.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(),MapClass.class);        myIntent.putExtra(""button"", BUTTON2);        startActivityForResult(myIntent, 0);    }});</code></pre><p>etc etc....</p><p>Then what i did was set up static ints to represent the buttons which you can see at the top of this class, the reason for this is because in my mapClass activity I just want to have one method, because the only thing that is varying is the coordinates to each location.ie. i dont want to have 100+ map classes essentially doing the same thing other than different coordinates into the method.</p><p>So my map class is as follows...</p><pre><code>case DundrumSelector.BUTTON1:        handleCoordinates(""53.288719"",""-6.241179"");        break;    case DundrumSelector.BUTTON2:        handleCoordinates(""53.288719"",""-6.241179"");        break;    case DundrumSelector.BUTTON3:        handleCoordinates(""53.288719"",""-6.241179"");        break;    }}private void handleCoordinates(String l, String b){    mapView = (MapView) findViewById(R.id.mapView);    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);    mc = mapView.getController();    String coordinates[] = {l, b};    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);    mapView.invalidate();}</code></pre><p>Now this is where my problem is. The onClick() events don't even work from the listView to get into the correct views. I have to comment out the methods in 'DundrumSelector' before I can get into their views.</p><p>And this is what I dont understand, firstly why wont the onClick() events work, because its not even on that next view where the map is.</p><p>I know this is a very long post and it might be quite confusing so let me know if you want any clarification..</p><p>Just to recap, what i'm trying to do is just have one class that sets up the map coordinates, like what i'm trying to do in my 'mapClass'.</p><p>Please can someone help or suggest another way of doing this! Thanks alot everyone for reading this.</p>","314610","","314610","","2010-05-30 21:41:04","2010-05-30 22:03:59","Android: who can help me with setting up this google maps class please?","<android><google-maps><listview><button><listviewitem>","1","2","","",""
"2939523","1","2939753","","2010-05-30 16:59:07","1","257","<p>I have a Service that downloads a file from the internet.  What I want is for the response (an InputStream in this case) to be handled by a custom handler that can be switched (like a strategy pattern) but I can't figure out how to do this.</p><p>So basically the User of the API would be able to plug in different handlers for the response, some would parse XML, others might save files etc.</p><p>I realise I could pass through the activity context and execute the method from this (given some interface) but I don't want to do this obviously, in case the Activity is closed in the meantime while the file is still downloaded.</p><p>How might I do this?</p><p><strong>UPDATE - I just had one idea it will work sort of but has problem if the DownloadRunnable gets changed between executions of the downloads.</strong></p><p>The modified Runnable interface</p><pre><code>interface DownloadRunnable {    void run(InputStream stream);}</code></pre><p>An enum</p><pre><code>public enum ServiceHandler {    DOWNLOAD_HANDLER;    private DownloadRunnable handler=null;    /**Called from the Service*/    public void doHandler(InputStream stream) {        if(handler==null) throw new IllegalStateException(""You must set the handler first: setDownloadHandler()"");        this.handler.run(stream);    }     /**Set before theservice runs*/     public void setHandler(DownloadRunnable r) {         this.handler = r;     }}</code></pre><p>The client can set what happens for each enum</p><pre><code>ServiceHandler.DOWNLOAD_HANDLER.setHandler(new DownloadRunnable() {        @Override        public void run(InputStream stream) {            // The user can do anything they want with the stream        }    });</code></pre><p>The Service runs this when the input stream is available</p><pre><code>ServiceHandler.DOWNLOAD_HANDLER.doHandler(stream);</code></pre><p>This kind of works but is not so elegant.</p><ol><li><p>What if the user runs the same operation twice with different DownloadRunnables set (before the first is complete)</p></li><li><p>The user has to set the Handler first is a separate enum object (not so user friendly or intuitive).</p></li><li><p>Maybe I could create a Map of DownloadRunnables each with an ID (static field - auto increment) that gets passed back and the correct runnable can then get executed...but all this is getting more complex than I had hoped.</p></li></ol>","248521","","248521","","2010-05-30 18:27:43","2010-05-30 18:27:43","Custom changeable handler when a Service finishes downloading a file","<android>","1","0","","",""
"2939642","1","2939915","","2010-05-30 17:45:25","1","566","<p>I have a widget that periodically updates itself (hourly) to display top result of search query. I would like to extend it so it captures several top results and then loops through these. The best example would be <code>Genie News and Weather</code> widget for which I was unable to find a source code.</p><p>QUESTIONS:</p><ol><li>What would be a good way to implement the animation? I'm thinking <code>ViewAnimator</code> + timer, but is there maybe a better way, say <code>FrameLayout</code> + alerts? I'm already using <code>AlertManager</code> to periodically pull search results for the widget</li><li>How bad such arraignment would affect phone's battery life? </li></ol>","135946","","","","","2010-05-30 19:02:33","Android: implementing sliding cards in widget","<android><animation><widget>","1","0","1","",""
"2939767","1","2941986","","2010-05-30 18:18:13","2","1904","<p>If I want to mark the second item I'm doing the following code:This code is from my Adapter that extends ArrayAdapter :</p><pre><code>if (convertView == null) {        LayoutInflater mInflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        convertView = mInflater.inflate(R.layout.channel_list, null);    }     MyContent o = items.get(position);    if (o != null) {        TextView tt = (TextView) convertView.findViewById(R.id.toptext);        TextView bt = (TextView) convertView.findViewById(R.id.bottomtext);        if (tt != null) {            tt.setText(o.Top());                                    }        if(bt != null){            bt.setText(o.Bottom());        }        if(position == 2) {            convertView.setBackgroundColor(R.color.selectem_color);        }    }    return convertView;</code></pre><p>It will show the list view but mark every 9'th item after this item (the 11'th item 13'th and so on).</p><p>Does anyone know what's the reason?</p>","117196","","114066","","2012-01-27 08:45:26","2012-01-27 08:45:26","When marking an item (changing background color) in ListView it's repeating for other items","<android><android-listview>","2","0","","",""
"2939896","1","2939977","","2010-05-30 18:56:06","1","1548","<ul><li>I have an Android activity which in turn starts a thread.</li><li>In the thread I open a persistent TCP socket connection. </li><li>When the socket connects to the server dynamic data is downloaded.</li><li>The thread sends messages using Handler-class to the activity when data has been received.</li></ul><p>Now if the user happens to switch from portrait to landscape mode the activity gets an onDestroy call. At this moment I close the socket and stop the thread. </p><p>When Android has switched landscape mode it calls onCreate yet again and I have to do a socket re-connect. Also, all of the data the activity received needs to be downloaded once more because the server does not have the ability to know what has been sent before, i.e. there is no ""resume"" feature. </p><p>Thus the problem is that there is alot of data which is resent all the time when landscape mode is changed.</p><p>What are my options here? </p><ul><li>Should I create a service which handles the socket traffic towards the server thus I always got all the data which the server has sent in the service.</li><li>Or should I disable landscape mode all together perhaps?</li><li>Or would my best bet be to rewrite my server which is a VERY BIG job :-)</li></ul><p>All input is welcome :-)</p><p>/ Henrik</p>","226342","","","","","2010-05-30 19:29:29","How to handle activity life cycle involving sockets in Android?","<android><sockets><application-lifecycle>","1","1","","",""
"2939944","1","2940261","","2010-05-30 19:14:19","2","5680","<p>I need to run a service each night at midnight. I would like to use the AlarmManager to do this.</p><p>Can you give me some guidance of how to make it work correctly?</p><pre><code>alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, System.currentTimeMillis(), AlarmManager.INTERNAL_DAY, serviceIntent);</code></pre><p>Perhaps I need to use a Calendar object to specify the time? Thanks for any help!</p>","354130","","244296","","2010-10-14 05:23:40","2011-05-07 21:03:37","Using AlarmManager in Android to launch a daily service?","<android>","2","0","3","",""
"2940001","1","2940275","","2010-05-30 19:39:08","5","4515","<p>Does Android Linux Kernel support V4L or V4L2 (Video for Linux). If not, it'is possible to add it</p>","1832564","","","","","2014-04-11 12:42:18","Android V4L or V4L2","<android><linux-kernel><v4l2><v4l>","3","1","2","",""
"2940117","1","","","2010-05-30 20:12:26","3","7874","<p>I can not figure out the android 2D graphic library. Is it <strong>SGL</strong>, <strong>Skia</strong> or subset of <strong>OpenGL</strong></p>","1832564","","","","","2011-03-16 04:28:17","Android 2D graphic library","<android><graphics>","3","0","","",""
"2940162","1","","","2010-05-30 20:23:13","0","642","<p>I am writing an action game, but I noticed that when there are a lot of actions going on during the game, the menu button on my MyTouch phone doesn't work. I have to pause the game before the menu buttons work. </p><p>I tried raising the priority of the activity thread by doing this:</p><pre><code>&lt;uses-permission  android:name=""android.permission.VIBRATE""  id=""android.permission.RAISED_THREAD_PRIORITY"" /&gt;</code></pre><p>I also tried to lower the game's thread priority with setPriority() but none of the above work.</p><p>The only thing that works was adding a bunch of buttons beneath the game view. Can someone help me? Thanks.</p><p><strong>Edit</strong></p><p>Ok now I tried this:</p><p>return true for all keys I use in my game and super.onKeyDown(event) for everything else, now the menu button sort of works in that pressing it brings up the keyboard (not the settings menu), even if I am not doing a long touch.</p>","270811","","441574","","2012-02-21 16:07:35","2012-02-21 16:07:35","MyTouch android phone's menu button doesn't work","<android>","0","2","","",""
"2940212","1","","","2010-05-30 20:40:06","1","1021","<p>I am trying to improve the layout for my game.  The problem is that while I can create a </p><p>good layout for one android phone, it doesn't work for another, ie the trackball for MyTouch </p><p>is on the right side (landscape mode), but for the MyCliq, the DPad is on the left side.  Is </p><p>there a way to programmatically set the layout based on which phone it is?  Thanks.</p>","270811","","11721","","2010-05-30 20:44:05","2010-05-30 20:56:50","Programmatically set layout for android","<android>","2","0","","",""
"2940252","1","2940492","","2010-05-30 20:50:53","0","887","<p>I have a service that regularly queries a web server for new messages. The service stores the new messages in an arrayList. These messages are implemented using a custom class, storing all kinds of metadata (strings and longs).</p><p>An activity then connects to this service to retrieve those messages and display them to the user.</p><p>I have an .aidl file that describes the interface that the service exposes. </p><pre><code>package com.example.package;interface MyInterface {    List&lt;Message&gt; getMessages();}</code></pre><p>The <code>Message</code> class extends the <code>Parcelable</code> class which should allow for the IPC transfer. </p><p>The problem is this: Eclipse gives me an error saying that the type of <code>List&lt;Message&gt;</code> is unknown. Any imports are marked as invalid.</p><p>Ideas? Thanks</p>","244182","","","","","2012-12-14 04:23:26","Custom Classes Passed from Service to a UI threads via AIDL","<java><android><ipc>","3","0","1","",""
"2940465","1","2940511","","2010-05-30 21:43:59","9","8243","<p>Currently, I'm trying to develop an app.and I don't know how to change the Toast font. .</p><pre><code> final OnClickListener clickListener = new OnClickListener() {    public void onClick(View v) {            try {                Toast.makeText(nova.this,""Hello"", 500000).show();            }            catch (Exception e) {                Toast.makeText(nova.this,""Exception:"" +e, 500000);            }        }    };</code></pre><p>I want to change the text ""Hello"" with custom font I've tried with TypeFace.</p><p>and Then, I want to set a variable at the place ""TextClicked"" .. I've tried with a local variable .. but it doesn't work </p><p>any help with example source code will be really great for me.</p>","2438460","","","","","2013-03-29 18:16:47","Change Toast Font","<android><toast><android-fonts>","3","0","","",""
"2940896","1","2940906","","2010-05-31 00:59:49","0","420","<p>I've have an application with Android front end and Django as the back end. As part of the answers <a href=""http://stackoverflow.com/questions/2935946/sending-images-using-http-post"">here</a>, I'm confused over the approach which I should take to send images to Django Server. I've 2 options at my disposal as <a href=""http://stackoverflow.com/users/352797/piro"">Piro</a> pointed out there.</p><p>1) Sending images as Multi Part entity</p><p>2) Send image as a String after encoding it using Base 64.</p><p>My knowledge in Django is limited and So I need guidance on whether which of the approaches would make it easier for the images to be processed by Django. The images are small in size (&lt;200kb) and number (&lt;10). Any suggestions or pointers are most welcome.</p>","323404","","","","","2010-05-31 01:09:17","Best Approach to process images in Django","<android><django><http-post><multipart>","1","0","","",""
"2940904","1","2940976","","2010-05-31 01:03:03","3","1654","<p>Coming from an iPhone world...</p><p>In Android, I am looking for an iPhone UIWebView-like control which can display HTML and let me catch clicks on links and stop the navigation. My apps display text with commands as href's in the HTML.</p>","172861","","","","","2010-05-31 01:30:50","Android equivalent of UIWebView in Xcode","<android><widget>","1","0","","",""
"2941009","1","3044995","","2010-05-31 01:47:41","5","4566","<p>I have some images that I loaded from a remote source stored in Bitmap variables and I want to display them. In addition to switching between these images the user should also be able to zoom and pan them. My first idea was to somehow pass them via an intent to the built-in gallery application but this doesn't seem to be possible.A solution that is suggested in several places is using a WebView since it already supports zooming and panning.My question is how does my Bitmap data get into the WebView? Do I have to write it to a file first, which I would have to remove again later, or is there an easier way?</p><p>Or are there even better ways to accomplish my main goal, which is displaying Bitmap data as zoomable and panable images?</p>","213817","","","","","2010-06-15 12:18:34","Android: Easiest way to make a WebView display a Bitmap?","<android><bitmap><zoom><pan>","2","0","1","",""
"2941017","1","2941276","","2010-05-31 01:50:38","0","542","<p>I tried searching the forums on this one, but I wasn't able to find anything on my problem. </p><p>To describe my problem, everytime my location changes, it redraws the center maker on the map.... Only catch is that it doesn't delete the previous one. I can get it to delete the previous one when the location is changed, but I have no idea how to pass the original overlay in-between classes. </p><p>Also, pastebin <a href=""http://pastebin.com/JdK63S4T"" rel=""nofollow"">here</a></p><p>Thanks in advance, hwrd</p>","354247","","","","","2010-05-31 03:48:45","How to pass Itemized Overlay from a class to a Listener Class","<android>","1","0","","",""
"2941215","1","","","2010-05-31 03:25:53","0","153","<p>Let me explain what I am want to archive. For example, in Flex I can create page (list of something) with 3 states: Loading state (just display some animation or label with text ""Please wait.""), No records state (page with text saying that there is no records) and Page with populated list. It is very easy to operate with states in Flex.</p><p>Is it possible to implement something similar in Android application? I would appreciate if you provide some examples.</p>","346362","","","","","2011-03-23 11:24:56","Is it possible to implement Flex states in Android application","<android><viewstate><state>","2","0","","",""
"2941241","1","2941481","","2010-05-31 03:36:37","4","4694","<p>I have an android activity in which I'm using tabs.</p><pre><code>public class UnitActivity extends TabActivity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.unit_view);    TabHost tabHost = getTabHost();    TabSpec spec;    spec = tabHost.newTabSpec(""controls"");    spec.setIndicator(""Control"");    spec.setContent(R.layout.unit_control);    tabHost.addTab(spec);    spec = tabHost.newTabSpec(""data"");    spec.setIndicator(""Data"");    spec.setContent(R.layout.unit_data);    tabHost.addTab(spec);  }}</code></pre><p>However when I run the program it crashes with the error:""Could not create tab content because could not find view with id 2130903042"". I don't understand what the problem is because R.layout.unit_data refers to a layout file in my resource directory (res/layout/unit_data.xml)</p><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=""fill_parent""      android:layout_height=""fill_parent""&gt;    &lt;TableLayout        android:stretchColumns=""*""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;    &lt;Spinner android:id=""@+id/unit_num""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:prompt=""@string/choose_unit""/&gt;    &lt;TableRow android:padding=""2dp""&gt;      &lt;TextView          android:gravity=""right""          android:padding=""5dp""          android:text=""@string/Power""/&gt;      &lt;TextView android:id=""@+id/unit_power""          android:layout_span=""3""          android:gravity=""center""          android:padding=""5dp""          android:background=""@android:color/white""          android:textColor=""@android:color/black""          android:text=""AUTO""/&gt;    &lt;/TableRow&gt;    ...  &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>as far as I can tell unit_data.xml is well formed and I've even referenced it successfully in another activity</p><pre><code>class UnitData extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.unit_data);    Toast.makeText(this, ""Hi from UnitData.onCreate"", 5);  }}</code></pre><p>which does not give an error and renders the layout just fine.</p><p>What's going on? Why can't I reference this layout when creating a tab?</p>","354271","","354271","","2010-05-31 03:44:36","2012-02-05 16:20:13","Why do I get an error while trying to set the content of a tabspec in android?","<android><layout><view><tabs>","3","0","2","",""
"2941459","1","2941538","","2010-05-31 05:04:47","7","1490","<p>I've 16 textViews and need to set something like this done:</p><pre><code>for (int i=1; i&lt;6; i++){    int $RidInt = R.id.s;     tv[i] = (TextView)findViewById($RidInt);    tv[i].setTypeface(face);    tv[i].setClickable(true);    tv[i].setOnClickListener(clickListener);}</code></pre><p>my R.java file is :</p><pre><code>public final class R {    public static final class attr {    }    public static final class drawable {        public static final int icon=0x7f020000;    }    public static final class id {        public static final int s1=0x7f050000;        public static final int s10=0x7f050009;        public static final int s11=0x7f05000a;        public static final int s12=0x7f05000b;        public static final int s13=0x7f05000c;        public static final int s14=0x7f05000d;        public static final int s15=0x7f05000e;        public static final int s16=0x7f05000f;        public static final int s2=0x7f050001;        public static final int s3=0x7f050002;        public static final int s4=0x7f050003;        public static final int s5=0x7f050004;        public static final int s6=0x7f050005;        public static final int s7=0x7f050006;        public static final int s8=0x7f050007;        public static final int s9=0x7f050008;    }    public static final class layout {        public static final int main=0x7f030000;        public static final int toast=0x7f030001;    }    public static final class string {        public static final int app_name=0x7f040000;        public static final int s2=0x7f040001;    }}</code></pre>","2438460","","2438460","","2010-05-31 05:21:04","2011-12-08 05:47:37","How do I iterate through the id properties of R.java class?","<java><android>","3","0","3","",""
"2941539","1","2941571","","2010-05-31 05:36:38","1","1588","<p>I'm creating interactive charts in java for android environment.Google visualisation API is very impressive.I need to know how to use it in java. Is there any Wrapper API available for this?Or Can I use it directly in my application. Can anyone post a code snippet for the same.</p>","353484","","","","","2010-05-31 05:48:01","Is there a way to use Google Visualization API in java","<android>","2","0","2","",""
"2941552","1","","","2010-05-31 05:41:13","26","14485","<p>How can I programmatically check how much free space an SD card mounted on an Android device has?</p>","304961","","23897","","2013-06-20 00:58:26","2013-06-20 00:58:26","How can I check how much free space an SD card mounted on an Android device has?","<android>","2","0","12","",""
"2941561","1","2941606","","2010-05-31 05:44:56","3","23458","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2663427/dont-want-activity-to-be-destroyed-created-when-phone-is-rotated"">Don’t want activity to be destroyed/created when phone is rotated</a>  </p></blockquote><p>I'm trying to write a program that needs smooth orientation sensor samples as the phone is rotated all around. Every time the orientation of the phone is changed, it interrupts the data and freezes the program while the layout changes. How can I lock it in one orientation (landscape or portrait, it doesn't matter)?</p><p>I assume it has something to do with <code>android:layout</code> in the xml file, but I can't find anything online.</p>","354318","","","","","2012-03-09 17:20:28","How do I lock the layout of my android program to one orientation","<java><android><orientation><sensor><screen-orientation>","5","0","","2012-10-12 03:16:42",""
"2941722","1","2941830","","2010-05-31 06:22:26","2","3198","<p>i have created following layout.</p><pre><code>&lt;TableLayout android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:orientation=""horizontal""        &gt;        &lt;TableRow&gt;&lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Post As"" /&gt;&lt;Spinner         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/ddlPostAs""        /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;&lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Expires In"" /&gt;&lt;Spinner         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/ddlExpiryOn""        /&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>in which android spinner changes its width according to the data.i want to stop it.</p><p>can any one guide me how to achieve this?</p><p>any help would be appriciated.</p>","249991","","","","","2012-10-01 23:04:08","android spinner width problem?","<android><spinner>","1","0","","",""
"2941728","1","2941933","","2010-05-31 06:24:37","0","1091","<p>I would like to write a rather simple content application which displays a list of textual items (along with a small pic).<br>I have a standard menu in which each menu item represents a different category of textual items (news, sports, leisure etc.). Pressing a menu item will display a list of textual items of this category.  </p><p>Now, having a separate ListActivity for each category seems like an overkill (or does it?..)<br>Naturally, it makes much more sense to use one ListActivity and replace the data of its adapter when each category is loaded.<br>My concern is when ""back"" is pressed. The adapter is loaded with items of the current category and now I need to display list of the previous category (and enable clicking on list items too...).<br>Since I have only one activity - I thought of backup and load mechanism in onPause() and onResume() functions as well as making some distinction whether these function are invoked as a result of a ""new"" event (menu item selected) or by a ""back"" press.<br>This seems very cumbersome for such a trivial usage... Am I missing something here?  </p><p>Thanks, Rob</p>","283630","","","","","2010-05-31 07:12:09","Android: ListActivity design - changing the content of the List Adapter","<android><design><listactivity><listadapter>","1","0","","",""
"2941748","1","","","2010-05-31 06:28:21","0","197","<p>Some pre-define variant, for example:attribute value, layout view .etc. (e.g.android:galleryItemBackground), where i can find the source code(exactly implementation or definition) in site: android.git.kernel.org,</p>","343809","","","","","2010-05-31 07:35:10","how to find corresponding source code or definations from site: android.git.kernel.org","<android>","1","1","","",""
"2941792","1","","","2010-05-31 06:38:23","1","2893","<p>I already wrote a program that read locations from android GPS ; each locatin(long , lat) will be sent to remote server to save it and display it in a website map.</p><p>what I'm trying to do now is to display my path in android by drawing line between the pointsI didn't find any sufficient answer until this moment!  so how this can be done?</p>","325296","","","","","2011-03-11 06:19:11","How to draw a line between points in google map in Android","<android><google-maps><path><overlay>","1","2","2","",""
"2941796","1","2941921","","2010-05-31 06:39:52","4","295","<p>I know that the android plattform is open source. What I am interested in is the share of open source Android apps, thus developers that realease their own apps under a open source license.</p><p>Does anybody have an idea, how to get this information?</p>","354354","","","","","2010-05-31 07:09:43","How many android apps are open source?","<iphone><android><open-source>","1","0","","",""
"2941863","1","","","2010-05-31 06:57:13","0","1165","<p>when we expand the notification expanded view ,we get a default white background with small squares. how can i change this white background to some other color.</p>","324225","","","","","2010-05-31 07:27:39","how to change background color of default notification expanded view?","<android>","1","0","","",""
"2941867","1","2941965","","2010-05-31 06:58:14","0","106","<p>I download the *.ics file successfully from the mail attachment by using<br>intent-filter.    I need to give an alert at the time of downloading the ics file. How to do this? Please help me to solve.This I am new to android. </p>","351928","","","","","2010-05-31 07:20:06","Give alert when the file is download from the attachment in android","<android>","1","0","","",""
"2941951","1","","","2010-05-31 07:17:28","1","3277","<p>I'm having trouble starting a Service to update an AppWidget that I'm creating as an exercise. I'm trying to get the latitude and longitude of spoofed location data from DDMS to display in the widget.  The widget uses a service to update the TextView, which may be slightly overkill, but I wanted to follow the template that seems to be common in AppWidgets that do more work (like the Forecast widget or the Wiktionary widget).</p><p>Right now, I'm not getting any error messages or strange behavior; nothing at all happens when the button is pressed.  I'm a bit mystified as to what might be wrong.  Could anyone out there point me in the right direction?</p><p>Additionally, if my logic for location is faulty, I'd love recommendations on that too.  I've looked at several blogs, the Google examples, and the documentation, but I feel a little fuzzy on how it works.</p><p>Here is the current state of the widget:</p><pre><code>public class Widget extends AppWidgetProvider{    static final String TAG = ""Widget"";     /**     * {@inheritDoc}     */    public void onUpdate(Context context, AppWidgetManager appWidgetManager,                        int[] appWidgetIds)    {        // Create an intent to launch the service        Intent serviceIntent = new Intent(context, UpdateService.class);        // PendingIntent is required for the onClickPendingIntent that actually        // starts the service from a button click        PendingIntent pendingServiceIntent =             PendingIntent.getService(context, 0, serviceIntent, 0);        // Get the layout for the App Widget and attach a click listener to the        // button        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);        views.setOnClickPendingIntent(R.id.address_button, pendingServiceIntent);        super.onUpdate(context, appWidgetManager, appWidgetIds);    }    // To prevent any ANR timeouts, we perform the update in a service;    // really should have its own thread too    public static class UpdateService extends Service    {        static final String TAG = ""UpdateService"";         private LocationManager locationManager;        private Location currentLocation;        private double latitude;        private double longitude;        public void onStart(Intent intent, int startId)        {            // Get a LocationManager from the system services            locationManager =                 (LocationManager) getSystemService(Context.LOCATION_SERVICE);            // Register for updates from spoofed GPS            locationManager.requestLocationUpdates(""gps"", 30000L, 0.0f, new LocationListener()            {                @Override                public void onLocationChanged(Location location)                {                    currentLocation = location;                }                @Override                public void onProviderDisabled(String provider) {}                @Override                public void onProviderEnabled(String provider) {}                @Override                public void onStatusChanged(String provider, int status,                        Bundle extras) {}                   });            // Get the last known location from GPS            currentLocation =                 locationManager.getLastKnownLocation(""gps"");            // Build the widget update            RemoteViews updateViews = buildUpdate(this);            // Push update for this widget to the home screen            ComponentName thisWidget = new ComponentName(this, Widget.class);            // AppWidgetManager updates AppWidget state; gets information about             // installed AppWidget providers and other AppWidget related state             AppWidgetManager manager = AppWidgetManager.getInstance(this);            // Updates the views based on the RemoteView returned from the            // buildUpdate method (stored in updateViews)            manager.updateAppWidget(thisWidget, updateViews);        }        public RemoteViews buildUpdate(Context context)        {            latitude = currentLocation.getLatitude();            longitude = currentLocation.getLongitude();            RemoteViews updateViews =                 new RemoteViews(context.getPackageName(), R.layout.main);            updateViews.setTextViewText(R.id.latitude_text, """" + latitude);            updateViews.setTextViewText(R.id.longitude_text, """" + longitude);            return updateViews;        }        @Override        public IBinder onBind(Intent intent) {            // We don't need to bind to this service            return null;        }    }}</code></pre>","75215","","","","","2010-06-02 12:02:16","Button click does not start Service in Android App Widget","<android><location><android-widget>","1","0","","",""
"2942063","1","","","2010-05-31 07:39:26","2","640","<p>I am trying  to determine if my current connection state is WIFI or Cell network (3g/2g... etc)I am using SDK 1.5. </p><p>Tried couple of technics not realy working.</p><p>Any working suggestions?</p><p>Thanks,</p><p>ray.</p>","260511","","12388","","2010-05-31 08:01:37","2010-06-01 06:24:25","Determine connection state","<android>","2","0","1","",""
"2942108","1","2943430","","2010-05-31 07:47:07","2","6107","<p>I'm writing an android program in which I have an activity that uses tabs.</p><p>The Activity</p><pre><code>public class UnitActivity extends TabActivity {  @Override  public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  TabHost tabHost = getTabHost();  TabSpec spec;  Resources res = getResources();  LayoutInflater.from(this).inflate(R.layout.unit_view, tabHost.getTabContentView(), true);  spec = tabHost.newTabSpec(""controls"");  spec.setIndicator(""Control"", res.getDrawable(R.drawable.ic_tab_equalizer));  spec.setContent(R.id.txtview);  tabHost.addTab(spec);}</code></pre><p>}</p><p>The XML referenced by R.layout.unit_view</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: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;TextView android:id=""@+id/txtview""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:gravity=""bottom""          android:text=""nullpointer this!"" /&gt;    &lt;/FrameLayout&gt;  &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>As far as I can see I'm doing the same thing I see in the tabs1 api sample from the android sdk.  I've tried ""getLayoutInflator()"" instead of ""LayoutInflator.from(this)"" with the same result.</p><p>If I replace the LayoutInflater line with ""setContentView(R.layout.unit_view)"" my program doesn't crash with a null pointer exception but my content is completely blank and empty. I get the tab and that's it.</p><p>I've checked to make sure R.layout.unit_view and tabHost are not null when it runs the LayoutInflater line and they seem to be fine. They're defenitely not null. I've also checked to make sure LayoutInflater.from(this) returns a valid layout inflater object and it does.</p><p>The logcat indicating the error says</p><pre> E/AndroidRuntime(  541): java.lang.NullPointerException E/AndroidRuntime(  541):  at android.widget.TabWidget.dispatchDraw(TabWidget.java:206) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.View.draw(View.java:6538) E/AndroidRuntime(  541):  at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1531) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(  541):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(  541):  at android.view.View.draw(View.java:6538) E/AndroidRuntime(  541):  at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(  541):  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830) E/AndroidRuntime(  541):  at android.view.ViewRoot.draw(ViewRoot.java:1349) E/AndroidRuntime(  541):  at android.view.ViewRoot.performTraversals(ViewRoot.java:1114) E/AndroidRuntime(  541):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) E/AndroidRuntime(  541):  at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(  541):  at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(  541):  at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime(  541):  at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(  541):  at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(  541):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime(  541):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime(  541):  at dalvik.system.NativeStart.main(Native Method) I/Process (   61): Sending signal. PID: 541 SIG: 3 I/dalvikvm(  541): threadid=7: reacting to signal 3 I/dalvikvm(  541): Wrote stack trace to '/data/anr/traces.txt'</pre><p>Anybody have any idea how I can get this content into a tab without crashing my application? My actual program is more complex and has more than one tab but I simplified it down to this in an attempt to find out why it's crashing but it still crashes and I don't know why.</p><p>If I don't use LayoutInflator my program doesn't crash but I don't get any content either, just tabs.</p>","354271","","","","","2012-09-04 02:51:43","Why do I get a null pointer exception from TabWidget?","<android><view><tabwidget>","4","0","1","",""
"2942132","1","","","2010-05-31 07:50:13","11","16611","<p>I need help in setting up value and display text in spinner.as per now I am populating my spinner by array adapter e.g</p><pre><code>mySpinner.setAdapter(myAdapter);</code></pre><p>and as far as I know after doing this the display text and the value of spinner at same position is same. The other attribute that I can get from spinner is the position on the item.</p><p>now in my case I want to make spinner like the drop down box, which we have in .NET.</p><p>which holds a text and value.</p><p>where as text is displayed and value is at back end.so if I change drop down box , I can either use its selected text or value.but its not happening in android spinner case.</p><p>For Example:</p><p>Text        ValueCat           10Mountain      5Stone         9Fish          14River         13Loin          17</p><p>so from above array I am only displaying non-living objects text, and what i want is that when user select them I get there value i.e. like when Mountain selected i get 5</p><p>I hope this example made my question a bit more clear...</p><p>thankx</p>","328518","","","","","2012-09-12 14:40:28","Setting values and display Text in Android Spinner","<java><android><drop-down-menu><spinner>","2","0","2","",""
"2942133","1","","","2010-05-31 07:50:31","0","969","<p>HI.</p><p>I have a Android application in which I want to download file from the web browser file link.But I don't know how can do it?</p><p>Help me.</p>","316451","","52626","","2011-03-27 20:13:52","2013-03-20 12:28:20","download file from the android web browser in sdcard?","<android>","1","2","","",""
"2942182","1","2942507","","2010-05-31 07:59:35","0","966","<p>I don't need a strict code related answer I just need somebody to tell me what I am missing.My application has to retrieve from a web service (xmlrpc) the positions of some users I know and update their position on a MapView.So I decided to use a Service and an Activity extending MapActivity to show results.I thought about two solutions:</p><p>I ) start the service and make it ask every minute for these positions and send them to the activity as a bundle via intent. (This didn't work out well, since once shown I couldn't find a method to let the activity continue  refresh itself until she stop receiving intents+data from the service)</p><p>II ) Incorporate a thread within the activity which starts the service via context.startService(...) every minute. And the MapUI refresh itself once the service send back an intent and stop itself. (Maybe I will fall in the same problem category as before I haven't tryied yet).</p><p>I am also giving directions (via maps.google ws) in this way I'd like to refresh only users positions on the map and save the route.What Am I missing do you have any suggestions? related to activities/services internal mechanics, don't know launch modes, use broadcast receivers or intent filters?Thanks in advance</p>","201058","","","","","2010-05-31 22:37:44","android use local service to refresh map UI","<android><service><map><android-intent>","1","0","","",""
"2942243","1","","","2010-05-31 08:15:39","0","211","<p>I plan to port some camera and multimedia algorithms and functionality on a Qualcomm Snapdragon platform running Android. I need OpenGL ES 2.0 acceleration for many algorithms. </p><p>Which platform is the right one? Also, where can I purchase this? The Android dev platform on Google's website supports on OpenGL ES 1.x </p><p>Thanks for any input.</p>","354402","","","","","2010-07-10 12:19:46","Android dev platform supporting OpenGL ES 2.0: Where to buy?","<android><opengl-es>","2","0","","",""
"2942295","1","","","2010-05-31 08:28:28","1","152","<p>I have'nt plunged into Android Development as yet though Java Classes C++ all that is not new to me. Here are the questions folks. Appreciated any help on these : - </p><ul><li><p>If I need to develop test and deploy Android Apps do I NEED AN ANDROID Hardware device or is there a software Android Simulator like VMWARE or Virtual PC , where I can emulate the results.If there is such can you point me more info</p></li><li><p>I have a Netbook ( the Chinese Ipad Clone ) running Android that has only Wi-Fi for the present. Is it possible to add the following features via the spare USB Port --- a USB Based 56K Modem : Are there Android platform H/W Drivers.--- a USB based RJ45 ( Ethernet LAN LandLine connection ) Adapter :Are there Android platform H/W Drivers.Please adviseThanksSaul</p></li></ul>","354412","","","","","2010-06-01 21:04:00","2 fundamental questions for the Androgurus ...Can someone guide me","<android><android-emulator><android-widget><android-manifest>","3","0","","",""
"2942454","1","6961658","","2010-05-31 09:01:16","13","1731","<p>I've got a problem with pushing files to my Nexus One.</p><p>It seems to me that there is only a small selection of file types that are accepted by my phone (such as jpg, gif and so on).</p><p>I recently tried to push other files to my phone (in my case gpx) and my phone rejected it automatically.</p><p>Is there a way to bypass or extend this filter in my program?<br>Is there also a way to catch those files by a service?</p>","317301","","13531","","2011-03-31 15:02:08","2011-08-05 19:41:03","Android: Issue with acceptable file types via bluetooth","<android><bluetooth><file-type><blacklist>","2","5","1","",""
"2942597","1","","","2010-05-31 09:26:14","1","441","<p>After several fruitless searches, I ask this question :</p><p>How can you redefine the ""search"" button an android phone?</p><p>I wish he would serve me something other than display a search box and a keyboard ...</p><p>Thank you</p><p>Regards</p><p>Vince</p>","354449","","133203","","2010-05-31 09:33:03","2010-06-01 07:57:54","Android, Redefine the search button","<android><search><button>","1","0","","",""
"2942675","1","","","2010-05-31 09:42:17","1","1254","<p>I'm beginner in Android. I have two screens. I am switching between the screens, but <code>onActivityResult()</code> is not called in my application. I'm getting my main screen back. I want result of my second screen.</p><p>This is my code:</p><p>mainActivity.java</p><pre><code>loadPicture.setOnTouchListener(new OnTouchListener() {    public boolean onTouch(View v, MotionEvent event) {        Intent i = new Intent(context, ImageThumbnailsActivity.class);        startActivityForResult(i, 0);        return true;    }});</code></pre><p>ImageThumbnailActivity.java</p><pre><code>public class ImageThumbnailsActivity extends Activity {    private Cursor imagecursor, actualimagecursor;    private int image_column_index, actual_image_column_index;    GridView imagegrid;    private int count;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.image_gallery);        init_phone_image_grid();    }    private void init_phone_image_grid() {        String[] img = { MediaStore.Images.Thumbnails._ID };        imagecursor = managedQuery(        MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, img, null,            null, MediaStore.Images.Thumbnails.IMAGE_ID + """");        image_column_index = imagecursor            .getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);        count = imagecursor.getCount();        imagegrid = (GridView) findViewById(R.id.PhoneImageGrid);        imagegrid.setAdapter(new ImageAdapterClass(getApplicationContext()));        imagegrid.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView parent, View v, int position,                long id) {                //System.gc();                String[] proj = { MediaStore.Images.Media.DATA };                actualimagecursor = managedQuery(                        MediaStore.Images.Media.EXTERNAL_CONTENT_URI, proj,                    null, null, null);                actual_image_column_index = actualimagecursor           .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);                actualimagecursor.moveToPosition(position);                String i = actualimagecursor.getString(actual_image_column_index);                //System.gc();                Intent intent = new Intent();                intent.putExtra(""filename"", i);                //startActivity(intent);                setResult(RESULT_OK,intent);                finish();            }        });    }    public class ImageAdapterClass extends BaseAdapter {        private Context mContext;        public ImageAdapterClass(Context c) {            mContext = c;        }        public int getCount() {            return count;        }        public Object getItem(int position) {            return position;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            //System.gc();            ImageView i = new ImageView(mContext.getApplicationContext());            if (convertView == null) {                imagecursor.moveToPosition(position);                int id = imagecursor.getInt(image_column_index);                i.setImageURI(Uri.withAppendedPath(                    MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """"+ id));                i.setScaleType(ImageView.ScaleType.CENTER_CROP);                i.setLayoutParams(new GridView.LayoutParams(92, 92));            } else {                i = (ImageView) convertView;            }            return i;        }     }}</code></pre>","354461","","1253844","","2013-07-31 15:11:37","2013-07-31 15:11:37","android onActivityResult not calling","<android>","2","0","","",""
"2942941","1","3564397","","2010-05-31 10:37:22","2","202","<p>Can someone tell me if this is a bug in the SDK/IDE:</p><p>Any custom or extended layout I add to my layout XML causes the IDE to ignore the fact that there are any child views of that layout (they just disappear from the outline view/window), thus making them uneditable via the properties view/window. (I need to extend a layout to make onSetAlpha() public)</p><p>FYI: I'm developing for Android 1.5 and up, using all the latest plug-ins/updates in Eclipse</p><p>Here is a simple example of a layout XML and the extended Layout that causes this error.</p><p>[Extended Layout]</p><pre><code>package com.test;public class CustomLinearLayout extends LinearLayout{    public CustomLinearLayout(Context context, AttributeSet attrs) {        super(context, attrs);    }    public CustomLinearLayout(Context context) {        super(context);    }}</code></pre><p>[Simple layout XML]</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.test.CustomLinearLayout 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/ImageView01""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/com.test.CustomLinearLayout&gt;</code></pre><p>ImageView01 is not visible or editable in the properties or outline views/windows.</p><p>Thanks.</p>","272302","","","","","2010-08-25 09:20:34","Android -- SDK/IDE Layout Bug (w/Custom Layouts)?","<android><ide><layout><sdk>","1","0","","",""
"2942952","1","","","2010-05-31 10:39:46","0","200","<p>I am thinking about converting my web apps into Android apps to reach the Android market. I do not have an Android phone. Can someone tell me how I can possibly get a Google developer phone (other than going to Google I/O, etc)?I realize this is somewhat of a ridiculous request but I have read blogs of people being enticed by google and offered a free phone to convert their web apps into Android apps. So I figure there is no harm in asking.</p><p>Any insight would be helpful. Thanks</p><p>I am also wondering what the cost of the developer phone is once you pay your $25 to enter the android market place as a developer through the developer account.</p>","241317","","","","","2010-06-01 10:23:37","Anyone know how you can get a Google dev phone to make Android apps?","<android><phone>","3","0","1","",""
"2943159","1","2943379","","2010-05-31 11:20:20","6","4640","<p>I have a TextView with android:maxLength set to 3 and another with android:maxLength set to 7.I want focus to automatically move to the second TextView once the 3 chars of the first TextView are filled up. Is this possible without inheriting TextView and writing a custom implementation ?</p>","907","","","","","2010-05-31 12:05:00","Focus next textview automatically","<android><textview>","1","0","2","",""
"2943191","1","2943340","","2010-05-31 11:25:33","2","567","<p>I know this should be fairly simple but I don't get it anyhow.<br>I've got an Activity (let's call it <em>XyActivity</em>) which has gotten pretty long. Therefore, I'd like to relocate some overriden methods to a subclass (let's call it <em>XyOptions</em>). Looks like that:</p><pre><code>public class XyActivity extends Activity {    XyOptions xyOptions;    public void onCreate(Bundle savedInstanceState) {        xyOptions = new XyOptions();        ...    }}</code></pre><p>and</p><pre><code>public class XyOptions extends XyActivity {    public EditImageOptions() {...}    @Override    public boolean onCreateOptionsMenu(Menu menu) {...}    @Override    public boolean onPrepareOptionsMenu(Menu menu) {...}    @Override    public boolean onOptionsItemSelected(MenuItem item) {...}</code></pre><p>Unfortunately, the methods in <em>XyOptions</em> are never called. And I don't get why. I'am sure the answer is trivial so please point me in some direction.</p><p>Thanks,<br>Steff</p>","289849","","","","","2010-05-31 12:11:40","Howto extend SomeActivity to relocate e.g. onCreateOptionsMenu?","<android><activity><subclass><relocation><subactivity>","2","0","","",""
"2943198","1","2943554","","2010-05-31 11:29:04","1","2408","<p>Hey guys,during my development in android I've missed a function that can log every broadcast intent that occur. Sometimes it had been very useful to have a function like that...</p><p>I'm also wondering how to trigger those broadcast intents manually on the emulator.</p><p>Is there an entire overview of available broadcast intents?</p><p>Would be great if someone would have some answers,</p><p>greets,poeschlorn</p>","317301","","","","","2010-05-31 12:38:02","Logging broadcast Intents and manually trigger them (Android)","<android><android-intent><broadcastreceiver><intentfilter>","1","0","","",""
"2943252","1","2972918","","2010-05-31 11:42:45","17","5045","<p>I have written a SyncAdapter that takes a ""com.google"" account and performs a sync with an appengine web service. Testing this with the dev tools sync tester (on the emulator), this sync appears to work just fine.</p><p>The problem is, it's not syncing by default. And going to the account in ""accounts &amp; sync"" shows my google account to be blank - as if there's no sync services available.</p><p>I suspect that in order to get my sync shown in the ""accounts &amp; sync"" menu, I'd need to implement my own AccountAuthenticator that would do exactly the same thing as what I presume google's AccountAuthenticator must already do. This is not an exciting job, and it seems very unnecessary. So:</p><ul><li>is there a way to add an entry to the ""accounts &amp; sync"" menu that uses my SyncAdapter but relies on a google account? or to add a sub-menu to google accounts that enables sync of my appengine service?</li></ul><p>if not,</p><ul><li>is there a way I can re-use google's AccountAuthenticator from within an AccountAuthenticator I write?</li></ul>","144135","","","","","2011-04-13 12:17:45","Android SyncAdapter using a google account","<android><authentication>","1","0","17","",""
"2943293","1","2943755","","2010-05-31 11:48:20","3","1062","<p>In my app, when one particular image button is clicked and held, i must be able to calculate the time for which the image button was held pressed. Can any one help me by giving some simple guidance or sample code. i am really stuck up here. Is there any specific event listener for this particular requirement. I am writing this app specifically for a touch screen phones only.</p>","347783","","347783","","2010-05-31 12:18:44","2010-05-31 13:16:20","what EVENT LISTENER should i use for my android app","<android><android-widget>","2","0","","",""
"2943386","1","2945682","","2010-05-31 12:06:13","4","5795","<p>I am trying to use a <a href=""http://developer.android.com/intl/de/reference/android/content/Context.html#sendOrderedBroadcast%28android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle%29"" rel=""nofollow"">sendOrderedBroadcast</a> in my Android app.</p><p>I want to be able to send the Intent from one of my applications to another and I then want to get data back from the Application that recieves the Intent, in this case a boolean true or false.</p><p>Here is the current code:</p><pre><code>    Intent i = new Intent();    i.setAction(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT);    i.putExtra(""com.testnetworks.QCLEVEL"", aProposedTheoreticalQoSLevel);    sendOrderedBroadcast(i, null, null, null, Activity.RESULT_OK, null, null);</code></pre><p>Is this the correct way to achieve what I want?</p><p>If so what do I use as the resultReceiver* parameter? (3rd parameter)</p><p>And then how to I recieve data back from the Broadcast?</p><p>I have done a quick google and not come up with any examples, any help or examples greatly appreciated.</p><p><strong>UPDATED CODE:</strong></p><hr><pre><code>sendOrderedBroadcast(i, null, domainBroadcast, null, Activity.RESULT_OK, null, null);</code></pre><hr><pre><code>class DomainBroadcast extends BroadcastReceiver{    @Override    public void onReceive(Context arg0, Intent intent) {        String action = intent.getAction();        if(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT.equals(action)){            Log.d(""BROADCAST"", ""Returning broadcast"");            Bundle b = intent.getExtras();             Log.d(""BROADCAST"", ""Returning broadcast "" +                     b.getInt(""com.testnetworks.INT_TEST""));        }          }</code></pre><hr><pre><code>    @Override    public void onReceive(Context context, Intent intent) {            String action = intent.getAction();             if(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT.equals(action)){                Bundle b = intent.getExtras();                int testQCLevel = b.getInt(""com.testnetworks.QCLEVEL"");                switch(testQCLevel){                case 1:                    Log.d(""QCLevel "", ""QCLevel = UNAVAILABLE"");                    break;                case 2:                    Log.d(""QCLevel "", ""QCLevel = BELOWUSABILITY"");                    break;                case 3:                    Log.d(""QCLevel "", ""QCLevel = VOICE"");                    break;                }                intent.putExtra(""com.testnetworks.INT_TEST"", 100);          }</code></pre><hr><p>So according to the Doc's I should recieve 100 back in my DomainBroadcast reciever but it always comes back as 0.</p><p>Can anyone see why?</p><p>*<em>resultReceiver - Your own BroadcastReceiver to treat as the final receiver of the broadcast.</em></p>","243999","","243999","","2010-05-31 16:37:11","2010-05-31 22:05:00","Android - sendOrderedBroadcast help","<android><android-intent><broadcast><broadcastreceiver>","1","1","3","",""
"2943523","1","2943642","","2010-05-31 12:31:57","3","2998","<p>Is it mandatory to have EULA for free android applications on Android Market. I 'm going to upload a free android application on Android Market. Since I 'm new to the process to uploading application to android market could anyone tell me why EULA is needed ?  </p>","218665","","","","","2011-11-02 11:23:55","Android Applications EULA","<android><eula>","1","1","","",""
"2943828","1","2957386","","2010-05-31 13:32:27","17","31075","<p>I'm trying to compile a static library to use on Android but I can't figure out how to compile it. The library uses standard libraries (stdio.h etc...) and libxml2.</p><p>I am trying to compile using arm-eabi-gcc but I get the following error:</p><p>/cygdrive/c/android-ndk-r4/build/platforms/android-8/arch-x86/usr/include/asm/posix_types.h:15:28: error: posix_types_64.h: No such file or directory</p><p>How do I get this to work?</p>","294743","","149841","","2011-12-07 15:26:49","2014-03-04 12:59:56","How to compile a static library using the Android NDK?","<android><static-libraries><android-ndk>","2","0","16","",""
"2943846","1","","","2010-05-31 13:34:35","0","353","<p>I am using edtftpj-pro3.1 trial copy in my android app to make SFTP connection with the server.After few connections with the server with 5-6 file transfers, my app is crashing with following exception.Is it causing the problem or what could be the problem??</p><p>I tried setParallelMode(false) in SSHFTPClient, but it is not working.</p><p>Exception i'm getting is,</p><p>05-31 18:28:12.661: ERROR/dalvikvm(589): HeapWorker is wedged: 10173ms spent inside Lcom/enterprisedt/net/j2ssh/sftp/SftpFileInputStream;.finalize()V05-31 18:28:12.661: INFO/dalvikvm(589): DALVIK THREADS:05-31 18:28:12.661: INFO/dalvikvm(589): ""main"" prio=5 tid=3 WAIT05-31 18:28:12.661: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x4001b260 self=0xbd1805-31 18:28:12.661: INFO/dalvikvm(589): | sysTid=589 nice=0 sched=0/0 cgrp=default handle=-134399319205-31 18:28:12.661: INFO/dalvikvm(589): at java.lang.Object.wait(Native Method)05-31 18:28:12.661: INFO/dalvikvm(589): - waiting on &lt;0x122d70> (a android.os.MessageQueue)05-31 18:28:12.661: INFO/dalvikvm(589): at java.lang.Object.wait(Object.java:288)05-31 18:28:12.661: INFO/dalvikvm(589): at android.os.MessageQueue.next(MessageQueue.java:148)05-31 18:28:12.661: INFO/dalvikvm(589): at android.os.Looper.loop(Looper.java:110)05-31 18:28:12.661: INFO/dalvikvm(589): at android.app.ActivityThread.main(ActivityThread.java:4363)05-31 18:28:12.661: INFO/dalvikvm(589): at java.lang.reflect.Method.invokeNative(Native Method)05-31 18:28:12.661: INFO/dalvikvm(589): at java.lang.reflect.Method.invoke(Method.java:521)05-31 18:28:12.661: INFO/dalvikvm(589): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)05-31 18:28:12.661: INFO/dalvikvm(589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)05-31 18:28:12.661: INFO/dalvikvm(589): at dalvik.system.NativeStart.main(Native Method)05-31 18:28:12.671: INFO/dalvikvm(589): ""Transport protocol 1"" daemon prio=5 tid=29 NATIVE05-31 18:28:12.671: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x44774768 self=0x3a793805-31 18:28:12.671: INFO/dalvikvm(589): | sysTid=605 nice=0 sched=0/0 cgrp=default handle=383460005-31 18:28:12.671: INFO/dalvikvm(589): at org.apache.harmony.luni.platform.OSNetworkSystem.receiveStreamImpl(Native Method)05-31 18:28:12.671: INFO/dalvikvm(589): at org.apache.harmony.luni.platform.OSNetworkSystem.receiveStream(OSNetworkSystem.java:478)05-31 18:28:12.671: INFO/dalvikvm(589): at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:565)05-31 18:28:12.671: INFO/dalvikvm(589): at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:87)05-31 18:28:12.671: INFO/dalvikvm(589): at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:67)05-31 18:28:12.671: INFO/dalvikvm(589): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:157)05-31 18:28:12.671: INFO/dalvikvm(589): at java.io.BufferedInputStream.read(BufferedInputStream.java:346)05-31 18:28:12.671: INFO/dalvikvm(589): at java.io.BufferedInputStream.read(BufferedInputStream.java:341)05-31 18:28:12.671: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.transport.A.A((null):-1)05-31 18:28:12.671: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.transport.A.B((null):-1)05-31 18:28:12.671: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.processMessages((null):-1)05-31 18:28:12.671: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.startBinaryPacketProtocol((null):-1)05-31 18:28:12.671: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.run((null):-1)05-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.671: INFO/dalvikvm(589): ""StreamFrameSender"" prio=5 tid=27 TIMED_WAIT05-31 18:28:12.671: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x44750a60 self=0x3964d805-31 18:28:12.671: INFO/dalvikvm(589): | sysTid=603 nice=0 sched=0/0 cgrp=default handle=376164805-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Object.wait(Native Method)05-31 18:28:12.671: INFO/dalvikvm(589): - waiting on &lt;0x399478> (a com.corventis.gateway.ppp.StreamFrameSender)05-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Object.wait(Object.java:326)05-31 18:28:12.671: INFO/dalvikvm(589): at com.corventis.gateway.ppp.StreamFrameSender.run(StreamFrameSender.java:154)05-31 18:28:12.671: INFO/dalvikvm(589): at com.corventis.gateway.util.MonitoredRunnable.run(MonitoredRunnable.java:41)05-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.671: INFO/dalvikvm(589): ""SftpActiveWorker"" prio=5 tid=25 TIMED_WAIT05-31 18:28:12.671: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x447522b0 self=0x398e0005-31 18:28:12.671: INFO/dalvikvm(589): | sysTid=604 nice=0 sched=0/0 cgrp=default handle=376270405-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Object.wait(Native Method)05-31 18:28:12.671: INFO/dalvikvm(589): - waiting on &lt;0x3962d8> (a com.corventis.gateway.hostcommunicator.SftpActiveWorker)05-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Object.wait(Object.java:326)05-31 18:28:12.671: INFO/dalvikvm(589): at com.corventis.gateway.hostcommunicator.SftpActiveWorker.run(SftpActiveWorker.java:151)05-31 18:28:12.671: INFO/dalvikvm(589): at com.corventis.gateway.util.MonitoredRunnable.run(MonitoredRunnable.java:41)05-31 18:28:12.671: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.671: INFO/dalvikvm(589): ""Thread-12"" prio=5 tid=23 NATIVE05-31 18:28:12.671: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x4474aca8 self=0x11569005-31 18:28:12.671: INFO/dalvikvm(589): | sysTid=602 nice=0 sched=0/0 cgrp=default handle=87812005-31 18:28:12.671: INFO/dalvikvm(589): at android.bluetooth.BluetoothSocket.acceptNative(Native Method)05-31 18:28:12.681: INFO/dalvikvm(589): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:287)05-31 18:28:12.681: INFO/dalvikvm(589): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:105)05-31 18:28:12.681: INFO/dalvikvm(589): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:91)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.bluetooth.BluetoothManager.openPort(BluetoothManager.java:215)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.bluetooth.BluetoothManager.open(BluetoothManager.java:84)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.patchcommunicator.PatchCommunicator.open(PatchCommunicator.java:123)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.patchcommunicator.PatchCommunicatorRunnable.run(PatchCommunicatorRunnable.java:134)05-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.681: INFO/dalvikvm(589): ""HfGatewayApplication"" prio=5 tid=21 RUNNABLE05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=0 dsCount=0 s=N obj=0x4472d9b0 self=0x12092805-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=601 nice=0 sched=0/0 cgrp=default handle=126467205-31 18:28:12.681: INFO/dalvikvm(589): at com.jcraft.jzlib.Deflate.deflateInit2(Deflate.java:~1361)05-31 18:28:12.681: INFO/dalvikvm(589): at com.jcraft.jzlib.Deflate.deflateInit(Deflate.java:1316)05-31 18:28:12.681: INFO/dalvikvm(589): at com.jcraft.jzlib.ZStream.deflateInit(ZStream.java:127)05-31 18:28:12.681: INFO/dalvikvm(589): at com.jcraft.jzlib.ZStream.deflateInit(ZStream.java:120)05-31 18:28:12.681: INFO/dalvikvm(589): at com.jcraft.jzlib.ZOutputStream.(ZOutputStream.java:62)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.zipfile.ZipStorer.addStream(ZipStorer.java:211)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.zipfile.ZipStorer.createZip(ZipStorer.java:127)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.hostcommunicator.HostCommunicator.scanAndCompress(HostCommunicator.java:453)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.hostcommunicator.HostCommunicator.doWork(HostCommunicator.java:1434)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.hf.HfGatewayApplication.doWork(HfGatewayApplication.java:621)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.hf.HfGatewayApplication.run(HfGatewayApplication.java:546)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.util.MonitoredRunnable.run(MonitoredRunnable.java:41)05-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.681: INFO/dalvikvm(589): ""Thread-10"" prio=5 tid=19 TIMED_WAIT05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x447287f8 self=0x1451b805-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=598 nice=0 sched=0/0 cgrp=default handle=133192005-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.VMThread.sleep(Native Method)05-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.Thread.sleep(Thread.java:1306)05-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.Thread.sleep(Thread.java:1286)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.util.Watchdog.run(Watchdog.java:167)05-31 18:28:12.681: INFO/dalvikvm(589): at java.lang.Thread.run(Thread.java:1096)05-31 18:28:12.681: INFO/dalvikvm(589): ""Thread-9"" prio=5 tid=17 RUNNABLE05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=Y obj=0x44722c90 self=0x114e2005-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=597 nice=0 sched=0/0 cgrp=default handle=120004805-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.time.Time.currentTimeMillis(Time.java:~77)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.patchcommunicator.PatchCommunicatorState$1.run(PatchCommunicatorState.java:27)05-31 18:28:12.681: INFO/dalvikvm(589): ""Thread-8"" prio=5 tid=15 RUNNABLE05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=Y obj=0x44722430 self=0x124dd005-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=596 nice=0 sched=0/0 cgrp=default handle=119984805-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.time.Time.currentTimeMillis(Time.java:~80)05-31 18:28:12.681: INFO/dalvikvm(589): at com.corventis.gateway.hostcommunicator.HostCommunicatorState$1.run(HostCommunicatorState.java:35)05-31 18:28:12.681: INFO/dalvikvm(589): ""Binder Thread #2"" prio=5 tid=13 NATIVE05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x4471ccc0 self=0x149b6005-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=595 nice=0 sched=0/0 cgrp=default handle=131799205-31 18:28:12.681: INFO/dalvikvm(589): at dalvik.system.NativeStart.run(Native Method)05-31 18:28:12.681: INFO/dalvikvm(589): ""Binder Thread #1"" prio=5 tid=11 NATIVE05-31 18:28:12.681: INFO/dalvikvm(589): | group=""main"" sCount=1 dsCount=0 s=N obj=0x447159a8 self=0x12329805-31 18:28:12.681: INFO/dalvikvm(589): | sysTid=594 nice=0 sched=0/0 cgrp=default handle=116489605-31 18:28:12.681: INFO/dalvikvm(589): at dalvik.system.NativeStart.run(Native Method)05-31 18:28:12.691: INFO/dalvikvm(589): ""JDWP"" daemon prio=5 tid=9 VMWAIT05-31 18:28:12.691: INFO/dalvikvm(589): | group=""system"" sCount=1 dsCount=0 s=N obj=0x4470f2a0 self=0x141a9005-31 18:28:12.691: INFO/dalvikvm(589): | sysTid=593 nice=0 sched=0/0 cgrp=default handle=131686405-31 18:28:12.691: INFO/dalvikvm(589): at dalvik.system.NativeStart.run(Native Method)05-31 18:28:12.691: INFO/dalvikvm(589): ""Signal Catcher"" daemon prio=5 tid=7 VMWAIT05-31 18:28:12.691: INFO/dalvikvm(589): | group=""system"" sCount=1 dsCount=0 s=N obj=0x4470f1e8 self=0x12497005-31 18:28:12.691: INFO/dalvikvm(589): | sysTid=592 nice=0 sched=0/0 cgrp=default handle=131680005-31 18:28:12.691: INFO/dalvikvm(589): at dalvik.system.NativeStart.run(Native Method)05-31 18:28:12.691: INFO/dalvikvm(589): ""HeapWorker"" daemon prio=5 tid=5 MONITOR05-31 18:28:12.691: INFO/dalvikvm(589): | group=""system"" sCount=1 dsCount=0 s=N obj=0x431b4550 self=0x14167005-31 18:28:12.691: INFO/dalvikvm(589): | sysTid=591 nice=0 sched=0/0 cgrp=default handle=131640005-31 18:28:12.691: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.sftp.SftpSubsystemClient.closeHandle((null):~-1)05-31 18:28:12.691: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.sftp.SftpSubsystemClient.closeFile((null):-1)05-31 18:28:12.691: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.sftp.SftpFile.close((null):-1)05-31 18:28:12.691: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.sftp.SftpFileInputStream.close((null):-1)05-31 18:28:12.691: INFO/dalvikvm(589): at com.enterprisedt.net.j2ssh.sftp.SftpFileInputStream.finalize((null):-1)05-31 18:28:12.691: INFO/dalvikvm(589): at dalvik.system.NativeStart.run(Native Method)05-31 18:28:12.691: ERROR/dalvikvm(589): VM aborting05-31 18:28:12.801: INFO/DEBUG(49): <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <em>*</em>05-31 18:28:12.801: INFO/DEBUG(49): Build fingerprint: 'google/passion/passion/mahimahi:2.1-update1/ERE27/24178:user/release-keys'05-31 18:28:12.801: INFO/DEBUG(49): pid: 589, tid: 601 >>> com.corventis.gateway.hf &lt;&lt;&lt;05-31 18:28:12.801: INFO/DEBUG(49): signal 11 (SIGSEGV), fault addr deadd00d05-31 18:28:12.801: INFO/DEBUG(49): r0 00000026 r1 afe13329 r2 afe13329 r3 0000000005-31 18:28:12.801: INFO/DEBUG(49): r4 ad081f50 r5 400091e8 r6 009b3a6a r7 0000000005-31 18:28:12.801: INFO/DEBUG(49): r8 000002e8 r9 ad082ba0 10 ad082ba0 fp 0000000005-31 18:28:12.801: INFO/DEBUG(49): ip deadd00d sp 46937c58 lr afe14373 pc ad035b4c cpsr 2000003005-31 18:28:12.851: INFO/DEBUG(49): #00 pc 00035b4c /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #01 pc 00044d7c /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #02 pc 000162e4 /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #03 pc 00016b60 /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #04 pc 00016ce0 /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #05 pc 00057b64 /system/lib/libdvm.so05-31 18:28:12.861: INFO/DEBUG(49): #06 pc 00057cc0 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #07 pc 00057dd4 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #08 pc 00012ffc /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #09 pc 00019338 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #10 pc 00018804 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #11 pc 0004eed0 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #12 pc 0004eef8 /system/lib/libdvm.so05-31 18:28:12.871: INFO/DEBUG(49): #13 pc 000426d4 /system/lib/libdvm.so05-31 18:28:12.881: INFO/DEBUG(49): #14 pc 0000fd74 /system/lib/libc.so05-31 18:28:12.881: INFO/DEBUG(49): #15 pc 0000f840 /system/lib/libc.so05-31 18:28:12.881: INFO/DEBUG(49): code around pc:05-31 18:28:12.881: INFO/DEBUG(49): ad035b3c 58234808 b1036b9b f8df4798 2026c01c05-31 18:28:12.881: INFO/DEBUG(49): ad035b4c 0000f88c ef52f7d8 0004c428 fffe631c05-31 18:28:12.881: INFO/DEBUG(49): ad035b5c fffe94f4 000002f8 deadd00d f8dfb40e05-31 18:28:12.881: INFO/DEBUG(49): code around lr:05-31 18:28:12.881: INFO/DEBUG(49): afe14360 686768a5 f9b5e008 b120000c 4628920105-31 18:28:12.881: INFO/DEBUG(49): afe14370 9a014790 35544306 37fff117 6824d5f305-31 18:28:12.881: INFO/DEBUG(49): afe14380 d1ed2c00 bdfe4630 00026ab0 000000b405-31 18:28:12.881: INFO/DEBUG(49): stack:05-31 18:28:12.881: INFO/DEBUG(49): 46937c18 0000001505-31 18:28:12.881: INFO/DEBUG(49): 46937c1c afe13359 /system/lib/libc.so05-31 18:28:12.881: INFO/DEBUG(49): 46937c20 afe3b02c /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c24 afe3afd8 /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c28 0000000005-31 18:28:12.891: INFO/DEBUG(49): 46937c2c afe14373 /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c30 afe13329 /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c34 afe13329 /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c38 afe13380 /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c3c ad081f50 /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c40 400091e8 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)05-31 18:28:12.891: INFO/DEBUG(49): 46937c44 009b3a6a05-31 18:28:12.891: INFO/DEBUG(49): 46937c48 0000000005-31 18:28:12.891: INFO/DEBUG(49): 46937c4c afe1338d /system/lib/libc.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c50 df00277705-31 18:28:12.891: INFO/DEBUG(49): 46937c54 e3a070ad05-31 18:28:12.891: INFO/DEBUG(49): #00 46937c58 ad06f573 /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c5c ad044d81 /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): #01 46937c60 000027bd05-31 18:28:12.891: INFO/DEBUG(49): 46937c64 0000000005-31 18:28:12.891: INFO/DEBUG(49): 46937c68 463b6ab4 /data/dalvik-cache/data@app@com.corventis.gateway.hf.apk@classes.dex05-31 18:28:12.891: INFO/DEBUG(49): 46937c6c 463d1ecf /data/dalvik-cache/data@app@com.corventis.gateway.hf.apk@classes.dex05-31 18:28:12.891: INFO/DEBUG(49): 46937c70 00140450 [heap]05-31 18:28:12.891: INFO/DEBUG(49): 46937c74 ad041d2b /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c78 ad082f2c /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c7c ad06826c /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c80 00140450 [heap]05-31 18:28:12.891: INFO/DEBUG(49): 46937c84 0000000005-31 18:28:12.891: INFO/DEBUG(49): 46937c88 000002f805-31 18:28:12.891: INFO/DEBUG(49): 46937c8c 400091e8 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)05-31 18:28:12.891: INFO/DEBUG(49): 46937c90 ad081f50 /system/lib/libdvm.so05-31 18:28:12.891: INFO/DEBUG(49): 46937c94 000002f805-31 18:28:12.891: INFO/DEBUG(49): 46937c98 0000271005-31 18:28:12.891: INFO/DEBUG(49): 46937c9c ad0162e8 /system/lib/libdvm.so</p><p>Thanks &amp; Regards,</p>","271769","","115145","","2010-05-31 14:08:21","2010-06-10 14:50:15","Android edtftpj/PRo SFTP heap worker problem","<android><eclipse><heap><sftp><edtftpj>","1","0","","",""
"2943928","1","","","2010-05-31 13:46:45","1","161","<p>i got the error 'org.eclipse.wst.sse.core 0.0.0 missing when i tried to install the adt plugin for android </p>","354635","","236128","","2010-05-31 13:57:41","2013-05-05 09:56:37","installing eclipse ide 3.5 for android development","<android><eclipse><eclipse-plugin>","2","2","","",""
"2943947","1","","","2010-05-31 13:50:15","3","12031","<p>How to Enable Flash Plugin in Webview Browser?</p>","354639","","268273","","2012-03-24 22:12:44","2014-02-14 19:55:12","How to Enable Flash Plugin in Webview?","<android><flash><webview>","4","0","1","",""
"2943967","1","","","2010-05-31 13:53:27","1","577","<p>Could someone give me an idea about how to exclude using maven, some resources. I have a lot of languages in my project and I want to make build only for 3 languages for example. I have create the pom file and when I make the apk, all resources are copy by default(resources:resources,""Copying 122 resources""). Can I make in any way to create the apk only with the language resources that I want? </p><p>Thanks in advance!</p>","354638","","70604","","2010-06-24 22:39:13","2010-07-23 19:38:20","exclude resources from android:generate-sources","<android><maven-2><resources><build><exclusion>","3","0","1","",""
"2943994","1","2944121","","2010-05-31 13:57:31","0","2740","<p>I have the calendar.ics file. I have to read that file from my application and transfer the data in to Google calendar in android. I am new to android. I need some help to do this.Can anyone help me to do this?  </p>","314427","","","","","2010-05-31 14:21:13","how to read .ics file and add data to Google Calendar in android?","<android>","1","0","","",""
"2944070","1","","","2010-05-31 14:11:30","0","439","<p>I have an android service that connects to remote server by TCP/IP and waits for notifications from it. Should I care about <a href=""http://developer.android.com/reference/android/os/PowerManager.html"" rel=""nofollow"">PowerManagement</a>? Can sleep mode affect me some how?</p><p>If no, than what are the ""use cases"" to care about wake locks?</p>","62192","","62192","","2010-06-20 02:12:49","2010-06-20 02:12:49","When should I care about PowerManagement and wake locks for Android service?","<android><power-management>","1","0","3","",""
"2944074","1","2944096","","2010-05-31 14:11:52","45","50354","<p>Once I have created a project with the Android wizard, how do I change the API Package from say 1.5 to 2.1 ?</p><p>I'm not referring to the application xml where the minimum API is set, I'm referring to the jar's included in my project to the Google APIs.</p>","172861","","","","","2012-05-02 10:58:47","Eclipse Android Change API Level","<android><eclipse>","2","5","10","",""
"2944120","1","","","2010-05-31 14:21:07","1","23791","<p>Hi i have the listview the sixitems in it, but  when i call alet function on event it doesnt work ? let me know how to write a function on item event on click?</p><pre><code>     public class PhotoListView extends ListActivity {     String[] listItems = {""HeadShot"", ""BodyShot "", ""ExtraShot"", ""Video Take1"", ""Video Take2"", ""Video Take3"", };     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, listItems));     }</code></pre><p>OnListclick</p><pre><code>  ListView Shot = getListView();  protected void onListItemClick(View view) {    if(view == Shot){        AlertDialog.Builder alertbox = new AlertDialog.Builder(this);        // set the message to display          alertbox.setMessage(""Please Get Ready"");    }    </code></pre>","164850","","","","","2013-07-18 06:37:42","How to write onclick event for ListView in Android?","<android><listview>","1","0","","",""
"2944187","1","2945158","","2010-05-31 14:36:41","0","1220","<p>I am using  the getItemIdAtPosition() to get the Basecoulmns id of the record in Sqlite Database. </p><p>the code is below:</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {        Cursor cursor = managedQuery(Constants.CONTENT_URI,                PROJECTION, BaseColumns._ID + ""=""                        + l.getItemIdAtPosition(position), null, null);}</code></pre><p>But its does not retrieves the id correctly. Is this method depends some thing at the time of setting adapter or creation of DB? I have no idea. why it shows the position of the listview. Any Idea?</p><p>Edit:</p><p>the code for getView mehod :</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        if (convertView == null) {            convertView = mInflater.inflate(R.layout.brutube_videos, null);            holder = new ViewHolder();            holder.text1 = (TextView) convertView                    .findViewById(R.id.vdo_text1);            holder.text2 = (TextView) convertView                    .findViewById(R.id.vdo_text2);            holder.text3 = (TextView) convertView                    .findViewById(R.id.vdo_rate_text);            holder.icon = (ImageView) convertView                    .findViewById(R.id.vdo_icon);            convertView.setTag(holder);        } else {            holder.text1 = (TextView) convertView                    .findViewById(R.id.vdo_text1);            holder.text2 = (TextView) convertView                    .findViewById(R.id.vdo_text2);            holder.text3 = (TextView) convertView                    .findViewById(R.id.vdo_rate_text);            holder.icon = (ImageView) convertView                    .findViewById(R.id.vdo_icon);        }        if (!mBusy) {            try {                Log.v(""getview"", """" + (position) + "" - "" + VAL3[position]);                holder.icon.setImageBitmap(BitmapFactory                        .decodeStream(new URL(VAL3[position])                                .openConnection().getInputStream()));                notifyDataSetChanged();            } catch (MalformedURLException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            }            holder.icon.setTag(null);        } else {            holder.icon.setImageResource(R.drawable.no_video_icon);            // Non-null tag means the view still needs to load it's data            holder.icon.setTag(this);        }        holder.text1.setText(VAL1[position]);        holder.text2.setText(VAL2[position]);        holder.text3.setText(VAL4[position] + "" Ratings"");        return convertView;    }</code></pre>","267269","","21234","","2010-06-25 13:21:48","2010-06-25 13:21:48","getItemIdAtPosition() problem in Android?","<android><listview>","2","0","","",""
"2944211","1","","","2010-05-31 14:40:10","1","323","<p>I have a mobile application and will like to have the authentication implemented either through the Application itself or through Facebook username and password. </p><p>For example, if I have username and password of Facebook then one can login into the Application. I don't want to integrate the facebook completely only the authentication part. Is this possible?</p><p>Hope to get a quick response.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2010-05-31 23:50:14","Facebook Authentication only in Android and Blackberry?","<android><authentication><facebook>","2","0","","",""
"2944242","1","2944658","","2010-05-31 14:44:38","1","1078","<p>I have a listview with custom rows and that extends SimpleAdapter. Each row consist of two linear layouts : 1st having two textviews of which one is hidden in horizontal orientation, second having two textviews in horizontal orientation.Now depending on the value in hidden textview , I want to setcolor for the remaining items for the row.To put it as simple: each listview item has some custom colors the value of which comes from the hidden field.</p><p>I have done this by overriding getview() for the simpleadapter and returning view for each, but this makes list very slow to render (and that I think is obvious as so much of work for each view before showing it). </p><p>Can I do this in some more efficient way ? like making views and then add up to list instead of using xml layout maybe one solution OR any other ? Any help ? Thanks.</p>","315619","","315619","","2010-05-31 15:41:34","2010-05-31 16:01:49","How to use custom color for each textview in listview that extends SimpleAdapter in Android?","<android>","1","1","","",""
"2944244","1","","","2010-05-31 14:44:46","46","49804","<p>I'm trying to change the default color for the options menu which is white. I want a black background for every item on the options menu. I've tried some shoots like android:itemBackground=""#000000"" on the item element within the menu element but it doesn't work.I don't know if this is doable or not. Any idea would be welcome! :)</p>","267779","","464552","","2012-01-10 12:40:48","2013-09-07 09:57:19","Change the background color of the options menu","<android><user-interface><layout-inflater>","8","0","24","",""
"2944470","1","","","2010-05-31 15:26:34","2","556","<p>I have made a layout with RelativeLayout. The layout includes quite a number of other elements, from a couple of TableLayouts to several ImageButtons...The RelativeLayout itself has the following parameters :</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:background=""@drawable/bgimage""&gt;</code></pre><p>Now I noticed that sometimes (mostly when coming out of the screensaver-mode, as in coming out of the black screen) the whole screen would be drawn as if it has moved like 50 pixels downwards, leaving a black space of 50 pixels on top... When I move my trackball (device is an ADP2, Google Ion) up and down the layout will move up and down as well, as if it's somehow scrollable...After loading another Actvity and getting back to the original one this behabiour will have corrected itself...</p><p>Does anyone have experienced something like this ? And how can this be solved ?Thanks in advance for any help/tips/pointers !</p>","162147","","","","","2011-11-01 23:11:41","Android RelativeLayout sometimes scrolls","<android><scrolling><relativelayout>","1","0","","",""
"2944528","1","2950895","","2010-05-31 15:37:32","2","1631","<p>Is it possible to open an external file in Android? (As XmlPullParser)</p>","120574","","","","","2010-06-01 15:05:00","Open an external XML file","<xml><android><external><open>","2","1","","",""
"2944626","1","2944827","","2010-05-31 15:55:36","2","734","<p>I want to make an application that compare pizza prices. To do that I have to go to the actual site and enter and search. How can I display the prices WITHOUT the user seeing the actions of going to the website and entering a search. Would I use a WebView and a WebViewClient?</p>","200477","","","","","2010-05-31 16:37:26","Get information from website for Android","<java><android>","1","0","2","",""
"2944679","1","2945279","","2010-05-31 16:04:36","1","911","<p>How do I get the current compass reading in android 2.1?  I know that I can initiate a listener and receive updates but I do not need constant updates I only need it to get the compass orientation when the user clicks a button.</p><p>Also what is the most accurate way to get the compass orientation? </p><p>Lastly, how do I send fake data to the android console.  I know that you're supposed to use the terminal and send it commands but what are the commands I can't seem to find it on the Android website.</p><p>Thank you</p>","349451","","","","","2010-05-31 18:21:03","How to get current compass reading android 2.1","<java><android>","1","0","","",""
"2944731","1","","","2010-05-31 16:16:56","1","525","<p>Below logs gives any clue ? The app just opens up (we could just see the tite of the app as YouTube and it goes back to launcher tray immd.)</p><pre><code>cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.youtube/.HomeActivity }05-31 14:06:41.655: INFO/ActivityManager(1102): Start proc com.google.android.youtube for activity com.google.android.youtube/.HomeActivity: pid=2977 uid=10041 gids={3003}05-31 14:06:41.655: DEBUG/KeyguardViewMediator(1102): setHidden false05-31 14:06:41.796: INFO/foo(1102): ********************** resuming: 114401240805-31 14:06:41.897: INFO/ActivityThread(2977): Publishing provider com.google.android.youtube.SuggestionProvider: com.google.android.youtube.suggest.SuggestionProvider05-31 14:06:41.960: INFO/YouTube(2977): Distribution channel:mvapp-android-google05-31 14:06:42.116: INFO/AndroidRuntime(2977): AndroidRuntime onExit calling exit(-42)05-31 14:06:42.116: INFO/dalvikvm(2977): In threadExitCheck 0xbdb005-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread exited without telling us05-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread 2977 status: 705-31 14:06:42.124: DEBUG/KeyguardViewMediator(1102): setHidden false05-31 14:06:42.139: INFO/ActivityManager(1102): Process com.google.android.youtube (pid 2977) has died</code></pre>","354738","","13070","","2010-05-31 16:59:46","2010-05-31 16:59:46","YouTube app fails to open up when launched","<android>","0","1","","",""
"2944735","1","","","2010-05-31 16:17:59","0","3248","<p>I am quite new about android platform. I want to export my service to be public used.I find something on developer doc </p><p>android:exported Whether or not components of other applications can invoke the service or interact with it — ""true"" if they can, and ""false"" if not. When the value is ""false"", only components of the same application or applications with the same user ID can start the service or bind to it. </p><p>but i dont understand itCan anyone show me a brief example of how to use it?</p><p>many thx  </p>","354734","","","","","2012-01-03 20:51:15","android service exported attribute?","<android>","2","0","","",""
"2945196","1","","","2010-05-31 17:54:10","1","970","<p>I've written an app with 3 tabs.  Each tab has the same list view with different data sources.  I have setup SharedPreferences in the tabhost activity, but I put my onSharedPreferenceChangeListener method in my listactivity.  When I change a preference, my listener gets called and it updates my database.  This is all working.  However, if I change the data in tab 1, it calls my listener once.  If I change the data for tab 2 it calls it twice and if I change the data in tab 3 it calls it three times.  Any idea why it works this way?  I guess I could setup my shared prefs in my listactivity and that might avoid the issue, but I'm curious why my listener is called multiple times if it's in a different tab.</p><p>brockoli</p>","326430","","","","","2012-03-15 04:32:08","Why is my onSharedPreferenceChangeListener being called multiple times when I change a pref","<android><listactivity><android-tabhost><sharedpreferences>","1","2","1","",""
"2945220","1","2946823","","2010-05-31 18:00:33","1","2661","<p>I have just started my career as an android programmer, and am currently relying heavily on the sample code and api examples. I have been working with <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List6.html"" rel=""nofollow"">this api example</a>, to produce an expandable list of items (note this example does not use the ExpadableListView).</p><p>In playing with the example, I tried to add another widget that would become visible and be gone at the same time as the text (mDialogue in the sample code). This works well with another TextView, but as soon as I tried to add a button widget, it stopped working. The list would expand on first click, showing my hidden TextView and Button, but it will not disappear on further clicks. The button is however, clickable, and I was able to set up an onClick listener to change the button text back and forth.</p><p>I'm starting to wonder, is it just not possible to have a clickable item inside a clickable list item? Or is there some kind of work around? Would it solve my problem if I used ExpandableListView?</p>","259645","","","","","2010-06-01 01:27:55","On Android, click to expand list -and- click on a button?","<android><android-widget><android-linearlayout>","1","0","","",""
"2945274","1","","","2010-05-31 18:14:43","9","18146","<p>I have a TabActivity and am going to have 3 or 4 tabs.</p><p>In TabA, I would like to have an ExpandableListView, which will list products. I would like TabC to act as a sort of ""shopping cart"", probably with a ListView of itself. </p><p>Is there a way to interact with the TabHost from the Activity? I would like to be able to click a button inside of TabA and have it update and switch to TabC. Is this possible? Can I get the Tab's activities call its parents methods?</p>","354791","","63550","","2011-11-01 10:55:26","2012-07-17 04:40:52","Update tabs from a tab's activity in a Android TabHost","<android><activity><android-intent><android-tabhost>","4","0","1","",""
"2945315","1","2945763","","2010-05-31 18:27:24","17","15253","<p>I would like to know if is there a way to call <code>android:layout_gravity</code> property from a Java method. I didn't found any method in Android documentation to do it. This is the picture of the layout I want to implement:</p><p><img src=""http://www.anddev.org/resources/image/2234"" alt=""""></p><p>I know to do it through XML, as following:</p><pre><code>&lt;FrameLayout    xlmns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;      &lt;Button         android:layout_gravity=""left|center_vertical""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""&lt;"" /&gt;      &lt;Button         android:layout_gravity=""right|center_vertical""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""&gt;"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>But in my situation, I need to do it through Java code, because I'll implement another layout views dynamically. To avoid merging XML layout with Java code, I would prefer make all layout using Java.</p>","209927","","313758","","2011-03-27 09:45:42","2014-01-30 13:43:27","Java method for android:layout_gravity","<java><android><layout>","4","1","","","2010-05-31 18:27:24"
"2945347","1","2949242","","2010-05-31 18:34:52","3","132","<pre><code>myInput.setText(myInput.getText().replace(myInput.getSelectionStart(), myInput.getSelectionEnd(), myText));myInput.setSelection(myInput.getSelectionStart() + myText.length(), myInput.getSelectionEnd() + myText.length())</code></pre><p>I ask because I think this code is much longer than it needs to be - Is there something shorter like <code>myInput.insertTextAtCursor(myText)</code> or is this the way everyone does it?</p>","347947","","347947","","2010-05-31 18:41:59","2010-06-01 11:15:27","Is this the correct way to insert text at the cursor in Android?","<android><edittext>","1","0","2","",""
"2945794","1","2947159","","2010-05-31 20:17:26","1","1412","<p>I am attempting to get the string representation of an Android device's current WiFi state. I am using the <code>getWifiState()</code> method of the <code>WiFiManager</code> and am getting an integer returned depending on the current state. This makes total sense as <code>getWifiState()</code> is supposed to return an integer. The method's documentation indicates that the possible return values translate to one of the following constant values</p><ul><li><strong>0</strong> WIFI_STATE_DISABLING </li><li><strong>1</strong> WIFI_STATE_DISABLED</li><li><strong>2</strong> WIFI_STATE_ENABLING</li><li><strong>3</strong> WIFI_STATE_ENABLED</li><li><strong>4</strong> WIFI_STATE_UNKNOWN</li></ul><p>Is there an easy way to translate the integer returned from <code>getWiFiState()</code> to a string representation? I've looked at <code>getIntExtra</code> but am unsure of its use.</p>","61654","","","","","2010-06-01 03:49:09","Android getWifiState to String","<android><android-wifi>","2","0","","",""
"2946044","1","","","2010-05-31 21:31:40","0","389","<p>I am using layout xml documents for my ui controls.</p><p>I need to create and remove these controls (input fields) on the fly, based on how many results I get back from my database.</p><p>For each group, there can be 0..* fields and these are prepopulated from the database.</p><p>Also, it would be good if I can invoke a method to create an additional field; something like the address book, where you can click + or - to add or remove a phone or other detail.</p><p>In a ""psuedo"" style, I'm guessing something like this:</p><ol><li>Check database - How many of X are there [y]?</li><li>Create Y fields.</li></ol><p>The user may then add new fields, so once I click submit i need to apply all of that to database.</p><p>Any examples or hints greatly welcomed.  Hope this make sense! :)</p>","354896","","","","","2010-05-31 23:20:45","Displaying conditional amount of fields in UI (Android)","<android><gui>","1","2","","",""
"2946408","1","2946622","","2010-05-31 23:15:37","1","257","<p>I'm having trouble trying to find a way to guide a user from one point on a map to another. I can add the locations I want to the overlay.</p><p>I want the user to be able to pick a location and be guided through the streets to that location.</p><p>Does anyone know how to do this, or is it even available in the api?</p>","335786","","","","","2010-09-23 11:45:59","Using Googlemaps API to guide a user to a location (Android)","<android><google-maps>","3","0","","",""
"2946553","1","2946727","","2010-05-31 23:55:48","0","575","<p>I have a list where i basically need a hierarchy of items. Any children of an item would be padded slightly, as to easily distinguish their parent item. How could this be achieved?</p><p>Note that i could, if needed, make each parent show no children, and then when the parent is clicked, a new list containing all of it's children is loaded. This however requires more clicking to display information than i would prefer.</p><p>Also, the items themselves will contain graphics and whatnot (to show a drag'n'drop button, etc), so it would be best if it visually appeared as if the item itself had a margin, rather than the contents of the item being padded.</p><p>Thanks to any replies!</p>","80943","","","","","2010-06-01 00:52:19","Padding List Items?","<android>","1","0","","",""
"2947019","1","5958107","","2010-06-01 02:40:09","18","4909","<p>I am having weird scrolling issues in my pretty simple GridView. Each item in the Grid is simply an ImageView and a TextView. The activity itself is simply an application selector. It looks like a rough version of the basic App Tray in Android.</p><p>The issue is that after spending some times scrolling through my view, it will inevitably allow me to continue scrolling past the top row of icons, to a blank screen, and the scroll bar will disappear, leaving me stuck.</p><p>It doesn't happen every time I go to the top of the view, only sometimes, and usually only after some excessive scrolling.</p><p>If I happen to notice the problem and catch it before the top row disappears off the bottom of the screen, I can usually scroll back through the view and spot some icons missing. There are empty spaces in the grid, and I can only assume that those icons have been moved to some bizarre position, which is allowing the view to scroll past the top.</p><p>This is my first Android app beyond a basic Hello World, so it's likely that I've just screwed up something in my layout files. I also realize that this is probably a pretty confusing description, so I'm hoping someone has experienced this and my search abilities simply were unable to find it.</p><p>I can post my layout files or other code if someone thinks that's useful.</p><p>Oh, and the program is built against 1.5, but is running on 2.2 (whatever state of 2.2 that was that snuck out last week) on my phone. I don't have enough apps to test this on an emulator, but could probably set something up if someone felt it necessary.</p><p>Thanks in advance for any help on the issue.</p>","355016","","355016","","2010-06-01 13:25:38","2013-04-19 11:56:18","Scrolling issues with GridView in Android","<android>","3","2","2","",""
"2947210","1","","","2010-06-01 04:04:49","1","1274","<p>Hi everyone I've been meaning to learn Java for a while now (I usually keep myself in languages like C and Lua) but buying an android phone seems like an excellent time to start.</p><p>now after going through the lovely set of tutorials and a while spent buried in source code I'm beginning to get the feel for it so what's my next step? well to dive in with a fully featured application with graphics, sound, sensor use, touch response and a full menu.</p><p>hmm now there's a slight conundrum since i can continue to use cryptic references to my project or risk telling you what the application is but at the same time its going to make me look like a raving sci-fi nerd so bare with me for the brief...</p><p>A semi-working sonic screwdriver (oh yes!) my grand idea was to make an animated screwdriver where sliding the controls up and down modulate the frequency and that frequency dictates the sensor data it returns.now I have a semi-working sound system but its pretty poor for what its designed to represent and I just wouldn't be happy producing a sub-par end product whether its my first or not.</p><p>the problem :</p><ul><li>sound must begin looping when the user presses down on the control</li><li>the sound must stop when the user releases the control</li><li>when moving the control up or down the sound effect must change pitch accordingly</li><li>if the user doesn't remove there finger before backing out of the application it must plate the casing of there device with gold (Easter egg ;P)</li></ul><p>now I'm aware of how monolithic the first 3 look and that's why I would really appreciate any help I can get.</p><p>sorry for how bad this code looks but my general plan is to create the functional components then refine the code later, no good painting the walls if the roofs not finished.</p><p>here's my user input, he set slide stuff is used in the graphics for the control</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {    //motion event for the screwdriver view    if(event.getAction() == MotionEvent.ACTION_DOWN)    {            //make sure the users at least trying to touch the slider            if (event.getY() &gt; SonicSlideYTop &amp;&amp; event.getY() &lt; SonicSlideYBottom)            {                //power setup, im using 1.5 to help out the rate on soundpool since it likes 0.5 to 1.5                SonicPower =  1.5f - ((event.getY() - SonicSlideYTop) / SonicSlideLength);                //just goes into a method which sets a private variable in my sound pool class thing                mSonicAudio.setPower(1, SonicPower);                //this handles the slides graphics                setSlideY ( (int) event.getY() );    @Overridepublic boolean onTouchEvent(MotionEvent event) {    //motion event for the screwdriver view    if(event.getAction() == MotionEvent.ACTION_DOWN)    {            //make sure the users at least trying to touch the slider            if (event.getY() &gt; SonicSlideYTop &amp;&amp; event.getY() &lt; SonicSlideYBottom)            {                //power setup, im using 1.5 to help out the rate on soundpool since it likes 0.5 to 1.5                SonicPower =  1.5f - ((event.getY() - SonicSlideYTop) / SonicSlideLength);                //just goes into a method which sets a private variable in my sound pool class thing                mSonicAudio.setPower(1, SonicPower);                //this handles the slides graphics                setSlideY ( (int) event.getY() );                //this is from my latest attempt at loop pitch change, look for this in my soundPool class                mSonicAudio.startLoopedSound();            }    }    if(event.getAction() == MotionEvent.ACTION_MOVE)    {            if (event.getY() &gt; SonicSlideYTop &amp;&amp; event.getY() &lt; SonicSlideYBottom)            {                SonicPower =  1.5f - ((event.getY() - SonicSlideYTop) / SonicSlideLength);                mSonicAudio.setPower(1, SonicPower);                setSlideY ( (int) event.getY() );            }    }            if(event.getAction() == MotionEvent.ACTION_UP)            {                mSonicAudio.stopLoopedSound();                SonicPower =  1.5f - ((event.getY() - SonicSlideYTop) / SonicSlideLength);                mSonicAudio.setPower(1, SonicPower);            }        return true;}</code></pre><p>and here's where those methods end up in my sound pool class its horribly messy but that's because I've been trying a ton of variants to get this to work, you will also notice that I begin to hard code the index, again I was trying to get the methods to work before making them work well.</p><pre><code>package com.mattster.sonicscrewdriver;import java.util.HashMap;import android.content.Context;import android.media.AudioManager;import android.media.SoundPool;public class SoundManager {    private float mPowerLvl = 1f;       private  SoundPool mSoundPool;     private  HashMap&lt;Integer, Integer&gt; mSoundPoolMap;     private  AudioManager  mAudioManager;    private  Context mContext;    private int streamVolume;    private int LoopState;    private long mLastTime;    public SoundManager()    {    }    public void initSounds(Context theContext)     {          mContext = theContext;         mSoundPool = new SoundPool(2, AudioManager.STREAM_MUSIC, 0);          mSoundPoolMap = new HashMap&lt;Integer, Integer&gt;();          mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);             streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);     }     public void addSound(int index,int SoundID)    {        mSoundPoolMap.put(1, mSoundPool.load(mContext, SoundID, 1));    }    public void playUpdate(int index)    {        if( LoopState == 1)        {            long now = System.currentTimeMillis();            if (now &gt; mLastTime)            {                mSoundPool.play(mSoundPoolMap.get(1), streamVolume, streamVolume, 1, 0, mPowerLvl);                     mLastTime  = System.currentTimeMillis() + 250;            }        }    }    public void stopLoopedSound()    {        LoopState = 0;        mSoundPool.setVolume(mSoundPoolMap.get(1), 0, 0);        mSoundPool.stop(mSoundPoolMap.get(1));    }    public void startLoopedSound()    {        LoopState = 1;    }    public void setPower(int index, float mPower)    {        mPowerLvl = mPower;        mSoundPool.setRate(mSoundPoolMap.get(1), mPowerLvl);    }}</code></pre><p>ah ha! I almost forgot, that looks pretty ineffective but I omitted my thread which actuality updates it, nothing fancy it just calls :</p><p>mSonicAudio.playUpdate(1);</p><p>thanks in advance, Matthew</p>","355052","","519383","","2012-01-25 19:35:39","2012-01-25 19:35:39","Complex sound handling (I.E. pitch change while looping)","<android>","1","0","","",""
"2947253","1","2984833","","2010-06-01 04:20:37","1","4219","<p>I am using BitmapFactory.decodeFile to load Bitmaps of images into my application. However, the function returns null on large images (such as those from the camera). The filepath is definitely correct, I just can't figure out why it would return null. I tried supersampling, but it didn't seem to help.</p><p>Does anyone have any idea why it would do this or how I could more easily load images taken from the camera into a Bitmap?</p><p>Here's the code I am using:</p><pre><code>public static Bitmap loadBitmap(String filePath){    Bitmap result = BitmapFactory.decodeFile(filePath);    if(result == null){        if(filePath.contains("".jpg"") || filePath.contains("".png"")){            //This is the error that occurs when I attempt to load an image from the Camera DCIM folder or a large png I imported from my computer.            Utils.Toast(""Could not load file -- too big?"");         } else {            Utils.Toast(""Could not load file -- image file type is not supported"");        }    }    return result;}</code></pre>","118241","","321731","","2014-03-11 18:40:54","2014-03-11 18:40:54","Android Load Camera image as Bitmap","<java><android><bitmap>","3","4","2","",""
"2947261","1","2948714","","2010-06-01 04:23:49","6","1773","<p>What are some iPhone or Android applications that use SMS as their primary means of user authentication?</p><p>I'm interested to see such apps in action. SMS-auth seems like a natural approach that is well-situated to mobile contexts.</p><p>The basic workflow is: to sign up, a user provides a phone number; the app calls a backend webservice which generates a signed URL and sends it to the phone number via an SMS gateway; the user receives the SMS, clicks the link, and is thus verified and logged in. This results in a very strong user identity that is difficult to spoof yet fairly easy. It can be paired with a username or additional account attributes as needed for the product requirements.</p><p>Despite the advantages, this does not seem to be in much use - hence my question. My initial assumption is that this is because products and users are wary of asking for / providing phone numbers, which users consider sensitive information. That said, I hope this becomes an increasingly more commonplace approach.</p>","300347","","141186","","2010-06-01 06:48:09","2010-10-04 22:26:31","iPhone or Android apps that use SMS based authentication?","<iphone><android><authentication><sms><sms-gateway>","4","3","3","",""
"2947320","1","","","2010-06-01 04:45:37","1","1067","<p>I have to read *.ics file from the download files by using my application and transfer the data in to Google calendar in android. I am new to android. I need some help to do this.Can anyone help me to do this?</p>","351928","","","","","2012-08-03 10:52:56","*.ics file to Google calendar in android","<android>","1","0","","",""
"2947369","1","","","2010-06-01 05:01:14","0","800","<p>My company makes DVRs that specialize in streaming live and recorded video.  The video is encoded using standard MPEG-4 codecs so the codecs in Android should have no trouble with them.  However, the video is recorded using non-standard file formats and is streamed using our proprietary protocol (among other things we embed additional data such as watermarks with each frame of video).  Is there any way I can take my stream pull out the frames and have it play on an Android device?</p><p>Thanks!</p>","355073","","","","","2012-03-01 08:51:03","Streaming video using non standard protocols","<android><video-streaming>","3","0","2","",""
"2947517","1","2948416","","2010-06-01 05:49:56","18","8206","<p>I know it sounds ambitious but our client requires a PDF Reader of his own with some selected functionalities. Can anyone guide me to some good tutorials for paving the way to start this development?</p><p>I guess I need to clear some pdf basics and start from scratch OR i would be happy if there is any library which i can use directly and only modify the controls at my will.</p>","238071","","114066","","2010-10-11 11:41:04","2012-11-20 04:54:01","Android PDF reader from scratch","<android><pdf><pdf-reader>","3","0","14","",""
"2947693","1","2948483","","2010-06-01 06:32:15","9","8562","<p>Other <a href=""http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view"">questions</a> say that the style cannot be set programmatically, but a <code>View</code> can be <em>initialised</em> with a style such as when it is loaded from XML.</p><p>How can I initialise a <code>View</code> with a particular style programmaticly (not in XML)? I tried using <a href=""http://developer.android.com/reference/android/view/View.html#View%28android.content.Context,%20android.util.AttributeSet,%20int%29"">View(Context context, AttributeSet attrs, int defStyle)</a>, but I don't know what to parse in for the second argument. Passing in <code>null</code> results in the <code>View</code> not being displayed</p>","165495","","165495","","2010-06-01 06:56:28","2014-03-19 15:33:35","Creating an Android View with a particular style programmatically","<android>","3","0","3","",""
"2947779","1","","","2010-06-01 06:51:04","1","1036","<p>In my android application I want to get URL of the hyper link text, selected from web page in my android web browser.How can I get it?</p><p>I want to URL of the hyper link (link that is clicked inside of that webview).</p><p>please help me..</p>","316451","","52626","","2011-03-27 19:50:53","2011-03-27 19:50:53","How to get the URL of selected hyperlink in android web browser?","<android><url><web-browser>","1","3","","",""
"2947826","1","","","2010-05-31 11:58:34","1","1447","<p>I am doing a school project where we need to create an android application which needs to connect to a database. the application needs to gain and store information for people's profiles on the database. But unfortunatly we are a little bit stuck at this point because there are numerous ways to link the application such as http request through apache or through the SOAP/REST protocol.</p><p>But it's really hard to find good instructions or tutorials on the problem since I can't really find them. Maybe that's cause i'm probably using the wrong words on google. Unfortunately I have little relevant information. So if anyone can help me with finding relevant links to good online tutorials or howto's than those are very welcome.</p>","","danny","","","","2011-04-01 08:40:49","Connect android to database","<apache><php><database><http><android>","2","1","","",""
"2947841","1","2948231","","2010-06-01 07:05:15","4","1342","<p>I'm trying to think of a way on how to sync in between a local service and the main activity.</p><p>The local service has,</p><ul><li>A thread with a socket connection that could receive data at any time.</li><li>A list/array with data. </li><li>At any time the socket could receive data and add it to the list.</li></ul><p>The activity needs to display this data. So when the activity starts up it needs to attach or start the local service and fetch the list. It also needs to be notified if the list is updated.</p><p>I think I would need to sync my list somehow so the local service does not add a new entry to it while the activity fetches the list when connecting to the service.</p><p>Any ideas?</p><p>Thanks.</p>","226342","","","","","2010-06-01 08:26:33","Sync between local service with a thread and an activity","<android><multithreading><service>","2","0","4","",""
"2947852","1","2948326","","2010-06-01 07:06:47","1","99","<p>i am developing android applicaiton disply user overlays on map.user values getting from webservices for disply overlays.when i tap on map and move it is calling draw method and connecting to webservices while connecting webservice and getting data my apps is struck</p><p>show force close error .how can i resolve this problem</p>","1746300","","","","","2010-06-01 08:44:18","map view is struck in android","<android>","1","0","","",""
"2947944","1","","","2010-06-01 07:30:20","2","2015","<p>I was wondering if it's possible to call specific methods defined within the AsynTask class from another class and/or service ?In my specific case I have a Service playing some sounds, but the sound is selected from a List with available sounds...</p><p>When a sounds is selected it is downloaded from my home server, this takes some time (not much, let's say around the 3-4 seconds, the sounds/effects aren't big in size)...So my problem at the moment is that I have a service to play those sounds, and when I select one I wanted to show a progressdialog... The way (if I understood correctly) is to use an AsyncTask, but the only thing the AsyncTask will do is telling my Service to play a specific sound from my server... So there is no ""callback"" from the service to the Asynctask...</p><p>How can I achieve that ?How can I call a running AsyncTask, which sits in another class, and tell him all work is done and thus he can stop showing the ProgressDialog ?Or am I over-engineering it and there are other ways ?Thanks in advance...</p>","162147","","","","","2010-12-05 20:26:16","Call AsyncTask methods from another class/service (callbacks?)","<android><callback><android-asynctask>","2","0","","",""
"2948002","1","2948010","","2010-06-01 07:42:54","0","1020","<p>My application requires to be started everytime the phone is switched off and switched on i.e it should start running automatically like an anti-virus software on start up. Is it possible??? I am totally clueless!!!</p>","347783","","","","","2010-06-01 07:44:41","how to start my app, automatically, everytime the phone is switched on?","<android>","1","0","","",""
"2948212","1","3147157","","2010-06-01 08:22:42","7","9245","<p>I want to make a layout similar to this one:</p><p><a href=""http://www.imagebanana.com/view/9kmlhy66/layout.png""><img src=""http://www.imagebanana.com/img/9kmlhy66/thumb/layout.png"" alt=""www.ImageBanana.net - layout.png"" /></a></p><p>Four square buttons on the screen - each of those using half of the screen with/screen height (whichever is smaler). Independent of screen size/resolution.</p><p>I already tried to achieve this by using a <code>LinearLayout</code>but the buttons are ending up using the correct width, but still having the height of the background (not square any more).</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;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button android:layout_height=""wrap_content"" style=""@style/CKMainButton""        android:layout_width=""fill_parent"" android:text=""@string/sights""        android:id=""@+id/ApplicationMainSight"" android:layout_toLeftOf=""@+id/ApplicationMainEvent""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" style=""@style/CKMainButton""        android:layout_width=""fill_parent"" android:text=""@string/sights""        android:id=""@+id/ApplicationMainSight"" android:layout_toLeftOf=""@+id/ApplicationMainEvent""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button android:layout_height=""wrap_content"" style=""@style/CKMainButton""        android:layout_weight=""1"" android:layout_width=""fill_parent""        android:text=""@string/usergenerated"" android:id=""@+id/ApplicationMainUserGenerated""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" style=""@style/CKMainButton""        android:layout_weight=""1"" android:layout_width=""fill_parent""        android:text=""@string/tours"" android:id=""@+id/ApplicationMainTour""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>It's looking like this: <a href=""http://www.imagebanana.com/view/i2ni6g4/layout2.png""><img src=""http://www.imagebanana.com/img/i2ni6g4/thumb/layout2.png"" alt=""www.ImageBanana.net - layout2.png"" /></a></p><p>How can i acchieve the Layout to look like the image at the top above?</p>","288980","","288980","","2010-06-01 11:27:47","2013-04-22 11:01:38","Android layout with sqare buttons","<xml><android><layout><stylesheet><styles>","4","0","5","",""
"2948566","1","","","2010-06-01 09:26:44","1","5909","<p>In my application I tried to search diff map location using diff lat and long. First time the application show the map but wen i change the lat long and try to invalidate the mapview using diff lat long, map is not refreshed. </p><p>Below is my code please have a look and suggest accordingly:</p><p>//Source code</p><pre><code>protected void onCreate(Bundle icicle) {        // TODO Auto-generated method stub        super.onCreate(icicle);        setContentView(R.layout.main);        infoTextView = (TextView) findViewById(R.id.infoTextView);        // Finding Current Location    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                1l, 1l, this);    Location location = locationManager.getLastKnownLocation(""gps"");    // mock location by hard-code if DDMS has not sent a fake loc to the emulator.        if (location == null) {            lat = 13.6972 * 1E6;            lng = 100.5150 * 1E6;    } else { // get real location if can retrieve the location sent by DDMS or GPS            lat = location.getLatitude() * 1E6;            lng = location.getLongitude() * 1E6;        }        setGPSLocation(lat, lng);    }</code></pre><p>//This is the function which I am calling with different lat and long</p><pre><code>public void setGPSLocation(Double lati, Double longi)    {        lat = lati;        lng = longi;        System.out.println(""Latitude :""+ lat +"" Longitude :""+lng);        // Prepare text being shown        String tmpLoc = LOC_INFO_TEMPLATE;        tmpLoc = tmpLoc.replace(""lg"", String.valueOf(lng));        tmpLoc = tmpLoc.replace(""lt"", String.valueOf(lat));        infoTextView.setText(tmpLoc);        // Setup Zoom/Hide Buttons        linearLayout = (LinearLayout) findViewById(R.id.zoomview);        mapView = (MapView) findViewById(R.id.mapview);          mapView.invalidate();        mapView.setBuiltInZoomControls(true);                           //new by me        mapView.setSatellite(true); // Set satellite view        mZoom = (ZoomControls) mapView.getZoomControls();        linearLayout.addView(mZoom);        // Setup Marker        mapOverlays = mapView.getOverlays();        drawable = this.getResources().getDrawable(R.drawable.marker);        itemizedOverlay = new MyItemizedOverlay(drawable);        GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());        OverlayItem overlayitem = new OverlayItem(point, """", """");        itemizedOverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedOverlay);        // Centralize Current Location        myMapController = mapView.getController();        myMapController.setZoom(DEFAULT_ZOOM_NUM);        myMapController.animateTo(point);       }</code></pre><p>Any suggest is truly appreciable.</p>","162644","","162644","","2010-06-03 11:33:00","2012-11-22 00:59:16","Map refresh problem mapview.invalidate() method is not working","<android>","1","2","","",""
"2948606","1","3786098","","2010-06-01 09:32:18","4","2323","<p>I have been trying to use reflection for a specifiec Field in the android.os.build class, the MANUFACTURER field...I have tried by using this code :</p><pre><code>try    {        Class myBuildClass = android.os.Build.class;        Field m1 = Build.class.getDeclaredField(""MANUFACTURER"");        validField = true;        manufacturer = Build.MANUFACTURER;    }    catch(Exception ex)    {        manufacturer = Build.PRODUCT;        System.err.println(""getDeviceSpecifics, got an exception during getting Field : "" + ex.toString());    }</code></pre><p>I am gettign the following errors :</p><pre><code>06-01 11:26:37.639: WARN/dalvikvm(7342): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build;06-01 11:26:37.639: WARN/dalvikvm(7342): VFY:  rejecting opcode 0x62 at 0x004806-01 11:26:37.639: WARN/dalvikvm(7342): VFY:  rejected Lmypackage/android/managementModule/Management;.getDeviceSpecifics ()V06-01 11:26:37.639: WARN/dalvikvm(7342): Verifier rejected class Lmypackage/android/managementModule/Management;</code></pre><p>And when debugging I noticed that InvocationtargetException is continuesly thrown, so I am guessing I haven't been implementing the whole Reflection principle correctly...Any idea where things are going wrong or otherwise on how to implement Refelction for a single Field correctly ?</p>","162147","","162147","","2010-06-01 10:18:59","2010-09-24 10:23:21","Reflection for a Field going wrong","<java><android><reflection><field>","7","2","","",""
"2948617","1","","","2010-06-01 09:33:48","4","3109","<p>I will like to develop an App which modifies LockScreen of Android. I have read in some forums that it is not supported as yet in the SDK but there are some applications available that does exactly that. </p><p>One can surf <a href=""http://www.androidzoom.com/android_applications/tools/screen-suite-lockscreen-trial_fznq.html?nav=related"">Screen Suite Lock Screen</a></p><p>Can someone let me know is it actually possible to customize LockScreen and implement our own way of Lock Screen?</p><p>Regards</p><p>Sunil</p>","261566","","","","","2011-11-09 05:12:42","Customizing Android Lock Screen functionality?","<android><customizing><lockscreen>","2","2","2","",""
"2948769","1","","","2010-06-01 09:57:42","0","431","<p>I met this problem at writing contacts by API for Android 2.0 or greater.Each time I write the same contact which already exist in my account (Google account) I got some part of contact aggregated ok but other did not. For example fields like FN, N, ORG, TITLE always are in one copy but TEL, EMAIL, ADR are added extra so after 2nd writing the same contact I have2 copy the same TEL or EMAIL. How to force API engine to not repeate existed data ?</p><p>Code:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();        ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)                                .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType).withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName)                       .build());...// adding phone numberContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);            builder.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0);            builder.withValue(ContactsContract.Data.MIMETYPE,                    ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);            builder.withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneValue);            builder.withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType); // work/home            builder.withValue(ContactsContract.CommonDataKinds.Phone.LABEL, phoneLabel);            ops.add(builder.build());...try {            contentResolver.applyBatch(ContactsContract.AUTHORITY, ops);        } catch (Exception e) {            //}</code></pre><p>I tried add: AGGREGATION_MODE on AGGREGATION_MODE_DISABLED.but it changed nothing.</p><p>I will glad for any hint in this case.</p><p>BR, Bogus</p>","355268","","243782","","2010-06-01 10:06:02","2010-06-01 10:08:02","part of contact are repeated after each writing the same contact (Android 2.0+)","<android>","1","0","","",""
"2948809","1","3115365","","2010-06-01 10:03:11","6","6550","<p>the Emulator's camera worked fine for taking pictures in 2.1 Eclair. What did not work was recording videos, obviously.<br>Now running an app which worked merely flawless on 2.1 Emulator causes the camera app to crash. I fire up an intent to launch it:</p><pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(TEMP_PHOTO_FILE)));startActivityForResult(intent, REQUEST_CAMERA);</code></pre><p>This starts the camera app but after a few seconds it crashes. The output is:</p><pre><code>06-01 09:57:15.593: DEBUG/libEGL(5212): egl.cfg not found, using default config06-01 09:57:15.593: DEBUG/libEGL(5212): loaded /system/lib/egl/libGLES_android.so06-01 09:57:15.733: ERROR/AndroidRuntime(5212): FATAL EXCEPTION: GLThread 1106-01 09:57:15.733: ERROR/AndroidRuntime(5212): java.lang.IllegalArgumentException: No configs match configSpec06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)</code></pre><p>Actually I just wanted to see if the bug which made you receive a small image from the camera even though EXTRA_OUTPUT was specified has been fixed in FroYo. Unfortunately, I don't even get to test it.<br>Does anyone run into similiar issues?</p><p>Thanks,<br>Steff</p>","289849","","","","","2011-08-13 10:08:55","Emulator's camera built-in app buggy in Froyo / 2.2?","<android><camera><emulator>","2","0","7","",""
"2948885","1","","","2010-06-01 10:16:02","0","498","<p>I want to add a textView at the end of gridView, as <a href=""http://i3.6.cn/cvbnm/11/41/dd/6307adbd865d210c9e1e7ec9d0933a33.png"" rel=""nofollow"">http://i3.6.cn/cvbnm/11/41/dd/6307adbd865d210c9e1e7ec9d0933a33.png</a></p><p>I override the getView but there is a textView at the end of every item of gridView, whichi don't like  -- I need the total number of item in the textView as ""91 images"".</p><pre><code>&lt;linearlayout&gt;&lt;gridView&gt;&lt;textView &gt;&lt;/linearlayout&gt;</code></pre><p>Could you give me some advice?</p>","233618","","8562","","2010-08-15 08:29:15","2010-08-15 08:29:15","Add a textView behind the gridView?","<android>","1","0","","",""
"2948900","1","2948959","","2010-06-01 10:17:55","4","8702","<p>Hi I need to add particulars to Google calendar from my application. Is it possible to add data to Google calendar? I am new to android Help me to solve this.</p>","351928","","","","","2013-05-13 16:00:30","How to add data to Google calendar programmatically in android?","<android>","4","1","5","",""
"2949036","1","2949598","","2010-06-01 10:42:08","10","7797","<p>I have a custom view that fills my entire screen. (A piano keyboard)When a user touches the key, it causes <code>invalidate()</code> to be called and the whole keyboard gets redrawn to show the new state with a touched key.</p><p>Currently the view is very simple, but I plan to add a bit more nice graphics. Since the whole keyboard is dynamically rendered this would make redrawing the entire keyboard more expensive.</p><p>So I thought, let's look into partial redrawing. Now I call <code>invalidate(Rect dirty)</code> with the correct dirty region. I set my <code>onDraw(Canvas canvas)</code> method to only draw the keys in the dirty region if I do indeed want a partial redraw. This results in those keys being drawn, but the rest of the keyboard is totally black/not drawn at all.</p><p>Am I wrong in expecting that calling <code>invalidate(Rect dirty)</code> would ""cache"" the current <code>canvas</code>, and only ""allows"" drawing in the dirty region? </p><p>Is there any way I can achieve what I want? (A way to ""cache"" the canvas and only redraw the dirty area?""</p>","107029","","","","","2011-05-06 09:51:12","Android: How to get a custom view to redraw partially?","<android><drawing><partial><invalidate>","2","0","8","",""
"2949171","1","","","2010-06-01 11:04:34","0","2286","<p>I want to create language pack for android. How can I do this. If anyone knows how or where to find info about this topic please share your knowledge. I'd appreciate any pointers to the right direction.</p>","263481","","321731","","2014-03-23 20:31:23","2014-03-25 09:13:53","Android language pack","<android>","1","0","1","",""
"2949211","1","","","2010-06-01 11:11:00","12","11387","<p>I have a <code>RelativeLayout</code> with a few <code>TextView</code> as children</p><pre><code>&lt;RelativeLayout    android:id=""@+id/shift_parent_name""    android:layout_width=""fill_parent""    android:layout_weight=""0.25""    &gt;    &lt;TextView        android:id=""@+id/shift_parent_nametitle""        android:text=""@string/shift_parent_nametitle""        style=""@style/header_text""        /&gt;    &lt;TextView        android:id=""@+id/shift_parent_namefield""        android:layout_alignParentRight=""true""        android:layout_below=""@id/shift_parent_nametitle""        style=""@style/wrap""        /&gt;</code></pre><p>How do I go about using the <code>RelativeLayout</code> as a <em>button</em> to react to a <em>click event</em> if any part of the area is pressed?</p>","308675","","1628280","","2014-02-24 10:21:35","2014-02-24 10:21:35","accepting click events in RelativeLayout","<android><events><click><onclick><relativelayout>","2","0","","",""
"2949225","1","2949246","","2010-06-01 11:12:42","1","68","<p>i have completed my First android application and i have deployed that application to different android based mobile phones</p><p>which is working fine.</p><p>my question to you is, is there iphone store like thing exists in android to upload your application by paying fee to android store or something like that..</p><p>or nothing or should i start passing my application to end users directly?</p><p>any help would be appriciated.</p>","249991","","","","","2010-06-01 11:16:17","Suggestions related to Android final application?","<android>","2","1","","",""
"2949259","1","2949279","","2010-06-01 11:18:23","1","1660","<p>How do access a drawable which resides in my project's res/drawable folder from outside an activity? The component which handles the loading of images is generic and is not inside any activity. I would like to display an image from res/drawable in case it can't be fetched from the web.</p><p>Thanks, Rob</p>","283630","","","","","2011-04-23 15:39:48","Android: access drawables outside an activity","<android><activity><drawable>","3","0","","",""
"2949320","1","","","2010-06-01 11:27:54","2","1137","<p>I want to write an application to List the Gmail message. In the list, if user click one of the message item, it shall link ot Gmail App to see more detial information. Currently I can read the Gmail db with Gmail.java. </p><p>There are some problems while I want to open Gmail Activity. In general, we can open Activity with Action and parameters. But Gmail App has not release code base. We do not know what Action set to Gmail Activity and what parmeter shall we put the extras. I only know that the Activity of View detial Message is named ""HtmlConversationActivity."" And the Package is under ""com.google.android.gm.""</p><p>Please tell me how to open the View detial Message Activity in Gmail APP.    thanks a lot.</p>","314231","","258120","","2010-06-09 01:42:07","2010-06-09 20:16:41","how to open Gmail View Message Activity?","<android><gmail>","1","0","1","",""
"2949407","1","4960510","","2010-06-01 11:42:50","13","5982","<p>Sometimes I have a button in my UI that it is so small that it is difficult to click. My solution so far has been to add a transparent border around the button in photoshop. Just increasing the padding on the button does not work, since this will also stretch the image. Since it is kind of a fuss to open photoshop each time I want to change the clickable surface, is there any way to do this programmatically? I have tried placing a framelayout behind the button and make it clickable, but then the button wont change appearance on touch as it should. Ofcourse I could also add a ontouchlistener on the framelayout which changes the buttons appearance, but then it quite some code if I have several of those buttons.</p><p>Cheers,</p>","249871","","","","","2013-01-13 03:07:21","Can I increase a buttons onclick-area programmatically?","<android><button>","7","0","5","",""
"2949560","1","2955583","","2010-06-01 12:04:25","5","741","<p>Hi I have some questions (read Doubts part) regarding implementing encrypted storage (kind of encrypted filesystem) on Android, Blackberry and J2ME. I <strong>need your advice, you cryptography masters</strong>.</p><p>I know this question is a bit long a maybe too verbose, but please try to read it till the end (I have so many related questions that I couldn't split them up in several posts). I would really appreciate if you can give me some feedback on at least one of my questions (<strong>Doubts part</strong>).</p><p>Thanks,</p><p>&nbsp;</p><p>&nbsp;</p><h3>Objective</h3><hr><p>I am currently designing the API for a multiplatform storage system that would offer same interface and capabilities accross following supported mobile Java Platforms:</p><ul><li><strong>J2ME</strong>. Minimum configuration/profile CLDC 1.1/MIDP 2.0 with support for some necessary JSRs (JSR-75 for file storage).</li><li><strong>Android</strong>. No minimum platform version decided yet, but rather likely could be API level 7.</li><li><strong>Blackberry</strong>. It would use the same base source of J2ME but taking advantage of some advaced capabilities of the platform. No minimum configuration decided yet (maybe 4.6 because of 64 KB limitation for RMS on 4.5).</li></ul><p>Basically the API would sport three kind of stores:</p><ul><li><em>Files</em>. These would allow standard directory/file manipulation (read/write through streams, create, mkdir, etc.).</li><li><em>Preferences</em>. It is a special store that handles properties accessed through keys (Similar to plain old java properties file but supporting some improvements such as different value data types such as SharedPreferences on Android platform)</li><li><em>Local Message Queues</em>. This store would offer basic message queue functionality.</li></ul><h3>Considerations</h3><hr><p>Inspired on JSR-75, all types of stores would be accessed in an uniform way by means of an URL following <a href=""http://www.faqs.org/rfcs/rfc1738.html"" rel=""nofollow"">RFC 1738</a> conventions, but with custom defined prefixes (i.e. ""file://"" for files, ""prefs://"" for preferences or ""queue://"" for message queues). The address would refer to a virtual location that would be mapped to a physical storage object by each mobile platform implementation. Only files would allow hierarchical storage (folders) and access to external extorage memory cards (by means of a unit name, the same way as in JSR-75, but that would not change regardless of underlying platform). The other types would only support flat storage.</p><p>The system should also support a <em>secure version of all basic types</em>. The user would indicate it by prefixing ""s"" to the URL (i.e. ""sfile://"" instead of ""file://""). The API would <em>only require one PIN</em> (introduced only once) to access any kind of secure object types.</p><h3>Implementation issues</h3><hr><p>For the implementation of both plaintext and encrypted stores, I would use the functionality available on the underlying platforms:</p><ul><li><strong>Files</strong>. These are available on all platforms (J2ME only with JSR-75, but it is mandatory for our needs). The abstract File to actual File mapping is straight except for addressing issues. </li><li><strong>RMS</strong>. This type of store available on J2ME (and Blackberry) platforms is convenient for Preferences and maybe Message Queues (though depending on performance or size requirements these could be implemented by means of normal files).</li><li><strong>SharedPreferences</strong>. This type of storage, only available on Android, would match Preferences needs.</li><li><strong>SQLite databases</strong>. This could be used for message queues on Android (and maybe Blackberry).</li></ul><p>When it comes to encryption some requirements should be met:</p><ul><li>To ease the implementation it will be carried out on read/write operations basis on  streams (for files), RMS Records, SharedPreferences key-value pairs, SQLite database columns. Every underlying storage object should use the same encryption key.</li><li>Handling of encrypted stores should be the same as the unencrypted counterpart. The only difference (from the user point of view) accessing an encrypted store would be the addressing.</li><li>The user PIN provides access to any secure storage object, but the change of it would not require to decrypt/re-encrypt all the encrypted data.</li><li>Cryptographic capabilities of underlying platform should be used whenever it is possible, so we would use:<ul><li>J2ME: SATSA-CRYPTO if it is available (not mandatory) or lightweight BoncyCastle cryptographic framework for J2ME.</li><li>Blackberry: RIM Cryptographic API or BouncyCastle</li><li>Android: JCE with integraced cryptographic provider (BouncyCastle?)</li></ul></li></ul><p><h3>My Doubts. Help Wanted Here</h3></p><hr><p>Having reached this point I was struck by some doubts about what solution would be more convenient, taking into account the limitation of the plataforms. These are some of <strong>my doubts</strong>:</p><ul><li><strong>Encryption Algorithm for data</strong>. Would AES-128 be strong and fast enough? What alternatives for such scenario would you suggest?</li><li><strong>Encryption Mode</strong>. I have read about the weakness of ECB encryption versus CBC, but in this case the first would have the advantage of random access to blocks, which is interesting for seek functionality on files. What type of encryption mode would you choose instead? Is stream encryption suitable for this case?</li><li><strong>Key generation</strong>. There could be one key generated for each storage object (file, RMS RecordStore, etc.) or just use one for all the objects of the same type. The first seems ""safer"", though it would require some extra space on device. In your opinion what would the trade-offs of each?</li><li><strong>Key storage</strong>. For this case using a standard JKS (or PKCS#12) KeyStore file could be suited to store encryption keys, but I could also define a smaller structure (encryption-transformation / key data / checksum) that could be attached to each storage store (i.e. using addition files with the same name and special extension for plain files or embedded inside other types of objects such as RMS Record Stores). What approach would you prefer? And when it comes to using a standard KeyStore with multiple-key generation (given this is your preference), would it be better to use a record-store per storage object or just a global KeyStore keeping all keys (i.e. using the URL identifier of abstract storage object as alias)?</li><li><strong>Master key</strong>. The use of a master key seems obvious. This key should be protected by user PIN (introduced only once) and would allow access to the rest of encryption keys (they would be encrypted by means of this master key). Changing the PIN would only require to reencrypt this key and not all the encrypted data. Where would you keep it taking into account that if this got lost all data would be no further accesible? What further considerations should I take into account?</li><li><strong>Platform cryptography support</strong>. Do SATSA-CRYPTO-enabled J2ME phones really take advantage of some dedicated hardware acceleration (or other advantage I have not foreseen) and would this approach be prefered (whenever possible) over just BouncyCastle implementation? For the same reason is RIM Cryptographic API worth the license cost over BouncyCastle?</li></ul><p><b>Any comments, critics, further considerations or different approaches are welcome.</b></p>","34880","","34880","","2010-06-02 06:46:20","2010-06-10 13:16:46","Ideas for multiplatform encrypted java mobile storage system","<java><android><file><encryption><blackberry>","3","4","3","",""
"2949810","1","","","2010-06-01 12:43:59","3","7883","<p>I want to submit form programatically in android. I don't want any user interaction with web browser. User will provide inputs in EditField and then inputs will be submitted thru httppost method via HTTPwebmethod. But I didn't get any success in the same. Please advise. I have used HTMLUnit in java but its not working android.</p><pre><code>  final WebClient webClient = new WebClient(); final HtmlPage page1 = webClient.getPage(""http://www.mail.example.com"");     final HtmlForm form = page1.getHtmlElementById(""loginform"");    final HtmlSubmitInput button = form.getInputByName(""btrn"");    final HtmlTextInput textField1 = form.getElementById(""user"");   final HtmlPasswordInput textField2 =          form.getElementById(""password"");textField1.setValueAttribute(""user.name"");    textField2.setValueAttribute(""pass.word""); final HtmlPage page2 = button.click();</code></pre>","301549","","301549","","2010-06-01 13:11:44","2011-04-05 06:46:47","submit html form programmatically in android","<android><android-emulator>","1","2","2","",""
"2949994","1","2950330","","2010-06-01 13:12:55","1","1091","<p>I have an android-app with a listview in an activity. The listview has, if I call it so, three data states.</p><ol><li>no data loaded from inet -> only one dummy item is visible, saying that data is loading;</li><li>data is loaded and shown in list;</li><li>one listitem is clicked and now shows more information for this listitem (so it is increased in its height).</li></ol><p>On every state change (1 -> 2, 2 -> 3), I call notifyDataSetChanged() on this ListAdapater.This causes the listview to scroll down to the last item. This is ugly in the first transition and even more ugly in the second because the clicked list item is now out of focus.</p><p>As I can see, this happens with a google g1 with android 1.6. An htc touch with the same sdk acts like desired (I will try to figure it out with some more devices).</p><p>To avoid this, I tried to read out getScrollY() and set this value back. but this returns 0. The reason for this return value I already found on stackoverflow in other questions.</p><p>Has anyone else seen this problem? Why does the listview scroll to the last item? It was mentioned that listview keeps track of the scroll position. but it seems that it does not in my case.</p><p>Or maybe I am calling the wrong refresh method? Is notifyDataSetChanged the correct one?</p>","345596","","82118","","2010-07-16 15:58:54","2010-07-16 15:58:54","how does scrolling in android listview work?","<android><listview><layout>","1","0","","",""
"2950074","1","2950161","","2010-06-01 13:21:46","30","26532","<p>(Newbie to Java, old time C# guy.)</p><p>I have noticed a lot of the use of <code>@Override</code> in Android example code. I thought that all Java methods were by default ""Virtual""?</p><p>What then does <code>@Override</code> do?</p><p>Example: </p><pre><code>private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre>","172861","","843804","","2012-01-10 13:09:06","2012-01-10 13:09:06","Android @Override usage","<java><android><override>","3","2","11","",""
"2950102","1","","","2010-06-01 13:25:23","0","2700","<p>Ok i wasted 1 day of my life i think now is the time to ask for help :DI have a listview that has an image text ..etc (custom view) and one of itselements is a Gallery. (Aka horizontal listview)Gallery also is a custom view.SO.. here is the problem:I call the adaptor to set the custom view in the listview.Ok for now.Inside the listview adaptor i call the Gallery adaptor.Ok for now.Everything render out as it should be with a very nice complex interface.Now the problemWhen i scroll the Gallery the data change to what the data should have been if i scrolled the gallery of the last listview row rendered.(Hope you get me here)Ex.gallery in first listview has photos of the sea.   gallery in 2nd listview has photos of a building.</p><p>If i scroll the first gallery the photos change from ""sea"" to building"".</p><p>Meaning ... each time the listview adapter's getView is called i feed the galleryadapter with data</p><pre><code>gal1.setAdapter(new GalleryAdapter(CON,PASS[position]));</code></pre><p>What i'm thinking as a possible solution is :</p><ul><li>Hardcore , preload all the data in the custom Gallery of each listview.</li><li>Figure a way that when i scroll the Gallery element within a listview , the gallery adapter to be aware of the index of listbox and load the correct data.</li></ul><p>I think the second solution is more elegant,and more difficult but considering that if i go for the 1st solution there will be >40 views loaded at all times so no biggy.</p><p>So.. I;m asking for your help.Is there a 3rd , 4rth .. way?Is anyone of my suggestions even possible?If so please point a way of implement to code.</p><p>Keed in mind that i want  to be able to do multiple scrollings at any given moment.So i think that my 2nd suggestiong might have some problems there.</p>","348058","","2680216","","2013-12-09 04:42:24","2013-12-09 05:44:52","Gallery(Horizontal ListView) inside a ListView","<android><listview><gallery>","1","1","","",""
"2950588","1","","","2010-06-01 14:25:09","4","3899","<p>I'm doing a college project on Bluetooth for Android, and I'm trying to understand how to manage communication between multiple connected devices. Eventually I'm going to develop a multiplayer Bluetooth Game.</p><p>Currently I've adapted Android's sample app BluetoothChat to connect my three Nexxus One phones.1 connects to 2 who connects to 31 sends its messages successfully to 2. 3 sends its messages successfully to 2 as well. 2 can send its messages successfully to 1 and 3, as it shares a ConnectedThread with both. But I can't figure out how to handle getting communication from 1 to 3. </p><p>Does anyone have any examples of communication between multiple devices or has done this themselves? Thanks</p>","355514","","","","","2014-03-31 16:43:17","Adapting Android Bluetooth Chat for multiple devices","<android><bluetooth>","3","0","2","",""
"2950653","1","2953770","","2010-06-01 14:35:41","0","377","<p>I want to draw different 2D objects in OpenGL for example a path/Road ,is there any program i could draw them using a GUI then transfer them to points so i could use them in my program ? </p>","302707","","44729","","2010-06-01 14:48:53","2010-06-01 22:15:24","OpenGL 2D editor?","<iphone><android><opengl-es>","2","0","","",""
"2950789","1","","","2010-06-01 14:51:06","0","249","<p>should we use android services for network connection? if yes please provide me a sample.</p>","355534","","","","","2010-06-01 15:20:29","should we use services for network connections in android","<android>","2","0","","",""
"2950885","1","","","2010-06-01 15:04:07","3","1382","<p>In some apps I see an EditText widget combined with a Button on the right side (e.g. the <a href=""http://2.bp.blogspot.com/_GTM_W5mVPTU/S-rmYdiUTCI/AAAAAAAAAEE/hIO9GD53SLc/s1600/search2.png"" rel=""nofollow"" title=""search field in the twitter app"">search field in the twitter app</a>).How can I create a widget like that?</p><p>Regards,Marco</p>","355544","","","","","2010-06-01 23:29:57","Combining EditText and Button?","<android><user-interface><button><edittext>","3","0","2","",""
"2950990","1","2952023","","2010-06-01 15:21:36","1","3039","<p>I would like to detect when the phone is in motion, but not all kind of motion. For example picking up or waving the phone should not trigger. </p><p>I would like ideally to run a code when the phone/person is in > ""walking"" state. What options I have?</p>","243782","","","","","2011-08-30 16:11:17","When GPS is not available how to get notified when the phone is in motion?","<android><motion>","3","0","1","",""
"2951007","1","2953077","","2010-06-01 15:23:34","0","5359","<p>At the moment I am using this code to inquire google maps for directions from an address to another one, then I simply draw it on a mapview from its GeometryCollection. But yet this isn't enough I need also to extract the total expected duration from the kml. can someone give a little sample code to help me? thanks </p><pre><code>StringBuilder urlString = new StringBuilder();urlString.append(""http://maps.google.com/maps?f=d&amp;hl=en"");urlString.append(""&amp;saddr="");//fromurlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));urlString.append("","");urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));urlString.append(""&amp;daddr="");//tourlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));urlString.append("","");urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));urlString.append(""&amp;ie=UTF8&amp;0&amp;om=0&amp;output=kml"");//Log.d(""xxx"",""URL=""+urlString.toString());// get the kml (XML) doc. And parse it to get the coordinates(direction route).Document doc = null;HttpURLConnection urlConnection= null;URL url = null;try{    url = new URL(urlString.toString());    urlConnection=(HttpURLConnection)url.openConnection();    urlConnection.setRequestMethod(""GET"");    urlConnection.setDoOutput(true);    urlConnection.setDoInput(true);    urlConnection.connect();    dbf = DocumentBuilderFactory.newInstance();    db = dbf.newDocumentBuilder();    doc = db.parse(urlConnection.getInputStream());    if(doc.getElementsByTagName(""GeometryCollection"").getLength()&gt;0)    {        //String path = doc.getElementsByTagName(""GeometryCollection"").item(0).getFirstChild().getFirstChild().getNodeName();        String path = doc.getElementsByTagName(""GeometryCollection"").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue() ;        //Log.d(""xxx"",""path=""+ path);        String[] pairs = path.split("" "");        String[] lngLat = pairs[0].split("",""); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height        // src        GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));        mMapView01.getOverlays().add(new MyOverLay(startGP,startGP,1));        GeoPoint gp1;        GeoPoint gp2 = startGP;        for(int i=1;i&lt;pairs.length;i++) // the last one would be crash        {            lngLat = pairs[i].split("","");            gp1 = gp2;            // watch out! For GeoPoint, first:latitude, second:longitude            gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));            mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color));            //Log.d(""xxx"",""pair:"" + pairs[i]);        }        mMapView01.getOverlays().add(new MyOverLay(dest,dest, 3)); // use the default color        }    }catch (MalformedURLException e){        e.printStackTrace();    }catch (IOException e){        e.printStackTrace();    }catch (SAXException e){        e.printStackTrace();    } catch (ParserConfigurationException e) {        e.printStackTrace();    }}</code></pre>","201058","","","","","2013-01-03 06:27:25","android get duration from maps.google.com directions","<java><android><google-maps><duration><map-directions>","1","0","1","",""
"2951068","1","2951370","","2010-06-01 15:32:36","15","26671","<p>I'm pretty new to android, and just finished setup my environment and reading some tutorials. Then I got sdk samples from the web. Okay, what I wanna ask you is that is there a way to start a sample as a project in the Eclipse? I mean like clicking a project file in c# or a solution file.</p><p>Here is my folder which I unzipped the code,\android-sdk-windows\samples\android-8\NotePad</p><p>There are three folders and one file in the folder, \res, \src, \tests, and AndroidManifest.xml</p><p>Or, do I need to make a new android project and import (or add files? maybe) them?</p><p>Thanks in advance,yokyo</p>","355572","","","","","2012-11-08 23:37:23","How to start an android project with downloaded sample code","<android><eclipse>","6","2","6","",""
"2951293","1","2955756","","2010-06-01 15:58:37","5","286","<p>I have a list of coordinates in the database identified as POI. For a city could be >100 records.</p><p>I would like to get notified when the phone gets in 150 meters range of one of the location. The location coordinates too has an error/radius, usually 10 to 100meters. Since I don't find it good to add each location(could be hundreds) for a trigger, how can I optimize the wake-up code?</p><p>Also do I have options to remove a previously setup notification from the queue?</p>","243782","","","","","2010-06-04 16:16:46","Do something when phone reaches a set of location?","<android><geolocation>","3","0","6","",""
"2951310","1","2951364","","2010-06-01 16:00:34","2","3210","<p>I have two activities:  a MainListActivity, and a DetailViewActivity.  DetailViewActivity is set with <code>android:launchMode=""singleTop""</code>.</p><p>When clicking an item in the ""main list"" activity, it launches the ""detail view"" activity via:</p><pre><code>startActivityForResult(detailIntent, REQUEST_CODE_DETAIL);</code></pre><p>If I then call <code>setResult(RESULT_OK, resultData);</code> and <code>finish();</code> from within the Detail activity, that resultData is received by the ""main list"" activity's <code>onActivityResult(..)</code> method correctly.</p><p>However, if I implement a ""see previous""/""see next"" type of navigation within the Detail activity, and implement it using singleTop, that result no longer gets sent back to the initial activity:</p><pre><code>Intent nextItemIntent = this.createIntent(nextId);nextItemIntent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);startActivity(nextItemIntent);// at this point, my DetailActivity's onNewIntent() method is called, and the new data is loaded properly</code></pre><p>But from here, when I call <code>setResult(..)</code> and <code>finish()</code>, my MainList activity never receives the new/updated result.</p><p>Anyone know what I'm doing wrong?</p>","231078","","","","","2010-06-01 16:07:01","Forwarding activity result to parent, with singleTop launch mode","<android>","1","0","1","",""
"2951418","1","","","2010-06-01 16:12:26","1","745","<p>I have a paid app out in the market currently. Now I want to provide a free app for the users to try out first. I also want to be able to ensure that the data created by the users of the free app would be visible once they upgrade to the paid app.</p><p>Having gone through the Android docs, it seems like using sharedUserId in Manifest would work.</p><p>The problem I have discovered is that if I put the sharedUserId in the Manifest of the paid app of version 2 then its older version (version 1) would not work since the data is no longer visible to the new app with the sharedUserId. Note that in version 1, I didn't implement the sharedUserId.</p><p>So now I am wondering if there is another workaround that I can implement so that:a) the older version (without sharedUserId) of the paid app would still work with the new version (with sharedUserId).</p><p>b) the upgrade path from free version to paid version would include data remaining visible.</p><p>Anyone? It seems like that someone must have come across a similar situation and found a solution?</p>","355614","","","","","2013-01-13 11:20:09","Android upgrading free app to paid app using sharedUserId","<android><android-manifest>","1","0","","",""
"2951585","1","2951697","","2010-06-01 16:38:22","1","3345","<p>i have a txt file which contains many chinese characters, and the txt file is in the directory res/raw/test.txt. I want to read the file but somehow i can't make the chinese characters display correctly. Here is my code:</p><pre><code>try {    InputStream inputstream = getResources().openRawResource(R.raw.test);    BufferedReader bReader = new BufferedReader(        new InputStreamReader(inputstream,Charset.forName(""UTF-8"")));    String line = null;    while ((line= bReader.readLine())!= null) {        Log.i(""lolo"", line);        System.out.println(""here is some chinese character ???????"");    }} catch (IOException e) {    e.printStackTrace();}</code></pre><p>Both Log.i(""lolo"", line); and System.out.println(""here is some chinese character ???????"") don't show characters correctly, i can not even see the chinese characters in the println() method.What can i do to fix this problem? Can anybody help me?</p>","353857","","1079354","","2012-05-20 20:38:32","2012-11-21 19:31:43","Android: How to read a txt file which contains Chinese characters?","<android><file><cjk>","2","0","","",""
"2951616","1","3015815","","2010-06-01 16:43:52","6","8429","<p>I have the url of an image. What i need to do is launch the default image viewer for images using an intent.</p><p>I tried launching it by using:</p><pre><code>Uri uri = Uri.parse(""http://www.google.com/intl/en_ALL/images/srpr/logo1w.png"");  Intent it = new Intent(Intent.ACTION_VIEW);it.setDataAndType(uri, ""image/*"")startActivity(it);</code></pre><p>But it doesn't work. If I do not specify the type of data, the intent launches the browser since the data is a url. It works basically (since you can see the image on the browser) but what I would like is to have the gallery display the image for me.</p><p>I can also download the image into a Bitmap but I would still not know how to display the Bitmap using the gallery (if that's even possible). Any ideas?</p><p><strong>EDIT:</strong> I tried saving the bitmap to the cache and then launch the viewer on that file but it doesn't work. Can you spot any mistakes on my code? (The Utilities class is a class i wrote. The method simply creates the Bitmap. It works, that's not the problem)</p><pre><code>File temp = File.createTempFile(""tempImage"", "".jpg"", getContext().getCacheDir());Bitmap bmp = Utilities.loadBitmap(largeUrl.toString());BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(temp));bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);out.close();Intent intent = new Intent();intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(temp), ""image/jpg"");((Activity) getContext()).startActivity(intent);</code></pre><p><strong>EDIT 2</strong>: I decided that i may need the downloaded images after all so i decided to first save them on the sd card. That created other problems. I asked a <a href=""http://stackoverflow.com/questions/2954594/launching-intent-action-view-intent-not-working-on-saved-image-file"">new question</a> for that since it is a different problem.</p>","56242","","56242","","2010-06-02 02:20:58","2012-06-06 21:12:52","Launch intent viewer to display image from url","<java><android><android-intent>","3","0","2","",""
"2951660","1","3066486","","2010-06-01 16:50:33","1","1417","<p>I have an app killing feature in one of my apps but up to API 7 i always worked with restartPackage(String PackageName); but since API 8 its deprecated so I tried killBackgroundProcesses(String PackageName); but that didn't work either.</p><p>Both are methods are in the <a href=""http://ttp://developer.android.com/reference/android/app/ActivityManager.html#restartPackage%28java.lang.String%29"" rel=""nofollow"">ActivityManager</a> class</p><p>I hope someone can help me. </p>","355651","","","","","2011-04-06 23:07:40","Kill an app / package in API 8 (Froyo)","<android>","2","2","","",""
"2951736","1","2951811","","2010-06-01 17:02:47","0","500","<p>I am interested in opening the Google Navigator app from inside an application I am writing.  I want to be able to spawn it at a given time and pass specific data into it.</p><p>Can anyone think of a good way for me to do this?  What permissions do I need, etc?  Thank you very much.</p>","355663","","","","","2010-06-01 17:14:09","Android - How to run another app","<android><spawn>","1","0","1","",""
"2951923","1","2953057","","2010-06-01 17:32:48","20","5027","<p>What's the default ScaleType of ImageView?If I put an image which is 400 pixels x 400 pixels on a normal screen (320x480) without specifying ScaleType, how will the image be scaled?</p><p>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=""fill_parent""&gt;    &lt;ImageView         android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:src=""@drawable/big_image""    /&gt;&lt;/RelativeLayout&gt;</code></pre>","256239","","","","","2010-06-01 20:24:53","What's the default ScaleType of ImageView?","<android>","1","1","0","2013-04-04 01:16:47",""
"2951949","1","2952561","","2010-06-01 17:36:03","1","727","<p>When I have the contact id, how do I send an SMS/email (aka text) to it?</p><p>I've seen code like this, but none are using the contact it.</p><pre><code>Intent intent = new Intent(Intent.ACTION_SEND);intent.setType(""text/plain"");intent.putExtra(Intent.EXTRA_TEXT, text);act.startActivityForResult(Intent.createChooser(intent, """"), 0);</code></pre>","243782","","","","","2010-06-01 19:16:02","How to send SMS/email when you know the contact id?","<android>","1","0","2","",""
"2951953","1","2953304","","2010-06-01 17:37:10","4","5004","<p>I'm having trouble positioning the layout elements.  The AutoComplete in my TableLayout and the button after it are expanding the TableRow larger than the width of the screen.  Anyone have an idea why?  Below is my XML code as well as a picture of the problem.  </p><p>Thanks in advance!!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                                </p><pre><code>&lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;AutoCompleteTextView android:id=""@+id/installation""        android:textSize=""14sp"" android:completionThreshold=""3"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button android:id=""@+id/btn_find"" android:text=""@string/btn_find""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/error"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:paddingTop=""20px""        android:textColor=""#FF0000"" /&gt;&lt;/TableRow&gt;</code></pre><p></p><p><a href=""http://img689.imageshack.us/img689/6006/90902262.jpg"" rel=""nofollow"">Picture of UI</a></p>","351338","","351338","","2010-06-01 18:05:33","2011-10-18 09:46:39","Android - UI Elements going off screen","<android><tablelayout>","2","1","","",""
"2952186","1","","","2010-06-01 18:18:03","0","306","<p>I am trying to start Google Maps activity like this:</p><pre><code>    Intent start = new Intent(Intent.ACTION_VIEW, Uri.parse(""geo:""+58.0+"",""+58.0));    startActivity(start);</code></pre><p>But I am getting activity not found exception. </p><p>Do I have to declare Google Maps Activity?Any help is appreciated thanks.</p>","355717","","","","","2010-06-02 20:38:45","Starting Google Maps activity","<java><android>","1","0","","",""
"2952301","1","2952866","","2010-06-01 18:33:57","1","154","<p>Contacts have a field called  LAST_TIME_CONTACTED, it is updated with the time after you make a call.</p><p>But as I noticed when I send an SMS by the inbuilt Messaging app, it does not update. Could this be a bug?</p>","243782","","","","","2010-06-01 19:57:30","Could be a bug, after I send and SMS the LAST_TIME_CONTACTED field is not updated","<android>","1","0","","",""
"2952316","1","","","2010-06-01 18:36:34","0","1423","<p>I am making a simple game for class on an Android phone in which you can change a ball's position by touch.  I had it working in Processing by simply using mouse position.  In Android, I am using the gesture scanner and corresponding methods for various gestures, but I can't figure out the exact way to pull in the coordinates of the touch method into the ball object's x/y coordinates.  I hope that I am making sense!  Thanks so much.</p>","355748","","","","","2011-09-10 12:13:58","Android: moving ball through touch","<java><android>","2","0","1","",""
"2952426","1","","","2010-06-01 18:53:37","1","1722","<p>Has anyone created an app for i-Jetty?  I'm trying to get started using it but I don't understand what I need to do to create the .war file.  When using the dx tool to change my .class files to .dex I get an </p><p><code>UNEXPECTED TOP-LEVEL EXCEPTION:                                                                                                                                          java.lang.RuntimeException:\...\ijetty\hello\HelloWorld.class: file not found<br>   at com.android.dx.util.FileUtils.readFile(FileUtils.java:55)<br>   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:133)    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)<br>   at com.android.dx.command.dexer.Main.processOne(Main.java:247)<br>   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)<br> at com.android.dx.command.dexer.Main.run(Main.java:139)<br> at com.android.dx.command.dexer.Main.main(Main.java:120)<br> at com.android.dx.command.Main.main(Main.java:89)<br>1 error; aborting</code></p><p>Is the code section usually difficult to format correctly? Took me 10 minutes to fix this small block... </p><p>I know I need to convert my class files to .dex and my libs, then convert to .war </p><p>If anyone could guide me out here I would greatly appreciate it!</p><p>Thanks,Chris</p>","346208","","60117","","2012-01-16 05:03:27","2012-01-16 05:03:27","Webapps for i-Jetty","<android><web-applications><mobile><jetty><ijetty>","1","1","","2012-08-14 18:43:32",""
"2952499","1","2954082","","2010-06-01 19:04:36","0","717","<p>I'm trying to crop a photo to use in a Live Wallpaper but I'm getting a FileNotFoundException when the crop activity tries to save my new cropped image. This is the code I'm using:</p><pre><code>File file = new File(getFilesDir(), ""wallpaper.jpg"");Intent intent = new Intent(""com.android.camera.action.CROP"");intent.setData(uri);DisplayMetrics metrics = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(metrics);intent.putExtra(""outputX"", metrics.widthPixels * 2);intent.putExtra(""outputY"", metrics.heightPixels);intent.putExtra(""aspectX"", metrics.widthPixels * 2);intent.putExtra(""aspectY"", metrics.heightPixels);intent.putExtra(""scale"", true);intent.putExtra(""noFaceDetection"", true);intent.putExtra(""output"", Uri.parse(""file:/"" + file.getAbsolutePath()));startActivityForResult(intent, REQUEST_CROP_IMAGE);</code></pre><p>The wallpaper.jpg file seems to exist on DDMS file explorer so I'm not sure what I'm doing wrong. Any advice is greatly appreciated.</p>","350678","","","","","2010-06-01 23:34:55","FileNotFoundException when cropping a photo","<java><android><camera><crop><filenotfoundexception>","2","0","","",""
"2952572","1","3145620","","2010-06-01 19:17:16","4","16924","<p>I want to use DTLS (on OpenSSL) using JNI on Android 2.1/2.2.</p><p>Can someone help me get started (tutorials, howto, pointers etc) with building OpenSSL for Android (2.1/2.2) using the Android NDK? </p><p>Anything important that I should be aware of before doing it. </p><p>Thanks.</p>","306346","","","","","2013-07-01 22:15:04","Building OpenSSL on Android NDK","<android><jni><openssl><android-ndk><datagram>","3","1","3","",""
"2952632","1","2952716","","2010-06-01 19:26:13","0","184","<pre><code>Intent intent = new Intent(this,AnotherClass.class);intent.putExtra(""Name"", ""foo"");setResult(RESULT_OK, null);</code></pre><hr><pre><code>super.onActivityResult(requestCode, resultCode, data);    switch (requestCode) {      case (1): {        TextView textView = (TextView) findViewById(R.id.TextView01);        if (resultCode == Activity.RESULT_OK) {          textView.setText(""Data"" + data.getStringExtra(""Name""));        }</code></pre><p>What am I doing wrong? </p>","82368","","","","","2010-06-01 19:35:13","Problem passing Data within Activity","<android><activity><android-intent><message-passing>","1","0","","",""
"2952914","1","6179414","","2010-06-01 20:03:53","9","10639","<p>I have a <code>ListView</code> where each item is a <code>TextView</code>.</p><p>I want to enable the long press behaviour similar to an <code>EditText</code> that displays the default context menu with items like ""Select all"", ""Cut all"", ""Copy all"", etc.</p><p>Is there an easy way to enable this for a <code>TextView</code>?</p>","338981","","2613054","","2013-12-05 12:11:48","2013-12-05 12:11:48","Copy text from TextView on Android","<android><select><copy><contextmenu><textview>","3","4","8","",""
"2953101","1","","","2010-06-01 20:31:21","1","3843","<p>I am currently finding about how to build a XMPP client application on android 2.1.I came across <a href=""http://stackoverflow.com/questions/2596855/interaction-between-java-and-android"">this link</a> which somewhat talks about the same problem.I am a newbie to android dev and thus found the solution given there to be difficult to digest.</p><p>The system currently has Active MQ as a JMS provider.My job is to fed the messages coming from JMS to the XMPP server and then develope XMPP client on android 2.1 which will listen and show notification to the events pushed by the server.</p><p>I have following concerns(which might sound foolish)1.How do I push the events from JMS to the XMPP server which will in turn push them on android?</p><p>2.Which XMPP server implementation I should use?I have 3 options     * Openfire: Very mature (was a commercial product), but sounds like it's  heavyweight, written in Java    * Prosody: Lightweight and easy to use, written in Lua. Doesn't have PubSub module yet    * Tigase: Also lightweight, written in Java, supports PubSubHow do I test and setup these servers.Do I need PubSub funcationality for my app?</p><p>3.For XMPP client I came across Smack API given <a href=""http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/"" rel=""nofollow"">here</a> which is updated like 2 years back.Can anyone please tell me how do I make use of it for Android 2.1.If possible can anyone please mail me latest working Smack jar files.</p><p>Thanks,Ameya </p>","355833","","355833","","2010-06-01 20:39:22","2010-08-07 21:45:09","XMPP and Android interaction","<android><jms><xmpp><activemq><smack>","3","0","","",""
"2953107","1","2953150","","2010-06-01 20:31:45","0","111","<p>I have about twenty pages of information that is stored in tables that needs to be stored in my Android application. Each column is a designated stop on a bus route and the column is filled with times that the bus will be at the stop. There is also certain information that needs to be associated with some times, such as if the bus is handicap accessible at a certain time. </p><p>Here is an example of one of the tables: <a href=""http://www.cyride.com/routes/Summer/WDRedEast.html"" rel=""nofollow"">Bus Times</a></p><p>I have thought about using a SQL lite as that seems as though it would be able to store these tables quite easily; but when I think of using SQL I think of dynamic data storage and this shouldn't be changing more than once a year. </p><p>Is SQL appropriate for this application? Is there a better way to do this? </p><p>Thanks, Rob  </p>","289153","","135152","","2011-05-25 03:13:51","2011-05-25 03:13:51","Storing Tables of Information on the Android Platform","<android><sqlite>","1","0","","",""
"2953146","1","2956352","","2010-06-01 20:39:02","43","68027","<p>I'm trying to integrate posting to one's wall from within my app. I already have an area where the user can save his/her username and password (encrypted). I would like my program to recall the saved username and password, pass that to Facebook for authentication, and then allow the app to post simple text (maybe a link too) to the user's wall. </p><p>That said, I've read everything on the developer pages at Facebook (the api looks completely foreign to me... I've never done any type of web app development before... just desktop apps), and experimented with the Java libraries <a href=""https://github.com/facebook/facebook-android-sdk"">here</a> but to be honest, I don't understand any of the various implementations. Some claim to be simple to use, but apparently they are all way above my head. </p><p>I've even tried messing with the official Facebook Android SDK, but that uses a webview interface, and I can't pass in the username and password for easy authentication. Plus, I'm still clueless as to how to post to the wall even after correct authentication.</p><p>Please help.Thanks.</p><p>Oh, btw I already have a Facebook API key and Application ID.</p><p>[UPDATE 1]</p><p>For further clarification:If I use the following code snippet with the official Facebook Android SDK <a href=""http://github.com/facebook/facebook-android-sdk"">http://github.com/facebook/facebook-android-sdk</a> what should I do next (after the user has logged-in)? This is unclear to me.</p><pre><code>Facebook facebookClient = new Facebook();facebookClient.authorize(this, ""[APP ID]"", new String[] {""publish_stream"", ""read_stream"", ""offline_access""}, this);</code></pre><p>where ""this"" is an Activity that implements a DialogListener, and ""[APP ID]"" is my Facebook application ID.</p><p>Thanks.</p><p>[UPDATE 2]</p><p>I found a solution (see below), though the only thing missing is the ability to auto-populate the login text boxes with the data I have stored in the app. The official Facebook Android SDK may not allow for this. I'll keep looking into it.</p>","272302","","55093","","2011-12-26 11:18:18","2012-09-01 18:00:43","Android/Java -- Post simple text to Facebook wall?","<java><android><facebook>","4","4","39","",""
"2953365","1","","","2010-06-01 21:10:11","0","892","<p>Is there a script for the Android Webkit browser thats make a site ""homepage""Or in other words can I make a ""Set as homepage"" button  </p>","355861","","258120","","2010-06-01 21:14:04","2011-01-31 03:20:26","Set As Homepage On Android Browser","<android><browser>","2","0","","",""
"2953381","1","2953665","","2010-06-01 21:12:52","12","11745","<p>I'm wondering if it is possible to rerender just one element in a listview? I assume by calling <code>notifyDatasetChanged()</code> is gonna rerender the whole list? </p><p>Thanks,</p>","109704","","231716","","2011-11-29 14:33:29","2014-02-20 04:10:56","Android: Is it possible to refresh just one item in a listview?","<android><listview>","6","2","2","",""
"2953532","1","","","2010-06-01 21:37:45","4","2057","<p>is it even possible to modify .apk, by adding additional class to .dex and re-packing with modified manifest.xml??  </p><p>I know there are tools such as baksmali / smali to disassemble / re-assemble given classes.dex from .apk, but not sure limitation what could be modified from there on? </p><p>I'm trying to add additional activity, to modify starting launcher activity (may be from androidmanifest.xml) from original apk, then re-pack and sign to make complete single .apk...  all need to be done out of build time, no raw source or build structure visible, only .apk as input... ANY IDEA?</p>","355859","","","","","2010-06-01 22:16:55","is it even possible to modify .apk, by adding additional class to .dex and re-packing with modified manifest.xml?","<android><apk>","1","0","1","",""
"2953791","1","","","2010-06-01 22:19:50","0","1298","<p>i want receive all start app intents (i think MAIN/LAUNCHER, see below) to log how often i used the application. So i do <em>not</em> want create an activity... I tried several receiver blocks, but for now nothing works:</p><p>with, without priority, only the action, both, only the category and so on..</p><pre><code>&lt;receiver android:name="".Receiver"" android:enabled=""true""    android:process="".e""&gt;    &lt;intent-filter priority=""100000"" android:priority=""100000""&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>Have anyone an idea?</p><p>Thanks</p>","184853","","","","","2010-06-01 22:25:35","How to get ""all"" (or the MAIN/LAUNCHER) android intent","<android><android-intent><broadcastreceiver><intentfilter>","1","0","","",""
"2953865","1","2953894","","2010-06-01 22:36:21","1","4982","<p>I am trying to access the JavaScript Camera API via the Android browser as demo'd at Google IO on Froyo (yes, I have Froyo on my Nexus1).  Since there is no documentation, I am going by the W3C specs.  But, I am unable to access the navigator.device object and unable to access navigator.camera either - both return undefined.  Can anyone point me to documentation or have a solution ?</p>","70711","","","","","2010-06-01 22:45:27","JavaScript Camera API Android (Froyo)","<android><api><html5>","1","0","","",""
"2953890","1","","","2010-06-01 22:43:53","0","1643","<p>I want to show the user a flattened pick list of all their contacts phone numbers and it must work from versions 1.6 up. I have read the related questions on SO and the Android documentation for <a href=""http://developer.android.com/resources/articles/contacts.html#legacy"" rel=""nofollow"">Eclair</a>.</p><p>The problem is, even splitting my code into a factory class and specific implementations does not work for me because using <code>Contacts.CONTENT_URI</code> only shows contacts not individual numbers. What I need is this for version 1.6  </p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI);startActivityForResult(intent, REQUEST_PICK_CONTACT);</code></pre><p>And the equivalent for 2.0 and above.</p><p>Even if I get their example to work, by building against the 2.1 API am I not stopping my app being visible on the Market to users with earlier versions of the OS? I can't launch it against a 1.6 emulator, for example.</p>","81317","","995926","","2012-05-22 08:22:05","2012-05-22 08:22:05","Display a native activity with a pick-list of Android phone contacts only on Eclair and above?","<android><contacts><android-2.0-eclair>","1","1","1","",""
"2953927","1","2953997","","2010-06-01 22:50:56","1","1007","<p>Is there any way to correctly stop the camera service? This does not seem to work:</p><pre><code>public void surfaceDestroyed(SurfaceHolder holder){    camera.stopPreview();    camera = null;}</code></pre><p>After doing that the camera does not work, even if I use the program that is preinstalled in my handset.</p>","244296","","","","","2010-06-03 15:31:36","After stop camera service, the camera does not work anymore","<android><camera>","2","0","1","",""
"2954059","1","2959227","","2010-06-01 23:29:59","0","983","<p>I'm brand new to Android development and right now I am building a simple calculator for healthcare workers. My program implements the OnClickListener class, but every time I click on the button to initiate the calculation, I get an error saying the ""Source is not Found"".</p><p>Here is the code:</p><pre><code>public class KidneyeGFR extends Activity implements OnClickListener {TextView EditAge;TextView EditSerum;TextView Gfrtext;RadioButton Male;RadioButton Female;RadioButton EveryoneElse;RadioButton African;Button Calculate;double gender;double race;double finalgfr;private static final int GFRCONST = 186;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    EditAge = (TextView)this.findViewById(R.id.EditAge);    EditSerum = (TextView)this.findViewById(R.id.EditSerum);    Male = (RadioButton)this.findViewById(R.id.Male);    Male.setChecked(true);    Female = (RadioButton)this.findViewById(R.id.Female);    EveryoneElse = (RadioButton)this.findViewById(R.id.EveryoneElse);    EveryoneElse.setChecked(true);    African = (RadioButton)this.findViewById(R.id.African);    Calculate = (Button)this.findViewById(R.id.Calculate);    Calculate.setOnClickListener(this);}public void onClick(View v) {    if (Female.isChecked()) {        gender = 0.742;    }    else {        gender = 1.0;    }    if (African.isChecked()) {        race = 1.212;    }    else {        race = 1.0;    }    calculateGFR();}protected void calculateGFR() {    int age = Integer.parseInt(EditAge.getText().toString());    double serum = Double.parseDouble(EditSerum.getText().toString());    finalgfr = GFRCONST * Math.pow(serum, -1.154) * Math.pow(age, -0.203) * gender * race;    Gfrtext.setText(Double.toString(finalgfr));}</code></pre>","339036","","339036","","2010-06-02 02:48:48","2010-06-02 15:48:53","OnClickListener error: Source not found","<android>","3","0","1","",""
"2954204","1","2954288","","2010-06-02 00:10:50","2","120","<p>I have an screen that displays all the names in the Contacts in a ListView.  </p><p>When the user clicks on a name, I want to launch another Activity which display the details of the selected Contact (Phone number/ email) in another screen. How do I display details for the <em>selected</em> row. (i.e When starting the intent how do I send over the row_id of the item selected)? </p><p>I've tried the following code:</p><pre><code>    Intent i = new Intent(this, ContactDetails.class);    startActivity(i);</code></pre>","289918","","","","","2010-06-02 00:39:26","Launch Activity for a certain record","<android>","1","0","","",""
"2954238","1","2965714","","2010-06-02 00:23:39","2","370","<p>I'm new to Android application development and I'm currently experimenting with various UI ideas.  In the image below, you can see a vertically scrolling list of horizontally scrolling galleries (and also textviews as you can see).  I'm also doing some matrix and camera transformations which I will come to in a minute.</p><p>For the background of the list elements, I use green.  Blue is the background of the galleries, and red is the background for the images.  These are just for my benefit of learning.</p><p>The galleries being used are extended classes where I overrode the drawChild method to perform a canvas scale operation in order for the image closest to the center (width) to be larger than the others.</p><p>The list view going vertically, I overrode the drawChild method and used the camera rotations from lack of depth dimension in the canvas functionality.  The items in the list are scaled down and rotated relative to their position's proximity to the center (height).</p><p>I understood that scrolling and clicking would not necessarily follow along with the image transforms, but it appears as though the parent Gallery class's drawing is constrained to the original coordinates as well (see photo below).</p><p>I would love to hear any insight any of you have regarding how I can change the coordinates of the galleries in what is rendered via gallery scroll and the touch responsiveness of said gallery.</p><p><em>Images in the gallery are not same dimensions, so don't let that throw you in looking at the image below</em></p><p>Thanks in advance!</p><p>Ben</p><p><a href=""http://i47.tinypic.com/maxg80.jpg"" rel=""nofollow"">link to image</a> (could not embed)</p><p>-<em>-</em> Update:I was using my test application UI and noticed that when I got the UI to the point of the linked image and then I touched the top portion of the next row in the list, the gallery updated to display the proper representation.  So, I added a call to clearFocus() in the drawChild method and that resulted in more accurate drawing.  It does seem a tad slower, and since I'm on the Incredible, I'm worried it is a bloated solution.  </p><p>In any event, I would still appreciate any thoughts you have regarding the best way to have the views display properly and how to translate the touch events in the gallery's new displayed area to its touchable coordinates so that scrolling on the actual images works when the gallery has moved.</p><p>Thanks!</p>","166242","","166242","","2010-06-02 12:39:52","2010-06-03 13:57:26","Android - Transforming widgets within transformed widgets and the resulting usability issues","<android><canvas><camera><widget>","1","0","1","",""
"2954311","1","2954323","","2010-06-02 00:44:35","0","865","<p>Keep getting ""The constructor SimpleCursorAdapter(MyProgram, int, Cursor, int) is undefined"" and am not sure why. Here is my code.</p><pre><code>  Cursor c = mDbHelper.getAllTypes();   startManagingCursor(c);  SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.list_item1, c, R.id.text1);      setListAdapter(notes);</code></pre><p>Any ideas?</p>","282475","","","","","2013-06-07 09:46:44","The constructor SimpleCursorAdapter(MyProgram, int, Cursor, int) is undefined","<android><cursor>","1","0","","",""
"2954346","1","","","2010-06-02 00:53:55","2","4738","<p>I'm writing an application for Android phones for Human vs. Human chess play over the internet. I was looking at some tutorials, to learn how to develop Android applications and found a very nice example of making galleries (it was a GridView usage example for making a gallery about dogs) and the idea came to draw the chess table using a GridView, because the example project also handled the point &amp; click event and I intended to use the same event in the same way, but for a different purpose. The game works well (currently it's a hotseat version), however, I'm really frustrated by the fact that whenever I rotate the screen of the phone, my GridView gets hysterical and puts some empty space in my chess table between the columns. I realized that the cause of this is that the GridView's width is the same as its parent's and the GridView tries to fill its parent in with, but there should (and probably is) be a simple solution to get rid of this problem. However, after a full day of researching, I haven't found any clue to help me to make a perfect drawing about my chess table without a negative side effect in functionality.The chess table looks fine if the phone is in Portrait mode, but in Landscape mode it's far from nice.This is how I can decide whether we are in Portrait or Landscape mode:</p><pre><code>((((MainActivity)mContext).getWindow().getWindowManager().getDefaultDisplay().getWidth()) &lt; ((MainActivity)mContext).getWindow().getWindowManager().getDefaultDisplay().getHeight())</code></pre><p>In the main.xml file the GridView is defined in the following way:</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;GridView xmlns:android=""http://schemas.android.com/apk/res/android""              android:id=""@+id/gridview""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:numColumns=""8""              android:verticalSpacing=""0dp""              android:horizontalSpacing=""0dp""              android:stretchMode=""columnWidth""              android:gravity=""center""              &gt;    &lt;/GridView&gt;...&lt;/LinearLayout&gt;</code></pre><p>I appreciate any help with the problem and thank you for reading this.</p><p>Portrait: <a href=""http://www.freeimagehosting.net/image.php?f388b3ec64.png"" rel=""nofollow"">http://www.freeimagehosting.net/image.php?f388b3ec64.png</a></p><p>Landscape: <a href=""http://www.freeimagehosting.net/image.php?ee790603a2.png"" rel=""nofollow"">http://www.freeimagehosting.net/image.php?ee790603a2.png</a></p>","355970","","355970","","2010-06-02 04:26:57","2010-06-03 18:18:13","GridView: How can I get rid of extra space from my GirdView object?","<java><android>","2","2","1","",""
"2954368","1","","","2010-06-02 01:00:26","1","4044","<p>I am using emulator Android 2.1 with Eclipse. For few days I had the emulator working ... was able to debug... I had 2 AVDs created and was using one of them. Earlier today I had to move my classes to a different package. Ever since I did that the configuration that I had has disappeared . So now I had to create configuration - I select Android Application and then click New - gave it a name TestPrjCfg - when I go to the ""Target"" tab - I see ""No AVD available"" but when I click manager I see two AVDs listed. I tired refresh in the ""Target"" tab - the existing AVDs do not show up. I used the Manager and created a third AVD that did not help either. Please let me know what am I missing here? What should I do so that the existing AVDs showup in the ""Target"" tab-</p><p>Thank you for the time and effortabhi</p>","355975","","","","","2012-11-01 11:55:32","AVDs that exist do not get listed in the ""Target Tab""","<android><eclipse><manager><avd>","1","0","","",""
"2954423","1","","","2010-06-02 01:20:33","1","63","<p>i'm developing an android app, and what i have is a String array of restaurants in one class...</p><pre><code>static final String[] AtoZ = new String[] {    ""Ananda"",    ""Brambles Cafe"", ""Brannigans"", ""Buona Sera"",    ""Cafe Mao"", ""Cafe Mimo"",    ""Dante"",    ""Eddie Rockets"",    ""Frango's World Cuisine"",    ""Nando's"",    ""Overends Restaurant @ Airfield House"",    ""Pizza Hut"",    ""Roly Saul"",    ""Siam Thai"",""Smokey Joes"",""Sohag Tandoori"",    ""TGI Friday"",""The Rockfield Lounge"", ""Winters Bar"",    ""Al Boschetto"",""Baan Thai"", ""Bella Cuba"", ""Bellamys"",""Bianconis"",""Canal Bank Cafe"",    ""Canalettos Restaurant"",""Chandni Restaurant"", ""Chill Out Cafe"", ""Crowes"", ""Da Vincenzo"", ""Druids"", ""Dylan"",    ""Epic Restaurant"", ""Jewel in the Crown"", ""Juniors"", ""Kanum Thai"",""Kites"", ""Koishi"",""Maia Restaurant"",    ""Mangetu Restaurant"", ""Millers Pizza Kitchens"",    ""O'Connells Restaurant"", ""Ocras Restaurant"", ""Orchid Szechuan Restaurant"", ""Roly's Bistro"",    ""Ryans Beggars Bush"", };</code></pre><p>i have created a view for each of these restaurants aswell in my layouts folder.</p><p>so this array is going to be displayed in a listView in my android app.</p><p>What i want to know is what is the quickest way of linking the item clicked to its correct view, without having to type out each position in the array and have a serious of if statements which would take a year with this!</p><p>i dont want to be doing something like this</p><pre><code>if(position == 1){        setContentView(R.layout.bentleys);</code></pre><p>as it would take a year doing that for each one...</p><p>Please help. thanks alot.</p>","314610","","","","","2010-06-02 05:46:32","Java & android: Help linking an item in a listView to its correct view, but not the way i know of","<java><android><arrays><listview>","1","0","1","",""
"2954434","1","","","2010-06-02 01:22:54","6","8535","<p>Basically what I need to do is to perform digest authentication. First thing I tried is the official example available <a href=""http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4.0.1/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java"">here</a>. But when I try to execute it(with some small changes, Post instead of the the Get method) I get a</p><pre><code>org.apache.http.auth.MalformedChallengeException: missing nonce in challangeat org.apache.http.impl.auth.DigestScheme.processChallenge(DigestScheme.java:132)</code></pre><p>When this failed I tried using:</p><pre><code>DefaultHttpClient client = new DefaultHttpClient();client.getCredentialsProvider().setCredentials(new AuthScope(null, -1, null), new UsernamePasswordCredentials(""&lt;username&gt;"", ""&lt;password&gt;""));HttpPost post = new HttpPost(URI.create(""http://&lt;someaddress&gt;""));        List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();nvps.add(new BasicNameValuePair(""domain"", ""&lt;username&gt;""));post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));DigestScheme digestAuth = new DigestScheme();digestAuth.overrideParamter(""algorithm"", ""MD5"");digestAuth.overrideParamter(""realm"", ""http://&lt;someaddress&gt;"");digestAuth.overrideParamter(""nonce"", Long.toString(new Random().nextLong(), 36));digestAuth.overrideParamter(""qop"", ""auth"");digestAuth.overrideParamter(""nc"", ""0"");digestAuth.overrideParamter(""cnonce"", DigestScheme.createCnonce());Header auth = digestAuth.authenticate(new      UsernamePasswordCredentials(""&lt;username&gt;"", ""&lt;password&gt;""), post);System.out.println(auth.getName());System.out.println(auth.getValue());post.setHeader(auth);HttpResponse ret = client.execute(post);ByteArrayOutputStream v2 = new ByteArrayOutputStream();ret.getEntity().writeTo(v2);System.out.println(""----------------------------------------"");System.out.println(v2.toString());System.out.println(""----------------------------------------"");System.out.println(ret.getStatusLine().getReasonPhrase());System.out.println(ret.getStatusLine().getStatusCode());</code></pre><p>At first I have only overridden ""realm"" and ""nonce"" DigestScheme parameters. But it turned out that PHP script running on the server requires all other params, but no matter if I specify them or not DigestScheme doesn't generate them in the Authorization RequestPreperty when I call its authenticate() method. And PHP script returns HTTP response code 200 with a message that PHP script requires cnonce, nc and qop parameters.</p><p>I've been struggling with this for two days, and no luck. Based on everything I think that the cause of the problem is the PHP script. It looks to me that it doesn't send a challenge when app tries to access it unauthorized.</p><p>Any ideas anyone?</p><p>Edit:One more thing, I've tried connecting with cURL and it works.</p>","355985","","355985","","2010-06-02 01:41:12","2013-01-12 12:08:17","Apache HttpClient Digest authentication","<java><android><httpclient><digest-authentication>","1","2","1","",""
"2954520","1","3672962","","2010-06-02 01:52:22","0","1272","<p>My application calls Runtime.exec() to launch an executable in aseparate process at start up time. I would like this child process toget killed when the parent activity exits. Now I can use onDestroy()to handle regular cases, but not ""Force quit"", shutdowns from DDMS, orkill from the console since those don't run onDestroy().The addShutdownHandler() does not seem to be invoked in these caseseither.</p><p>Is there any other hook or signal handler that informs my activitythat it's about to get terminated ? As an alternative is there a wayto have the system automatically kill the child process when theparent dies ? </p>","355993","","","","","2011-01-12 20:19:25","Android: How to receive process signals in an activity to kill child process?","<android><exec><kill><signals>","1","4","1","",""
"2954594","1","3677598","","2010-06-02 02:17:27","4","9355","<p>First of all let me say that this questions is slightly connected to <a href=""http://stackoverflow.com/questions/2951616/launch-intent-viewer-to-display-image-from-url"">another question</a> by me. Actually it was created because of that.</p><p>I have the following code to write a bitmap downloaded from the net to a file in the sd card:</p><pre><code>// Get image from urlURL u = new URL(url);HttpGet httpRequest = new HttpGet(u.toURI());HttpClient httpclient = new DefaultHttpClient();HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);HttpEntity entity = response.getEntity();BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);InputStream instream = bufHttpEntity.getContent();Bitmap bmImg = BitmapFactory.decodeStream(instream);instream.close();// Write image to a file in sd cardFile posterFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+""/Android/data/com.myapp/files/image.jpg"");posterFile.createNewFile();BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(posterFile));Bitmap mutable = Bitmap.createScaledBitmap(bmImg,bmImg.getWidth(),bmImg.getHeight(),true);mutable.compress(Bitmap.CompressFormat.JPEG, 100, out);out.flush();out.close();// Launch default viewer for the fileIntent intent = new Intent();                   intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(posterFile.getAbsolutePath()),""image/*"");((Activity) getContext()).startActivity(intent);</code></pre><p>A few notes. I am creating the ""mutable"" bitmap after seeing someone using it and it seems to work better than without it. And i am using the parse method on the Uri class and not the fromFile because in my code i am calling these in different places and when i am creating the intent i have a string path instead of a file.</p><p>Now for my problem. The file gets created. The intent launches a dialog asking me to select a viewer. I have 3 viewers installed. The Astro image viewer, the default media gallery (i have a milstone on 2.1 but on the milestone the 2.1 update did not include the 3d gallery so it's the old one) and the 3d gallery from the nexus one (i found the apk in the wild).</p><p>Now when i launch the 3 viewers the following happen:</p><ul><li><p><strong>Astro image viewer:</strong> The activitylaunches but i see nothing but ablack screen.</p></li><li><p><strong>Media Gallery:</strong> i get an exceptiondialog shown ""The application MediaGallery (processcom.motorola.gallery) has stoppedunexpectedly. Please try again"" witha force close option.</p></li><li><p><strong>3D gallery:</strong> Everything works as itshould.</p></li></ul><p>When i try to simply open the file using the Astro file manager (browse to it and simply click) i get the same option dialog but this time things are different:</p><ul><li><p><strong>Astro image viewer:</strong> Everything worksas it should.</p></li><li><p><strong>Media Gallery:</strong> Everything works as itshould.</p></li><li><p><strong>3D gallery:</strong> The activity launches buti see nothing but a black screen.</p></li></ul><p>As you can see everything is a complete mess. I have no idea why this happens but it happens like this every single time. It's not a random bug.</p><p>Am i missing something when i am creating the intent? Or when i am creating the image file? Any ideas?</p><p><strong>EDIT:</strong> As noted in the comment here is the part of interest in adb logcat. Also i should note that i changed the way i create the image file. Since i want to create a file that reflects an online file i simply download it instead of creating a Bitmap and then creating the file (this was done because at some point i needed the Bitmap but now i do it the other way around). the problems persist thought and are exactly the same :</p><blockquote>  <p>I/ActivityManager(18852): Starting  activity: Intent {  act=android.intent.action.VIEW  dat=/sdcard/Android/data/com.myapp/files/image.jpg  typ=image/* flg=0x3800000  cmp=com.motorola.gallery/.ViewImage }</p>    <p>I/ActivityManager(18852): Start proc  com.motorola.gallery:ViewImage for  activity  com.motorola.gallery/.ViewImage:  pid=29187 uid=10017 gids={3003, 1015}</p>    <p>I/dalvikvm(29187): Debugger thread not  active, ignoring DDM send  (t=0x41504e4d l=38)</p>    <p>I/dalvikvm(29187): Debugger thread not  active, ignoring DDM send  (t=0x41504e4d l=64)</p>    <p>I/ActivityManager(18852): Process  com.handcent.nextsms (pid 29174) has  died.</p>    <p>I/ViewImage(29187): In View Image  onCreate!</p>    <p>D/AndroidRuntime(29187): Shutting down  VM</p>    <p>W/dalvikvm(29187): threadid=3: thread  exiting with uncaught exception  (group=0x4001b170)</p>    <p>E/AndroidRuntime(29187): Uncaught  handler: thread main exiting due to  uncaught exception</p>    <p>E/AndroidRuntime(29187):  java.lang.RuntimeException: Unable to  start activity  ComponentInfo{com.motorola.gallery/com.motorola.gallery.ViewImage}:  java.lang.NullPointerException</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread.access$2200(ActivityThread.java:119)</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)</p>    <p>E/AndroidRuntime(29187):  at  android.os.Handler.dispatchMessage(Handler.java:99)</p>    <p>E/AndroidRuntime(29187):  at  android.os.Looper.loop(Looper.java:123)</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread.main(ActivityThread.java:4363)</p>    <p>E/AndroidRuntime(29187):  at  java.lang.reflect.Method.invokeNative(Native  Method)</p>    <p>E/AndroidRuntime(29187):  at  java.lang.reflect.Method.invoke(Method.java:521)</p>    <p>E/AndroidRuntime(29187):  at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)</p>    <p>E/AndroidRuntime(29187):  at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)</p>    <p>E/AndroidRuntime(29187):  at  dalvik.system.NativeStart.main(Native  Method)</p>    <p>E/AndroidRuntime(29187): Caused by:  java.lang.NullPointerException</p>    <p>E/AndroidRuntime(29187):  at  com.motorola.gallery.ImageManager.allImages(ImageManager.java:5621)</p>    <p>E/AndroidRuntime(29187):  at  com.motorola.gallery.ImageManager.getSingleImageListByUri(ImageManager.java:5515)</p>    <p>E/AndroidRuntime(29187):  at  com.motorola.gallery.ViewImage.onCreate(ViewImage.java:1801)</p>    <p>E/AndroidRuntime(29187):  at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)</p>    <p>E/AndroidRuntime(29187):  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)</p>    <p>E/AndroidRuntime(29187):  ... 11 more</p></blockquote>","56242","","56242","","2010-06-02 07:54:33","2013-04-11 09:36:14","Launching Intent.ACTION_VIEW intent not working on saved image file","<java><android><bitmap><android-intent>","3","5","5","",""
"2954712","1","2968171","","2010-06-02 02:57:11","2","2284","<p>I successfully created the Database and inserted a row however I cannot Query it for some reason. My Droid crashes everytime.</p><pre><code>          // Create a new row of values to insert.          ContentValues newValues = new ContentValues();          // Assign values for each row.          newValues.put(""value"", ""kunjan"");          // Insert the row into your table          myDatabase.insert(DATABASE_TABLE, null, newValues);          String[] result_columns = new String[] { ""value"" };          // I GET AN EXCEPTION HERE          Cursor allRows = myDatabase.query(true, DATABASE_TABLE, result_columns, null, null,              null, null, null, null);          if (allRows.moveToFirst()) {            String value = allRows.getString(0);            TextView foo = (TextView) findViewById(R.id.TextView01);            foo.setText(value);          }          allRows.close();          myDatabase.close();</code></pre><p>I get this exception</p><pre><code>no such column: value: , while compiling: SELECT DISTINCT value FROM mainTable</code></pre>","82368","","82368","","2010-06-02 04:49:29","2010-06-03 17:06:09","How do I query SQLite Database in Android?","<database><android><sqlite>","2","0","","",""
"2954729","1","","","2010-06-02 03:05:15","1","497","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2384461/bluetooth-support-on-android-emulator"">Bluetooth support on Android Emulator</a>  </p></blockquote><p>I want to run Bluetooth chat apps, but my emulator is unable to switch Bluetooth on. I am using Android 2.2. The Bluetooth option is not being highlighted in the emulator. how can I activate Bluetooth on the emulator?</p>","356033","","50776","","2011-12-16 20:09:38","2011-12-16 20:09:38","unable to access Bluetooth in emulator","<android><android-emulator><bluetooth><android-2.2-froyo>","2","0","","2011-12-16 20:09:48",""
"2954775","1","6714164","","2010-06-02 03:19:02","0","1450","<p>I was wondering how I could query my database of 1400 items and get only the <code>DISTINCT</code> types and row ids. Below is the actual sql that I want to run by my program crashes if I dont return ids.</p><pre><code> return mDb.rawQuery(""SELECT DISTINCT Type from the_foods"",null);</code></pre><p>Any ideas?</p>","282475","","301832","","2010-07-21 09:49:49","2011-07-15 23:22:17","Android rawQuery help","<android><sqlite>","1","1","","",""
"2955092","1","","","2010-06-02 04:55:52","2","579","<p>Successfully loaded a KML file into the DDMS Emulator Tab, which shows up as a series of Latitude and Longitude coordinates in the Location Controls window. Is there a way to step through each Placemark, vs. having the entire series play automatically? There are forward and back buttons on the Location Controls window, but no documentation on what they mean. I tried them both, but no Placemark coordinates are highlighted, so I don't know which Placemark is currently the focus. Thanks for your help.</p>","318109","","","","","2010-11-02 11:49:05","Stepping through KML Files with DDMS","<android><android-emulator><android-mapview>","1","0","1","",""
"2955170","1","2955775","","2010-06-02 05:18:31","0","636","<p>In windows text files are displayed with notepad icon. When we double click the particular file it open’s the notepad and displays the file. Like that I need to open the file from the download folder in android. I have used the intent-filter for register my ics file’s mime type. When I select the file in the download folder it just opens my application only. At that time I need to open / read the selected file. How to do this? I am new to android Can anyone help me?</p>","324223","","","","","2010-06-03 17:42:42","How to open a selected file in android?","<android>","2","0","","",""
"2955218","1","","","2010-06-02 05:29:58","23","7051","<p>I have a ListView in a custom ArrayAdapter that displays an icon ImageView and a TextView in each row.  When I make the list long enough to let you scroll through it, the order starts out right, but when I start to scroll down, some of the earlier entries start re-appearing.  If I scroll back up, the old order changes.  Doing this repeatedly eventually causes the entire list order to be seemingly random.  So scrolling the list is either causing the child order to change, or the drawing is not refreshing correctly.</p><p>What could cause something like this to happen?  I need the order the items are displayed to the user to be the same order they are added to the ArrayList, or at LEAST to remain in one static order.  If I need to provide more detailed information, please let me know.  Any help is appreciated.  Thanks.</p>","356098","","","","","2012-01-10 18:56:38","ListView in ArrayAdapter order get's mixed up when scrolling","<android><listview><android-arrayadapter>","3","1","6","",""
"2955281","1","2955342","","2010-06-02 05:48:02","-2","365","<p>i have activity1 and activity2 and i want to go activity2 from activity1 using rotation animation if do you have any code so please send me...... </p>","343678","","","","","2010-06-02 06:48:50","Go to Activity2 from Activity1 using rotation animation","<android>","1","0","","2012-08-22 22:09:15",""
"2955497","1","","","2010-06-02 06:34:58","1","399","<p>I have created a php webpage. I now want to create a launcher application in android phone, it simply opens the browser with the url ""http://&lt;mywebsite&gt;/m"".</p><p>I use uri intent to launch the browser in onCreate function. </p><pre><code>public void onCreate(...){    ....    startActivity(new Intent(Intent.ACTION_VIEW, new Uri(http://&lt;mywebsite&gt;/m)));    ...}</code></pre><p>I execute this program in my G1 phone (Cyan Mod 5). However, when I click the ""Home"" key, and then re-enter my application through Task list, I lose focus for my last started browser, and the screen blank </p><p>Any suggestion?!Should I need any code in onResume function to re-focus my web!?</p>","356131","","243782","","2010-06-02 07:21:59","2011-01-26 15:42:59","Create web page launcher, losing focus","<android><android-intent>","1","2","","",""
"2955638","1","","","2010-06-02 07:10:51","2","576","<p><strong>Description</strong>I have used the code tip from <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>   to copy a pre-filled data file to the target and handled this in a asynch task</p><p><strong>Problem :</strong> On starting the application it gives error and shuts down first time, starting again without any change it works perfectly fine.So first time after the file is copied, the error comes but after that no issues. Please help</p><p><em><strong>Code attached:..</em></strong></p><pre><code>private class CopyDatabase extends AsyncTask&lt;String, Void, Boolean&gt; {    private final ProgressDialog dialog = new ProgressDialog(BabyNames.this);    protected void onPreExecute() {        this.dialog.setMessage(""Loading..."");        this.dialog.show();    }    @Override    protected Boolean doInBackground(String... params) {        // TODO Auto-generated method stub        try {            namesDBSQLHelper.createDatabase();            return null;        } catch(IOException ioe){            ioe.printStackTrace();        }        return null;    }    protected void onPostExecute(final Boolean success){        if (this.dialog.isShowing()){            this.dialog.dismiss();        }    }}</code></pre>","356142","","102703","","2010-06-02 07:17:23","2011-05-18 07:02:16","Data not displayed first time in android after copying the file from assets to data folder","<database><android><asynchronous-processing><first-time><android-assets>","1","9","","",""
"2955705","1","2955802","","2010-06-02 07:22:01","2","2711","<p>How can I easily get date and time as integer values in Android?</p>","317301","","73488","","2010-10-04 11:18:53","2010-10-04 11:18:53","Getting simple date and time in android","<java><android><date><time>","2","2","1","",""
"2955787","1","2958607","","2010-06-02 07:36:25","1","240","<p>I'm developing an app that starts with a main menu, and then continues through three different steps (activities) to a final activity where the task is marked complete. On this last activity, i have several additional options (add note, share, etc..) and i also have a return to main menu button.</p><p>My question is.. how do i stack the activities so that calling finish() on the final activity will return back to the first activity launched? i am currently just starting the new activity via an intent, so pressing back on this screen doesn't return me to home as i would like.</p><p>Sorry in advance for being so convoluted in my desc</p>","350237","","","","","2010-06-02 17:42:49","Optimal Activity Stack Order for a Main Menu button?","<android>","2","0","1","",""
"2955831","1","2955841","","2010-06-02 07:46:15","4","602","<p>I am facing to android application signing problem. My application contains Google MapView.When I compile the app and run on the emulator, MapView works fine. But signed the app, MapView doesn't work. I've get Google Map API. This works on the simulator. </p><p>I could sign the app once 2 months ago. Then I've upgraded the app. Now I need to sign the app again.Actually I don't know why signed app's mapView doesn't work. How to fix it ? </p><p>Please advice.</p><p>I used following steps when sign the app:</p><ol><li>Run Eclipse.</li><li>Select the project. Right Click -> Android Tools -> Export Signed Application Package -> Then Filled forms. (In forms, Validity years: 200, and all passwords are same.)</li></ol><p>Can you suggest me ?</p><p>Thanks in advance.</p>","164589","","","","","2010-10-27 10:08:41","Google MapView doesn't work after signed the app","<android><android-widget>","1","0","","",""
"2955895","1","2974570","","2010-06-02 08:00:25","0","524","<p>I am developing an Android app, it will connect to the internet to load some data back.</p><p>I tested it with WIFI and it works well. But when I switched to use EDGE/GPRS, it always timed out, I have set a big timeout parameter for httpclient, but it did not help.</p><p>It may caused by the server side that it did not return back a Content-Length header. But I can not change the server code.</p><p>Anyone have experienced this before?</p>","238061","","238061","","2010-06-02 09:33:04","2010-06-04 13:30:16","Http request timed out only in GPRS/EDGE environment in Android phone","<android><http><httpclient>","1","0","","",""
"2956101","1","2957016","","2010-06-02 08:38:02","2","883","<p>i made a small test app with 2 screens. the first screen contains an EditText and a Button. The second screen is just a simple ListActivity showing 3 static items.The ListActivity is started when the user clicks the Button on the first screen or when the enter key was hit in the TextEdit. The weird thing is if the ListActivity was started by pressing the enter key in the EditText view, then the first list item is selected right after the startup. if it was started by hitting the button, everything is normal - no list item is selected.</p><p>that's the code that starts the ListActivity.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.startup);    final Button b = (Button)findViewById(R.id.but);    b.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            startList();        }    });    final EditText t = (EditText)findViewById(R.id.in_text);    t.setOnEditorActionListener(new OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            startList();            return true;        }    });}public void startList(){    Intent i = new Intent(this, TestList.class);    startActivity(i);}</code></pre><p>and this is the code of the ListActivity</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.list);        inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        String[] str = {""a"", ""b"", ""c""};        ListAdapter adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, str){            @Override            public View getView(int position, View convertView, ViewGroup parent) {                View row =                         null == convertView ?                         inflater.inflate(R.layout.list_item, null) :                         convertView;                String s = getItem(position);                TextView tvid = (TextView)row.findViewById(R.id.word_suggestion_item_text);                tvid.setText(s);                return row;            }        };        setListAdapter(adapter);    }</code></pre><p>any ideas why that happens?</p><p>Simon</p>","356224","","21234","","2010-06-25 13:21:26","2010-06-25 13:21:26","First list-item selected when starting listactivity from EditText event","<android><listview>","1","0","","",""
"2956357","1","2957306","","2010-06-02 09:22:14","0","63","<p>I'm trying to create a simple app, whose main task is to open the browser on defined URL.I've created first Activity:</p><pre><code>public class MyActivity extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);    Intent myIntent = new Intent(Intent.ACTION_VIEW,            Uri.parse(""http://my.url.tld""));    startActivity(myIntent);}</code></pre><p>Here's my AndroidManifest.xml:</p><pre><code>&lt;manifest ...&gt;    &lt;application ...&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;</code></pre><p>This code is fully functional, but before it opens the browser, it displays a black background - blank app GUI. I didn't figured out, how to go directly do the browser (without displaying the GUI).</p><p>Anyone knows?</p>","335717","","","","","2010-06-02 11:42:26","Android App - disappearance of app GUI","<android>","1","0","","",""
"2956470","1","","","2010-06-02 09:40:53","24","2253","<p>This code works on the plain google devices with native android system. But there is no MMS app in the list on htc sense devices and I don't know about Motorola Blur etc.:</p><pre><code>    final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);    emailIntent.setType(""image/png"");    emailIntent.putExtra(Intent.EXTRA_STREAM, uri);    context.startActivity(Intent.createChooser(emailIntent, context.getString(R.string.send_intent_name)));</code></pre><p>This code works on the htc sense but not from the Chooser, what I really need:</p><pre><code>    Intent sendIntent = new Intent(""android.intent.action.SEND_MSG"");    sendIntent.putExtra(Intent.EXTRA_STREAM, uri);    sendIntent.setType(""image/png"");    context.startActivity(sendIntent);</code></pre><p>But I don't know how to combine this code samples together and I don't know how to determine Htc Sense ui programmatically. Is it right way to support different type of devices?</p><p>Thank you for answers.</p>","227016","","","","","2013-03-06 22:49:30","Android: Is there a universal way to send the MMS on any android devices?","<android><android-intent><mms><htc><htcsense>","3","3","3","",""
"2956571","1","2957323","","2010-06-02 09:57:50","1","129","<p>I have working with email option. i can send the Email using the intent chooser method. by this i can get the default email compose window with the title of ""Compose"". i want to change and customize this. is there any possible to do the Feature_Custom_Title option for it? Any Idea? </p>","267269","","","","","2010-06-02 11:44:50","Custom Title for Email in Android?","<android><email>","1","0","","",""
"2956619","1","2959339","","2010-06-02 10:03:51","0","3135","<p>It is possible to connect simultaneously to multiple bluetooth devices?</p>","131897","","","","","2010-12-17 07:02:36","Android Bluetooth API connect to multiple devices at the same time","<android><bluetooth>","1","1","1","",""
"2956633","1","","","2010-06-02 10:06:06","6","6665","<p>I faced the problem updating/insertng contacts on Android 2.0+.There is no problem to insert a new contact when phone book is empty butwhen I did it 2nd time some fileds like TEL, EMAIL are doubled and tripped etc.but N, FN, ORG  are ok (one copy). </p><p>After getting and advice of other member this forum I updated a contact first and then ContentProviderResult[] returned uri's with null then I do an insert action and it wentok but after that I made an update and all contacts are aggregated into one - i got 1 contact insted 3 which existed in phone book. This one was damaged, the contact fields are randomly built.</p><p>I set Google account.</p><p>Code:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();  ops.add(ContentProviderOperation.newUpdate(ContactsContract.RawContacts.CONTENT_URI)    .withValue(RawContacts.AGGREGATION_MODE, RawContacts.AGGREGATION_MODE_DISABLED)    .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType)    .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName)    .build()); // add nameContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI);   builder.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0);   builder.withValue(ContactsContract.Data.MIMETYPE,     ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE);builder.withValue(ContactsContract.CommonDataKinds.StructuredName.PHONETIC_FAMILY_NAME, name);// phonesContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI);   builder.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0);   builder.withValue(ContactsContract.Data.MIMETYPE,     ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);   builder.withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneValue);   builder.withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType);   builder.withValue(ContactsContract.CommonDataKinds.Phone.LABEL, phoneLabel);            ops.add(builder.build());// emails ...// orgs ...try {  ContentProviderResult[]  result = mContentResolver.applyBatch(ContactsContract.AUTHORITY, ops);    }  } catch (Exception e) {   Log.e(LOG_TAG, ""Exception while contact updating: "" + e.getMessage());  }</code></pre><p>What is wrong in this solution ? How does work aggregation engine ?</p><p>I will be glad for help.</p><p>Bogus</p>","355268","","243782","","2010-06-02 10:20:14","2013-12-01 01:47:15","Using ContentProviderOperation to update and insert contacts","<android>","3","0","","",""
"2956647","1","2961345","","2010-06-02 10:08:00","7","10094","<p>How to do RSA encryption of byte array with base-64 encoded public key?</p><p>After reading the couple of articles( of google search ) on how to do RSA encryption in Java, found the following snippet </p><pre><code>public byte[] rsaEncrypt(byte[] data) {  PublicKey pubKey = readKeyFromFile(""/public.key"");  Cipher cipher = Cipher.getInstance(""RSA"");  cipher.init(Cipher.ENCRYPT_MODE, pubKey);  byte[] cipherData = cipher.doFinal(src);  return cipherData;}</code></pre><p>I have public key as a base64 encoded string (126 characters), How do i create 'PublicKey' with the encoded string and use it with Cipher.</p>","110024","","","","","2011-02-21 02:23:38","RSA encrypt with base64 encoded public key in Android","<java><android><rsa>","2","1","2","",""
"2956908","1","2956968","","2010-06-02 10:45:41","19","8529","<p>I'm planning to implement an Android application that requires a login screen.</p><p>If the user opens the activity something like this should happen:</p><ol><li>If user is logged in, goto 3</li><li>If user is not logged in open the login screen and perfom login</li><li>Show my application content</li></ol><p>So, what's the ""correct"" way of implementing a login?</p><ol><li>Implement a <code>StartActivity</code> that perfoms the check if the user is logged in, implement a <code>LoginActivity</code> that implements the logging and an <code>ApplicationActivity</code> that actually implements the application logics?</li><li>Implement just one Activity and handle the login by using multiple views which I show according to the application state?</li></ol><p>Are there any examples or tutorials for this scenario?</p>","2963863","","","","","2013-01-20 11:10:31","Android Login - Best implementation","<android><mobile><login>","4","1","8","",""
"2956982","1","","","2010-06-02 10:54:53","2","1890","<p>I have requirement like this- my activity contains some textviews at the top then the expandable list view in the middle and a button at the bottom. my problem is when i clicked on<br>expandable list view the expanded list get accommodated  in the space between button and expandable list view.  </p><p>I wanted expandable list view to get expanded full and button should move downward according to the contains of the expandable list view. And i have used scrollview as a main layout.<br>thank you</p>","356346","","243782","","2010-06-02 11:04:20","2013-06-04 11:53:10","ExpandableListView in Android","<android><expandablelistview>","4","1","1","",""
"2957041","1","","","2010-06-02 11:03:24","2","1216","<p>I have file on SD-CARD and my app using it as log file.Is it possible through the adb to watch file with all changes in real time?Like with <em>tail -f /sdcard/myfile.log</em> command.</p>","289488","","","","","2013-09-05 07:43:52","How I can simulate ""tail"" command for file on the Android file system?","<android>","2","0","","",""
"2957142","1","","","2010-06-02 11:20:34","7","2161","<p>I want to have a simple TextView with horizontal scrolling, I know that I use HorizontalScrollview for that and I want the text to be autoscrolled continuously. Is that possible?</p>","296395","","","","","2013-10-14 20:45:54","How to get a TextView in Android have Horizontal Scrolling and autoscrolled?","<android><textview><autoscroll><horizontalscrollview>","2","0","1","",""
"2957168","1","","","2010-06-02 11:25:04","2","2276","<p>One of my clients wants a code method that returns a boolean. True if the Android phone has hardware red/green call/hang up keys and false if it does not. </p><p>Sonething like this :</p><pre><code>public void keyFeedbackFromInput(KeyEvent event) {  if (event.getAction() == KeyEvent.ACTION_DOWN         &amp;&amp; (event.getFlags() &amp; KeyEvent.FLAG_VIRTUAL_HARD_KEY) != 0) {    // perform your logic here  }}</code></pre><p>But not in a key press event as in the code snippet above. He needs to determine this up front if a phone has physical red/green keys or virtual ones.</p><p>Is it possible and if yes can someone provide a code sample to achieve this?</p>","356365","","234938","","2010-06-02 12:13:14","2011-05-13 10:20:51","Programatically detect presence of hardware call/hang up keys","<android>","1","1","","",""
"2957172","1","","","2010-06-02 11:25:31","9","4293","<p>I need to implement a screen having around 1000 thumbnails. This screen should support gesture based scrolling as well as fast scrolling using a scrollbar with thumb. So if user want to move from page 1 to page 100 he can just drag the thumb and reach there.</p><p>But there is no such control in Android. There is seek bar but its look and feel is not similar to what I want. I also want to flick and swipe functionality which can be inherited using horizontalscrollbar. So i want to add functionality of horizontal scroolbar as well as of seekbar in my application.</p><p>But I am facing some issue to sync thumb position with swipe or flick event and also the seekbar thumb look and feel need to be modified. </p><p>Please suggest some clue.</p>","356367","","21234","","2010-06-02 11:26:07","2014-01-15 12:08:18","How to implement scrollbar with thumb for fast scrolling","<android><horizontal-scrolling>","2","1","5","",""
"2957287","1","2958541","","2010-06-02 11:39:51","2","4583","<p>I have an extended BaseAdapter in a ListActivity:</p><pre><code>private static class RequestAdapter extends BaseAdapter {</code></pre><p>and some handlers and runnables defined in it</p><pre><code>// Need handler for callbacks to the UI thread    final Handler mHandler = new Handler();    // Create runnable for posting    final Runnable mUpdateResults = new Runnable() {        public void run() {            loadAvatar();        }    };    protected static void loadAvatar() {        // TODO Auto-generated method stub        //ava.setImageBitmap(getImageBitmap(""URL""+pic));        buddyIcon.setImageBitmap(avatar);    }</code></pre><p>In the getView function of the Adapter, I'm getting the view like this:</p><pre><code>if (convertView == null) {            convertView = mInflater.inflate(R.layout.messageitem, null);            // Creates a ViewHolder and store references to the two children views            // we want to bind data to.            holder = new ViewHolder();            holder.username = (TextView) convertView.findViewById(R.id.username);            holder.date = (TextView) convertView.findViewById(R.id.dateValue);            holder.time = (TextView) convertView.findViewById(R.id.timeValue);            holder.notType = (TextView) convertView.findViewById(R.id.notType);            holder.newMsg = (ImageView) convertView.findViewById(R.id.newMsg);            holder.realUsername = (TextView) convertView.findViewById(R.id.realUsername);            holder.replied = (ImageView) convertView.findViewById(R.id.replied);            holder.msgID = (TextView) convertView.findViewById(R.id.msgID_fr);            holder.avatar = (ImageView) convertView.findViewById(R.id.buddyIcon);            holder.msgPreview = (TextView) convertView.findViewById(R.id.msgPreview);            convertView.setTag(holder);        } else {            // Get the ViewHolder back to get fast access to the TextView            // and the ImageView.            holder = (ViewHolder) convertView.getTag();        }</code></pre><p>and the image is getting loaded this way:</p><pre><code>Thread sepThread = new Thread() {                    public void run() {                        String ava;                        ava = request[8].replace(""."", ""_micro."");                        Log.e(""ava thread"",ava+"", username: ""+request[0]);                        avatar = getImageBitmap(URL+ava);                        buddyIcon = holder.avatar;                        mHandler.post(mUpdateResults);                        //holder.avatar.setImageBitmap(getImageBitmap(URL+ava));                    }                };                sepThread.start();</code></pre><p>Now, the problem I'm having is that if there are more items that need to display the same picture, not all of those pictures get displayed. When you scroll up and down the list maybe you end up filling all of them.</p><p>When I tried the commented out line (holder.avatar.setImageBitmap...) the app sometimes force closes with ""only the thread that created the view can request..."". But only sometimes.</p><p>Any idea how I can fix this? Either option.</p>","297616","","","","","2011-06-11 03:45:04","Web image loaded by thread in android","<android><image><list><multithreading><adapter>","3","2","0","",""
"2957606","1","2957835","","2010-06-02 12:23:40","3","973","<p>I have purchased an HTC Incredible and have dived into the world of android! Only to find myself totally confused about the API levels and backward compatibility.</p><p>My device runs the 2.1 OS, but I know that most of the devices out there run 1.5 or 1.6; and soon the 2.2 OS will be running on new devices. The SDK has gone through such enormous changes, that even constants have been renamed (from VIEW_ACTION to ACTION_VIEW for example). Methods have been added and removed (onPause replacing the earlier call, etc al).</p><p>So, If I want to write an application that will work from 1.6+, does that mean I have to install and write my code using the 1.6 API; then test on later versions? Or can I write using the 2.1 SDK and just set the minSDK level and not use ""new"" features?</p><p>I have never worked with an SDK that changes SO drastically from release to release! So I am not sure what to do....</p><p>I read through an article on the Android Development site(and this posting on stack overflow that references it: <a href=""http://stackoverflow.com/questions/2076150/should-a-legacy-android-application-be-rebuilt-using-sdk-2-1"">http://stackoverflow.com/questions/2076150/should-a-legacy-android-application-be-rebuilt-using-sdk-2-1</a>), but it was still not very clear to me.Any help would be appreciated</p>","335577","","","","","2010-06-02 12:57:48","Confused about Android API's and compatability","<android>","2","1","4","",""
"2957802","1","2957967","","2010-06-02 12:53:38","1","1700","<p>I've been implementing a number of custom-lists, all worked fine. Now I'm trying to add an EditText to the list's rows. The rows look like that:</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/tv_quest_listrow_categorical_text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:text=""blabla""        android:paddingLeft=""10dp""        android:minHeight=""48dp""        android:gravity=""center_vertical"" /&gt;    &lt;EditText android:id=""@+id/tv_quest_listrow_text""        android:layout_width=""60dp""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_centerVertical=""true""        android:layout_marginRight=""10dp""        android:gravity=""right|center_vertical""        android:singleLine=""true""        android:enabled=""false""        android:imeOptions=""actionDone"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>When constructing the list I set an ItemClickListener for the list with <code>listView.setOnItemClickListener(onItemClick);</code>. This <em>used to</em> work fine but fails as soon as there is an EditText in the list rows.</p><p>Does anyone have a hint on how to do this?</p><p>Regards,<br>Steff</p>","289849","","","","","2010-06-02 13:38:06","Custom list: EditText consumes list's OnItemClickListener","<android><listener><edittext><custom-lists>","2","2","","",""
"2957814","1","","","2010-06-02 12:54:59","2","236","<p>I am in the scope of a <code>RemoteService</code> on an APK, and I want to start another <code>RemoteService</code> which is on different APK. I can only know its service name at runtime.</p><p>How would I achieve that?</p>","273550","","119775","","2012-10-26 06:26:27","2013-12-09 08:49:34","Remote service , start remote serivce (on diffrent apk)","<android>","0","0","1","",""
"2957860","1","2958045","","2010-06-02 13:01:40","22","12836","<p>I want to add <strong><em>Pattern 6: QuickActions</em></strong> from <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"">android's blog</a> to my app.</p><p>Any code snippet?</p><p>Anyone try to do it already? </p><p>Should this work on android 1.5?</p>","119895","","","","","2012-03-18 08:17:26","QuickActions like the Twitter app","<android>","5","2","23","",""
"2958420","1","2959432","","2010-06-02 14:00:47","1","1464","<p>I have several Views in my Activity. I want to draw a Drawable over these views. The Drawable should be on top of the views (that means it hides the views below it.The Drawable may appear over several views (that is I can't just draw it in one view).How can this be done?</p><p>Thank you</p>","285174","","","","","2010-06-02 16:04:11","How to draw a Drawable over a View","<android><drawable>","2","0","","",""
"2958560","1","2959594","","2010-06-02 14:17:12","11","7655","<p>I am trying to learn how to do stuff in Android, and I'm not sure of the best way to build the interface.</p><p>I've been working on porting an iPhone app, which uses navigation controllers and table views for looking at the different sections: basically, someone touches a cell in the table, which drills down to another table. when they touch a cell on that table it drills down to a webview that displays the information. </p><p>I want to do something similar for the android app, but I don't know how, or if there is a better way native to Android. I've figured out how to use the webview to my purposes, but moving forward and backward in the table tree is unclear.</p>","356438","","","","","2012-11-19 07:21:46","Beginner: Best Practices in an Android App UI Navagation","<android>","4","0","12","",""
"2958701","1","","","2010-06-02 14:34:54","160","93890","<p>Can anybody please guide me regarding how to launch my android application from the android browser? </p>","356543","","948041","","2012-04-04 17:25:58","2014-04-10 12:07:17","Launch custom android application from android browser","<android>","9","1","128","",""
"2958719","1","2958992","","2010-06-02 14:37:06","0","655","<p>I want to have a view with several choices when I click an element of my ListView. I was thinking of implementing an AlertDialog but as I need more than 3 options it is not possible...I also thought of putting my ListView in a FrameLayout and have an view with a gone visibility that I would turn visible at the click and update the content but I don't know If it's a good idea.I could do with some advice,</p><p>Thanks for any idea.</p>","263521","","","","","2012-10-18 18:28:28","Add a view/activity on top of a ListView [Android]","<android><listview><subview>","3","1","","",""
"2958800","1","2959290","","2010-06-02 14:47:04","8","22589","<p>I have seen several examples of how to implement a BroadCastReceiver, but how should I implement a Service that has to react to some pending Intent (for example incoming phone call)...Actually I was wondering about the same ""problem"" but in an Activity..You obviously have a class which extends a Service or an Activity) so it cannot also extend BroadCastReceiver...It looks like we cannot make ""platform-aware"" services and/or Activties?</p>","162147","","910718","","2012-01-20 19:18:35","2012-01-20 19:18:35","Service and a BroadCastReceiver","<android><service><activity><broadcastreceiver>","3","0","9","",""
"2958897","1","2958918","","2010-06-02 14:57:57","1","195","<p>How to implement Multithreading in Android application so as to increase responsiveness of UI. ?</p>","218665","","","","","2010-06-02 19:07:40","mulithreading in android","<android><multithreading>","3","1","","",""
"2959022","1","","","2010-06-02 15:11:59","0","1990","<p>I'm appalled by the apparent lack of support for calling SOAP web services in Android. I've looked at ksoap2 libraries but getting them to work is like rocket science. Is there a way out? Has anyone got it working 100%?</p><p>Clearly, Google is not targeting Android as a business app platform. Good for tic-tac-toe and tiny little feel good apps.</p>","244353","","","","","2011-11-20 03:05:36","Android SOAP Web Services","<android><soap>","3","0","0","",""
"2959063","1","2959135","","2010-06-02 15:17:57","0","3027","<p>I have searched the net quite a bit and haven't found a single resource that can help me call my custom keyboard in my application. I am using the android/sdk examples/soft keyboard and have commented out the first row of keys in the qwerty.xml file for testing purposes.</p><p>I have tried making changes in the AndroidManifest.xml but still can't call my custom keyboard. Any help in this regard will be helpful.</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.artoo"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""Virtual Keyboard""&gt;  &lt;activity android:name="".MainActivity"" android:label=""Virtual Keyboard""   android:windowSoftInputMode=""adjustResize""&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;service android:name="".SoftKeyboard"" android:permission=""android.permission.BIND_INPUT_METHOD""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.view.InputMethod"" /&gt;   &lt;/intent-filter&gt;   &lt;meta-data android:name=""android.view.im"" android:resource=""@xml/method"" /&gt;  &lt;/service&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""4""&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt;</code></pre><p>Thanks for your help!</p>","356580","","","","","2010-06-02 15:27:39","Calling Custom Android Keyboard in my application","<android><keyboard>","1","0","1","",""
"2959201","1","2959919","","2010-06-02 15:35:48","1","1228","<p>I have a one-many relationship in my local Sqlite db. Pretty basic stuff. When I do my left outer join I get back results that look like this:</p><p>the resulting cursor has multiple rows that look like this:</p><pre><code>A1.id | A1.column1 | A1.column2 | B1.a_id_fk | B1.column1 | B1.column2 A1.id | A1.column1 | A1.column2 | B2.a_id_fk | B2.column1 | B2.column2 </code></pre><p>and so on...</p><p>Is there a standard practice or method of dealing with results like this ? Clearly there is only A1, but it has many B-n relationships. I am coming close to using multiple queries instead of the ""relational db way"". Hopefully I am just not aware of the better way to do things.</p><p>I intend to expose this query via a content provider and I would hate for all of the consumers to have to write the same aggregation logic. </p>","36285","","","","","2010-06-02 17:12:29","Dealing w/ Sqlite Join results in a cursor","<android><sqlite><join><cursor><android-contentprovider>","1","1","1","",""
"2959223","1","2959391","","2010-06-02 15:38:28","4","1257","<p>As of right now, in my app I have created a rudimentary gallery app using the provided widget, I need this to select a picture from the phone. This is working fine and everything, but lacking very much in presentation.</p><p>I've got a couple apps on my phone that do the same thing, but they somehow use the gallery that's already in the phone to let the user select an image. FourSquare, for example, when you select an image to use as your picture, it loads the gallery and asks you to select an image.</p><p>How is this possible? I've scoured the internet for the last couple and have come up empty handed.</p>","326468","","","","","2010-06-02 15:58:47","Android SDK - Reference the phone's gallery app?","<android><sdk><gallery>","1","0","2","",""
"2959288","1","6323735","","2010-06-02 15:46:32","3","2895","<p>My web service should be returning an integer, but every time i run the code i get the NullPointerException error.Any ideas or help would be very appreciated</p><p>Here's my code:</p><pre><code>public class CGCountTest extends Activity {    TextView testTV;    private static final String NAMESPACE = ""http://passport-america.com/webservices/"";    private static final String URL = ""http://localhost:11746/Service1.asmx"";    private static final String SOAP_ACTION = ""http://www.passport-america.com/webservices/getCGCount"";    private static final String METHOD_NAME = ""getCGCount"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.soap_test);          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);            SoapSerializationEnvelope envelope =                new SoapSerializationEnvelope(SoapEnvelope.VER11);                envelope.dotNet = true;                envelope.setOutputSoapObject(request);                HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);                try {                    androidHttpTransport.call(SOAP_ACTION, envelope);                    java.lang.Integer result = (Integer)envelope.getResponse();                    TextView testTV = (TextView)findViewById(R.id.testTV);                    result.toString();                    testTV.setText(result);                }                catch(Exception e)                {                    testTV.setText(e.getMessage());                }    }</code></pre><p>here's the logcat </p><pre><code>06-02 15:13:36.557: WARN/dalvikvm(326): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)06-02 15:13:36.557: ERROR/AndroidRuntime(326): Uncaught handler: thread main exiting due to uncaught exception06-02 15:13:36.876: ERROR/AndroidRuntime(326): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pa.passammain/com.pa.passammain.CGCountTest}: java.lang.NullPointerException06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.os.Handler.dispatchMessage(Handler.java:99)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.os.Looper.loop(Looper.java:123)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at java.lang.reflect.Method.invokeNative(Native Method)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at java.lang.reflect.Method.invoke(Method.java:521)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at dalvik.system.NativeStart.main(Native Method)06-02 15:13:36.876: ERROR/AndroidRuntime(326): Caused by: java.lang.NullPointerException06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at com.pa.passammain.CGCountTest.onCreate(CGCountTest.java:46)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-02 15:13:36.876: ERROR/AndroidRuntime(326):     ... 11 more</code></pre><p>i think my url string may be the problem, but i've tried using my ip with no luck</p>","356615","","828625","","2012-06-20 07:00:25","2012-06-20 07:00:25","NullPointerException when trying to connect to web service using kSoap method Android","<android><web-services><soap><ksoap2>","2","0","","",""
"2959316","1","4660576","","2010-06-02 15:50:03","64","67691","<p>I have a HTTP GET request that I am attempting to send. I tried adding the parameters to this request by first creating a <code>BasicHttpParams</code> object and adding the parameters to that object, then calling <code>setParams( basicHttpParms )</code> on my <code>HttpGet</code> object. This method fails. But if I manually add my parameters to my URL (i.e. append <code>?param1=value1&amp;param2=value2</code>) it succeeds.</p><p>I know I'm missing something here and any help would be greatly appreciated.</p><p>Thanks in advance,</p><p>groomsy</p>","349179","","617801","","2012-07-25 07:48:29","2014-02-05 17:19:08","How to add parameters to a HTTP GET request in Android?","<java><android><http-get>","5","1","27","",""
"2959448","1","","","2010-06-02 16:06:20","4","5019","<p>I am new to android.Can any one help me .how to create a list.example:List1by selecting list1I should get list1 items in sublist list1.1,list1.2....List2by selecting list2sublist items aslist2.1list2.2</p><p>Please help me.</p>","356632","","","","","2010-07-19 04:07:04","how to create list and sublist -android?","<android>","2","0","2","",""
"2959500","1","2967183","","2010-06-02 16:13:22","10","1717","<p>Failing JUnit tests, not breaking my Ant script like I expect?</p><p>My continuous integration server runs an Ant script, which calls something like:/tests/ant run-tests</p><p>My JUnit tests run, but with errors:run-tests:     [echo] run-tests-helper.     [echo] Running tests ...     [exec]     [exec] com.zedray.stuff.FooBarTest:....     [exec] com.zedray.stuff.FooBarTest:.....INSTRUMENTATION_RESULT: shortMsg=Some error in your code.     [exec] INSTRUMENTATION_RESULT: longMsg=java.security.InvalidParameterException: Some error in your code     [exec] INSTRUMENTATION_CODE: 0</p><p>The errors are OK, but my build script keeps going (eventually publishing my broken app to my testers - bad!).  What I would expect is for the instrimentaiton to throw a build error, so my continuous integration server (TeamCity in this case) realises that something has gone wrong and reports a broken build.  The ""failonerror"" is already set in the relevant macrodef, so I'm not sure what else I can do?</p>/tests/build.xml<p>                    Running tests ...                                                                                                                                         </p><p>Any ideas/suggestions on how to fix this?</p><p>RegardsMark</p>","356643","","","","","2012-09-25 14:53:26","Failing Android JUnit tests, not breaking my Ant script like I expect?","<android><ant><junit>","5","3","1","",""
"2959749","1","2959779","","2010-06-02 16:44:30","1","7194","<p>I'm looking to create a simple form with some textfields and a button using the Android SDK. Could someone point out a good example or tutorial for getting started?</p>","204317","","","","","2010-06-02 16:49:21","Example/tutorial for creating an input form using Android SDK","<android>","1","0","","",""
"2959820","1","2959849","","2010-06-02 16:58:33","32","19787","<p>How do you convert an existing project into an Android project in Eclipse?</p><p>In particular, I want to convert a plain old Java project into an Android Library project.</p><p>Thanks.</p>","143378","","","","","2013-08-03 08:29:21","Convert existing project into Android project in Eclipse?","<android><eclipse>","6","1","12","",""
"2959833","1","2962708","","2010-06-02 17:00:30","4","2966","<p>My app uses a WebView, and users sometimes adjust the zoom level to make the text larger. However the zoom level setting is lost when the Activity is closed and another one started. </p><p>I can't see how to get and set the zoom level programatically on WebView, can anyone suggest a way this could be done?</p>","82515","","","","","2012-02-17 16:43:37","WebView: how to preserve the user's zoom settings across sessions?","<android><webview>","3","0","2","",""
"2959941","1","2959968","","2010-06-02 17:14:39","3","910","<p>How can i define each menu item in different line?Right now if I'm adding 4 items they will get the form of 2X2. Is there a way to add them differently? Like 1 item and 3 below it? or 1X4 ?</p>","117196","","","","","2012-02-20 08:07:03","Android menu item separetor (menu item in different line)","<android><menu>","2","0","","",""
"2960009","1","","","2010-06-02 17:24:50","3","3610","<p>I am using MediaPlayer to play a video in my app. The video takes a while to buffer and the videoview is blank for that time. </p><p>Is there a way to start the buffering when the user is in the previous screen, so that when he comes to the video playing screen, the video is ready to play?</p><p>ThanksChris</p>","334802","","","","","2014-02-11 09:01:47","Android - Buffering in MediaPlayer","<android><media-player><buffering>","4","0","","",""
"2960015","1","3088120","","2010-06-02 17:26:12","11","10827","<p>In my android app I am getting ""database disk image is malformed""What are the reasons for getting this error?</p><p>not closed db? multiple threads accessing the db? or android just got corrupted? </p><p>Thanks</p><pre><code>android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed   android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)   android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)   android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:288)   android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:269)   android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)   android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)...</code></pre>","237115","","601868","","2012-02-15 14:10:50","2012-08-15 09:16:05","Android - database disk image is malformed","<database><android>","4","0","4","",""
"2960122","1","2980570","","2010-06-02 17:44:47","14","1462","<p>Does anyone know what approach one can take to automatically generate Java source code, from for example an xml or json file, in eclipse?</p><p>One great example of what I am thinking of doing is what Google Android sdk does: they have an R class generated automatically from the <a href=""http://developer.android.com/guide/topics/resources/available-resources.html"" rel=""nofollow"">resources</a>.</p><p>Every time a resource file is saved in Eclipse R class is automatically regenerated.</p><p>UPDATE: Example:In the text (xml or json file) I have the following:</p><pre><code> &lt;tags&gt;     &lt;tag id=""ALPHA""&gt;         &lt;description&gt;The first alpha tag.&lt;/description&gt;         &lt;value&gt;231232&lt;/value&gt;     &lt;/tag&gt;     &lt;tag id=""BETA""&gt;         &lt;description&gt;This is the beta tag.&lt;/description&gt;         &lt;value&gt;231232&lt;/value&gt;     &lt;/tag&gt;</code></pre><p>Then in my generated java class, say R I would have something like:</p><pre><code>R.tags.ids.ALPHA //refers to an enum value for exampleR.tags.values.ALPHA //refers to final int with avlue 231232R.tags.descriptions.ALPHA //refers to the String with description</code></pre><p>Thanks!</p>","74865","","74865","","2010-06-03 17:06:13","2010-10-16 17:09:48","Generate java code in Eclipse?","<java><android><eclipse><code-generation>","7","7","2","",""
"2960191","1","2960547","","2010-06-02 17:54:47","0","9439","<p>I'm trying to make an activity that is asked for some result. This result is normally returned instantly (in the onCreate), however, sometimes it is nesesary to wait for some internet-content to download which causes the ""loader""-activity to show. What I want is that the loader-activity don't display anything more than a progressdialog (and that you can still se the old activity calling the loader-activity in the background) and I'm wondering wheather or not this is possible.</p><p>The code I'm using as of now is:</p><pre><code>//ListComicsActivity.javapublic class ListComicsActivity extends Activity{    private static final int REQUEST_COMICS = 1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.list_comics);        Button button = (Button)findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener()        {            @Override            public void onClick(View v) {                Intent intent = new Intent();                intent.setAction(Intents.ACTION_GET_COMICS);                startActivityForResult(intent, REQUEST_COMICS);            }        });    }    /** Called when an activity called by using startActivityForResult finishes. */    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data)    {        Toast toast = Toast.makeText(this, ""The activity finnished"", Toast.LENGTH_SHORT);        toast.show();    }}//LoaderActivity.java (answers to Intents.ACTION_GET_COMICS action-filter)public class LoaderActivity extends Activity{    private Intent result = null;    private ProgressDialog pg = null;    private Runnable returner = new Runnable()    {        public void run()        {            if(pg != null)                pg.dismiss();            LoaderActivity.this.setResult(Activity.RESULT_OK, result);            LoaderActivity.this.finish();        }    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        String action = getIntent().getAction();        if(action.equals(Intents.ACTION_GET_COMICS))        {            Runnable loader = new Runnable()            {                public void run()                {                    WebProvider.DownloadComicList();                    Intent intent = new Intent();                    intent.setDataAndType(ComicContentProvider.COMIC_URI, ""vnd.android.cursor.dir/vnd.mymir.comic"");                    returnResult(intent);                }            };            pg = ProgressDialog.show(this, ""Downloading"", ""Please wait, retrieving data...."");            Thread thread = new Thread(null, loader, ""LoadComicList"");            thread.start();        }        else        {            setResult(Activity.RESULT_CANCELED);            finish();        }    }    private void returnResult(Intent intent)    {        result = intent;        runOnUiThread(returner);    }}</code></pre>","213323","","","","","2010-06-02 18:41:23","startActivityForResult to an activity that only displays a progressdialog","<android><activity><android-intent>","1","2","","",""
"2960229","1","","","2010-06-02 17:59:37","0","1039","<p>I am getting this error when trying to play certain mp4/3gp videos encoded as H.264/AVC.</p><p><code>06-02 08:46:38.262: ERROR/QCOmxcore(51): OMXCORE API :  Free Handle 586d4<br> 06-02 08:46:38.262: ERROR/QCOmxcore(51):  Unloading the dynamic library for OMX.qcom.video.decoder.avc<br>06-02 08:46:38.281: ERROR/PlayerDriver(51): Command PLAYER_PREPARE completed with an error or info PVMFErrNoResources<br>06-02 08:46:38.281: ERROR/MediaPlayer(1372): error (1, -15)<br>06-02 08:46:38.281: ERROR/MediaPlayer(1372): Error (1,-15)<br>06-02 08:46:38.281: DEBUG/VideoView(1372): Error: 1,-15<br>06-02 08:46:38.302: WARN/PlayerDriver(51): PVMFInfoErrorHandlingComplete</code></p><p>I have been successfully able to play a lot of other videos that are mp4/3gp of varying sizes, with the same code. Anyone know what exactly this error means?</p><p>ThanksChris</p>","334802","","334802","","2010-06-02 18:36:08","2011-01-26 09:57:25","Android - Mediaplayer error PVMFErrNoResources","<android><media-player>","1","2","1","",""
"2960286","1","","","2010-06-02 18:07:32","0","716","<p>Im trying to see working of ambient media player.</p><p>I checkout from url <a href=""https://ambientmp.svn.sourceforge.net/svnroot/ambientmp/Ambient/trunk"" rel=""nofollow"">https://ambientmp.svn.sourceforge.net/svnroot/ambientmp/Ambient/trunk</a>  to my eclipse work space. when build the app it is showing errors as </p><ul><li>Unbound classpath variable: 'M2_REPO/hotsax/hotsax/0.1/hotsax-0.1.jar' in project 'ambient'</li><li>Unbound classpath variable: 'M2_REPO/net/sf/entagged/entagged/0.31/entagged-0.31.jar' in project 'ambient'    </li></ul><p>please help me to resolve this problem.</p><p>Thanks  </p>","341443","","39321","","2011-03-28 11:44:26","2011-06-28 20:04:31","Configure ambient media player source code in my eclipse?","<android><android-emulator><android-widget>","2","0","","",""
"2960319","1","","","2010-06-02 18:12:11","3","3248","<p>I have implemented a routing protocol on an Android 1.6 mobile that uses wireless (ad-hoc) network in order to exchange messages. Now I would like to evaluate it under an energy consumption point of view, the base would be to try to calculate the energy wasted to transmit a single packet, do anybody has any idea how to do that? Software/hardware solutions are welcome! Thanx :)</p>","356751","","","","","2013-02-20 11:00:27","how to calculate power consumption on an Android mobile that uses wifi?","<android><mobile-phones><wifi><energy><consumption>","3","0","2","",""
"2960352","1","2960379","","2010-06-02 18:16:31","0","576","<p>I've written an Android app wich various abstract classes that perform useful functions. These functions could be leveraged in other apps.</p><p>I want to share a class module with another programmer, but I don't want to share the source code. I would like to share a .class file but I'm not sure how to do the following:</p><ul><li>Compile an Android .java file into .class</li><li>What does the receiver of the .class file have to do to use that .class in their project? (using Eclipse environment)</li></ul><p>Thank you very much</p>","268803","","","","","2010-06-02 18:24:26","Best way to package a class for use in another app?","<java><android>","2","0","","",""
"2960368","1","2960689","","2010-06-02 18:19:17","0","1764","<p>I need to rely on external app (Barcode scanner in my case). The eclipse emulator crashes when I try to download it from within the emulator itself. </p><ul><li>Is there a way to download it using the emulator?</li><li>Or Is there a way to directly install the APK and make it available for my application?</li></ul>","82368","","82368","","2010-06-02 18:28:59","2010-06-02 18:55:21","How do I Install external APKs necessary for my app in the Eclipse ADT?","<android><install><apk><external-application>","2","0","1","",""
"2960425","1","","","2010-06-02 18:25:49","6","7434","<p>I have problems getting the HTML code of a website by using this example code.</p><p><a href=""http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java"">http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java</a></p><p>I have to use the above one, as I need preemptive authentication for my application in Android.</p><p>I thought the solution might be the httpget object, but I still get only errors :(c.f. HttpGet httpget = new HttpGet(""/index.html"");</p><p>Does anybody have an idea how to get the content of the file, which is specified in the httpget object above using the example code of the link. It definitely called, but for now I can only get status code and so on ...</p><p>Thanks 4 help</p>","331556","","12388","","2010-09-25 16:42:28","2012-06-07 13:00:27","Android httpclient - getting a file with preemptive authentication","<android><httpclient>","4","0","3","",""
"2960459","1","","","2010-06-02 18:32:07","2","3972","<p>I got an app with tabs and a notification bar entry,when I send it to background (click on home button)and try to re-open the application via click on the notification bar, the app restarts (last selectedtab is lost).</p><p>When I hold the home button if the application is in the background and select it from there or click theapp's icon on the homescreen, the previous state isrestored per default (the correct tab is selected)</p><p>IMO the intent of the notification is wrong, but I'mnot sure how to fix it.</p><p>In short: How to get a background application back to foreground when I click the notification entry?</p><p>thx!</p>","356764","","","","","2013-06-17 12:13:18","re-open background application via notification item","<android><background><notifications>","5","1","2","",""
"2960632","1","","","2010-06-02 18:50:01","0","1228","<p>I am using a TabWidget that contains a List in one tab. What I want to do is when a user selects an item, a webview is shown in that tab. </p><p>If the user then wants to go back to the list, they would click on the list tab.</p><p>I can get the webview up that replaces the whole tabwidget but don't know how to leave the tabs and show a webview.</p><p>Any help greatly appreciated</p>","356786","","","","","2010-06-05 21:44:50","Android - show webview in same tab containing a list","<android>","1","2","","",""
"2960646","1","2960752","","2010-06-02 18:51:34","2","1399","<p>Check out this image</p><p><img src=""http://img534.imageshack.us/img534/2193/pickaction.png"" alt=""alt text""></p><p>How do I create such a dialog? Having 2 line subtitle and three distinctive buttons.</p>","243782","","","","","2010-06-02 19:03:13","How to create dialog with custom subtitle and some buttons","<android><dialog>","1","0","1","",""
"2960888","1","2961157","","2010-06-02 19:20:51","0","1691","<p>I need a way to detect if this is the first time the user is ever opening the application, if so, start an activity. Then all previous application launches wouldn't start that activity.  I've read in a few places about using preferences to accomplish this. Anyone got any ideas?</p>","356615","","","","","2013-08-14 12:22:21","Launch an activity only the first time the application starts","<android>","3","1","","",""
"2960915","1","","","2010-06-02 19:24:18","0","4073","<p>I've posted a bigger chunk of the code  below.  You can see that initially QUOTE was procedural- coded in place.  I'm trying to learn how to use declarative design so I want to do the same thing  but  by using resources.  It seems like I need to access the string.xml thru the @R.id tag and identify QUOTE with that string value.   But I don't know enough to negotiate this.  Any tips?  Thanks!</p><p>public class circle extends Activity {   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(new GraphicsView(this));   }</p><p>static public class GraphicsView extends View {</p><pre><code>  //private static final String QUOTE = ""Happy Birthday to David."";   private final String QUOTE = getString(R.string.quote);</code></pre><p>.....      @Override      protected void onDraw(Canvas canvas) {         // Drawing commands go here</p><pre><code>     canvas.drawPath(circle, cPaint);     canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint);</code></pre>","356812","","356812","","2010-06-02 23:02:28","2014-01-03 15:26:30","Syntax error on token ""QUOTE"", VariableDeclaratorId expected after this token","<android>","1","0","","",""
"2960971","1","","","2010-06-02 19:31:27","1","235","<p>I have an app that creates a new data entry in a sqlite db with several columns. I would like to have a simple <em>share</em> button on the final activity so they can share the results (or even a simple text field) with apps that accept it (email, mms, twitter, etc..).</p><p>I did some reading on ContentProviders but the more I read, the more I'm thinking i'm heading down the wrong path. Any help is appreciated.</p><p>Thanks!</p>","350237","","","","","2010-08-28 17:35:53","How can i share data/text with other apps that will accept it?","<android>","2","0","","",""
"2960981","1","2961009","","2010-06-02 19:33:04","2","3089","<p>I'm trying to get a character count of an EditText. I've looked into different properties of the EditText and TextView classes, but there doesn't seem to be a function that returns the amount of characters. I have tried to use the TextWatcher, but that is not ideal since sometimes I load a saved message into the EditText from the preferences, and TextWatcher does not count characters not typed right then.</p><p>Any help would be great! </p><p>Cheers!</p>","253567","","41956","","2011-11-21 13:58:28","2013-03-14 18:36:09","Getting character count of EditText","<java><android><edittext>","2","0","1","",""
"2961049","1","3020898","","2010-06-02 19:42:01","224","39677","<p>Please Help me compile a list of Effective Android Programming techniques</p><ol><li><p><strong>Don't forget to free resources after use</strong>.<br> Lot of resources like Cursors are overlooked. Free them too.</p></li><li><p><strong>Don't Use magic Numbers.</strong><br>values[0] is meaningless. The framework provides very useful accessors like <code>values[SensorManager.DATA_X]</code></p></li></ol><hr><ol><li><p>""Make use of <strong>onPause()/onResume</strong> to save or close what does not need to be opened the whole time.""</p><pre><code>protected void onResume() {mSensorManager.registerListener(...);}protected void onStop() {  mSensorManager.unregisterListener(...);  super.onStop();}</code></pre></li><li><p><a href=""http://www.youtube.com/watch?v=N6YdwzAvwOA"">Make your Android UI Fast and Efficient</a> from the Google I/O has a lot of useful UI Performance tips.</p></li></ol>","82368","","1228","","2013-07-18 18:04:00","2014-02-13 11:11:35","Effective Android Programming Techniques","<android>","9","3","371","2012-03-04 05:33:41","2010-06-02 19:42:01"
"2961083","1","","","2010-06-02 19:47:28","1","194","<p>I am creating a program which requires me to change a setting in the program when the video reaches specific points (at 1/3 of the video's completion, 2/3's and on completion). Android has a built in callback method for completion so performing an action at that point in time is not difficult. However, I don't know how to go about checking when the video has reached 1/3 and 2/3's of completion.</p>","356832","","","","","2010-09-18 02:49:35","How can I perform an action at a certain point in time during a video in Android?","<android><video><callback><playing>","1","0","2","",""
"2961154","1","2961559","","2010-06-02 19:58:32","5","3784","<p>I have a horizontal <code>LinearLayout</code> and in it I have <code>EditText</code> and <code>Spinner</code> elements.Which attributes I need to adjust so I would get proportional widths: I want <code>EditText</code> to take 3/5 and <code>Spinner</code> - 2/5 of all available width?</p><p>My code looks like this:</p><pre><code>&lt;LinearLayout     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""     android:id=""@+id/LinearLayout01""&gt;    &lt;EditText         android:layout_height=""wrap_content""         android:id=""@+id/EditText01""         android:singleLine=""true""&gt;    &lt;/EditText&gt;    &lt;Spinner         android:layout_height=""wrap_content""         android:id=""@+id/Spinner01""         android:layout_width=""wrap_content""&gt;    &lt;/Spinner&gt;&lt;/LinearLayout&gt;</code></pre><p>I tried setting <code>android:layout_weight</code>, but somehow it does not look ""stable"" enough for me - when <code>EditText</code> has no text - everything looks fine, but as soon as I start entering text into it - it starts expanding and <code>Spinner</code> shrinking accordingly...</p>","283037","","283037","","2010-06-02 20:07:58","2010-06-02 21:02:11","Proportional width of elements in LinearLayout","<android><layout><android-linearlayout>","2","0","0","",""
"2961275","1","2962154","","2010-06-02 20:15:42","2","4074","<p>Currently I am trying to place a MapView within a ListView.  Has anyone had any success with this?  Is it even possible?  Here is my code:</p><pre><code>            ListView myList = (ListView) findViewById(android.R.id.list);        List&lt;Map&lt;String, Object&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();        Map&lt;String, Object&gt; curGroupMap = new HashMap&lt;String, Object&gt;();        groupData.add(curGroupMap);        curGroupMap.put(""ICON"", R.drawable.back_icon);        curGroupMap.put(""NAME"",""Go Back"");        curGroupMap.put(""VALUE"",""By clicking here"");        Iterator it = data.entrySet().iterator();        while (it.hasNext())         {            //Get the key name and value for it            Map.Entry pair = (Map.Entry)it.next();            String keyName = (String) pair.getKey();            String value = pair.getValue().toString();            if (value != null)            {                //Add the parents -- aka main categories                curGroupMap = new HashMap&lt;String, Object&gt;();                groupData.add(curGroupMap);                //Push the correct Icon                if (keyName.equalsIgnoreCase(""Phone""))                    curGroupMap.put(""ICON"", R.drawable.phone_icon);                else if (keyName.equalsIgnoreCase(""Housing""))                    curGroupMap.put(""ICON"", R.drawable.house_icon);                else if (keyName.equalsIgnoreCase(""Website""))                    curGroupMap.put(""ICON"", R.drawable.web_icon);                else if (keyName.equalsIgnoreCase(""Area Snapshot""))                    curGroupMap.put(""ICON"", R.drawable.camera_icon);                else if (keyName.equalsIgnoreCase(""Overview""))                    curGroupMap.put(""ICON"", R.drawable.overview_icon);                  else if (keyName.equalsIgnoreCase(""Location""))                    curGroupMap.put(""ICON"", R.drawable.map_icon);                else                    curGroupMap.put(""ICON"", R.drawable.icon);                //Pop on the Name and Value                curGroupMap.put(""NAME"", keyName);                curGroupMap.put(""VALUE"", value);            }        }        curGroupMap = new HashMap&lt;String, Object&gt;();        groupData.add(curGroupMap);        curGroupMap.put(""ICON"", R.drawable.back_icon);        curGroupMap.put(""NAME"",""Go Back"");        curGroupMap.put(""VALUE"",""By clicking here"");        //Set up adapter        mAdapter = new SimpleAdapter(                mContext,                groupData,                R.layout.exp_list_parent,                new String[] { ""ICON"", ""NAME"", ""VALUE"" },                new int[] { R.id.photoAlbumImg, R.id.rowText1, R.id.rowText2  }        );        myList.setAdapter(mAdapter); //Bind the adapter to the list </code></pre><p>Thanks in advance for your help!!</p>","351338","","","","","2012-10-29 22:21:13","Android - MapView contained within a Listview","<android><listview><android-mapview>","4","4","0","",""
"2961397","1","","","2010-06-02 20:36:02","0","405","<p>Is it possible to use AdapterView with text fields in android?</p><p>My query returns a set of values and for each I want to place that within a textfield, so that the user may edit the value.</p><p>Also, I want to click a button to create a new empty field, so that I may insert a new entry.</p><p>If you know of good example, then please let me know!</p><p><strong>EDIT 1</strong></p><p>I would prefer to use XML to define ui and I found this informations:</p><p>""In this case we create a new id called text1. The + after the @ in the id string indicates that the id should be automatically created as a resource if it does not already exist, so we are defining text1 on the fly and then using it."" Source <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a></p><p>Will this + allow me to autocreate as many fields as needed?  Is there a way I can generically specify the layout in XML and then create fields adhoc based on db response?</p><p>Many thanks,</p><p>Mith</p>","262894","","932225","","2012-07-13 09:30:27","2012-07-13 09:30:27","Using text field with AdapterView","<android><gui><user-interface><android-adapterview>","1","0","","",""
"2961460","1","","","2010-06-02 20:44:06","12","7067","<p>I have a native Android 2.1 application that hosts a web view.  I load up a site that contains javascript that uses the LocalStorage feature.  When the application is running localStorage works fine.  When some users exit the application and restart it, all the values are gone.  I'm not seeing this problem in my Motrola Droid or Sprint EVO, but there is a report of users in the field with this issue.</p><p>Does anyone know what I am missing?  I'm setting the following flag to true.</p><pre><code>settings.setDomStorageEnabled(true);</code></pre>","2723","","","","","2014-04-02 06:31:27","My Android HTML application is losing values stored in localStorage when it shuts down. Anyone else see this issue?","<android><webview><local-storage>","6","8","5","",""
"2961749","1","","","2010-06-02 21:30:33","8","36593","<p>I want media controls such as play/pause for streaming audio that I am playing in my app. I am using MediaPlayer to stream and play the audio. </p><p>Can someone provide a code snippet on how to use MediaController with MediaPlayer? </p><p>ThanksChris</p>","334802","","","","","2011-07-29 06:52:53","MediaController with MediaPlayer","<android><controller><media-player>","4","0","12","",""
"2961777","1","2968227","","2010-06-02 21:36:03","23","15352","<p>Is there a property to set for Android's LinearLayout that will enable it to properly wrap child controls?</p><p>Meaning - I have changeable number of children and would like to lay out them horizontally like:</p><pre>Example: Control1, Control2, Control3, ...</pre><p>I do that by setting:</p><pre>ll.setOrientation(LinearLayout.HORIZONTAL);foreach (Child c in children)  ll.addView(c);</pre><p>However, if I have large number of children, last one gets cuts off, instead of going to next line.</p><p>Any idea how this can be fixed?</p>","237858","","","","","2012-09-19 10:39:43","Android - LinearLayout Horizontal with wrapping children","<android>","4","0","10","",""
"2961833","1","","","2010-06-02 21:43:03","6","15229","<p>I am followin the method described <a href=""http://stackoverflow.com/questions/460418/best-way-to-show-a-edit-text-over-screen/460556#460556"">here</a> to create an EditText input activity. But the view doesn't fill the width of the screen. How can I tell to fit the screen width?</p><p><img src=""http://img405.imageshack.us/img405/5057/activitythemed.png"" alt=""alt text""></p><pre><code>&lt;activity android:name=""TextEntryActivity""           android:label=""My Activity""           android:theme=""@android:style/Theme.Dialog""/&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:layout_width=""fill_parent""    android:orientation=""vertical""    android:gravity=""right""    android:layout_height=""wrap_content""&gt;    &lt;EditText        android:text=""@+id/txtValue""        android:id=""@+id/txtValue""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;    &lt;Button        android:text=""Done""        android:id=""@+id/btnDone""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","243782","","","","","2011-03-20 04:22:44","How to set a dialog themed activity width to screen width?","<android>","3","0","2","2013-07-26 02:06:24",""
"2961881","1","2962178","","2010-06-02 21:52:52","0","172","<p>It is my first time building an android app. Was wondering firstly, if there are demos that exists which could help me to build a media tag editor (form to edit mp3 files). I would also like to know how to populate the sd card on the emulator.Any help on android would be good. Thanks all!</p>","236988","","","","","2010-06-02 22:50:30","android tag editor","<android><mobile>","1","0","","",""
"2961919","1","","","2010-06-02 21:59:58","0","205","<p>I downloaded the emulator and followed the steps on the android website on how to install the SDK. i made an AVD and everything showed up on my computer screen perfectly, but now the problem was installing it to my phone. i can't find the instructions the android website on how to install it on my device.</p>","356916","","","","","2010-06-03 10:37:05","How do I install a platform into my android device?","<android>","3","0","","",""
"2961977","1","2962072","","2010-06-02 22:07:33","3","9662","<p>I am trying to create an app with some menus, an I am following the basic example available in the official android site:</p><p><a href=""http://developer.android.com/guide/topics/ui/menus.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/menus.html</a></p><p>My problems appear when I define the menu in the XML. After creating the folder res/menu and creating the menu_option.xml file from eclipse.... The project (in general) gives an error that can be read from the Problems tab:</p><p><pre><code> Unparsed aapt error(s)! Check the console for outputAndroid Packaging Problem</pre></code></p><p>So, changing to the Console tab to get more information about the problem, this can be read:</p><p><pre><code> [2010-06-02 11:35:54 - TestAudio] Error in an XML file: aborting build.[2010-06-02 11:35:54 - TestAudio] W/ResourceType(11566): Bad XML block: header size 63327 or total size -144759824 is larger than data size 0[2010-06-02 11:35:54 - TestAudio] /home/User/workspace/TestAudio/res/menu/options_menu.xml:1: error: Error parsing XML: no element found</pre></code></p><p>The strange thing is that eclipse recognizes the menu items that I've defined in the XML,I can reference them in the code with no problems and my main activity builds. (and the rest of the files too).</p><p>Could it be that when eclipse creates a file, for some reason, the Android SDK has problems to read it, or something similar??</p><p>The XML code is exactly the same as the one in the example, so I don't really know what is happening. The code in options_menu.xml is this:</p><pre>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android"">    &lt;item android:id=""@+id/new_game""          android:title=""New Game"" />    &lt;item android:id=""@+id/quit""          android:title=""Quit"" />&lt;/menu></pre><p>Thanks in advance for your help!</p>","353261","","353261","","2010-06-02 22:19:44","2010-06-02 22:25:49","XML problem in the basic menu example","<xml><android><menu>","1","2","","",""
"2962045","1","2962092","","2010-06-02 22:19:28","4","5882","<p>I recently started using eclipse and an AVD emulator to develop android apps for a droid.  Everything is going fine, except when i type in the emulator it returns chinese characters.  My location is set to en-us, so not sure what is going on.</p><p>Any thoughts?</p>","356931","","286595","","2010-06-02 22:39:04","2013-01-30 04:02:25","Android Emulator Has Chinese Characters","<android><android-emulator>","2","2","","",""
"2962138","1","2962197","","2010-06-02 22:42:40","0","72","<p>I know its easy to do this with Eclipse but i dont have that. can someone please tell me how to do this step by step on Windows??</p>","356916","","","","","2010-06-02 22:55:26","How do I install a platform into my android device using Windows not Eclipse?","<android>","1","1","","",""
"2962452","1","2962477","","2010-06-02 23:51:41","0","699","<p>I have created some contacts data in the emulator. When I run the ContactManager sample app downloaded from the Android site, I get an error. Specifically, when trying to add a Contact through the app, I get a NullPointerException.   </p><p>I think it is because the ""Target Accounts"" spinner on the scree is not getting populated, and hence I cannot select a Target Account before adding a contact.   </p><p>Has anyone run across this problem or has any clues on how to fix this?</p>","289918","","","","","2011-11-19 16:47:24","Getting error using ContactManager Sample","<android>","1","1","","",""
"2962682","1","","","2010-06-03 00:53:51","0","216","<p>I need to have a linear Layout whose height is wrap_content, but how can I specify a child of this linear layout to stretch to its parent?</p><p>I tried                     ... some other children ...                </p><p>But this does not work.  The image does not scretch.</p>","286802","","","","","2011-09-16 05:54:57","Need help with an android layout question","<android>","3","0","","",""
"2962745","1","","","2010-06-03 01:11:36","3","284","<p>I read this quote in one of the webpages:</p><blockquote>  <p>If you are writing a large  application, consider dividing it into  a suite of applications and services.  Smaller applications load faster and  use fewer resources. Making a suite of  applications, content providers, and  services makes your code more open to  incorporation into other applications  as described the ""Use and be used""  tip.</p></blockquote><p>Is this true? What is the thumb rule for the size of app?</p>","82368","","","","","2012-02-08 13:07:44","Android Performance Question : Many small apps or one big app?","<android><performance>","2","0","2","",""
"2962813","1","","","2010-06-03 01:34:29","0","281","<p>I'm looking to create AVDs to test my apps on, and i'm trying to figure out the correct settings for a square screen such as the new Motorola Flip Out.  I don't see a wikipedia article for it, or many specs...</p><p>On a related note, what about tablets? Actually.. Why aren't there a set of AVD instances with params from popular devices.. or at least a site that lists them for each of the 60+ devices.</p><p>Thanks in advance :)</p>","350237","","","","","2011-06-10 16:07:05","AVD properties for Motorola Flipout?","<android><android-emulator>","2","2","","",""
"2962846","1","2962864","","2010-06-03 01:44:09","0","1349","<p>I thought I could use the <code>position</code> <code>int</code>, but when I click on the item in the list view, nothing happens. Please help!</p><pre><code>ListView d = (ListView) findViewById(R.id.apo); ArrayAdapter adapt = ArrayAdapter.createFromResource(this,  R.array.algebra, android.R.layout.simple_list_item_1); d.setAdapter(adapt); d.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view,      int position, long id) {        if (position == '0') {            Intent intent = new Intent(Algebra.this, Alqv.class);            startActivity(intent);        }        if (position == '2') {            Intent intent1 = new Intent(Algebra.this, qfs.class);            startActivity(intent1);        }    });}</code></pre>","357032","","234938","","2010-06-03 10:54:03","2012-11-13 04:57:39","How do I get the value of the item selected in ListView?","<android><listview><activity><android-intent><selecteditem>","2","0","0","",""
"2962881","1","2963036","","2010-06-03 01:55:25","0","606","<p>So I'm trying to build a tabs view for an Android app, and for some reason I get a force close every time I try to run it on the emulator. When I run the examples, everything shows fine, so I went as far as to just about copy most of the layout from the examples(a mix of Tabs2.java and Tabs3.java), but for some reason it still wont run, any ideas?</p><p>Here is my code(List1.class is a copy from the examples for testing purposes). It all compiles fine, just gets a force close the second it starts:</p><pre><code>package com.jvavrik.gcm;import android.app.TabActivity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.TabHost;import android.widget.TextView;public class GCM extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final TabHost tabHost = getTabHost();        tabHost.addTab(tabHost.newTabSpec(""tab1"")                .setIndicator(""g"", getResources().getDrawable(R.drawable.star_big_on))                .setContent(new Intent(this, List1.class)));        tabHost.addTab(tabHost.newTabSpec(""tab2"")                .setIndicator(""C"")                .setContent(new Intent(this, List1.class))                );        tabHost.addTab(tabHost.newTabSpec(""tab3"")                .setIndicator(""S"")                .setContent(new Intent(this, List1.class))                );        tabHost.addTab(tabHost.newTabSpec(""tab4"")                .setIndicator(""A"")                .setContent(new Intent(this, List1.class))                );    }}</code></pre>","325400","","325400","","2010-06-03 02:00:44","2010-06-03 07:56:46","Android: Help with tabs view","<java><android>","2","0","","",""
"2963152","1","2964068","","2010-06-03 03:28:32","54","78668","<p>I am coding a custom view, extended from RelativeLayout, and I want to resize it programmatically, How can I do?</p><p>the custom view Class is something like:</p><pre><code>public ActiveSlideView(Context context, AttributeSet attr){        super(context, attr);        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        if(inflater != null){                   inflater.inflate(R.layout.active_slide, this);        }</code></pre>","354459","","","","","2013-03-27 14:20:49","Android: How to resize a custom view programmatically?","<android><resize>","4","0","20","",""
"2963161","1","2969281","","2010-06-03 03:31:30","4","1416","<p>I was looking for an API to send incoming calls to voicemail. </p><p>I know this can be done using the Contact app that comes with any Android phones. But is there an API for this? </p>","331916","","","","","2010-09-30 16:28:26","Is there an API to send calls to voicemail in Android?","<android>","2","0","0","",""
"2963198","1","2963623","","2010-06-03 03:39:59","0","2740","<p>I want to use a custom media controller in my Android app and therefore looking at the vidtry code (<a href=""http://github.com/commonsguy/vidtry"" rel=""nofollow"">http://github.com/commonsguy/vidtry</a>), especially Player.java:</p><p>The sample works fine as it comes. But I want the sample to play the fixed video automatically on app startup (so I don't want to enter a URL).I added:</p><pre><code> @Override public void onResume() {  super.onResume();   address.setText(""/sdcard/mydata/category/1/video_agkkr6me.mp4"");  go.setEnabled(true);  onGo.onClick(go);   }</code></pre><p>Strange thing here is that if I run the app, the audio of the video plays but the image doesn't show. Everything else works fine (progress bar, etc.). I can't figure out the difference between the manual click on the go-button and the programmatic one. I looked at the code and didn't see any difference that might occur between manual and programmatic click.</p><p>I checked if any elements (esp. surface) might be hidden, but it's not. I even tried a </p><pre><code>surface.setVisibility(View.INVISIBLE);surface.setVisibility(View.VISIBLE);</code></pre><p>in case of some issue with the redrawing, but no difference.</p><p>The video image does show when I manually hit the go button, but just not on start up automatically.</p>","241475","","241475","","2010-06-16 06:12:18","2010-06-16 06:14:18","Android custom media controller using vidtry","<android><android-video-player>","1","0","2","",""
"2963312","1","","","2010-06-03 04:26:17","1","322","<p>I am trying to make a sniper style game where the user looks through a scope to see a large image that he can navigate.  The user can only see part of the image at a time.  The image is supposed to be much larger than the screen size that way he has to actually navigate and look for the enemy.  How do I use an image that is larger than the screen that the user can navigate?</p><p>It is kind of like when you are zoomed in to an image and you can pan the image and move it around to see different parts.</p>","349451","","","","","2010-06-03 22:27:54","Android 2.1 How to create sniper style game","<java><android>","1","0","","",""
"2963414","1","","","2010-06-03 05:01:05","2","1903","<p>I need to create two views programmatically (because I need to access the ondraw of one of the views).  For some reason, no matter what I do to add the views to the contentview, they don't show up vertically stacked, one below the other.</p><p>I can do it just fine using the XML using a RelativeLayout and layout positioning, but with the XML I can't create a view object and overload the ondraw method.</p><p>What am I doing wrong with the programmatic approach, and how do I solve this problem?</p><pre><code>LinearLayout mLinearLayout;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Create a LinearLayout in which to add the ImageView        mLinearLayout = new LinearLayout(this);        TextView tv = new TextView(this);            tv.setBackgroundColor(0xff333333);        tv.setText(""Enter your member number:"");        tv.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));        DrawableView i = new DrawableView(this);        i.layout(0,40,0,0);        i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT));        mLinearLayout.addView(tv);        mLinearLayout.addView(i,300,300);        setContentView(mLinearLayout);    }</code></pre>","357119","","","","","2011-10-18 12:59:16","Help with Android LinearLayout or RelativeLayout","<android><android-linearlayout><layout><relativelayout>","3","0","","",""
"2963430","1","","","2010-06-03 05:07:13","0","40","<p>Here's the problem I'm facing : I've got a custom slider that controlls the volume and a label ""volume"" that I combine together in a liniar Layout to obtain a volume control setting. In the emulator and on a G1 phone these look pretty ok , however , when put on a Xperia mini the label and the slider overlap . What should I do obtain a decent view independent of the device the application runs ?</p>","284609","","","","","2010-06-03 05:37:19","Overllaping view elements","<android>","1","0","","",""
"2963578","1","","","2010-06-03 05:48:48","3","600","<p>How to add bubble counter on tabs in an Android application? Same has been done by eBuddy Android application.</p>","278194","","","","","2011-01-26 03:57:57","How to add bubble counter on tabs in an Android application?","<android>","1","2","","",""
"2963609","1","","","2010-06-03 05:58:39","1","84","<p>I want one sample code for startActivityForResult().Please explain how it works?</p>","323062","","759866","","2013-12-28 21:17:41","2013-12-28 21:17:41","How to receive data from activity in android?","<android>","1","0","","",""
"2963705","1","3142479","","2010-06-03 06:20:55","8","13623","<p>I've been having issues with this for far too long.  This code should output dx,dy,dz for the accelerometer, and a running total of the dx.  It should also output azimuth, pitch, and roll.</p><p><a href=""http://stackoverflow.com/questions/2858255/need-to-calculate-rotation-vector-from-sensor-type-orientation-data/2858307#2858307"">I've used the information given here</a>, but to no avail.</p><p>This code does not correctly output pitch, azimuth, or roll.  It outputs 0.0, -0.0, -0.0 for the last three textviews, respectively.    </p><pre><code>switch (event.sensor.getType()) {    case Sensor.TYPE_ACCELEROMETER:        accelerometerValues = event.values.clone();    case Sensor.TYPE_MAGNETIC_FIELD:        geomagneticMatrix = event.values.clone();        sensorReady = true;        break;    default:        break;}   if (geomagneticMatrix != null &amp;&amp; accelerometerValues != null &amp;&amp; sensorReady) {    sensorReady = false;    float[] R = new float[16];    float[] I = new float[16];    SensorManager.getRotationMatrix(R, I, accelerometerValues, geomagneticMatrix);    float[] actual_orientation = new float[3];    SensorManager.getOrientation(R, actual_orientation);    tvXCoordinate.setText(accelerometerValues[0] + """");    tvYCoordinate.setText(accelerometerValues[1] + """");    tvZCoordinate.setText(accelerometerValues[2] + """");    floatXTotal += accelerometerValues[0];    tvXTotal.setText(floatXTotal + """");    tvAzimuth.setText(actual_orientation[0] + """");    tvPitch.setText(actual_orientation[1] + """");    tvRoll.setText(actual_orientation[2] + """");}</code></pre>","285952","","540162","","2011-11-04 18:11:32","2011-11-04 18:11:32","Using getRotationMatrix and getOrientation in Android 2.1","<java><android><events><matrix><sensor>","2","0","4","",""
"2963738","1","","","2010-06-03 06:29:17","3","173","<p>How can we read birth date from contact list in SDK-1.6 and 1.5??Any help will be appreciated.......</p><p>Thanks in AdvanceNemat</p>","208436","","","","","2011-04-21 00:38:35","read birth date from contact list in Android","<android>","0","0","1","",""
"2963947","1","2964125","","2010-06-03 07:15:06","0","834","<p>I'm having trouble getting my widget to stop hogging so many resources.</p><p>I setRepeating on the AlarmManager to update. When the widget is deleted (onDisabled()), I call .cancel() on the service, but the service still shows up in the android ""running processes"" making me believe I'm doing something wrong. Any guidance?</p><p>Also, should I be scheduling my updates in the onEnabled() or the onUpdate()? onUpdate doesn't seem to work on anything other than the first widget.</p><p>Thanks for any help you can give!</p>","354130","","","","","2010-06-03 07:51:13","Stopping a widget's service when not in use","<android>","1","0","","",""
"2963996","1","","","2010-06-03 07:27:16","6","467","<p>I am looking to add a completely new type of bluetooth device to android. I am wondering if there is an SDK or a way to build device support into and application.Thanks,Ed</p>","357197","","","","","2011-05-30 10:05:56","Support a new Bluetooth Device in Android","<android><bluetooth>","1","1","","",""
"2964228","1","2964446","","2010-06-03 08:09:51","1","315","<p>I know how to setup an alarm to fire repeatedly, but the alarm stops firing after my application is killed. </p><p>How do I make sure the alarm continues to fire as it was setup?</p>","243782","","","","","2010-06-03 08:53:03","How to place a kill safe alarm fired on daily basis?","<android><alarmmanager>","2","0","1","",""
"2964310","1","2966167","","2010-06-03 08:26:53","1","4869","<p>I want to quit application in Android. Just put a ""quit"" button, which kills my app.</p><p>I know I shouldn't do this. I know that this is not the philosophy of the OS.</p><p>If you know how it can be done, pls share. </p><p>In the app, I have many opened activities, so ""finish()"" will not do the job.</p><p>Thank you for your information in advance.Danail</p>","232798","","","","","2013-05-21 21:53:06","Quitting application in Android","<android>","3","0","1","",""
"2964318","1","","","2010-06-03 08:28:09","0","1270","<p>If someone asks me the below questions What an Android Framework is?What does it do? </p><p>How should I answer?</p><p>Also what is the role of API's such as Activity Manager, Location Manager etc in the Framework?</p>","357216","","","","","2010-06-03 08:44:16","Android framework","<android>","1","1","","",""
"2964355","1","3006011","","2010-06-03 08:34:40","3","5577","<p>I'm new to opengl-es and I wonder how people are able to draw these much detailed OpenGL ES graphics, e.g. on Android OS. It's already hard to draw a single squre, because it's composed of triangles due to the reason that OpenGL ES obviously cannot draw anything else than triangles.I thought about this approach:</p><ul><li>Drawing and rendering an object in Blender.</li><li>Export it somehow as array of vertices and an array of colors</li><li>Copy this array of vertices into the Java code</li><li>Run the code</li></ul><p>Or are there approaches to solve such problems in a better way? I do not think that people just ""draw"" their graphics as array of vertices in the code. I'm sure they draw them anywhere else and import it into the code. If there is such a solution with Blender, I would be pleased to know how this is solved.</p><p>Regards.</p>","319773","","","","","2010-06-09 13:05:23","Approach to create complex 3D drawings in OpenGL ES (on Android)?","<java><android><opengl-es><3d><blender>","2","0","5","",""
"2964562","1","","","2010-06-03 09:12:04","0","2482","<p>I am using a LinearLayout to display some Text and image. I have the images at drawable/ and i am implimenting this with ListActivity with some onListItemClick functionality. now i wants to change the image for the rows which are processed by onclick functionality to show the status as processed. can some one help me in this issue to change the image at runtime.</p><p>the following is my implimentation.</p><p>public class ListWithImage extends ListActivity {    /** Called when the activity is first created. */</p><p>private SimpleCursorAdapter myAdapter;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState); // raj   setContentView(R.layout.main);    Cursor cursor = getContentResolver().query(People.CONTENT_URI, null, null, null, null);    startManagingCursor(cursor);    String[] columns = new String[] {People.NAME, People.NUMBER};    int[] names = new int[] {R.id.contact_name, R.id.contact_number};    myAdapter = new SimpleCursorAdapter(this, R.layout.main, cursor, columns, names);    setListAdapter(myAdapter);}@Overrideprotected void onListItemClick(ListView listView, View view, int position, long id) {    super.onListItemClick(listView, view, position, id);    Intent intent = new Intent(Intent.ACTION_CALL);    Cursor cursor = (Cursor) myAdapter.getItem(position);    long phoneId = cursor.getLong(cursor.getColumnIndex(People.PRIMARY_PHONE_ID));    intent.setData(ContentUris.withAppendedId(Phones.CONTENT_URI, phoneId));    startActivity(intent);}</code></pre><p>}</p><p>and main.xml is :</p><p></p><pre><code>&lt;LinearLayout    android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_width=""250px""&gt; &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;   &lt;TextView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Name: "" /&gt;   &lt;TextView android:id=""@+id/contact_name""     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""&gt;             &lt;TextView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""Phone: "" /&gt;          &lt;TextView android:id=""@+id/contact_number""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;  </code></pre><p><br>     </p><p>I thought to add the field to DB. but i was unable to know how to change the image with code. can any one provide me an example for drawing image with code and change it based on a condition at runtime.</p>","357273","","357273","","2010-06-04 06:28:14","2010-10-28 08:40:07","changing image on listview at runtime in android","<android><android-widget>","1","0","","",""
"2964767","1","2965057","","2010-06-03 09:48:43","0","1191","<p>When you click the Google universal search box on the home screen it animates upwards on the screen until it has reached the top and from there the search area and keyboard is opened. </p><p>The animated widget is animated ""on"" the home screen because it slides under other widgets.</p><p>It is easy to see this behavior if one puts the search box at the bottom of the screen and place some other widgets higher up.</p><p>I can see this on my N1 and also in the emulator. Here's a video of how it looks:<a href=""http://clip2net.com/page/m17613/6147916"" rel=""nofollow"">http://clip2net.com/page/m17613/6147916</a></p><p>Is this possible for me to do with my widgets or is this something that Google has made special for this particular box.</p>","357303","","31161","","2011-08-05 11:15:03","2011-08-05 11:15:03","Is it possible to animate a android widget I create in the same way the universal search widget animates","<android><search><animation><widget><nexus-one>","1","0","","",""
"2964982","1","2965133","","2010-06-03 10:17:25","10","6241","<p><a href=""http://code.google.com/apis/maps/documentation/directions/"">google Directions API</a></p><p>I read this guide now I can build a correct request to receive the xml file containg the directions from address A to address B. What I need is some instructions and example on how to read this xml to draw the obtained directions on an Android MapView. I'd like also to know what represents this tag in the xml: </p><pre><code>&lt;overview_polyline&gt;&lt;points&gt;a~l~Fjk~uOnzh@vlbBtc~@tsE`vnApw{A`dw@~w\|tNtqf@l{Yd_Fblh@rxo@b}@xxSfytAblk@xxaBeJxlcBb~t@zbh@jc|Bx}C`rv@rw|@rlhA~dVzeo@vrSnc}Axf]fjz@xfFbw~@dz{A~d{A|zOxbrBbdUvpo@`cFp~xBc`Hk@nurDznmFfwMbwz@bbl@lq~@loPpxq@bw_@v|{CbtY~jGqeMb{iF|n\~mbDzeVh_Wr|Efc\x`Ij{kE}mAb~uF{cNd}xBjp]fulBiwJpgg@|kHntyArpb@bijCk_Kv~eGyqTj_|@`uV`k|DcsNdwxAott@r}q@_gc@nu`CnvHx`k@dse@j|p@zpiAp|gEicy@`omFvaErfo@igQxnlApqGze~AsyRzrjAb__@ftyB}pIlo_BflmA~yQftNboWzoAlzp@mz`@|}_@fda@jakEitAn{fB_a]lexClshBtmqAdmY_hLxiZd~XtaBndgC&lt;/points&gt;&lt;levels&gt;BBBAAAAABAABAAAAAABBAAABBAAAABBAAABABAAABABBAABAABAAAABABABABBABAABB&lt;/levels&gt; &lt;/overview_polyline&gt; </code></pre><p>thanks</p>","201058","","","","","2014-04-18 09:45:20","android get and parse Google Directions","<java><android><google-maps>","5","1","5","",""
"2965109","1","9013857","","2010-06-03 10:36:35","22","25130","<p>How do you pass data between activities in an Android application?</p>","205929","","1288","","2011-02-25 21:33:58","2013-05-18 14:52:55","Passing data between activities in Android","<android>","2","0","15","",""
"2965125","1","2965556","","2010-06-03 10:38:59","7","4499","<p>I run an app in fullscreen mode where fullscreen is defined as a theme in xml for the entire app. </p><pre><code>&lt;style name=""MyAppTheme"" parent=""android:Theme""&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;    &lt;item name=""android:windowFullscreen""&gt;true&lt;/item&gt;    &lt;item name=""android:windowBackground""&gt;@null&lt;/item&gt;&lt;/style&gt;</code></pre><p>Generally it works ok, but there are some issues in some cases:</p><ol><li>when I open the search dialog via search button  -> <a href=""http://www.mathiaslin.com/dl/statusbar.png"" rel=""nofollow"">Screenshot</a></li><li>when I open spinner widgets that are very long and fill the screen (so that the list is usually scrollable)  -> <a href=""http://www.mathiaslin.com/dl/statusbar2.png"" rel=""nofollow"">Screenshot</a></li></ol><p><strong>The problem is that when I open the search dialog or spinner widget, the system notification bar occurs for a few millisecs and then scrolls off the screen again. Please see the screenshots linked above.</strong></p><p>I'm currently on 2.2 with NexusOne, but same thing happened on 2.1update1 (esp. case 2) as well before.</p>","241475","","128662","","2011-07-25 07:56:00","2011-07-25 07:56:00","Problem with notification bar in fullscreen app","<android><fullscreen>","2","4","4","",""
"2965141","1","2965669","","2010-06-03 10:40:36","1","1939","<p>I've never built a game before, and I've not programmed for Android before but am looking to do so over the summer by building a game. </p><p>What type of object do I use for a shape that I want the user to be able to drag around the screen for instance using touch gestures? How do I tie together the MotionEvent, View and Graphics2D to make objects drawn on screen that can be interacted with? I imagine this will use ActionListeners / Handlers but I'm a bit confused at this stage...</p><p>A simple breakdown of steps would be much appreciated. Thanks</p>","357361","","","","","2010-06-03 11:57:41","Making interactive touch objects on Android","<android><touchscreen>","1","0","2","",""
"2965149","1","","","2010-06-03 10:40:57","0","948","<p>What is the importance of ""res"" and ""src"" folders in eclipse-android while creating android project. </p>","357349","","","","","2010-06-03 10:45:46","res and src folder relation in eclipse android","<android>","2","0","","",""
"2965216","1","","","2010-06-03 10:52:37","3","4619","<p>I'm a newbie to Android. Actually, I want to query data from Media provider with Content provider &amp; content resolver.</p><pre><code>c = mContent.query(CONTENT_URI,projection,where,null,null); </code></pre><p>My question is, how can I query data from media provider as below using a <code>GROUP BY</code> clause:</p><pre><code>select DISTINCT _id, count(_id), _data FROM aaa_table WHERE _data LIKE ""A"" OR _data LIKE ""B"" GROUP BY _id;</code></pre><p>I have tried setting <code>projection</code> and <code>where</code> as follows:</p><pre><code> final String[] projection = new String[] {                ""_id"",                 ""COUNT (""+ _id +"")"" ,                ""_data""                 }; </code></pre><p>and <code>where</code>:</p><pre><code>_data LIKE ""A"" OR _data LIKE ""B""</code></pre><p>but, I couldn't find how to set the query option <code>GROUP BY _id</code>.</p><p>Please help me. </p>","357373","","844882","","2012-03-22 23:24:48","2012-03-22 23:26:06","How to query from MEDIA provider with ""group by"" option?","<android><android-contentprovider>","3","0","","",""
"2965277","1","4479509","","2010-06-03 11:02:01","0","559","<p>I have a HTC Dream firmware version 1.6 build DRD20. I am unable to install voice data in Menu ==> Settings ==> Speech Synthesis ==> Install voice data. The option just brings me back to previous screen of settings. I also tried installing Speech Synthesis Data Installer and many other applications for text to speech. But none works and give back Sorry! Force close error. Is there any way by which I can install voice data ? Or any way I can use text to speech ?Can anyone also tell what is latest offical firmware available for this mobile ?</p>","315619","","315619","","2010-06-03 12:18:06","2010-12-18 18:49:07","Does Android Speech Synthesis do not work for HTC Dream firmware version 1.6 build DRD20?","<android>","1","0","","",""
"2965662","1","","","2010-06-03 11:57:03","29","59700","<p>I want to set the <code>LayoutParams</code> for an <code>ImageView</code> but cant seem to find out the proper way to do it.</p><p>I can only find documentation in the API for the various <code>ViewGroups</code>, but not an <code>ImageView</code>. Yet the <code>ImageView</code> seems to have this functionality.</p><p>This code doesn't work...</p><pre><code>myImageView.setLayoutParams(new ImageView.LayoutParams(30,30));</code></pre><p>How do I do it?</p>","351469","","1522562","","2013-04-08 12:02:31","2013-04-08 12:02:31","How do you setLayoutParams() for an ImageView?","<android><layout><imageview>","4","0","7","",""
"2965698","1","2967456","","2010-06-03 12:01:12","6","43548","<p>I have read on this site that it is necessary to customize the setOnItemSelectedListener and setOnItemClickListener of a ListView if we want to know the Index of the SelectedItem (.getSelectedItemPosition()). So that is what I do but it does not stores the position of the SekectedItem, instead i have always -1...</p><p>What I want to do is just to give the user a way to delete items from a list by selected and Item and Clicking a button.</p><p>See the code below :</p><pre><code>    listViewPeople.setOnItemClickListener(new ListView.OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; a, View v, int i, long l) {            try {                // Remembers the selected Index                listViewPeopleId = listViewPeople.getSelectedItemPosition();            }            catch(Exception e) {                System.out.println(""Nay, cannot get the selected index"");            }        }    });    listViewPeople.setOnItemSelectedListener(new ListView.OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; a, View v, int i, long l) {            try {                // Remembers the selected Index                listViewPeopleId = listViewPeople.getSelectedItemPosition();                System.out.println(""Yay, set the selected index "" + listViewPeopleId);            }            catch(Exception e) {                System.out.println(""Nay, cannot get the selected index "" + listViewPeopleId);            }        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            try {                // Remembers nothing selected                listViewPeopleId = -1;                System.out.println(""Yay, set that nothing is selected "" + listViewPeopleId);            }            catch(Exception e) {                System.out.println(""Nay, cannot set that nothing is selected "" + listViewPeopleId);            }        }    });</code></pre><p>What's wrong??</p><p>Thank you for your help!</p><p>Christophe</p>","357431","","","","","2011-01-26 00:59:48","ListView setOnItemClickListener and setOnItemSelectedListener to store the Selected Item Index","<android><android-sdk-2.2>","1","0","3","",""
"2965787","1","","","2010-06-03 12:15:23","1","189","<p>I want my application to start when someone modifies a content provider. A setting to be specific. The settings framework calls ""notify"" when a value is set.</p><p>If my app was started I would use registerContentObserver() I guess, but is is not started.</p><p>Can define some intent-filter in my manifest that wakes up my application. A back up plan would be to have a service running all the time that has registered a listener, but that seems like a wast or resources.</p><p>Thanks, Ola</p>","357447","","","","","2011-04-10 19:27:52","Start application when Content provider is changed","<android><settings><android-intent><android-contentprovider>","1","0","","",""
"2965856","1","","","2010-06-03 12:26:36","1","1717","<p>i've build an AlertDialog which shows three items:</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(myActivity);...builder.setItems(items, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int item) {                        if(item==0){ //do stuff}                                    else if(item==1){//do other stuff}                                    else if(item==2){//show other dialog}...</code></pre><p>now i want to display another dialog when the user selects the third item (item==2). My approach is the following:</p><pre><code>Dialog otherDialog = new Dialog(myActivity.savedApplicationContext);otherDialog.setContentView(R.layout.other_layout);otherDialog.setTitle(getString(R.string.update_dialog));dialog.dismiss(); //dismiss old dialogotherDialog.show(); </code></pre><p>This doesn't work :( An exception thrown:</p><pre><code>06-03 12:21:32.684: ERROR/AndroidRuntime(507): Uncaught handler: thread main exiting due to uncaught exception06-03 12:21:32.834: ERROR/AndroidRuntime(507): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.view.ViewRoot.setView(ViewRoot.java:472)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.app.Dialog.show(Dialog.java:239)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at com.dapr.altfuelloc.activity.DetailsActivity$1$1.onClick(DetailsActivity.java:96)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:884)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.widget.ListView.performItemClick(ListView.java:3285)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.os.Handler.handleCallback(Handler.java:587)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.os.Handler.dispatchMessage(Handler.java:92)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.os.Looper.loop(Looper.java:123)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at java.lang.reflect.Method.invokeNative(Native Method)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at java.lang.reflect.Method.invoke(Method.java:521)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-03 12:21:32.834: ERROR/AndroidRuntime(507):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I've searched on stackoverflow/the inet but the solution that was meantioned there was to pass the applicationContext of the Activity to the Dialog (which i did in this case, i saved an reference of the activitys applicationContext in a private variable: myActivity.savedApplicationContext</p>","317913","","","","","2010-06-03 12:47:06","Showing custom dialog in after an Android AlertDialog-Click","<android><exception><dialog><token><alertdialog>","1","0","","",""
"2966016","1","3225119","","2010-06-03 12:46:50","0","1067","<p>i try to parse an rdf file using android.sax and android.utils.Xml methods. My parser ouputs nothing and don't send any exception.</p><p>RDF file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;?xml-stylesheet type=""text/xsl"" media=""screen"" href=""/~d/styles/rss1full.xsl""?&gt;&lt;?xml-stylesheet type=""text/css"" media=""screen"" href=""http://feeds.feedburner.com/~d/styles/itemcontent.css""?&gt; &lt;rdf:RDF xmlns:rdf=""http://www.w3.org/1999/02/22-rdf-syntax-ns#"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:sy=""http://purl.org/rss/1.0/modules/syndication/"" xmlns:admin=""http://webns.net/mvcb/"" xmlns:content=""http://purl.org/rss/1.0/modules/content/"" xmlns=""http://purl.org/rss/1.0/"" xmlns:feedburner=""http://rssnamespace.org/feedburner/ext/1.0""&gt;   &lt;channel rdf:about=""http://www.olympique-et-lyonnais.com/""&gt;     &lt;title&gt;OL Blog | Olympique et Lyonnais&lt;/title&gt;     &lt;description /&gt;     &lt;link&gt;http://www.olympique-et-lyonnais.com/&lt;/link&gt;     &lt;dc:language&gt;fr&lt;/dc:language&gt;     &lt;dc:creator /&gt;     &lt;dc:rights /&gt;     &lt;dc:date&gt;2010-06-01T23:23:50+02:00&lt;/dc:date&gt;     &lt;admin:generatorAgent rdf:resource=""http://www.dotclear.net/"" /&gt;     &lt;sy:updatePeriod&gt;daily&lt;/sy:updatePeriod&gt;     &lt;sy:updateFrequency&gt;1&lt;/sy:updateFrequency&gt;     &lt;sy:updateBase&gt;2010-06-01T23:23:50+02:00&lt;/sy:updateBase&gt;     &lt;items&gt;     ...     &lt;/items&gt;   &lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""self"" type=""application/rdf+xml"" href=""http://feeds.feedburner.com/oetl"" /&gt;&lt;feedburner:info uri=""oetl"" /&gt;&lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""hub"" href=""http://pubsubhubbub.appspot.com/"" /&gt;   &lt;/channel&gt;   &lt;item rdf:about=""http://www.olympique-et-lyonnais.com/ligue-1/la-toul-ce-tlier,4513.html""&gt;     &lt;title&gt;La Toul, ce tôlier&lt;/title&gt;     &lt;link&gt;http://feedproxy.google.com/~r/oetl/~3/RycUlTDp3eY/la-toul-ce-tlier,4513.html&lt;/link&gt;     &lt;dc:date&gt;2010-06-01T23:23:50+02:00&lt;/dc:date&gt;     &lt;dc:language&gt;fr&lt;/dc:language&gt;     &lt;dc:creator&gt;Aurelien&lt;/dc:creator&gt;     &lt;dc:subject&gt;Ligue 1&lt;/dc:subject&gt;     &lt;description&gt;Décidément très bavard ces derniers temps notamment dans la presse, Jean-Michel Aulas n'a pas seulement livré le plan de recrutement de l'OL, il a aussi parlé de certains joueurs actuellement en place au club et de leur avenir. Le président est notamment...&lt;/description&gt;     &lt;content:encoded&gt;&lt;![CDATA[D&amp;eacute;cid&amp;eacute;ment tr&amp;egrave;s bavard ces derniers temps notamment dans la presse, Jean-Michel Aulas n'a pas seulement livr&amp;eacute; le plan de recrutement de l'OL, il a aussi parl&amp;eacute; de certains joueurs actuellement en place au club et de leur avenir. Le pr&amp;eacute;sident est notamment...&lt;img src=""http://feeds.feedburner.com/~r/oetl/~4/RycUlTDp3eY"" height=""1"" width=""1""/&gt;]]&gt;&lt;/content:encoded&gt;   &lt;feedburner:origLink&gt;http://www.olympique-et-lyonnais.com/ligue-1/la-toul-ce-tlier,4513.html&lt;/feedburner:origLink&gt;&lt;/item&gt;...&lt;/rdf:RDF&gt;</code></pre><p>my parser:</p><pre><code>static final String RDF_NAMESPACE = ""http://www.w3.org/1999/02/22-rdf-syntax-ns#"";static final String ATOM_NAMESPACE = ""http://www.w3.org/2005/Atom"";static final String RSS_NAMESPACE = """";   try{    RootElement root;    Element itemlist;    Element item;    String namespace;    if(feedsTypes[i].equals(""RDF"")){     Log.i(TAG, ""RDF feed"");     namespace = RDF_NAMESPACE;     root = new RootElement(RDF_NAMESPACE, feedsTypes[i]);     item = root.getChild(RDF_NAMESPACE, ITEM);    }    else{     Log.i(TAG, ""RSS feed"");     namespace = RSS_NAMESPACE;     root = new RootElement(RSS_NAMESPACE, feedsTypes[i]);     itemlist = root.getChild(RSS_NAMESPACE, CHANNEL);     item = itemlist.getChild(RSS_NAMESPACE, ITEM);    }    item.setStartElementListener(new StartElementListener(){     @Override     public void start(Attributes attributes) {      Log.i(TAG, ""item///"");     }    });    item.setEndElementListener(new EndElementListener(){     public void end() {      Log.i(TAG, ""///item"");      messages.add(currentMessage.copy());     }    });    item.getChild(namespace, TITLE).setEndTextElementListener(new EndTextElementListener(){     public void end(String body) {      Log.i(TAG, body);      currentMessage.setTitle(body);     }    });    Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8, root.getContentHandler());   }   catch(Exception e){    Log.w(TAG, e.getMessage());   }</code></pre><p>Is there someone who can tell me what i'm doing wrong ?</p>","357481","","","","","2012-09-04 08:29:50","Android sax with rdf","<xml><android><rdf><sax>","3","1","","",""
"2966228","1","","","2010-06-03 13:12:00","5","366","<p>The TouchUtils class in the android documentation has functions like drag() </p><p><a href=""http://developer.android.com/intl/de/reference/android/test/TouchUtils.html#drag(android.test.InstrumentationTestCase,%20float,%20float,%20float,%20float,%20int"" rel=""nofollow"">http://developer.android.com/intl/de/reference/android/test/TouchUtils.html#drag(android.test.InstrumentationTestCase,%20float,%20float,%20float,%20float,%20int</a>)</p><p>but they do not support multi touch gestures, like a two finger swipe. </p><p>Looking at the MotionEvent.obtain() methods, there does not seem to be any way of invoking a ""virtual"" multi touch event from a testcase. </p><p>Anyone has got it working? </p>","357509","","317773","","2011-08-19 16:08:49","2012-04-05 11:36:49","Testcase with multitouch on Android?","<android><testing><multi-touch>","1","0","2","",""
"2966245","1","2966602","","2010-06-03 13:14:33","2","805","<p>i have using Table Layout. It has two columns. first column contains a text view  another one is EditText. My Layout should be look like this.</p><pre><code>column1: columnvalue1column2: columnvalue2col3: columnvalue3</code></pre><p>But my Layout auto aligned like this:</p><pre><code>column1: columnvalue1column2: columnvalue2col3:    columnvalue3</code></pre><p>how to resolve the layout like first one. what is the mistake in it.Any idea?</p><p>code: i noted single row's code. for reference. like this code i done for all rows.</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""wrap_content"" android:layout_height=""fill_parent""            android:stretchColumns=""1"" android:background=""@drawable/corner_white""            android:layout_margin=""10dip""&gt;&lt;TableRow android:orientation=""horizontal""                android:minHeight=""50dip"" android:gravity=""center_vertical""&gt;                &lt;TextView android:text=""@string/ename"" android:textSize=""15sp""                    android:textColor=""@color/black"" android:padding=""10dip"" /&gt;                &lt;EditText android:id=""@+id/ename_value"" android:textSize=""15sp""                    android:inputType=""textEmailAddress"" android:background=""@null""                    android:singleLine=""true"" /&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;</code></pre>","267269","","","","","2010-06-03 13:54:44","Table Layout problem in Android?","<android><tablelayout><tablerow>","1","0","","",""
"2966491","1","","","2010-06-03 13:41:37","1","270","<p>Looking at an earlier question <a href=""http://stackoverflow.com/questions/1942104/building-using-runtime-generated-layout-xml-in-android"">link text</a> based on the same concept,is there an approach to do this via the LayoutInflator?</p>","357442","","","","","2010-06-03 13:41:37","Building Android user interfaces at runtime with layouts from server","<android><layout>","0","2","1","",""
"2966547","1","2972360","","2010-06-03 13:48:01","2","4548","<p>I use GridView to display thumbnails from MediaStore.If I launch and close my application 2-3 times it crashes with out ofmemory error.System.gc() is called in onCreate of main activity.If comment call setImageURI then no errors.Maybe I need to explicitly clear memory somehow?Please, help.</p><pre><code>   public View getView(int position, View convertView, ViewGroup parent){           ImageView i;           if (convertView == null) {                   i = new ImageView(activity.getApplicationContext());                   i.setLayoutParams(new GridView.LayoutParams(92, 92));                   i.setScaleType(ImageView.ScaleType.CENTER_CROP);           } else {                   i = (ImageView) convertView;           }           Uri imageUri = thumbUri(position);           i.setImageURI(imageUri);   //  &lt;--- no error if this string is commented           return i;   }</code></pre>","357542","","","","","2010-06-04 07:57:33","GridView out of memory error","<android><memory><gridview><image>","2","0","0","",""
"2966955","1","2967028","","2010-06-03 14:40:46","1","1678","<p>I want to do a RSS reader, which would display an image (left alignment, text running around it) a Title flowing next to it, and a description, also running around the image.What is the best method to do this in Android?</p>","117701","","","","","2010-06-03 14:47:36","Android: Best method for displaying table data","<android>","1","0","1","",""
"2967081","1","2967258","","2010-06-03 14:54:17","1","1970","<p>I am writing an app that allows a user to access their corporate voice mail system. the voice mails are displayed in a list view and when one is selected they are given a menu. when the user selects ""listen"" i would like a small media player to pop up at the bottom of the screen on top of the existing ListView (similar to how the soft keyboard comes up when needed and then goes away when its done).</p><p>options?</p>","339428","","50049","","2011-11-22 02:01:43","2011-11-22 02:01:43","How do I make a sub view apear on top of an existing activity in Android?","<android><popupwindow><android-listview>","1","0","4","",""
"2967120","1","2967365","","2010-06-03 14:58:05","2","1763","<p>Is there way to dump the current screen to a bitmap in Android?</p><p>And what about dump screen of other applications? For example, running a service background, the foreground app could send an intent to start the service, and capture the current screen and save as a bitmap.</p>","234939","","","","","2010-12-18 19:34:27","How to dump the screen programmatically?","<android>","2","0","1","",""
"2967150","1","2967401","","2010-06-03 15:00:32","0","836","<p>I am using the following code to setup a TabWidget:</p><pre><code> public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            TabHost mTabHost = getTabHost();          mTabHost.addTab(mTabHost.newTabSpec(""tab_1"").setIndicator(""Tab1"", getResources().getDrawable(R.drawable.tab_1)).setContent(new Intent(this, TabClass1.class)));        mTabHost.addTab(mTabHost.newTabSpec(""tab_2"").setIndicator(""Tab2"", getResources().getDrawable(R.drawable.tab_2)).setContent(new Intent(this, TabClass2.class)));              mTabHost.addTab(mTabHost.newTabSpec(""tab_3"").setIndicator(""Tab3"", getResources().getDrawable(R.drawable.tab_3)).setContent(new Intent(this, TabClass3.class)));                mTabHost.setCurrentTab(0);              }</code></pre><p>So, TabClass1, TabClass2 and TabClass3 are separate .java files that are contained within my package. I am able to create content within each of these .java files and display the content when each tab is selected - but how do I assign an XML layout file to each of the .java files? </p><p>I have tried various setups but have been unable to create a TextView in an XML Layout and have it display when a particular tab is selected.</p>","300129","","","","","2010-06-03 18:36:26","Controling XML Within Tab Widget (Android)","<xml><android><tabs>","1","2","","",""
"2967337","1","2967466","","2010-06-03 15:23:19","8","43281","<p>I am writing a media player and i would like to have a progress bar showing the progress of the song. I found the ProgressBar class, but all i can get on the screen is a circular spinning icon. what im looking for is an actual bar. </p><p>How do i change the style of the ProgressBar to be a bar (not a circle) and how would i use it with MediaPlayer?</p><p>thanks</p>","339428","","","","","2011-12-01 00:09:45","android: how do i use the progress bar?","<android><progress-bar><media-player>","1","0","7","",""
"2967399","1","2967462","","2010-06-03 15:29:56","1","829","<p>I have an Android application with a main activity that is the tabhost. I'm adding multiple tabs to the tabhost with an intent to several activities.</p><p>My problem is that these activities are not created (onCreate is not called) until I click on the tab. This is a problem because I need to register broadcastreceivers: there may be broadcasts that are sent -before- a particular tab is opened.</p><p>I tried to work around this by:</p><ul><li>Setting my receivers as static and registering from somewhere else. This is not possible because I need to call into methods.</li><li>Calling into tabHost.setCurrentTabByTag(the_tag) and then switching back to my root tab. This only works sometimes and this is a very ugly solution imo.</li><li>Not using activities but just using views instead. Also not a very elegant solution because it turns my tabHost activity into one huge master class doing all kinds of unrelated things.</li></ul><p>What would be the best solution to this problem? Can I somehow make sent broadcasts 'queue' instead of just disappearing when there are no receivers? Can I force creation of the my tab activities (this is not a problem, my users are almost guaranteed to use every single tab at some points)? Other ideas?</p><p>edit:</p><p>According to CommonsWare in this question;<a href=""http://stackoverflow.com/questions/2945274/android-tabhost-update-tabs-from-tabs-activity"">http://stackoverflow.com/questions/2945274/android-tabhost-update-tabs-from-tabs-activity</a></p><p>It may be a better idea to implement the tabs as views instead of activities... That somewhat changes my question:</p><p>How do I seperate different kinds of logic in the same activity? Not really looking forward to 30+ method uberactivity.</p>","51133","","51133","","2010-06-03 15:49:49","2010-06-03 15:49:49","Android force tab activity creation?","<android><activity><broadcastreceiver><android-tabhost>","1","0","","",""
"2967441","1","","","2010-06-03 15:33:53","0","621","<p>My android app draws a chart on a Canvas.  It works fine in the simulator.  On a real device the chart is clipped to the left 1/5 of the screen.  I've tried:</p><p>canvas.clipRect(0, 0, canvas.getWidth(), canvas.getHeight(), Region.Op.REPLACE);</p><p>to clear the clipping.  Am I missing something?  Does layering have anything to do with this?</p><p>Thanks,Gerry</p>","321594","","","","","2010-06-09 22:51:59","android canvas draw mysteriously clipped","<android><drawing><canvas>","1","0","","",""
"2967870","1","2968559","","2010-06-03 16:23:44","2","1469","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1983990/how-to-open-source-an-application-that-uses-api-keys"">How to open-source an application that uses API keys</a>  </p></blockquote><p>I have an open source Android app which I am planning on adding Flurry tracking to.  Flurry creates a unique API key for your app's tracking.  </p><p>Do I need to try and hide this API key in my source code (i.e. not include it and I would add it every time I build for release) or just not worry about it?</p>","396","","","","","2010-06-03 20:02:56","Do I need to hide my Flurry API key in my open source app?","<android><open-source><tracking><api-key><flurry>","3","0","","2012-09-27 01:33:20",""
"2967903","1","2976946","","2010-06-03 16:29:26","2","1221","<p>From the documentation regarding the <code>android:configChanges='orientation'</code> attribute of the activity tag in the manifest:</p><blockquote>  <p>Note: Using this attribute should be avoided and used only as a last-resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.</p></blockquote><p>Why does it say this?  </p><p>In the case of threads and networking requests via a service API library, a request could be made with a reference to the original Activity, and then an orientation change could occur, leaving the thread pointing to the old Activity.</p><p>While this can be fixed, it's tedious and ugly compared to just handling the configuration changes yourself.</p><p>Why should it be avoided?</p><p>Edit:  I guess I should also ask: would this be an acceptable reason for doing the orientation configuration changes yourself?</p>","238849","","238849","","2010-06-03 18:55:25","2010-06-04 18:57:45","Handling orientation changes yourself","<android>","2","1","2","",""
"2967904","1","","","2010-06-03 16:29:27","5","9266","<p>I was trying to get hold of 2D graphics in Android.  As a example i want to implement a custom drawable and show it in my Activity</p><p>I have defined a customized drawable by extending from Android drawable as mentioned below</p><pre><code>myDrawable extends Drawable { private static final String TAG = myDrawable.class.getSimpleName(); private ColorFilter cf; @Override public void draw(Canvas canvas) {  //First you define a colour for the outline of your rectangle  Paint rectanglePaint = new Paint();  rectanglePaint.setARGB(255, 255, 0, 0);  rectanglePaint.setStrokeWidth(2);  rectanglePaint.setStyle(Style.FILL);  //Then create yourself a Rectangle  RectF rectangle = new RectF(15.0f, 50.0f, 55.0f, 75.0f); //in pixels  Log.d(TAG,""On Draw method"");  // TODO Auto-generated method stub  Paint paintHandl = new Paint();//  paintHandl.setColor(0xaabbcc);  paintHandl.setARGB(125, 234, 213, 34 );  RectF rectObj = new RectF(5,5,25,25);  canvas.drawRoundRect(rectangle, 0.5f, 0.5f, rectanglePaint); } @Override public int getOpacity() {  // TODO Auto-generated method stub  return 100; } @Override public void setAlpha(int alpha) {  // TODO Auto-generated method stub } @Override public void setColorFilter(ColorFilter cf) {  // TODO Auto-generated method stub  this.cf = cf; }}</code></pre><p>I am trying to get this displayed in my activity, as shown below</p><pre><code>public class custDrawable extends Activity {/** Called when the activity is first created. */ LinearLayout layObj = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        layObj = (LinearLayout) findViewById(R.id.parentLay);        ImageView imageView = (ImageView) findViewById(R.id.icon2);        myDrawable myDrawObj = new myDrawable();        imageView.setImageDrawable(myDrawObj);        imageView.invalidate();//  layObj.addView(myDrawObj, params);    }}</code></pre><p>But when i run the app i see no rectangle on the activity, can anyone help me out?Where am i going wrong?</p>","357709","","6744","","2010-06-03 17:11:03","2010-06-11 17:53:01","Implementing a customized drawable in Android","<android>","1","0","5","",""
"2967962","1","2968442","","2010-06-03 16:36:51","2","1943","<p>I am using VideoView to display a video in my app. The problem is that, once the layout gets created there is lag of almost 10-30 seconds before which the video starts to play. I can see in LogCat that the video is buffering during the lag.</p><p>Is there a way I can minimize this lag, or tell MediaPlayer to play the video sooner? </p><p>ThanksChris</p>","321927","","","","","2010-06-03 17:43:47","Android - Buffering Lag with VideoView","<android><buffer><delay><videoview>","1","2","1","",""
"2968016","1","","","2010-06-03 16:45:12","0","11417","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2964318/android-framework"">Android framework</a>  </p></blockquote><p>I've few questions on Android Framework. Can someone please answer them </p><ol><li><p>What does an Android Frameworkdo? What is it's job? </p></li><li><p>What are these managers -Activity Manager, Location Manageretc?  Are they APIs or libraries? </p></li><li><p>I heard that the definition ofa framework is - a set of  librariesthat say “Don’t call us, we’ll callyou.”  So can I say that  ActivityManager, Location Manager etc aresuch libraries? Or is it  that theyare not libraries but APIs (used toaccess underlying c/c++  libraries)and the actual libraries that do""Don't call us, we'll call  you.""are hidden from us?</p></li></ol>","357724","","114066","","2010-06-04 07:30:00","2010-06-07 09:46:16","Android framework. What is it?","<android>","3","1","0","2010-06-05 06:38:03",""
"2968060","1","","","2010-06-03 16:50:53","0","1572","<p>I have an image which is of rectangular dimension, eg 30 x 60 pixels I want to rotate this image around the bottom center of the image, i.e  i want to set the pivot in the above example as (15, 60 )pixel.</p><p>I am using a drawble and matrix to get this done,  whatever i try i always end up rotating around center of the image.</p><p>Code is :</p><pre><code>Bitmap bitmapOrg = BitmapFactory.decodeFile(""/sdcard/DCIM/2010-06-01_15-32-42_821.jpg"");</code></pre><p>//            float angle =  (angle + 10.0f)%360.0f;             if(null !=bitmapOrg)            {</p><pre><code>             int width = bitmapOrg.getWidth();             int height = bitmapOrg.getHeight();             int newWidth = 15;             int newHeight = 15;             // calculate the scale - in this case = 0.4f             float scaleWidth = ((float) newWidth) / width;             float scaleHeight = ((float) newHeight) / height;</code></pre><p>/*                 Canvas c = new Canvas(bitmapOrg);                 float px = ;                float py;                c.rotate(angle, px, py)*/</p><pre><code>             // createa matrix for the manipulation             Matrix matrix = new Matrix();             // resize the bit map             matrix.postScale(scaleWidth, scaleHeight);             // rotate the Bitmap</code></pre><p>//                 matrix.postRotate(45);</p><pre><code>             // recreate the new Bitmap             Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,                                width, height, matrix, true);              // make a Drawable from Bitmap to allow to set the BitMap              // to the ImageView, ImageButton or what ever             BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);             ImageView imageView = new ImageView(this);             // set the Drawable on the ImageView             imageView.setImageDrawable(bmd);             // center the Image             imageView.setScaleType(ScaleType.CENTER);</code></pre><p>//                 imageView.layout(100, 300, 0, 0);//                 linLayout.addView(imageView);</p><pre><code>             // add ImageView to the Layout             linLayout.addView(imageView,                 new AbsoluteLayout.LayoutParams(                           LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 10, 30                     )             );</code></pre><p>can anyone let me know how to get this rectified?</p>","357709","","","","","2013-05-28 05:05:50","rotate an image aroound a point","<android>","2","0","1","",""
"2968631","1","2990213","","2010-06-03 18:14:43","5","3155","<p>I've done my research and found plenty of people launching the sms application from an intent, The thing is that people usually tend to do this only for outgoing messages.</p><p>I'm currently displaying a Unread Sms Count on my app, but it seams I cant get the proper intent to work.</p><p>On every try I get the same result, It launches the app but for a new sms...</p><p>My current intent looks like this</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setData(Uri.parse(""sms:""));startActivity(intent);</code></pre><p>and it's result is:</p><p><img src=""http://img291.imageshack.us/img291/1330/22012196.png"" alt=""Android sms Aplication form""></p><ul><li>EDIT: Para -> To</li><li>Escribir mensaje -> Write Message</li><li>Enviar -> Send</li></ul><p>I hope I'm clear enough about this. </p><p>The question is:</p><p><strong>How can I go to the inbox of the sms application on android via an Intent?</strong></p><hr><p><strong>EDIT:</strong> I just want to replicate this:</p><pre><code>startActivity(new Intent(this, ConversationList.class));</code></pre><p>Wich I took from: <a href=""http://www.google.com/codesearch/p?hl=en#dpDz7Q08o9c/src/com/android/mms/ui/ComposeMessageActivity.java"" rel=""nofollow"">http://www.google.com/codesearch/p?hl=en#dpDz7Q08o9c/src/com/android/mms/ui/ComposeMessageActivity.java</a>   @LINE: 2028</p><p>On my own app. But I cant seem to get it to work.</p><p>Thanks in advanced.</p>","356828","","356828","","2010-06-04 14:35:49","2012-03-12 09:19:08","start sms Activity @ ConversarionList.class from my own app","<android><sms><android-intent><inbox>","3","0","3","",""
"2968689","1","2968714","","2010-06-03 18:24:49","6","329","<p>I've got plenty of these lying around, and I'm wondering if I'm going to face any trouble - or performance problems.</p><p>I have method A:<pre><code>MyClass monkey;...if(monkey != null) { ...}</pre></code></p><p>Or method B:<pre><code>boolean hasMonkey; //This is set to TRUE when monkey is not nullMyClass monkey;...if(hasMonkey) { ...}</pre></code></p><p>On a functional level, they both do the same thing. Right now, I'm using method A. Is that a bad way of doing things? Which is going to perform better?</p>","310455","","","","","2010-06-03 19:15:49","Which is the 'correct' way to do this (if statement)","<java><android>","8","0","","",""
"2968849","1","2968860","","2010-06-03 18:48:29","0","1118","<p>When running a thread in Android/Java:</p><pre><code>public void run(){   while (running)   {      if (moreTasksToExec())      {         task = getNextTask()         task.exec();      }   }}</code></pre><p>Is it OK to let it run and not using a semaphore to block while no work needs to be executed? </p><p>I am only using one thread, so I need no inter-thread synchronization.</p>","226342","","","","","2010-06-04 23:24:04","Do I need a semaphore for my thread in Android/Java?","<java><android><multithreading><runnable>","3","1","","",""
"2968911","1","","","2010-06-03 19:00:12","2","2276","<p>Is there any way to Linkify a specific TextView that is contained within a ListView?  I tried using <code>android:autoLink=""all""</code> but that didn't work.  I was getting an out of context error.  </p><p>Important also to note: the ListView is my second view in the ViewFlipper.</p><p>I have also tried:</p><pre><code>            View mItemView = mAdapter.getView(2, null, null);        TextView infoText = (TextView) mItemView.findViewById(R.id.rowText2);        Linkify.addLinks(infoText, Linkify.ALL);</code></pre><p>Right after the adapter was bound to the ListView and the View was switched.  No luck.</p><p>Here is the stack trace:</p><pre><code>06-03 21:19:25.180: ERROR/AndroidRuntime(1214): Uncaught handler: thread main exiting due to uncaught exception06-03 21:19:25.219: ERROR/AndroidRuntime(1214): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.app.ApplicationContext.startActivity(ApplicationContext.java:550)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:248)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.text.style.URLSpan.onClick(URLSpan.java:62)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.widget.TextView.onTouchEvent(TextView.java:6560)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.View.dispatchTouchEvent(View.java:3709)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.os.Handler.dispatchMessage(Handler.java:99)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.os.Looper.loop(Looper.java:123)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at java.lang.reflect.Method.invokeNative(Native Method)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at java.lang.reflect.Method.invoke(Method.java:521)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-03 21:19:25.219: ERROR/AndroidRuntime(1214):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any Ideas?</p><p>Thanks in advance!!!</p>","351338","","694378","","2011-05-11 13:43:16","2011-05-11 13:43:16","Android -- autoLink","<android><listview><linkify>","3","0","1","",""
"2968936","1","3019878","","2010-06-03 19:04:47","12","7956","<p>I'm writing an application which connects to a back office site. The backoffice site contains a whole slew of JavaScript functions, at least 100 times the average site. Unfortunately it does not load them, and causes much of the functionality to not work properly. So I am running a test. I put a page out on my server which loads the FireBugLite javascript text. Its a lot of javascript and perfect to test and see if the Android WebView will load it. The WebView loads nothing, but the browser loads the Firebug Icon. What on earth would make the difference, why can it run in the browser and not in my WebView? Any suggestions.</p><p>More background information, in order to get the stinking backoffice application available on a Droid (or any other platform except windows) I needed to trick the bakcoffice application to believe what's accessing the website is Internet Explorer. I do this by modifying the WebView User Agent.</p><p>Also for this application I've slimmed my landing page, so I could give you the source to offer me aid.</p><pre><code>package ksc.myKMB;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.app.ProgressDialog;import android.content.DialogInterface;import android.graphics.Bitmap;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.Window;import android.webkit.WebChromeClient;import android.webkit.WebView;import android.webkit.WebSettings; import android.webkit.WebViewClient;import android.widget.Toast;public class myKMB extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState); /** Performs base set up */        /** Create a Activity of this Activity, IE myProcess */        myProcess = this;        /*** Create global objects and web browsing objects */        HideDialogOnce = true;        webview = new WebView(this) {        };        webChromeClient = new WebChromeClient() {         public void onProgressChanged(WebView view, int progress) {                // Activities and WebViews measure progress with different scales.                // The progress meter will automatically disappear when we reach 100%          myProcess.setProgress((progress * 100));          //CreateMessage(""Progress is : "" + progress);              }        };        webViewClient = new WebViewClient() {          public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {                 Toast.makeText(myProcess, MessageBegText + description + MessageEndText, Toast.LENGTH_SHORT).show();               }            public void onPageFinished (WebView view, String url) {              /** Hide dialog */           try {           // loadingDialog.dismiss();             } finally {           }           //myProcess.setProgress(1000);           /** Fon't show the dialog while I'm performing fixes */              //HideDialogOnce = true;view.loadUrl(""javascript:document.getElementById('JTRANS011').style.visibility='visible';"");          }          public void onPageStarted(WebView view, String url, Bitmap favicon) {       if (HideDialogOnce == false) {         //loadingDialog = ProgressDialog.show(myProcess, """",                 //   ""One moment, the page is laoding..."", true);       } else {        //HideDialogOnce = true;       }      }    };    getWindow().requestFeature(Window.FEATURE_PROGRESS);            webview.setWebChromeClient(webChromeClient);    webview.setWebViewClient(webViewClient);    setContentView(webview);    /** Load the Keynote Browser Settings */    LoadSettings();    webview.loadUrl(LandingPage);}    /** Get Menu */    @Override    public boolean onCreateOptionsMenu(Menu menu) {     MenuInflater inflater = getMenuInflater();     inflater.inflate(R.menu.menu, menu);     return true;    }    /** an item gets pushed */    @Override public boolean onOptionsItemSelected(MenuItem item) {  switch (item.getItemId()) {  // We have only one menu option  case R.id.quit:   System.exit(0);   break;  case R.id.back:   webview.goBack();  case R.id.refresh:   webview.reload();  case R.id.info:   //IncludeJavascript("""");  }  return true; }/** Begin Globals */public WebView webview;public WebChromeClient webChromeClient;public WebViewClient webViewClient;public ProgressDialog loadingDialog; public Boolean HideDialogOnce; public Activity myProcess;public String OverideUserAgent_IE = ""Mozilla/5.0 (Windows; MSIE 6.0; Android 1.6; en-US) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2 myKMB/1.0"";public String LandingPage = ""http://kscserver.com/main-leap-slim.html"";public String MessageBegText = ""Problem making a connection, Details: "";public String MessageEndText = "" For Support Call: (xxx) xxx - xxxx."";public void LoadSettings() { webview.getSettings().setUserAgentString(OverideUserAgent_IE); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setBuiltInZoomControls(true); webview.getSettings().setSupportZoom(true);}/** Creates a message alert dialog */public void CreateMessage(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(message)        .setCancelable(true)        .setNegativeButton(""Close"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int id) {           dialog.cancel();          }        }); AlertDialog alert = builder.create(); alert.show();}}</code></pre><p><img src=""http://img413.imageshack.us/img413/9628/myapp.gif"" alt=""The background Application is my app, running in an emulator. The top application is the browser. You'll see the browser has the firebug icon, and can activate the firebug, but the application does not have the firebug icon.""></p><p>My Application is running in the background, and as you can see no Firebug in the lower right hand corner. However the browser (the emulator on top) has the same page but shows the firebug. What am I doing wrong? I'm assuming its either not enough memory allocated to the application, process power allocation, or a physical memory thing. I can't tell, all I know is the results are strange.</p><p>I get the same thing form my android device, the application shows no firebug but the browser shows the firebug.</p><p>I already have JavaScript on the web browser on, the problem is the web view is acting to different from the web browser.</p>","345442","","345442","","2010-06-07 21:48:47","2011-09-20 02:41:54","Android WebView not loading a JavaScript file, but Android Browser loads it fine","<android><android-sdk-1.6><android-webview>","1","3","2","",""
"2969037","1","3049037","","2010-06-03 19:17:20","46","24578","<p>I'm wondering how vector drawing in Android with the <code>Shape</code> class may resemble another vector drawing standard.</p><p>Since <code>Shape</code> is a <code>Drawable</code>, and Drawables are usually defined as XML, it sounds a lot like the vector drawing commands in SVG.</p><p>My question is this: Has anybody created an XSLT transformation, or other mechanism, for converting an SVG drawing description into Android Shapes?</p>","67875","","67875","","2010-06-14 15:25:19","2012-11-19 07:14:09","SVG to Android Shape","<android><svg><vector-graphics><shape>","6","2","26","2012-07-12 12:43:54",""
"2969111","1","2969246","","2010-06-03 19:27:21","1","222","<p>I am using ZipInputStream and BufferedOutputStream to decompress a file from a zip archive in Android 1.6.  The code runs without exceptions, but when I check the existance of the file, I can't find it.  I am just looking for the filename.  Is there an application directory that stores this file?  Do I need to specify a directory?</p>","291981","","","","","2010-06-03 19:48:00","Cannot find file after decompressing from archive in Android","<android><unzip>","1","0","","",""
"2969180","1","2970466","","2010-06-03 19:39:42","1","5241","<p>I have a question about postDelayed. The android docs say that it adds the runnable to the queue and it runs in the UI thread. What does this mean? </p><p>So, for example, the same thread I use to create my layout is used to run the Runnable?</p><p>What if I want it as an independent thread that executes while I am creating my layout and defining my activity?</p><p>ThanksChris</p>","334802","","","","","2010-06-03 23:15:29","Android - Question on postDelayed and Threads","<android><multithreading><runnable><postdelayed>","2","0","","",""
"2969242","1","","","2010-06-03 19:47:32","14","19518","<p>I'm new to Android development and I have a question/problem. </p><p>I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (<code>res/raw</code>) and it looks kind of easy.</p><p>To play a raw resource, the MediaPlayer has to be initialized like this:</p><p><pre><code>MediaPlayer mp = MediaPlayer.create(appContext, R.raw.song);mp.start();</pre></code></p><p>Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my application. Specifically when I add the ""Stop"" button/option.</p><p>Basically, what I want to do is...when I press ""Stop"", the music stops. And when I press ""Start"", the song/sound starts over. (pretty basic!)</p><p>To stop the media player, you only have to call <code>stop()</code>. But to play the sound again, the media player has to be reseted and prepared.</p><p><pre><code>mp.reset();mp.setDataSource(params);mp.prepare();</pre></code></p><p>The problem is that the method <code>setDataSource()</code> only accepts as params a file path, Content Provider URI, streaming media URL path, or File Descriptor.</p><p>So, since this method doesn't accept a resource identifier, I don't know how to set the data source in order to call <code>prepare()</code>. In addition, I don't understand why you can't use a Resouce identifier to set the data source, but you can use a resource identifier when initializing the MediaPlayer.</p><p>I guess I'm missing something. I wonder if I am mixing concepts, and the method <code>stop()</code> doesn't have to be called in the ""Stop"" button. Any help?</p><p>Thanks in advance!!!</p>","353261","","1321640","","2013-01-14 07:46:18","2013-09-16 11:40:17","Problems with MediaPlayer, raw resources, stop and start","<android><media-player><stop>","6","4","6","",""
"2969547","1","2969602","","2010-06-03 20:32:25","2","1097","<p>I'm trying some stuff out in Android and I'm stuck at when trying to cast a class in another .apk to my interface. I have the interface and various classes in other .apks that implement that interface. I find the other classes using PackageManager's query methods and use Application#createPackageContext() to get the classloader for that context. I then load the class, create a new instance and try to cast it to my interface, which I know it definitely implements.</p><p>When I try to cast, it throws a class cast exception. I tried various things like loading the interface first, using Class#asSubclass, etc, none of which work. Class#getInterfaces() shows the interface is implemented. My code is below:</p><pre><code>PackageManager pm = getPackageManager();    List&lt;ResolveInfo&gt; lr = pm.queryIntentServices(new Intent(""com.example.some.action""), 0);    ArrayList&lt;MyInterface&gt; list = new ArrayList&lt;MyInterface&gt;();    for (ResolveInfo r : lr) {        try {            Context c = getApplication().createPackageContext(r.serviceInfo.packageName, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE);            ClassLoader cl = c.getClassLoader();            String className = r.serviceInfo.name;            if (className != null) {                try {                    Class&lt;?&gt; cls = cl.loadClass(className);                    Object o = cls.newInstance();                    if (o instanceof MyInterface) { //fails                        list.add((MyInterface) o);                     }                } catch (ClassNotFoundException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } // some exceptions removed for readability            }        } catch (NameNotFoundException e1) {            e1.printStackTrace();        }    </code></pre>","240251","","","","","2010-06-03 20:47:46","Cast object to interface when created via reflection","<java><android><classloader><casting>","1","0","1","",""
"2969703","1","2970385","","2010-06-03 20:56:05","0","681","<p>I have limited SQL background, basically a small amount of manipulation through HTML and mostly with pre-existing databases. What I am trying to do is set up a database that will store time information for bus routes. So basically I have different routes with stops for each route and then a list of times that the bus arrives at each stop. Here is an example of a table of times from their website: <a href=""http://www.cyride.com/routes/Summer/WDRedSouth.html"" rel=""nofollow"">Link</a>.</p><p>I am wondering what would be the best way to layout my database/tables?</p><p>Also what is the purpose of the _id field in each table? </p><p>Thanks,Rob!</p><p>P.S. Sorry if my lack of knowledge on the subject has caused me to post a duplicate question. </p>","289153","","","","","2010-06-03 22:58:05","Getting started with SQLite (Android)","<android><sqlite>","2","1","","",""
"2969949","1","2970015","","2010-06-03 21:35:02","2","1081","<p>My app uses a WebView widget to load ads from Google AdManager.  AdManager gives you an HTML snippet, which is 90% JavaScript to call their server for the image to load.</p><ol><li>I put their html snippet into a string and use String.format to add in several variables that AdManager requires. </li><li>I enable JavaScript on the WebView (webView.getSettings().setJavaScriptEnabled(true);)</li><li>I load the string into the WebView (webView.loadData(myString, ""text/html"", ""UTF-8"");</li></ol><p>result:  the ad never loads (although the WebViewClient shows several .js resources loading).</p><p>If I take that exact string and create a file and then use webView.loadUrl(""file:///android_asset/test.html""), the image loads properly.</p><p>Why would loadUrl work but loadData does not?</p><p>BTW, I've verified that JavaScript is running.  I injected a little script to write out a text string and it works.  </p>","346166","","759866","","2014-02-02 19:52:03","2014-02-02 19:52:03","Can't Load Image in WebView via Javascript","<android>","1","0","1","",""
"2970111","1","","","2010-06-03 22:02:43","16","7304","<p>how can I get my fixed width site to always appear ""fully zoomed in"" on webkit (iphone and android) browsers?</p><p>right now, it looks fine on an iPhone and ""too small/zoomed out"" on an Android phones that have higher resolution.</p><p>i'm trying this viewport:</p><pre><code> &lt;meta name=""viewport"" content=""user-scalable=yes, width=device-width, target-densityDpi=device-dpi, initial-scale=1.0"" /&gt;</code></pre>","357951","","","","","2013-08-29 23:16:18","how can I get my fixed-width mobile website to always appear ""fully zoomed in""?","<iphone><html><css><android><mobile>","2","0","1","",""
"2970444","1","4725468","","2010-06-03 23:11:12","0","1843","<p>I am trying to display the name, phone number and email of a contact and letting the user update any of the values. For some reason, the value of email is overwritten on all three fields when my code is executed. There's got to be a glitch in the logic here, but I cannot figure it out.</p><p>Here's my method which updates the Contacts URI.</p><pre><code>private void updateContact() {    ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();    ops.add(ContentProviderOperation.newUpdate(ContactsContract.RawContacts.CONTENT_URI)            .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, name)            .build());    ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name)            .withValue(ContactsContract.Data.MIMETYPE,                        ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)            .build());    ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneNumber)            .withValue(ContactsContract.Data.MIMETYPE,                     ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)            .build());    ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.Data.MIMETYPE,                            ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)            .withValue(ContactsContract.CommonDataKinds.Email.DATA, email)            .build());    try {        getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);        // Display update        Context ctx = getApplicationContext();        CharSequence txt = ""Contact Updated"";        int duration = Toast.LENGTH_SHORT;        Toast toast = Toast.makeText(ctx, txt, duration);        toast.show();    } catch (Exception e) {        // Display warning        Context ctx = getApplicationContext();        CharSequence txt = ""Update Failed"";        int duration = Toast.LENGTH_SHORT;        Toast toast = Toast.makeText(ctx, txt, duration);        toast.show();    }}</code></pre>","289918","","","","","2011-02-19 03:50:21","Updating Contact causing wrong values to be written","<android>","2","0","1","",""
"2970660","1","2971191","","2010-06-04 00:01:21","2","693","<p>I've got the following code making SSL work with my HttpClient connections and such</p><pre><code>SchemeRegistry schemeRegistry = new SchemeRegistry();schemeRegistry.register(new Scheme(""https"",             SSLSocketFactory.getSocketFactory(), 443));HttpParams params = new BasicHttpParams();SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry);HttpClient client = new DefaultHttpClient(mgr, params);</code></pre><p>However, does this actually validate the cert?  It seems like there should be more to it.</p>","238849","","","","","2010-06-04 02:45:57","Android and SSL - checking certificate validity","<android>","1","0","","",""
"2970790","1","2970923","","2010-06-04 00:42:09","1","809","<p>my android application is handling a large database of bus passage time and we would like to allow others application to be able to display certains bus passage time. We would like to use a content provider to do that. Most example seems to be about using an SQL database, but... we use some custom text file. I was wondering what would be the best way to do that. I was thinking I could use a Content Provider and implement the Cursor interface on a custom object that I would manually fill with my text data. Would this be possible ? Anyone have a better idea (excluding changing to SQL lite of course) ?</p><p>Thanks in advance.</p>","211682","","","","","2010-06-04 01:18:05","Android Content Provider without SQL","<android>","1","0","","",""
"2970821","1","2971305","","2010-06-04 00:50:29","2","809","<p>I created multiple ExecutorService instances in my code, usually each UI page has one ExecutorService instance. Each ExecutorService instance will execute some http get request threads.</p><pre><code>private ExecutorService m_threadPool = Executors.newCachedThreadPool();</code></pre><p>Is it OK to do that?</p><p>The problem I met is that sometimes the http get requests got response code -1 from HttpURLConnection getResponseCode() call. I don't know whether it is caused by multiple threadpool instances.</p><p>Thanks. </p>","256239","","25507","","2010-06-04 00:57:35","2010-06-04 03:39:00","Is it OK to create multiple threadpools (ExecutorService)?","<java><android>","2","0","","",""
"2970844","1","","","2010-06-04 00:55:42","42","40732","<p>The Android Developers TabWidget tutorial says the following:</p><p>""You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities.""</p><p>The tutorial goes on to demonstrate how you can use tabs with separate Activities.  I have been unable to find an example of using tabs with different Views within the same Activity.  I would rather not re-invent this particular wheel, so I am hoping someone here knows how this is done and can clue me in.  Thanks!</p>","358032","","1279334","","2012-09-22 12:08:40","2013-08-06 07:12:19","Example of using Android tabs with Views instead of Activities?","<java><android><android-widget>","3","2","20","",""
"2970876","1","2975598","","2010-06-04 01:04:42","4","3704","<p>I'm new in Android development and I have the next question/problem. </p><p>I'm playing around with the MediaRecorder class to record just audio from the microphone. I'm following the steps indicated in the official site: <a href=""http://developer.android.com/reference/android/media/MediaRecorder.html"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaRecorder.html</a></p><p>So I have a method that initializes and configure the MediaRecorder object in order to start recording. Here you have the code:</p><pre><code>        //initializes audio recorder        MediaRecorder mrecorder = new MediaRecorder();        //configure the input sources        mrecorder.setAudioSource(MediaRecorder.AudioSource.MIC);        //set the output format        mrecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        //set the audio encoding        mrecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);        //specify the output file        mrecorder.setOutputFile(""/sdcard/test.3gp"");        //prepare for recording        try {            mrecorder.prepare();        } catch (IllegalStateException e) {             e.printStackTrace();            Log.d(""Syso"". e.toString());        } catch (IOException e) {             e.printStackTrace();            Log.d(""Syso"". e.toString());        }</code></pre><p>When I execute this code in the simulator, thanks to logcat, I can see that the method prepare() gives an exception when is called: </p><pre><code>java.io.FileNotFoundException: /sdcard/test.3gp (Permission denied)</code></pre><p>And I have no idea why this is happening. Due to the message of the exception, I've given permissions in the manifest to access to storage by adding the following line to the xml:</p><pre><code>&lt;uses-permission android:name=""android.permission.STORAGE"" /></code></pre><p>But this doesn't fix anything and I still get the same exception all the time. The SDCard is mounted according to the emulator, so I have no clue.</p><p>Can anyone give me some advise??</p><p>Thanks in advanced!!</p>","353261","","213269","","2011-08-15 21:02:01","2013-07-03 11:06:50","Problems with MediaRecorder class to record audio - prepare() gives an exception - Permission denied","<android><exception><audio-recording><permission-denied><mediarecorder>","1","0","","",""
"2970946","1","","","2010-06-04 01:26:24","1","792","<p>I keep getting this when I try install my app to the real phone.</p><p>E/PackageManager(   67): Package com.mobile.prototype requires unavailable shared library com.google.android.maps; failing!</p><p>The problem is solved when I use the google API emulator. The problem what is my app is eventually going to run on a phone and not an emulator. </p><p>Anyone has any solutions?</p>","358033","","","","","2010-06-04 01:26:24","INSTALL_FAILED_MISSING_SHARED_LIBRARY","<android>","0","2","","",""
"2971155","1","3081073","","2010-06-04 02:33:13","13","21440","<p>I need to extract information from an unstructured web page in Android. The information I want is embedded in a table that doesn't have an id.</p><pre><code>&lt;table&gt; &lt;tr&gt;&lt;td&gt;Description&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;I want this field next to the description cell&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;</code></pre><p>Should I use  </p><ul><li>Pattern Matching?</li><li>Use BufferedReader to extract the information?</li></ul><p>Or are there faster way to get that information?</p>","82368","","","","","2013-02-24 02:13:37","What is the fastest way to scrape HTML webpage in Android?","<html><android><http><webpage><webpagescraping>","6","0","23","",""
"2971307","1","","","2010-06-04 03:25:13","0","1721","<p>I'm trying to display a map using that rotates according to the phone's orientation. I have rewrite a part of the google sample to use a <code>SensorEventListner</code> instead of a <code>SensorListener</code>.</p><p>My Problem is when I try to use the <code>findViewByID()</code> method to display the map my application crashes on start. If I use <code>MapView(Context, String)</code> to create my view it works fine. Did I miss something to use main.xml layout file ? What's wrong with this ?</p><p>Thanks in advance.</p><p>Here is my code :</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);    mRotateView = new RotateView(this);    // Seems ok    mMapView = new MapView(this, ""0t6yfD1f6K1wZe99RmpB2KdpQHl23WZSPRtGLEg"");    // Does not work: application crash on launch.    //setContentView(R.layout.main);    //mMapView = (MapView) findViewById(R.id.mapview);    mRotateView.addView(mMapView);    setContentView(mRotateView);    mMyLocationOverlay = new MyLocationOverlay(this, mMapView);    mMyLocationOverlay.runOnFirstFix(new Runnable() {        public void run() {            mMapView.getController().animateTo(                    mMyLocationOverlay.getMyLocation());        }    });    mMapView.getOverlays().add(mMyLocationOverlay);    mMapView.getController().setZoom(18);    mMapView.setClickable(true);    mMapView.setEnabled(true);    mMapView.setBuiltInZoomControls(true);}</code></pre><p>AndroidManifest:</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.hello"" android:versionCode=""1""    android:versionName=""1.0""&gt;        &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;        &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""        android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;uses-library android:name=""com.google.android.maps"" /&gt;        &lt;activity android:name="".HelloGoogleMapsActivity""            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>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;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=""0t6yfD1f6K1wZe99RmpB2KdpQHl23WZSPRtGLEg""/&gt;&lt;/LinearLayout&gt;</code></pre><hr><pre><code>06-04 18:07:31.512: INFO/ActivityManager(66): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.hello/.HelloGoogleMapsActivity }06-04 18:07:31.842: INFO/ActivityManager(66): Start proc com.example.hello for activity com.example.hello/.HelloGoogleMapsActivity: pid=207 uid=10025 gids={3003, 1015}06-04 18:07:33.053: ERROR/ActivityThread(207): Failed to find provider info for com.google.settings06-04 18:07:33.063: ERROR/ActivityThread(207): Failed to find provider info for com.google.settings06-04 18:07:33.093: ERROR/ActivityThread(207): Failed to find provider info for com.google.settings06-04 18:07:33.282: DEBUG/qemud(34): fdhandler_accept_event: accepting on fd 1006-04 18:07:33.282: DEBUG/qemud(34): created client 0x150b8 listening on fd 1506-04 18:07:33.282: DEBUG/qemud(34): client_fd_receive: attempting registration for service 'sensors'06-04 18:07:33.282: DEBUG/qemud(34): client_fd_receive:    -&gt; received channel id 806-04 18:07:33.292: DEBUG/qemud(34): client_registration: registration succeeded for client 806-04 18:07:33.302: DEBUG/qemud(34): fdhandler_event: disconnect on fd 1506-04 18:07:33.312: DEBUG/SensorManager(207): found sensor: Goldfish 3-axis Accelerometer, handle=006-04 18:07:33.725: DEBUG/AndroidRuntime(207): Shutting down VM06-04 18:07:33.725: WARN/dalvikvm(207): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)06-04 18:07:33.732: ERROR/AndroidRuntime(207): Uncaught handler: thread main exiting due to uncaught exception06-04 18:07:33.772: ERROR/AndroidRuntime(207): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hello/com.example.hello.HelloGoogleMapsActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.os.Handler.dispatchMessage(Handler.java:99)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.os.Looper.loop(Looper.java:123)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at java.lang.reflect.Method.invokeNative(Native Method)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at java.lang.reflect.Method.invoke(Method.java:521)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at dalvik.system.NativeStart.main(Native Method)06-04 18:07:33.772: ERROR/AndroidRuntime(207): Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.addViewInner(ViewGroup.java:1856)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.addView(ViewGroup.java:1751)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.addView(ViewGroup.java:1708)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.addView(ViewGroup.java:1688)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at com.example.hello.HelloGoogleMapsActivity.onCreate(HelloGoogleMapsActivity.java:156)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-04 18:07:33.772: ERROR/AndroidRuntime(207):     ... 11 more06-04 18:07:33.812: INFO/Process(66): Sending signal. PID: 207 SIG: 306-04 18:07:33.822: INFO/dalvikvm(207): threadid=7: reacting to signal 306-04 18:07:33.962: INFO/dalvikvm(207): Wrote stack trace to '/data/anr/traces.txt'06-04 18:07:34.412: INFO/ARMAssembler(66): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x2aa9e8:0x2aaa8c] in 1786681 ns06-04 18:07:34.442: INFO/ARMAssembler(66): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x2ac4f8:0x2ac648] in 2802312 ns06-04 18:07:41.580: WARN/ActivityManager(66): Launch timeout has expired, giving up wake lock!06-04 18:07:42.550: WARN/ActivityManager(66): Activity idle timeout for HistoryRecord{4379c288 com.example.hello/.HelloGoogleMapsActivity}</code></pre><p>I think the problem is that I call setContentView() 2 times :</p><pre><code>setContentView(R.layout.main);mMapView = (MapView) findViewById(R.id.mapview);mRotateView.addView(mMapView);setContentView(mRotateView);</code></pre><p>I've tried to Comment the first setContentView(R.layout.main); but the application is still crashing at launch time. It result in a NullPointerException :</p><pre><code>06-05 10:30:10.272: WARN/dalvikvm(211): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)06-05 10:30:10.282: ERROR/AndroidRuntime(211): Uncaught handler: thread main exiting due to uncaught exception06-05 10:30:10.312: ERROR/AndroidRuntime(211): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hello/com.example.hello.HelloGoogleMapsActivity}: java.lang.NullPointerException06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.os.Handler.dispatchMessage(Handler.java:99)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.os.Looper.loop(Looper.java:123)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at java.lang.reflect.Method.invokeNative(Native Method)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at java.lang.reflect.Method.invoke(Method.java:521)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at dalvik.system.NativeStart.main(Native Method)06-05 10:30:10.312: ERROR/AndroidRuntime(211): Caused by: java.lang.NullPointerException06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.view.ViewGroup.addView(ViewGroup.java:1701)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.view.ViewGroup.addView(ViewGroup.java:1688)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at com.example.hello.HelloGoogleMapsActivity.onCreate(HelloGoogleMapsActivity.java:156)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-05 10:30:10.312: ERROR/AndroidRuntime(211):     ... 11 more</code></pre><p>Now I know where the problem commes from; but I don't know how to create my MapView using the main.xml file.</p><p>I'm using new MapView() instead; it does work, but is it the good way to do it?</p>","358092","","19679","","2014-02-25 19:42:21","2014-02-25 19:42:21","MapView: application crash on launched","<android><google-maps><android-mapview>","1","0","","",""
"2971320","1","2972795","","2010-06-04 03:29:38","4","6554","<p>I am adding MediaController to a VideoView, but it does not show up unless I tap the phone. The controller disappears after a while.</p><p>Is there a way I can have the MediaController show always?</p><p>ThanksChris</p>","321927","","","","","2011-11-24 03:45:30","Android Show MediaController","<android><controller><media><videoview>","2","0","1","",""
"2971668","1","2971998","","2010-06-04 05:19:41","0","678","<p>Is it possible to convert a Button into a TextView onclick during runtime?</p><p>ThanksChris</p>","321927","","","","","2010-06-04 06:38:55","Android - Convert Button to TextView at runtime","<android><button><runtime><textview>","2","0","","",""
"2971871","1","2973102","","2010-06-04 06:08:49","6","6393","<p>This is my manifest file. After using intent filter i download the ics file from the mail attachment. When i open the downloaded file it start my application. I need to get the file name and data of the selected file in my application. What should i do in the manifest and the java file. I am very new to android can any one help me????</p><pre><code>&lt;application android:label=""@string/app_name"" android:icon=""@drawable/icsicon""&gt;    &lt;activity android:name="".setMIMEfile"" android:label=""@string/app_name""&gt;     &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:mimeType=""*/*"" /&gt;        &lt;data android:pathPattern="".*\\.ics"" /&gt;         &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","351928","","114066","","2010-06-04 07:27:00","2013-11-23 07:04:43","How to get the file name from the intent?","<android><android-intent><intentfilter>","4","0","1","",""
"2972055","1","","","2010-06-04 06:53:37","0","5363","<p>I am new to android. I am trying to learn and work on it. Can some one help me with the following issue.I have some fields to be encrypted and uploaded to a DB using android.The fields which should be encrypted are DOB, Email id, Phone number and some other numeric values.Now I am doing some formal encryption by substitution.Can some one help me with an example to do some standard form of encryption.</p>","357273","","1108213","","2012-03-07 13:15:32","2013-12-10 16:23:29","how to encrypt data in android?","<android>","2","0","1","",""
"2972109","1","","","2010-06-04 07:02:32","0","477","<p>I have an activity that I want to show up when the phone goes to sleep. However, the phone wakes up when I press the volume buttons or the camera button.</p><p>I tried using the dispatchKeyEvent(KeyEvent event) method, but it doesn't prevent the phone from waking up. </p><p>How else can I disable that functionality?</p><p>Thanks,</p>","358894","","","","","2012-10-20 19:16:26","How to prevent volume keys and camera key from waking up phone in Android?","<android><camera><key><volume>","1","2","","",""
"2972485","1","2972667","","2010-06-04 08:18:04","6","7512","<p>I'm told by some users that my Android app is not usable because their device does not have a MENU key.</p><p>What's the best way to deal with these devices? Is it possible to detect if the device lack a MENU key and show a menu button only in this case?</p><p>And most importantly, how do you test this in the simulator?</p><p>Thanks.</p><p><strong>Edit</strong>: Apparently the problem was that the users didn't know that the Menu key was called the Menu key.</p><p><strong>Edit</strong>: Also, some unofficial Android devices like the Eken and aPad don't have a physical menu key.</p>","143378","","143378","","2010-06-27 03:04:42","2013-07-27 10:29:05","Dealing with Android devices without MENU key","<android><menu>","3","5","1","",""
"2972486","1","","","2010-06-04 08:18:26","2","410","<p>I tried to ad admob to my app but it would not request anything from the site. I followed all of the directions but in the logs I could see that a request went to api.admob.com but that was the end of it. It seems as if nothing was returned. I tried test mode and regular mode and got the same results with both. </p><p>I guess my question is, is there anything missing from the Admob docs or should it work if I follow the directions exactly?</p>","282475","","","","","2010-06-08 20:40:58","Ad Mob on Android Problems","<android><admob>","1","3","","",""
"2972845","1","","","2010-06-04 09:23:41","33","28978","<p>I am working on a multimedia application. I am capturing one image through the camera and want to send that image with a text to some other number. But I am not getting how to send the image via the MMS.</p>","358287","","775361","","2011-11-10 21:40:21","2013-07-19 20:11:39","How to send image via MMS in Android?","<android><messaging><mms>","4","1","38","",""
"2973270","1","2973931","","2010-06-04 10:28:23","69","52497","<p>I want to use a custom font for my android application which I am creating.<br>I can individually change the typeface of each object from Code, but I have hundreds of them.</p><p>So,</p><ul><li>Is there a way to do this from the XML? [Setting a custom typeface]</li><li>Is there a way to do it from code in one place, to say that the whole application and all the components should use the custom typeface instead of the default one?</li></ul><p>Thanks.<br>-Codevalley</p>","177890","","234938","","2010-06-04 17:58:31","2014-01-16 05:53:42","Using a custom typeface in Android","<xml><android><layout><fonts>","13","3","44","",""
"2973290","1","2973334","","2010-06-04 10:32:41","6","16267","<p>I would need to check the wifi is on or off in the phone at the runtime?</p><p>if it is not connected, i want to show dialog and goto directly Setting/Wireless Controls to enable it by user.</p><p>its for both wifi and <strong>Gps staus</strong> of the phone. How to do it? which intent to wake for this? Any idea?</p>","267269","","267269","","2010-06-04 13:28:14","2014-04-03 11:24:06","Check WiFi and GPS isConnected or Not in Android?","<android><gps><wifi>","3","0","7","",""
"2973679","1","12451182","","2010-06-04 11:32:26","1","1687","<p>When displaying custom dialog box which is showing textView and EditView. How can i access these elements within dialog. Below is the code which is giving error.</p><pre><code>LayoutInflater factory = LayoutInflater.from(this);            final View textEntryView = factory.inflate(R.layout.alert_dialog_text_entry, null);            return new AlertDialog.Builder(AlertDialogSamples.this)                .setIcon(R.drawable.alert_dialog_icon)                .setTitle(R.string.alert_dialog_text_entry)                .setView(textEntryView)                .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                     string = uetd.getText().toString() + "":"" + petd.getText().toString(); /////producing error                    }                })                .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        /* User clicked cancel so do some stuff */                    }                })                .create();</code></pre><hr><pre><code>public class listdemo extends ListActivity {    /** Called when the activity is first created. */    private static final int DIALOG_TEXT_ENTRY = 7;    EditText uetd;    EditText petd;    SharedPreferences.Editor editor;    String string;@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));        ListView lv = getListView();        lv.setTextFilterEnabled(true);     uetd=(EditText)findViewById(R.id.username_edit);      petd=(EditText)findViewById(R.id.password_edit);lv.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,                long id) {    showDialog(DIALOG_TEXT_ENTRY);}        });}}</code></pre>","301549","","301549","","2010-06-04 11:47:59","2012-09-16 22:13:02","Access controls within custom alert dialog in android","<android>","2","4","0","",""
"2973982","1","","","2010-06-04 12:18:43","20","17975","<p>I'm looking for a very simple ORM framework working on Android for SQLite. I've been testing <a href=""http://www.activeandroid.com"">ActiveAndroid</a> but none of the example could ever build on Eclipse.<br>By the way, how do guys implement a ""many to many"" relationship in SQLite for Android? How do you reflect the cascade regarding deletion of rows and guarantee the database integrity? </p>","358427","","356895","","2013-02-05 18:05:22","2013-04-13 18:13:29","ORM on Android SQLite and database scheme","<android><sqlite><orm><many-to-many><crud>","6","0","9","2013-04-15 15:57:35",""
"2974095","1","2974631","","2010-06-04 12:32:27","1","96","<p>My first screen has the alert message when I accept the alert I have to show the next screen and pass some values to that screen to show that values.I am very new to android.</p><pre><code>new AlertDialog.Builder(this)    .setTitle(""File accept!"")    .setMessage(""Do you Want to open ""+name+"" file !!"")    .setPositiveButton(""Open"", new DialogInterface.OnClickListener()    {        public void onClick(DialogInterface dlg,int acc)        {            //here i need to open a new screen        }    })    .setNegativeButton(""Close"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dlg, int sumthin) {    // do nothing – it will close on its own    }    })        .show();    }   </code></pre><p>--Thanks in advance</p>","351928","","351928","","2010-06-04 13:28:29","2010-06-04 13:39:40","How to open a new screen at the time of accepting the alert?","<android>","1","1","","",""
"2974185","1","2974227","","2010-06-04 12:41:59","3","4284","<p>I can't find much information out there on Android's hardware compass. I keep trying to setup my criteria to force Android to use the hardware  compass. Basically my problem is I want the bearing to update even while the device is stationary. From my understanding the GPS will only update your bearing when your moving. I'd like bearing to update regardless if your moving or not. I've tried tricking the device in to thinking it's moving by setting the speed at a constant 10 but the bearing returns 0.0 always.My device for testing (currently) is a HTC tattoo. It has a compass so that's not the problem.So my question is, is there a way to get the bearing to update using hardware compass or not? regardless if your moving or not?</p><p>Thanks, </p>","358438","","","","","2010-06-04 13:03:25","Android, Using the hardware compass","<java><android><sensor>","1","0","","",""
"2974261","1","","","2010-06-04 12:51:57","6","17084","<p>I am trying to get the HelloWebView Sample up and running (as is, with no cuustomizations) found at </p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-webview.html"">http://developer.android.com/resources/tutorials/views/hello-webview.html</a></p><p>I continue to get java.lang.SecurityException: Permission Denial despite all efforts.  In my mind this has got to be some fundamental lack of understanding on my part (I am a newbie) or something perhaps local to my development environment (Windows XP).</p><p>I have included my main.xml, AndroidManifest.xml, and console output below.</p><p>Things tried so far:</p><ul><li>different api's (6,7)</li><li>adding/verifying (I think :)) that ""uses-permission android:name=""android.permission.INTERNET"""" has the correct syntax and location in my manifest.</li><li>wiping emulator</li><li>restarting eclipse, laptop etc.</li><li>disabling my internet security </li></ul><p>Any help would be greatly appreciated.</p><p>Thank you.Tim</p><p>my main xml 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;WebView    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt; </code></pre><p>my manifest file is:</p><p></p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".HelloWebView""              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="".HelloWebView"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar""&gt;    &lt;/activity&gt; &lt;/application&gt;</code></pre><p> </p><p>Actual console output:</p><pre> ------------------------------[2010-06-04 07:57:06 - HelloWebView] Android Launch![2010-06-04 07:57:06 - HelloWebView] adb is running normally.[2010-06-04 07:57:06 - HelloWebView] Performing com.example.hellowebview.HelloWebView activity launch[2010-06-04 07:57:06 - HelloWebView] Automatic Target Mode: launching new emulator with compatible AVD 'AndroidGM2.1'[2010-06-04 07:57:06 - HelloWebView] Launching a new emulator with Virtual Device 'AndroidGM2.1'[2010-06-04 07:57:08 - HelloWebView] New emulator found: emulator-5554[2010-06-04 07:57:08 - HelloWebView] Waiting for HOME ('android.process.acore') to be launched...[2010-06-04 07:57:34 - HelloWebView] WARNING: Application does not specify an API level requirement![2010-06-04 07:57:34 - HelloWebView] Device API version is 7 (Android 2.1)[2010-06-04 07:57:34 - HelloWebView] HOME is up on device 'emulator-5554'[2010-06-04 07:57:34 - HelloWebView] Uploading HelloWebView.apk onto device 'emulator-5554'[2010-06-04 07:57:35 - HelloWebView] Installing HelloWebView.apk...[2010-06-04 07:57:46 - HelloWebView] Success![2010-06-04 07:57:47 - HelloWebView] Starting activity com.example.hellowebview.HelloWebView on device [2010-06-04 07:57:55 - HelloWebView] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellowebview/.HelloWebView }[2010-06-04 07:57:55 - HelloWebView] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellowebview/.HelloWebView } from null (pid=-1, uid=-1) requires null</pre>","358455","","1228","","2013-08-15 14:45:33","2014-02-07 22:13:17","HelloWebView Sample: java.lang.SecurityException: Permission Denial","<android><permissions>","2","0","","",""
"2974275","1","2974749","","2010-06-04 12:53:44","0","323","<p>Can i get informed in my android application when a user adds a new entry in his calendar application (i.e. via listeners, ...) or is checking the calendar every now and then via the content provider of the calendar app the only solution to find out if the user has added new entries ?</p>","343482","","","","","2010-06-04 13:56:29","Is there a way to get notified when a user adds a new calendar entry","<android><calendar>","1","0","","",""
"2974276","1","2974763","","2010-06-04 12:53:46","3","8231","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/2912209/how-to-create-startup-application-in-android"">how to create startup application in android?</a><br>  <a href=""http://stackoverflow.com/questions/1056570/how-to-autostart-an-android-application"">How to Autostart an Android Application?</a>  </p></blockquote><p>Hi,</p><p>I am trying in one of my application when i am going to start i mean power on my google android g1 my application automatically will start but i am unable to understand how can i do that please help......</p>","343678","","","","","2010-06-04 15:02:45","Run my application in background when i start device power on in android","<android>","1","2","5","2010-06-06 09:10:40",""
"2974464","1","2974515","","2010-06-04 13:15:24","5","575","<p>I'm trying to list Web features (HTML, CSS, Javascript, APIs)that can be used for mobile web pages, things we don't usuallyuse on Desktop browsers.</p><p>So far, I have:</p><ul><li>geolocation</li><li>orientation</li><li>viewport (width, scale)</li><li>touch-events</li><li>tap-highlight-color</li><li>map and youtube links open in a dedicated app</li><li>tel: links support</li><li>specific keyboard layout depending on the form (type=number, email, ...)</li></ul><p>What do I miss here?</p><p>The question would be: ""If I am a Desktop Web developer, what should I consider to build a mobile version of my website?""</p>","256130","","","","","2010-06-04 13:47:49","What are the iphone/android specific Web features?","<iphone><android><mobile><html5>","1","0","","",""
"2974487","1","","","2010-06-04 13:17:51","5","1063","<p>general video players connect the media server through unicast but I need a player to receive media stream using multicast/broadcast.</p><p>scenario:     Media Server ---> AP --(multicast/broadcast video stream)--> player(android phone)</p><p>is there any Android SDK to support this function?or is there any solution without developing software codec and RTP stack?</p><p>James.</p>","358476","","","","","2011-09-28 06:20:13","How to develop a video player that receives video stream on wi-fi broadcasting/multicasting?","<android><video><player><codec>","1","0","","",""
"2974553","1","2974707","","2010-06-04 13:27:50","7","7343","<p>I've scoured the interwebs and found many posts regarding how to change the colors of a list view using a list selector.  However it does not seem to work for me.  So my question would be what am I doing wrong?</p><p>When I use the below files I get a list where all item backgrounds are initially blue.  (I expected white)  </p><p>When I move the focus up and down the text just changes to a dark grey and the item backgrounds are still blue.  (This is when I would expect a single row to be blue with the rest white)</p><p>When I click on a row the background of the row I clicked on turns black and all other rows turned green.  (I expected to have the row I clicked turn green and the rest be white)</p><p>Here is my main layout 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;ListView    android:id=""@android:id/list""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:listSelector=""@drawable/item_selector""    /&gt;&lt;TextView    android:id=""@android:id/empty""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/empty""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is my list item file:</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;CheckBox        android:id=""@+id/checkbox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:focusable=""false""        /&gt;    &lt;TextView         android:id=""@+id/title""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:ellipsize=""end""        android:singleLine=""true""         android:textStyle=""bold""        android:padding=""7dip""        android:textSize=""18sp""        android:layout_toRightOf=""@id/checkbox""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here is my colors file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;color name=""red""&gt;#ff00&lt;/color&gt;    &lt;color name=""green""&gt;#f0f0&lt;/color&gt;    &lt;color name=""blue""&gt;#f00f&lt;/color&gt;    &lt;color name=""white""&gt;#ffff&lt;/color&gt;&lt;/resources&gt;</code></pre><p>Here is my selector 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:state_pressed=""true""         android:drawable=""@color/green"" /&gt;    &lt;item         android:state_focused=""true""         android:drawable=""@color/blue"" /&gt;    &lt;item         android:drawable=""@color/white"" /&gt;&lt;/selector&gt;</code></pre><p>Hopefully it's something dumb and simple that I'm doing wrong.</p><p>Thanks in advance.</p>","289641","","","","","2014-03-13 02:10:56","Customizing Android ListView Colors?","<android><listview>","2","1","2","",""
"2974792","1","","","2010-06-04 14:01:15","3","931","<p>We need to make an application that runs on iPhone, Android and BB. What is the best approach to write the least ammount of code? I know about some frameworks but I am not sure the best approach.</p>","","samuel morhaim","","","","2011-08-12 13:44:13","What is the best approach to develope a multi-platform mobile application?","<iphone><android><blackberry><mobile>","5","2","2","",""
"2974798","1","3053020","","2010-06-04 14:01:35","4","7663","<p>I'd like to use the <code>ZipFile</code> class to unzip a file using its name from an archive of multiple files. How can I get the string of the zip file name and directory to pass to the <code>ZipFile</code> constructor?</p>","291981","","","user1521536","2013-03-28 02:23:49","2013-03-28 02:23:49","Unzip file from zip archive of multiple files using ZipFile class","<android><unzip><zipfile>","1","2","3","",""
"2974862","1","","","2010-06-04 14:07:39","47","55042","<p>I have an ImageView with a source image set in the xml using the following syntax:</p><pre><code>   &lt;ImageView       android:id=""@+id/articleImg""      style=""@style/articleImgSmall_2""      android:src=""@drawable/default_m"" /&gt;</code></pre><p>now I need to change this image programmatically. What I need to do is delete the old image and add a new one though. What I have done is this:</p><pre><code>myImgView.setBackgroundResource(R.drawable.monkey);</code></pre><p>it works but I noticed android stacks the new image on top of the old one (dont ask me how I found out it's not relevant for the discussion :). I definitely need to get rid of the old one before setting the new image.</p><p>how can I achieve that?</p><p>thanks</p>","87624","","","","","2013-09-04 13:29:38","changing ImageView source","<android>","3","1","7","",""
"2975197","1","8370299","","2010-06-04 14:48:06","48","48290","<p>What's the easiest way to convert from a <code>file:</code> <code>android.net.Uri</code> to a <code>File</code> in Android?</p><p>Tried the following but it doesn't work:</p><pre><code> final File file = new File(Environment.getExternalStorageDirectory(), ""read.me""); Uri uri = Uri.fromFile(file); File auxFile = new File(uri.toString()); assertEquals(file.getAbsolutePath(), auxFile.getAbsolutePath());</code></pre>","143378","","527702","","2012-08-08 05:53:18","2014-04-10 19:42:11","Convert file: Uri to File in Android","<android><file><uri><file-uri>","5","1","15","",""
"2975369","1","2975514","","2010-06-04 15:06:34","1","146","<p>I have a particular collection of code along with some XML files that I need to share with every application I will make. </p><p>At the moment I can't because as far as I am aware there is no way to do this.  This seems like a massive oversight by the development team.</p><p>If the code needs changing, I have to change it in every app that I create - and will create in the future.</p><p>Are there any ways to share code in android yet?</p><p>I am using Eclipse for development.</p>","248521","","","","","2010-06-04 15:25:15","Sharing Android code (Is there really no way to do this?)","<android>","3","0","1","",""
"2975396","1","2975527","","2010-06-04 15:09:03","5","1014","<p>I need to get item's index(position) knowing its ID while using ExpandableListView.Is there any way to do this without making complete hash id->index and searching it?</p><p>Thanks</p>","218783","","","","","2010-06-04 15:26:02","Getting item's index from id in ExpandableListView","<android>","1","0","","",""
"2975406","1","2975496","","2010-06-04 15:10:23","0","1209","<p>How do you create unit tests for an Android activity that starts async tasks in <code>onCreate</code>? I would like to test the result of these tasks.</p>","143378","","","","","2010-06-04 15:22:28","Testing Android activity with async tasks","<android><unit-testing><android-asynctask>","1","0","1","",""
"2975469","1","2975498","","2010-06-04 15:19:04","23","26713","<p>I read on many other topics that the Android emulator starts really slow. Indeed, it takes +15 mins to start. However, on my machine is slow even after that.</p><p>The 'phone' responds with a 3-4 seconds delay and everything has a huge lag.</p><p>Is there any way to improve the performance of my laptop (Asus 1201N) is too rusty for the Android emulator?</p><p>PS: Tried in different emulator resolutions and the result is the same</p><p>Edit: My laptop has 2 cores with HyperThreading. And it shows as 4 CPU in Device Manager. However, when using the emulator, just one of the graphs is at 100%. Can I do something to make it work multi core?</p>","358593","","149841","","2011-08-23 15:06:31","2013-02-22 07:43:53","Speed up Android emulator","<android><windows><android-emulator><qemu>","8","1","10","",""
"2975536","1","","","2010-06-04 15:26:54","3","913","<pre><code>package edu.ohio.android.bmm.activity;import android.content.Context;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.CursorAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import edu.ohio.android.bmm.R;import edu.ohio.android.bmm.db.BMMDBOpenHelper.Diary;public class DiaryList extends BMMActivity { // Cursor for sqlite database private Cursor cursor; private LayoutInflater mInflater; // Icons bound to rows private Bitmap mild; private Bitmap moderate; private Bitmap severe; /***  *   */ @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  cursor = fetchAllDiary();  this.setListAdapter(new DiaryListAdapter(this, cursor, true)); } /**  *   * @author vycon  *  */ public class DiaryListAdapter extends CursorAdapter {  /**   *    * @param context   * @param cursor   * @param autoRequery   */  public DiaryListAdapter(Context context, Cursor cursor, boolean autoRequery) {    super(context, cursor, autoRequery);    mInflater = LayoutInflater.from(context);    // icons bound to the rows    mild = BitmapFactory.decodeResource(context.getResources(), R.drawable.mild);    moderate = BitmapFactory.decodeResource(context.getResources(), R.drawable.moderate);    severe = BitmapFactory.decodeResource(context.getResources(), R.drawable.severe);   }  /**   *    */  @Override  public void bindView(View view, Context context, Cursor cursor) {   TextView tvStartTime = (TextView) view.findViewById(R.id.diary_list_row_dateAndTime);   TextView tvDuration = (TextView) view.findViewById(R.id.diary_list_row_duration);   TextView tvSymptom = (TextView) view.findViewById(R.id.diary_list_row_symptom);   TextView tvMedication = (TextView) view.findViewById(R.id.diary_list_row_medication);   ImageView ivMaxSeverity = (ImageView) view.findViewById(R.id.diary_list_row_maxSeverity);   ImageView ivInitSeverity = (ImageView) view.findViewById(R.id.diary_list_row_initSeverity);   String maxSeverity = cursor.getString(cursor.getColumnIndex(Diary.MAX_SEVERITY));   String initSeverity = cursor.getString(cursor.getColumnIndex(Diary.INIT_SEVERITY));   tvStartTime.setText(cursor.getString(cursor.getColumnIndex(Diary.START_TIME)));   tvDuration.setText(cursor.getString(cursor.getColumnIndex(Diary.DURATION)));   tvSymptom.setText(cursor.getString(cursor.getColumnIndex(Diary.SYMPTOM)));   tvMedication.setText(cursor.getInt(cursor.getColumnIndex(Diary.MEDICATION_ID)));   if (maxSeverity.equalsIgnoreCase(""mild"")) {    ivMaxSeverity.setImageBitmap(mild);   }   if (maxSeverity.equalsIgnoreCase(""moderate"")) {    ivMaxSeverity.setImageBitmap(moderate);   }   if (maxSeverity.equalsIgnoreCase(""severe"")) {    ivMaxSeverity.setImageBitmap(severe);   }   if (initSeverity.equalsIgnoreCase(""mild"")) {    ivInitSeverity.setImageBitmap(mild);   }   if (initSeverity.equalsIgnoreCase(""moderate"")) {    ivInitSeverity.setImageBitmap(moderate);   }   if (initSeverity.equalsIgnoreCase(""severe"")) {    ivInitSeverity.setImageBitmap(severe);   }  }  /**   *    */  @Override  public View newView(Context context, Cursor cursor, ViewGroup parent) {   final View view = mInflater.inflate(R.layout.diary_list_view, parent, false);   return view;  } } /**  *   */ @Override protected void onListItemClick(ListView l, View v, int position, long id) {  // TODO Auto-generated method stub  super.onListItemClick(l, v, position, id); }}</code></pre>","342698","","329637","","2010-06-04 15:29:57","2010-06-04 15:47:24","findviewbyid() returns null - in a custom CursorAdapter bindview()","<android><listview>","1","0","","",""
"2975596","1","","","2010-06-04 15:35:53","2","2504","<p>i am trying to authenticate something(in this case LinkedIn) using OAuth but the requested token always returns null?</p><p>Here is my code below:</p><pre><code>public void authenticateAppOauthApi() {        Log.d(TAG, ""authenticateAppOauthApi"");        OAuthServiceProvider provider = new OAuthServiceProvider(                REQUEST_TOKEN_PATH, AUTHORIZE_PATH, ACCESS_TOKEN_PATH);        OAuthConsumer consumer = new OAuthConsumer(CALLBACK_URL, API_KEY,                SECRET_KEY, provider);        OAuthAccessor accessor = new OAuthAccessor(consumer);        Intent intent = new Intent(Intent.ACTION_VIEW);        Log.d(TAG, ""Intent intent = new Intent(Intent.ACTION_VIEW );"");        // intent.setData(Uri.parse(url));        String url = accessor.consumer.serviceProvider.userAuthorizationURL                + ""?oauth_token="" + accessor.requestToken + ""&amp;oauth_callback=""                + accessor.consumer.callbackURL;        intent.setData(Uri.parse(url));        Log.d(TAG, ""intent.setData(Uri.parse(url)); = "" + url);        mContext.startActivity(intent);        Log.d(TAG, ""finish authenticateApp"");}</code></pre><p>I basicaly followed the example here <a href=""http://donpark.org/blog/2009/01/24/android-client-side-oauth"" rel=""nofollow"">http://donpark.org/blog/2009/01/24/android-client-side-oauth</a></p><p>thanks in advance</p>","357652","","","","","2011-06-28 19:18:00","OAuth Request token = null in android app","<android><oauth>","4","1","1","",""
"2975608","1","","","2010-06-04 15:38:09","1","6073","<p>I am looking for some examples of using xpath in Android?  Or if anyone can share their experiences.  I have been struggeling to make tail or head of this problem :-(</p><p>I have a string that contains a standard xml file.  I believe I need to convert that into an xml document.  I have found this code which I think will do the trick:</p><pre><code>public static Document stringToDom(String xmlSource) throws SAXException, ParserConfigurationException, IOException {    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();    DocumentBuilder builder = factory.newDocumentBuilder();    return builder.parse(new InputSource(new StringReader(xmlSource)));}</code></pre><p><strong>Next steps</strong>Assuming the code above is OK, I need to apply xpath to get values from cat: ""/animal/mammal/feline/cat""</p><p>I look at the dev doc here: <a href=""http://developer.android.com/reference/javax/xml/xpath/XPath.html"" rel=""nofollow"">http://developer.android.com/reference/javax/xml/xpath/XPath.html</a> and also look online, but I am not sure where to start!</p><p>I have tried to use the following code:</p><pre><code> XPathFactory xPathFactory = XPathFactory.newInstance();// To get an instance of the XPathFactory object itself.XPath xPath = xPathFactory.newXPath();// Create an instance of XPath from the factory class.String expression = ""SomeXPathExpression"";XPathExpression xPathExpression = xPath.compile(expression);// Compile the expression to get a XPathExpression object.Object result = xPathExpression.evaluate(xmlDocument);// Evaluate the expression against the XML Document to get the result.</code></pre><p>But I get ""Cannot be resolved"".  Eclipse doesn't seem to be able to fix this import.  I tried manually entering:</p><pre><code>javax.xml.xpath.XPath</code></pre><p>But this did not work.</p><p>Does anyone know any good source code that I can utilise, for Android platform?  1.5</p>","358616","","358616","","2010-06-04 16:01:14","2011-11-06 23:54:51","Using XPath on String in Android (JAVA)","<java><xml><android><xpath>","2","1","1","",""
"2976209","1","2976300","","2010-06-04 16:57:38","2","1963","<p>edit: This is an Android project.  My problem arose when I added a new .wav file to my 'raw' folder.</p><p>I seem to have gotten into an endless loop in Eclipse.  I deleted my R.java file from my project.  Choosing to ""Clean"" or ""Build Project"" has no effect (i.e. doesn't generate an R.java file, or put anything into the 'gen' folder, or create any .class files in the 'assets' folder).  </p><p>I don't have the wrong package name in any of my classes or in my manifest.</p><p>I don't have any errors in any of my .xml files.</p><p>Every reference to 'R' in my classes are marked as errors, because the R.java file does not exist.</p><p>What can I do??</p>","355663","","355663","","2010-06-04 17:06:19","2012-12-12 00:04:23","Cannot create R.java b/c project has errors...errors result from lack of R.java","<android><eclipse><compilation>","4","2","","",""
"2976384","1","3030898","","2010-06-04 17:26:58","3","1324","<p>I am developing an application in Eclipse build ID 20090920-1017 using android SDK 2.2 and testing on a Google Nexus One. For the purposes of the tests below I am using the IME ""Android keyboard"" on a non-rooted phone.</p><p>I have an EditText widget which exhibits some very strange behavior. I can type text, and then press the ""del"" key to delete that text; but after I enter a 'space' character, the ""del"" key will no longer remove characters before that space character.</p><p>An example speaks a thousand words, so consider the following two incredibly simple applications...</p><p>Example 1: An EditText in a LinearLayout widget:</p><pre><code>package com.example.linear.edit;import android.app.Activity;import android.os.Bundle;import android.view.ViewGroup.LayoutParams;import android.widget.EditText;import android.widget.Gallery;import android.widget.LinearLayout;public class LinearEdit extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);                LinearLayout layout = new LinearLayout(getApplicationContext());        layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT));        EditText edit = new EditText(getApplicationContext());        layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));         setContentView(layout);    }}</pre><p></code></p><p>Run the above application, enter text ""edit example"", then press the ""del"" key several times until the entire sentence is deleted. Everything Works fine.</p><p>Now consider example 2: An EditText in a Gallery widget:</p><pre><code>package com.example.gallery.edit;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.view.ViewGroup.LayoutParams;import android.widget.ArrayAdapter;import android.widget.EditText;import android.widget.Gallery;import android.widget.LinearLayout;public class GalleryEdit extends Activity{    private final String[] galleryData = {""string1"", ""string2"", ""string3""};    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);                Gallery gallery = new Gallery(getApplicationContext());        gallery.setAdapter(new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, galleryData)        {            @Override            public View getView(int position, View convertView, ViewGroup parent)            {                LinearLayout layout = new LinearLayout(getApplicationContext());                layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT));                EditText edit = new EditText(getApplicationContext());                layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));                 return layout;            }        });        setContentView(gallery);    }}</pre><p></code></p><p>Run the above application, enter text ""edit example"", then press the ""del"" key several times. If you are getting the same problem as me then you will find that you can't deleted past the 'space' character. All is not well.</p><p>If anyone could shed some light on this issue I would be most appreciative.</p><p>Regards</p>","358673","","358673","","2010-06-04 18:34:05","2011-08-09 15:29:25","Soft keyboard ""del"" key fails in EditText on Gallery widget","<android><widget><gallery><edittext>","2","0","","",""
"2976455","1","","","2010-06-04 17:38:01","1","729","<p>I would like to have my android app ignore flip, is that possible? I added android:screenOrientation=""portrait"" to all of my activities but that is about as effective as the close door button on an elevator.</p>","282475","","30618","","2010-06-04 17:51:19","2010-06-04 17:51:19","Android Ignore Flip","<android><orientation>","1","3","","",""
"2976478","1","2980119","","2010-06-04 17:42:03","0","1008","<p>I need to make my client talk to a XML-RPC service. I found a couple of interesting ones on the web like android-xmlrpc. Have you used any such libraries in your code? Which library do you recommend?</p>","82368","","","","","2012-03-28 16:49:59","Which XML-RPC library do you recommend for Android?","<android><web-services><service><xml-rpc>","2","0","","",""
"2976548","1","","","2010-06-04 17:56:12","5","828","<p>If I write a native Android application that uses android.webkit.WebView, how do I enable WebKitDeveloperExtras for it? I would like to be able to enable real script debugging via Web Inspector, not just dumping to a console.</p>","358729","","","","","2011-12-23 17:07:42","How to enable WebKitDeveloperExtras on Android's WebView","<android><webkit><webview><web-inspector>","1","2","","",""
"2976694","1","2976713","","2010-06-04 18:20:00","1","3018","<p>I have an app that displays a video using VideoView. The layout consists of a Clock and a VideoView laid out in a simple vertical LinearLayout.</p><p>Here's my code snippet that I use:</p><pre><code>VideoView mVideoView = new VideoView(this);mVideoView.setVideoPath(myVideoURL);mVideoView.requestFocus();mVideoView.start();</code></pre><p>Since the buffering of the video takes about 8-10 seconds, the layout comes up with the Clock, but the VideoView stays blank. What I want to achieve is this:</p><p>-- Display an ImageView for the 10s while the video is buffering-- Detect when the video is ready to be played (onPrepared?)-- Show the Clock and VideoView and start the Video</p><p>Anyone have pointers on how to go about this?</p><p>ThanksChris</p>","334802","","186636","","2012-04-11 22:42:21","2012-04-11 22:42:21","Android Show image while video is buffering?","<android><buffer><imageview><videoview>","1","0","1","",""
"2976895","1","2977458","","2010-06-04 18:49:26","1","250","<p>When I create an 'Android Library Project' is it OK to put a whole lot of different libraries in there and create a number of different packages?</p><p>If I use just one or two components from the library, will it import all the resources and packages or is it smart enough to only import the referenced resources and packages that are needed?</p><p>The alternative is to create a single 'Android Library Project' for each component which I don't want to do if I can help it.</p>","248521","","","","","2010-06-04 20:11:46","Can you put many packages inside a single 'Android Libray Project'?","<android>","1","0","0","",""
"2976927","1","2977064","","2010-06-04 18:54:57","6","5740","<p>I am building an app for Android 2.1 that provides notifications based on calendar events. But I'm aware there are issues with the Calendar API not being readily available / stable / whatever.</p><p>What I'd like to do is somehow communicate with the user's Google Calendar to get a list of tasks every few hours, or perhaps when the calendar is updated, and then store that data locally so they don't need to have an active internet connection at all times.</p><p>Then at a particular time, the notifcation event would occur.</p><p>Surely, someone must have determined a way to interface with Google Calendar? I'm sure there must be numerous apps and solutions available that connect to it already, and my users can use any interface they like for interacting with it, but I need to be able to read the data and store it locally.</p><p>Thanks!</p>","124732","","","","","2010-06-04 19:17:01","Android: How to interface with Google Calendar?","<android><google-calendar>","1","0","3","",""
"2976935","1","2976950","","2010-06-04 18:56:26","1","1114","<p>I have an Android application that I've been working on, and it's implemented using tabs to separate the different functions that it performs. </p><p><a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"" rel=""nofollow"">See the article here</a></p><p>The above article talks about how instead of implementing the Twitter application using tabs they decided to go with a home screen and a tool bar because of some of the limitations of tabs.</p><p>If my application only ever would need to have three tabs (or 3 home screen icons) would it be worth it for me to take the time to go back and convert my application to a home screen layout, or is home screen versus tab purely a preference?</p><p><img src=""http://3.bp.blogspot.com/_GTM_W5mVPTU/S-rlV2NLU0I/AAAAAAAAAD0/fQUmdTS6cdA/s400/home01.png"" alt=""Home Screen Example"">Home Screen Example<img src=""http://www.simplydroid.com/wp-content/uploads/2009/11/site14.png"" alt=""Tabs Example"">Tabs Example</p>","356076","","9360","","2010-06-04 19:29:29","2010-06-04 19:38:51","Tabs vs. Home Screen For Android Application?","<android><gui><user-interface><interface-design>","4","0","","",""
"2977128","1","2978895","","2010-06-04 19:24:32","1","3500","<p>My app has a small web view that I want to animate into place once the page has finished loading.  My code looks like this:</p><pre><code>view.setVisibility(View.VISIBLE);TranslateAnimation anim=new TranslateAnimation(0.0f, 0.0f,                                  view.getLayoutParams().height, 0.0f);anim.setDuration(5);anim.setInterpolator(new LinearInterpolator());view.startAnimation(anim);</code></pre><p>It animates all right, but I can't seem to control the speed.  I've set the value for setDuration() to 5, 500, 5000, 5000000 - all to no discernible effect.</p><p>Is there something else I need to do to control animation duration?</p><p>BTW my base SDK is 1.6.</p>","346166","","","","","2010-06-05 13:40:50","Controlling Animation Speed","<android>","2","0","","",""
"2977480","1","2977607","","2010-06-04 20:14:21","2","1485","<p>I need to detect Android Clipboard's content changes, and register the changes, but I can't really understand how to achieve such result.</p><p>There are a lot of clipboard managers around, but I found none open source, and it's difficult to believe they work by checking the clipboard every 15 seconds.</p><p>Is there a good method to observe clipboard changes ?</p><p>Thanks in advance !</p>","358813","","","","","2012-10-05 07:44:44","How to observe Android's Clipboard, really?","<android>","2","0","4","",""
"2977572","1","2992143","","2010-06-04 20:28:14","1","2032","<p>I am currently developing android XMPP client to communicate with the Tigase server setup locally.Before starting development on Android I am writing a simple java code on PC to test connectivity with XMPP server.My XMPP domain is my pc name ""mwbn43-1"" and administrator username and passwords are admin and tigase respectively.</p><p>Following is the snippet of the code I am using </p><pre><code>class Test {public static void main(String args[])throws Exception{System.setProperty(""smack.debugEnabled"", ""true"");XMPPConnection.DEBUG_ENABLED = true;ConnectionConfiguration config = new ConnectionConfiguration(""mwbn43-1"", 5222);config.setCompressionEnabled(true);config.setSASLAuthenticationEnabled(true);XMPPConnection con = new XMPPConnection(config);// Connect to the servercon.connect();con.login(""admin"", ""tigase"");Chat chat = con.getChatManager().createChat(""aaphadke@mwbn43-1"",    new MessageListener() {           public void processMessage(Chat chat, Message message) {           // Print out any messages we get back to standard out.           System.out.println(""Received message: "" + message);       }   });        try {      chat.sendMessage(""Hi!"");  }  catch (XMPPException e) {      System.out.println(""Error Delivering block"");  } String host = con.getHost(); String user = con.getUser(); String id = con.getConnectionID(); int port = con.getPort(); boolean i = false; i = con.isConnected(); if (i) System.out.println(""Connected to host "" + host + "" via port "" + port + "" connection id is "" + id); System.out.println(""User is "" + user); con.disconnect(); } }</code></pre><p>When I run this code I get following error </p><pre><code> Exception in thread ""main"" Resource binding not offered by server:  at   org.jivesoftware.smack.SASLAuthentication.bindResourceAndEstablishSession(SASLAuthenticatio     n.java:416) at    org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:331) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349) at Test.main(Test.java:26)</code></pre><p>I found this articles on the same problem but no concrete solution <a href=""http://www.igniterealtime.org/issues/browse/SMACK-271"" rel=""nofollow"">here</a>Could anyone please tell me the solution for this problem.I checked the XMPPConnection.java file in the Smack API and it looks the same as given in the link solution.</p><p>Thanks,Ameya</p>","355833","","355833","","2010-06-04 20:34:10","2010-06-07 18:37:32","Smack API giving error while logging into Tigase Server setup locally","<android><login><xmpp><smack>","3","0","","",""
"2978095","1","","","2010-06-04 22:03:31","5","9822","<p>Would anyone know where to control the ISO setting for the camera from in the Android SDK ? It should be possible as the native camera application on the HTC Desire has ISO settings.</p>","357636","","","","","2012-12-04 07:04:38","Android Camera API ISO Setting?","<android><camera><iso>","3","0","2","",""
"2978278","1","","","2010-06-04 22:49:00","2","919","<p>I'm having a problem in that whenever I start a emulator, either manually through the command line, or when debugging from Eclipse, it is never recognized by adb, i.e. 'adb devices' will not list it. I have to manually kill and restart adb every time I want to recognize a new emulator. Surely, something is wrong here?</p><p>(I'm on Vista 64-bit)</p>","358927","","","","","2012-04-10 05:12:41","Android Emulator and adb problems","<android><emulator>","1","2","","",""
"2978290","1","11817558","","2010-06-04 22:51:38","8","6200","<p>I have a simple user interface: an EditText should be located below a SurfaceView.I use a RelativeLayout to arrange these two views. </p><p>Now, when I tap on the EditText to open the virtual keyboard the SurfaceView slides up but the EditText is hidden and does not show the typed string.</p><p>To reproduce, use the following layout XML code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/RelativeLayout01""android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;SurfaceViewandroid:id=""@+id/SurfaceView01""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;/SurfaceView&gt;&lt;EditText android:id=""@+id/EditText01""android:layout_height=""wrap_content""android:layout_width=""fill_parent""android:layout_alignParentLeft=""true"" android:layout_alignParentBottom=""true"" android:selectAllOnFocus=""true""android:textStyle=""normal""android:singleLine=""true""&gt;&lt;/EditText&gt; &lt;/RelativeLayout&gt;</code></pre><p>The main Activity class only needs to show the layout. When I start the program and tap the EditText, the virtual keyboard appears but the EditText field is gone.</p><p>Maybe the RelativeLayout is causing the problems, but I don't know how to reproduce the same layout with another Layout class.</p><p>Any suggestions are welcome, I really appreciate your help.</p><p>Thanks.</p><p>Edit:</p><p>Here are two screenshots, one showing the EditText at the bottom without virtual keyboard, one with virtual keyboard but with no EditText. It is interesting to note that the SurfaceView and the EditText actually shift upward, the EditText just disappears. BTW this also happens to a button if it is next to the EditText.</p><p><a href=""http://i46.tinypic.com/fqaz5.png"">EditText below a SurfaceView (left); EditText is gone (right)</a></p>","358846","","358846","","2010-06-05 13:24:57","2013-09-08 14:47:37","Android's EditText is hidden when the virtual keyboard is shown and a SurfaceView is involved","<android><surfaceview>","2","2","1","",""
"2978295","1","","","2010-06-04 22:52:53","1","2301","<p>I tried using the load function of the SoundPool that takes a FileDescriptor, because I wanted to be able to set the offset and length. The File is not stored in the Ressources but a file on the storage card. Even though neither the load nor the play function of the SoundPool throw any Exception or print anything to the console, the sound is not played. Using the same code, but use the file path string in the SoundPool constructor works perfectly.</p><p>This is how I have tried the loading (start equals 0 and length is the length of the file in miliseconds):</p><pre><code>FileInputStream fileIS = new FileInputStream(new File(mFile));mStreamID = mSoundPool.load(fileIS.getFD(), start, length, 0);mPlayingStreamID = mSoundPool.play(mStreamID, 1f, 1f, 1, 0, 1f);</code></pre><p>If I would use this, it works:</p><pre><code>mStreamID = mSoundPool.load(mFile, 0);mPlayingStreamID = mSoundPool.play(mStreamID, 1f, 1f, 1, 0, 1f);</code></pre><p>Any ideas anyone?</p><p>Thanks</p>","358930","","358930","","2010-06-05 10:10:21","2011-01-24 01:51:55","SoundPool.load() and FileDescriptor from file","<android><audio><soundpool>","1","0","1","",""
"2978412","1","2978611","","2010-06-04 23:33:26","0","1262","<p>I have several ListActivties  set up in my Android Application. What I am trying to do is set it up so the user can select the background color, the font size, and the font color through a PreferenceActivity. I have gotten everything figured out regarding the Preference activity but I can not figure out how to grab the ListView in code. </p><p>One of my ListActivities is set up in the normal way but it is required to have the android id tag ""android:id=""@android:id/list"""". Because of this I am unable to change it in real time. (I was trying to use findViewById(R.id.list);)</p><p>My other ListActivities use a different implementation of ArrayAdapter in order to change the layouts of each row. So in this case I have one XML file containing the ListView and another XML file defining the layout of the row. I need to be able to change the TextView in side the row XML file and the ListView in the other XML file. The reason it is set up this way is to dynamically decide what icon to put in each row and in the implementation of ArrayAdapter I had to use an inflator to get to the label ImageView. In this case I am not sure how I would use an inflator out side of that implementation.</p><p>The following is an example of what I was talking about with the second listView.  </p><pre><code>public class Routes extends ListActivity {private String[] ROUTES;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ROUTES = getResources().getStringArray(R.array.routes);    setContentView(R.layout.routes);    setListAdapter(new IconicAdapter());}class IconicAdapter extends ArrayAdapter&lt;String&gt; {    IconicAdapter() {        super(Routes.this, R.layout.row, R.id.label, ROUTES);    }    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        View row = inflater.inflate(R.layout.row, parent, false);        TextView label = (TextView) row.findViewById(R.id.label);        label.setText(ROUTES[position]);        ImageView icon = (ImageView) row.findViewById(R.id.icon);        ShapeDrawable mDrawable;        int x = 0;        int y = 0;        int width = 50;        int height = 50;        float[] outerR = new float[] { 12, 12, 12, 12, 12, 12, 12, 12 };        mDrawable = new ShapeDrawable(new RoundRectShape(outerR, null, null));        mDrawable.setBounds(x, y, x + width, y+height);        mDrawable.setPadding(25,25,25,25);        switch(position){        case 0:            mDrawable.getPaint().setColor(0xffff0000);      //Red            break;        case 1:            mDrawable.getPaint().setColor(0xffff0000);      //Red            break;        case 2:            mDrawable.getPaint().setColor(0xff00c000);      //Green            break;        case 3:            mDrawable.getPaint().setColor(0xff00c000);      //Green            break;        case 4:            mDrawable.getPaint().setColor(0xff0000ff);      //Blue            break;        case 5:            mDrawable.getPaint().setColor(0xff0000ff);      //Blue            break;        }        icon.setBackgroundDrawable(mDrawable);        return(row);    }   &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;ListView    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/row""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""android:paddingTop=""7px""android:paddingLeft=""6px""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;TextView    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""17px""    android:textSize=""28sp""/&gt;</code></pre><p>Any suggestions would be appreciated! </p>","289153","","","","","2010-06-05 00:41:46","Android: Changing background color and/or text size in realtime","<android><listview>","1","0","0","",""
"2978569","1","2978578","","2010-06-05 00:28:33","4","7215","<p>i have a question, what is the best way to append ints and Strings to build a new String? In the allocation debug tool i see too much allocations if i use the operator +.</p><p>But i have tried also with StringBuffer and there are still too much allocations.</p><p>Anyone can help me?</p><p>Thanks</p>","258863","","238639","","2010-06-05 00:36:01","2011-09-05 21:25:47","Android/Java Append String + int","<java><android><string>","2","1","","",""
"2978963","1","5331787","","2010-06-05 03:08:23","2","3342","<p>I've written a small app to parse some RSS feeds from YouTube and launch videos selected by the user. To play the video, I'm using an intent:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(videoAddress);</code></pre><p>In order to call the YouTube app, if installed on the device.</p><p>The problem I'm having is that, of the population of videos I am using in my app, about 90% of them display a 'Cannot play video' error message: ""Sorry, this video cannot be played."". A few of them work just fine from my app. The videos that do not work will play fine in the YouTube app if searched for and launched entirely from within the YouTube app.</p><p>Has anybody seen this behavior, or does anybody have any ideas for things to try? Obviously the YouTube app launches videos in a slightly different way internally than it does from an Intent request, but I haven't a clue how to get to the bottom of it.</p>","359005","","815724","","2013-09-06 04:07:30","2013-09-06 04:07:30","Calling YouTube app using ACTION_VIEW intent Failing most of the time","<android><youtube>","5","2","","",""
"2979291","1","2979350","","2010-06-05 05:31:32","3","3453","<p>When embedding WebView in an application and loading html-pages in it, JavaScripts alert() do not work.Give me an example pls</p>","357112","","126562","","2010-06-05 09:37:58","2010-12-21 21:17:23","alert in embedded webview","<javascript><android><webview>","1","0","","",""
"2979433","1","2979493","","2010-06-05 06:34:37","5","7592","<p>Below is an example of the type of problem that I have. I have data in a pojo that I need to display in a textview... the data has pseudo code that denotes each paragraph with [p]</p><p>I would like to somehow parse the [p]'s into paragraphs when they are displayed in the textview. Can this be done? Is there something I can substitute for the [p] that will make a new paragraph in the textview?</p><pre><code>    Question question = new Question();    question.setText(""Here is the first paragraph.[p] And this should be the second."");     TextView view = (TextView) findViewById(R.id.qtext);    view.setText(question.getParsedText());</code></pre>","268648","","304673","","2010-06-05 07:09:21","2011-12-07 05:25:31","In an Android TextView, is it possible to insert paragraphs?","<android><textview>","2","4","1","",""
"2979441","1","","","2010-06-05 06:39:31","4","7741","<p>I have 2 EditTexts; 01 and 02. My button will be disabled once the activity is started and when these two EditText contain text, the button has to be enabled again. However my button is always disabled and can't enable it using <code>button.setEnabled(true);</code>.</p><p>Can anyone help me with this?</p><pre><code>summit.setEnabled(false);buttonEnable();public void buttonEnable(){    if (feedback.length()&gt;0 &amp;&amp; email.length()&gt;0){        summit.setEnabled(true);    }else{        summit.setEnabled(false);    }}</code></pre>","1367242","","741249","","2012-05-02 12:26:35","2012-05-02 12:26:35","Android: How to enable my button back if EditText is not empty?","<android><button><edittext>","2","10","1","",""
"2979450","1","","","2010-06-05 06:43:27","2","401","<p>I want make an app/service that looks like (Nexus One touch buttons)for the navigation keys (Home, menu,Back, Search)</p><p>The buttons should always stay on top and send the command to the actually app thats running.</p><p>Someone have ideas and sample codes how to do that?</p><h3>Update:</h3><p>I also see and test an app wich show a ""cracked display"" always ontopso that tecnic maybe shold be useful to always show the buttons on top.</p><p>Those function, show the button and catch the ""touch event"" and send the eventto the active program should be in a service module wich runs in background.</p>","359062","","1288","","2011-03-22 15:20:10","2012-10-17 00:43:56","How do I make an app/service for virtual/soft buttons for (Home, menu,Back, Search) always on top?","<android>","2","0","","",""
"2979489","1","","","2010-06-05 06:59:27","3","1121","<p>I would like to create a Home Widget containing a ListView, but I don't know if this is possible and if it is, how to do it.I was using a ListActivity and it was pretty simple, but can't figure out a way to do it using AppWidgetProvider.</p><p>Thanks for your help</p>","359069","","","","","2011-07-16 12:36:23","Display a ListView on a Home Widget with AppWidgetProvider","<android><listview><widget>","2","0","","",""
"2979718","1","2979771","","2010-06-05 08:41:19","4","1120","<p>If yes, then is there any other method to make it a bit faster?</p>","172543","","126562","","2010-06-05 09:09:51","2010-06-05 11:13:19","Do we need to launch the virtual device from eclipse every time we want to test our code?","<android><android-emulator>","4","0","","",""
"2979732","1","2980127","","2010-06-05 08:48:00","2","1210","<p>I create an android application. I need the check, how my application is working on the device. How to install the application on the android device ? </p><p>-Thanks in advance </p>","324223","","276052","","2010-06-05 08:51:43","2011-07-13 18:24:23","How to install an application on an Android phone?","<android>","4","0","2","",""
"2979778","1","","","2010-06-05 09:12:00","2","4499","<p>I'm not very clear about the Intent object and how to use it to pass data between Activities. In my application I have several tabs between which I want to pass ArrayList. Here is a sample code I plan to use, but I'm missing the part where the main activity catches the Intent and passes it to the new activity on start :</p><p><strong>1.</strong> myTabs.java ==> This is where I think I need to add some code to pass the data between TabOne and TabTwo. For now it is just using the sample code of the TabActivity sample.</p><pre><code>public class myTabs extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        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)        intent = new Intent().setClass(this, TabPeopleActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""TabOne"").setIndicator(""TabOne"",                          res.getDrawable(R.drawable.ic_tab_one))                      .setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, TabTransactionActivity.class);        spec = tabHost.newTabSpec(""TabTwo"").setIndicator(""TabTwo"",                          res.getDrawable(R.drawable.ic_tab_two))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre><p><strong>2.</strong> TabOne.java ==> I added a piece of code in the onStop procedure to fill in the Intent data with the array I want to pass to TabTwo. Not sure it is the right way to do though.</p><pre><code>public class TabOne extends Activity {    [...]    private ArrayList&lt;String&gt; arrayPeople;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.tabone);        arrayPeople = new ArrayList&lt;String&gt;();    [... here we modify arrayPeople ...]    }    /** Called when the activity looses focus **/    @Override    public void onStop(){        Intent myIntent = new Intent();        myIntent.putStringArrayListExtra(""arrayPeople"", arrayPeople);        this.setIntent(myIntent);    }}</code></pre><p><strong>3.</strong> TabTwo.java ==> Here I am trying to fetch the ArrayList from the Intent that is supposed to be passed when the Activity starts. But how to do this?</p><pre><code>public class TabTwo extends Activity {    private ArrayList&lt;String&gt; arrayPeople;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.transaction);        Intent myIntent = new Intent();        myIntent = this.getIntent();        arrayPeople = myIntent.getStringArrayListExtra(""arrayPeople"");    }}</code></pre><p>Thanks for your ideas !</p><p><strong>EDIT :</strong></p><p>Okay i'll make it simple, here is the complete workspace of the project :</p><p><a href=""http://www.lecompteestbon.com/Android.LCEB.zip"" rel=""nofollow"">http://www.lecompteestbon.com/Android.LCEB.zip</a></p><p>What i want to do is an offline version of the website lecompteestbon, which allows people to do accounting between friends after a weekend.</p><pre><code>TabPeople = Add the list of friendsTabTransactions = List of expensesTabTransaction = Add an expenseTabResult = Calculate the list of payments</code></pre><p>Let me know how to make this work :)</p>","357431","","357431","","2010-07-03 02:34:21","2011-04-17 17:09:31","Passing ArrayList<String> between tabs","<android><android-sdk-2.2>","3","0","2","",""
"2979835","1","2979959","","2010-06-05 09:41:26","4","8219","<p>I'm looking for a way to make the Chronometer in Android (preferably 1.6 and upwards) show 10ths of a second while counting up.</p><p>Is it possible to do this? If not, is there a free (and preferably open source) library that does the same? Failing that I'll write my own, but I'd rather use someone else's!</p>","6713","","","","","2012-10-20 06:18:01","Show milliseconds with Android Chronometer","<android><chronometer>","4","0","1","",""
"2979897","1","2979914","","2010-06-05 10:03:34","1","1120","<p>I can't find a way I can activate and deactivate the vibration at the time of incoming calls.</p><p>The option in the menu --> Settings --> Sounds &amp; Display mentions - PHONE VIBRATE - vibrate phone for incoming calls...</p><p>I want to activate and deactivate it through code (if possible).</p>","238071","","881229","","2014-03-18 22:45:16","2014-03-18 22:45:16","android ringing vibration activate/deactivate","<android><android-audiomanager><vibrate>","1","0","1","",""
"2979926","1","","","2010-06-05 10:13:27","2","1950","<p>I wonder how could is possible to make custom shape key on android keyboard. To create custom keyboard is relatively easy, but what needs to be done to create new buttons. They also need to respond with all events as normal keyboard.</p><p>Any ideas where to start?</p>","264618","","","","","2011-02-07 06:11:59","Android: How to create custom shape keys on keyboard?","<android><keyboard><key><reshape>","1","0","","",""
"2980199","1","2980307","","2010-06-05 11:47:57","2","523","<p>I save preferences in one activities but not able to get saved preferences in other activity. I can access saved preferences in the same activity but not in other one.It is not giving me any error but always gibing null values in second activity.</p><blockquote>  <p>Below is the code:</p></blockquote><pre><code>First Activity:      public static final String PREFS_NAME = ""MyPrefsFile"";    SharedPreferences.Editor editor;editor.putString(""token"", access_token); editor.commit();</code></pre><blockquote>  <p>Second Activity:</p></blockquote><pre><code>      public static final String PREFS_NAME = ""MyPrefsFile"";   SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);//getPreferences(0);      String restoredtoken = prefs.getString(""token"", null);     if (restoredtoken== null) {               ///doing some task;            }</code></pre>","301549","","301549","","2010-06-05 12:32:13","2010-06-05 12:41:46","Can we use preferences accress multiple different acvtivities in android?","<android><android-emulator>","2","0","","",""
"2980418","1","","","2010-06-05 12:57:35","1","534","<p>Fairly new to Android, so just trying to work out:</p><p>I have a simple Maps app that plots a couple of locations. It's a demo for a potentially bigger app later. The one thing I would like to do is make it exit correctly. I want to assume that when a user hits the ""Home"" or ""Back"" button on the phone, that they have exited the app. I want when this has happened for the GPS process to shut down. I can't seem to find any examples of how to do this correctly. I have an onDestroy() subclass with a super.onDestroy() method but this doesn't seem to cut it. I've tested on my phone and while everything else seems to work fine, this is bugging me. I keep seeing the GPS icon in the notifications bar. To give you an example, this doesn't happen when you leave GoogleMaps.</p><p>Anyone any ideas or know what I'm missing?</p><p>T</p>","359197","","","","","2010-12-03 12:01:32","Android GPS app not closing connection","<android><process><gps><shutdown>","1","0","","",""
"2980592","1","","","2010-06-05 13:49:42","1","611","<p><strong>Updated:</strong>  I have now included the logcat file below.  Looking at it it appears I am still having a permission problems (06-05 14:10:36.593) - I am guessing the same problem I am having with SDK 7</p><p>Well I was trying to get the HelloWebview example working with SDK 7 with no success (see HelloWebView Sample: java.lang.SecurityException: Permission Denial thread), so I decided just out of curiosity to back off to SDK3 to see if I could learn anything.  I have been able to get all the ""Layout"" samples to work and decided to try something a little harder.</p><p>Unfortunately, I still cannot get the simple HelloWebView app to run.  I no longer get a Permission Denial but now the app is getting killed.  </p><p>Killed usually implies that there are not enough resources (memory etc.) for an application to run....  Any thoughts?  Are there any other log files I can look at either on my computer or on the emulator?    </p><p>The main.xml, manifest, and console output are below.  Let me know if you need more information.</p><p>Thanks,Tim</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;WebView   android:id=""@+id/webview""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""/&gt; &lt;/LinearLayout&gt;</code></pre><p>mainfest file:</p><p></p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".HelloWebView3""              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="".HelloWebView3"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar""&gt;    &lt;/activity&gt; &lt;/application&gt;</code></pre><p> </p><p>Console output:</p><pre><code>[2010-06-05 08:43:37 - HelloWebView3] ------------------------------[2010-06-05 08:43:37 - HelloWebView3] Android Launch![2010-06-05 08:43:37 - HelloWebView3] adb is running normally.[2010-06-05 08:43:37 - HelloWebView3] Performing com.example.hellowebview3.HelloWebView3 activity launch[2010-06-05 08:43:37 - HelloWebView3] Automatic Target Mode: launching new emulator with compatible AVD 'Android1.5'[2010-06-05 08:43:37 - HelloWebView3] Launching a new emulator with Virtual Device 'Android1.5'[2010-06-05 08:43:42 - HelloWebView3] New emulator found: emulator-5554[2010-06-05 08:43:42 - HelloWebView3] Waiting for HOME ('android.process.acore') to be launched...[2010-06-05 08:45:04 - HelloWebView3] HOME is up on device 'emulator-5554'[2010-06-05 08:45:04 - HelloWebView3] Uploading HelloWebView3.apk onto device 'emulator-5554'[2010-06-05 08:45:04 - HelloWebView3] Installing HelloWebView3.apk...[2010-06-05 08:45:19 - HelloWebView3] Success![2010-06-05 08:45:19 - HelloWebView3] Starting activity com.example.hellowebview3.HelloWebView3 on device [2010-06-05 08:45:23 - HelloWebView3] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }[2010-06-05 08:45:23 - HelloWebView3] ActivityManager: [1]   Killed                  am start -n com....</code></pre><p>logcat output:</p><pre><code>06-05 14:10:33.963: DEBUG/AndroidRuntime(763): &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;06-05 14:10:33.963: DEBUG/AndroidRuntime(763): CheckJNI is ON06-05 14:10:34.232: INFO/jdwp(763): received file descriptor 20 from ADB06-05 14:10:34.253: DEBUG/AndroidRuntime(763): --- registering native functions ---06-05 14:10:35.013: DEBUG/AndroidRuntime(763): Shutting down VM06-05 14:10:35.013: DEBUG/dalvikvm(763): DestroyJavaVM waiting for non-daemon threads to exit06-05 14:10:35.022: DEBUG/dalvikvm(763): DestroyJavaVM shutting VM down06-05 14:10:35.032: DEBUG/dalvikvm(763): HeapWorker thread shutting down06-05 14:10:35.053: DEBUG/dalvikvm(763): HeapWorker thread has shut down06-05 14:10:35.053: DEBUG/jdwp(763): JDWP shutting down net...06-05 14:10:35.062: DEBUG/jdwp(763): +++ peer disconnected06-05 14:10:35.062: INFO/dalvikvm(763): Debugger has detached; object registry had 2 entries06-05 14:10:35.073: DEBUG/dalvikvm(763): VM cleaning up06-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa08 len=2006-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa20 len=34006-05 14:10:35.112: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410cab78 len=224406-05 14:10:35.112: DEBUG/dalvikvm(763): LinearAlloc 0x0 used 632420 of 4194304 (15%)06-05 14:10:35.561: DEBUG/AndroidRuntime(772): &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;06-05 14:10:35.561: DEBUG/AndroidRuntime(772): CheckJNI is ON06-05 14:10:35.793: DEBUG/AndroidRuntime(772): --- registering native functions ---06-05 14:10:35.803: INFO/jdwp(772): received file descriptor 20 from ADB06-05 14:10:36.593: INFO/ActivityManager(579): Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }06-05 14:10:36.593: WARN/ActivityManager(579): Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null06-05 14:10:36.602: DEBUG/AndroidRuntime(772): Shutting down VM06-05 14:10:36.613: WARN/dalvikvm(772): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)06-05 14:10:36.613: ERROR/AndroidRuntime(772): Uncaught handler: thread main exiting due to uncaught exception06-05 14:10:36.623: ERROR/AndroidRuntime(772): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.06-05 14:10:36.633: ERROR/AndroidRuntime(772): java.lang.SecurityException: Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at android.os.Parcel.readException(Parcel.java:1234)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at android.os.Parcel.readException(Parcel.java:1222)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1046)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at com.android.commands.am.Am.runStart(Am.java:199)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at com.android.commands.am.Am.run(Am.java:73)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at com.android.commands.am.Am.main(Am.java:51)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at com.android.internal.os.RuntimeInit.finishInit(Native Method)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)06-05 14:10:36.633: ERROR/AndroidRuntime(772):     at dalvik.system.NativeStart.main(Native Method)06-05 14:10:36.661: ERROR/JavaBinder(772): Unknown binder error code. 0xfffffff706-05 14:10:36.661: ERROR/AndroidRuntime(772): Crash logging skipped, no checkin service06-05 14:10:36.673: INFO/Process(772): Sending signal. PID: 772 SIG: 906-05 14:21:41.081: DEBUG/dalvikvm(626): GC freed 9840 objects / 555600 bytes in 106ms</code></pre>","358455","","1228","","2013-08-15 14:45:32","2013-08-15 14:45:32","HelloWebView Sample: now using SDK 3 and getting killed","<android>","2","0","","",""
"2980791","1","3001655","","2010-06-05 14:45:22","3","4547","<p>I am new to Android development. I am using a x-platform development tool which builds and signs the APK for me. This tool has a bug and it does not generate APK's with the version code I specify, all APK's generated are version 1.0.</p><p>I would like to unpack the APK, edit the version code, and then resign and repackage it. It was signed using my keystore originally, so I have the keys needed to sign it again.</p><p>How can this be done?</p>","151501","","151501","","2010-06-05 15:53:02","2010-06-10 10:21:37","How can I update the version of an APK which I did not create myself","<android>","3","0","4","",""
"2980798","1","2980922","","2010-06-05 14:48:18","6","2493","<p>I have an Android Service that I would like to keep running even after the last Activity has been popped off the stack, or the User has chosen to do something else.</p><p>Essentially the Service is listening for changes on a remote server, and I would like to generate a Notification if and only if an Activity from the app isn't running(or visible). In other words, I don't want the Notifications to occur while the User is directly interacting with the app. </p><p>In the case where the User is directly interacting with the app, the Service will notify the Activity and update appropriate UI elements based on the changes. I plan to implement this through the Observer pattern.</p><p>How can the Service know if none of apps Activities are bound to it?</p><p>Thanks,J</p>","312176","","","","","2013-07-20 12:59:11","How can an Android Service know that its not bound to any Activities","<android><service><activity>","3","0","3","",""
"2980972","1","","","2010-06-05 15:37:20","1","222","<p>I load a url over the web containing images (their source is anotherurl).when then view loads the html, it loads it without the images. afterfew milliseconds, the images come along but then the html is redrawn,and it does so over the previous html, causing it the web view to hold2 htmls one over the other (very ugly result).</p><p>anyone knows why does that happen? how can I avoid that?</p><p>thanks,Ori</p>","258429","","","","","2010-06-05 15:37:20","Webview duplicate HTML problem","<android>","0","4","","",""
"2980978","1","2981071","","2010-06-05 15:40:40","1","1303","<p>I have a TabActivity with several tabs. Each tab corresponds to a specific view, and those views may further switch to other views. For example, one of my tabs displays RSS feed list, after user clicks one of the RSS feed, it will switch to a view displaying a list of articles, and after user clicks one of the titles, a full article view will be displayed.</p><p>I'm going to add support for ""back"" button in my application. For instance, in a full article view, after user presses the ""back"" button, it should switch back to the article list view. And if user presses it the ""back"" button again, my application should switch back to the feed list view.</p><p>My idea is to maintain a <code>Stack&lt;View&gt;</code> during navigation, and every time user presses the ""back"" button, the program will pop a View out of the stack, and set it as the current view. But I would like to know how to set current view in TabHost. Many thanks.</p>","111896","","","","","2010-06-05 16:09:22","Emulate back button in multi-view TabActivity","<android><android-tabhost>","1","0","","",""
"2981069","1","2981944","","2010-06-05 16:08:26","1","371","<p>I'm aware that API 3 doesn't allow a view to be set for a tab, but I still need to modify the TextView displayed as the indicator. I'd also like to change the Drawable for the tab, but I don't see a way to do it without a custom tab view as allowed in 1.6, API 4. </p><p>Working with this generic example below, is there way to retrieve the TextView and modify its properties or change the drawable?</p><pre><code>       TabHost tabHost = getTabHost();       TabHost.TabSpec spec;       spec = tabHost.newTabSpec(""nearby"")                      .setIndicator(""Nearby Activity"")                      .setContent(R.id.nearby_list);                       tabHost.addTab(spec);               spec = tabHost.newTabSpec(""friends"")                  .setIndicator(""Friends &amp; Favorites"")                      .setContent(R.id.friends_list);       tabHost.addTab(spec);               tabHost.setCurrentTabByTag(""nearby"");</code></pre><p>Thanks for any help.</p>","155546","","","","","2010-06-05 20:51:42","Customizing TabWidget in SDK 1.5, API 3","<java><android><android-widget>","2","0","","",""
"2981192","1","2981224","","2010-06-05 16:47:50","0","67","<p>On my activity, im getting some big data from web, and while getting this data i want to show the user a ProgressDialog with spinning wheel. That i can do only with putting this code into a thread, right ? the problem is that after im getting this data i need to insert it into my tableLayout as TableRows and it seems impossible to <strong>access the TableLayout from the thread</strong>.</p><p>What can i do to show this progress dialog and to be able access the table layout from the thread ??Is there any event that happens on the end of the thread ?</p><p>My code fails for :</p><pre><code>_tableLayout.addView(_tableRowVar, new TableLayout.LayoutParams(      LayoutParams.FILL_PARENT,      LayoutParams.FILL_PARENT));</code></pre><p>My full code is :</p><pre><code>final ProgressDialog dialog = ProgressDialog.show(MyActivity.this, """",             ""Getting data.\nPlease wait..."",true);new Thread() {    public void run()     {        try        {            TableLayout _tableLayout;            _tableLayout = (TableLayout)MyActivity.this.findViewById(R.id.tableLayoutID);            List&lt;String&gt; data = getDataFromWeb();            // Get the data and bind it into the table            publishTableLayoutWithTableRows(_tableLayout, data );        }        catch (Exception e) {            new AlertDialog.Builder(MyActivity.this)                 .setMessage(e.getMessage())             .show();        }        dialog.dismiss();    }}.start();</code></pre>","247929","","","","","2010-06-05 16:56:46","Find TableLeyout in a thread (Because of the ProgressDialog)","<android><multithreading><tablelayout><progressdialog>","1","0","","",""
"2981249","1","","","2010-06-05 17:05:23","1","446","<p>For all of you android devs out there that have the Android simulator running on your comp, you know that there are a few built in apps that are already installed on your 'phone'. I had an idea for an app that would utilize a function that is already being done in the spare parts app that comes already installed. </p><p>I went on to the android developer site, dug through the source code files, and found the spare parts app, and am now trying to set it up so that running it from eclipse on my machine actually runs the app in the simulator. In other words, I want to be able to make changes to and adjust some of the things in that app for my own needs. But it won't compile, because of a number of different errors.</p><p>How do I get that source code running on my local machine? Is there some special trick that I just dont know about? I thought that if I could get the source code than the rest would be easy, but it isn't being too easy. Any help here would be appreciated!!</p>","293124","","293124","","2010-06-05 17:49:26","2010-06-05 18:15:34","How can I run an app's source code that I got from the Android source code?","<java><eclipse><android><source-code><android-emulator>","1","0","1","",""
"2981302","1","","","2010-06-05 17:21:05","1","2458","<p>here is my situation:</p><p>I have a media player playing music in an Android application. I've found that with certain headphones, the volume is much too loud even when the volume is set to it's lowest setting. As a result, I want to change the volume of the music for all volume levels to be 10% of what it normally is (actually, this value is user-defined of course).</p><p>The following works perfectly:</p><pre><code>mediaPlayer.setVolume(0.1f, 0.1f);</code></pre><p>The volume of the music is now at a good level for listening.  However, if the user now changes the volume using the volume rocker (thus changing the music stream volume), the media player changes the volume as expected, but it also seems to reset the 'setVolume' parameters to 1.0, causing a massive volume change.  Setting the volume back to 0.1 sets the volume to how it should be (which is 10% of the current music stream volume).</p><p>To quote the Android docs for the MediaPlayer.setVolume method:</p><blockquote>  <p>This API is recommended for balancing the output of audio streams within an application</p></blockquote><p>How can you do this if it gets reset to 1.0 each time the system volume changes?</p><p>Any help muchly appreciated. Thanks.</p>","131578","","","","","2010-06-05 23:14:29","Android MediaPlayer ignores it's internal volume when the system volume changes","<android><media-player>","1","1","2","",""
"2981339","1","","","2010-06-05 17:30:39","1","1608","<p>parse .ics Calendar file using Ical4J in android.i saw the  <a href=""http://ical4j.sourceforge.net/introduction.html"" rel=""nofollow"">http://ical4j.sourceforge.net/introduction.html</a>. How to use that ical4j-1.0-rc3.jar file in my project.I need help related to this plz ?</p>","324223","","353410","","2011-05-03 00:12:48","2012-08-03 10:43:19","how to parse ics file using ICal4j in android","<android>","1","2","","",""
"2981426","1","","","2010-06-05 17:55:25","1","2903","<p>I want to incorporate some Accelerometer code into a Android application im working and want to see if this is possible. Basically what I need is for the code to detect car acceleration motion. I am not wanting to determine speed with the code but just distinguish if the phone is in a car and has accelerated motion (Hence the car is moving for the first time). I have gone through many different accelerometer applications to see if this motion produces a viable profile to go off of and it appears it does. Just looking for something that popups a ""Hello World"" dialog when it detects your in the car and its moving for the first time down the street. Any help would be appreciated and a simple yes or no its possible would work. I would also be interested in compensating anyone that is capable of doing this as well. I need this done like yesterday so please let me know.</p><p>Thank You,</p><p>JTW</p>","359322","","27637","","2010-06-05 19:17:04","2010-06-05 19:17:04","Detect car acceleration in Android app?","<java><javascript><android>","2","7","1","",""
"2981451","1","2981462","","2010-06-05 18:04:32","0","102","<p>I'm creating a custom Layout for android.The layout implementation is exactly the same, but once I need to extend from RelativeLayout, and once from LinearLayout.</p><pre><code>class Layout1 extends LinearLayout {// methods and fields}class Layout2 extends RelativeLayout {// the same EXACT methods and fields}</code></pre><p>How can I use inheritance to avoid code duplication and implement my methods once.</p>","184973","","184973","","2010-06-05 18:20:11","2010-06-09 20:17:13","Inheritance question / problem","<java><android><oop><inheritance>","3","2","","",""
"2981495","1","","","2010-06-05 18:16:27","2","9736","<p>I have been seeking beginner learning books in Android, and of course found out that I should learn Java first.  So I began studying Java and now I am quite comfortable with objects, classes, inheritance, interfaces, and just moved onto Layouts in Swing as well as Swing Features.  But I am starting to wonder.... do I know enough about Java now?  Can I start programming Android yet?</p><p>Of course I can keep going in Java, but have been itching to begin programming Android apps.  </p><p>Any definitive answer here about how much Java I need to know before Android?</p><p>Thanks so much!</p>","359336","","21234","","2010-06-05 18:30:40","2010-06-05 23:47:31","How much Java should I have learnt before trying Android programming?","<java><android>","5","0","4","",""
"2981498","1","","","2010-06-05 18:17:22","11","27325","<p>I'm new to Android development, and am attempting to run a test application on my actual device. I followed the instructions at <a href=""http://developer.android.com/guide/developing/device.html"">http://developer.android.com/guide/developing/device.html</a> (and related links), but the Android Debug Bridge (adb) doesn't recognize my connected device.</p><p>Some quick background info, I'm running WinXP, developing with Eclipse, with a Motorola Droid running Android 2.1 as my physical device.</p><p>An overview of the steps I've taken:</p><ol><li>Installed the Android SDK, downloading all necessary packages.</li><li>Enabled USB Debugging on my device.</li><li>Connected Device via USB, installing the driver from the SDK folder.</li></ol><p>I'll stop here (though I continued to setup my application to be debug-able in Eclipse), because I at this point I noticed a problem.</p><p>Running ""sdk\tools\adb devices"" at this point (at least, by my understanding), should list my device as connected. However, running this yields only:</p><blockquote>  <p>List of devices attached  </p></blockquote><p>My device recognizes that it's connected to a computer in debug mode, and my computer recognizes the device. However, I can't seem to get the sdk to recognize it. I'll leave out the steps I used to setup Eclipse for debugging on a device, as it doesn't seem relevant to the problem. I'll include them if requested.</p><p>If anyone has any ideas, I'd greatly appreciate some assistance. Thanks in advance for your time.</p>","359340","","","","","2014-02-23 15:24:06","Android SDK not recognizing debug-able device","<android>","17","2","8","",""
"2981515","1","","","2010-06-05 18:21:06","1","3975","<p>I am playing a Video using a VideoView in my app. On the click of a button, it records the current position of the video, and the app opens up the browser with some url. On pressing the back button, the app comes back to video app and resumes the video from where it left off.</p><p>I looked at the Android Activity lifecycle and saw that onStart() method gets called once the video activity comes to the foreground. So I am creating my layout in onStart() and playing the video by seeking to the current position. </p><p>My problem is that when the video resumes, it buffers from the start and then seeks to. Since it already buffered the first time, is there a way to eliminate buffering again while doing a seekTo?</p><p>ThanksChris</p>","321927","","","","","2014-03-12 16:44:45","Android VideoView resume and seekTo","<android><resume><seek><videoview>","2","1","1","",""
"2981623","1","2981882","","2010-06-05 18:56:02","8","5265","<p>I have a ListActivity and I want to implement context menu for each of the list elements. I know that the common way to do this is to show the context menu on long click/tap. I want to know if there is a way to show the context menu for each element on a key press(preferably the menu key). To rephrase my question, how can I trigger the context menu and not the options menu by pressing the menu key(or any other key). </p>","328302","","328302","","2010-06-05 19:01:22","2010-06-05 22:43:15","How to implement context menu on key press instead of long click/tap","<android>","2","0","3","",""
"2981751","1","","","2010-06-05 19:28:01","4","15151","<p>I'm trying to scan for wireless networks and found this helpful source on the net.Unfortunately it's not working and I have no idea why. My problem is that I can't wait 10 minutes for the result - I need them within a few seconds and thought about setting the boolean variable waiting on false as soon as I get a result.... well, it runs forever ... looks like nothing is received. Any idea ? Thanks.</p><pre><code>// -- Sample WiFi implementation - http://groups.google.com/group/android-developers/browse_thread/thread/f722d5f90cfae69        IntentFilter i = new IntentFilter();        i.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);            registerReceiver(new BroadcastReceiver(){                @Override                public void onReceive(Context c, Intent i){                    // Code to execute when SCAN_RESULTS_AVAILABLE_ACTION event occurs                    mWifiManager = (WifiManager) c.getSystemService(Context.WIFI_SERVICE);                    wireless =  mWifiManager.getScanResults(); // Returns a &lt;list&gt; of scanResults                    waiting = false;                }            }        ,i);        // -- End Wifi Sample         mWifiManager.startScan();        while (waiting)  {             try {                Thread.sleep(200);            } catch (InterruptedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            Log.d(""PROJECT1"",""Wifi WAITING"");        }</code></pre>","331556","","","","","2013-04-25 15:57:22","Android Scan for Wifi networks","<android><wifi><android-wifi>","4","0","8","",""
"2981767","1","2981796","","2010-06-05 19:32:11","0","542","<p>I am attempting to use a few of the simple android examples for Tab Views. One thing i am attempting to do different than all the examples i've seen so far, is to not use a TabActivity. I am trying to use a normal activity, which means i need to retrieve the TabHost object some how, so i can add tabs and etc to it. How can this be done?</p><p>If you wanted to retrieve a view, you can simply use <code>findViewById(R.id.blah)</code>, but how can you retrieve the TabHost object in a similar manner?</p><p><strong>EDIT:</strong>So CommonsWare provided the answer to the question i was asking, but i had not stated my problem it seems. I was using findViewById, and casting it as a TabHost, ala <code>TabHost tab_host = (TabHost)this.findViewById(R.id.mytabhost);</code>, but whenever i used it the application would crash.</p><p>The problem is if you are not using TabActivity, <strong>TabHost.setup()</strong> is never called, so you need to yourself.</p><p>This issue is now resolved :)</p>","80943","","80943","","2010-06-05 20:03:11","2010-06-05 20:03:11","How to retrieve the TabHost object, if you're not using TabActivity?","<android>","1","0","","",""
"2981899","1","2982343","","2010-06-05 20:09:54","0","1132","<p>I have an activity that shows up when the phone screen goes to sleep/turns off ie turns black.For some reason, the phone turns on when the volume buttons or the camera buttons are pressed. By turns on, I mean the screen wakes up or comes back from the black screen state.</p><p>I've tried using dispatchKeyEvent(KeyEvent event) and the buttons are disabled on the activity, but they still wake up the phone.</p>","306410","","","","","2010-06-05 22:24:57","Android - How to prevent the phone screen from turning on when volume or camera key is pressed?","<android><events><screen><activity><key>","1","4","","",""
"2982111","1","","","2010-06-05 21:07:17","7","1101","<ol><li>Is it possible to use custom view as a section indexer? I.e. make it more transparent and use images instead of characters?</li><li>Is it possible to enable/disable SectionIndexer popup on demand without disabling FastScroll feature?</li></ol>","7162","","","","","2011-05-25 13:46:45","Android: custom view layout for SectionIndexer and disabling SectionIndexer on the fly","<android><list><listadapter>","1","0","2","",""
"2982220","1","2982327","","2010-06-05 21:41:29","0","2673","<p>I'm very new to Android programming, so this is probably something pretty basic.  I just have an xml layout with a few buttons.  I'm trying to follow the model given by the JetBoy demo, so I'm adding a view to the layout which extends SurfaceView.  When this new view is put in my xml layout, I just get a blank screen.  </p><p>Here's the XML layout if it helps.  The gameview element is what causes the screen to be blank</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:alwaysDrawnWithCache=""true""&gt; &lt;game.test.gameEngine      android:id=""@+id/gameView""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""/&gt;&lt;Button android:text=""Easy"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/EasyButton""&gt;&lt;/Button&gt;&lt;Button android:text=""Medium"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/MedButton""&gt;&lt;/Button&gt;&lt;Button android:text=""Hard"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/HardButton""&gt;&lt;/Button&gt;&lt;DatePicker android:id=""@+id/DatePicker01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/DatePicker&gt;&lt;Button android:id=""@+id/Button04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Exit""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","48784","","","","","2010-06-06 01:51:05","Adding View extending from SurfaceView to layout gives me a blank screen","<android><surfaceview>","2","0","","",""
"2982393","1","","","2010-06-05 22:38:58","1","119","<p>i want to build a db file where i can </p><p>1.withdraw relevant info from tables I already inserted there2.add to this db file new values </p><p>but the main thing I want db file with info already stored in the application where 1,2 are optional from it can someone please help me ? it will mean a lot thanks :)... </p>","346447","","","","","2010-10-01 20:58:59","I want to use SQLIGHT how can I set a db file into my project using eclipse android","<android>","1","1","","",""
"2982454","1","2982471","","2010-06-05 23:01:00","3","8419","<p>I'm new to Android development and I'm currently going through some tutorials.  When I setup a new Android Project in Eclipse, and select <strong>Windows</strong> -> <strong>Android SDK and AVD Manager</strong>, in <strong>Virtual Devices</strong>, the list of existing Android Virtual Devices is empty.  <em>Is it supposed to be?</em></p><p>From the pictures in the tutorial, it's pre-populated.  Can I download these AVDs from somewhere, am I missing something here?  Also, I'm developing this on my Macbook Pro.</p>","67998","","","","","2011-03-08 10:56:52","List of existing Android Virtual Devices empty","<android><eclipse><avd>","3","0","","",""
"2982769","1","3143680","","2010-06-06 01:27:52","2","2506","<p>Sorry if this has been answered before, but I am trying to make an application that will include the ability to scan barcodes on Android. I'm looking at using ZXing as the library, however, I want to embed the scanner in my application so that the user doesn't have to have the ZXing barcode scanner installed to use my application. From the description of ZXing, it sounds like this is possible.</p><p>I've gotten as far as building ZXing, linking it into my project in Eclipse, then creating a new reader instance. However, I'm lost when it comes to starting the barcode reader and implementing the callbacks. IMO, this is when the documentation <a href=""http://code.google.com/p/zxing/wiki/DeveloperNotes"" rel=""nofollow"">here</a> gets hazy. </p><p>If someone could explain how to use ZXing properly, that would be of great help.</p><p>Cheers!</p>","253567","","","","","2011-06-13 12:55:37","Embedded ZXing - what am I missing?","<android><barcode><barcode-scanner><zxing>","2","0","1","",""
"2982940","1","2983009","","2010-06-06 02:55:00","1","1908","<p>Before I delve into it, I'm very new to Android and I have just started learning Java last month. I've hit bumps while trying to develop my first simple app. Most of these hurdles were jumped thanks to random tutorials online. MY CODE IS VERY MESSY. Any tips are appreciated.</p><p>The question above is quite broad, but this is what I want to do: It's a essentially a blood alcohol content calculator / drink keeper-tracker. Basic layout: <a href=""http://i.imgur.com/JGuh7.jpg"" rel=""nofollow"">http://i.imgur.com/JGuh7.jpg</a></p><p>The buttons along the bottom are just regular buttons, not ImageButtons (had problems with that) Here's some example code of one: </p><pre><code>&lt;Button android:id=""@+id/Button01""                    android:layout_width=""wrap_content""                    android:layout_marginRight=""5dp""                    android:background=""@drawable/addbeer""/&gt;</code></pre><p>The buttons and TextView are all in main.xml.</p><p>I have variables defined in a class called Global.java:</p><pre><code>package com.dantoth.drinkingbuddy;</code></pre><p>import android.app.Activity;</p><p>public class Global extends Activity{</p><pre><code>public static double StandardDrinks = 0;public static double BeerOunces = 12;public static double BeerPercentAlcohol = .05;public static double BeerDrink = BeerOunces * BeerPercentAlcohol;public static double BeerDrinkFinal = BeerDrink * 1.6666666;public static double ShotOunces = 1.5;public static double ShotPercentAlcohol = .4;public static double ShotDrink = ShotOunces * ShotPercentAlcohol;public static double ShotDrinkFinal = ShotDrink * 1.6666666;public static double WineOunces = 5;public static double WinePercentAlcohol = .12;public static double WineDrink = WineOunces * WinePercentAlcohol;public static double WineDrinkFinal = WineDrink * 1.6666666;public static double OtherOunces;public static double OtherPercentAlcohol;public static double OtherDrink = OtherOunces * (OtherPercentAlcohol * .01);public static double OtherDrinkFinal = OtherDrink * 1.6666666;public static double GenderConstant = 7.5; //9 for femalepublic static double Weight = 180;public static double TimeDrinking = 60;public static double Hours = TimeDrinking / 60;public static double Bac = ((StandardDrinks / 2) * (GenderConstant / Weight)) - (0.017 * Hours);</code></pre><p>}</p><p>The last variable is the important part. It calculates your BAC based on the factors involved.</p><p>When I press the add beer button (Button01) I make it add 1 to StandardDrinks, simulating drinking one beer. The other variables in the Bac formula have values assigned to them in Global.java.</p><p>The code that makes the beer button do stuff is in my regular class, drinkingbuddy.java:</p><pre><code>public class DrinkingBuddy extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button = (Button) findViewById(R.id.Button01);    button.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            Global.StandardDrinks = Global.StandardDrinks + Global.BeerDrinkFinal;            Toast.makeText(DrinkingBuddy.this, ""Mmmm... Beer"", Toast.LENGTH_SHORT).show();        }        });</code></pre><p>By my perception, StandardDrinks should now have a value of 1. However, when I click the Calculate BAC button (Button05) it merely outputs the variable Bac as if StandardDrinks was still set to 0. Here is the code for the Calculate BAC button (Button05):</p><p>Button button4 = (Button) findViewById(R.id.Button05);         button4.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {</p><pre><code>            TextView texty;            texty = (TextView) findViewById(R.id.texty1);            texty.setText(""Your BAC is "" + Global.Bac );        }        });</code></pre><p>It outputs the following to the text view: ""Your BAC is -0.017"". This is the Bac value for if StandardDrinks was still 0, so obviously there is some problem communicating between the classes. Can anyone help me??</p><p>The other elements of the formula (weight, time spent drinking, and the alcohol %'s and such) are variables because I will ultimately allow the user to change those values in the settings.</p><p>I've heard around the water cooler that global variables are not good programming style, but this is the closest I've come to getting it to work. Any other ways of doing it are very much welcomed!</p>","359045","","","","","2010-06-06 03:28:17","How do I change variables from different classes?","<java><android><variables><button><global-variables>","2","0","","",""
"2982948","1","","","2010-06-06 02:57:47","1","5085","<p>I am populating a text and list view from a SQLite database. The data is populating from the cursor correctly (I see the list filling with text rows), but I'm not able to see the actual text in the rows - all I see are empty rows. For the life of me, I can't figure out what I'm not able to see the data in the text rows.</p><p>My layouts:</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><p>list 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=""wrap_content""android:layout_height=""wrap_content""&gt;</code></pre><p></p><pre><code>&lt;/LinearLayout&gt;</code></pre><p>row layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView android:id=""@+id/text1""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt;</code></pre><p>My main:</p><pre><code>package com.gotquestions.gqapp;import java.io.IOException;import com.gotquestions.gqapp.DataBaseHelper;import android.database.Cursor;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.database.SQLException;import android.net.Uri;import android.os.Bundle;import android.widget.TabHost;public class gqMain extends TabActivity {/** Called when the activity is first created. */private DataBaseHelper myDbHelper;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Resources res = getResources(); // Resource object to get Drawables    TabHost tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Resusable TabSpec for each tab    Intent intent;  // Reusable Intent for each tab    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, TopicsActivity.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""topics"").setIndicator("""" +            ""Topics"")                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, FavoritesActivity.class);    spec = tabHost.newTabSpec(""favorites"").setIndicator(""Favorites"")                  .setContent(intent);    tabHost.addTab(spec);  // Do the same for the other tabs    intent = new Intent().setClass(this, AskActivity.class);    spec = tabHost.newTabSpec(""ask"").setIndicator(""Ask"")                  .setContent(intent);    tabHost.addTab(spec); // Do the same for the other tabs    intent = new Intent().setClass(this, BlogActivity.class);    spec = tabHost.newTabSpec(""blog"").setIndicator(""Blog"")                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);    DataBaseHelper myDbHelper = new DataBaseHelper(this);    myDbHelper = new DataBaseHelper(this);//test    try {        myDbHelper.createDataBase();    } catch (IOException ioe) {        throw new Error(""Unable to create database"");    }    try {        myDbHelper.openDataBase();    }catch(SQLException sqle){        throw sqle;    }    //Cursor c = myDbHelper.fetchAllTopics();}}</code></pre><p>My topics activity that generates the data within the TopicsActivity Tab..this is where the data shows up in the listview, but I can't see it. I've looked at the cursor adaptor, but am just not seeing it.</p><pre><code>package com.gotquestions.gqapp;import com.gotquestions.gqapp.R.layout;import android.R;import android.app.ListActivity;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.widget.SimpleCursorAdapter;public class TopicsActivity extends ListActivity {private DataBaseHelper myDbHelper;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //    DataBaseHelper myDbHelper = new DataBaseHelper(this);    myDbHelper = new DataBaseHelper(this);//test    try {        myDbHelper.openDataBase();    }catch(SQLException sqle){        throw sqle;    }        setContentView(layout.list_layout);        Cursor c = myDbHelper.fetchAllTopics();        startManagingCursor(c);        String[] from = new String[] { DataBaseHelper.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, layout.notes_row, c, from, to);        setListAdapter(notes);        myDbHelper.close();  }}</code></pre><p>My database helper:</p><pre><code>package com.gotquestions.gqapp;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class DataBaseHelper extends SQLiteOpenHelper{//The Android's default system path of your application database.private static String DB_PATH = ""/data/data/com.gotquestions.gqapp/databases/"";private static String DB_NAME = ""gotquestions_database.mp3"";public static final String KEY_TITLE = ""topic_title"";public static final String KEY_ARTICLE_TITLE = ""article_title"";public static final String KEY_ROWID = ""_id"";private static final String TAG = null;private SQLiteDatabase myDataBase; //private final Context myContext;/** * Constructor * Takes and keeps a reference of the passed context in order to access to the     application assets and resources. * @param context */public DataBaseHelper(Context context) {    super(context, DB_NAME, null, 1);    this.myContext = context;}   /** * Creates a empty database on the system and rewrites it with your own database. * */public void createDataBase() throws IOException{    boolean dbExist = checkDataBase();    if(dbExist){        //do nothing - database already exist    }else{        //By calling this method and empty database will be created into the default system path           //of your application so we are gonna be able to overwrite that database with our database.        this.getReadableDatabase();        try {            copyDataBase();        } catch (IOException e) {            throw new Error(""Error copying database"");        }    }   }/** * Check if the database already exist to avoid re-copying the file each time you open the application. * @return true if it exists, false if it doesn't */private boolean checkDataBase(){    SQLiteDatabase checkDB = null;    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){        checkDB.close();    }    return checkDB != null ? true : false;}/** * Copies your database from your local assets-folder to the just created empty database in the * system folder, from where it can be accessed and handled. * This is done by transfering bytestream. * */private void copyDataBase() throws IOException{    //Open your local db as the input stream    InputStream myInput = myContext.getAssets().open(DB_NAME);    // Path to the just created empty db    String outFileName = DB_PATH + DB_NAME;    //Open the empty db as the output stream    OutputStream myOutput = new FileOutputStream(outFileName);    //transfer bytes from the inputfile to the outputfile    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);}@Overridepublic synchronized void close() {        if(myDataBase != null)            myDataBase.close();        super.close();}@Overridepublic void onCreate(SQLiteDatabase db) {    // TODO Auto-generated method stub}@Overridepublic 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 titles"");            onCreate(db);        }public Cursor getTitle(long rowId) throws SQLException {    Cursor mCursor =            myDataBase.query(true, ""topics"", new String[] {                    KEY_ROWID,                    KEY_TITLE                    },                     KEY_ROWID + ""="" + rowId,                     null,                    null,                     null,                     null,                     null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public Cursor fetchAllTopics() {    return myDataBase.query(""topics"", new String[] {KEY_ROWID, KEY_TITLE},             null,             null,             null,             null,             null);};public Cursor fetchAllFavorites() {    return myDataBase.query(""articles"", new String[] {            KEY_ROWID,             KEY_ARTICLE_TITLE},             null,             null,             null,             null,             null);};</code></pre><p>}</p>","359502","","234976","","2011-11-28 06:59:23","2014-04-02 09:16:45","SQLite and populating list view, android","<android><sqlite><listview>","2","0","0","",""
"2982977","1","2984204","","2010-06-06 03:11:06","0","1284","<p>I have a button in my app.  When it is pressed I call the onSearchRequested() method.  When this is called the stock search box comes up so the user can type some junk in there.  When they press ""Go"" I need the results returned back to my application but instead the stock browser is opened and a google search is performed.  How can I tell it to return the results to my application instead.</p><p>I've tried these items in my manifest.xml file:</p><pre><code>&lt;meta-data android:name=""android.app.default_searchable""android:value="".MainActivity"" /&gt;&lt;activity android:name="".MainActivity""android:launchMode=""singleTop""&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.SEARCH"" /&gt;                         &lt;/intent-filter&gt;</code></pre><p>I've also tried to capture the result in my onCreate with this:</p><pre><code>Intent intent = getIntent();        if (Intent.ACTION_SEARCH.equals(intent.getAction())) </code></pre>","242904","","","","","2010-06-06 12:44:28","How to have onSearchRequested not open a web browser","<android>","1","0","","",""
"2983010","1","","","2010-06-06 03:29:06","2","1243","<p>I am new to android.Can anyone please help me to create db ,table and insert data and retrieve it make it display in list.I am really in need of your help.</p>","356632","","366898","","2012-07-10 06:29:39","2012-07-10 06:29:39","create db,table and insert data and retrieve it in android","<android><database><sqlite3>","3","0","","",""
"2983037","1","","","2010-06-06 03:49:06","1","1280","<p>i am new to android programming and want to develop an application similar to vista where the wallpaper changes automatically , so how should i go about it, please could someone guide me on it? thanks</p>","238505","","","","","2010-08-03 18:46:45","changing wallpapers automatically in android","<android>","2","0","1","",""
"2983073","1","2983420","","2010-06-06 04:15:42","22","9631","<p>I have to download a file and I'm using <a href=""http://casidiablo.in/bdJf5v"">this code</a>, which is basically an <code>AsyncTask</code> that is meant to update a progress bar. But, since I don't know what's the file size I've been having to use the spinner progress bar. So, how can I get the file size before start downloading it so that I can use a normal progress bar?</p>","244296","","244296","","2010-07-18 04:47:27","2012-09-04 21:45:22","How to know the size of a file before downloading it?","<android><file-download>","2","2","9","",""
"2983250","1","9149464","","2010-06-06 05:49:19","31","44426","<p>I need to set up a simple event listener to refresh a <code>ListView</code> once in a while. The problem is I don't know how could I generate an event.</p><p>I know that for events like key or button pressing I just need to implement the <code>Handler</code>. But in this specific case I actually need to generate the event, which will be fired every time another running thread of my app wakes up and refreshes its list of news from an RSS feed.</p><p>I've done everything, but got stuck in here. Can I get any suggestion or link with some more info on how to implement this?</p>","274434","","795158","","2014-04-15 06:50:50","2014-04-15 06:50:50","Custom event listener on Android app","<android><events><event-handling><listener><addeventlistener>","3","0","27","",""
"2983304","1","","","2010-06-06 06:12:46","3","605","<p>If i got a new message, in notification expanded view it shows only time. suppose If i got a message today(i.e on 06/06/2010) it should display simply a string ""Today"" and tomorrow it should show date on whilch message was received i.e it should display date 06/06/2010</p>","324225","","","Roger Pate","2010-06-06 12:25:55","2010-11-14 20:00:53","How to get customised date format for Notification expanded view","<android>","2","1","","",""
"2983398","1","","","2010-06-06 07:05:11","5","1679","<p>I have an ImageView in my layout xml file. I set the width to wrap_content and height to fill_parent.  In hierarchy viewer, the width is 2 px and height is 120 px. But when I see it on device, my 9-patch image for the image view does not stretch to 120 px. Can you please tell me how can I trouble shoot this 9 patch image does not stretch error?</p><p>Thank you.</p>","286802","","286802","","2010-06-06 15:50:34","2010-08-20 07:26:49","How to trouble shoot 9-patch image problem in android","<android>","1","2","2","",""
"2983534","1","","","2010-06-06 08:06:47","1","348","<p>Hi AllI want to know if I can find/reach UI components of running application under Android OS.<br/>it is possible to catch the Button/DDL/.. that was clicked by the user in real-time,<br/></p><p>example from other subject(web):<br/>In browser I can listen to the events and catch the DOM object that was clicked,<br/>in this way I can save the DOM object data.<br/></p><p>catching UI components that was changed by the user will give the option to save UI component<br/>data, and to perform the user actions automatic.<br/></p><p>Thanks.</p>","315264","","114066","","2010-06-07 14:37:19","2010-06-07 14:38:24","Find UI components in real time run, under Android OS, it is possible?","<android>","1","0","","",""
"2983548","1","","","2010-06-06 08:14:13","7","5013","<p>I'm a C# programmer and want to write an Android app. I'm a stubborn curmudgeon and refuse to write Java ever again (after switching to C# six years ago).</p><p>Besides Mono and MonoDroid (and writing Java), are there any options for me? Or should I just feel foolish for refusing to returning to my Java roots?</p><p>(Please refrain from Java-related vs. C# discussion. I was being rhetorical when I asked about returning to me Java roots.)</p>","359595","","","","","2013-01-08 15:21:20","Writing Android apps in C#","<c#><.net><android>","5","2","1","",""
"2983596","1","","","2010-06-06 08:35:16","1","266","<p>I would like to create buttons that have distinctive colors, no text. How can I create such push buttons?</p>","243782","","","","","2010-06-17 07:40:54","How to create full color buttons?","<android>","2","0","","",""
"2983652","1","","","2010-06-06 09:04:45","1","598","<p>I'm populating a list from the DB, and i have a image field in the DB which contains a URL to a image file.</p><pre><code>ListAdapter adapter=new SimpleCursorAdapter(this,R.layout.row, constantsCursor,new String[] {""title"", ""subtitle"", ""image""},new int[] {R.id.value, R.id.title, R.id.icon});</code></pre><p>However, the other fields are populated, but the image remains empty.Why?</p>","117701","","","","","2010-09-19 09:10:01","Android: ListAdapter populating image (icon) source","<android>","1","0","","",""
"2983920","1","3038048","","2010-06-06 10:47:16","8","6978","<p>I know I can use <code>android.text.format.DateFormat.getDateFormat()</code> to format my dates, and <code>android.text.format.DateFormat.getTimeFormat</code> to format my times, but how do I format a datetime? Similar to the <code>getDateTimeInstance</code> method from <code>java.text.DateFormat</code>.</p><p>I'm currently just concatenating the result of both the <code>getDateFormat</code> and <code>getTimeFormat</code>'s formatters, but I don't know which way around the user prefers to have their dates and times shown.</p>","87279","","63550","","2012-07-03 17:16:50","2013-04-10 09:03:30","Display date AND time in user locale","<android><datetime><formatting>","2","0","3","",""
"2984015","1","2992651","","2010-06-06 11:34:32","1","145","<p><code>SoundPool</code> has a serious bug in it in Android 1.5. I fixed it with a workaround, but since it really limits my app, I want to target 1.6+ for the next version of it.</p><p>I am wondering: What happens when I release a upgrade that has a higher target SDK version then the previous version of my app? Will only 1.6+ users be able to upgrade their app? Or will also the 1.5 users be able to upgrade since they have the program already installed?</p><p>Anybody experience with this?</p>","107029","","","","","2010-12-03 07:23:47","What happens when I release a upgrade with higher targeted sdk as previous version?","<android><upgrade><target>","2","0","","",""
"2984021","1","2984035","","2010-06-06 11:37:39","1","1083","<p>I've created a device targeting 2.1 and having a screen screen size of 480x800 (WVGA). Some apps, including the one I'm currently writing, as well as the ApiDemos example, won't run fullscreen. I've uploaded a screenshot here: <a href=""http://img248.imageshack.us/img248/503/emulator.png"" rel=""nofollow"">http://img248.imageshack.us/img248/503/emulator.png</a></p><p>What could cause something like this? If I run these apps on my HTC Desire (which has the same resolution), they utilize the whole screen like they should.</p>","135522","","","","","2011-09-25 17:24:48","Problem running apps fullscreen in emulator","<android><android-emulator>","2","0","","",""
"2984040","1","2984419","","2010-06-06 11:44:30","2","1978","<p>I have a spinner, which mostly works. If a user selects one of the items in it, the 'onItemSelected' routine catches it just fine.</p><p>But if a user clicks the same spinner, but does not change from the already visible item that it's currently displaying, the 'onItemSelected' routine just ignores it, and the logs show:-</p><p><strong>WARN/InputManagerService(577): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@437948b0</strong></p><p>I there anyway to capture someone doing this? The idea is that my spinner contains a list of names, and when a user selects one from the spinner, it gets added to a listview.</p><p>I could just add another button to get the name from the spinner, but, screen-space is already lacking and I'd rather not add anymore content.</p>","330770","","","","","2012-09-13 08:28:59","Android - How to tell is someone has pressed a SPINNER but not changed the visible item in it","<android><listview><focus><spinner><try-catch>","4","0","1","",""
"2984065","1","2986717","","2010-06-06 11:51:26","1","849","<p>Hey everyone. I'm kinda new to android programming so please bear with me. I'm having some problems with retrieving records from the db. Basically, all I want to do is to store latitudes and longitudes which GPS positioning functions outputs and display them in a list using ListActivity on different tab later on. This is how the code for my DBAdapter helper class looks like:</p><pre><code>public class DBAdapter {    public static final String KEY_ROWID = ""_id"";    public static final String KEY_LATITUDE = ""latitude"";    public static final String KEY_LONGITUDE = ""longitude"";    private static final String TAG = ""DBAdapter"";    private static final String DATABASE_NAME = ""coords"";    private static final String DATABASE_TABLE = ""coordsStorage"";    private static final int DATABASE_VERSION = 1;    private static final String DATABASE_CREATE =        ""create table coordsStorage (_id integer primary key autoincrement, ""        + ""latitude integer not null, longitude integer not null);"";    private final Context context;     private DatabaseHelper DBHelper;    private SQLiteDatabase db;    public DBAdapter(Context ctx)     {        this.context = ctx;        DBHelper = new DatabaseHelper(context);    }    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);        }        @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 titles"");            onCreate(db);        }    }        //---opens the database---    public DBAdapter open() throws SQLException     {        db = DBHelper.getWritableDatabase();        return this;    }    //---closes the database---        public void close()     {        DBHelper.close();    }    //---insert a title into the database---    public long insertCoords(int latitude, int longitude)     {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_LATITUDE, latitude);        initialValues.put(KEY_LONGITUDE, longitude);        return db.insert(DATABASE_TABLE, null, initialValues);    }    //---deletes a particular title---    public boolean deleteTitle(long rowId)     {        return db.delete(DATABASE_TABLE, KEY_ROWID +                 ""="" + rowId, null) > 0;    }    //---retrieves all the titles---    public Cursor getAllTitles()     {        return db.query(DATABASE_TABLE, new String[] {                KEY_ROWID,                 KEY_LATITUDE,                KEY_LONGITUDE},                 null,                 null,                 null,                 null,                 null);    }    //---retrieves a particular title---    public Cursor getTitle(long rowId) throws SQLException     {        Cursor mCursor =                db.query(true, DATABASE_TABLE, new String[] {                        KEY_ROWID,                        KEY_LATITUDE,                         KEY_LONGITUDE},                         KEY_ROWID + ""="" + rowId,                         null,                        null,                         null,                         null,                         null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    //---updates a title---    /*public boolean updateTitle(long rowId, int latitude,     int longitude)     {        ContentValues args = new ContentValues();        args.put(KEY_LATITUDE, latitude);        args.put(KEY_LONGITUDE, longitude);        return db.update(DATABASE_TABLE, args,                          KEY_ROWID + ""="" + rowId, null) > 0;    }*/}</code></pre><p>Now my question is - am I doing something wrong here? If yes could someone please tell me what? And how I should retrieve the records in organised list manner? Help would be greatly appreciated!!</p><p>This are the error it throws:</p><pre>06-06 14:49:32.434: ERROR/Database(276): Error inserting latitude=0 longitude=006-06 14:49:32.434: ERROR/Database(276): android.database.sqlite.SQLiteException: no such table: coordsStorage: , while compiling: INSERT INTO coordsStorage(latitude, longitude) VALUES(?, ?);06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteProgram.&lt;init>(SQLiteProgram.java:59)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:41)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:925)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1300)06-06 14:49:32.434: ERROR/Database(276):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)06-06 14:49:32.434: ERROR/Database(276):     at tabs.app.DBAdapter.insertCoords(DBAdapter.java:81)06-06 14:49:32.434: ERROR/Database(276):     at tabs.app.Tribocracy$1.onClick(Tribocracy.java:118)06-06 14:49:32.434: ERROR/Database(276):     at android.view.View.performClick(View.java:2344)</pre><p>and then when I'm trying to retrieve it it throws this:</p><pre>06-06 14:49:52.734: INFO/Process(51): Sending signal. PID: 276 SIG: 306-06 14:49:52.734: INFO/dalvikvm(276): threadid=7: reacting to signal 306-06 14:49:52.734: ERROR/dalvikvm(276): Unable to open stack trace file /data/anr/traces.txt': Permission denied</pre>","359656","","236247","","2011-06-29 03:44:47","2014-01-23 14:36:33","Android SQLite crashes after trying retrieving data from it","<android><sqlite>","2","3","","",""
"2984339","1","","","2010-06-06 13:33:03","3","868","<p>I am planning to develop for WP7 and Android.</p><p>What is the better way to display (and traverse) 3D scene/models in term of <a href=""http://en.wikipedia.org/wiki/Level_of_detail"" rel=""nofollow"">LoD</a>?The data is planned to be island-wide (Singapore).</p><p>1) <a href=""http://www.gamasutra.com/view/feature/3188/realtime_dynamic_level_of_detail_.php"" rel=""nofollow"">Real-Time Dynamic Level of Detail Terrain Rendering</a><br>2) Discrete LoD<br>3) Others?</p><p>And please advice some considerations/algorithms/resources/source codes. something like <a href=""http://lodbook.com/"" rel=""nofollow"">LoD book</a> also Okay.</p><p>Side note: I am a beginner in this area but pretty well-versed in C/C++. And I haven't read the <a href=""http://lodbook.com/"" rel=""nofollow"">LoD book</a>.</p><p>Related posts:<br>- <a href=""http://stackoverflow.com/questions/1013675/distant-3d-object-rendering-games"">Distant 3D object rendering [games]</a><br>- <a href=""http://groups.google.com/group/replica-island-coding-community/browse_thread/thread/ee9e86c727ca9b61"" rel=""nofollow"">Chris Pruett's 3D benchmark for Android</a>  </p>","109747","","109747","","2010-06-23 03:37:50","2010-08-07 22:35:38","Level of Detail for 3D terrains/models in Mobile Devices (Android / XNA )","<android><graphics><3d><xna>","3","0","4","",""
"2984414","1","2985166","","2010-06-06 13:53:22","10","4943","<p>In android, the notification bar at the top has a shadow most of the time. However, sometimes, such as when an app has it's title-bar showing, or in some other cases (such as in the twitter app or the market) that shadow effect is gone. My guess is that the shadow is supposed to be there when the content underneath can scroll.</p><p>In my app, however, the content underneath can't scroll, and I think the shadow looks bad on the top part of my logo.</p><p>Does anyone know how to disable it?</p>","6007","","-1","","2011-03-23 20:47:09","2011-03-23 20:47:09","remove notification bar shadow in android app","<java><android><android-ui>","1","1","7","",""
"2984430","1","2984523","","2010-06-06 14:01:36","1","1868","<p>Hopefully this will actually make sense and sorry if its a stupid / obvious question. Basically I'm calling the onDraw method like so...</p><pre><code>    requestWindowFeature(Window.FEATURE_NO_TITLE);     Preview mPreview = new Preview(this);     DrawOnTop mDraw = new DrawOnTop(this);  setContentView(mPreview);     addContentView(mDraw, new LayoutParams     (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));</code></pre><p>You see I'm drawing it on top of a Camera view and the information being drawn is subject to change. I have a listener setup which will update the variables being drawn at the appropriate time but I now want to ""refresh"" this draw in that listener. How would I do such a thing?</p>","358438","","","","","2010-06-06 14:27:51","Call OnDraw in another method, then ""refresh"" that call in ANOTHER method","<java><android>","1","0","","",""
"2984439","1","2984468","","2010-06-06 14:04:11","1","170","<p>I am having some design techniques about How shall I schedule a code to retrieve the weather info?<br>Should I use alarms to retrieve the weather each 10 minutes?<br>And do I need to run a service for this? Or just put the code in the Broadcastreceiver and start when the alarm fired?</p>","243782","","","","","2010-06-06 14:11:56","Updating weather info, should I use alarm and/or a service?","<android>","1","0","","",""
"2984531","1","","","2010-06-06 14:30:45","1","1795","<p>I m a novice in android.. i want to add a button or menu item in message inbox or email. how can i do so.</p>","359728","","114066","","2010-06-07 14:33:22","2010-06-07 14:33:22","How to add button/menu item in android","<android>","2","0","","",""
"2984594","1","2984600","","2010-06-06 14:47:01","2","2353","<p>The main Activity I use in my Android application uses a fair amount of memory, meaning that on a less powerful phone, it is susceptible to being killed off when not at the front. Normally this is fine, but it also happens when I am still inside my application, but have a different activity at the top of the stack (such as a preference activity).</p><p>Obviously it's a problem if my application is killed while the user is still running it. Is there any way to disable the OS's ability to kill off the application for low memory problems? </p><p>Thanks.</p>","118241","","","","","2010-06-06 16:09:57","Android Keep Activity from Dieing","<java><android><memory><activity>","2","0","","",""
"2984639","1","","","2010-06-06 14:57:13","3","859","<p><b>Bug</b></p><p>I have a weird bug in my piano app. Sometimes keys (and thus notes) hang. I did a lot of debugging and narrowed it down to what looks like androids inaccuracy of motion event handling:</p><pre><code> DEBUG/(2091): ACTION_DOWN A4 DEBUG/(2091): KeyDown: A4 DEBUG/(2091): ACTION_MOVE A4 =&gt; A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 =&gt; A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 =&gt; A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_UP B4 //HOW CAN THIS BE???? DEBUG/(2091): KeyUp: B4 DEBUG/(2091): Stream is null, can't stop DEBUG/(2091): Hanging Note: A4 X=240-287 EventX=292 Y=117-200 EventY=164 DEBUG/(2091): KeyUp Note:   B4 X=288-335 EventX=292 Y=117-200 EventY=164</code></pre><p>Clearly it can be seen here that out of nowhere I suddenly have an <code>ACTION_UP</code> for another note. Shouldn't I definitely get a <code>ACTION_MOVE</code> first?</p><p>As shown in the end of the log, it's definitely not an error in region detection, since the <code>ACTION_UP</code> event is clearly in the B4 region.</p><p><b>Logging Implementation details</b></p><p>Every <code>onTouchEvent()</code> call is logged, so the log is accurate.</p><p>The relevant pseudo-code for the ACTION_MOVE logging is:</p><pre><code> Key oldKey = Key.get(event.getHistoricalX(), event.getHistoricalY()); Key newKey = Key.get(event.getX(), event.getY());</code></pre><p><b>Question</b></p><p>Is this normal behaviour for Android (the jumping in coordinates)? </p><p>Can a <code>ACTION_UP</code> just occur without any previous <code>ACTION_MOVE</code> towards it's coordinates?</p>","107029","","107029","","2010-06-06 15:30:45","2012-06-15 16:19:43","Is android's motion event handling accurate?","<android><touch><motion-detection>","1","3","","",""
"2984728","1","","","2010-06-06 15:22:06","0","674","<p>I have released an app (World Time) with initial database. Now i want to update the app with a database upgrade.</p><p>I have put in the upgrade code in OnUpgrade() and checking for the newVersion. But it was not being called in my local testing...</p><p>So i put in the debug statement to get the database version and it is zero .</p><p>Any idea why it is not being versioned ?</p><p>Following is the code to copy the database from my Assets folder ...</p><pre><code>    InputStream myInput = myContext.getAssets().open(DB_NAME);    // Path to the just created empty db    String outFileName = DB_PATH + DB_NAME;    //Open the empty db as the output stream    OutputStream myOutput = new FileOutputStream(outFileName);    //transfer bytes from the inputfile to the outputfile    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();</code></pre><p>Following is my constructor, OnCreate() &amp; OnUpgrade()</p><pre><code>public DatabaseHelper(Context context) {    super(context, DB_NAME, null, DB_VERSION);    this.myContext = context;}@Overridepublic void onCreate(SQLiteDatabase db) {}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    if(oldVersion == 1 &amp;&amp; newVersion == 2){        String sql = ""update statement....""; // i have a correct update statement here        db.execSQL(sql);    }}</code></pre><p>--<br>Mahesh<br><a href=""http://android.maheshdixit.com"" rel=""nofollow"">http://android.maheshdixit.com</a></p>","359747","","359747","","2010-06-06 17:51:20","2010-06-20 17:45:18","Database version is zero on initial install","<android><sqlite>","3","3","","",""
"2984762","1","2984835","","2010-06-06 15:32:27","1","142","<p>So, I noticed that I can organize apps into folders (HTC Incredible). However these folders are fairly limited in their capabilities. I want to implement an activity that extends the ""base"" folder activity (at the very least I want to add the ability to rearrange items in folders), but I can't figure out the class name... So, what's the name of the class that is used when adding a ""New Folder"" to the Home screen?</p><p>PSI did take a look at the Android developer <a href=""http://developer.android.com/resources/articles/live-folders.html"" rel=""nofollow"">website</a>. But the discussion there revolves mostly around content providers. I assume that's not quite what I need since I'd have to create a separate content provider for each new folder, or am I misunderstanding something?</p>","350103","","350103","","2010-06-11 23:20:44","2010-06-11 23:20:44","Extending folder (LiveFolder?) class","<android><folder><htcsense>","2","0","","",""
"2984957","1","2988341","","2010-06-06 16:39:21","3","840","<p>I've been trying to experiment with developing Android applications with Scala.</p><p>I've gotten to the point where I can get the app to compile, but there are no helper functions for things like:</p><pre><code>button.setOnClickListener( () =&gt; {    text.setText(""test"")})</code></pre><p>(I'm talking about the closure there)</p><p>I see lots of references to scala-android.jar, and have this file in my project, but I'm not sure what it does, or how to use it.  I get the feeling it has these helper conversion functions, but I'm not sure.  Running <code>jar -tvf scala-android.jar</code> on the file gives me this:</p><pre><code>401 Sun Jun 06 10:06:02 MDT 2010 scala/Function0$class.class431 Sun Jun 06 10:06:02 MDT 2010 scala/Function0.class572 Sun Jun 06 10:06:02 MDT 2010 scala/Function1.class282 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject$class.class271 Sun Jun 06 10:06:02 MDT 2010 scala/ScalaObject.class458 Sun Jun 06 10:06:02 MDT 2010 scala/runtime/BoxedUnit.class</code></pre><p>If this isn't what I'm looking for, is there a simple library that'll do conversions for this kind of stuff?</p>","238849","","243782","","2010-06-06 17:35:00","2010-06-07 09:28:49","What is in scala-android.jar?","<java><android><scala>","1","0","1","",""
"2985016","1","3072064","","2010-06-06 16:57:19","0","381","<p>So I've been looking at code from various parts of the Android git, but when I try to load and compile many of them (camera, media player, etc) they reference classes and parts of the SDK that just aren't available even with my SDK version updated to 2.2.  (for example the bitmap config option inNativeAlloc)</p><p>Is there a reason that these are not in the SDK given out to developers?</p>","118241","","648313","","2011-07-13 21:00:05","2011-07-13 21:00:05","Android Source Not Compilable?","<java><android><android-source>","2","0","","",""
"2985045","1","","","2010-06-06 17:08:36","3","3862","<p>I'm currently working on a webservice-client for Android. I'm using a Java client library which provides an abstraction for interaction with the service. The client library works on normal machines. However, when I use the classes in my Android project, some calls don't return a result on Android, the background-service stops working at the first of those commands. Wireshark shows a tcp exchange, the server gets the requests. There is no exceptions or anything. Something in the serialization/deserialization seams not to work. I'm using the newest version of Jackson libraries (1.5.3) and the restlet jar in the android edition. Is there any known problems with Jackson and Android? Which code and libraries are compatible with Android?</p>","330816","","114066","","2010-07-15 08:48:19","2010-10-09 02:45:15","Android compatibility with Restlet/JSON/Jackson","<java><android><json><restlet><jackson>","2","0","","",""
"2985156","1","","","2010-06-06 17:37:42","1","172","<p><strong>Note:</strong>  </p><p><strong>The VM mentioned in here is not like in VMWare or VirtualBox, it is more like Java Virtual Machine (JVM), (as well as Python and Ruby).That is, the fact that objective c is an interpreted language, should make it easier.</strong></p><p>For a long time I wondered if the following idea worth a nickel or just a waste of time and energy. I am willing to start a project which will provide a kind of a VM for all iPxxx apps - so developed once for iPxxx can run on a Macbook, iMac, Linux, Android and windows (desktop and mobile). You get the idea, right?</p><p>I want to do to the current iPhone SDK, the same as what Mono did to Microsoft .Net and perhaps a more complete set of implementation.</p><p>I tend to believe that if overnight all apps on appstore become available on the android market as well that would be a mini revolution. Think about running iPad apps on every tablet that will come out to the market in the future.</p><p>Wouldn't it be fantastic to all the developers, which from now on, can write once and sell everywhere?</p><p>The main questions which I ask myself repeatedly is: ""Is This Legal?"" - I mean, say I have done this, would apple's lawyers will start sending me all kinds of nasty emails?</p><p>I am willing to hear your opinion about this idea as well as if some of you willing and able to join forces and start this open source project.</p>","9296","","21234","","2010-06-24 08:57:01","2010-06-24 08:57:01","Would there be a market for this idea (cross platform VM for iPhone OS)","<android><iphone><open-source><cross-platform>","2","2","1","",""
"2985171","1","2985322","","2010-06-06 17:41:00","1","1230","<p>What's the best way to create a reusable loading screen in Android? The loading screen should have a background image and a loading indicator.</p><p>Should I use a separate activity?</p>","143378","","143378","","2010-06-06 17:47:24","2010-06-06 18:28:23","Loading screen in Android","<android><activity>","2","2","","",""
"2985225","1","2985285","","2010-06-06 17:55:13","2","1632","<p>I would like to make a LinearLayout that was created from xml invisible, and another LinearLayout visible to replace it.  The replacement layout starts out as invisible. When I make the originally visible layout invisible, it still leaves space for it on the screen.  How can I refresh the screen so that space is gone?  </p>","48784","","","","","2011-08-17 14:34:39","Make part of layout invisible and the other part visible","<android><layout>","3","0","","",""
"2985302","1","2985340","","2010-06-06 18:16:36","9","4565","<p>I'm looking to test some code I've written and to do so I need to construct a variable of type Location and to give it a long / lat value but I'm unsure how I would do so. Any ideas?</p>","358438","","","","","2010-06-06 18:25:54","Android: How to initialize a variable of type ""Location"" (other than making it equal to null)","<android><geolocation>","1","0","","",""
"2985363","1","2985458","","2010-06-06 18:29:47","1","1205","<p>Is it possible to change the orientation of an ImageView to be always PORTRAIT, while the other views in the activity can rotate?</p><p>Since images don't always look good when rotated...</p><p>ThanksChris</p>","321927","","","","","2010-06-06 18:52:30","Android change orientation of ImageView","<android><orientation><imageview>","1","0","","",""
"2985424","1","3737988","","2010-06-06 18:43:57","0","360","<p>I have a use-case for a vertical 1x4 home screen widget on android. The supported size is 4x1 ie horizontal. Does anyone know if the vertical version can be implemented?</p><p>I realize changing screen orientation would scrunch the widget together, which I'm fine with. Even better would be if there was an equivalent to ""overflow hidden"" in css. </p><p>Has anyone come across a way to do this?</p>","320263","","","","","2010-09-17 18:34:00","Non-Standard widget size for Android","<android><size><widget><standards>","2","0","","",""
"2985580","1","3016624","","2010-06-06 19:25:18","3","768","<p>Thanks,</p><p>EDIT///</p><p>Converting the outcome to radians gives me a lat of 5.6xxxxxxxxxxxxxx .I have a feeling this bug has something to do with conversions but its not THAT simple.</p><p>The equation is correct, it just.. outputs wrong..</p>","358438","","358438","","2010-06-13 23:56:18","2010-06-13 23:56:18","Android-Java: Constructing a triangle based on Coordinates on a map and your bearing","<android><math><geolocation><coordinates><triangle-generation>","3","0","","","2010-06-07 10:59:54"
"2985814","1","","","2010-06-06 20:37:51","1","1886","<p>I need to implement HorizontalScrollView which is scrolled to predefined positions (similar to Home behaviour). It works with slow gestures, but does not work with neither flings nor arrow key press.</p><p>I hooked to View.onScrollChanged() and it is called when scrolling happened, but I can't determine when scrolling animation ends. </p><p>In theory there should be a way to say that fling movement is over. Is there such API?</p>","359881","","359881","","2010-06-07 19:04:20","2011-08-19 11:50:01","Android: How to detect end of scroll","<android>","2","0","1","",""
"2985890","1","3479668","","2010-06-06 21:03:31","6","3296","<p>I have quite a complicated <code>ListView</code>. Each item looks something like this:</p><pre><code>&gt; LinearLayout (vertical)  &gt; LinearLayout (horizontal)    &gt; include (horizontal LinearLayout with two TextViews)    &gt; include (ditto)    &gt; include (ditto)  &gt; TextView  &gt; HorizontalScrollView (this guy is my problem)    &gt; LinearLayout (horizontal)</code></pre><p>In my activity, when an item is created (<code>getView()</code> is called) I add dynamic <code>TextView</code>s to the <code>LinearLayout</code> inside the <code>HorizontalScrollView</code> (besides filling the other, simpler stuff out). Amazingly, performance is pretty good.</p><p>My problem is that when I added the <code>HorizontalScrollView</code>, my list items became unclickable. They don't get the orange background when clicked and they don't fire the <code>OnItemClickedListener</code> I have set up (to do a simple <code>Log.d</code> call).</p><p>How can I make my list items clickable again?</p><hr><p><strong>Edit:</strong> setting <code>android:descendantFocusability=""blocksDescendants""</code> on the topmost <code>LinearLayout</code> seems to work. I'd like to know if there are other ways, though: what if I want focusable items in my list items?</p>","180784","","21234","","2010-06-25 13:21:03","2013-10-09 13:55:32","ListView items not clickable with HorizontalScrollView inside","<android><listview>","3","0","1","",""
"2986044","1","","","2010-06-06 21:55:12","1","594","<p>I'm subclassing Android's view class, but whenever I make an instance of the view from another class, the constructor never gets called (or so it seems). I've implemented both <code>public myclass (Context context)</code> and <code>public myclass (Context context, AttributeSet, attrs)</code></p><p>I can't figure out what I'm doing wrong. Do I need to override onDraw and onMeasure? </p><p>Thanks for help in advance!</p>","253567","","","","","2010-06-06 22:12:24","Subclass of View constructor not being called","<android><constructor><view><subclass>","1","2","","",""
"2986089","1","2986282","","2010-06-06 22:06:32","1","703","<p>I need my app to be the default action for opening a particular file type. How do I control this? Also, how can my app access the file being opened?</p><p>Thanks.</p>","359917","","","","","2010-06-06 23:02:23","How to make an Android app the default for a filetype?","<android><file-io>","2","0","1","",""
"2986162","1","","","2010-06-06 22:28:07","3","1884","<p>I have a very simple project that compiles, but can't be started on Emulator. The problem is with this method:</p><pre><code>private void bar(@Some String a) {} // java.lang.VerifyError</code></pre><p>The issue can be avoided if annotation removed</p><pre><code>private void bar(String a) {} // OK</code></pre><p>or the method visibility changed:</p><pre><code>void bar(@Some String a) {} // OKpublic void bar(@Some String a) {} // OKprotected void bar(@Some String a) {} // OK</code></pre><p>Any idea what is wrong with original method? Is this a dalvik bug, or?</p><p>If some one whould like to experiment with code, here it is:</p><p>Test.java:</p><pre><code>public class Test {    private void bar(@Some String a) {}    public void foo() {        bar(null);    }}</code></pre><p>Some.java:</p><pre><code>public @interface Some {}</code></pre><p>MainActivity.java:</p><pre><code>public class MainActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new Test().foo();    }}</code></pre><p>Stack trace:</p><pre><code>ERROR/dalvikvm(1358): Could not find method com.my.Test.bar, referenced from method com.my.Test.fooWARN/dalvikvm(1358): VFY: unable to resolve direct method 11: Lcom/my/Test;.bar (Ljava/lang/String;)VWARN/dalvikvm(1358): VFY:  rejecting opcode 0x70 at 0x0001WARN/dalvikvm(1358): VFY:  rejected Lcom/my/Test;.foo ()VWARN/dalvikvm(1358): Verifier rejected class Lcom/my/Test;DEBUG/AndroidRuntime(1358): Shutting down VMWARN/dalvikvm(1358): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)ERROR/AndroidRuntime(1358): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(1358): java.lang.VerifyError: com.my.TestERROR/AndroidRuntime(1358):     at com.my.MainActivity.onCreate(MainActivity.java:13)ERROR/AndroidRuntime(1358):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)ERROR/AndroidRuntime(1358):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)ERROR/AndroidRuntime(1358):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)ERROR/AndroidRuntime(1358):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)ERROR/AndroidRuntime(1358):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)ERROR/AndroidRuntime(1358):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(1358):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(1358):     at android.app.ActivityThread.main(ActivityThread.java:3948)ERROR/AndroidRuntime(1358):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(1358):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(1358):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)ERROR/AndroidRuntime(1358):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)ERROR/AndroidRuntime(1358):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","62192","","","","","2011-08-30 11:11:33","Android java.lang.VerifyError for private method with annotated argument","<java><android><annotations><verifyerror>","2","0","0","",""
"2986337","1","4194447","","2010-06-06 23:22:44","15","8129","<p>I'd like to run an Android background service that will act as a keylistener from the home screen or when the phone is asleep.  Is this possible?</p><p>From semi-related examples online, I put together the following service, but get the error, ""onKeyDown is undefined for the type Service"".  Does this mean it can't be done without rewriting Launcher, or is there something obvious I'm missing?</p><pre><code>public class ServiceName extends Service {    @Override    public void onCreate() {        //Stuff    }    public IBinder onBind(Intent intent) {        //Stuff        return null;    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        if(event.getAction() == KeyEvent.ACTION_DOWN) {        switch(keyCode) {        case KeyEvent.KEYCODE_A:            //Stuff            return true;        case KeyEvent.KEYCODE_B:            //Stuff            return true;            //etc.        }        }        return super.onKeyDown(keyCode, event);    }}</code></pre><p>I realize Android defaults to the search bar when you type from the home screen, but this really is just for a very particular use.  I don't really expect anyone but me to want this.  I just think it'd be nice, for example, to use the camera button to wake the phone.</p>","256425","","256425","","2010-06-11 04:39:49","2013-03-08 10:59:48","Is it possible to create an Android Service that listens for hardware key presses?","<android><listener><keyevent>","1","1","9","",""
"2986387","1","","","2010-06-06 23:42:31","18","7384","<p>Is it possible to have an <code>EditText</code> widget with <code>android:inputType=""textMultiLine""</code> set, and <code>android:imeOptions=""actionDone""</code> at the same time?</p><p>I'd like a multi-line edit box, with the action button on the keyboard to be Done, not Enter (Carriage Return), but it doesn't seem to be working..</p><p>Thanks in advance</p>","350237","","","","","2013-06-23 20:25:44","Multi-line EditText with Done action button","<android>","5","2","4","",""
"2986628","1","","","2010-06-07 01:30:46","7","6208","<p>I know this question is definitely solved somewhere many times already, please enlighten me if you know of their existence, thanks.</p><p>Quick rundown:I want to compute from a 3 axis accelerometer the gravity component on each of these 3 axes.I have used 2 axes free body diagrams to work out the accelerometer's gravity component in the world X-Z, Y-Z and X-Y axes. But the solution seems slightly off, it's acceptable for extreme cases when only 1 accelerometer axis is exposed to gravity, but for a pitch and roll of both 45 degrees, the combined total magnitude is greater than gravity (obtained by Xa^2+Ya^2+Za^2=g^2; Xa, Ya and Za are accelerometer readings in its X, Y and Z axis).</p><p>More detail:The device is a Nexus One, and have a magnetic field sensor for azimuth, pitch and roll in addition to the 3-axis accelerometer.</p><p>In the world's axis (with Z in the same direction as gravity, and either X or Y points to the north pole, don't think this matters much?), I assumed my device has a pitch (P) on the Y-Z axis, and a roll (R) on the X-Z axis. With that I used simple trig to get:Sin(R)=Ax/GxzCos(R)=Az/GxzTan(R)=Ax/Az</p><p>There is another set for pitch, P.</p><p>Now I defined gravity to have 3 components in the world's axis, a Gxz that is measurable only in the X-Z axis, a Gyz for Y-Z, and a Gxy for X-Y axis.Gxz^2+Gyz^2+Gxy^2=2*G^2the 2G is because gravity is effectively included twice in this definition.</p><p>Oh and the X-Y axis produce something more exotic... I'll explain if required later.</p><p>From these equations I obtained a formula for Az, and removed the tan operations because I don't know how to handle tan90 calculations (it's infinity?).</p><p>So my question is, anyone know whether I did this right/wrong or able to point me to the right direction?</p><p>Thanks!Dvd</p>","359975","","","","","2014-01-10 19:53:53","Accelerometer gravity components","<android><algorithm><physics><accelerometer>","5","0","5","",""
"2986772","1","2987723","","2010-06-07 02:27:29","2","306","<p>In Visual Studio, I can obtain a succinct list of public methods/members exposed in a class for which I do not have the source (i.e. bundled inside a DLL) by pressing F12 (GoToDefinition).</p><p>Similarly, I am learning the Android API - in Eclipse. Jumping to an Android framework method definition produces decompilation output which is not intuitive to read, and is very verbose. To mimic results like Visual Studio, I am considering several options:</p><ol><li>How can I format the decompilation output to be 'cleaner' - I have looked through Eclipse's preferences menus and have not found a way to do this.</li><li>How do I 'add corresponding source files' once Google provides it, so that jumping to definition yields the actual definition?</li><li>Is there a plugin that does this already? I looked into Jadclipse, but that project has not been updated in several years, and is still a decompiler.</li></ol><p>Thank you in advance.</p>","226937","","","","","2010-07-01 07:53:44","Eclipse Class File Metadata","<java><android><eclipse><decompiler>","3","0","1","",""
"2986930","1","2988648","","2010-06-07 03:31:30","1","500","<p>Now I make a trial application. I'd like to store IMEI and other info in Android permanently. And I don't want to lose them after uninstalling it.</p><p>I tested with shared preference but it deletes after un-installation.</p><pre><code>          SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);      SharedPreferences.Editor editor = settings.edit();      editor.putBoolean(""silentMode"", true);                        // Commit the edits!      editor.commit();</code></pre><p>let me know where to store.</p>","305732","","","","","2010-06-07 10:22:16","don't wanna lose data on Android after uninstalling","<android><storage><imei><trial>","2","1","","",""
"2986973","1","","","2010-06-07 03:46:26","0","1867","<p>Thanks to every on to support android development forum.I want to make a application where when I click a button in my application then open android built-in Calculator application.</p><p>That means I want to call calculator apk file from my application.Is it possible?</p><p>Advanced thanks to reply</p>","360027","","21234","","2010-07-14 14:25:24","2012-11-30 08:26:29","How to open android calculator buit-in-application","<android>","1","0","1","",""
"2987011","1","2987074","","2010-06-07 04:04:52","8","6599","<p>Sorry if this is a noob question, I searched quite a bit and couldn't find an answer. </p><p>I'm developing a html5 app that relies on sqlite for local storage.</p><p>I'd like for it to appear as an app icon on the iPhone/Android screen, what's the best way to do this? Ie can I write some sort of ""wrapper"" app to achieve it?</p><p>Thanks!</p>","360034","","539542","","2012-01-15 06:16:11","2012-04-23 07:10:48","HTML5 Webapp as regular icon or app on iPhone and Android.","<iphone><android><sqlite><html5><web-applications>","4","0","4","",""
"2987049","1","2987485","","2010-06-07 04:19:19","0","5586","<p>I have an Android Activity with a RelativeLayout and I have implemented the following method to prevent the activity from being recreated on change of Orientation:</p><pre><code>@Overridepublic void onConfigurationChanged(Configuration newConfig) {           super.onConfigurationChanged(newConfig);}</code></pre><p>I am obviously not doing anything in this method, but it worked perfect when using a LinearLayout. Now however, using RelativeLayout, my layout is all messed up when changing to landscape orientation.</p><p>What is the most efficient way to have the screen redraw correctly without having the activity restarted again with a call to onCreate?</p>","268648","","","","","2010-06-07 10:15:27","How to refresh an Android RelativeLayout when orientation changes without restarting the Activity?","<android>","2","1","","",""
"2987113","1","2987680","","2010-06-07 04:48:08","1","411","<p>I would like to show a banner in an Android activity. </p><p>The banner should be:</p><ul><li>Aligned at the bottom of the layout</li><li>Take all the width and have relative height (say 100dip)</li><li>Be dismissable</li></ul><p>When dismissed the rest of the layout should strech to fill the area that was occupied by the banner.</p><p>What's the best way to implement this in Android? </p><p>Thanks!</p>","143378","","","","","2010-06-07 07:19:52","Dismissable banner in Android","<android><layout><banner>","1","0","","",""
"2987140","1","6667640","","2010-06-07 04:56:23","4","2911","<p>What's the best way to use Amazon Simple Storage Service (S3) on Android?</p><p>For iPhone I use ASIHTTPRequest. Is there something similar for Android?</p>","143378","","143378","","2010-06-08 00:45:15","2011-07-12 16:26:09","Using Amazon Simple Storage Service (S3) on Android","<android><amazon-s3><asihttprequest>","3","0","","",""
"2987455","1","","","2010-06-07 06:25:31","1","340","<p>Does any one know, or is it possible  to do one time payment, with paypal in android ?</p><p>Consider the senario.</p><ul><li><strong>Buyer purchases installs freeapplication.</strong></li><li><strong>Clicks on paypal module and makesin-app payment, purchases featuresuccessfully.</strong></li><li><strong>Buyer deletes application. Allinformation including the featurepurchase enty in database is deleted.</strong></li><li><strong>Buyer reinstalls the application.</strong></li></ul><p>Here is the catch, if he wants to use the feature he will have to do a re-purchase.Which I wann to avoid in my application. This is taken care in iPhone in-app purchase.That is if a buyer has already purchased an feature or in-app item, and if he trys to repurchase it (item has been set to one time payment), the in-app purchase transaction will succeed without the user actually having to repay for the item. </p><p>Is there an solution for this can anyone help.</p>","353497","","8976","","2010-06-07 07:26:42","2010-06-07 07:26:42","Android Paypal One time Payment","<android><paypal>","1","0","2","",""
"2987520","1","2990692","","2010-06-07 06:41:21","3","254","<p>I plan to work with android. Please point me some good books and blogs/discussion/tutorials/ forums for getting vast and in depth knowledge quickly about this android technology.</p>","297115","","8976","","2010-06-07 07:45:08","2010-06-07 15:15:04","Android development","<android>","1","0","1","2012-07-29 13:54:54",""
"2987610","1","","","2010-06-07 07:01:16","7","16095","<p>Hi all I am new to android. I parsed the calendar file. I need to add events to Google calendar from my application. I am using eclipse ide. In eclipse how to use the Google calendar api? Any jar file is needed  to use the calendar api?</p>","360127","","21234","","2010-06-07 07:02:26","2012-05-10 01:16:27","How to use google calendar api in android?","<android><google-calendar>","2","1","2","",""
"2987700","1","2989494","","2010-06-07 07:22:57","1","1220","<p>I wanna know if there is anyway to determine <strong>not through the packages, but through applications</strong> the version of an application which isnt the current application.</p><p>let's say right now i am in the scope of app A. and i wanna run an activity from app B. i wanna check before the version code of app B.</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-06-07 12:21:41","2010-06-07 12:36:05","Determine application version","<android>","1","0","","",""
"2987706","1","","","2010-06-07 07:23:18","21","26032","<p>I've just started looking at doing some basic mobile web development on the android and an writing a test script to investigate the touch events. I've run the following code in the android emulator, and the touchend event never gets fired. Can anyone tell me why ? </p><p>I've tried in three versions of the emulator (1.6, 2.1 and 2.2) and all three behave in the same way.</p><p>Thanks in advance for any help you can give me.</p><p>Cheers,Colm</p><p>EDIT - I've also tried this using the XUI framework and have the same problem so I'm guessing I have a fundamental misunderstanding of how this stuff works ......</p><p>            Map Test        </p><pre><code>    &lt;meta name=""description"" content="""" /&gt;    &lt;meta name=""keywords"" content="""" /&gt;    &lt;meta name=""language"" content=""english"" /&gt;    &lt;meta name=""viewport"" content=""minimum-scale=1.0,                                   width=device-width,                                   height=device-height,                                   user-scalable=no""&gt;    &lt;script type=""text/javascript""&gt;        window.onload = function(){            document.body.appendChild(                    document.createTextNode(""w: "" + screen.width + "" x "" + ""h : "" +screen.height)            );           attachTouchEvents();        }        function attachTouchEvents() {            console = document.getElementById(""console"");            var map = document.getElementById(""map"");            map.addEventListener ('touchstart', function (event) {                event.preventDefault();                var touch = event.touches[0];                document.getElementById(""touchCoord"").innerHTML = ""S : "" + touch.pageX + "" "" + touch.pageY;                document.getElementById(""touchEvent"").innerHTML = ""Touch Start"";            }, false);            map.addEventListener ('touchmove', function (event) {                event.preventDefault();                var touch = event.touches[0];                document.getElementById(""touchCoord"").innerHTML = ""M : "" + touch.pageX + "" "" + touch.pageY;                document.getElementById(""touchEvent"").innerHTML = ""Touch Move"";            }, false);            map.addEventListener ('touchend', function (event) {                var touch = event.touches[0];                document.getElementById(""touchCoord"").innerHTML = ""E : "" + touch.pageX + "" "" + touch.pageY;                document.getElementById(""touchEvent"").innerHTML = ""Touch End"";                event.preventDefault();            }, false);            console.innerHTML = ""event attached"";        }    &lt;/script&gt;    &lt;style type=""text/css""&gt;        html, body {            height:100%;            width:100%;            margin: 0;            background-color:red;        }        #map {            height: 300px;            width: 300px;            background-color:yellow;        }    &lt;/style&gt;&lt;/head&gt;&lt;body&gt;    &lt;div id=""map""&gt;&lt;/div&gt;    &lt;div id=""touchCoord""&gt;Touch Coords&lt;/div&gt;    &lt;div id=""touchEvent""&gt;Touch Evnt&lt;/div&gt;    &lt;div id=""console""&gt;Console&lt;/div&gt;&lt;/body&gt;</code></pre><p></p>","360137","","360137","","2010-06-07 08:22:13","2012-12-18 18:04:20","touchend event doesn't work on Android","<javascript><android><events><touch>","5","2","7","",""
"2987893","1","2988178","","2010-06-07 08:05:48","2","388","<p>I have some messages being passed back from my server through php.  The problem is that the messages are in English and if the user is using another language they will still get the message in English.</p><p>So I had an idea that maybe instead of passing back the message I would instead pass the String resource Id from the android app, that way the app will get the correct string id for their language.  I will use this in a number of apps so I just want to know if the string id is guaranteed to be the same across different android projects?</p>","248521","","234938","","2010-06-07 09:07:28","2010-06-07 12:59:52","Are string resource ID values guaranteed to be consistent over different projects?","<android><resources>","3","0","","",""
"2987910","1","","","2010-06-07 08:10:24","0","549","<p>How to add icons to the android context menu?</p>","360174","","","","","2010-06-07 08:15:38","How to add icons to the android context menu?","<android><menu><context>","1","1","","",""
"2988072","1","3000635","","2010-06-07 08:42:27","4","5530","<p>I need to handle orientation changes in my Android application. For this purpose I decided to use <code>OrientationEventListener</code> convenience class. But his callback method is given somewhat strange behavior. </p><p>My application starts in the portrait mode and then eventually switches to the lanscape one. I have some custom code executing in the callback <code>onOrientationChanged</code> method that provides some additional UI handling logic - it has a few calls to <code>findViewById</code>.What is strange is that when switching back from landscape to portrait mode <code>onOrientationChanged</code> callback is called twice, and what's even worse - the second call is dealing with <strong>bad</strong> <code>Context</code> - <code>findViewById</code> method starts returning <code>null</code>. These calls are made right from the <em>MainThread</em></p><pre><code>    @Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    listener = new OrientationListener();}    @Overrideprotected void onResume() {         super.onResume();    // enabling listening    listener.enable();}    @Overrideprotected void onPause() {    super.onPause();    // disabling listening    listener.disable();}</code></pre><p>I've replicated the same behavior with a dummy <code>Activity</code> without any logic except for one that deals with orientation hadling.I initiate orientation switch from the Android 2.2 emulator by pressing <em>Ctrl+F11</em>What could be wrong?</p><p>Upd:Inner class that implements <code>OrientationEventListener</code></p><pre><code>private class OrientationListener extends OrientationEventListener {    public OrientationL() {        super(getBaseContext());    }    @Override    public void onOrientationChanged(int orientation) {        toString();    }}</code></pre><p>}</p>","118104","","118104","","2010-06-07 10:27:58","2011-04-30 15:17:07","Problems when handling orientation changes","<android><android-emulator><screen-orientation><android-2.2-froyo>","3","4","1","",""
"2988150","1","2988248","","2010-06-07 08:59:49","2","1406","<p>Can someone please tell me how can I easily display every record from sqllite in ListActivity tab? I'm kinda confused with this. Do I have to create db from my helper class in TabActivity or ListActivity or both? My db helper class is as follow:</p><pre><code>package tabs.app;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;public class DBAdapter { private static String DB_PATH = ""/data/data/tabs.app/databases/"";    public static final String KEY_ROWID = ""_id"";    public static final String KEY_LATITUDE = ""latitude"";    public static final String KEY_LONGITUDE = ""longitude"";    private static final String TAG = ""DBAdapter"";    private static final String DATABASE_NAME = ""coords"";    private static final String DATABASE_TABLE = ""coordsStorages"";    private static final int DATABASE_VERSION = 2;   /* private static final String DATABASE_CREATE =        ""create table coordsStorage (_id integer primary key autoincrement, latitude integer not null, longitude integer not null)"";     */       public Context context;     private DatabaseHelper DBHelper;    private SQLiteDatabase db;    public DBAdapter(Context ctx)     {        this.context = ctx;        DBHelper = new DatabaseHelper(context);    }    private static class DatabaseHelper extends SQLiteOpenHelper     {        DatabaseHelper(Context context)         {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db)         {            db.execSQL(""create table coordsStorages (_id integer primary key autoincrement, latitude integer not null, longitude integer not null)"");        }        @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 titles"");            onCreate(db);        }    }        //---opens the database---    public DBAdapter open() throws SQLException     {        db = DBHelper.getWritableDatabase();        return this;    }    //---closes the database---        public void close()     {        DBHelper.close();    }    //---insert a title into the database---    public long insertCoords(int latitude, int longitude)     {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_LATITUDE, latitude);        initialValues.put(KEY_LONGITUDE, longitude);        return db.insert(DATABASE_TABLE, null, initialValues);    }    public void openDataBase() throws SQLException{        //Open the database        String myPath = DB_PATH + DATABASE_NAME;        db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);    }    //---deletes a particular title---    public boolean deleteTitle(long rowId)     {        return db.delete(DATABASE_TABLE, KEY_ROWID +           ""="" + rowId, null) &gt; 0;    }    //---retrieves all the titles---    public Cursor getAllTitles()     {        return db.query(DATABASE_TABLE, new String[] {          KEY_ROWID,           KEY_LATITUDE,          KEY_LONGITUDE},                 null,                 null,                 null,                 null,                 null);    }    //---retrieves a particular title---    public Cursor getTitle(long rowId) throws SQLException     {        Cursor mCursor =                db.query(true, DATABASE_TABLE, new String[] {                  KEY_ROWID,                  KEY_LATITUDE,                   KEY_LONGITUDE},                   KEY_ROWID + ""="" + rowId,                   null,                  null,                   null,                   null,                   null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    //---updates a title---    /*public boolean updateTitle(long rowId, int latitude,     int longitude)     {        ContentValues args = new ContentValues();        args.put(KEY_LATITUDE, latitude);        args.put(KEY_LONGITUDE, longitude);        return db.update(DATABASE_TABLE, args,                          KEY_ROWID + ""="" + rowId, null) &gt; 0;    }*/}And Im trying to retrieve the records in TabActivity like this:public class Areas extends ListActivity { DBAdapter db; SimpleCursorAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.areas_layout);          db = new DBAdapter(this);          db.open();          Cursor c = db.getAllTitles();          startManagingCursor(c);          String[] display = new String[] { db.KEY_LATITUDE };                int[] to = new int[] { R.id.row_latitude};        /*          String[] display2 = new String[] { db.KEY_LONGITUDE };                int[] to2 = new int[] { R.id.row_longitude};*/          mAdapter = new SimpleCursorAdapter(this, R.layout.areas_layout, c, display, to);          setListAdapter(mAdapter);       /*   mAdapter2 = new SimpleCursorAdapter(this, R.layout.areas_layout, c, display2, to2);          setListAdapter(mAdapter2);*/          db.close(); }/* private void fillData() {     // Get all of the rows from the database and create the item list     Cursor c = db.getAllTitles();     startManagingCursor(c); }*/}</code></pre><p>Whenever I'm trying to do that the error log outputs this:</p><pre><code>06-07 09:51:56.529:ERROR/AndroidRuntime(2034): Uncaughthandler: thread main exiting due touncaught exception06-07 09:51:56.559:ERROR/AndroidRuntime(2034):java.lang.RuntimeException: Unable tostart activityComponentInfo{tabs.app/tabs.app.Areas}:java.lang.RuntimeException: Yourcontent must have a ListView whose idattribute is 'android.R.id.list'06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.ActivityThread.startActivityNow(ActivityThread.java:2242)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:631)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.widget.TabHost.setCurrentTab(TabHost.java:317)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.widget.TabHost$2.onTabSelectionChanged(TabHost.java:127)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.widget.TabWidget$TabClickListener.onClick(TabWidget.java:346)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.View.performClick(View.java:2344)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.View.onTouchEvent(View.java:4133)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.View.dispatchTouchEvent(View.java:3672)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:850)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(    oneWindow.java:1712)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.Activity.dispatchTouchEvent(Activity.java:1987)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(    oneWindow.java:1696)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.view.ViewRoot.handleMessage(ViewRoot.java:1658)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.os.Handler.dispatchMessage(Handler.java:99)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.os.Looper.loop(Looper.java:123)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.ActivityThread.main(ActivityThread.java:4203)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atjava.lang.reflect.Method.invokeNative(NativeMethod)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atjava.lang.reflect.Method.invoke(Method.java:521)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atdalvik.system.NativeStart.main(NativeMethod)06-07 09:51:56.559:ERROR/AndroidRuntime(2034): Caused by:java.lang.RuntimeException: Yourcontent must have a ListView whose idattribute is 'android.R.id.list'06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.ListActivity.onContentChanged(ListActivity.java:236)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atcom.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:316)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.Activity.setContentView(Activity.java:1620)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     attabs.app.Areas.onCreate(Areas.java:18)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-07 09:51:56.559:ERROR/AndroidRuntime(2034):     ... 30more06-07 09:51:56.619: INFO/Process(51):Sending signal. PID: 2034 SIG: 306-07 09:51:56.619:INFO/dalvikvm(2034): threadid=7:reacting to signal 306-07 09:51:56.619:ERROR/dalvikvm(2034): Unable to openstack trace file'/data/anr/traces.txt': Permissiondenied</code></pre><p>Can someone please tell me what I'm doing wrong? Help greatly appreciated!</p>","359656","","600500","","2011-06-28 15:37:34","2011-06-28 15:37:34","How to correctly populate records from SQLite in ListActivity?","<android><sqlite>","2","0","","",""
"2988165","1","2991383","","2010-06-07 09:03:14","0","2483","<p>1.Is it possible to NOT use Google Maps in Android?<br>2. Can we use Navteq maps?<br>3. What will it take to write such an application?<br>4. Do we have to come up with our own version of MapView? </p><p>Pointers and links that can answer these questions and help me get started on 4. are welcome.</p><p>Thanks.</p>","236128","","","","","2011-01-07 16:27:14","Using Navteq maps in Android","<android><google-maps>","3","0","","",""
"2988200","1","2988300","","2010-06-07 09:09:31","2","6213","<p>What I have done is I have taken the class-files from my eclipse project and run them trough an optimizer/obfuscator. So I now have optimized class-files that I want to get in the form of an apk so I can sign and publish it. However, I am lost on how to do this. I guess I cant just copy them into the bin-folder of my eclipse-project, because eclipse would just overwrite them with a new compilation when I try to export a signed apk. So how do I create an apk from these class-files?</p><p>Cheers,</p>","249871","","","","","2011-05-13 12:23:01","Compile android project to apk without eclipse","<android><eclipse><obfuscation><apk>","2","0","3","",""
"2988314","1","2989625","","2010-06-07 09:24:07","0","1468","<p>I know this question has been asked in similar forms before, but I found no real answer about the following issue:</p><p>On my Nexus One there's a widget to toggle on/off several things on my phone like wlan, bluetooth, gps,..</p><p>Why does this widget has access to the GPS, without forwarding me to the settings screen?</p><p>And how can I use this functionality in my own apps?</p><p>On many sites it is mentioned, this is done because of security reasons...but in a strage way, this widget may do this? why? and the better question is: how?</p><p>Does someone have a clue?</p>","317301","","","","","2012-01-26 18:21:38","Enable GPS without forwarding the user to ""settings""?","<android><usability><gps>","1","2","","",""
"2988378","1","2988592","","2010-06-07 09:34:28","1","11115","<p>I have this below code access the ListView item value into string and display it in alert?</p><pre><code>ListView shot = getListView();shot.setOnItemClickListener(this);public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,long arg3) {    String S = arg1.getContext().toString();    AlertDialog.Builder alertbox = new AlertDialog.Builder(this);    // set the message to display    alertbox.setMessage(S).show();    }</code></pre>","164850","","114066","","2010-06-07 10:01:40","2013-03-27 09:27:48","How to get the value of a Listview item which is clicked in android?","<android><listview>","3","2","","",""
"2988391","1","","","2010-06-07 09:36:36","1","5128","<p>I encounter this problem when displaying text on SurfaceView, some chars can climb up on others, code is here:</p><pre><code>private static void fakeDraw(Canvas c){    Paint mPaint = new Paint();    int color = 0xff000000;    mPaint.setColor(color);    mPaint.setStrokeWidth(2);    mPaint.setStyle(Style.FILL);    mPaint.setAntiAlias(true);    FontMetricsInt fm = mPaint.getFontMetricsInt();    int fh = Math.abs(fm.top);     int left = 0;    int top = 100;    Rect smallClip = new Rect(left, top-fh, left + 200, top + 30);    Rect bigClip = new Rect(0, 0, getW(), getH());    c.drawRect(bigClip, mPaint);    String text1 = ""Evi"";    String text2 = ""&gt;&gt;"";    String text3 = ""Tom"";    color = 0xff303030;    mPaint.setColor(color);    c.drawRect(smallClip, mPaint);    color = 0xffffffff;    mPaint.setColor(color);    c.drawText(text1, left, top, mPaint);    Rect bounds = new Rect();    mPaint.getTextBounds(text1, 0, text1.length(), bounds);    left += bounds.width();    c.drawText(text2, left, top, mPaint);    left -= bounds.width();    top += 12;    c.drawText(text3, left, top, mPaint);    mPaint.getTextBounds(text3, 0, text3.length(), bounds);    left += bounds.width();    c.drawText(text2, left, top, mPaint);    }</code></pre><p>In the case of a second text Tom>> all displayed correctly, but the first text Evi>> not. The problem is that the chars >> draws in Evi draw space(last char ""i"")!! It is possible to see if you zoom the picture, what am I doing wrong and how to fix this?</p><p>screen shot can be found here: <img src=""http://img192.imageshack.us/img192/2782/imagexs.png""></p>","309955","","","","","2014-04-05 04:24:29","Android Canvas.drawString display problem","<android><canvas><metrics><drawtext>","2","4","","",""
"2988619","1","","","2010-06-07 10:17:38","0","476","<p>Hi I am new to android. I need to know the needed jar file's to add the calendar event from my application and where to download that ?</p>","360127","","","","","2010-06-07 10:41:45","Needed jar file's for add event google calendar in android?","<android>","1","0","","",""
"2988793","1","","","2010-06-07 10:45:05","0","1178","<p>I'm currently working on a very simple aplication, and I intended to make it change the visual aspect depending on the screen size. The application just has 6 buttons like this:</p><p><img src=""http://www.freeimagehosting.net/uploads/e1efb4c4d0.jpg"" alt=""http://www.freeimagehosting.net/uploads/e1efb4c4d0.jpg""></p><p>I'm using the AbsoluteLayout, and changing the x and y of the buttons with the methods offsetLeftAndRight and offsetTopAndBottom. I'm not changing the layout of the buttons in the xml file, so the all start in the same place.</p><p>However, if I use this methods inside the onClickMethod they sometimes appear where I want them, sometimes don't (can't figure out why), but if i use them in the onCreate method, nothing happens.</p><p>Can someone point me in the right direction?</p><p>Thanks</p>","360312","","114066","","2010-06-07 13:01:28","2010-06-07 13:01:28","How to change object positions in an android layout?","<android><dynamic><layout>","2","0","","",""
"2989077","1","2989278","","2010-06-07 11:38:10","3","4098","<p>I want to display external image like:</p><p>""http://abc.com/image.jpg""</p><p>in my android phone application.</p><p>can any one guide me how to achieve this?</p>","249991","","114066","","2010-06-07 14:18:03","2010-06-07 15:05:16","how to display external image in android?","<android><imageview>","2","0","3","",""
"2989226","1","2989247","","2010-06-07 12:02:01","1","2438","<p>i have a following ListActivity:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Get Strings from res/strings.xml    String items[] = { getString(R.string.mainMenu_1),            getString(R.string.mainMenu_2), getString(R.string.mainMenu_3),            getString(R.string.mainMenu_4), getString(R.string.mainMenu_5)};    strings = items;    ListAdapter listAdapter = new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1, items);    setListAdapter(listAdapter);}</code></pre><p>Displaying it and reacting to user clicks works great, now I want to add some pictures before the text (like ""Settings"").can someone explain me how to do this?(How to get pictures from res/drawable isn needed to get explained ;-))</p><p>greets,poeschlorn</p>","317301","","","","","2010-06-07 12:05:27","ListActivity adding images?","<android><image><drawable><listactivity>","1","0","","",""
"2989275","1","2999852","","2010-06-07 12:08:19","3","1314","<p>i have written an application that needs to process outgoing calls. Everything works fine, the application has already a few hundred downloads, but now i get feedback from people who would like to download it, yet cannot find it. </p><p>I have done some tests and have found that the permission ""PROCESS_OUTGOING_CALLS"" seems to be responsible for this. If i include it in an app, people with branded phones (at least in Germany) cannot find it, as soon as i remove this permission, everything is fine (when i re-insert it again, the app vanishes again)</p><p>The weird thing is, that those users can see other apps which use this permission in the market. I have compared my manifest file to outputs from other manifest files and cannot understand why it doesn't work. </p><p>Here is the manifest file for a test application i wrote to test the problem: </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.eventkontor.marketavailabilitytest""     android:versionName=""1.2""android:versionCode=""3""     android:installLocation=""auto""&gt;&lt;application          android:icon=""@drawable/icon""          android:label=""@string/app_name""&gt;    &lt;activity android:name="".showMain""                 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""        android:targetSdkVersion=""4"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.PROCESS_OUTGOING_CALLS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_CONTACTS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.VIBRATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;supports-screens android:normalScreens=""true""    android:resizeable=""true"" android:largeScreens=""true""    android:smallScreens=""false""&gt;&lt;/supports-screens&gt;&lt;/manifest&gt; </code></pre><p>Does anyone have an idea what i'm doing wrong? </p>","360386","","114066","","2010-06-07 12:58:10","2010-06-08 17:48:42","Android Market: Application not visible on some Devices","<android><permissions><google-play>","2","0","","",""
"2989430","1","","","2010-06-07 12:28:47","0","727","<p>I am trying to create one custom button which is circular and when i click that button i want that button FOCUS and COLOR change and i don't know how to do exactly so any one can help me or show me that code how to do?</p>","343678","","114066","","2010-06-07 14:19:39","2010-06-07 14:19:39","I Want to create custom Circular Button which will Focus on click how to do?","<android>","2","0","","",""
"2989459","1","2989609","","2010-06-07 12:31:48","3","995","<p>Is there any way I can load a class based on what version of the OS the phone is running?For example:I made an app which requires 1.6+ Android. Is there a way for me to load one class or the other based on what OS the phone is running? I'm asking this specifically for contacts.The database was changed from 1.6 to 2.0 and the old version doesn't retrieve contacts on the new OS phone. I'd still like to keep my 1.6 requirement, but at the same time I'd like 2.0+ phones to access the contact part of the app.</p><p>So can I make 2 APIs, somehow pack them with the app and decide on the fly which I choose to import?</p>","297616","","","","","2010-06-07 12:52:15","Load class based on SDK version","<android><class><sdk><load><version>","2","0","2","",""
"2989505","1","","","2010-06-07 12:37:44","0","8195","<p>On pressing menu button , I have 2 options : Add &amp; more.On click of more i have 3 options : Organize ,Export &amp; ExitOn click of Organize i want other 5 options.</p><p>On click of more i get my submenu. But i want other 5 options on click of organize.How do i proceed???</p><p>My code in parts is as follows :XML file-------------------------------</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;item        android:id=""@+id/more""        android:title=""@string/moreMenu""        android:icon=""@drawable/icon""&gt;    &lt;menu&gt;        &lt;item android:id=""@+id/Organize""        android:title=""@string/Organize"" /&gt;        &lt;item android:id=""@+id/Export""        android:title=""@string/Export"" /&gt;    &lt;/menu&gt;     &lt;/item&gt;    &lt;item        android:id=""@+id/add""        android:title=""@string/addMenu""      android:icon=""@drawable/add""/&gt;   &lt;/menu&gt;</code></pre><p>Java-------------------------</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.widget.Toast;public class ToDoList extends Activity { Menu menu;  public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.todolist);    }  public boolean onCreateOptionsMenu(Menu menu) {            super.onCreateOptionsMenu(menu);            getMenuInflater().inflate(R.layout.categorymenu, menu);         return true;      }     public boolean onOptionsItemSelected(MenuItem item) {            switch (item.getItemId()) {          case R.id.more:                  Toast.makeText(this, ""You pressed more!"", Toast.LENGTH_LONG).show();//(What needs to be done from here)                    return true;         case R.id.add:           Toast.makeText(this, ""You pressed add!"", Toast.LENGTH_LONG).show();          return true;           }         return false;         }   public boolean onPrepareOptionsMenu(Menu menu) {                      return true;        }  }</code></pre><hr>","344768","","344768","","2010-06-08 05:01:34","2010-09-28 09:37:29","Submenu within menu within menu?","<android><layout><menu>","1","0","0","",""
"2989640","1","","","2010-06-07 12:54:54","0","1954","<p>I'm trying to control soft keyboard using this:</p><pre><code>((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))            .hideSoftInputFromInputMethod(filterText.getWindowToken(), 0);((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))            .showSoftInput(filterText, InputMethodManager.SHOW_IMPLICIT);</code></pre><p>But nothing happens on the device when i call this code. What can cause such behavior?</p>","218783","","","","","2014-02-12 07:31:55","Android soft keyboard showing problem","<android>","2","0","","",""
"2989678","1","","","2010-06-07 13:01:01","0","112","<p>I'm facing a problem regarding to design issue, to understand problem i uploaded a screen shot</p><p><img src=""http://img38.imageshack.us/img38/1926/imag0062h.jpg"" alt=""first screen""></p><p>i checked in emulator, it works well but when i try the same application in HTC Sprint mobile which screen size is 4.3"" and resolution is 480*800(HVGA) but there did not display appropriate (check attachment for screen shot).</p>","360122","","114066","","2010-06-07 13:04:57","2010-06-07 15:44:55","Android design issue","<android><android-emulator><android-widget>","1","1","","",""
"2989958","1","2990021","","2010-06-07 13:35:49","1","8156","<p>Assuming i want to open another activity from my current activity and i want to pass arguments such as in my case difficulty level how do I do it?</p><pre><code>newGameButton.setOnClickListener(new OnClickListener() {        public  void onClick(View view) {            Intent i = new Intent(countryCityGameMenu.this,GameScreen.class);                startActivityForResult(i, GlobalDataStore.STATIC_INTEGER_VALUE);        }    });</code></pre><p>is there a way to pass those arguments in the calling ?</p><p>can someone show an example explaining </p><p>what send activity should dowhat the new born activity should do    </p>","346447","","346447","","2010-06-07 14:02:27","2011-02-21 06:29:41","working with android intents how to pass arguments between father and the intent h in","<android><android-intent>","4","0","2","",""
"2990038","1","2990220","","2010-06-07 13:50:25","0","95","<p>We are writing apps for Android and so far only use the simulator.</p><p>What kind of unlocked phone can I buy that will work in the USA and with a change in the SIM card, work in Australia? What do we look for?</p><p>We will have teams in the US and Australia and want to buy the same phones in bulk.</p>","172861","","114066","","2010-06-07 14:15:29","2010-06-07 14:15:29","Android Phone - Dev world wide","<android><dev-phone>","4","0","","",""
"2990191","1","","","2010-06-07 14:07:46","3","1056","<p>Hey everyone I am working on an applications and I am using the built in zoom controls. When using a specific size I can see the zoom controls. When using fill_parent the zoom controls are not visible. How it is setup is a mapview inside of a frame layout(also using fill parent for the height and width but with an offset down the screen. The only thing I can think of is the fill parent issue is with the framelayout and the zoom controls are off the screen. Sorry if this is confusing, I confused myself writing it. Thanks in advance</p>","360499","","","","","2012-07-04 12:54:36","Zoom controls not showing when using a MapView with fill_parent","<android><google-maps>","2","3","","",""
"2990507","1","","","2010-06-07 14:48:46","4","544","<p>Lets say that I have an app that lets you browse through a listing of cars found in a Sqlite database.  When you click on a car in the listing, it'll open up a view with the description of the car and a photo of the car.</p><p>My question is: should I keep the photo in the database as a binary data column in the row for this specific car, or should I have the photo somewhere in the resources directory?  Which is better to do?  Are there any limitations of Sqlite in terms of how big a binary data column can be?</p><p>The database will be pretty much be read only and bundled with the app (so the user wouldn't be inserting any cars and their photos).</p>","396","","","","","2010-06-09 14:06:41","Best way to bundles photos with app: files or in sqlite database?","<database><android><sqlite><image><binary-data>","2","0","3","",""
"2990548","1","2995414","","2010-06-07 14:55:33","0","1775","<p>I have been implementing a class which class extends ArrayAdapter and implements Filterable.The filtering part (in the performFiltering method()) seems to go ok, it fills the FilterResults object just as expected.But then I think I'm not doing it right on how to publish the results, atm I have :</p><pre><code>protected void publishResults(CharSequence prefix, FilterResults results)   {    // NOTE: this function is *always* called from the UI thread.     subItems =  (Vector)results.values;     notifyDataSetChanged();  }</code></pre><p>But this simply won't ""populate"" my List with the received data.So now my question is how do I populate my List with the received results ? Do I have to do that programmatically ?</p>","162147","","","","","2010-06-08 07:20:05","custom Filter Android won't show me the results","<android><listview><filter>","2","0","","",""
"2990652","1","","","2010-06-07 15:09:58","1","977","<p>Hi I am creating an edittext in android and i am able to select particular text in it, I want to convert the selected text into a bitmap or png image..Is it possible </p>","360538","","","","","2011-10-05 18:08:54","Selecting text from Edit Text and converting selected text into an image","<android><edittext>","1","2","1","",""
"2990833","1","2991169","","2010-06-07 15:32:49","0","494","<p>i am getting a Array of  objects  from a  webservice  which has to be assigned to ArrayAdapter to be listed in a listView, i getting the result in @431d5410 in this format, How can i get in a string  Format?</p><pre><code>      projects = projectService.SearchProjects("""", 0, -1);  **Vector&lt;ADSProject&gt; ProjList = projects.getResults();**      setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,ProjList));  ListView Projects = getListView();  Projects.setOnItemClickListener(this);</code></pre>","164850","","","","","2010-06-07 16:15:03","How can i get Array of objects in a Array of string Format to assign to List View in Android?","<android>","1","0","","",""
"2990882","1","2991213","","2010-06-07 15:39:31","3","5347","<p>I need your help!</p><p>I need to locate text on view as showed on the picture:</p><p>text 'Some more text' should be located in bottom|center_horizontal</p><p>text 'Short text' should be located on with align right, but about 10% from the top of the screen</p><p>text 'x.x.x.x' should be aligned to the center of the screen (right/bottom align of the 1st quater)</p><p>text 'Some long text ..' should be aligned to the top/left of the 3-rd quater of the screen, but it should cross the center_horizontal of the screen</p><p>eh ... something like this .. I hope, you're understand me :)</p><p><a href=""http://www.freeimagehosting.net/image.php?ca27bc012e.png"" rel=""nofollow"">http://www.freeimagehosting.net/image.php?ca27bc012e.png</a></p><p>Please, help me!!! </p><p>Thanks for your help!</p>","332311","","","","","2010-06-08 05:40:21","Android and Layouts","<android><layout>","2","3","4","",""
"2991110","1","2997760","","2010-06-07 16:05:53","63","62197","<p>I want to download an image (of unknown size, but which is always roughly square) and display it so that it fills the screen horizontally, and stretches vertically to maintain the aspect ratio of the image, on any screen size. Here is my (non-working) code. It stretches the image horizontally, but not vertically, so it is squashed...</p><pre><code>ImageView mainImageView = new ImageView(context);    mainImageView.setImageBitmap(mainImage); //downloaded from server    mainImageView.setScaleType(ScaleType.FIT_XY);    //mainImageView.setAdjustViewBounds(true);     //with this line enabled, just scales image down    addView(mainImageView,new LinearLayout.LayoutParams(             LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));</code></pre>","319618","","","","","2014-04-09 20:23:37","Android: How to stretch an image to the screen width while maintaining aspect ratio?","<java><android><layout>","11","3","43","",""
"2991149","1","","","2010-06-07 16:11:28","1","1216","<p>Here is the situation.</p><p>I have a java project ""LicenseGenerator"" in eclipse that depends on commons-codec.  I have therefore added the commons-codec jar file to the build path.  I have Junit tests and everything is working fine.</p><p>I have made a different project in the same workspace - which happens to be an Android project - that needs to use my LicenseGenerator classes.  I added LicenseGenerator to the ""projects"" tab in the build path - the classes were recognized and I was able to use them.  </p><p>Everything compiled and ran. However, when the part of the LicenseGenerator that used the commons-codec was called from my Android project I got the following error.</p><blockquote>  <p>Could not find method  org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString,  referenced from method</p></blockquote><p>This basically tells me that the commons-codec was not packaged which the Android project, so I added the commons-codec to the android project as well but the same error appears.</p><p>how do I fix this?<img src=""http://droidprofessor.com/trash/commons-codec5.png"" alt=""alt text""></p><p><img src=""http://droidprofessor.com/trash/commons-codec4.png"" alt=""alt text""></p><p><img src=""http://droidprofessor.com/trash/commons-codec1.png"" alt=""alt text""></p><p><img src=""http://droidprofessor.com/trash/commons-codec3.png"" alt=""alt text""></p><p><img src=""http://droidprofessor.com/trash/commons-codec2.png"" alt=""alt text""></p>","248521","","248521","","2010-06-07 17:30:31","2010-06-08 12:32:27","Eclipse is not importing jar dependencies between two projects in the same workspace","<java><android><eclipse>","2","0","","",""
"2991306","1","2991484","","2010-06-07 16:32:19","0","2110","<p>I'm toying with the Android SDK, with a view to writting a simple app for friends (and maybe for sale).</p><p>This app will search a database for keywords and dispaly the results on the screen, I've had a look at the searchabul dictonary and the notepad demo applications, but I'm still a bit unsure some things.</p><p>I know I need to write a class that extends the SQLiteOpenHelper, and use that to create the database, however how do I check if the database already exists?</p><p>Does onCreate get called on installation or every time an instance of the class is created? is the easyist way just to try and add the database each time and catch any errors (feels a little dangerous to be makeing the assumption every error will be due to the database already existing).</p><p>Thanks in Advance.</p>","70568","","70568","","2011-09-17 15:38:09","2011-09-17 15:38:09","SQLiteOpenHelper, when is onCreate called","<android><sqlite><installation>","1","2","","",""
"2991574","1","","","2010-06-07 17:09:51","0","470","<p>I have an idea, can u tel me what the procedure to do this?</p><p>In my incoming calls r outgng cal it should display the phone number as wel as with network name For eg: 9876543210,Airtel like that</p><p>How to do that i am new to android. So anybody help me. whats the way to develop it?</p>","360530","","759866","","2014-02-20 17:41:17","2014-02-20 17:41:17","Display Phone number with network name","<android>","1","1","","",""
"2991718","1","2992124","","2010-06-07 17:30:03","1","1355","<p>It's kind of hard to explain, but an example of what I'm wanting to accomplish is like this:</p><pre><code>Here is some text | image |that is printed   |       |out in a view and ---------it is wrapped around animage that is floating andright aligned.</code></pre><p>I thought about generating the layout in html and using a web view, but I need to be able to perform an action when the user clicks on the image. Does anyone have any ideas?</p><p>Thanks in advance,</p><p>groomsy</p>","349179","","","","","2011-04-08 10:27:46","How can I have a floating image (right aligned) with text that wraps around the image in Android Layout?","<android><image><layout><floating>","2","0","2","",""
"2991727","1","2991953","","2010-06-07 17:31:09","0","225","<p>In my app i have have a Cursor field and in the <code>onStart()</code> method of my Android Service I create it by fetching records from my database. When i look into my cursor in the <code>onStart()</code> method i find a number of records but when i try to use them in my <code>trigger()</code> method it has zero records.</p><p>the field<code>private Cursor c;</code></p><p>in onStart()<code>c = dbHelper.fetchAllRecords();</code></p><p>in trigger()<code>c.getCount()</code> returns 0</p><p>I didn't close the cursor earlier than in my <code>onDestroy()</code> method</p>","355651","","355651","","2010-06-07 17:41:50","2010-06-07 18:06:47","Use a Cursor field in another method","<android>","1","0","","",""
"2991866","1","2992524","","2010-06-07 17:49:29","1","1106","<p>This question may have been asked before, but I'm starting to get into game programming on the Android. I'm having a hard time figuring out the best way to move an object.</p><p>To put it simply, lets say I have a bitmap located on 0,0 and i want to move it across the screen. The obvious way to do it would be to simply increment the X position by one every time the Surface View onDraw method gets called.</p><p>But what if I wanted to make it move faster? I could increment it by two or three instead of one, but then the movement starts to get really choppy and stupid looking.</p><p>What is the best way to go about doing this?</p>","67510","","","","","2011-03-30 11:29:32","Movement in game programming","<android>","2","1","2","",""
"2992070","1","3019465","","2010-06-07 18:26:15","1","1102","<p>I've started a little game, and so far I'm moving a little guy with onKeyDown() and the DPAD from Android Emulator. Now what I want to do is to add 4 buttons on the screen (like in a GAMEBOY emulator for example) and these buttons should move my little guy. With a clickListener and onClick() (or touchListener and onTouch()), it's ok for one move but how to do if I want that my little guy continues moving when I stay clicked on the button ??? Buttons are enough or should I make a 4 arrows soft keyboard or anything else ??</p><p>Thanks</p>","360708","","","","","2011-09-05 11:34:10","How to move something from a virtual dpad on-screen","<android>","1","0","2","",""
"2992084","1","2992256","","2010-06-07 18:29:02","1","563","<p>I see no problem in the code. Help?</p><p>preferences.xml</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;ListPreferenceandroid:title=""Gender""android:summary=""Are you male or female?""android:key=""genderPref""android:defaultValue=""male""android:entries=""@array/genderArray""android:entryValues=""@array/genderValues"" /&gt;&lt;ListPreferenceandroid:title=""Weight""android:summary=""How much do you weigh?""android:key=""weightPref""android:defaultValue=""180""android:entries=""@array/weightArray""android:entryValues=""@array/weightValues"" /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>arrays.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""genderArray""&gt;&lt;item&gt;Male&lt;/item&gt;&lt;item&gt;Female&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""genderValues""&gt;&lt;item&gt;male&lt;/item&gt;&lt;item&gt;female&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""weightArray""&gt;&lt;item&gt;120&lt;/item&gt;&lt;item&gt;150&lt;/item&gt;&lt;item&gt;180&lt;/item&gt;&lt;item&gt;210&lt;/item&gt;&lt;item&gt;240&lt;/item&gt;&lt;item&gt;270&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""weightValues""&gt;&lt;item&gt;120&lt;/item&gt;&lt;item&gt;150&lt;/item&gt;&lt;item&gt;180&lt;/item&gt;&lt;item&gt;210&lt;/item&gt;&lt;item&gt;240&lt;/item&gt;&lt;item&gt;270&lt;/item&gt;&lt;/string-array&gt;&lt;/resources&gt;</code></pre><p>Preferences.java:</p><pre><code> package com.dantoth.drinkingbuddy; import android.os.Bundle; import android.preference.PreferenceActivity; public class Preferences extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); }; }</code></pre><p>butts.xml (idk why it's butts but I've gotten used to it now. really just sets up the menu button)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:id=""@+id/settings""    android:title=""Settings""    android:icon=""@drawable/ic_menu_settings"" /&gt;  &lt;item android:id=""@+id/archive""    android:title=""Archive""    android:icon=""@drawable/ic_menu_archive"" /&gt;  &lt;item android:id=""@+id/new_session""    android:title=""New Session""    android:icon=""@drawable/ic_menu_new"" /&gt;  &lt;item android:id=""@+id/about""    android:title=""About""    android:icon=""@drawable/ic_menu_about"" /&gt;        &lt;/menu&gt;</code></pre><p>within DrinkingBuddy.java:</p><pre><code> @Override public boolean onOptionsItemSelected(MenuItem item) {   switch (item.getItemId()) {    case R.id.settings:          startActivity(new Intent(this, Preferences.class));        return true;    case R.id.archive:     Toast.makeText(this, ""Expect to see your old drinking sessions here."", Toast.LENGTH_LONG).show();        return true;     //ETC. } return false;</code></pre><p>That's it. I can press the menu button on the phone and see the menu items I created, but when I click on the ""Settings"" (r.id.settings) it FC. Do I have to do anything to the manifest/other thing to get this to work??</p>","359045","","","","","2010-06-07 18:56:33","Force close message when preferences are called via menu button","<xml><android><menu><preferences><android-preferences>","1","1","","",""
"2992172","1","2992287","","2010-06-07 18:43:59","1","729","<p>I'm using eclipse for Android development, and the editor always seems to take a while to actually update and recognize if I change an ID in a layout, then try to use it in a class with R.id.someId. Is there a way to force a refresh?</p>","30512","","","","","2010-06-07 19:01:53","Eclipse - Force Refresh of IDs","<java><android><eclipse>","2","1","","",""
"2992258","1","3024445","","2010-06-07 18:56:51","8","2345","<p>I know this question has been asked here before, but I don't think those answers were adequate for my needs.</p><p>We have a SOAP webservice that is used for an iPhone application, but it is possible that we need an Android specific version or a proxy of the service, so we have the option to go with either SOAP or JSON. I have a few concerns about both methods:</p><p><strong>SOAP solution:</strong></p><ol><li>Is it possible to generate javasource code from a WSDL file, if so,will it include some kind of proxyclass to invoke the webservice andwill it work in the Androidenvironment at all?</li><li>Google has not provided any SOAPlibrary in Android, so i need to use3rd party, any suggestion?</li><li>What about the performance/overheadwith parsing and transmitting SOAPxml over the wire versus the JSONsolution?</li></ol><p><strong>JSON solution:</strong></p><ol><li>There is a few classes in theAndroid sdk that will let me parseJSON, but does it support genericparsing, like if I want the resultto be parsed as a complex type? Orwould I need to implement thatmyself?</li><li>I have read about 2 libraries beforehere on Stackoverflow, GSON anJackson. What is the differenceperformance and usability (from adevelopers perspective) wise? Do youguys have any experince with eitherof those libraries?</li></ol><p>So i guess the big question is, what method to go with?</p><p>I hope you can help me out. Thanks in advance :-)</p>","201651","","","","","2010-06-11 16:23:01","Call .NET Webservice with Android","<.net><android><web-services><json><soap>","2","0","6","",""
"2992567","1","2992705","","2010-06-07 19:44:55","6","14971","<p><b>Edit:</b> I'm rewriting this question because I apparently wasn't clear.</p><p>Sometimes the GPS service on Android phones takes a long time to get a fix. Sometimes it's fast, sometimes it takes hours. I know and accept this.</p><p>I have an application that does many things. One of the things it must do is allow the user to click a button to send their current coordinates to a server. What I need are the coordinates of the phone <i>when the user clicks the button</i> or within a reasonably short time thereafter.</p><p>Because I know that getting a GPS fix is not instant and I know that it could take minutes or hours (during which the user has moved a great distance), I need to code a timeout for this feature. For this feature, it is simply not acceptable to upload the GPS location of the user three minutes (for example) after they clicked the button. It's fine if it takes 45 seconds, not okay if it takes 75 seconds. It's fine to give the user an error notification if the feature failed to get a location fast enough.</p><p>I need a feature to 'get the GPS location and send it to the server, <i>unless it takes more than one minute</i>'.</p><p>My original code is below. I have changed some things since posting it. I have added a Timer in the onStartCommand() method. I start a TimerTask that after 60 seconds will call my stop() method. At the beginning of the onLocationChanged() method, I cancel the TimerTask.</p><p>My question is: Is the Timer scheme a good way of implementing this timeout? Is there a better way?</p><p><b>Original question:</b></p><p>I'm writing an Android application that, among other things, needs to send the current GPS coordinates to a server when the user tells it to. From a context menu, I run the service below. The service is a LocationListener and requests updates from the LocationManager. When it gets a location (onLocationChanged()), it removes itself as a listener and sends the coordinates off to the server. All of this is working.</p><p>However, if GPS coordinates are not quickly available, my service just keeps running until it gets some. It holds up the UI with a progress dialog, which is annoying. Worse, if the user has moved since starting the service, the first GPS coordinates might be wrong and the app will send bad data to the server.</p><p>I need a timeout on the service. Is there a good way to do that? I'm not very experienced with threads. I think I can run a Runnable in the onStartCommand() method that will somehow count down 30 seconds and then, if there is no GPS result yet, call my service's stop() method. Does that sound like the best way to do this?</p><p>Alternatively, is it possible to tell if the GPS cannot get a fix? How would I go about doing that?</p><p><b>Edit:</b> To further clarify, I'm looking for the best way to ""give up"" on getting a Location after some amount of time.</p><pre><code>public class AddCurrentLocation extends Service implements LocationListener {    Application app;    LocationManager mLocManager;    ProgressDialog mDialog;    @Override    public int onStartCommand(Intent intent, int arg0, int arg1) {        app = getApplication();        // show progress dialog        if (app.getScreen() != null) {            mDialog = ProgressDialog.show(app.getScreen(), """", ""Adding Location. Please wait..."", true);        }        // find GPS service and start listening        Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        mLocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        String bestProvider = mLocManager.getBestProvider(criteria, true);        mLocManager.requestLocationUpdates(bestProvider, 2000, 0, this);        return START_NOT_STICKY;    }    private void stop() {        mLocManager.removeUpdates(this);        if (mDialog != null) {            mDialog.dismiss();        }        stopSelf();    }    @Override    public void onLocationChanged(Location location) {        // done with GPS stop listening        mLocManager.removeUpdates(this);        sendLocation(location); // method to send info to server        stop();    }    // other required methods and sendLocation() ...}</code></pre>","64193","","64193","","2010-06-09 14:25:16","2013-02-04 15:11:29","Android GPS timeout","<android><gps>","5","1","5","",""
"2992635","1","3037279","","2010-06-07 19:52:33","7","12917","<h1><a href=""http://stackoverflow.com/a/14447214/356828"">Please note there is a new way of doing this</a></h1><p>I've been trying to get the number of unread gmail mails with no luck.</p><p>I've read <a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/provider/Gmail.java&amp;q=gmail.java&amp;sa=N&amp;cd=1&amp;ct=rc"" rel=""nofollow"">Gmail.java</a> and <a href=""http://code.google.com/p/gmail4j/"" rel=""nofollow"">gmail4j</a> both links taken out of this site from this question: <a href=""http://stackoverflow.com/questions/2779625/android-how-can-i-find-out-how-many-unread-email-the-user-has"">Android - How can I find out how many unread email the user has?</a></p><p>But still after having read all of that and a couple of other sites that talked about this particular subject my question remains:</p><p><strong>Q</strong>: How can I get the Gmail Unread Count?</p><p>Sorry if it seams a bit insistent but <strong>I clearly lack the knowledge</strong> to find this out on my own from the source.</p><p>PS: I would like to clarify that I want to do it without having to ask the user for credentials. </p><p>Just 2 add some colors to the question let me show you the looks of my app.</p><p><img src=""http://img716.imageshack.us/img716/8818/lookr.png"" alt=""alt text""></p><h1><a href=""http://stackoverflow.com/a/14447214/356828"">Please note there is a new way of doing this</a></h1>","356828","","356828","","2013-01-22 00:59:38","2013-02-19 10:18:01","How to get the number of unread gmail mails (on android)","<android><count><gmail>","4","0","19","",""
"2992650","1","2994037","","2010-06-07 19:54:36","0","1244","<p>In the description of <a href=""http://developer.android.com/guide/topics/ui/dialogs.html#AddingAList"" rel=""nofollow"">how to add a list</a> of options to an <code>AlertDialog</code> the official Android documentation alludes to saving a users preferences with one of the ""<a href=""http://developer.android.com/guide/topics/data/data-storage.html"" rel=""nofollow"">data storage techniques</a>."" The examples assume the <code>AlertDialog</code> has been spawned within an  <code>Activity</code> class.</p><p>In my case I've created a class that extends <code>ItemizedOverlay</code>. This class overrides the <code>onTap</code> method and uses an <code>AlertDialog</code> to prompt the user to make a <a href=""http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setMultiChoiceItems"" rel=""nofollow"">multi-choice selection</a>. I would like to capture and persist the selections for each <code>OverlayItem</code> they tap on.</p><p>The below code is the onTap method I've written. It functions as written but doesn't yet do what I'd hope. I'd like to capture and persist each selection made by the user to be used later. How do I do that? Is using an <code>AlertDialog</code> in this manner a good idea? Are there better options?</p><pre><code>protected boolean onTap(int index){    OverlayItem item = _overlays.get(index);    final CharSequence[] items = { ""WiFi"", ""BlueTooth"" };    final boolean[] checked = { false, false };    AlertDialog.Builder builder = new AlertDialog.Builder(_context);    builder.setTitle(item.getTitle());    builder.setMultiChoiceItems(items, checked, new        DialogInterface.OnMultiChoiceClickListener()        {          @Override          public void onClick(DialogInterface dialog, int item,              boolean isChecked)              {                  // for now just show that the user touched an option                  Toast.makeText(_context, items[item],                    Toast.LENGTH_SHORT).show();              }        });    builder.setPositiveButton(""Okay"", new DialogInterface.OnClickListener()    {        @Override        public void onClick(DialogInterface dialog, int id)        {            // should I be examining what was checked here?            dialog.dismiss();        }    });    builder.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener()    {        @Override        public void onClick(DialogInterface dialog, int id)        {            dialog.cancel();        }    });    AlertDialog alert = builder.create();    alert.show();    return true;}</code></pre>","61654","","61654","","2010-06-07 21:03:12","2010-06-08 00:11:01","How to persist options selected in AlertDialog spawned from ItemizedOverlay onTap method","<android><android-mapview><alertdialog><itemizedoverlay>","2","4","","",""
"2992656","1","2993050","","2010-06-07 19:55:11","0","3989","<p>A TabActivity start other activity when i click on a tab,</p><p>How to send information to parent (tabActivity) and don't finish current activity?</p><p>My tabactivity start another activity like this :</p><blockquote>  <p>mTabHost.addTab(</p>    <p>mTabHost.newTabSpec(TAB_OPTIONS)</p>    <p>.setIndicator(TabImgFond5)</p>    <p>.setContent(intentOptions));</p></blockquote><p>Inside my new Activity Option, i would like to Call method of Tabactivity, is it possible ?</p><p>Thanks</p>","144587","","","","","2010-06-07 20:50:57","Android Activity call another Activity method","<android><activity><android-tabhost>","1","0","","",""
"2992754","1","2992800","","2010-06-07 20:09:16","28","18218","<p>Does anyone have any good pointers on designing the UI for an android application and some good practises?</p><p>Obviously I'm aware of the basic principles involved with designing the layout in XML.  Also, that you have a stack of activities.  But I'm interested in some approaches to creating the interfaces and also how to design an application around those intentions.</p>","128991","","","","","2013-05-30 12:42:36","UI Design Tips and Tutorials for Android","<android><user-interface>","6","0","26","",""
"2992882","1","2993187","","2010-06-07 20:26:04","5","6235","<p>I have this code</p><pre><code>Calendar c = new GregorianCalendar();        c.add(Calendar.DAY_OF_YEAR, 1);        c.set(Calendar.HOUR_OF_DAY, 23);        c.set(Calendar.MINUTE, 22);        c.set(Calendar.SECOND, 0);        c.set(Calendar.MILLISECOND, 0);        // We want the alarm to go off 30 seconds from now.        long firstTime = SystemClock.elapsedRealtime();        firstTime += 30*1000;        long a=c.getTimeInMillis();        // Schedule the alarm!        AlarmManager am = (AlarmManager)ctx.getSystemService(Context.ALARM_SERVICE);        am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,                c.getTimeInMillis(), 1*60*60*1000, sender);</code></pre><p>It is not executed at <strong>23:22h</strong></p><p>What I am doing wrong? I noticed firstTime and c.getTimeInMillis() differs a lot in size and length. When I use firstTime, so when set to 30 seconds, the alarm is executed well.</p>","243782","","243782","","2010-06-07 20:37:01","2013-04-27 07:32:26","How to set an alarm to fire properly at fixed time?","<android><broadcastreceiver><alarm>","3","1","7","",""
"2993112","1","2993281","","2010-06-07 20:58:44","4","2265","<p>I seem to be having trouble with the linkify I am using in my Custom Adapter.  For some reason I recieve the following stack track when I click on one of the links:</p><pre><code>06-07 20:49:34.696: ERROR/AndroidRuntime(813): Uncaught handler: thread main exiting due to uncaught exception06-07 20:49:34.745: ERROR/AndroidRuntime(813): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.app.ApplicationContext.startActivity(ApplicationContext.java:550)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:248)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.text.style.URLSpan.onClick(URLSpan.java:62)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.widget.TextView.onTouchEvent(TextView.java:6560)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.View.dispatchTouchEvent(View.java:3709)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)06-07 20:49:34.745: ERROR/AndroidRuntime(813):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)</code></pre><p><strong>Here is the code that is calling it</strong>:</p><pre><code>    TextView bot = new TextView( c );    bot.setText(li.getBottomText());    bot.setTextColor(Color.BLACK);    bot.setTextSize(12);    bot.setPadding(50, 35, 0, 10);    Linkify.addLinks(bot, Linkify.ALL);    rL.addView(bot,ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);</code></pre><p>I understand what the error is saying but I am not sure how to fix it.  Does anyone have any ideas?  <strong>Thanks in advance for your help</strong>!</p>","351338","","","","","2010-06-07 21:23:11","Android - Linkify Problem","<android><linkify>","1","0","","",""
"2993124","1","","","2010-06-07 21:00:22","0","2044","<p>I have this code:</p><pre><code>    db=(new DatabaseHelper(this)).getWritableDatabase();    constantsCursor=db.rawQuery(""SELECT _ID, title, subtitle, image ""+                                                            ""FROM news ORDER BY title"",                                                            null);    ListAdapter adapter=new SimpleCursorAdapter(this,                                                R.layout.row, constantsCursor,                                                new String[] {""title"", ""subtitle"", ""image""},                                                new int[] {R.id.value, R.id.title, R.id.icon});    setListAdapter(adapter);    registerForContextMenu(getListView());</code></pre><p>Which displays a list of titles. I dont however for the life of me know how to create a click event so that i can call another view when i click an item from that list.</p><p>Anyone?</p>","117701","","","","","2010-06-07 21:29:42","Android: How to create an onclick event for a SimpleCursorAdapter?","<android>","1","0","","",""
"2993146","1","","","2010-06-07 21:03:48","1","6758","<p>I'm just wondering if I do this correctly; I'm programming a notification app which can display a notification when the phone is sleeping</p><ol><li>Disable keyguard lock</li><li>Aquire a wake lock</li><li>show notification </li><li>Set alarm for timeout and reenabling keyguard and release wakelock is the user dont touches the screen.4.1 User touches the screen, and I disable the timer. Do nothing more. Done and done4.2 User dont touch the screen, so reenable keyguard and release wakelock. Phone sleeps again</li></ol><p>Basically I'm wondering about point 4.1 the most. cancel the pendingintent for the alarm, and do nothing more? or should the keyguard and wakelock that are set be dealt with in some way?</p>","353528","","","","","2013-03-18 12:42:11","Android WakeLock and KeyGuard","<android>","3","1","2","",""
"2993147","1","2993853","","2010-06-07 21:03:51","6","5305","<p>I'm still pretty new to Android and programming in general, and I can't seem to get the command line tools packaged with the Android SDK to work. I'm running Mac OSX and each time I try to run <em>layoutopt</em>, for example, the terminal returns, *-bash: cmd: command not found*</p><p>Also, is it okay to have my SDK located in the Developer directory and my android project in some unrelated directory when using these tools?</p>","339036","","","","","2013-10-16 17:21:31","How do i run the Android command line tools?","<android><command-line><terminal>","5","0","2","",""
"2993179","1","2999225","","2010-06-07 21:08:30","0","1974","<p>I am using 8 EditText boxes from the NewCard.xml from which i am taking the values and when the save button is pressed i am storing the values into a database, in the same process of saving i am trying to get the values and present them into 8 different TextView boxes on the main.xml file and when i press the button i get an FC from the emulator and the resulting error is java.lang.NullPointerException. If Some 1 could help me that would be great, since i have never used databases and this is my first application for android and this is the only thing keepeng me to complete the whole thing and publish it on the market like a free app.Here's the full code from NewCard.java.</p><pre><code>public class NewCard extends Activity {    private static String[] FROM = { _ID, FIRST_NAME, LAST_NAME, POSITION, POSTAL_ADDRESS, PHONE_NUMBER, FAX_NUMBER, MAIL_ADDRESS, WEB_ADDRESS};    private static String ORDER_BY = FIRST_NAME;    private CardsData cards;    EditText First_Name;    EditText Last_Name;    EditText Position;    EditText Postal_Address;    EditText Phone_Number;    EditText Fax_Number;    EditText Mail_Address;    EditText Web_Address;    Button New_Cancel;    Button New_Save;    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.newcard);        cards = new CardsData(this);        //Define the Cancel Button in NewCard Activity        New_Cancel = (Button) this.findViewById(R.id.new_cancel_button);            //Define the Cancel Button Activity/s            New_Cancel.setOnClickListener            (                new OnClickListener()                {                    public void onClick(View arg0)                    {                        NewCancelDialog();                    }                }            );//End of the Cancel Button Activity/s        //Define the Save Button in NewCard Activity        New_Save = (Button) this.findViewById(R.id.new_save_button);        //Define the EditText Fields to Get Their Values Into the Database        First_Name = (EditText) this.findViewById(R.id.new_first_name);        Last_Name = (EditText) this.findViewById(R.id.new_last_name);        Position = (EditText) this.findViewById(R.id.new_position);        Postal_Address = (EditText) this.findViewById(R.id.new_postal_address);        Phone_Number = (EditText) this.findViewById(R.id.new_phone_number);        Fax_Number = (EditText) this.findViewById(R.id.new_fax_number);        Mail_Address = (EditText) this.findViewById(R.id.new_mail_address);        Web_Address = (EditText) this.findViewById(R.id.new_web_address);            //Define the Save Button Activity/s            New_Save.setOnClickListener            (                new OnClickListener()                {                    public void onClick(View arg0)                    {                        //Add Code For Saving The Attributes Into The Database                        try                        {                            addCard(First_Name.getText().toString(), Last_Name.getText().toString(),                                    Position.getText().toString(), Postal_Address.getText().toString(),                                    Integer.parseInt(Phone_Number.getText().toString()),                                     Integer.parseInt(Fax_Number.getText().toString()),                                    Mail_Address.getText().toString(), Web_Address.getText().toString());                            Cursor cursor = getCard();                            showCard(cursor);                        }                        finally                        {                            cards.close();                            NewCard.this.finish();                        }                    }                }            );//End of the Save Button Activity/s    }    //======================================================================================//    //DATABASE FUNCTIONS    private void addCard(String firstname, String lastname, String position, String postaladdress,                        int phonenumber, int faxnumber, String mailaddress, String webaddress)    {          // Insert a new record into the Events data source.          // You would do something similar for delete and update.        SQLiteDatabase db = cards.getWritableDatabase();        ContentValues values = new ContentValues();        values.put(FIRST_NAME, firstname);        values.put(LAST_NAME, lastname);        values.put(POSITION, position);        values.put(POSTAL_ADDRESS, postaladdress);        values.put(PHONE_NUMBER, phonenumber);        values.put(FAX_NUMBER, phonenumber);        values.put(MAIL_ADDRESS, mailaddress);        values.put(WEB_ADDRESS, webaddress);        db.insertOrThrow(TABLE_NAME, null, values);     }    private Cursor getCard()    {        // Perform a managed query. The Activity will handle closing        // and re-querying the cursor when needed.        SQLiteDatabase db = cards.getReadableDatabase();        Cursor cursor = db.query(TABLE_NAME, FROM, null, null, null, null, ORDER_BY);        startManagingCursor(cursor);        return cursor;    }    private void showCard(Cursor cursor)    {        // Stuff them all into a big string        long id = 0;        String firstname = null;        String lastname = null;        String position = null;         String postaladdress = null;        long phonenumber = 0;        long faxnumber = 0;         String mailaddress = null;        String webaddress = null;        while (cursor.moveToNext())        {            // Could use getColumnIndexOrThrow() to get indexes            id = cursor.getLong(0);             firstname = cursor.getString(1);            lastname = cursor.getString(2);            position = cursor.getString(3);             postaladdress = cursor.getString(4);            phonenumber = cursor.getLong(5);            faxnumber = cursor.getLong(6);             mailaddress = cursor.getString(7);            webaddress = cursor.getString(8);        }        // Display on the screen add for each textView        TextView ids = (TextView) findViewById(R.id.id);         TextView fn = (TextView) findViewById(R.id.firstname);         TextView ln = (TextView) findViewById(R.id.lastname);         TextView pos = (TextView) findViewById(R.id.position);         TextView pa = (TextView) findViewById(R.id.postaladdress);         TextView pn = (TextView) findViewById(R.id.phonenumber);         TextView fxn = (TextView) findViewById(R.id.faxnumber);         TextView ma = (TextView) findViewById(R.id.mailaddress);         TextView wa = (TextView) findViewById(R.id.webaddress);         ids.setText(String.valueOf(id)); //this is the line reported when i get the error        fn.setText(String.valueOf(firstname));        ln.setText(String.valueOf(lastname));        pos.setText(String.valueOf(position));         pa.setText(String.valueOf(postaladdress));        pn.setText(String.valueOf(phonenumber));        fxn.setText(String.valueOf(faxnumber));         ma.setText(String.valueOf(mailaddress));        wa.setText(String.valueOf(webaddress));    }    //======================================================================================//    //Define the Dialog that alerts you when you press the Cancel button    private void NewCancelDialog()     {        new AlertDialog.Builder(this)            .setMessage(""Are you sure you want to cancel?"")            .setTitle(""Cancel"")                    .setCancelable(false)                    .setPositiveButton(""Yes"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                         {                            NewCard.this.finish();                        }                    })                    .setNegativeButton(""No"", new DialogInterface.OnClickListener()                    {                        public void onClick(DialogInterface dialog, int id)                        {                            dialog.cancel();                        }                    })                    .show();    }//End of the Cancel Dialog}</code></pre><p>Here is the error stack:</p><pre><code>06-07 19:05:21.728: ERROR/AndroidRuntime(207): Uncaught handler: thread main exiting due to uncaught exception06-07 19:05:21.788: ERROR/AndroidRuntime(207): java.lang.NullPointerException06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.test.android.bussinesscard.NewCard.showCard(NewCard.java:181)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.test.android.bussinesscard.NewCard.access$1(NewCard.java:143)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.test.android.bussinesscard.NewCard$2.onClick(NewCard.java:104)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.View.performClick(View.java:2364)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.View.onTouchEvent(View.java:4179)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.widget.TextView.onTouchEvent(TextView.java:6541)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.View.dispatchTouchEvent(View.java:3709)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.os.Handler.dispatchMessage(Handler.java:99)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.os.Looper.loop(Looper.java:123)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at java.lang.reflect.Method.invokeNative(Native Method)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at java.lang.reflect.Method.invoke(Method.java:521)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-07 19:05:21.788: ERROR/AndroidRuntime(207):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","360819","","360819","","2010-06-07 21:21:18","2010-06-08 19:16:19","I get java.lang.NullPointerException when trying to get the contents of the database in Android","<android>","3","3","","",""
"2993282","1","2993414","","2010-06-07 21:23:20","8","7515","<p>I need to change the emulator's default time zone. It worked in command line with -timezone option. But when I tried it in eclipse android's launch options. it didn't work. I set it in Window->preferences->android->launch->default emulator options. Am I setting it in a wrong place?</p>","109704","","80425","","2012-04-30 21:56:09","2014-03-01 03:06:27","Android Emulator's launch options don't work in Eclipse plugin?","<android>","3","0","3","",""
"2993329","1","3020989","","2010-06-07 21:32:47","0","806","<p>Hi: I'm using Android 2.1 on a HTC Nexus One. I want to collect sensor data while the device is turned off. By using android.app.Service this works well while the app is in the background but stops working when the display is turned off by the hardware button.</p><p>Is there a possibility to collect sensor data while the display is turned off?</p>","281535","","","","","2010-06-11 07:35:56","Use android.app.Service and SensorEventListener while screen is off (Android 2.1)","<android>","3","0","","",""
"2993362","1","3000024","","2010-06-07 21:39:57","4","1723","<p>I've read <a href=""http://stackoverflow.com/questions/2531317/android-mock-location-on-device"">this</a> post about mocking location with custom provider, but I am looking for a way to mock the location during a presentation, is that possible?</p>","243782","","","","","2010-06-08 18:11:49","How to mock location during a presentation on a real device?","<android><location>","1","4","","",""
"2993509","1","2993869","","2010-06-07 22:03:32","1","459","<p>I have a resources file called string.xml in res/valus directory</p><p>the file has many string resources</p><p>how can I obtain these items in an array from code ?</p><p>I tried</p><pre><code>Field[] x=R.string.class.getFields();</code></pre><p>but it does not work.</p><p>thanks</p>","235123","","235123","","2010-06-07 22:51:08","2012-08-11 04:46:31","How to enumerate strings in a string resources file?","<android>","2","4","","",""
"2993588","1","","","2010-06-07 22:17:48","1","316","<p>I am looking for Android GUI which is wheel type number lock, with numbers on the wheel. The password GUI looks like a wheel with numbers on it and user can roll the wheel to select a number when wheel stops, only the numbers are visible that are on the surface of wheel.</p>","357349","","","","","2010-06-08 09:59:16","Android Password GUI","<android>","1","0","2","",""
"2993817","1","2993911","","2010-06-07 23:14:14","0","233","<p>I have to use context in many places of my code such as database operations, preference operations, etc. I don't want to pass in context for every method.</p><p>Is it a good practice to create a reference to application context at the main Activity and use it anywhere such as database operations? So, I don't need some many context in method parameters, and the code can avoid position memory leak due to use of Activity Context.</p><pre><code>public class MainActivity extends Activity  {    public static Context s_appContext;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        s_appContext = this.getApplicationContext();</code></pre>","256239","","","","","2010-06-07 23:36:53","Is it a good practice to create a reference to application context and use it anywhere?","<android>","1","0","3","",""
"2993874","1","2994098","","2010-06-07 23:26:03","3","6058","<p>I am making a Client Server application for my Android phone.</p><p>I have created a UDP Server in Python which sits and listens for connections.</p><p>I can put either the server IP address in directly like <code>192.169.0.100</code> and it sends data fine.  I can also put in <code>192.168.0.255</code> and it find the server on <code>192.169.0.100</code>.</p><p>Is it possible to get the broadcast address of the network my Android phone is connected to?  I am only ever going to use this application on my Wifi network or other Wifi networks.</p><p>Cheers</p>","30786","","","","","2013-02-08 21:06:53","Android Broadcast Address","<java><android><udp><broadcast>","3","0","2","",""
"2993920","1","","","2010-06-07 23:39:40","6","6351","<p>How can I browse the SQLite database that I am creating in my app on my Android myTouch phone?</p><p>When I log in through adb shell, sqlite3 gives me a permission denied. Is there another way to check if my database and tables are actually being created, and if rows are being inserted?</p><p>I am not able to use the emulator, since it doesn't play videos etc. very well that is the main feature of my app, so I can only test on phone.</p><p>ThanksChris</p>","334802","","","","","2010-06-07 23:46:59","Android browse SQLite database on phone","<database><android><sqlite><phone>","1","2","","",""
"2994062","1","","","2010-06-08 00:21:56","3","4558","<p>I am trying to learn Android development, so I downloaded Eclipse Galileo and the Android SDK. However, whenever I start Eclipse, I get the error message ""Failed to parse the output of adb version."" In the Console/DDMS pane, the debug output reads:</p><p>[2010-06-07 20:15:13 - ddms]Failed to reopen debug port for Selected Client to: 8700[2010-06-07 20:15:13 - ddms]Address family not supported by protocol family: bindjava.net.SocketException: Address family not supported by protocol family: bind at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(Unknown Source) at com.android.ddmlib.MonitorThread.run(Unknown Source)</p><p>[2010-06-07 20:15:17 - adb]Failed to parse the output of 'adb version'</p><p>I am running Eclipse Galileo, have the most recent Android SDK downloaded, and am running Windows Vista 32-bit SP2. I am sure that the Android SDK path is correct and that all the files are there.</p><p>I would appreciate any assistance anyone could provide.</p><p>P.S.--If anyone could direct me to any useful Android development resources, I would appreciate it</p>","360916","","","","","2011-04-21 11:25:05","Eclipse/adb error message in Vista ""Failed to parse the output of adb version""","<android><eclipse><adb>","4","0","","",""
"2994116","1","2994284","","2010-06-08 00:40:24","17","8171","<p>I'm having problems with this. If I go to an SWF directly in the browser, it works fine. If I attempt to use loadUrl on an SWF file it stays blank and loads nothing.</p>","92259","","","","","2013-10-13 14:45:59","Load an SWF into a WebView","<android><flash><swf><webview>","2","2","5","",""
"2994158","1","","","2010-06-08 00:59:45","1","534","<p>Why does my video playing app crash when I try to run on a Droid 2.1 device, but works fine with myTouch 1.6?</p><p>ThanksChris</p><p>LogCat shows</p><pre><code>06-07 18:13:13.444: ERROR/AndroidRuntime(4252): java.lang.IllegalStateException06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.media.MediaPlayer.getVideoWidth(Native Method)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.widget.VideoView$2.onPrepared(VideoView.java:290)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1152)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.os.Handler.dispatchMessage(Handler.java:99)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.os.Looper.loop(Looper.java:123)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at java.lang.reflect.Method.invokeNative(Native Method)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at java.lang.reflect.Method.invoke(Method.java:521)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-07 18:13:13.444: ERROR/AndroidRuntime(4252):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","334802","","1839241","","2012-11-30 14:06:11","2012-11-30 14:06:11","Android 2.1 - Video issue","<android><video>","1","1","","",""
"2994275","1","","","2010-06-08 01:35:17","4","849","<p>If I have a bunch of data that is never going to change (eg. an English language dictionary or the rgb values of a couple hundred color names), how do I use an SQLite database to store it? I know a database is faster than loading everything into memory when the app starts, but how do I make the database either the first time the app runs or ""before"" the apps ever runs?</p>","63887","","","","","2011-02-12 22:23:24","How do I put static data into an SQLite database in Android?","<database><android><sqlite><static>","2","0","","",""
"2994294","1","2996228","","2010-06-08 01:40:41","1","1521","<p>How to rotate control (checkbox) in 180 or 90 degrees ?</p>","346665","","","","","2010-06-08 09:46:13","Android rotate control","<android><control><rotation>","1","0","","",""
"2994407","1","2994459","","2010-06-08 02:21:39","21","9988","<p>Somehow, I have deleted the code from for sample apps from workspace, but the app still show up in the  android emulator. How do I delete them?</p>","203018","","2900893","","2014-01-26 07:19:12","2014-01-26 07:19:12","How to delete sample app from android emulator ?","<android>","3","0","4","",""
"2994417","1","","","2010-06-08 02:26:20","7","5457","<p>can anybody please give me example of using similar functionality like uitableview in iphone to in android?</p>","360965","","","","","2012-08-16 12:52:31","similar functionality like uitableview in iphone to in android?","<android>","2","3","","",""
"2994455","1","","","2010-06-08 02:34:06","6","2730","<p>I am trying to compose a list with some items expandable and some single items.  I wish to have it so that when either a single item or expandable list child is clicked, I can call an intent based on the text of the item.  </p><p>I suppose expandable lists would work, but is there a way to set items in an expandable list so that they don't have the expandable list icon? Should I use something other than a string array? </p><p>What is the best way to do this?</p><p>Thanks</p><p>Below is my incomplete code, I would like to insert the items ""Zone 1"", ""Zone 2"", ""Zone 3"" between the items ""Atlanta"" and ""Boston"" or as a subset of Atlanta:</p><pre><code>package test.lists.special;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class SpecialList extends ListActivity{TextView toptext;String[] items={""Atlanta"", ""Boston"", ""Chicago"", ""Dallas""};@Override public 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,  items));  toptext=(TextView)findViewById(R.id.toptext); }public void onListItemClick(ListView parent, View v, int position, long id) {     Intent intent = new Intent();     if (parent.getItemAtPosition(position)==""Atlanta"")     {           //THIS IS WHERE I WISH TO INSERT ""ZONE 1"", ""ZONE 2"", ""ZONE 3""                   //between Atlanta and Boston in the list     }     else if (parent.getItemAtPosition(position)==""Boston"")     {          intent.setClass(this, test.lists.special.Boston.class);           startActivity(intent);      }     else if (parent.getItemAtPosition(position)==""Chicago"")     {             intent.setClass(this, test.lists.special.Chicago.class);              startActivity(intent);      }     else if (parent.getItemAtPosition(position)==""Dallas"")     {            intent.setClass(this, test.lists.special.Dallas.class);             startActivity(intent);      }     else if (parent.getItemAtPosition(position)==""Zone 1"")     {            intent.setClass(this, test.lists.special.Atlanta.Zone1.class);             startActivity(intent);      }     else if (parent.getItemAtPosition(position)==""Zone 2"")     {            intent.setClass(this, test.lists.special.Atlanta.Zone2.class);             startActivity(intent);      }     else if (parent.getItemAtPosition(position)==""Zone 3"")     {            intent.setClass(this, test.lists.special.Atlanta.Zone3.class);             startActivity(intent);      }    }}</code></pre>","360964","","","","","2010-11-29 06:06:01","How can I create a list with only certain items expandable?","<android><list><android-arrayadapter><expandablelistview>","2","0","","",""
"2994494","1","2995955","","2010-06-08 02:45:37","6","35705","<p>I'm looking for an easy way for the user to see how many drinks they've had for a BAC calculator.</p><p>Picture of the app:</p><p><img src=""http://i.stack.imgur.com/JN13ym.jpg"" alt=""PICTURE OF THE APP""></p><p>On button press, I would like an image to be added to the screen, directly under the spinner and with left alignment. When I press the button again, I want another image to be added to the screen.</p><p>So if I pressed the add beer button, a drawable of a beer would appear below the spinner. If I pressed the add beer button again, I want there to be TWO drawables of beers under the spinner, preferably with them being added from the right.</p><p>(Also, having them reach their width limit, wrapping around, and starting again on the left, but below a full line, would be AWESOME)</p><p>I can't figure out how to do this. I assume adding a ImageView in code to a relative layout (because it needs to be positioned to the right) would be the best route, but if it's possible in xml I'd be more than happy to use that. Any help?</p>","359045","","1694500","","2014-03-15 13:33:02","2014-03-15 13:33:02","How do I create an ImageView in java code, within an existing Layout?","<java><android><image><layout><drawable>","1","0","3","",""
"2994582","1","","","2010-06-08 03:16:38","0","3736","<p>I am trying to teach myself the basics of Android dev. At the moment I am experimenting with home screen widgets. I would like to create a simple widget that lists all my bookmarks. Somewhere in my googling I read that ListView is not usable in a widget. What's the best way to display a scrolling list in a widget? An example would be fantastic, but otherwise point me in the right general direction and I can research further.</p><p>Thanks in advance,Dany.</p>","150061","","","","","2012-02-17 21:42:53","Scrolling list in Android home screen widget","<android><android-widget>","2","1","","",""
"2994619","1","2996783","","2010-06-08 03:32:02","2","962","<p>I've got an Android project I'm working on that, ultimately, will require me to create a movie file out of a series of still images taken with a phone's camera.  That is to say, I want to be able to take raw image frames and string them together, one by one, into a movie.  Audio is not a concern at this stage.</p><p>Looking over the Android API, it looks like there are calls in it to create movie files, but it seems those are entirely geared around making a live recording from the camera on an immediate basis.  While nice, I can't use that for my purposes, as I need to put annotations and other post-production things on the images as they come in before they get fed into a movie (plus, the images come way too slowly to do a live recording).  Worse, looking over the Android source, it looks like a non-trivial task to rewire that to do what I want it to do (at least without touching the NDK).</p><p>Is there any way I can use the API to do something like this?  Or alternatively, what would be the best way to go about this, if it's even feasible on cell phone hardware (which seems to keep getting more and more powerful, strangely...)?</p>","360994","","","","","2010-06-08 17:34:23","Turning a series of raw images into movie frames in Android","<android><movie>","2","0","1","",""
"2994723","1","2994739","","2010-06-08 04:16:53","2","3553","<p>I want the contains() method from ArrayList to be case insensitive.</p><p>Is there any way?</p><p>Thanks</p>","2443607","","","","","2012-07-21 13:32:34","ArrayList & contains() - case insensitive","<android><arraylist><contacts><case-insensitive>","3","0","","",""
"2994812","1","4078301","","2010-06-08 04:49:05","1","3456","<p>I'm developing an application for the Android platform targeted for api level 4 (Android 1.6) but I can't get it to show up on my phone and I can't figure out why. Here's my AndroidManifest.xml is there a problem in here? Or is there something else I should be looking at?</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.sbe.app.hellocogen""          android:versionCode=""1""          android:versionName=""1.0""&gt;            &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;                &lt;activity android:name="".activity.ListPlants""                        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="".activity.AddPlant""                        android:label=""Add Plant""&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;                &lt;activity android:name="".activity.UnitActivity""                        android:label=""IP HERE, PLANT NAME""&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;        &lt;/application&gt;        &lt;uses-sdk android:minSdkVersion=""4""/&gt;    &lt;/manifest&gt; </code></pre><p>When I started this application it didn't show up but I fixed it by setting the minimum api level to 4 instead of 7 then it started showing up but now it stopped showing up again and I don't know why.</p>","354271","","","","","2010-11-02 13:48:50","Why doesn't my android application show up in the launcher?","<android><android-manifest><launcher><app-launcher>","1","3","","",""
"2994911","1","","","2010-06-08 05:21:31","11","5857","<p>I would like to know how I can display a HTML page in webview with references to relative/local images. The goal is to have the html page and all linked images contained in the android application package itself. </p><p>Where would I need to place the assets (assets directory?) and how do I reference these so they load into the webview?</p><p>Thanx!Sven</p>","302750","","","","","2011-01-28 08:28:17","Loading package html + resources into webview","<android><webkit><webview><local><assets>","1","0","3","",""
"2995020","1","","","2010-06-08 05:46:36","1","322","<p>I'm having this odd issue. I have these buttons where the button's text is shifted downward upon certain actions. For example, I have a spinner with choices and one of the choices makes some buttons invisible while others are made visible. When I choose these, the buttons made visible all have their text shifted downward. Nothing else is shifted, just the text on the buttons. I've tried this on 1.5 and it works fine, no text is shifted, but I have issues with 2.1 and I really cannot figure it out. Any ideas or help would be great. Thanks.</p><p>Here is the xml of the file:</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;TableLayout android:id=""@+id/testpracHeader""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""&gt;    &lt;!-- android:background=""#ff0000""--&gt;    &lt;TableRow&gt;        &lt;Spinner android:id=""@+id/testprac_menu""             android:layout_width=""200px""             android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;        &lt;View android:id=""@+id/header_space_buffer""             android:layout_width=""40px""             android:layout_height=""30px""            android:gravity=""center""&gt;&lt;/View&gt;        &lt;Button android:text=""New""             android:id=""@+id/newInterval""             android:layout_width=""80px""             android:layout_height=""wrap_content""&gt;&lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:id=""@+id/bottomStruct""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""&gt;    &lt;TableRow&gt;        &lt;Button android:layout_width=""80px""             android:text=""Replay""             android:id=""@+id/replay""             android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;Button android:id=""@+id/playInterval""             android:text=""Play""            android:layout_width=""160px""             android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;Button android:text=""Submit""             android:id=""@+id/submit""             android:layout_width=""80px""             android:layout_height=""wrap_content""&gt;&lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>When i use the <code>testprac</code> spinner, the replay, new and submit buttons go invisible and the play button becomes visible (which is what I want). This seems to be when the issue seems to start. The play button's text is completely gone (probably shifted to low to see) and when I go back to the other button's are visible I get the issue that is shown below. The left is the issue before using the spinner, and the right is the issue. I don't know if it is just the spinner that causes this.</p><p><img src=""http://img.photobucket.com/albums/v68/authoreety/before_bug.png"" alt=""The GUI before I invoke the spinner""><img src=""http://img.photobucket.com/albums/v68/authoreety/after_bug.png"" alt=""The GUI after I invoke the spinner""></p>","278447","","278447","","2010-06-08 15:02:50","2013-11-04 11:47:51","Issue with button text shifting","<android><layout>","2","1","","",""
"2995144","1","2996100","","2010-06-08 06:12:25","0","752","<p>I am trying to use the facebook in my application. I had founded some webservices for dotNet . Like that is there any facebook webservices are available for android . can any one help me please.</p><p>ThanQ.</p>","247921","","","","","2010-06-08 09:25:59","facebook webservices for android","<android><facebook>","1","0","","",""
"2995145","1","2995659","","2010-06-08 06:12:37","5","23205","<p>I want to create image slideshow in android.</p><p>I have many images in android GridView now i want to open manual slideshow if any image is clicked so that i could view it by moving finger left or right next and previous imageslike android built in gallery.</p><p>any one guide me how to achieve this?</p><p>any help would be appreciated.</p>","249991","","614807","","2012-03-14 11:59:46","2013-11-27 05:22:06","image slideshow example in android?","<android><image-manipulation>","3","0","8","",""
"2995525","1","2995620","","2010-06-08 07:44:00","0","599","<p>I think it's kinda easy one but still I'm new to android programming so please have patience. I want to know how can I get the number of records (rows) in a specific table in my db. I need this so I can create a loop to go through every record and add each one of it to the specific Array and display it later on. This is the source:  </p><pre><code>db.openDataBase();            // open connection with dbCursor c = db.getTitle(5);    // loop here through db, right now I'm fetching only one recordstartManagingCursor(c);//adding areas to the list hereArea o1 = new Area();o1.setOrderName(c.getString(1) + c.getString(2));  m_areas.add(o1);db.close();</code></pre><p>Does anyone can help me with this please? Thx in advance!     </p>","359656","","236247","","2011-06-28 16:05:43","2012-07-03 07:51:47","How to go through every record in SQLite db?","<android><sqlite>","3","1","","",""
"2995581","1","2995739","","2010-06-08 07:54:08","5","17633","<p>after creating some menus with <code>simple_list_item_1</code> (which worked very fine) I tried to replace this by <code>simple_list_item_2</code>, but my system throws around with exceptions...</p><p>Now I'm wondering how to create such a two-different-sized-line-entry for my list...is there any trap for beginners? Can someone please help me fixing my (small!?) problem?</p><p>My code looks like this:</p><pre><code>ListAdapter listAdapter = new ArrayAdapter&lt;String&gt;(this,        android.R.layout.simple_list_item_2, fileNames);setListAdapter(listAdapter);</code></pre><p>My <code>String[] fileNames</code> stores all strings to display in ascending order (does this matter for the functionality?!)</p><p>After unsuccessfully searching in some forums I now hope that someone of you can give me an useful suggestion.</p><p>nice greetings,poeschlorn</p>","317301","","","","","2010-06-08 08:26:38","simple_list_item_2 in Android","<android><menu><listactivity>","1","0","1","",""
"2995696","1","2996623","","2010-06-08 08:17:39","0","985","<p>How can I make a custom content provider in android?Give me a simple example</p>","357112","","","","","2011-09-28 05:39:34","Custom Content Provider","<android><android-contentprovider>","3","1","","",""
"2995745","1","4133035","","2010-06-08 08:28:09","0","1242","<p>I've been listening music on my Samsung i7500 Galaxy with headset plugged to the device. After listening I've plugged headset out and now while I call to somebody I see there is a call on the device screen, but either me, either person whom I am calling to, doesn't hear the other person. While I plug headset again I can hear everything (on the headset), after another plug out problem still exist. Anybody know how to fix it?</p><p>I found this <a href=""http://androidforums.com/samsung-i7500/41993-speakers-problem.html"" rel=""nofollow"">solution</a>, but it doesn't works in my case.</p>","235973","","","","","2010-11-09 11:18:39","Samsung i7500 Galaxy - speakers, calling problem after listening music","<android><call><speaker><android-hardware>","1","1","","2011-06-10 09:33:34",""
"2995890","1","","","2010-06-08 08:50:44","5","3642","<p>I have been trying to use a ScrollView on a single ImageView with a JPG (~770 x 1024) over an AVD that's 600x800. </p><p>My main.xml 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:orientation=""vertical""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     &gt;&lt;ScrollView android:id=""@+id/scroller""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Now, I add a single ImageView with </p><pre><code>setContentView(R.layout.main);ScrollView sv = (ScrollView)findViewById( R.id.scroller );ImageView iv = new ImageView(this);iv.setImageDrawable( new BitmapDrawable( ""/sdcard/770x1024.jpg"" ) ); // same happens with ScaleDrawable.iv.setScaleType( ScaleType.CENTER_INSIDE );sv.addView( sv ); // and it does not go any better if I use Linear Layout between the ScrollView and the ImageView.</code></pre><p>The result is The image was displayed in a middle of a ScrollView, wrapped with background area on top and bottom as following:</p><pre><code>     | } blank     | }Image|.    |.    :.    :     : } blank     : }     ^-scrollbar</code></pre><p>Instead of just </p><pre><code>Image|.    |.    |.    |.    :</code></pre><p>I tried to set the background of the ImageView red, and it verified that the blank margins were ImageView background.</p><pre><code>iv.setBackgroundColor( color.Red );</code></pre><p>Where I would expect the image to take no more than its size (scaled to the AVD size) and I expect the ScrollView to let me scroll over the remainder (if any).</p><p>For some reason, I see that the drawable size is 600x1024.</p><p><strong>Moreover</strong>I tried to add a LinearLayout with a dummy text view such as the linear layout is a parent to the ImageView and the TextView, and the ScrollView is a parent to the LinearLayout.</p><pre><code>LinearLayout dummy = new LinearLayout( this );dummy.addView(iv);TextView someTextView = new TextView( this );someTextView.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT ));dummy.addView( someTextView );sv.addView( dummy );</code></pre><p>The result was very peculiar:The entire layout was set into the height of a text-less text view (19).</p><pre><code>______________________| T I T L E    B A R |+--------------------+|         []&lt;-image  ||        height=19px |.                    ..                    .+--------------------+ </code></pre><p>It is important for me to avoid stretching the image. I can not use FIT_XY for ScaleType.What is the recommended way to implement a display of a page that can be potentially scrolled?Do I have to do it manually with a plain layout and scrolling upon <em>GestureDetector.OnScroll</em> events?</p><p>Thanks</p><p>Shmuel</p><p>P.S: Another observation: With an image scaled-down to 600x780 (proportional scaling) it does work properly. Unfortunately, for me it is not feasible to use a set of scaled-down clones of the images.</p>","361169","","361169","","2010-06-10 14:40:03","2012-03-22 17:30:47","Redundant margins when adding ImageView to ScrollView in Android","<android><imageview><scrollview>","4","0","0","",""
"2996362","1","","","2010-06-08 10:06:42","1","2657","<p>I have an application, which (for the sake of simplicity) has two types of activities - Overview and DetailView. The Overview activity shows a list of steps and allows the user to start a DetailView activity corresponding to the step chosen.</p><p>In the DetailView activity, the user can start another Overview, which shows different steps than the ones in the parent of the current DetailView.</p><p>In the Overview, DetailView is started by using startActivityForResult (). In the DetailView, when the user decides to start a second Overview, I call setResult () and finish () and then start the new Overview. In this scenario, onActivityResult () and finishFromChild () do not fire. Instead, they fire when the parent finishes (!?).</p><p>I hope that this question isn't too stupid :)</p><p>Code from Overview:</p><pre><code>        Intent spIntent = new Intent ();  spIntent.setClassName (""com.testing.testa"", ""com.testing.testa.Overview"");  spIntent.putExtra(""id"", itemId);  spIntent.putExtra(""local"", isLocal);  spIntent.putExtra(""numberOfSteps"", numberOfSteps);  spIntent.putExtra(""currentStep"", swipeStepNumber);  spIntent.putExtra(""name"", name);  System.out.println (""swipeStepNum: "" + this.swipeStepNumber);  startActivityForResult (spIntent, 0);</code></pre><p>...</p><pre><code>public void onActivityResult (int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);  System.out.pritnln (""Child ended with resultCode: "" + resultCode);     }</code></pre><p>Code from DetailView:</p><pre><code>Intent spIntent = new Intent ();spIntent.setClassName (""com.testing.testa"", ""com.testing.testa.Overview"");spIntent.putExtra(""id"", itemId);spIntent.putExtra(""name"", sectionedAdapter.getItem(position).toString());startActivity (spIntent);Intent die = new Intent ();die.putExtra (""die"", true);setResult (1, die);finish ();</code></pre>","361230","","","","","2010-07-20 04:17:46","finishFromChild and onActivityResult not firing when child starts activity of the same type as the parent","<android>","1","0","","",""
"2996363","1","2996808","","2010-06-08 10:06:57","3","2279","<p>i am developing an android application using google maps data.I can access google maps in emulator but  when i try the same in my application the google maps is not opening .What is the problem?Help</p>","260654","","286595","","2010-06-08 11:44:19","2010-08-06 20:29:52","Accessing google maps in android emulator","<java><android><google-maps>","2","0","2","",""
"2996404","1","2996832","","2010-06-08 10:13:11","2","1403","<p>Are there any requirements/guidelines for an Android device? like numbers of buttons or minimum buttons required.</p><p>Also are there any android devices which do not have the menu and back buttons?</p><p>( I am aware that no menu/back buttons will kill most of the apps in terms of usability , I just wanted to know more on the topic :-) ) </p>","304673","","","","","2010-06-08 11:26:24","Android device guidelines/requirements","<android>","2","0","2","",""
"2996493","1","2996767","","2010-06-08 10:26:00","0","580","<p>I am using list view using ""ArrayAdapter"" to display number of items while user is looking at results when user click on load button i want results to load and prepends(add in the beginning)</p>","216431","","","","","2010-06-08 11:15:54","android customize list view prepends results","<android><listview><results><prepend>","1","0","","",""
"2996690","1","","","2010-06-08 11:00:46","1","3088","<p>Does anyone know of a cheap Android or programmable device that has wifi?</p><p>I need it for a project for a company that needs a wifi handheld device for the shop floor. </p><p>I<code>m not too fussed about the language the device uses though I</code>m not really interested in the iTouch as theres no intention to release the app in the app store and I don`t really want to jail break everybodys iTouch. </p><p>Ideally it would be small , iTouch size for example and relatively cheap $100 or less. Nothing fancy just ability to write a simple UI and have wifi. Voice is not needed.</p><p>Not too fussed about touch  or qwerty keyboard either.</p>","283483","","","","","2010-06-08 11:43:03","Cheap Wifi enabled Android or other programmable device","<android><wifi><device>","2","3","1","",""
"2996759","1","","","2010-06-08 11:14:39","4","3381","<p>I am new to Android development and have an assignment to read frame buffer data after a specified interval of time.</p><p>I have come up with the following code:</p><pre><code>public class mainActivity extends Activity {    Bitmap mSavedBM;    private EGL10 egl;    private EGLDisplay display;    private EGLConfig config;        private EGLSurface surface;    private EGLContext eglContext;    private GL11 gl;    protected int width, height; //Called when the activity is first created. @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // get the screen width and height    DisplayMetrics dm = new DisplayMetrics();    getWindowManager().getDefaultDisplay().getMetrics(dm);    int screenWidth = dm.widthPixels;    int screenHeight = dm.heightPixels;     String SCREENSHOT_DIR = ""/screenshots"";    initGLFr(); //GlView initialized.    savePixels( 0, 10, screenWidth, screenHeight, gl); //this gets the screen to the mSavedBM.    saveBitmap(mSavedBM, SCREENSHOT_DIR, ""capturedImage"");    //Now we need to save the bitmap (the screen capture) to some location.    setContentView(R.layout.main); //This displays the content on the screen}private void initGLFr(){    egl = (EGL10) EGLContext.getEGL();    display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);    int[] ver = new int[2];    egl.eglInitialize(display, ver);    int[] configSpec = {EGL10.EGL_NONE};    EGLConfig[] configOut = new EGLConfig[1];    int[] nConfig = new int[1];    egl.eglChooseConfig(display, configSpec, configOut, 1, nConfig);    config = configOut[0];    eglContext = egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, null);    surface = egl.eglCreateWindowSurface(display, config, SurfaceHolder.SURFACE_TYPE_GPU, null);    egl.eglMakeCurrent(display, surface, surface, eglContext);    gl = (GL11) eglContext.getGL();}public void savePixels(int x, int y, int w, int h, GL10 gl){    if (gl == null)            return;     synchronized (this) {     if (mSavedBM != null) {     mSavedBM.recycle();     mSavedBM = null;     }     }    int b[] = new int[w * (y + h)];    int bt[] = new int[w * h];    IntBuffer ib = IntBuffer.wrap(b);    ib.position(0);    gl.glReadPixels(x, 0, w, y + h, GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,ib);    for (int i = 0, k = 0; i &lt; h; i++, k++)    {        //OpenGLbitmap is incompatible with Android bitmap        //and so, some corrections need to be done.            for (int j = 0; j &lt; w; j++)            {                    int pix = b[i * w + j];                    int pb = (pix &gt;&gt; 16) &amp; 0xff;                    int pr = (pix &lt;&lt; 16) &amp; 0x00ff0000;                    int pix1 = (pix &amp; 0xff00ff00) | pr | pb;                    bt[(h - k - 1) * w + j] = pix1;            }    }    Bitmap sb = Bitmap.createBitmap(bt, w, h, Bitmap.Config.ARGB_8888);    synchronized (this)    {        mSavedBM = sb;    }} static String saveBitmap(Bitmap bitmap, String dir, String baseName) {    try {        File sdcard = Environment.getExternalStorageDirectory();        File pictureDir = new File(sdcard, dir);        pictureDir.mkdirs();        File f = null;        for (int i = 1; i &lt; 200; ++i) {            String name = baseName + i + "".png"";            f = new File(pictureDir, name);            if (!f.exists()) {                break;            }        }        if (!f.exists()) {            String name = f.getAbsolutePath();            FileOutputStream fos = new FileOutputStream(name);            bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);            fos.flush();            fos.close();            return name;        }    } catch (Exception e) {    } finally {        //if (fos != null) {         //   fos.close();       // }    }    return null;}</code></pre><p>}</p><p>Also, if some one can direct me to better way to read the framebuffer it would be great. I am using Android 2.2 and virtual device of API level 8. I have gone through many previous discussions and have found that we can not read frame buffer directly through the ""/dev/graphics/fb0"".</p><p>Thanks,Ali</p><p>(edit: reformatting first lines of code)</p>","361275","","361275","","2014-02-24 23:42:42","2014-02-24 23:42:42","Android source code not working, reading frame buffer through glReadPixels","<android><opengl-es><framebuffer>","1","2","","",""
"2997135","1","3148765","","2010-06-08 12:15:22","0","1591","<p>I have two Activities: one with <code>VideoView</code> attached to <code>MediaPlayer</code> and the second one.<br> I start watching a video in the first Activity, then during playback I start second Activity.<br>After going back to first Activity I can hear sound but see no picture.</p><p>My Video 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;VideoView android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:layout_weight=""1""            android:id=""@+id/videoView"" android:layout_gravity=""center"" /&gt;      &lt;ListView android:layout_width=""fill_parent"" android:layout_height=""125dp""            android:id=""@+id/ListView"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Do you have any ideas why video doesn't appear?</p>","296427","","154306","","2011-04-08 15:57:49","2011-05-26 06:51:46","Video playback on VideoView disappears after going back from another Activity","<android><media-player><videoview>","2","0","0","",""
"2997216","1","2998441","","2010-06-08 12:25:45","0","152","<p>I'm having some difficulty with drawing a line on a map. I'm basically drawing it etc. but when I select other tab and then come back to the ""map tab"" the line disappears. How can I prevent that so the line stays there all the time? Please can someone help me to solve this?</p>","359656","","359656","","2010-06-08 12:52:59","2010-06-08 14:50:10","Having tabs I want to draw a line on map and let it stay there all the time","<android>","1","0","","",""
"2997245","1","2997385","","2010-06-08 12:31:51","1","461","<p>Coming from a .NET C# background, new to Java....</p><p>How do I re-write this code to point the listener to a normal function?</p><pre><code>confirmButton.setOnClickListener(new View.OnClickListener() {     public void onClick(View view) {    //Some Code Here;     }});</code></pre>","172861","","","","","2010-06-08 12:52:24","Android Anonymous Delegate","<android>","1","1","","",""
"2997281","1","","","2010-06-08 12:37:26","0","240","<p>guys, anybody has a code snippet where I can get all the numbers (telephone) of a contact? (in android 2.1).</p>","361352","","","","","2010-06-09 12:43:20","get all the numbers (telephone) of a contact? (in android 2.1)","<android>","2","0","","",""
"2997338","1","","","2010-06-08 12:45:15","4","11634","<p>In my application I have a button initially on the screen and in onclick of the button, a popup window should open. In the popup window I have an imagebutton, on click of this button i want to start an activity. The popup window opens but I don't understand how to handle the onclick of the imagebutton inside the popup window.</p><p>In main.xml I have a button and in popup_example.xml I have an imagebutton.</p><p>My Java code is as follows:</p><pre><code>final LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); final Button b=(Button)findViewById(R.id.btn);b.setOnClickListener(new OnClickListener(){    public void onClick(View v)    {        PopupWindow pw = new PopupWindow(inflater.inflate(R.layout.popup_example,(ViewGroup)findViewById(R.layout.main)));        pw.showAtLocation(v, Gravity.LEFT,0,0);        pw.update(8,-70,150,270);        //if onclick written here, it gives null pointer exception.        ImageButton img=(ImageButton)findViewById(R.id.home);        img.setOnClickListener(new OnClickListener()        {            public void onClick(View v)            {                Intent.....            }        });        //if onclick is written here it gives runtime exception.    }); </code></pre><p>and i have two xml layouts.........</p><ol><li><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=""wrap_content""&gt;     &lt;ImageButton         android:id=""@+id/btn""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:src=""@drawable/ghj"" /&gt;&lt;/LinearLayout&gt;</code></pre></li><li><p>popup_example.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:padding=""10dip""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:background=""#8E2323""&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""         android:orientation=""vertical""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:padding=""5px""&gt;        &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""             android:orientation=""vertical""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:padding=""5px""            android:background=""#000000""&gt;            &lt;ImageButton android:id=""@+id/home""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:focusable=""true""                 android:src=""@drawable/vitalss""                 android:layout_weight=""1""                 android:background=""#8E2323""/&gt;                         &lt;/TableLayout&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt; </code></pre></li></ol>","361362","","44853","","2012-03-26 12:08:17","2012-03-26 12:08:17","how to handle onclick event of button inside popup window in android","<android>","1","0","2","",""
"2997348","1","2998451","","2010-06-08 12:46:58","103","70064","<p>I am trying to follow the Android mapping tutorial and got to this part where I had to get an API key<a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint"">http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint</a></p><p>I have found my <code>debug.keystore</code> but there does not appear to be a keytool application in the directory:</p><p><strong>C:\Documents and Settings\tward\.android>ls</strong>adb_usb.ini      avd       debug.keystore  repositories.cfg androidtool.cfg  ddms.cfg  default.keyset</p><p>There is also no keytool in this directory:</p><p><strong>C:\Android\android-sdk-windows\tools>ls</strong>AdbWinApi.dll     apkbuilder.bat       etc1tool.exe         mksdcard.exeAdbWinUsbApi.dll  ddms.bat             fastboot.exe         source.propertiesJet               dmtracedump.exe      hierarchyviewer.bat  sqlite3.exeNOTICE.txt        draw9patch.bat       hprof-conv.exe       traceview.batadb.exe           emulator.exe         layoutopt.bat        zipalign.exeandroid.bat       emulator_NOTICE.txt  lib</p><p>I am using Eclipse as my editor and believe that I have downloaded all the latest SDKWhat am I doing wrong?</p>","134100","","530681","","2013-06-19 17:50:05","2014-02-10 21:50:34","I can’t find the android keytool","<android>","9","1","30","",""
"2997585","1","2998478","","2010-06-08 13:15:09","1","193","<p>I have android application and service that runs in separate process. Application and service read and write to same database (and same table). What is the best way to work with database?How to prevent locks?</p>","238123","","","","","2010-06-08 14:53:57","Application and service with one database","<android><database><thread-safety>","1","0","","",""
"2997703","1","2998012","","2010-06-08 13:31:35","0","1259","<p>i am using following code to display remote image with next and previous buttons.clicking on next and previous buttons two or three times it does not show image next image.and bitmap of DisplayLiveImage is null.</p><p>can any one check is this a buffer problem? or connection?</p><pre><code>ImageView img;     int CurrentImageIndex;    protected void onCreate(Bundle savedInstanceState)    {          super.onCreate(savedInstanceState);        setContentView(R.layout.imageviwer);        setTitle(""some text"");        myRemoteImages = new String[6];        myRemoteImages[0]=""http://www.comparecheapinsurance.com/car-insurance/images/car-insurance-policy.jpg"";        myRemoteImages[1]=""http://www.speedace.info/solar_cars/solar_car_images/auburn_university_solar_car_banked_road_test.jpg"";        myRemoteImages[2]=""http://zedomax.com/blog/wp-content/uploads/2009/07/car.jpg"";        myRemoteImages[3]=""http://www.wallpaperez.net/wallpaper/car/Lamborghini-prototype-car-926.jpg"";        myRemoteImages[4]=""http://www.evbeat.com/blog/wp-content/uploads/2009/03/aptera-electric-car.jpg"";        myRemoteImages[5]=""http://www.cartuningcentral.com/wp-content/uploads/2008/01/exotic-car-pagani-zonda.jpg"";        CurrentImageIndex= 0;        img= (ImageView)findViewById(R.id.myImageView);        DisplayLiveImage(CurrentImageIndex);        Button previous = (Button)findViewById(R.id.btnPrevious);        Button next = (Button)findViewById(R.id.btnNext);        next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                ShowNext();            }        });        previous.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                ShowPrevious();            }        });    }    public void DisplayLiveImage(int val)    {                     try {                               URL aURL = new URL(myRemoteImages[val]);                               URLConnection conn = aURL.openConnection();                               conn.connect();                               InputStream is = conn.getInputStream();                               BufferedInputStream bis = new BufferedInputStream(is);                               Bitmap bm = BitmapFactory.decodeStream(bis);                               bis.close();                               is.close();                              // i.setImageBitmap(bm);                              img.setImageBitmap(bm);                        } catch (IOException e) {                          }                    //   i.setScaleType(ImageView.ScaleType.FIT_CENTER);                     //  i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));                      // return i;    }    public void ShowNext()    {        if(CurrentImageIndex &lt; myRemoteImages.length )        {            CurrentImageIndex  = CurrentImageIndex +1 ;            DisplayLiveImage(CurrentImageIndex);        }    }    public void ShowPrevious()    {        if(CurrentImageIndex &gt; 0 )        {            CurrentImageIndex  = CurrentImageIndex -1 ;            DisplayLiveImage(CurrentImageIndex);        }    }</code></pre><p>any help would be appriciated.</p>","249991","","","","","2011-09-02 18:02:59","android Remote image Getting problem?","<android>","1","1","","",""
"2997818","1","2998524","","2010-06-08 13:45:56","5","6861","<p>I currently have a GridView scrolling vertically, and everything works fine. But now that I want to change my layout and have the gridview grow on its width instead of height as it grows bigger I am lost.</p><p>I have tried to simply change the column width each time an item is added to the gridview. But no vertical scroll appears, even though the items are added correctly. Is there a neat way to fix this, or must I make my own gridview? :(</p><p>Cheers,</p>","249871","","","","","2012-09-03 20:22:37","GridView with horizontal scroll","<android><gridview><scrolling>","2","0","","",""
"2997821","1","2998064","","2010-06-08 13:46:03","0","60","<p>I added a new layout in the project and after adding it, I am getting error, even I deleted the layout file still error keep on coming, below is the screen shot for more explanation:<img src=""http://www.freeimagehosting.net/uploads/13ea6caf83.jpg"" alt=""alt text""></p><p>Thanks</p>","328518","","","","","2010-06-08 16:24:50","XML error in android application","<xml><android><layout>","2","1","","",""
"2997848","1","2997988","","2010-06-08 13:48:56","0","1543","<p>I have this Code to Capture a image  and Display it back in ListViewonclick of the listitem i can capture image and  save  to image View, but  how can get  onlthe  left of the list  item?</p><pre><code>         public class ShootList extends ListActivity implements OnItemClickListener {  String[] listItems = {""HeadShot"", ""BodyShot "", ""ExtraShot"", ""Video Take1"", ""Video    Take2"", ""Video Take3"", };  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.list);        setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, listItems));        ListView shot = getListView();        shot.setOnItemClickListener(this); }@Overridepublic void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int Position, long arg3) {    // TODO Auto-generated method stub    int P = Position;    switch ( P ) {    case 0:        Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");        startActivityForResult(intent, 1);        break;    case 1:        AlertDialog.Builder alertbox1 = new AlertDialog.Builder(this);        alertbox1.setMessage(""BodyShot"").show();        break;    case 2:        AlertDialog.Builder alertbox2 = new AlertDialog.Builder(this);        alertbox2.setMessage(""ExtraShot"").show();        break;    case 3:        Intent Take1 = new Intent(""android.media.action.VIDEO_CAPTURE"");        startActivityForResult(Take1, 0);        break;    case 4:        AlertDialog.Builder alertbox4 = new AlertDialog.Builder(this);        alertbox4.setMessage(""Take2"").show();        break;    case 5:        AlertDialog.Builder alertbox5 = new AlertDialog.Builder(this);        alertbox5.setMessage(""Take3"").show();        break;    default:        break;}}  public void onActivityResult(int requestCode, int resultCode, Intent data) {         super.onActivityResult(requestCode, resultCode, data);            int i;        // 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)         {             Bundle extras = data.getExtras();             Bitmap b = (Bitmap) extras.get(""data"");             //setContentView(R.layout.main);             ImageView mImg;             mImg = (ImageView) findViewById(R.id.img);             mImg.setImageBitmap(b);        // save image to gallery         String timestamp = Long.toString(System.currentTimeMillis());         MediaStore.Images.Media.insertImage(getContentResolver(), b, timestamp, timestamp);         }  }</code></pre><p>}</p><p><img src=""http://audition800.com/1.jpg"" alt=""alt text"">    </p>","164850","","164850","","2010-06-08 14:58:40","2010-06-08 14:58:40","How can i put the thumbnail beside the list item in Android?","<android>","3","0","","",""
"2997945","1","2998566","","2010-06-08 13:58:54","1","1153","<p>Hey everyone. I'm currently developing an app which uses tabs and google map. What I want to do is to get the gps positions, say 3, and store them in sql db (which I'm already doing) and then display them on the map. I already created canvas, added to overlay but those points disappear when I'm changing tabs so I thought if there is a way to somehow store those coords with google map so I can retrieve them and display them nicely whenever I'm clicking the ""map tab""? Please can anyone help? </p>","359656","","","","","2010-06-09 06:32:20","How to save coordinates with Google Map?","<android><google-maps>","3","0","","",""
"2998468","1","2999112","","2010-06-08 14:52:38","1","6346","<p>Sheesh talk about limited information! I'm trying to get my Android application to connect to an online database to access information. There's quite a bit of info including geotags and these are going to be mapped on my app. The developer site has the very informative piece of information:</p><blockquote>  <p>You can use the network (when it's available) to store and retrieve data on your own web-based services. To do network operations, use classes in the following packages:</p><pre><code>java.net.*android.net.*</code></pre></blockquote><p>Like I said in my previous question, I'm still very much an android newbie, and trying to remember my java oop from college is slow. Does anyone have an example of how this might work, or how I could implement it? I wouldn't mind even connecting to a local xml file, if I could find a good example of how to do that!? Am I just looking in all the wrong places?!</p><p>Help. Please!</p><p>T</p>","359197","","115145","","2010-06-08 15:23:26","2010-06-08 16:08:17","Connect Android application to remote data","<java><android><connection><database>","2","0","1","",""
"2998591","1","2998682","","2010-06-08 15:07:44","0","86","<p>This code not work. Anyone can helpme?</p><p>.java</p><pre><code>package rfmsoftware.util.test1;import android.app.Activity;import android.os.Bundle;public class test1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button = (Button)findViewById(R.id.Button01); &lt;---- Error at this line !?    }}</code></pre><p>.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;EditText android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:ems=""10""&gt;&lt;/EditText&gt;&lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""@string/Scan""&gt;&lt;/Button&gt;&lt;View android:id=""@+id/View01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/View&gt;&lt;/LinearLayout&gt;</code></pre><p>.error</p><p>Button cannot be resolved to a type (type Java problem) ???</p>","361513","","265143","","2010-06-08 15:14:42","2010-06-08 15:18:09","What i am doing wrong with Class Overview?","<java><android>","2","0","","",""
"2998662","1","3242483","","2010-06-08 15:15:05","0","772","<p>Right now I have a list activity powered by a cursor adapter.I have a AutoCompleteTextView that allows the user to filter the list.Code looks like this:</p><pre><code>filterText = (AutoCompleteTextView) findViewById(R.id.search_box);filterText.setAdapter(mAdapter);filterText.setDropDownHeight(0); // hide the drop down, just filter the listActivityfilterText.setThreshold(1);</code></pre><p>It works great. I want to switch to the Quick Search Box so I don't take up so much screen space and I feel like the Quick Search Box is more UI standard.The problem is the Quick Search Box doesn't really filter a list very well. It doesn't broadcast the intent on every letter typed (only when you click the search button). Is there a good tutorial on how to do this somewhere?</p>","341390","","","","","2010-07-14 00:09:15","Quick Search Box to filter adapter","<android><search><filter>","1","0","","",""
"2998684","1","","","2010-06-08 15:18:06","0","820","<p>I'm using a custom view to display items in a listview. For some reason every time the list is populated; the first item is shown as selected (ie; orange highlight). I've tried everything I can think about to solve it; any ideas?</p>","36285","","","","","2010-06-08 16:19:27","Listview's first item is always selected","<android><listview><selector>","2","1","","",""
"2998911","1","","","2010-06-08 15:43:46","0","1966","<p>Is it possible for child views of a list item to receive focus? I have a custom listview. Each row has a linear layout with two views, a button and a textview. I want to get the click event on the button and also have the background change color with focus.</p>","261855","","4702","","2012-06-19 13:27:22","2012-06-19 13:27:22","Focus on list item child views","<android><focus><listitem>","2","0","","",""
"2999107","1","2999237","","2010-06-08 16:07:54","0","142","<p>Whenever the Android device locks and I unlock it, the image that was displayed in the ImageView disappears. What do I need to do to redisplay it or prevent this from happening.</p><p>More:I have a view that displays video, images or text depending on the context and three subclasses that extend the parent view. On creation, I replace the display view with the View object returned from createMediaPreview(), which each subclass implements. </p><p>Thanks in advance</p>","131721","","","","","2010-06-08 17:27:40","Unlock Android Image fails to Show","<android><imageview>","2","0","","",""
"2999257","1","","","2010-06-08 16:26:01","0","1215","<p>I want to display the icons in grid view and also text heading for that icon just below it.can some one help me out.</p>","361579","","","","","2012-08-10 10:53:31","Displaying both text and icons in gridview","<android>","2","0","","",""
"2999285","1","","","2010-06-08 16:29:53","8","17502","<p>I am running CentOS 5.5 x86_64 with JDK 1.6, Eclipse Galileo, and the 0.9.7 ADT is installed; however, after installation, the Android project type is not available. I have checked in the installed packages list and it is installed. Anybody encounter this problem before? Could it be due to my use of the 64-bit java VM that is installed on my system?</p>","361584","","4249","","2010-06-08 16:38:46","2012-10-25 19:54:22","No Android project type in Eclipse->File->New-Project","<java><android><eclipse><adt>","6","0","1","",""
"2999310","1","","","2010-06-08 16:32:14","0","123","<p>where to add the new GUI xml pages in android project, say I have a welcome screen in res>layout>main.xml layout and when user clicks ""next"" button, it has to load up a new page with username and password GUI. any help will be appreciated</p>","357349","","","","","2010-06-08 16:39:21","Android xml pages","<android><gui>","1","0","","",""
"2999360","1","","","2010-06-08 16:37:32","1","2327","<p>I'm trying to write a program that can read the signal strength of a bluetooth device linked to my android 2.0 handset. Doesnt seem like android exposes anyway to get the RSSI unless it is during discovery. Is there any other way to get the signal strength of the device after the device has been detected? I read of a way to do it using NDK to access the underlying BlueZ API, but I dont know how to use that. Any help would be appreciated. </p>","361592","","","","","2011-02-10 11:49:13","How to get bluetooth RSSI on android after discovery","<android><bluetooth><rssi>","1","0","","",""
"2999848","1","","","2010-06-08 17:48:21","2","2732","<p>In my application I use SoftReference to cache images, it is working fine with active internet connection. And now I need to cache images, so I could use it in offline mode.</p><p>What is the best way to implement it? Use complex solution with SoftReference and database? or maybe SoftReference and local storage (sdcard)? </p><p>I would appreciate your advices. Thanks.         </p>","331565","","","","","2012-03-12 14:23:00","What is the best practice to cache images on Android?","<android><database><image><caching>","2","0","1","",""
"2999855","1","3000515","","2010-06-08 17:49:03","1","2538","<p>I cannot for the life of me figure out why I'm getting a NullPointerException.</p><p>When a user clicks on a particular image, a dialog window is supposed to pop-up and display a larger version of said image:</p><pre><code>private OnClickListener coverListener = new OnClickListener() { public void onClick(View v)  {   showDialog(DIALOG_COVER); }};</code></pre><p>DIALOG_COVER is set to = 0.</p><p>The associated onCreateDialog looks like this:</p><pre><code>protected Dialog onCreateDialog(int id) { Dialog dialog; switch(id)  {  case DIALOG_COVER:   dialog = new Dialog(mContext);   dialog.setContentView(R.layout.cover_dialog);   dialog.setTitle(book.getTitle());   ImageView coverLarge = (ImageView)findViewById(R.id.coverLarge);   coverLarge.setImageBitmap(book.getCover());      break;  default:      dialog = null; } return dialog;}</code></pre><p>For reference, this is cover_dialog.xml:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""          android:id=""@+id/coverDialog""          android:orientation=""horizontal""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dp""&gt;&lt;ImageView android:id=""@+id/coverLarge""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""           android:scaleType=""fitStart""           /&gt;&lt;/LinearLayout&gt;</code></pre><p>Now, when the image previously described is clicked, the application immediately crashes and throws the following error through LogCat:</p><pre><code>06-08 13:29:17.727: ERROR/AndroidRuntime(2220): Uncaught handler: thread main exiting     due to uncaught exception 06-08 13:29:17.757: ERROR/AndroidRuntime(2220): java.lang.NullPointerException06-08 13:29:17.757: ERROR/AndroidRuntime(2220):     at org.kylehughes.android.brarian.AndroidBrarian.onCreateDialog(AndroidBrarian.java:259)</code></pre><p>The line in question refers to this line inside of onCreateDialog:</p><pre><code>coverLarge.setImageBitmap(book.getCover());</code></pre><p>Basically, I don't get why coverLarge is null at that point. Any help would be much appreciated.</p>","205910","","105224","","2010-06-08 17:55:25","2010-06-08 19:20:38","Android Custom Dialog NullPointerException","<java><android><dialog><nullpointerexception>","4","0","1","",""
"2999866","1","2999943","","2010-06-08 17:50:43","31","29499","<p>Can you please tell me how can I create an android menu item using android setting icon?</p><p>Thank you.</p>","286802","","","","","2013-07-29 03:53:21","How can I create an android menu item using android setting icon","<android>","2","1","10","",""
"2999907","1","","","2010-06-08 17:55:50","4","1282","<p>I have a weather image I would like to use as an overlay in the google maps android api.  I would like to achieve the same result that I get from using GroundOverlay in KML files, such as</p><pre><code>&lt;GroundOverlay&gt;    &lt;name&gt;myimage&lt;/name&gt;    &lt;Icon&gt;    &lt;href&gt;myimage.png&lt;/href&gt;    &lt;viewBoundScale&gt;0.75&lt;/viewBoundScale&gt;  &lt;/Icon&gt;  &lt;LatLonBox&gt;    &lt;north&gt;75.6088&lt;/north&gt;    &lt;south&gt;5.0121&lt;/south&gt;    &lt;east&gt;182.2805&lt;/east&gt;    &lt;west&gt;120.6795&lt;/west&gt;  &lt;/LatLonBox&gt;&lt;/GroundOverlay&gt;</code></pre><p>The above will ensure that the 4 corners of my image stay anchored to the 4 lat/long points listed, regardless of scrolling, zooming etc..</p><p>Is there a way to accomplish this using the google api/maps provided for android?</p>","361672","","","","","2011-08-26 16:09:14","Does android maps support ground overlay?","<android><android-maps>","2","1","3","",""
"2999945","1","3000039","","2010-06-08 18:00:28","3","15422","<p>I've been searching the web for a way to do this for about a week now, and I just can't seem to figure it out.</p><p>I'm trying to implement an app that my college can use to allow users to log in to various services on the campus with ease. The way it works currently is they go to an online portal, select which service they want, fill in their user name and pwd, and click login. The form data is sent via post (it includes several hidden values as well as just the user name and pwd) to the corresponding login script which then signs them in and loads the service.</p><p>I've been trying to come at the problem in two ways. I first tried a WebView, but it doesn't seem to want to support all of the html that normally makes this form work. I get all of the elements I need, fields for user and pwd as well as a login button, but clicking the button doesn't do anything. I wondered if I needed to add an onclick handler for it, but I can't see how as the button is implemented in the html of the webview not using a separate android element.</p><p>The other possibility was using the xml widgets to create the form in a nice relative layout, which seems to load faster and looks better on the android screen. I used EditText fields for the input, a spinner widget for the service select, and the button widget for the login. I know how to make the onclick and item select handlers for the button and spinner, respectively, but I can't figure out how to send that data via POST in an intent that would then launch a browser. I can do an intent with the action url, but can't get the POST data to feed into it.</p><p>So here is what I have right now...</p><pre><code>HttpParams params = new BasicHttpParams();HttpClient client = new DefaultHttpClient(params);HttpPost post = new HttpPost(action);String endResult = null;try {post.setEntity(new UrlEncodedFormEntity(myList));} catch (UnsupportedEncodingException e) {// TODO Auto-generated catch blocke.printStackTrace();} try {String response = client.execute(post, new BasicResponseHandler());endResult = response;} catch (ClientProtocolException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}  </code></pre><p>So my question now... is how do I take the endResult screen, which should be the page returned after I logged in to my service, and display it in a browser?</p>","361675","","361675","","2010-06-09 03:42:31","2014-01-30 12:31:09","Submit form with POST data in Android app","<android><forms><post><android-intent>","2","1","5","",""
"3000029","1","3000069","","2010-06-08 18:12:46","1","574","<p>I have two resources file in res/values directory: string.xml and names.xml</p><p>how can I retreive all resources from names.xml only</p><p>the method </p><pre><code>Field[] x=R.string.class.getFields();</code></pre><p>retrieves resources from both files.</p><p>how can this be acheived</p><p>thanks</p>","235123","","958370","","2012-02-04 17:55:03","2012-02-04 17:55:03","How to get string resources from a certain file?","<android><android-resources>","1","0","","",""
"3000065","1","3000159","","2010-06-08 18:17:04","1","5499","<p>I would like to arrange the menu items in my app so that one item appears in its own line, and  the other 3 items appear below it. I know that this is possible because i have seen apps do it. I tried writing a menu xml with linear layouts to arrange the items, but this doesnt work. I have also tried putting them in different groups, but I had no luck with that either. </p><p>I know that this is possible: i have seen it done.</p><p>Anyone have any ideas?</p>","339428","","82187","","2011-01-28 17:47:06","2011-03-25 14:55:17","Android: how do i custom arrange menu items?","<android><menu>","1","3","1","",""
"3000103","1","3694111","","2010-06-08 18:21:16","3","2008","<p>I'm trying to get and display a live .kml file from maps.google.com using</p><pre><code>Uri.parse(""geo:0,0?q=http://maps.google.com/maps/ms?ie=UTF8&amp;hl=en&amp;msa=0&amp;msid=104538451667315338387.0004887d133ba2ab6eec9&amp;ll=42.029611,-93.646109&amp;spn=0.011396,0.022724&amp;z=16l&amp;output=kml"");Intent mapIntent = new Intent(Intent.ACTION_VIEW, mapUri);startActivity(Intent.createChooser(mapIntent, ""lol""));</code></pre><p>However after opening the mapview I get a notification saying ""The community map could not be displayed because it contains errors""</p><p>I only get this error if I download the .kml directly from maps.google. If I copy the exact same link into my address bar, download the .kml file, and upload it elsewhere then it works fine. I would like to be able to get the maps directly from Google that way I can make a change and it would be immediately reflected to my users.</p>","192549","","192549","","2010-09-12 07:37:11","2010-12-15 20:13:22","Android: Getting an invalid KML file from google maps","<android><google-maps><kml><android-maps>","4","0","","",""
"3000131","1","3000156","","2010-06-08 18:25:11","41","24561","<p>I'm starting to learn the android NDK and I've instantly come up against a problem.</p><p>I'e built the tool chain (which took a LOT longer than I was expecting!!) and I've compiled the C++ code with no problems and now I'm trying to build the java code.</p><p>Instantly I come up against a problem.  There is a file ""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=""match_parent""    android:layout_height=""match_parent""    &gt;&lt;TextView      android:layout_width=""match_parent""     android:layout_height=""wrap_content""     android:text=""Hello World, DemoActivity""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>and I get the following errors:</p><pre><code>Description Resource Path Location Typeerror: Error: String types not allowed (at 'layout_height' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problemerror: Error: String types not allowed (at 'layout_height' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problemerror: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problemerror: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 7 Android AAPT Problemerror: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 7 Android AAPT Problem</code></pre><p>So I can see the problem lies in the fact that these ""match_parent"" strings are in there.  Anyone know how to fix this?</p>","131140","","192373","","2012-09-20 07:19:29","2012-09-20 07:19:29","Android NDK r4 san-angeles problem","<java><android><xml>","1","1","3","",""
"3000197","1","3000715","","2010-06-08 18:34:31","4","6402","<p>Hello I am looking for personalized screen locker for android phones, instead of typing numbers , user can flex fingers in a particular pattern and unlock the screen.Any pointers/ideas are appreciated.</p>","357349","","234938","","2010-06-08 19:13:59","2012-06-14 06:35:43","Personalized lock screen for Android","<android><screen><locking>","1","2","4","",""
"3000720","1","3001137","","2010-06-08 19:48:15","1","276","<p>Here's my story.</p><ol><li>I downloaded the <a href=""http://developer.android.com/resources/tutorials/notepad/index.html"" rel=""nofollow"">NotePad tutorial</a> project exercise files.  </li><li>I created an Android project based on the tutorial files for the completed exercise (located in the Notepadv3Solution folder)</li><li>I run the project and bellow is a screenshot of what appears:</li></ol><p><img src=""http://i47.tinypic.com/2ebg02h.jpg"" alt=""alt text""></p><p>It doesn't seem to be working properly.</p><p>Could it be because I'm on version 2.2?</p>","200145","","200145","","2010-06-09 04:10:04","2010-06-09 04:10:04","Is the Android NotePad tutorial compatible with version 2 of Android?","<android>","1","1","","",""
"3000764","1","","","2010-06-08 19:54:28","3","880","<p>I have an android list activity that is backed by a database cursor through a SimpleCursorAdapter.</p><p>i have one constraint that need to be modify the cursor data. i cannot add the constraint in query.</p><p>How should I be update cursor ?</p>","361757","","","","","2010-06-08 21:53:00","updating android simplecursoradapter cursor","<android>","1","1","","",""
"3000975","1","3001296","","2010-06-08 20:20:38","5","7242","<p>In my application, after enough clicking around, I get this error:</p><pre><code>06-08 19:47:59.967: ERROR/AndroidRuntime(2429): java.lang.RuntimeException: Unable to pause activity {com.MYAPP.app/com.MYAPP.app.MainActivity}: android.database.StaleDataException: Access closed cursor</code></pre><p>What I have is a Tab Activity (my MainActivity), which has a ListActivity as the contents for each tab. Inside the onCreate for each ListActivity I get a cursor that represents the data to be displayed in that list.</p><p>The onListItemClick for each list also creates another activity, so clicking on an item in the list will show more information about that item in a new screen. It's inconsistent, but after enough clicking into these new activities, or going back to the ListView from a new activity, the program crashes.</p><p>In searching around for a solution to my problem, I did stumble upon registerDataSetObserver, but it doesn't seem to be the whole answer. I am also having trouble finding documentation on it, so I'm not sure I fully understand it. I have a custom ListAdapter that both my ListViews use and have called registerDataSetObservers on the cursors there.</p><p>I have attached the relevant code from one of my ListActivities and from my custom ListAdapter class.</p><hr><p>The ListActivity. I have two of these, almost identical, except they both have different cursors created from different database queries:</p><pre><code>import com.MYAPP.app.listmanager.DeviceListAdapter;public class AllSensorsActivity extends ListActivity{    private DeviceListAdapter AllList;    private DbManager db;    protected Cursor AllCur;    protected Cursor AllSensors;    private static final String TAG = ""AllSensorsActivity"";                         @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        Log.e(TAG, ""Calling All onCreate"");        db = new DbManager(this);        db.open();        AllCur = db.fetchAllDevices();        startManagingCursor(AllCur);                                                    AllSensors = db.fetchAllSensors();        startManagingCursor(AllSensors);        AllList = new DeviceListAdapter(this, AllCur, AllSensors);        setListAdapter(AllList);    }    @Override    protected void onListItemClick(ListView l, View v, int position, long id){        String device_name = (String) ((DeviceListAdapter)getListAdapter()).getItem(position);        String sensor_string = ((DeviceListAdapter)getListAdapter()).getSensors(id);        Intent i = new Intent(this, SensorActivity.class);        Bundle bundle = new Bundle();        bundle.putString(""NAME"", device_name);        i.putExtras(bundle);        bundle.putString(""SENSORS"", sensor_string);        i.putExtras(bundle);        this.startActivity(i);    }</code></pre><p>The custom ListAdapter:</p><pre><code>public class DeviceListAdapter extends BaseAdapter {    private static final String TAG = ""DeviceListAdapter"";    private Context mContext;    private Cursor mSensors;    private Cursor mDevices;     protected MyDataSetObserver sensors_observer;    protected MyDataSetObserver devices_observer;    public DeviceListAdapter(Context context, Cursor devices, Cursor sensors){          mContext = context;        mDevices = devices;        mSensors = sensors;        sensors_observer = new MyDataSetObserver();        mSensors.registerDataSetObserver(sensors_observer);        devices_observer = new MyDataSetObserver();        mDevices.registerDataSetObserver(devices_observer);    }    // ... more functions and stuff that are not relevant go down here...}private class MyDataSetObserver extends DataSetObserver {    public void onChanged(){        Log.e(TAG, ""CHANGED CURSOR!"");    }    public void onInvalidated(){        Log.e(TAG, ""INVALIDATED CURSOR!"");    }}</code></pre><p>Should I just have MyDataSetObserver catch the exception and move on? I'd like a more robust solution than that if possible. Or is there some other way I could rearrange my program so that the staleDataException doesn't occur (as often)? I believe that it is happening because I am launching the new activity in my onListItemClick.</p>","259645","","","","","2010-06-08 21:06:05","StaleDataException: access closed cursor","<android><cursor>","1","0","2","",""
"3001088","1","3013578","","2010-06-08 20:37:24","0","1581","<p>I'm guessing this will be such a newbee question but I hit a wall and...</p><p>I am running the <a href=""http://jwebsocket.org"" rel=""nofollow"">jWebSocket</a> stand-alone server. For a client I am using <a href=""http://code.google.com/p/weberknecht/"" rel=""nofollow"">Weberknecht</a> And Eclipse is my IDE of choice.</p><p>Now, when I start the server and run the Weberknecht client like a normal Java application I get a connection. Granted, the connection is quickly dropped because the handshake needs to be configured but at least the server shows me a connection was attempted.</p><p>However, when I use the exact same code in my hello world Android app I get nothing :(I am also not seeing any console outputs even thought I used both Log.i and Log.v</p><pre><code>Log.i(TAG, ""YEI! connectToWS 1!"");Log.v(TAG, ""YEI! connectToWS 1!"");</code></pre><p>Maybe I am calling the connect method in the wrong place?</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    connectToWS();...</code></pre>","271873","","646382","","2012-06-03 11:54:21","2012-06-03 11:54:21","Android Socket Connection","<android><sockets>","2","0","","",""
"3001179","1","3001342","","2010-06-08 20:48:33","0","4837","<p>The sample I'm referring to is: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">CameraPreview</a>.</p><p>The program simply force closes upon start up. I've also tried other camera demos that have the same problem.</p><p>I'm trying to run the samples on my Nexus One and the emulator with the same problem on both. I'm not even sure if the emulator should be able to run them or not.</p><p>Based on LogCat, the error is:</p><pre><code>06-08 16:39:10.483: ERROR/AndroidRuntime(6726): Uncaught handler: thread main exiting due to uncaught exception06-08 16:39:10.494: ERROR/AndroidRuntime(6726): java.lang.RuntimeException: Fail to connect to camera service06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.native_setup(Native Method)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.&lt;init&gt;(Camera.java:110)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.open(Camera.java:90)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.example.android.apis.graphics.Preview.surfaceCreated(CameraPreview.java:69)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.SurfaceView.updateWindow(SurfaceView.java:454)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.View.draw(View.java:6557)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.widget.FrameLayout.draw(FrameLayout.java:352)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.View.draw(View.java:6557)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.widget.FrameLayout.draw(FrameLayout.java:352)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.draw(ViewRoot.java:1349)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.os.Handler.dispatchMessage(Handler.java:99)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.os.Looper.loop(Looper.java:123)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at java.lang.reflect.Method.invokeNative(Native Method)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at java.lang.reflect.Method.invoke(Method.java:521)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>All I did to try out the sample was create a new Android 2.1update1 Project, named everything according to the supplied Java file, copied the Java file from the URL to the CameraPreview.java file, then run it. Am I supposed to do anything else?</p><p>Any help would be appreciated. Thanks in advance.</p>","359850","","","","","2012-01-02 08:44:43","Cannot run Android ""Camera Preview"" sample","<android>","1","0","","",""
"3001255","1","3021933","","2010-06-08 20:59:20","1","877","<p>Hallo all,</p><p>I have a ListView, which contains an EditText in each of it's row. I also have an Array.The length of the Array==the Nr of the rows in the ListView. </p><p>I want to store the user input (the text in the EditText) to the Arrray. E.g, if i type some text in the EditText in the first row of the ListView, i want the text to be stored in Array[0]. But how can i detect to which row the EditText belongs to? I can detect the possition of the row if the row contains a RadioGroup, but not a EditText.</p><p>What if i first type some text in the EditText and sometime later i want to update mein Input? How can i update it?</p><p>Thanks a lot!</p>","353857","","","","","2011-11-11 16:19:50","How to make a EditText work correctly in a ListView?","<android><listview><edittext>","2","0","","",""
"3001268","1","3006908","","2010-06-08 21:01:12","0","547","<p>I have the following XML code, which I got by a UPnP device and like to get the res value - the RTSP URL. In this case rtsp://10.42.0.103:554/live.sdp</p><p>How can I do this? I heard that Android has some built-in support for reading XML. Is that true?</p><pre><code>&lt;DIDL-Lite xmlns=""urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:upnp=""urn:schemas-upnp-org:metadata-1-0/upnp/""&gt;&lt;item id=""11"" parentID=""1"" restricted=""1""&gt;&lt;dc:title&gt;Network Camera Stream 1&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;res protocolInfo=""rtsp-rtp-udp:*:video/mpeg4-generic:*"" resolution=""640x480""&gt;rtsp://10.42.0.103:554/live.sdp&lt;/res&gt;&lt;/item&gt;&lt;item id=""12"" parentID=""1"" restricted=""1""&gt;&lt;dc:title&gt;Network Camera Stream 2&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;res protocolInfo=""rtsp-rtp-udp:*:video/mpeg4-generic:*"" resolution=""176x144""&gt;rtsp://10.42.0.103:554/live2.sdp&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</code></pre>","331556","","243782","","2010-06-08 21:02:52","2010-06-09 14:46:00","Android getting XML values","<java><xml><android>","2","0","","",""
"3001417","1","3018885","","2010-06-08 21:25:22","-3","1039","<p>I have three xml layout pages, 1.welcome screen (with ""next >>"" button) and clicking on next button should bring second page 2.welcome page with (""register"" button) this takes to another window/page 3. with name and other details. I have all the three pages GUI built i.e the xml file , how to put them all together and get them working.</p>","357349","","1228","","2013-08-15 14:45:43","2013-08-15 14:45:43","load new page-Android XML","<android>","1","0","","",""
"3001483","1","3001546","","2010-06-08 21:33:46","7","7474","<p>I have learned that when using <code>android:entries</code> with a <code>ListView</code>, it uses <code>android.R.layout.simple_list_item_1</code> as the layout for a list item and <code>android.R.id.text1</code> as the ID of the TextView inside that layout. Please, correct me if I'm wrong.</p><p>Knowing this, I wanted to create my own adapter but use the same layout resources, in order to provide UI consistency with the platform. Thus, I tried the following:</p><pre><code>mAdapter = new SimpleCursorAdapter(    getApplicationContext(),    android.R.layout.simple_list_item_1,    mSites,    new String[] { SitesDatabase.KEY_SITE },    new int[] { android.R.id.text1 });</code></pre><p>Unfortunately, because I am using a light theme (I have <code>android:theme=""@android:style/Theme.Light""</code> in my <code>&lt;application&gt;</code>), the list items appear with white text, making them unreadable.</p><p>However, when using <code>android:entries</code> to specify a static list of items, the items appear correctly, with black text color.</p><p>What am I doing wrong? How can I make my dynamic adapter use the standard layout but work with a light theme?</p>","180784","","21234","","2010-06-25 13:19:36","2013-04-11 17:08:50","Use android.R.layout.simple_list_item_1 with a light theme","<android><listview><themes>","2","0","2","",""
"3001494","1","3001567","","2010-06-08 21:36:24","0","139","<p>I know that when a row is selected in list view, the function onListItemClick() is called.</p><p>I want to know which function is called when a row in ListView is highlighted(not selected).</p>","328302","","","","","2010-06-08 21:51:21","Calling a function when a row is highlighted in Listview","<android>","1","0","","",""
"3001706","1","3005937","","2010-06-08 22:15:48","0","1599","<p>I want to create an app that has pictures Ive taken or created and allows users to browse through them.  Ive got how to use buttons but I just cant figure out how to store the pictures within the apk file that gets uploaded to market. Im really new to android development and Ive been through some tutorials and have a couple books but for right now Im stuck and would greatly appreciate a push in the right direction. I know it should be easy to do but I just cant find anything describing what Im trying to do.</p>","607013","","","","","2010-06-09 12:56:41","How to store pictures within an app and call them to screen?","<android>","1","1","","",""
"3002094","1","3009173","","2010-06-08 23:30:36","7","8926","<p>I need to rotate an ImageView by a few degrees.  I'm doing this by subclassing ImageView and overloading <code>onDraw()</code></p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    canvas.save();    canvas.scale(0.92f,0.92f);    canvas.translate(14, 0);    canvas.rotate(1,0,0);    super.onDraw(canvas);    canvas.restore();}</code></pre><p>The problem is that the image that results shows a bunch of jaggies.</p><p><img src=""http://img.skitch.com/20100608-gmdy4sexsm1c71di9rgiktdjhu.png""></p><p>How can I antialias an ImageView that I need to rotate in order to eliminate jaggies?  Is there a better way to do this?</p>","82156","","","","","2012-08-15 09:33:56","How to rotate a drawable with anti-aliasing enabled","<android><image><rotation><imageview>","4","0","6","",""
"3002222","1","3002465","","2010-06-08 23:55:00","1","170","<p>I have a database with which I wish to expose data with a ContentProvider. However, it is important that all the colums are not exposed, and also they should be renamed. Is there any good way of doing this? I was thinking maybe some kind of proxy-cursor which takes a cursor and translates its columns to the desired ones, and calls to close and the like would just be replayed to the original cursor. Does something like this exist, or would it be hard to make?</p>","213323","","","","","2010-06-09 01:03:52","Android Proxy Cursor","<android><database><cursor><proxy-classes>","1","0","","",""
"3002523","1","","","2010-06-09 01:18:08","0","718","<p>Lets say I have 1 - 1,000 in a list and I click on 250. When I push the back button I want to go back to 250 not all the way back up to 1.</p><p>Is this possible?</p>","282475","","282475","","2010-06-09 02:07:16","2010-06-09 02:07:16","Android listadapter Anchor","<android><listadapter>","1","2","","",""
"3002537","1","3039576","","2010-06-09 01:22:08","4","4553","<p>I'm new in Android development and I have the next question/problem.</p><p>I'm playing around with the MediaRecorder class to record just audio from the microphone. I'm following the steps indicated in the official site: <a href=""http://developer.android.com/reference/android/media/MediaRecorder.html"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaRecorder.html</a></p><p>So I have a method that initializes and configure the MediaRecorder object in order to start recording. Here you have the code:</p><pre><code>        this.mr = new MediaRecorder();        this.mr.setAudioSource(MediaRecorder.AudioSource.MIC);        this.mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        this.mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);        this.mr.setOutputFile(this.path + this.fileName);        try {            this.mr.prepare();        } catch (IllegalStateException e) {            Log.d(""Syso"", e.toString());            e.printStackTrace();        } catch (IOException e) {            Log.d(""Syso"", e.toString());            e.printStackTrace();        }</code></pre><p>When I execute this code in the simulator, thanks to logcat, I can see that the method setAudioSource(MediaRecorder.AudioSource.MIC) gives the next error (with the tag audio_ipunt) when it is called:</p><pre><code>ERROR/audio_input(34): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_valueERROR/audio_input(34): VerifyAndSetParameter failed</code></pre><p>And then when the method prepare() is called, I get the another error again:</p><pre><code>ERROR/PVOMXEncNode(34): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle </code></pre><p>If I start to record bycalling the method start()... I get lots of messages saying:</p><pre><code>AudioFlinger(34):RecordThread: buffer overflow</code></pre><p>Then...after stop and release,.... I can see that a file has been created, but it doesn't seem that it been well recorderd. Anway, if i try this in a real device I can record with no problems, but I CAN'T play what I just recorded.</p><p>I gues that the key is in these errors that I've mentioned before. How can I fix them? Any suggestion or help??</p><p>Thanks in advanced!!</p>","353261","","","","","2013-01-26 23:03:03","Problems with MediaRecorder class setting audio source - setAudioSource() - unsupported parameter","<android><audio><audio-recording>","3","1","3","",""
"3002566","1","3002655","","2010-06-09 01:32:00","24","2978","<p>Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to program for android, or is it java only?</p><p><a href=""http://stackoverflow.com/questions/670987/running-java-bytecode-on-the-android-sun-jvm-on-top-of-dalvikvm"">There was a similar question asked over a year ago</a> but I wasn't sure if there'd been any change since then.</p>","9859","","","","","2010-06-10 01:26:50","Can I program for android using any JVM language?","<android><clojure><jvm><jruby><jython>","4","1","3","",""
"3002633","1","3005117","","2010-06-09 01:47:14","0","1419","<p>I have a SQLite database, and several tables within that datbase. I am developing a DBAdapter for each table within the database. (reference Reto Meier's Professional Android 2 Application Development, Listing 7.1).</p><p>I am using the adb shell to interface with the database from the command line and see that the database is being populated as I expect. Occasionally, I want to drop a table so that I can ensure it's being built properly, from scratch.</p><p>The problem is that SQLiteOpenHelper only checks to see if the database exists. Is there a typical solution to writing a helper to also see that the table(s) exists? Basically once I drop a table, the helper checks to see that the database exists and assumes all is well.</p><p>Also, the CREATE_DATABASE string used in the reference above only creates the one table. Should I consider using the DBAdapter for an adapter to ALL of my tables? That doesn't seem as clean to me.</p><p><a href=""http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-2-Application-Development.productCd-0470565527,descCd-DOWNLOAD.html"" rel=""nofollow"">Reference Material</a></p>","312176","","312176","","2010-06-09 16:53:35","2011-05-28 08:10:11","Android and SQLite using the SQLiteOpenHelper","<android><sqlite><adapter><helper>","2","0","","",""
"3002648","1","","","2010-06-09 01:50:29","1","735","<p>Applications can have any number of launchable activities.  I know how to get the list of these activities via PackageManager.</p><p>Is there a way to determine which activities can be launched via startActivity?</p><p>For example, the Documents To Go app has different activities that will start Word, Excel, Powerpoint, PDF, etc...  I am able to launch all o these just fine.</p><p>However, it also contains some activities that I am not able to launch with startActivity... If I attempt to do this I get a SecurityException.</p><p>I want to be able to determine which activities I can safely launch and which I cannot so I only present the user with a list of activities that I can safely launch from within my application...</p><p>Is this possible?</p>","249412","","","","","2011-03-21 15:37:58","Determine if a specific activity in an application can be launched","<android><activity><launch><securityexception>","2","0","1","",""
"3002722","1","3035589","","2010-06-09 02:18:23","1","4378","<p>I'm just getting started developing for Android and I'm running into a weird problem.First off, I'm running Eclipse for Java devs v3.5.2 with the Android 2.1 SDK installed.</p><p>Basically, whenever I do just about anything the ""gen"" (R.java, etc.) folder will just disappear from the project.  I'm seen some people online say that it was still on the drive, just gone from the project listing in Eclipse, but in my case it is literally and completely gone.</p><p>The only fix I've found is that if I refresh, then try to build, it gives an error and ""gen"" shows up in the project view (though it's not on the disk), then delete it from within the project, then Rebuild All and it will say that it cannot find it and is recreating it.</p><p>Problem is, I have to do this <strong>every</strong> single time I want to build.</p><p>There's got to be a fix for this.</p>","194","","","","","2010-06-16 08:25:24","Gen folder disappearing in Eclipse Android project","<java><android><eclipse>","2","0","1","",""
"3002735","1","","","2010-06-09 02:23:03","4","2221","<p>I'm working on an application that needs to perform recognition algorithms on raw PCM audio captured from the microphone. On all Android devices I've tested, the PCM data is usable (i.e., raw audio data.) This is not the case for the new Sprint EVO.</p><p>The Sprint EVO has AGC (Auto Gain Control) on the mic, which destroys the data such that our recognition algorithms no longer work.</p><p>I believe this is a feature that HTC added to the OS for this device (and possibly future devices.) I've tested our application on a few other devices using the same OS version (2.1) and these other devices behave normally.</p><p>Unfortunately, HTC has not yet posted the code used on this device. I expect that I may have to use JNI in order to bypass this for this specific device, and I'm willing to do this, but without access to the HTC source, I wouldn't know where to begin.</p><p>There is no way to reverse the effects of AGC, so I'm stuck trying to work around it.</p><p>More specific information:</p><p>I'm using AudioRecorder in order to get access to the raw PCM data. I've tried a few programs that use MediaRecorder to record AMR data and those recordings also exhibit the same AGC properties.</p><p>One thing I have yet to try, is to write my own routines to use MediaRecorder and use setAudioSource(AudioSource.VOICE_RECOGNITION). The only documentation I can find on this flag is from the Android reference, which simply states ""Microphone audio source tuned for voice recognition if available, behaves like DEFAULT  otherwise."" This may be what I need, but would require the extra step of decoding the AMR data in order to get the PCM data (which I'll do if I have to.)</p><p>If anybody knows anything about this new ""feature"", any information would be greatly appreciated. Specifically, my life would be much better if I had the answers to any of the following questions:</p><ol><li>Is this new feature specific to HTC?</li><li>When will HTC release their codebase for the EVO/Supersonic?</li><li>Has anybody else run into this and found a way to work around the issue?</li><li>Does AudioSource.VOICE_RECOGNITION actually prevent AGC?</li><li>Does the existence of AudioSource.VOICE_RECOGNITION indicate that this is expected to be more common in future devices and this flag is a provision for bypassing it?</li></ol><p>Any other clues, hints, tips would be greatly appreciated.</p>","361982","","","","","2013-02-28 09:28:06","How do you disable AGC on the HTC EVO (Supersonic)?","<android><audio-recording>","2","0","1","",""
"3002861","1","3002983","","2010-06-09 03:04:24","1","3064","<p>Why I can't implement OnKeyListener with parameter View such as on <a href=""http://developer.android.com/reference/android/view/View.OnKeyListener.html#onKey%28android.view.View,%20int,%20android.view.KeyEvent%29"" rel=""nofollow"">example</a> where parameters are <strong>(View  v, int keyCode, KeyEvent  event)</strong> I'm forced to use parameters (<strong>DialogInterface dialog, int keyCode, KeyEvent event)</strong> but not the View as I want.</p>","346665","","","","","2010-06-09 03:54:47","Android OnKeyListener","<android><listener>","1","0","","",""
"3002886","1","","","2010-06-09 03:15:50","23","36164","<p>I'm working on a Push Notifications library for Android (<a href=""http://deaconproject.org/"">http://deaconproject.org/</a>) that needs to take action if network connectivity is interrupted or changed - namely, it needs to re-initiate a server connection or pause its operation until network connectivity is available. This seems to work fine using and Android BroadcastReceiver for ""android.net.ConnectivityManager.CONNECTIVITY_ACTION"".</p><p>My problem is in testing the library - I would like to automatically test the library's response to a broken network connection, or a transition from 3G to WiFi, under various configuration conditions. The problem is, I don't want to sit with the emulator and hit F8 all day.</p><p>Is there a way to programmatically manipulate network connections on Android from within a jUnit test without resorting to toggling Airplane Mode? I've already tried issuing commands to the emulator via the console, manipulating the GSM mode, etc, but while the phone state changes on the display, the Internet connection remains up.</p>","263607","","263607","","2010-06-22 01:11:17","2014-03-22 15:36:37","How to disable/enable network, switch to Wifi in Android emulator?","<android><unit-testing><testing><networking>","6","4","7","",""
"3003019","1","","","2010-06-09 04:02:31","0","1689","<p>How can I make an app or maybe service that looks like (Nexus One touch buttons) for the navigation keys (Home, menu,Back, Search)</p><p>The buttons should always be visibly and always stay on top and send the command to the app thats running.</p><p>Someone have ideas and sample codes how to do that?</p><p>*I see an app with name (Smart Taskmanager) wich always detect when you touch the right side of the screen and then detect when you slide the finger to left.</p><p>So I think its possible, with this function I think its possible to implementate the code to simulate the (Home, Meny, Back, Search) buttons.</p><p>*I also see and test an app wich show a ""cracked display"" always ontop so that tecnic maybe shold be useful to always show the buttons/bitmanp on top.</p><p>Thoose function, to show the button and catch the ""touch event"" and send the event to the active program, thats what i dont can figure out how to do.</p>","362038","","331473","","2011-11-23 07:25:48","2011-11-23 07:25:48","Virtual/soft buttons for (Home, menu,Back, Search) always on top?","<android>","2","0","","",""
"3003062","1","","","2010-06-09 04:18:31","7","4515","<p>I have an activity with two <code>EditText</code>s. I am calling the <code>requestFocus</code> on the second <code>EditText</code> field since by default the focus goes to the first one. The focus appears to be in the second field (the second one gets the highlighted border), but if we try to enter any characters using the hardware keyboard the text appears in the first <code>EditText</code> control. Any ideas why it would be happening?</p>","345941","","385478","","2012-02-17 12:46:51","2014-04-04 12:35:21","Focus issue with multiple EditTexts","<android><focus><edittext>","3","2","","",""
"3003128","1","3003162","","2010-06-09 04:44:11","0","147","<p>Is there a way to test, from within an android app, if the device it's running on is actually using the Froyo JIT?</p><p>I ask because I know that 2.2 has a JIT, but we've already had a few test builds that seem to lack the JIT. So it's not a case where you can just test for the api version and be assured you've got the JIT.</p>","23866","","995926","","2012-05-05 13:32:12","2012-05-05 13:32:12","How can I tell reliably if my Android App is running on a device with JIT?","<android><android-2.2-froyo>","1","0","","",""
"3003140","1","","","2010-06-09 04:48:12","0","156","<p>I have my menu button bringing up a Settings option, which brings up numerous ListPreferences such as weight and various sizes for glasses (it's a BAC calculator app). I'll pick one example... weight will work.</p><p>Depending on how much you weigh it will affect your BAC. I have a int for Weight, set at 180. I would like someone to be able to go into the menu Settings, pick the ""Weight"" ListPreference, and choose between 100, 130, 150, 180, 210, 240, 270, and 300. I already have the numbers show up (all of the arrays have been created) and I can choose one, but it doesn't do anything because it's not linked up with the int Weight variable. How do I go about linking the information?</p>","359045","","359045","","2010-06-09 07:16:51","2010-06-09 07:35:57","How do I get a preference to correlate to a variable?","<android><arrays><menu><settings><preferences>","1","0","","",""
"3003141","1","3005181","","2010-06-09 04:48:48","1","1056","<p>I'm trying to add a ProgressBar to my row.xml view but I can't seem to make it work I keep getting</p><pre><code>06-09 12:44:44.802: ERROR/AndroidRuntime(1012): java.lang.IllegalStateException: android.widget.ProgressBar is not a  view that can be bounds by this SimpleAdapterArrayList arr = new ArrayList();HashMap map = new HashMap();map.put(""progress"", 10);arr.add(map);String [] fieldNames = {""progress""};int [] fieldIds = {R.id.progress};SimpleAdapter adapter = new SimpleAdapter(this, arr, R.layout.row, fieldNames, fieldIds);list = (ListView) findViewById(R.id.list);list.setAdapter(adapter);&lt;ProgressBar android:id=""@+id/progress""        style=""?android:attr/progressBarStyleHorizontal""        android:max=""100""        android:progress=""5""                android:layout_width=""fill_parent""        android:layout_height=""fill_parent""     /&gt;</code></pre><p>Does anyone have any idea what I'm missing?</p>","159856","","","","","2011-10-13 18:21:49","ProgressBar inside SimpleAdapter","<java><android>","2","0","","",""
"3003163","1","","","2010-06-09 04:54:42","0","274","<p>I have developed an application which stores reminders and to do list activities.Now i want the to do activity of the day, say 'collect laundry' to be displayed on my home screen.How can one approach that? (Must not be notifications)</p>","344768","","","","","2010-06-09 05:01:56","Sticky Notes : Displaying reminders on home screen","<android>","1","0","","",""
"3003271","1","3004524","","2010-06-09 05:27:08","0","1152","<p>referring  to the code example of mine </p><p><a href=""http://stackoverflow.com/questions/2997703/android-remote-image-getting-problem"">http://stackoverflow.com/questions/2997703/android-remote-image-getting-problem</a></p><p>how can i accommodate bigger resolution images in android.</p><p>when i try to display bigger resolution image from internet it give me null bitmap.</p><p>any one guide me whats the solution?</p><p>any help would be appreciated.</p>","249991","","","","","2010-06-09 09:23:30","how to display bigger resolution images in android?","<android>","1","0","","",""
"3003299","1","","","2010-06-09 05:34:45","0","538","<p>I'm new to android.I'm developing an app in which I'm trying to find north direction of my device anyone who can solve my problem it would be great full.thanks in advance..</p>","351599","","","","","2010-09-04 16:26:18","having problem in finding north of android device","<android>","2","0","","",""
"3003357","1","","","2010-06-09 05:51:00","1","952","<p>I am adding some jar files into my application. At the time of adding jar's in Eclipse it gives the “Internal Error” alert.</p><p>The error message dialog says:</p><hr><p>An out of memory error has occurred. Consult the ""Running Eclipse"" section of the read me file for information on preventing this kind of error in the future.You are recommended to exit the workbench.Subsequent errors may happen and may terminate the workbench without warning.See the .log file for more details.</p><p>How to solve this.Can anyone help me??</p>","324223","","","","","2010-06-09 06:02:55","How to solve the Problem in Eclipse IDE","<android>","1","2","","",""
"3003896","1","3004043","","2010-06-09 07:42:50","1","936","<p>I'm kinda noob to android so please bear with me. I'm currently developing app which uses tabs. My question now is: how to store values of variables so I can access them on the other tabs? I want to create something similar to sessions in PHP where I can save variables on one page and access on the other. Please can someone help me with this? There has to be an easy way to solve this. Thanks in advance!</p>","359656","","","","","2010-06-09 09:12:46","Storing variables for app access","<android><data-structures>","3","0","","",""
"3004124","1","3004606","","2010-06-09 08:24:11","5","1286","<p>I know that the function Location.getBearing() returns the bearing if any when in move</p><pre><code> public void onLocationChanged(Location lastLocation)  {     int bearing=lastLocation.getBearing()  }</code></pre><p>,so now bearing might be , 170 degrees..but, I'd like to know if there is anything in android that will give me the direction of the orientation (ex for 170 degrees , the direction is : SSE  south, south east)</p>","304866","","","","","2010-06-09 09:35:40","gps orientation in android","<android>","1","0","","",""
"3004515","1","3004542","","2010-06-09 09:21:57","214","133269","<p>I'm just wondering how to fire up an Intent to the phone's browser to Open an specific URL and display it.</p><p>Can someone please give a hint?</p><p>Is there also a way to pass coords directly to google maps to display?</p>","317301","","276052","","2011-09-19 12:01:55","2013-12-03 16:12:31","Android: Sending an Intent to Browser to open specific URL","<android><android-intent>","11","0","37","2013-10-20 23:52:22",""
"3004579","1","3004666","","2010-06-09 09:31:07","8","12937","<p>I need to download an image from the internet,in a different thread,<br>and then send that image object in the handler message, to the UI thread.  </p><p>I already have this:  </p><pre><code>...Message msg = Message.obtain();Bundle b = new Bundle();b.putParcelable(""MyObject"", (Parcelable) object);msg.setData(b);handler.sendMessage(msg);</code></pre><p>And when I receive this message,I want to extract the object:  </p><pre><code>...public void handleMessage(Message msg) {    super.handleMessage(msg);    MyObject objectRcvd = (MyObject) msg.getData().getParcelable(""IpTile"");    addToCache(ipTile);    mapView.invalidate();}</code></pre><p>But this is giving me:  </p><pre><code>...java.lang.ClassCastException...</code></pre><p>Can anyone help?    </p><p>And by the way, is this the most efficient way<br>to pass an object to the UI Thread?  </p><p>Thank you all!</p>","243376","","","","","2011-06-29 01:13:34","Put an object in Handler message","<android><handler><parcelable>","3","0","4","",""
"3004694","1","","","2010-06-09 09:49:16","0","424","<p>When I was originally learning about Android a few months ago I swear I read something about a way to immediately launch an activity when starting a task.  I am curious about this now because I need to display an intro screen on launch but I don't want the intro screen to be the root activity.  Does anyone know if there is something like this and if not what is the best way to handle an intro screen?</p><p>I tried googling for a few hours to find it but can't for the life of me.</p><p>Thanks for the help.</p>","354888","","","","","2010-06-09 11:08:24","Immediately starting a new activity from an activity","<android>","1","0","2","",""
"3004704","1","3004790","","2010-06-09 09:51:12","1","4323","<ul><li>I have an xml layout file which contains a few widgets including a Spinner</li><li>I want to display a list of strings in the spinner, the list is generated at runtime as a result of a function so it can not be in arrays.xml.</li></ul><p>I tried doing:</p><pre><code>String[] SpinnerItems = GetMyCustomItems();((Spinner)findViewById(R.id.MySpinner)).setAdapter(new ArrayAdapter&lt;String&gt;(getBaseContext(), android.R.layout.simple_list_item_1,SpinnerItems));</code></pre><p>But this crashes my application. </p><p>What would be the correct way to accomplish this?</p>","360646","","","","","2010-06-09 10:04:02","How can I display an array of Strings in a Spinner with Spinner.setAdapter?","<java><android><arrays><spinner>","1","1","","",""
"3004713","1","3005936","","2010-06-09 09:53:01","44","56358","<p>I know the absolute path of an image (say for eg, /sdcard/cats.jpg).  Is there any way to the content uri for this file ? </p><p>Actually in my code I download an image and save it at a particular location. In order to set the image in an ImageView currently I open the file using the path, get the bytes and create a bitmap and then set the bitmap in the ImageView. This is a very slow process, instead if I could get the content uri then I could very easily use the method    <code>ImageView.setImageUri(uri)</code></p>","266272","","1225413","","2013-02-12 17:18:05","2013-07-25 13:56:44","Get content uri from file path in android","<android><image>","4","2","10","",""
"3004771","1","","","2010-06-09 10:01:32","0","397","<p>I am working on Active sync in Android. I get ""java.lang.NullPointerException"" every time.</p><p>Logs shows:</p><p>Uncaught exception in EasSyncService java.lang.NullPointerException org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:453) 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) at com.android.exchange.EasSyncService.sendHttpClientPost(EasSyncService.java:787) at com.android.exchange.EasSyncService.sendPing(EasSyncService.java:721) at com.android.exchange.EasSyncService.runPingLoop(EasSyncService.java:1093) at com.android.exchange.EasSyncService.runAccountMailbox(EasSyncService.java:957) at com.android.exchange.EasSyncService.run(EasSyncService.java:1460) at java.lang.Thread.run(Thread.java:1096)</p><p>This error has been noticed in logs when I am sending http request using POST. Sending the ping command gives the above error some times.</p><p>I am not able to figure out why this error occurs and how it can be avoided . Kindly any one can give solution to above and solve the same .</p><p>Solution is appreciated well in advance.</p><p>Thanks,Ambika</p>","142521","","","","","2011-09-15 22:23:34","Android:Email: E/AbstractSyncService( 529): java.lang.NullPointerException occurs every time","<android><email><httprequest><sync><active>","1","2","","",""
"3004836","1","3005164","","2010-06-09 10:09:50","0","2372","<p>I am trying to create and use jar file in an Android project under Eclipse. I have tried various methods without any success. Here are the steps:</p><ul><li>Create jar file from the source files <strong>jar -cf lib.jar *.java</strong></li><li>Copy jar file to libs folder</li><li>Right click, Build Path->Add to Build path</li><li>Now, compiler gives unresolved symbols if I try to use a class from the jar file?</li></ul><p>Can someone please let me know correct method to create and use an external jar file for the Android project under eclipse.</p>","362293","","","","","2010-08-02 23:17:27","Creating and using custom JAR in Android project","<java><android><eclipse><jar>","1","0","","",""
"3004915","1","3026808","","2010-06-09 10:21:14","8","4855","<p>I've begun playing with the android NDK.  One of the things I've just learnt is about creating  an application.mk file to specify the armv7 abi.  </p><p>I'm building the san-angeles example with the following parameters.</p><pre><code>APP_MODULES      := sanangelesAPP_PROJECT_PATH := $(call my-dir)/../APP_OPTIM        := releaseAPP_ABI          := armeabi-v7a</code></pre><p>However this seems to run at exactly the same speed as it did before (ie badly).  Am I just GL limited and not CPU limited or is something wrong here?</p><p>I have noticed when I compile that I get the following command line options emitted:</p><pre><code>-march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb </code></pre><p>The thing that worries me there is the ""softfp"".  There IS mention of the v7 abi, the VFP fpu stuff and I'm guessing the ""thumb"" refers to the ""thumb-2"" instructions (Though I don't know what exactly these are).  However that ""softfp"" does concern me.  Shouldn't it be ""hardfp""?</p><p>Anyone got any ideas on these questions?  I think I'm probably about ready to start implementing some GL ES 2.0 code for my HTC Desire but I'd like to make sure I'm getting the best possible speed out of it :)</p><p>Cheers in advance!</p>","131140","","","","","2013-11-05 17:48:34","Getting hardware floating point with android NDK","<c++><android><android-ndk><armv7><android-ndk-r4>","1","0","3","",""
"3004939","1","5915686","","2010-06-09 10:24:05","4","1329","<p>I have a small problem. In my activity I have an edittext and a button. </p><p>Clicking on the button I am changing the inputtype of the edittext. </p><p>Now when I click button the input type changes but the cursor goes to the begining of the text in the edittext. </p><p>How can I retain the same position of the cursor or can I bring the cursor to the end of the text?</p><p>I tried <code>setSelection(edittextobj.getText().length())</code> but doesnot work how can I achive this....?</p>","348686","","592182","","2011-05-06 18:57:41","2011-08-09 12:49:04","Cursor postion comes to start of the edittext","<android><edittext>","2","0","","",""
"3004993","1","","","2010-06-09 10:33:15","0","895","<p>how do i change the position of my buttonin my screen dynamically???</p><p>example:</p><p>change the x position and my y position Can anyone help me?</p>","362307","","","","","2011-02-22 08:32:52","Changing the position of the button","<android>","1","1","","",""
"3005072","1","","","2010-06-09 10:46:38","1","1413","<p>I am using the code available here <a href=""http://davanum.wordpress.com/2009/12/04/android-%E2%80%93-videomusic-player-sample-take-2/"" rel=""nofollow"">VideoView Example</a>. This code runs properly on Android emulator 1.6 but not on 2.1. </p><p>In 2.1 it only plays the audio and not video. I have gone through several other threads where this issue has been mentioned. I will like to know whether this problem is limited to emulator only or the devices also have the same problem.</p><p>Regards</p><p>Sunil</p>","261566","","","","","2012-05-28 11:05:40","VideoView problem in 2.1 Emulator of Android?","<android><videoview>","2","1","","",""
"3005144","1","","","2010-06-09 10:59:16","1","2199","<p>I am consuming Twitter's REST APIs on Android to get a user's status timeline and for updating a user status. I am using Apache's HTTPClient class for this that is bundled with Android SDK. The user enters his/her credentials and I am saving it in String variables.</p><p>Everytime I need to invoke an API that require authentication, I pass these Credentials to my HTTPClient and create appropriate HTTP POST and GET requests as required.</p><p>I have a few questions about this approach:  </p><ol><li><p>For methods that require Authentication, I am setting userName and password in the fields of Credentials class. Does the HTTPClient class include this data in an HTTP ""Authorization"" header? Is this an example of Basic Authorization?  </p></li><li><p>It was said that Twitter would be deprecating the use of Basic Authentication in June 2010. How would that affect my code? Will it break? Will passing userName and password in Credentials not work post June?</p></li></ol><p>Thanks.</p>","362325","","","","","2010-06-09 12:22:16","Twitter Authentication on Android question","<android><twitter><authorization>","1","0","1","",""
"3005204","1","","","2010-06-09 11:07:42","-1","276","<p>I'm trying to create a scrollview that contains a linearlayout with some options inside of it. I'd like for the options to show up at the top and grow downwards, and to have ""save,"" ""delete,"" and ""cancel"" buttons which show up at the very bottom of the screen (if there is space left in between the bottom of all the options and the top of the buttons).</p><p>Here's a screenshot of my attempt:http: //img375.imageshack.us/img375/3628/10370572.png<br>(StackOverflow was only letting me post a single link so you'll have to get rid of the space in between http: and the rest)</p><p>As you can see, the buttons show up directly below the options rather than at the bottom of the screen. In fact the top level (green) linearlayout doesn't even extend all the way down, despite having a height of fill_parent and a weight of 1 (and the blue is the scrollview, so there is room to expand).</p><p>I've tried every possible combination of heights, weights, gravities, and anything else to get this working and still can't do it. Everytime I pasted my xml layout into here, the top and bottom portions got cut off, so instead I pasted it here: <a href=""http://www.pastey.net/137504-36x1"" rel=""nofollow"">pastey link</a></p><p>Can anyone see what I'm doing wrong?</p>","362328","","","","","2010-06-09 12:49:03","How do I get this linearlayout working on android?","<android><android-linearlayout>","1","0","","",""
"3005478","1","3005576","","2010-06-09 11:47:15","0","361","<pre><code>Hi Folks i am using following webservices for retrieving data from server server side:.net client side:ksoap2whenever activity start, onCreate i am using spinner for displying data returned by the webserviceswhen this activity start it showing black screen after lunching the activity .i found black screen is coming when activity connecting to webservicesHow to resolve this MyCodepublic void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState); try {                 //Display the online and busy people display in spinner                  //people are display in relative people only(Mygroup)                 /* get the online and busy people who are in user group from DB*/                 users_names_ids=new ParseXMLString().convertusernames(new DataParsingComm().ILGetOnlinePeoples(""&lt;spGetOnlinePeoples&gt;&lt;UserID&gt;""+GetCurrentUserID.id+""&lt;/UserID&gt;&lt;/spGetOnlinePeoples&gt;""));                 /* create an array with the size of number of peoples whose status is online or busy */                 String[] array =new String[users_names_ids.size()];                         int setselction=0;// initialize the selection to 0.                 /* if array length is greater than zero, that means getting at least one person whose status is online or busy */                 if(array.length&gt;0){                     /* Returns an enumeration on the keys of this Hashtable instance. And assigns into Enumeration instance variable */                     Enumeration e= users_names_ids.keys();                      /* Iterate list Enumeration until it does't has any more elements */                     for(int i=0;e.hasMoreElements();i++)                         try{                             /* get all persons names into the array list */                             array[i]=e.nextElement().toString();                             /* Get the ChatUserName value from the ChatInPeopleDetails preferences. And If it is in this list set selection to the index 'i' */                             if(getSharedPreferences(""ChatInPeopleDetails"", 0).getString(""ChatUserName"", """").equals(array[i]))                                 setselction=i;                                /*                                  * Get the String value of Relname, that previously added with putExtra() as extended data to the parent intent                                 * If that value is not null and exists in the array list then                                 * set the selection to the index 'i'.                                 *   */                             else if(getIntent().getStringExtra(""Relname"")!=null &amp;&amp; getIntent().getStringExtra(""Relname"").equals(array[i]))                                      setselction=i;                         }catch(Exception ex){                             ex.printStackTrace();                         }                         finally                         {                             System.gc();                             System.runFinalization();                         }                 }                 /* create a new array adapter with the ChatForm context and array objects  */                ArrayAdapter&lt;String&gt; adapter2 = new ArrayAdapter&lt;String&gt;(ChatForm.this,android.R.layout.simple_spinner_item, array);                /* Set the layout resource to create the drop down views. */                adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                /*  The Adapter is used to provide the data which backs this Spinner SpinnerUsersToChat. */                ((Spinner)findViewById(R.id.SpinnerUsersToChat)).setAdapter(adapter2);                /*  Get the ChatUserName value from the ChatInPeopleDetails preferences. If this value  is not null*/                if(getSharedPreferences(""ChatInPeopleDetails"", 0).getString(""ChatUserName"", """") !=null)                {                    /* Set the currently selected item  of spinner based on selection variable value  */                     ((Spinner)findViewById(R.id.SpinnerUsersToChat)).setSelection(setselction);                }                /* Register a callback to be invoked when an item in this AdapterView has been selected.*/                ((Spinner)findViewById(R.id.SpinnerUsersToChat)).setOnItemSelectedListener(new OnItemSelectedListener()                {                    public void onItemSelected(AdapterView&lt;?&gt; parent,View v,int position,long id)                        {                                               /* call getMsg() to get messages and  display them*/                             getMsg();                             /* Causes the Runnable to be added to the message queue. The runnable will be run on the user interface thread.*/                             ((ScrollView)findViewById(R.id.ScrollView06)).post(new Runnable()                              {                                public void run()                                {                                    /* This fullScroll() method will scroll the view to the bottom .*/                                   ((ScrollView)findViewById(R.id.ScrollView06)).fullScroll(View.FOCUS_DOWN);                                 }                             });                        }                        /* on nothing selected to do somthing . this an overridden method */                        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {                        }                });             } catch (Exception e1) {                e1.printStackTrace();            }</code></pre><p>}</p>","1746300","","1746300","","2010-06-10 04:47:11","2010-06-10 04:47:11","black screen while retrieving result from webservices in android","<android>","1","3","","",""
"3005643","1","3035242","","2010-06-09 12:12:55","6","11372","<p>i am creating image gallery if i click on grid view of images it shows full screen image.</p><p>now i want to implement functionality of touch screen or finger sliding left and right ward to change images.</p><p>any one guide me which event should i use or whats the procedure</p><p>any help would be appriciated.</p>","249991","","","","","2010-06-14 06:08:49","which event is used to slide finger left and right ward in android?","<android>","4","1","5","",""
"3005811","1","","","2010-06-09 12:41:07","9","3983","<p>I have a problem with android version 2.1. It looks like a bug.</p><p>I attached an <code>OnScrollListener</code> to my listView.</p><p>I'm using the method <code>onScrollStateChanged(AbsListView view, int scrollState)</code> for monitoring the scroll's state of my listview.</p><p>The scrollstate could assume 3 value (taken from the documentation):</p><ol><li><strong>SCROLL_STATE_FLING</strong>: The user hadpreviously been scrolling usingtouch and had performed a fling. Theanimation is now coasting to a stop</li><li><strong>SCROLL_STATE_IDLE</strong>:The view is notscrolling. Note navigating the listusing the trackball counts as beingin the idle state since thesetransitions are not animated.</li><li><strong>SCROLL_STATE_TOUCH_SCROLL</strong>:The useris scrolling using touch, and theirfinger is still on the screen</li></ol><p>I assume that the <strong>SCROLL_STATE_IDLE</strong> will always be passed after one of other two states.It's always true excepted for android version 2.1.<strong>SCROLL_STATE_IDLE</strong> is not passed after <strong>SCROLL_STATE_TOUCH_SCROLL</strong>The problem happens also if you stop the fling by a touch instead of let the scroll stop by itself.This strange behaviour leaves my listView in an unconsistate state.</p><p>Someonelse has the same problem? Suggestion for a ""not-so-dirty"" work around?</p>","329692","","21234","","2010-06-25 13:19:16","2012-02-17 16:42:15","android: AbsListView.OnScrollListener SCROLL_STATE_IDLE is not called after SCROLL_STATE_TOUCH_SCROLL (Version 2.1)","<android><listview><android-sdk-2.1>","4","1","6","",""
"3005862","1","3006963","","2010-06-09 12:47:53","1","2164","<p>Newbie Q coming from iPhone/MonoTouch C# background</p><p>I have an existing SQLite database file from another project.</p><p>Where do I include the database file into my Eclipse project to have it deploy with the app. </p><p>Do I need to indicate that the database file is writable? (In the iPhone world you need to copy the database file from the app's bundle to a writable folder on the iPhone proper before first use.)</p><p>Once I have the database file on the phone, how do I tell SQLiteOpenHelper to use it? (I extend SQLiteOpenHelper in a custom class.</p>","172861","","","","","2010-06-09 14:53:19","Android SQLiteOpenHelper existing database","<android><sqlite>","1","0","1","",""
"3005932","1","3063718","","2010-06-09 12:56:09","2","1863","<p>is there a way to find out the last time a contact was modified?I can't seem to find a variable for it. The reason I'm asking is because I'd like to do a sync of the contacts to my web server and I don't feel like checking for each contact with a HTTP request if it needs updating.</p><p>So I was thinking to check the date of the last update to the date of the last sync.</p>","297616","","1228","","2013-09-05 12:46:45","2013-09-05 12:46:45","Last time the contact was modified","<android><date><contacts><modified>","2","1","","",""
"3005966","1","","","2010-06-09 13:00:50","0","623","<p>This error is driving me partially insane, it only surfaces on motorola droid / milestone devices, it works flawlessly on the hero and g1. Not got a droid to test it on so have to go on the crash reports in the android market. If you can shed any light onto this matter, I have gone through every db open and made sure it was closed.</p><pre><code>java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2516)  at android.app.ActivityThread.access$2200(ActivityThread.java:119)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:123)  at android.app.ActivityThread.main(ActivityThread.java:4363)  at java.lang.reflect.Method.invokeNative(Method.java:-2)  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(NativeStart.java:-2)Caused by: java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable  at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:31)  at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:56)  at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1221)  at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1194)  at piedogmedia.com.tweetschedular.DBAdapter.getResult(DBAdapter.java:137)  at piedogmedia.com.tweetschedular.main.numberUpdater(main.java:357)  at piedogmedia.com.tweetschedular.main.updater(main.java:406)  at piedogmedia.com.tweetschedular.main.onResume(main.java:442)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)  at android.app.Activity.performResume(Activity.java:3763)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2516)  at android.app.ActivityThread.access$2200(ActivityThread.java:119)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:123)  at android.app.ActivityThread.main(ActivityThread.java:4363)  at java.lang.reflect.Method.invokeNative(Method.java:-2)  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(NativeStart.java:-2)</code></pre>","287072","","","","","2010-06-09 13:15:20","Sqlite error only on Motorola Droid devices, puzzled to say the least","<android>","0","2","1","",""
"3006040","1","3006260","","2010-06-09 13:08:56","1","2251","<p>I don't now if this title is very clear, but I would like to understand how this is possible :<img src=""http://developer.android.com/resources/articles/images/list_fade_4.png"" alt=""alt text""><br>And how we can have 2 elements on the same row of the listview, and handle different clicks, as the listview deals with handling the click on a child.</p><p>Thanks for anyone who could point me in the right direction.</p>","263521","","","","","2010-06-09 15:13:12","display several items in one row of a listview in android","<android><listview>","3","1","","",""
"3006143","1","3006149","","2010-06-09 13:20:21","0","123","<p>This is a pretty open ended question.</p><p>I have a T-Mobile Touch and have some free time on my hands.  So far as i understand im stuck with Android 1.5 and no sign of T-Mobile or Huawei releasing a ROM using a more up-to-date version of the Android SDK.</p><p>Im asking what are the major complexities involved with making a ROM for this fone using a newer version of the Android SDK?</p>","268247","","","","","2010-06-09 13:21:21","What complexities are involvod in writing a ROM for an android fone","<java><android>","1","0","","",""
"3006409","1","","","2010-06-09 13:47:54","0","4256","<p>Any call to a PhoneGap navigator.notification method is failing with the message ""<strong>Result of expression navigator.notification [undefined] is not an object</strong>""</p><p>I've gone through the full installation and project generation process outlined here: <a href=""http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse"" rel=""nofollow"">http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse</a></p><p>...and the application works fine when run from Eclipse, except until trying to access the navigator object. Here is the JavaScript code that is throwing the error:</p><pre><code>var beep = function(){   try{       if(navigator != null){           navigator.notification.beep(2);       }   }catch(e){       alert(""Beep failed: "" + e.message);   }}</code></pre>","214935","","","","","2012-11-07 04:50:04","navigator.notification.* fails ""navigator.notification [undefined] is not an object""","<javascript><android><phonegap>","1","3","","",""
"3006643","1","3007017","","2010-06-09 14:11:54","8","1864","<p>I'm making an ecommerce application on Android and, as it is my first serious project, I'm trying to figure out beforehand the best approach to do this.</p><p>The application talks to a web service (magento api, meaning soap or xml rpc unfortunately) and gets all the content on the phone (product categories, product details, user credentials etc.). I think it should do lazy loading or something like that.</p><p>So, I was thinking to keep the user credentials in a custom Object which will be kept in a <code>SharedPreferences</code> so that every Activity cand easily access it. I'll use a couple of <code>ListView</code>s to show the content and <code>AsyncTask</code> to fetch the data needed. Should I keep all the data in memory in objects or should I use some sort of cache or a local database? Also, I'm planning to use a <code>HashMap</code> with <code>SoftReferences</code> to hold the bitmaps I am downloading. But wouldn't this eat a lot of memory?</p><p>How cand all the activities have access to all these objects (ecommerce basket etc.)? I'm thinking of passing them using Intents but this doesn't seem right to me. Can SharedPreferences be used for a lot of objects and are there any concurrency issues?</p><p>Any pointers would be really appreciated. What are some good guidelines? What classes should I look into? Do you know of any resources on the Internet for me to check out?</p>","292263","","","","","2010-07-02 11:52:50","Good guidelines for developing an ecommerce application","<android><e-commerce>","2","0","4","",""
"3006762","1","3020662","","2010-06-09 14:27:32","0","582","<p>I wrote a code for pinging of given URL.It works fine for me.But whenever i clicked on the start ping button, pinging started but that time focus always is on start button and no widget of the screen working that time. After pressing many times it will gives the force close error.If iam giving URL which is not pinging then that time , all the widgets are working fine.After some time i need to stop the pinging by using my stop button.But it is not working.Please give me advise.Iam using Runtime.exec() for ping command in my android.Plz give me advise.</p>","362544","","","","","2010-06-11 07:34:22","focus not going to another button in android","<android><button><focus><ping>","1","0","","",""
"3006782","1","3006834","","2010-06-09 14:30:22","0","1097","<p>I have a class that fetches data in response to button presses in the main activity. Unfortunately, I keep running into problems because this class is not an Activity or a Service. For example, without a Context I cannot translate a resource id into a string:</p><pre><code>getString(R.string.example_string); // Doesn't work</code></pre><p>Should I make this class into a Service and have the main Activity stop the class when it is closed? Should I pass the Context from the Activity into this class like this?</p><pre><code>MyClass c = new MyClass(this);</code></pre><p>Or is there some better way to handle this problem?</p><p>This issue also comes up when I try to send a Toast from this class.</p><p><strong>Update:</strong> Erich and Janusz pointed me in the direction of the <code>AsyncTask</code> class which works perfectly, except that it creates a new thread and never kills that thread. This means that ever time the user presses a button, another thread is added and the old ones just sit there.</p>","118391","","118391","","2010-06-12 16:28:52","2010-06-12 16:28:52","When to use a service in Android","<android><multithreading><android-asynctask>","2","0","","",""
"3006850","1","3040048","","2010-06-09 14:38:07","1","1417","<p>does someone know how to receive a file on android via RFCOMM?I'm a newby to bluetooth issues, so please have patience with me.</p><p>I'm looking for an approach to receive data via RFCOMM as a stream and store it somewhere on my phone. Saving data is not the problem, it works quite fine.</p><p>The main issue is the implementation of the connection and the reliable retrieval of the data...</p><p>This whole procedure should be implemented as an android service (so that no activity has to be launched while receiving data). What would you suggest: Local or remote service?</p><p>greetz,poeschlorn</p>","317301","","317301","","2010-06-16 07:19:11","2010-11-15 16:43:05","Receiving a File via RFCOMM on Android","<android><bluetooth><rfcomm>","1","1","","",""
"3006876","1","11585341","","2010-06-09 14:41:09","2","1455","<p>I'm placing the file '.nomedia' into a folder in order to avoid Android's MediaScanner from detecting the media files in the folder. I need to copy this folder (including '.nomedia') from the APK's assets to the SD card (so other apps can make use of these media files, etc.). When I package the APK in Eclipse, it doesn't package the '.nomedia' file. Presumably it's detecting it as a hidden file. Any ideas how to fix this? Is there a secret aapt flag I can use? I'd like to avoid copying the folder and then manually creating a '.nomedia' folder, if possible.</p>","299080","","","","","2012-07-20 18:53:58","Packaging ""hidden"" asset files","<android><hidden><assets><aapt>","2","2","","",""
"3006916","1","","","2010-06-09 14:47:13","2","2162","<p>I've just started with Android, I'm making a simple Live wallpaper. I'm testing it on a 2.1 emulator. The trouble is while it works in the preview screen before you choose ""Set Wallpaper"" the touch events don't appear to register on the screen once you've selected it as a wallpaper. Do I need to state anything in the manifest about touch events or so to get it to work? Little bit confused why it would work in one and not the other.</p><pre><code>public void handleTouchEvent(MotionEvent event) {    if(event.getAction() == MotionEvent.ACTION_UP) {        //add new BulletHole        int x = (int)event.getX();        int y = (int)event.getY();        synchronized(holes) {            holes.add(new BulletHole(x,y));        }    }    this.pause = false;         synchronized(this) {        notify();    }}</code></pre>","362556","","995926","","2012-05-22 08:22:52","2012-09-08 19:20:05","Android Live Wallpaper touch events","<android><live-wallpaper><android-2.0-eclair>","2","0","1","",""
"3006933","1","","","2010-06-09 14:49:50","0","603","<p>First off, my application currently defines anyDensity=false in the manifest file. Elsewhere in the app, I'm trying to capture and display a View's DrawingCache but I'm not able to get a clear Bitmap without scaling artifacts.</p><p>The code below yields a Bitmap but it has scaling artifacts and is generally fuzzy.</p><pre><code>myView.setDrawingCacheEnabled(true);Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache());myImageView.setImageBitmap(myBitmap);</code></pre><p>As I read it, the documentation for getDrawingCache says this is to be expected and to use getDrawingCache(true). Yet, both code examples below throw NullPointer exceptions because the Bitmap returned by getDrawingCache(true) is always null.</p><pre><code>myView.setDrawingCacheEnabled(true);Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache(true));myImageView.setImageBitmap(myBitmap);</code></pre><p>OR</p><pre><code>myView.buildDrawingCache(true);Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache(true));  myImageView.setImageBitmap(myBitmap);myView.destroyDrawingCache();</code></pre><p>Does anyone know how to properly capture and render the drawingCache when anyDensity=false?</p>","262119","","","","","2011-06-09 05:53:44","When anyDensity=false why does getDrawingCache(true) return null?","<android>","1","0","","",""
"3007128","1","","","2010-06-09 15:10:47","0","480","<p>I just got an evo 4G and it is annoying that all my useless Sprint programs and their partners' programs. So I am interested in finding a way to.prevent them starting and not using up memory. </p>","362584","","","","","2010-06-09 15:55:50","how do i prevent default programs from auto starting on android 2.1","<android>","1","1","","",""
"3007246","1","3007390","","2010-06-09 15:25:39","21","13885","<p>Is there a publicly available document explaining the naming conventions followed in the Android SDK?</p>","200145","","200145","","2011-01-14 12:42:09","2011-01-14 12:42:09","Naming conventions in the Android SDK","<android><naming-conventions>","1","1","4","",""
"3007447","1","","","2010-06-09 15:44:48","0","183","<p>I am using customadapter to set data for list which contains a text view, imageview and a layout with some buttons. the buttons layout will be invisible initially. When we click on list item the layout has to appear with user able to click a button. This work fine as long as ImageView is static.</p><p>But our build will fetch image from url and set it to view. Here the refresh issue arises. The Layout is unable to be view. </p><p>List refreshes when re apply any external even such as Track ball or scroll.</p><p>Please help me regarding this.....</p>","321234","","","","","2011-03-04 01:03:57","Unable to refresh listview","<android><listview>","1","0","","",""
"3007644","1","3007778","","2010-06-09 16:07:24","107","87028","<p>The question is in the title. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>","200145","","200145","","2013-09-08 20:24:56","2013-09-08 20:24:56","How to output messages to the Eclipse console when developing for Android","<android><eclipse>","5","0","14","",""
"3007725","1","3007978","","2010-06-09 16:18:21","1","5462","<p>I have the following code in a form's submit button onClickListener:</p><pre><code>String action, user, pwd, user_field, pwd_field;        action = ""theURL"";        user_field = ""id"";        pwd_field = ""pw"";        user = ""username"";        pwd = ""password!!"";        List&lt;NameValuePair&gt; myList = new ArrayList&lt;NameValuePair&gt;();        myList.add(new BasicNameValuePair(user_field, user));         myList.add(new BasicNameValuePair(pwd_field, pwd));        HttpParams params = new BasicHttpParams();        HttpClient client = new DefaultHttpClient(params);        HttpPost post = new HttpPost(action);        HttpResponse end = null;        String endResult = null;        try {            post.setEntity(new UrlEncodedFormEntity(myList));        } catch (UnsupportedEncodingException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }         try {            HttpResponse response = client.execute(post);            end = response;        } catch (ClientProtocolException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }          BasicResponseHandler myHandler = new BasicResponseHandler();        try {            endResult = myHandler.handleResponse(end);        } catch (HttpResponseException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }</code></pre><p>How can I take the resulting string (endResult) and start a new activity using an intent that will open webview and load the html?</p>","361675","","","","","2011-06-22 09:42:41","Display HttpResponse (string from Handler) in new WebView","<android><webview><android-intent><httpresponse>","3","0","1","",""
"3007998","1","3008684","","2010-06-09 16:53:53","107","32306","<p>All activities in my application require a user to be logged-in to view. Users can log out from almost any activity. This is a requirement of the application. At any point if the user logs-out, I want to send the user to the Login <code>Activity</code>. At this point I want this activity to be at the bottom of the history stack so that pressing the ""back"" button returns the user to Android's home screen.</p><p>I've seen this question asked a few different places, all answered with similar answers (that I outline here), but I want to pose it here to collect feedback.</p><p>I've tried opening the Login activity by setting its <code>Intent</code> flags to <code>FLAG_ACTIVITY_CLEAR_TOP</code> which seems to do as is outlined in the documentation, but does not achieve my goal of placing the Login activity at the bottom of the history stack, and preventing the user from navigating back to previously-seen logged-in activities. I also tried using <code>android:launchMode=""singleTop""</code> for the Login activity in the manifest, but this does not accomplish my goal either (and seems to have no effect anyway).</p><p>I believe I need to either clear the history stack, or finish all previously- opened activities.</p><p>One option is to have each activity's <code>onCreate</code> check logged-in status, and <code>finish()</code> if not logged-in. I do not like this option, as the back button will still be available for use, navigating back as activities close themselves.</p><p>The next option is to maintain a <code>LinkedList</code> of references to all open activities that is statically accessible from everywhere (perhaps using weak references). On logout I will access this list and iterate over all previously-opened activities, invoking <code>finish()</code> on each one. I'll probably begin implementing this method soon.</p><p>I'd rather use some <code>Intent</code> flag trickery to accomplish this, however. I'd be beyond happy to find that I can fulfill my application's requirements without having to use either of the two methods that I've outlined above.</p><p>Is there a way to accomplish this by using <code>Intent</code> or manifest settings, or is my second option, maintaining a <code>LinkedList</code> of opened activities the best option? Or is there another option that I'm completely overlooking?</p>","300368","","","","","2014-01-29 23:58:16","On logout, clear Activity history stack, preventing ""back"" button from opening logged-in-only Activites","<android>","10","2","81","",""
"3008001","1","","","2010-06-09 16:54:07","3","1416","<p>On the iPhone, safari strips out scrollbars on divs that have overflow set to auto or scroll, but still lets the user scroll with the two-finger swipe gesture.</p><p>Using an HTC Incredible, we see the scrollbars are again missing, but we cannot figure out any gesture that allows the user to scroll.  Is there a special directive we need to add to our HTML?  This should affect zillions of websites, any time someone is trying to scroll an area of the page rather than the whole page.  Does anyone know how to enable scrolling a div using the web browser on Android phones?</p>","3059","","","","","2013-01-16 17:21:44","How do you scroll one area of a page using Android's web browser?","<css><android>","2","1","1","",""
"3008056","1","3008225","","2010-06-09 17:01:43","2","2368","<p>My web service is returning quite a bit of data, so i'm storing it in an arraylist and returning that to my application. I don't know whether or not this is the preferred method or not. When the arraylist is returned and displayed in my application, it also displays the arraylists ""anyType"" section. I'm new to this whole process so i'm sure i'm missing something somewhere or going about this incorrectly. Can anyone point me in the right direction please?</p>","356615","","","","","2011-11-27 14:21:10","Return ArrayList from .net web service to android application using kSoap","<.net><android><web-services><arraylist><ksoap2>","3","0","1","",""
"3008283","1","3008336","","2010-06-09 17:33:09","0","958","<p>Is there any way to connect to a SQL Server from an Android application and execute/query SQL statements without Web Service/WCF etc?</p><p>Thanks.</p>","140937","","","","","2014-03-15 07:22:10","SQL Server and Android","<java><sql><sql-server><android>","3","0","","",""
"3008320","1","3008404","","2010-06-09 17:38:24","0","352","<p>Is there a way to control the relative stacking of Dialogs produced by your own Activity? For instance, there are some more important Dialogs which I would like to ensure are on top and if another Dialog wants to pop up I would want it to pop <em>under</em> the important Dialogs. </p><p>Example: I want to present to the user an important dialog, Dialog A. The activity realizes that there is a dialog, Dialog B, of lesser importance to display to the user. Is it possible to specify Dialog B to be under Dialog A so that when Dialog A is cleared, Dialog B will be seen by the user?</p><p>I know that the onDismiss interface exists, but this necessarily ties Dialog A and Dialog B together. I want the Dialogs to be independent and would prefer to use a higher level abstraction like the window stack responsible for ordering the Dialogs.</p>","299080","","","","","2010-06-09 17:49:29","Stacking Dialogs in Android","<android><dialog><stack>","1","0","","",""
"3008454","1","","","2010-06-09 17:56:02","1","919","<p>I'm developing an Android game, it has 20k downloads so far.</p><p>But I'm not in US region, so I can't just SELL it via Android Market, so it's free.</p><p>So, I'm looking for a best legal way to earn some money from my game.</p><p>PS: Game already has AdMob ads, and I'm looking for something better.</p>","286595","","","","","2010-06-09 17:59:33","What's the best way to monetize Android Game?","<android><monetization>","1","2","1","2010-06-11 15:32:50",""
"3008499","1","3008615","","2010-06-09 18:00:47","4","5142","<p>how to differentiate the 480X800 and 480X854 screens. we have an option to put the one image at the hdpi folder.in my case 480X800 image is does not support for the 480X854 image. it shows a blank space at the bottom.Any Idea?</p><p><strong>Edit: i set the image as a background. on my layout i have transparent image views with margins. if i click the image view it do some task. but between these two screens. i can adjust the value for one. in another one the image was strectched slightly. then what can i do? can you understand my problem? please help.</strong></p>","267269","","267269","","2013-05-08 06:07:16","2013-05-08 06:07:16","how to differentiate the 480X800 and 480X854 screens in android?","<android><android-layout><highdpi>","4","0","","",""
"3008569","1","3082150","","2010-06-09 18:09:26","24","4932","<p>Has anyone tried to make Android and Arduino communicate with each other?</p><p>I found a couple of projects online:</p><ul><li><a href=""http://www.amarino-toolkit.net/index.php/amarino-api.html"">Amarino</a></li><li><a href=""http://code.google.com/p/android-arduino/"">Android-Arduino</a></li></ul><p>What do  you guys suggest is the best way to make those two communicate?</p>","82368","","","","","2013-08-05 07:52:31","Working Android with Arduino","<android><arduino>","7","1","7","",""
"3008586","1","3008962","","2010-06-09 18:11:17","2","1180","<p>I' have a view that contains several textViews an ImageView and a Button . Because on small screen devices (or in landscape mode on big ones ) not all are visible I use a Scroll as the parent of the whole hierarchy to allow the user to view all the information. The things are suck that the button must be at the buttom of the view . However on big screen device , where it remains enough space at the buttom , the button is put immediatelly below the last textview,and seems to occupy all the remaining space (resulting in an unnactractive view) . Trying to use android:allignParentButtom =""true"" not only that it has no effect but it puts the button at top of the screen . Has anyone any ideea how could I accomplish what I described ?</p><p>here's the xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;ScrollView        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/scroll_view""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""&gt;     &lt;RelativeLayout         android:id=""@+id/gps_info_page1""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:layout_centerHorizontal=""true""&gt;       &lt;TextView            android:id=""@+id/itsDateTimeValue""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentTop=""true""            android:layout_centerHorizontal=""true""            android:text=""@string/eStrUnknown""&gt;       &lt;/TextView&gt;     &lt;RelativeLayout             android:id=""@+id/directions""             android:layout_centerHorizontal=""true""             android:layout_below=""@+id/itsDateTimeValue""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;         &lt;TextView                android:id=""@+id/itsDirectionValue""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""0""                android:layout_marginRight=""2dip""                android:textSize=""20sp""&gt;        &lt;/TextView&gt;        &lt;TextView                android:id=""@+id/itsOrientation""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""20sp""                android:layout_marginLeft=""2dip""                android:text=""@string/eStrUnknown""                android:layout_toRightOf=""@+id/itsDirectionValue""&gt;        &lt;/TextView&gt;    &lt;/RelativeLayout&gt;    &lt;ImageView        android:id=""@+id/itsImage""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/compass""        android:layout_below=""@+id/directions""        android:layout_centerHorizontal=""true""&gt;     &lt;/ImageView&gt;     &lt;RelativeLayout&gt;       ...""TextViews below the above image""    &lt;/RelativeLayout&gt;     &lt;RelativeLayout&gt;      ...""TextViews below the above""             &lt;/RelativeLayout&gt;    &lt;RelativeLayout&gt;     ...""TextViews below the above""      &lt;/RelativeLayout&gt;     &lt;RelativeLayout&gt;    ...""TextViews below the above""               &lt;/RelativeLayout&gt;   &lt;RelativeLayout    ...""TextViews below the above""   &lt;/RelativeLayout&gt;   &lt;LinearLayout      android:id=""@+id/div""      android:layout_width=""fill_parent""      android:layout_height=""1dip""      android:layout_below=""@+id/sunset_layout""      android:background=""#F333""&gt;   &lt;/LinearLayout&gt;   &lt;Button  //adding here android:alignParentBottom=""true"" has described above behavior     android:layout_marginBottom=""3dip""     android:layout_marginTop=""20dip""     android:id=""@+id/done_button""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""@string/eStrDone""     android:textSize=""18sp""     android:layout_below=""@+id/div""     android:layout_centerHorizontal=""true""&gt;    &lt;/Button&gt;    &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre>","284609","","","","","2011-02-14 07:35:25","ScrollView in android","<android>","2","1","2","",""
"3008745","1","3008862","","2010-06-09 18:32:07","1","16877","<p>I'm getting an ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) error each time I boot up my program in the debugger. The program won't even start up! Any help would be greatly appreciated! I'm very new to this environment. Let me know if you need anymore information/code to help me out.</p><p>Here is my logcat:</p><pre><code>06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory)06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)06-09 11:16:37.887: ERROR/MemoryHeapBase(53): error opening /dev/pmem: No such file or directory06-09 11:16:37.887: ERROR/SurfaceFlinger(53): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake06-09 11:16:37.927: ERROR/libEGL(53): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)06-09 11:16:38.407: ERROR/libEGL(64): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)06-09 11:16:41.358: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/usb/online'06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_vol'06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_temp'06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mouse0, Not a typewriter06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mice, Not a typewriter06-09 11:16:41.797: ERROR/System(53): Failure starting core service06-09 11:16:41.797: ERROR/System(53): java.lang.SecurityException06-09 11:16:41.797: ERROR/System(53):     at android.os.BinderProxy.transact(Native Method)06-09 11:16:41.797: ERROR/System(53):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)06-09 11:16:41.797: ERROR/System(53):     at android.os.ServiceManager.addService(ServiceManager.java:72)06-09 11:16:41.797: ERROR/System(53):     at com.android.server.ServerThread.run(SystemServer.java:162)06-09 11:16:41.797: ERROR/AndroidRuntime(53): Crash logging skipped, no checkin service06-09 11:16:42.777: ERROR/LockPatternKeyguardView(53): Failed to bind to GLS while checking for account06-09 11:16:46.557: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings06-09 11:16:46.577: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings 06-09 11:16:49.087: ERROR/ApplicationContext(53): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml06-09 11:16:51.146: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin06-09 11:16:54.266: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin06-09 11:16:54.416: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin06-09 11:16:56.336: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound06-09 11:16:56.356: ERROR/MediaPlayer(53): Unable to to create media player06-09 11:16:56.637: ERROR/AndroidRuntime(201): Uncaught handler: thread main exiting due to uncaught exception06-09 11:16:56.757: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.svgeeks.kidneytest/com.svgeeks.kidneytest.KidneyTest}: java.lang.ClassCastException: android.widget.EditText06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.os.Handler.dispatchMessage(Handler.java:99)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.os.Looper.loop(Looper.java:123)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at java.lang.reflect.Method.invokeNative(Native Method)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at java.lang.reflect.Method.invoke(Method.java:521)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at dalvik.system.NativeStart.main(Native Method)06-09 11:16:56.757: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassCastException: android.widget.EditText06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at com.svgeeks.kidneytest.KidneyTest.onCreate(KidneyTest.java:57)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-09 11:16:56.757: ERROR/AndroidRuntime(201):     ... 11 more06-09 11:16:56.876: ERROR/dalvikvm(201): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre>","339036","","339036","","2010-06-09 18:38:24","2010-06-09 18:57:50","Android: ActivityThread.performLaunchActivity error","<android>","1","0","1","",""
"3009059","1","3009690","","2010-06-09 19:11:52","48","20719","<p>I have a alarm thing going on in my app and it launches a notification that then when pressed launched an activity.The problem is that when I create more than one alarm then the activity launched from the notification gets the same extras as the first one. I think the problem is either with the intent i put in the pending intent or in the pending intent itself. I think I might need to put a flag on one of these but I dont know which one.</p><pre><code>Intent showIntent =new Intent(context, notificationreceiver.class);    showIntent.putExtra(""details"", alarmname);PendingIntent contentIntent = PendingIntent.getActivity(context, 0,        showIntent, 0);     notification.setLatestEventInfo(context, ""The event is imminent"",            alarmname, contentIntent);</code></pre><p>And the receiver of the notification</p><pre><code>Bundle b = getIntent().getExtras();    String eventname = b.getString(""details"");    details.setText(eventname);</code></pre><p>The ""details"" extra is the same to every the next time a notification happens instead of having the different value.Until I set the intents I am sure that the correct value goes to the ""details"" so its a problem of getting the first intent everytime i press any notification.How can I make it to launch the correct intents?Hope I was as clear as i couldThanks!</p>","338522","","","","","2012-08-03 13:03:01","android pending intent notification problem","<android><notifications><android-intent>","2","1","22","",""
"3009060","1","3009135","","2010-06-09 19:12:05","2","346","<p><em>SQL noob, please bear with me!!</em></p><p>I am storing a 3-tuple in a database (x,y, {signal1, signal2,..}).<br>I have a database with tables coordinates (x,y) and another table called signals (signal, coordinate_id, group) which stores the individual signal values. There can be several signals at the same coordinate.<br> </p><p>The group is just an abitrary integer which marks the entries in the signal table as belonging to the same set (provided they belong to the same coordinate). So that any signals with the same 'coordinate_id' and 'group' together form a tuple as shown above. </p><p>For example,</p><pre>Coordinates table                 Signals table--------------------             -----------------------------     | id  |  x  |  y  |              | id | signal | coordinate_id | group | |  1  |  1  |  2  |              | 1  |   45   |       1       |   1   ||  2  |  2  |  5  |              | 2  |   95   |       1       |   1   |                                 | 3  |   33   |       1       |   1   |                                 | 4  |   65   |       1       |   2   |                                 | 5  |   57   |       1       |   2   |                                 | 6  |   63   |       2       |   1   |</pre><p>This would produce the tuples (1,2 {45,95,33}), (1,2,{65,57}), (2,5, {63}) and so on.</p><p>I would like to retrieve the sets of {signal1, signal2,...} for each coordinate. The signals belonging to a set have the same coordinate_id and group, <strong>but I do not necessarily know the group value</strong>. I only know that if the group value is the same for a particular coordinate_id, then all those with that group form one set.</p><p>I tried looking into SQL <code>GROUP BY</code>, but I realized that it is for use with aggregate functions. </p><p>Can someone point out how to do this properly in SQL or give tips for improving my database structure.</p>","332738","","","","","2010-06-09 21:55:02","How to properly group SQL results set?","<sql><android><sqlite><sqlite3>","2","0","","",""
"3009366","1","","","2010-06-09 19:48:05","1","1540","<p>I'm creating a Client/Server application with Android (Client) and WCF (Web Service).From reading quite alot of discussions, I'm under the impression that there is no tool available to create the web service client in android automatically from a WSDL file.</p><p>If this is the situation, what is the easiest approach for creating a communication infrastructure between the client and server, that can be updated easily in the future (plain GET, REST, use SOAP and manually parse responses)Initially, I wanted to build the web service and have the client created automatically with the provided WSDL file.</p><p>Thanks</p>","184973","","","","","2011-09-08 06:53:17","Web Services with Android - why no support for WSDL?","<android><web-services><wsdl>","1","0","","",""
"3009663","1","3009701","","2010-06-09 20:25:52","1","333","<p>We currently have an application that starts its own background services to manage syncing of data and downloads of files/images. We want to automate some of those services and we have a difference of opinion on what the best way forward is.</p><p>I contend that having services completely separate and driven through intents is a better way to go, but some team members are saying we should just leave it as it is and have alarms just signal to our app via intents. The problem is, some of these services may need to run even if the app is closed. I think a loosely coupled design is inherently better.</p><p>Just wondering what the general consensus is for Android services?</p>","246793","","","","","2011-12-08 21:09:08","Should Android services be completely independent of an application?","<android><architecture><service><android-intent>","1","0","","",""
"3009734","1","","","2010-06-09 20:35:51","0","1555","<p>I've defined a private class that extends WebViewClient and set my WebView's client to an instance of that class (webView01.setWebViewClient(new Callback());).</p><p>The class definition is as follows:</p><pre><code>private class Callback extends WebViewClient {    public void onLoadResource (WebView view, String url) {    }    public void onPageStarted (WebView view, String url, Bitmap favicon) {    }    public void onPageFinished (WebView view, String url) {        Animation anim = AnimationUtils.loadAnimation(MyNews.this, R.anim.webviewanim);        view.startAnimation(anim);    }    public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) {    }       public boolean shouldOverrideUrlLoading (WebView view, String url) {        Log.e(""loading url"", url);        return false;    }}</code></pre><p>My problem is that onPageFinished is definitely getting called, but shouldOverrideUrlLoading is never being called.</p><p>What am I doing wrong here?</p><p>6/13/2010</p><p>A little more information.  </p><p>I'm loading the initial page from a string (        webView01.loadDataWithBaseURL(""fake://fake"", myHTML, ""text/html"", ""UTF-8"", null);).</p><p>The page loads (and there are several calls to onLoadResource) and onPageFinished is being called at page load completion.</p><p>When the user taps on an Anchor link in the page, instead of calling shouldOverrideUrlLoading, onLoadResource is called.</p><p>I need to invoke the full web browser when the user taps on the link, but I never get the chance to override url loading.</p>","346166","","346166","","2010-06-13 17:33:53","2011-02-03 13:23:22","Android WebViewClient problem","<android>","1","1","","",""
"3009782","1","","","2010-06-09 20:43:02","0","727","<p>I've been working on an application for the past week or so, and when I went to test it the other day, my console read the following to me:</p><pre><code>[2010-06-08 17:13:36 - CellSafe2] ------------------------------[2010-06-08 17:13:36 - CellSafe2] Android Launch![2010-06-08 17:13:36 - CellSafe2] adb is running normally.[2010-06-08 17:13:36 - CellSafe2] Performing com.ryan.android.cellsafe.Activity activity launch[2010-06-08 17:13:36 - CellSafe2] Automatic Target Mode: launching new emulator with compatible AVD 'AVD1'[2010-06-08 17:13:36 - CellSafe2] Launching a new emulator with Virtual Device 'AVD1'[2010-06-08 17:13:38 - CellSafe2] New emulator found: emulator-5554[2010-06-08 17:13:38 - CellSafe2] Waiting for HOME ('android.process.acore') to be launched...[2010-06-08 17:14:16 - CellSafe2] WARNING: Application does not specify an API level requirement![2010-06-08 17:14:16 - CellSafe2] Device API version is 6 (Android 2.0.1)[2010-06-08 17:14:16 - CellSafe2] HOME is up on device 'emulator-5554'[2010-06-08 17:14:16 - CellSafe2] Uploading CellSafe2.apk onto device 'emulator-5554'[2010-06-08 17:14:16 - CellSafe2] Installing CellSafe2.apk...[2010-06-08 17:14:31 - CellSafe2] Success![2010-06-08 17:14:32 - CellSafe2] Starting activity com.ryan.android.cellsafe.Activity on device [2010-06-08 17:14:38 - CellSafe2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.ryan.android.cellsafe/.Activity }[2010-06-08 17:14:38 - CellSafe2] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.ryan.android.cellsafe/.Activity } from null (pid=-1, uid=-1) requires android.permission.ACCESS_CHECKIN_PROPERTIES</code></pre><p>The icon for the program is present in my emulator, and I have added  android.permission.ACCESS_CHECKIN_PROPERTIES to my Manifest.</p><p>For some reason the emulator tells me that the program is not installed ""on this phone"" when I try to run the program using the icon in the emulator. Which I find interesting considering that the console says it was installed successfully...</p><p>Any ideas as to why it isn't working? I'd really appreciate some help as this is due for one of my classes on Monday of next week.</p>","362861","","","","","2010-06-09 22:03:53","Program not Installed & java.lang.SecurityException ","<android>","1","0","","",""
"3009839","1","","","2010-06-09 20:50:39","3","4232","<p>Alright, I'm a little new to the Android SDK, so forgive me if my question doesn't make sense or is very trivial. I'd like to add a custom field for contacts, that contains the contacts username on a website I'm doing this app for.  And, with this custom field, I'd like to have the ability to click it (like ""Send message"" or ""Call mobile"") so that I can go to a specif Activity in my application, with a TextView set with the username that I just clicked on.</p><p>Sorry if that is a bit confusing, if you need anything else let me know!</p>","362857","","","","","2012-06-15 14:50:17","Contact Custom Fields","<android>","3","2","2","",""
"3010011","1","9804508","","2010-06-09 21:17:11","1","2186","<p>I need to update the location through GPS in the background even when the phone is in sleep. I am thinking to use AlarmManager to broadcast an Intent and then a receiver will call requestLocationUpdates() on LocationManager. But I am not sure whether it's guaranteed that the GPS location will be updated when the phone is in sleep and an intent will be broadcasted if I registered a PendingIntent when call requestLocationUpdates()?</p><p>thanks,</p>","109704","","","","","2012-03-21 12:21:29","Android: GPS location updates when the cellphone is in sleep?","<android><locationmanager>","2","0","","",""
"3010019","1","","","2010-06-09 21:18:01","2","6458","<p>I'm looking for a way to implement a minimum value in my SeekBar and also have the option to increment decimal numbers. For example, currently my SeekBar's minimum is set to 0, but I need it to start at the value 0.2. Also, I would like to have the functionality to be able to have the user select a number from 0.2 to 10.0 at a .1 precision so they can choose the numbers 5.6 or 7.1.</p><p>Here are the style attributes for my SeekBar:</p><pre><code> &lt;style name=""SeekBar""&gt;            &lt;item name=""android:paddingLeft""&gt;30dp&lt;/item&gt;            &lt;item name=""android:paddingRight""&gt;30dp&lt;/item&gt;            &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;            &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;            &lt;item name=""android:layout_marginTop""&gt;0dp&lt;/item&gt;            &lt;item name=""android:layout_marginBottom""&gt;0dp&lt;/item&gt;            &lt;item name=""android:max""&gt;10&lt;/item&gt;            &lt;item name=""android:progress""&gt;1&lt;/item&gt;    &lt;/style&gt;</code></pre>","339036","","","","","2011-09-06 18:43:59","Android SeekBar Minimum and Continuous Float Value Attributes","<android>","3","2","","",""
"3010039","1","3010211","","2010-06-09 21:20:40","1","4382","<p>I get a list of contacts in a given group id by <em>id</em>:</p><pre><code>Cursor cur = ctx.managedQuery(ContactsContract.Data.CONTENT_URI,             new String[] { GroupMembership.GROUP_ROW_ID,        GroupMembership.CONTACT_ID },        GroupMembership.GROUP_ROW_ID + ""="" + String.valueOf(id),        null, null);if (cur.moveToFirst()) {    int groupIdx = cur.getColumnIndex(GroupMembership.GROUP_ROW_ID);    int personIdx = cur.getColumnIndex(GroupMembership.CONTACT_ID);    do {        if (cur.getLong(groupIdx) == id) {            Cursor ccur = ctx.getContentResolver().query( Phone.CONTENT_URI,                new String[] {Phone.NUMBER, Phone.TYPE,                Phone.DISPLAY_NAME },                Phone.CONTACT_ID +""=""+ contactId,                       null, null);             Log.e(""Test: Number"", ccur.getString(0))            Log.e(""Test: Name"", ccur.getString(2))        }    } while (cur.moveToNext());}</code></pre><p>But it seems that does not work correctly.</p>","301132","","995926","","2012-05-22 08:24:03","2012-05-22 08:24:03","Android 2.0 How to get display name and number in a contact group","<android><contacts><group><android-2.0-eclair>","1","0","2","",""
"3010103","1","3010241","","2010-06-09 21:31:18","6","4812","<p>I have seen the below log message when navigating to the Account &amp; sync settings screen but I am confused as to how to create an Intent to navigate there.</p><pre><code>INFO/ActivityManager(53): Starting activity: Intent { cmp=com.android.providers.subscribedfeeds/com.android.settings.ManageAccountsSettings }</code></pre><p>I dont seem to have access to the ManageAccountsSettings for development.</p><p>I just wanted to create an Intent such as below, but I cant call out ManageAccountsSettings</p><pre><code>Intent i =new Intent(this,ManageAccountsSettings.class);//Then start the activitystartActivity(intent);</code></pre>","362901","","471213","","2012-12-06 23:54:14","2012-12-06 23:54:14","Android - How to Create Intent to open the activity that displays the ""Accounts & Sync settings"" screen","<android>","1","0","7","",""
"3010130","1","3018794","","2010-06-09 21:35:20","5","8385","<p>I would like to access a web service provided by one of the machines on my LAN from the android emulator.</p><p>If the service was running on the same machine where the emulator is running (called host), I could add a network redirection and access the 10.0.2.2 (host loopback interface in the emulator) with the correct port.</p><p>However it is running on another machine on the LAN. I guess I could add another redirection on the host additionally to the above one (would have to fight with iptables though ... ), but does a more simple solution exist ?</p>","236011","","","","","2010-12-09 05:06:58","Is there an easy way to setup the android emulator to access the LAN of the host machine?","<android><android-emulator>","3","0","1","",""
"3010145","1","3011007","","2010-06-09 21:37:22","1","822","<p>How to calculate the speed with which android mobile is moving, i.e user with mobile in his pocket/hand. Basically I would like to invoke some activity based on the user's speed, how will I calculate? based on what parameters in mobile. Thank you. </p>","357349","","","","","2012-09-29 03:10:33","Speed of Android mobile","<android>","2","0","","",""
"3010157","1","3010793","","2010-06-09 21:39:03","0","1193","<p>Question: How do you programmatically distinguish between directories and regular files in the assets folder?</p><p>When using AssetManager to access files in the assets folder, it seems impossible to determine if a file is in fact a file or a directory. You get the list of files from the <code>list</code> method and then open the file using the <code>open</code> method. I thought perhaps using the <code>openFd</code> method to get the asset file descriptor (and then subsequently requesting the normal file descriptor) would provide me some information. But requesting the file descriptor for a directory results in an IOException (which makes sense since what would it mean for a directory to have a file descriptor...?). </p><p>Currently I'm relying on that IOException (resulting from attemptng to open a directory in the assets folder) in order to determine if a file is in fact a directory. (Opening a regular file works just fine). This seems like a bad idea. Any other suggestions to distinguish between a file and a directory?</p>","299080","","","","","2010-06-09 23:52:11","Determining filetype of file in assets folder","<android><directory><filesystems><assets>","1","4","","",""
"3010430","1","","","2010-06-09 22:23:49","1","615","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4904560/where-can-i-find-android-video-tutorials"">Where can I find Android video tutorials?</a>  </p></blockquote><p>Specifically some that may cater to an experienced developer (C#) but not necessarily familiar with Java/Eclipse?</p><p>I have seen a couple vids on YouTube but they are either short (not much you can learn in 3mins or patronizing)</p>","40714","","","","","2010-06-09 22:31:16","Is there a good library of video tutorials for Android development?","<java><android>","2","0","2","2011-12-18 07:10:31",""
"3010457","1","3010746","","2010-06-09 22:30:07","9","12571","<p>OK, so I'm playing around with an android app.</p><p>The 90% use case is that users want to go straight to the primary list screen to find what they're looking for.  That's what I want as my default screen.</p><p>The first time a user loads the app however, some configuration is required before their list screen is of any value to them.</p><p>So my question, is how I can go about displaying the configuration activity the first time the app is opened up, and then the list screen for future openings.</p><p>I also want to put a demo button on the configuration screen, so I suppose more than just detecting that it's the first time, I specifically want to detect whether the user has performed certain configurations within the first screen.</p>","77528","","","","","2013-04-18 06:19:24","Can I have an android activity run only on the first time an application is opened?","<android><activity><startup>","4","0","10","",""
"3010520","1","3013085","","2010-06-09 22:41:13","0","1312","<p>I'm using a Nexus One and the Camera displays horizontal when it should be vertical and vice versa. I've no idea what's wrong. The code works fine on a HTC tattoo. Anyone have any idea what's wrong?</p><pre><code> 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);}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 e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}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 = null;}public void surfaceChanged(SurfaceHolder holder, int format, intw, int h) {    // Now that the size is known, set up the camera parameters    //and begin    // the preview.    Camera.Parameters parameters = mCamera.getParameters();    parameters.setPreviewSize(800, 480);    mCamera.setParameters(parameters);    mCamera.startPreview();}</code></pre>","358438","","","","","2010-06-10 09:15:22","Camera Preview View, Horizontal when should be Vertical Worked fine on HTC Tattoo, broke on Nexus","<java><android><camera>","1","2","1","",""
"3010569","1","3010714","","2010-06-09 22:51:14","1","232","<p>I have to dynamically add a list of views (the views use RelativeLayout). Can I do this by specifying the view definition in xml and instantiate multiple objects off it? This gives the usual benefits of separating the view part from the code (for e.g., making it easy for the UI guys to alter things) or Is going the ArrayAdapter the suggested/only route?</p>","362953","","","","","2010-06-09 23:34:07","Creating multiple objects of a view defined in the xml","<android>","1","0","","",""
"3010593","1","","","2010-06-09 22:56:35","1","2937","<p>The Android docs indicate that I should ship with different icons for different resolution phone screens.  <a href=""http://developer.android.com/guide/practices/screens_support.html#qualifiers"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html#qualifiers</a></p><ul><li><code>res/drawable-ldpi/my_icon.png       // icon image for low density</code></li><li><code>res/drawable-mdpi/dpi/my_icon.png   // icon for medium density</code></li><li><code>res/drawable-hdpi/my_icon.png       // icon image for high density</code></li></ul><p>This does not work when compiling with Eclipse for the Android.  Does anyone has an example of a manifest file that works for multiple resolution icons?</p><p>Thanks,Gerry</p>","321594","","119895","","2010-06-10 00:57:07","2010-06-14 20:55:15","How to include different resolution icons with Android App?","<android><icons><manifest>","1","5","","",""
"3010997","1","","","2010-06-10 00:57:28","0","402","<p>I know with Android 2.x there is the ability to tap into Microsoft Exchange, for at least email, if not calendar and contacts.  I would like to see how this was accomplished.  Particularly because Microsoft Exchange exposes SOAP web services, and I understand there is no native Android support for SOAP.  Since this is open source, shouldn't I be able to find something in the Android source?  If so, can you point me in the right direction of where to find it in the ~4Gig (!) source?  I want to develop an application that accesses Exchange contacts and calendars, but don't want to reinvent that piece.  Any other guidance would be appreciated.</p><p>Thanks.</p>","358041","","716216","","2012-03-08 10:34:53","2012-03-08 10:34:53","How does Google implement Microsoft Exchange access?","<android><web-services><soap><exchange-server>","2","0","1","",""
"3011092","1","5180473","","2010-06-10 01:34:04","5","8392","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1851633/how-to-add-button-dynamically-in-android"">how to add button dynamically in android?</a>  </p></blockquote><p>How can I dynamically create a button in Android?</p>","655814","","496830","","2011-11-08 14:29:48","2011-11-08 14:29:48","How can I dynamically create a button in Android?","<android>","1","2","2","2012-07-25 15:44:49",""
"3011094","1","","","2010-06-10 01:35:42","1","1939","<p>I have 9 (vertical) radio buttons and they are all showing in default resolution (320x480) without problems . But when I'm trying in resolution for Htc Tattoo (240x320) the last radio button is  hidden - there isn't space to be shown. How to make uniformly size ? </p>","346665","","","","","2010-06-13 00:01:55","Android different resolutions problem","<android><resolution>","2","1","","",""
"3011164","1","3058604","","2010-06-10 01:58:19","3","2032","<p>Here is the context.I want to have a free version and a premium version of the same application. When people buy the application, I want them to be able to ""upgrade"" without losing their data, i.e. the premium version should install over the free version.I want to use the same code base and just switch a setting to build the premium version.Andoid Market does not let me convert a free app to a paid app, so the trivial option is not available.</p><p>I am curious if someone has tried this successfully. How does Android Market identify an application - will it think that the premium version is a different app and just install it in parallel?</p>","58880","","58880","","2010-06-17 02:59:15","2013-01-16 13:05:17","How to handle application upgrades from free to paid version while preserving any data","<android><versioning><google-play>","3","0","2","",""
"3011285","1","","","2010-06-10 02:37:18","2","872","<p>I used google.map api to develop a project which works well on android 2.1. But when I run the same project on android 2.2, it encountered some errors. The shown errors are</p><blockquote>  <p>--  AndroidRuntime FATAL EXCEPTION:main  --  AndroidRuntime java.lang.NoClassDefFoundError:android.net.NetworkConnectivityListener</p>    <p>--  AndroidRuntime at com.google.android.maps.MapActivity.onCreate(MapActivity.java:199)</p></blockquote><p>I don't know where is the problem? Can anyone help me? I will apreciate it very much!</p>","363050","","119895","","2010-06-10 02:42:57","2011-10-08 20:56:53","android 2.2 google map error","<android>","3","0","","",""
"3011361","1","3011374","","2010-06-10 02:59:08","20","36452","<p>I'd like to use AlertDialog as a Login or pin code or password dialog. Here is my code - </p><pre><code>    AlertDialog.Builder alert = new AlertDialog.Builder(this);                 alert.setTitle(""Login"");  alert.setMessage(""Enter Pin :"");                 // Set an EditText view to get user input    final EditText input = new EditText(this);  alert.setView(input);    alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {      public void onClick(DialogInterface dialog, int whichButton) {          String value = input.getText().toString();        Log.d( TAG, ""Pin Value : "" + value);        return;                         }       });      alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            return;           }    });            alert.show();</code></pre><p>How to code that all input text will appear like ' <em>*</em> ' - asterisk</p><p>I can't get my pin code value although it shows into asterisk. my code is below</p><pre><code>    private void accessPinCode_2(){    LayoutInflater factory = LayoutInflater.from(this);    final View textEntryView = factory.inflate(R.layout.dialog_login, null);    AlertDialog.Builder alert = new AlertDialog.Builder(this);                     alert.setTitle(""Login"");   alert.setMessage(""Enter Pin :"");                 alert.setView(textEntryView);    alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {      public void onClick(DialogInterface dialog, int whichButton) {          //String value = input.getText().toString();        EditText mUserText;        mUserText = (EditText) textEntryView.findViewById(R.id.txt_password);        String strPinCode = mUserText.getText().toString();        Log.d( TAG, ""Pin Value : "" + strPinCode);        return;                         }       });      alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            return;           }    });            alert.show();   }}</code></pre><p>dialog_login.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;EditText xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/txt_password""         android:password=""true""         android:layout_height=""wrap_content""         android:layout_width=""250px""         android:layout_centerHorizontal=""true""         android:layout_below=""@+id/password_text""         android:singleLine=""true"" /&gt; </code></pre><p>I entered the value, but get null!</p><p>how to solve?</p><p>Debugging is stopped at this statement. When I pointed above mUserText null value being shown in popup.</p><blockquote>  <p>String strPinCode = mUserText.getText().toString();</p></blockquote><p>I use Android 1.6. Does it depend on Version? :?:</p>","305732","","459579","","2014-03-01 22:12:34","2014-03-01 22:12:34","AlertDialog Input Text","<android><alertdialog>","3","0","3","",""
"3011451","1","","","2010-06-10 03:28:46","1","952","<p>I've been modifying the <a href=""http://developer.android.com/guide/tutorials/notepad/index.html"" rel=""nofollow"">Notepad tutorial</a> for Android very subtly- all I did was rename the column from <code>title</code> to <code>name</code>:</p><p>Before:</p><pre><code>    public static final String KEY_TITLE = ""title"";</code></pre><p>...</p><pre><code>    private static final String DATABASE_CREATE =    ""create table notes (_id integer primary key autoincrement, ""    + ""title text not null, body text not null);"";</code></pre><p>After:</p><pre><code>    public static final String KEY_TITLE = ""name"";</code></pre><p>...</p><pre><code>    private static final String DATABASE_CREATE =    ""create table notes (_id integer primary key autoincrement, ""    + ""name text not null, body text not null);"";</code></pre><p>However,  it always results in this:</p><pre><code>06-10 03:29:38.421: ERROR/AndroidRuntime(344): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.demo.notepad1/com.android.demo.notepad1.Notepadv1}: android.database.sqlite.SQLiteException: no such column: name: , while compiling: SELECT _id, name, body FROM notes</code></pre><p>...</p><pre><code>06-10 03:29:38.421: ERROR/AndroidRuntime(344): Caused by: android.database.sqlite.SQLiteException: no such column: name: , while compiling: SELECT _id, name, body FROM notes</code></pre><p>Am I failing to rename something?  All I am modifying is the Exercise 1 Solution program from the Notepad tutorial.</p>","223327","","223327","","2010-06-10 21:18:00","2010-10-05 08:20:44","Renaming column in Android sqlite database results in error","<mysql><android><sqlite><sqlite3>","2","0","","",""
"3011454","1","3011534","","2010-06-10 03:28:51","4","785","<p>I am interested in activating another application's activity. I know from reading the Android SDK that it's probably better to do this with an implicit intent. However, this activity doesn't reside in an application I own, so I don't know the action and category and data flags on the intent-filter.</p><p>How can I examine an Android applications metadata like the activity classes and the intent-filters for those activities (if declared in the manifest)?</p><p>Thanks!</p>","66766","","","","","2010-09-15 22:47:21","Listing an application's activity and intent-filters?","<android><activity><manifest>","2","0","0","",""
"3011520","1","","","2010-06-10 03:51:33","1","68","<p>hi in my android application,iam presnting add's from admob website ,then add's are displaying in my application,but my problem is if we make the application from portriat to landscape the add's control is not strecting and it changing its position</p>","148269","","199972","","2012-06-12 22:11:19","2012-06-12 22:11:19","how to perform screen orientation in android mobile application","<android><android-widget>","0","0","","",""
"3011604","1","","","2010-06-10 04:20:00","22","36454","<p>I've really been struggling through this. New to Java/Android. I'm writing my first app and this is the first thing that has taken me longer than a couple days of searching to figure out. Here's the setup: It's a BAC calculator / drink counter:</p><p><img src=""http://i.imgur.com/MSSf0.jpg"" alt=""alt text""></p><p>A formula is used to calculate the BAC. Here's the forumla:</p><pre><code>Bac = ((StandardDrinks / 2) * (GenderConstant / Weight)) - (0.017 * Hours);</code></pre><p>So as you can see, being able to modify the gender and weight will produce more accurate and personalized results. So I have them as doubles:</p><pre><code>double GenderConstant = 7.5; //9 for femaledouble Weight = 180;</code></pre><p>To change these variables I would like the person to be able to go into the settings and choose different values. I have these things set up, but not linked to the variables shown above because I cannot for the life of me figure out how. Here they are:</p><p><img src=""http://i.imgur.com/YapQF.jpg"" alt=""alt text""></p><p>I press the menu button and this pops up. Great. I'll click Settings.</p><p><img src=""http://i.imgur.com/xftjv.jpg"" alt=""alt text""></p><p>Now the preferences pops up. Here is my preferences.xml:</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=""Personal Settings""&gt; &lt;ListPreference android:title=""Gender"" android:summary=""Verify or deny the presence of a Y chromosome."" android:key=""genderPref"" android:defaultValue=""male"" android:entries=""@array/genderArray"" android:entryValues=""@array/genderValues"" /&gt; &lt;ListPreference android:title=""Weight"" android:summary=""How much the planet pulls on you, in pounds."" android:key=""weightPref"" android:defaultValue=""180"" android:entries=""@array/weightArray"" android:entryValues=""@array/weightValues"" /&gt; &lt;/PreferenceCategory&gt;&lt;PreferenceCategory android:title=""Drink Settings""&gt; &lt;ListPreference android:title=""Beer Size"" android:summary=""The volume of your beer, in ounces."" android:key=""beerPref"" android:defaultValue=""12"" android:entries=""@array/beerArray"" android:entryValues=""@array/beerValues"" /&gt; &lt;ListPreference android:title=""Shot Size"" android:summary=""The volume of your shot, in ounces."" android:key=""shotPref"" android:defaultValue=""1.5"" android:entries=""@array/shotArray"" android:entryValues=""@array/shotValues"" /&gt; &lt;ListPreference android:title=""Wine Size"" android:summary=""The volume of your wine, in ounces."" android:key=""winePref"" android:defaultValue=""5"" android:entries=""@array/wineArray"" android:entryValues=""@array/wineValues"" /&gt; &lt;/PreferenceCategory&gt; &lt;/PreferenceScreen&gt;</code></pre><p>Onward to the weight ListPreference:</p><p><img src=""http://i.imgur.com/sEQfk.jpg"" alt=""alt text""></p><p>And that shows up. The values are stored as string-arrays in res/values/arrays.xml. Here's a sample, of just the weight ones:</p><pre><code>&lt;string-array name=""weightArray""&gt;&lt;item&gt;120 lbs&lt;/item&gt;&lt;item&gt;150 lbs&lt;/item&gt;&lt;item&gt;180 lbs&lt;/item&gt;&lt;item&gt;210 lbs&lt;/item&gt;&lt;item&gt;240 lbs&lt;/item&gt;&lt;item&gt;270 lbs&lt;/item&gt; &lt;/string-array&gt; &lt;string-array name=""weightValues""&gt;&lt;item&gt;120&lt;/item&gt;&lt;item&gt;150&lt;/item&gt;&lt;item&gt;180&lt;/item&gt;&lt;item&gt;210&lt;/item&gt;&lt;item&gt;240&lt;/item&gt;&lt;item&gt;270&lt;/item&gt; &lt;/string-array&gt;</code></pre><p>This is basically as far as I've gotten. I can click a value, sure, but it doesn't change the formula because it's not linked with the doubles I created in DrinkingBuddy.java. All of the stuff displayed in the settings are just empty shells for now, including the spinner on the main layout (the default time is just set to 1 hour)</p><p>I did create a Preferences.java and have tried implementing various combinations of code found in tutorials and resources around the web, but to no avail. Here it is anyway, filled with failed attempts to make beerPref (the settings option to change how many ounces in the beer) correlate with a variable in my main class:</p><pre><code>package com.dantoth.drinkingbuddy; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.Preference.OnPreferenceClickListener; public class Preferences extends PreferenceActivity {public static final String PREF_BEER_SIZE = ""PREF_BEER_SIZE"";@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); //Get the custom preference Preference beerPref = (Preference) findPreference(""beerPref""); beerPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { public boolean onPreferenceClick(Preference preference) { SharedPreferences customSharedPreference = getSharedPreferences(""myCustomSharedPrefs"", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = customSharedPreference.edit(); editor.commit(); return true; }} );} }</code></pre><p>A full on tutorial and sample code would be AWESOME as I've yet to find any reliable guides out there. </p>","359045","","23897","","2010-06-10 04:26:05","2013-05-04 21:46:58","How do I get preferences to work in Android?","<android><variables><settings><preferences><sharedpreferences>","2","3","9","",""
"3011677","1","","","2010-06-10 04:41:21","0","132","<p>I have an app that has a client Activity and a long-running Service. The Service may be started by the alarm manager or by the Activity itself. </p><p>The alarm intent calls startService(). The Activity calls startService, and then binds itself to the service so it can get information from it.</p><p>When I back-button out of the Activity, onDestroy() is called on the Activity, the Activity unbinds from the Service, and onDestroy() is called on the Service. </p><p>I was under the impression that if I called startService(), then the Service would stay around until stopService()/stopSelf() was called, no matter what clients have unbound from it.</p><p>Am I misunderstanding something?</p>","345651","","","","","2010-06-10 04:52:47","Service exiting after last client unbinds, even though startService() called beforehand?","<android>","1","0","","",""
"3011707","1","","","2010-06-10 04:48:31","5","2133","<p>When my app starts, the title bar is hidden. However, if I leave the app and then return (minimize or phone goes to sleep), there is a blank bar inserted at the top. Is this an intentional feature? How can I prevent it? It seems that the bar goes away after I press the menu key.</p><p>This is the relevant line in the manifest file:</p><p>android:theme=""@android:style/Theme.Black.NoTitleBar.Fullscreen""</p><p>Thanks</p>","359917","","","","","2012-01-19 11:33:51","Android hidden title bar comes back","<android><fullscreen><titlebar>","1","0","","",""
"3011765","1","","","2010-06-10 05:05:49","10","4773","<p>I am new to <strong>Flurry Analytics</strong> in Android, where can I find basic tutorials to work on it?</p>","184814","","1449460","","2012-10-06 18:52:04","2012-10-06 18:52:04","Tutorials for Flurry Analytics in Android ?","<android><flurry>","1","2","5","",""
"3011770","1","3025317","","2010-06-10 05:07:02","6","4639","<p>After I had a lot of problems with preemptive authentication , I got it finally working.Now the next problem. I want to get a file with it, but I don't know how.I thought the file data might be in the variable response, but it isn't.Any ideas how this might work? I'm trying it since days without success :( - Basically I'm trying to download an jpeg file, which is on a server protected by prem. auth.  </p><pre><code>        // BASIC AUTH        /*         * ====================================================================         *         *  Licensed to the Apache Software Foundation (ASF) under one or more         *  contributor license agreements.  See the NOTICE file distributed with         *  this work for additional information regarding copyright ownership.         *  The ASF licenses this file to You under the Apache License, Version 2.0         *  (the ""License""); you may not use this file except in compliance with         *  the License.  You may obtain a copy of the License at         *         *      http://www.apache.org/licenses/LICENSE-2.0         *         *  Unless required by applicable law or agreed to in writing, software         *  distributed under the License is distributed on an ""AS IS"" BASIS,         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.         *  See the License for the specific language governing permissions and         *  limitations under the License.         * ====================================================================         *         * This software consists of voluntary contributions made by many         * individuals on behalf of the Apache Software Foundation.  For more         * information on the Apache Software Foundation, please see         * &lt;http://www.apache.org/&gt;.         */        //http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java        httpclient = new DefaultHttpClient();        httpclient.getCredentialsProvider().setCredentials(                new AuthScope(host, port),                 new UsernamePasswordCredentials(username, password));        // Generate BASIC scheme object and stick it to the local         // execution context        BasicHttpContext localcontext = new BasicHttpContext();        BasicScheme basicAuth = new BasicScheme();        localcontext.setAttribute(""preemptive-auth"", basicAuth);        //first request interceptor        httpclient.addRequestInterceptor(new PreemptiveAuth(), 0);       HttpHost targetHost = new HttpHost(host, port, ""http"");         //HttpGet httpget = new HttpGet(""/"");        HttpGet httpget = new HttpGet(http.url);         System.out.println(""executing request"" + httpget.getRequestLine());        /// !!!        HttpResponse response = httpclient.execute(targetHost, httpget, localcontext);        HttpEntity entity = response.getEntity();        System.out.println(""----------------------------------------"");        System.out.println(""+""+response.getStatusLine()+""+"");...</code></pre>","331556","","","","","2011-09-29 13:11:21","Download a file with DefaultHTTPClient and preemptive authentication","<android><file><authentication><download><preemptive>","1","2","3","",""
"3011945","1","3012134","","2010-06-10 05:53:08","42","18202","<p>I have a custom list view and I want the background of the list to be white, so I do something like this which works great.</p><pre><code>listView = (ListView) this.findViewById(R.id.listview);listView.setBackgroundColor(Color.WHITE);</code></pre><p>The problem is when you scroll the list the background of all the list items changes to black, which looks horrible.</p><p>I tried in my list view setting the background color to white.  When I inflate the view I also tried setting the background color to white:</p><pre><code>view.setBackgroundColor(Color.WHITE);</code></pre><p>Both of these fix the problem of the scrolling background color, but now the item doesn't appear to be clickable even though it is.  What I mean by that is the onClick still works fine, but the background doesn't flash to orange to let the user know he clicked it.</p><p>How can I have a white background in a list view, that stays white while scrolling, and does the normal list acitvity orange click background?</p><p>Thanks!</p>","242904","","","","","2013-09-11 15:24:30","Scrolling a ListView changes everything from White to Black","<android>","5","0","11","2013-05-29 17:10:40",""
"3011953","1","","","2010-06-10 05:54:04","0","116","<p>Hey Can anyone tel me how to use arrays in Android.I need to add the numbers given by the user...Pls help me</p>","362307","","","","","2010-06-10 06:17:54","How to use arrays in addding numbers?","<android>","1","1","","",""
"3012004","1","3012059","","2010-06-10 06:06:35","1","1577","<p>Changing the locale for a device is done in the settings, and can't be done by an app AFAIK.I know how to force my own app to a specific locale, described e.g. here: </p><p><a href=""http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html"" rel=""nofollow"">http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html</a></p><p>So now to my question. Can I force, programatically,  the local of an activity that isn't mine?</p><p>I can imagine 2 ways this could be possible:</p><ol><li>Specifying the locale in an Intent used to start the activity.</li><li>Access and manipulate the configuration of running activities (in the same way as I can modify my own activities' configurations).</li></ol><p>Any thoughts? Is it possible? Is it reasonable?I guess 2. would be more direct, but require some kind of permission (e.g. the modified atcitiy must allow it in the manifest file). But I'd settle for 1. or similar.</p><p>What I want is to be able to see certain apps in a different language, but rather not  change the system locale. E.g. the Android Market, that only displays comments in one language. Can't think of other things right now.</p><p>Can't find much written on Locale in the documentation, what is and isn't possible. But hoping some undocumented feature might enable this :)</p>","311681","","","","","2010-06-10 07:45:41","Launch app with specific locale","<android><locale>","2","0","","",""
"3012054","1","3012472","","2010-06-10 06:15:12","2","2347","<p>say for example I have this code in my activity:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);       Thread cThread = new Thread(new Runner());    cThread.start();}private NotifyMe(){    //do something here}</code></pre><p>and this is my Runner class:</p><pre><code>public class TCPClient implements Runnable {   public void run(){      //call NotifyMe() [THIS IS MY QUESTION]   }}</code></pre><p>I have a thread on my activity that runs the Runner Class.Once the thread start, I would like to call the NotifyMe() functionthat is located at the activity. Is this possible?Please let me know if you don't understand my question.</p>","82350","","114066","","2012-01-27 12:24:29","2012-01-27 12:24:29","android call an outside function from a thread","<android><multithreading><function>","1","0","","",""
"3012150","1","","","2010-06-10 06:33:49","2","921","<p>I don't have a dedicated button in Nexus1.I want to detect whether an image/video is captured from the camera like if anyone captures an image then it should write to file that image has been captured.</p>","363159","","","","","2010-06-10 06:38:22","how to detect whether an image,video has been captured from phone camera of Nexus G1","<android><camera>","1","0","1","",""
"3012287","1","","","2010-06-10 07:00:28","38","35092","<p>I want to read MMS data I have seen the part table in the <code>mmssms.db</code> where the mms entries are stored; I am using a cursor and I want to know the appropriate <code>URI</code>; I am using ""content://mms-sms/conversations"" and the <strong>Column names</strong> of ""Address""(Sent to), ""Text"" or ""Subject"" and ""Data"" column name of image.</p><p>I have seen the schema of <code>mmssms.db</code> and Their Column of part Table.</p>","321373","","244296","","2011-09-17 17:40:42","2013-08-26 02:27:13","How to Read MMS Data in Android?","<android><mms>","5","3","66","",""
"3012443","1","","","2010-06-10 07:29:17","1","1569","<p>I'm trying to reproduce the tabwidget example (<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>). I'm not really sure what's the problem, I got no errors while compiling, but i cannot see the application on the emulators screen.</p><p>It would be excellent if maybe anyone could have a look at my classes and tell me what's my mistake? I've packed my project here: <a href=""http://etanto.com/TabTest.zip"" rel=""nofollow"">http://etanto.com/TabTest.zip</a></p><h2>here's the console dump while the run:</h2><pre><code>[2010-06-10 09:18:34 - TabTest] Launching a new emulator with Virtual Device 'Virtual1'[2010-06-10 09:18:35 - TabTest] New emulator found: emulator-5554[2010-06-10 09:18:35 - TabTest] Waiting for HOME ('android.process.acore') to be launched...[2010-06-10 09:19:05 - TabTest] WARNING: Application does not specify an API level requirement![2010-06-10 09:19:05 - TabTest] Device API version is 8 (Android 2.2)[2010-06-10 09:19:05 - TabTest] HOME is up on device 'emulator-5554'[2010-06-10 09:19:05 - TabTest] Uploading TabTest.apk onto device 'emulator-5554'[2010-06-10 09:19:05 - TabTest] Installing TabTest.apk...[2010-06-10 09:19:22 - TabTest] Success![2010-06-10 09:19:22 - TabTest] \TabTest\bin\TabTest.apk installed on device[2010-06-10 09:19:22 - TabTest] Done!</code></pre><hr>","216569","","114066","","2010-06-10 07:36:57","2010-10-18 18:24:51","Tab widget example not running","<android><android-tabhost>","1","2","","",""
"3012465","1","","","2010-06-10 07:32:04","0","1345","<p>In Android 2.2 site (<a href=""http://developer.android.com/sdk/android-2.2-highlights.html%29"" rel=""nofollow"">link text</a></p><p>it's written:Improved security with the addition of numeric pin or alpha-numeric password options to unlock device. Exchange administrators can enforce password policy across devices</p><p>But while I'm using N1 with 2.2 and try to connect to my company exchange server it didn't enforce me to set a password, although connecting to the same server from Windows Mobile 6 device enforce this.I know that exchange server is configured to enforce password. Is there anything special the administrator need to do?</p><p>Thank you,Moshe</p>","363200","","","","","2010-10-08 22:36:18","Android 2.2 - and exchange password policy enforcement","<android><passwords><exchange-server><policy>","1","0","","",""
"3012640","1","","","2010-06-10 08:03:13","1","582","<p>I'v got the following piece of code:</p><pre><code>try {    HttpClient httpClient = new DefaultHttpClient();    HttpPost httpPost = new HttpPost(""http://www.flashstall.com/json.txt"");    HttpResponse httpResponse = httpClient.execute(httpPost);} catch (Exception e) {    Log.e(""m40"", ""Error in http connection "" + e.toString());}</code></pre><p>When I run it it logs ""Error in http connection java.net.UnkownHostException: www.flashstall.com"".</p><p>What am I doing wrong?</p>","200145","","","","","2010-09-07 05:02:35","Connecting to a web server over HTTP, code snippet","<android><http>","3","0","","",""
"3012703","1","","","2010-06-10 08:14:30","1","271","<p>I want to create a list like iphone list and HTC hero phone app.</p><p>So how can i do that because I tried it with default ListView but I can not make two list in a single layout and ScrollView does not work on it.</p><p>So can any body help me about this matter? </p>","286919","","114066","","2012-01-27 08:51:36","2012-01-27 08:51:36","List like iphone and HTC hero phone app","<android><android-listview>","1","0","","",""
"3012813","1","3013018","","2010-06-10 08:32:56","1","114","<p>I'm currently building an android application with quite a few different connected activities. In each activity I've got a private updateView() method to update all the textViews and stuff on that screen. This gets called in the onResume() method so that each time the activity comes to the front it's views will be updated.</p><p>Is this the right way to do things or is there a more standard pattern for keeping your views in sync with the data?</p>","350678","","","","","2010-06-10 09:04:37","Is there a standard pattern for updating android views?","<android><view><patterns>","1","0","","",""
"3012824","1","","","2010-06-10 08:34:37","2","2959","<p>All Facebook SDKs for Android require an ""application key"", which I assume is the API key for a facebook application that must be created on Facebook. Since all I want is to post to my wall without dealing with Facebook applications, is there an SDK for Android that doesn't require these api keys?</p>","363237","","","Roger Pate","2010-09-22 06:18:35","2010-09-22 06:31:42","How to post a message on my Facebook wall?","<android><facebook>","2","0","","",""
"3013021","1","3013216","","2010-06-10 09:04:45","5","8605","<p><br>My question is I think quite simple but I don't think the answer will be...I have quite a lot of content to have in my application to make it run properly, and I'm thinking of putting all of it in a database, and <strong>distribute it in an embeded database</strong> with the application in the market.The only trouble is that I have no idea of how to do that.I know that I can extract a file .db from Eclipse DDMS with the content of my database, and I suppose I need to put it in the asset folder of my application,  but then how to make the application use it to regenerate the application database?If you have any link to some code or help, that would be great.Thanks</p>","263521","","49246","","2010-06-10 19:31:09","2011-11-06 18:49:05","Embed a database in the .apk of a distributed application [Android]","<android><database><embedded-database>","2","0","10","",""
"3013201","1","3013262","","2010-06-10 09:33:58","1","890","<p>I have a song and its lyrics. The song can be played using <code>MusicPlayer</code> class. But how do I show the lyrics of the song and also highlight them in sync with the audio. Words appear and fade with the playback. </p><p>Does Android have anything in-built for such a thing?</p><p>How can this be achieved?</p>","236128","","390278","","2012-02-24 14:58:39","2012-02-24 14:58:39","Music and Lyrics","<android><media-player>","1","0","","",""
"3013231","1","3014430","","2010-06-10 09:37:10","12","8335","<p><br>I'm trying to access the database of the application I'm developping directly on my Nexus, but I get a ""permission denied"" when I tried to execute the ""sqlite3"" command.I also tried to start the adb in root mod, but again, permission denied on the device...I guess I will have to do that with the emulator but I have a lot of data to load and it would have been 10 times faster with the phone on Wifi than the emulator...Unless someone has any idea?thanks</p>","263521","","119895","","2010-06-10 11:04:38","2013-04-17 19:52:06","sqlite3 permission denied android","<android><sqlite3>","4","0","3","",""
"3013291","1","3013443","","2010-06-10 09:47:28","1","3356","<p>friends,</p><p>i am using following onDraw method to display bitmap on screen.</p><pre><code> @Override            public void onDraw(Canvas canvas) {                    Bitmap _scratch =  BitmapFactory.decodeResource(getResources(), R.drawable.icon2);                    //ImageView img= new ImageView(Tutorial2D.this);                    //img.setImageBitmap(_scratch);                    canvas.drawColor(Color.BLACK);                    canvas.drawBitmap(_scratch, 0, 0, null);            }</code></pre><p>image is displayed on the screen but some part because android screen is smallhow can i display complete image in whole android screen?</p><p>can i set ScaleType of image to fitxy in canvas ? </p><p>or</p><p>can i add android layout image to this canvas so that i could set fitxy property or image there as i have commented the code?</p><p>any help would be appreciated.</p>","249991","","","","","2010-06-10 10:13:37","how to display complete Bitmap in android using Canvas?","<android>","2","0","","",""
"3013358","1","3080065","","2010-06-10 09:59:26","0","313","<p>I need to develop a Instant Lottery game app.</p><p>I need an idea/procedure to implement Scratchable custom widget similar to instant Lottery Tickets in Android.</p><p>The requirement is like, the actual content(secret number) should be covered by some image(which indicates scratch area). When the user touch and scratch the image, the image has to disappear slowly and the background content(secret number) should appear accordingly.</p><p>Please let me know the best way to implement this. I am in real need of it.</p><p>Thanks in advance.</p>","269304","","","","","2010-06-20 16:52:06","Scratchable Ticket kind Custom View Item in Android?","<android><android-custom-view>","2","1","","",""
"3013530","1","3013623","","2010-06-10 10:27:33","8","12234","<p>I am overriding the onCreateDialog and onPrepareDialog methods or the Dialog class.</p><p>I have followed the example from Reto Meier's Professional Android Application Development book, Chapter 5 to pull some XML data and then use a dialog to display the info.</p><p>I have basically followed it exactly but changed the variables to suit my own XML schema as follows:</p><hr><pre><code>@Overridepublic Dialog onCreateDialog(int id) {  switch(id) {    case (SETTINGS_DIALOG) :              LayoutInflater li = LayoutInflater.from(this);      View settingsDetailsView = li.inflate(R.layout.details, null);      AlertDialog.Builder settingsDialog = new AlertDialog.Builder(this);      settingsDialog.setTitle(""Provisioned Settings"");               settingsDialog.setView(settingsDetailsView);return settingsDialog.create();  }  return null;}@Overridepublic void onPrepareDialog(int id, Dialog dialog) {  switch(id) {    case (SETTINGS_DIALOG) :                  String afpunText = ""  "";     if(setting.getAddForPublicUserNames() == 1){      afpunText = ""Yes"";     }     else{      afpunText = ""No"";     }      String Text = ""Login Settings: "" + ""\n""                        + ""Password: "" + setting.getPassword()  + ""\n""                        + ""Server: "" + setting.getServerAddress() + ""\n"";      AlertDialog settingsDialog = (AlertDialog)dialog; settingsDialog.setTitle(setting.getUserName());tv = (TextView)settingsDialog.findViewById(R.id.detailsTextView);if (tv != null)        tv.setText(Text);      break;  }}</code></pre><hr><p>It works fine until I try changing the screen orientation, When I do this onPrepareDialog gets call but I get null pointer exceptions on all my variables.</p><p>The error still occurs even when I tell my activity to ignore screen orientation in the manifest.</p><p>So I presume something has been left out of the example in the book do I need to override another method to save my variables in or something?</p><p>I have now added the following:</p><hr><pre><code>@Overridepublic void onSaveInstanceState(Bundle savedInstanceState) {  // Save UI state changes to the savedInstanceState.  // This bundle will be passed to onCreate if the process is  // killed and restarted.  savedInstanceState.putString(""Username"", setting.getUserName());  savedInstanceState.putString(""Password"", setting.getPassword());  savedInstanceState.putString(""Server"", setting.getServerAddress());  super.onSaveInstanceState(savedInstanceState);}@Overridepublic void onRestoreInstanceState(Bundle savedInstanceState) {  super.onRestoreInstanceState(savedInstanceState);  settings.clear();  // Restore UI state from the savedInstanceState.  // This bundle has also been passed to onCreate.  username = savedInstanceState.getString(""Username"");  password = savedInstanceState.getString(""Password"");  serveraddress = savedInstanceState.getString(""Server"");Settings setting = new Settings(username, password, serveraddress);addNewSettings(setting);}</code></pre><hr><p>But I'm still getting the Null Pointer exception</p>","243999","","243999","","2010-06-10 12:00:20","2010-09-04 12:07:58","Android - Dealing with a Dialog on Screen Orientation change","<android><dialog><screen-orientation><null-pointer>","3","0","2","",""
"3013532","1","3013614","","2010-06-10 10:28:25","2","220","<p>Here's a quote from Android's Dev Guide:</p><blockquote>  <p>A central feature of Android is that  one application can make use of  elements of other applications  (provided those applications permit  it). For example, if your application  needs to display a scrolling list of  images and another application has  developed a suitable scroller and made  it available to others, you can call  upon that scroller to do the work,  rather than develop your own.</p></blockquote><p>Isn't it a bad practice to make an app dependent on other apps?</p>","200145","","","","","2010-06-10 10:41:44","Sharing elements between Android apps, a question of best practices","<android>","2","0","1","",""
"3013538","1","4413591","","2010-06-10 10:29:07","12","4713","<p>Please anybody tell how to use</p><pre><code>FlurryAgent.onEvent(String eventId, Map&lt;String, String&gt; parameters)</code></pre><p>in an android activity to track events with flurry ?</p>","304961","","15825","","2010-12-10 21:47:21","2011-10-25 20:34:54","Use FlurryAgent.onEvent(String eventId, Map<String, String> parameters)","<android><flurry>","2","0","3","",""
"3013655","1","4960071","","2010-06-10 10:47:48","11","6332","<p>I'm making an application where a web service fetches (amongst other) a bunch of codes from a webservice (I.e BEL, FRA, SWE). During runtime I want to translate these codes to their apporiate names to display to users (I.e Belgium, France, Sweden). There can be a lot of these codes, so i'm wondering if there is any approriate way to store the (code, name) entry as a some sort of map in the XML resources in Android, so I can quickly fetch the name by the given code?</p><p>It's all about speed here, since the map can have a few hundred entries.</p>","353528","","","","","2014-03-03 13:21:37","Creating hashmap/map from XML resources","<xml><android>","3","0","3","",""
"3013791","1","","","2010-06-10 11:08:59","21","9930","<p>I was wondering what the best way to do a live character count of an edit-text box is in Android. I was looking at <a href=""http://developer.android.com/reference/android/view/KeyEvent.html"">this</a> but I couldn't seem to make any sense of it. </p><p>To describe the problem, I have an EditText and I'm trying to limit the characters to 150. I can do this with an input filter, however I want to show right below the text box the number of characters a user has entered(Almost like stack overflow is doing right now).</p><p>If someone could write a small snippet of example code or point me in the right direction I'd appreciate it a lot.</p><p>Thanks in advance. </p>","363364","","","","","2013-09-24 15:42:07","Live Character Count For EditText Android","<android>","3","0","11","",""
"3013795","1","","","2010-06-10 11:09:50","8","5304","<p>How do you create an edittext entry that formats input in money format only?  When the user enters 5, I want the input to look like ""$0.05"" and when they then enter 3,  the input should now look like ""$0.53"" and finally they enter 6 and the input should look like ""$5.36"".</p>","158757","","","","","2013-12-19 21:05:22","Android Money Input with fixed decimal","<android><format><edittext>","6","0","1","",""
"3013823","1","3014404","","2010-06-10 11:15:06","15","8004","<p>I have developed an Android app. Now I want to perform a few operations (i. e. - Reset the settings etc.. ) at the moment the app gets uninstalled from the phone.</p><p>Is it possible to reigster a listener or a function that is called at the moment the app is removed?</p>","193583","","114066","","2010-06-10 12:41:51","2011-12-30 01:36:16","Perform a task on uninstall in android","<android><uninstall>","3","1","5","",""
"3013963","1","3014361","","2010-06-10 11:35:01","14","3659","<p>Is there a way to display a MapView without extending MapActivity? I have other Activity class which I'm extending and I would prefer not to change that... I've seen that you can inflate using MapActivity, but didn't find any spec/examples on how to do it. </p>","58862","","","","","2012-08-06 19:22:50","MapView without extending MapActivity","<android><google-maps>","3","4","1","",""
"3014089","1","3035521","","2010-06-10 11:56:28","145","79594","<p>I have a long <code>ListView</code> that the user can scroll around before returning to the previous screen. When the user opens this <code>ListView</code> again, I want the list to be scrolled to the same point that it was previously. Any ideas on how to achieve this?</p>","304866","","56285","","2013-12-22 20:50:15","2014-02-07 23:48:07","Maintain/Save/Restore scroll position when returning to a ListView","<android><android-listview><scrolling><scroll-position>","8","2","125","",""
"3014117","1","","","2010-06-10 12:01:47","13","15799","<p>I need to check in code what Android release version is running currently on target device. Can you supply code example?</p>","268121","","73488","","2012-01-18 00:51:21","2012-11-16 08:15:42","How can I check in code the Android version like 1.5 or 1.6","<android><android-ndk>","5","0","5","",""
"3014118","1","3315139","","2010-06-10 12:01:54","3","12243","<p>I'm creating a popup window in a listactivity in the event onListItemClick.</p><pre><code>LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View pop = inflater.inflate(R.layout.popupcontact, null, false);ImageView atnot = (ImageView)pop.findViewById(R.id.aNot);height = pop.getMeasuredHeight();width = pop.getMeasuredWidth();Log.e(""pw"",""height: ""+String.valueOf(height)+"", width: ""+String.valueOf(width));atnot.setOnClickListener(new View.OnClickListener() {    @Override    public void onClick(View v) {        pw.dismiss();    }}); pw = new PopupWindow(pop, width, height, true); // The code below assumes that the root container has an id called 'main' //pw.showAtLocation(v, Gravity.CENTER, 0, 0);  pw.showAsDropDown(v, 10, 5);</code></pre><p>Now, the height and width variables were supposed to be height and width of the layout used for the popup window (popupcontact). But they return 0. I guess that is because the layout isn't rendered yet. Does anyone have a clue, how can I control the size of the popup window without needing to use absolute pixel numbers?</p>","297616","","114066","","2010-06-10 12:52:55","2010-12-20 15:08:02","Popup window size in android","<android><layout><popup><size>","3","0","3","",""
"3014152","1","","","2010-06-10 12:08:07","4","6925","<p>I am trying to provide user settable colors in my app.  White text on black background and black text on white background.  I have multiple layouts with many listviews, both standard and custom adapters.  People have suggested using Themes, but I have had no luck changing the text colors across all layouts.  Can anyone show me an actual Theme layout that can accomplish this?  I can easily change the background colors using myscreen.setBackGroundColor(xx), but when I try to change the text with a theme, it also changes spinner text as well. </p>","158757","","","","","2010-09-07 15:14:53","Android changing colors with themes","<android><themes>","2","1","2","",""
"3014258","1","","","2010-06-10 12:25:52","0","107","<p>below is the code of a sign up form, when we CLICK second time to submit the entered details, the application collapses and hags just displaying the dialog_thread....On executing very first time it rum perfectly..............The code of dialog_thread is given after onClick()....Please help me, how to get rid of this problem and let the application run smoothly.....</p><p>PLZ HELP ME FAST...</p><p>public void onClick(View arg0)     {        // TODO Auto-generated method stub</p><pre><code>    alert_dialog ad=new alert_dialog();    try    {        if(arg0==signup)        {            if(password.getText().toString().equals(confirm_password.getText().toString()))            {                //**** Start loading dialog thread                dt=new dialog_thread(this);                Log.i(""dialog thread"",""Object created"");                dt.start();                Log.i(""dialog thread"",""thread started"");                String message=null;                Integer success=null;                //************ Encrypt the password                String encrypt_password=new md5(password.getText().toString()).getEncryped();                //************* create name value pair                ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();                nameValuePairs.add(new BasicNameValuePair(""username"",username.getText().toString()));                nameValuePairs.add(new BasicNameValuePair(""password"",encrypt_password));                nameValuePairs.add(new BasicNameValuePair(""email"",email.getText().toString()));                nameValuePairs.add(new BasicNameValuePair(""func"",""signup""));                nameValuePairs.add(new BasicNameValuePair(""user_type"",s.getSelectedItem().toString()));                DBConnect db=new DBConnect();                String result=db.fetch_data(nameValuePairs);                //******** Toast.makeText(this, result, Toast.LENGTH_LONG).show();                //************* Parse JSONArray returned                JSONArray jArray = new JSONArray(result);                for(int i=0;i&lt;jArray.length();i++)                {                    JSONObject json_data = jArray.getJSONObject(i);                                     success=json_data.getInt(""success"");                                        message=json_data.getString(""message"");                                 }                //************ Stop loading dialog thread                dt.stop_execution();                if(success==1)                    Toast.makeText(this,""You have sucessfully signed up"", Toast.LENGTH_LONG).show();                else                    {                                               ad.alertbox(this, """", message);                    }            }            else                ad.alertbox(this, """", ""Error : Please enter the same password"");        }    }catch(Exception e)    {        Log.i(""Exception in signup"",e.toString());    }}</code></pre><p>}</p><p>(THIS CODE IS IN A DIFFERENT FILE)</p><p>class dialog_thread extends Thread{       </p><pre><code>ProgressDialog pd;Context c;String title=""Working ..."";String msg=""Please Wait ..."";dialog_thread(Context cont){    c=cont;}dialog_thread(Context cont,String title,String msg){    c=cont;    this.title=title;    this.msg=msg;}public void run() {    // TODO Auto-generated method stub  try    {        Looper.prepare();        pd = ProgressDialog.show(c, this.title, this.msg, true, false);        Handler handler = new Handler()                                 {                                                   public void handleMessage(Message msg)                                         {                                            //pd.dismiss();                                                                                      Log.i(""Handler"",""Inside handler"");                                            Log.i(""dissmissing thread"",msg.toString());                                        }                                               };        handler.sendEmptyMessage(0);        Log.i(""TRy block"",""Executed"");        Looper.loop();      }    catch(Exception e)    {        Log.i(""Exception in dialog thread"",e.toString());    }//************************ Run ends here    }public void stop_execution(){    pd.dismiss();    this.stop();}</code></pre><p>//<strong><em>*</em>**<em>*</em>****</strong> Class ends here<br>}</p>","363423","","","","","2010-06-10 18:24:50","Application hangs or collapses on submitting the data in the sign-up form, second time...First time it run perfectly","<android><performance>","1","0","","",""
"3014302","1","","","2010-06-10 12:31:49","0","460","<p>I have a question in regards to <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> Lots of issues are already discussed but this example only works for me if I in the onCreate() method do NOT use setContentView(R.layout.main); Why is that? What do I have to do if I want to mix a tab layout with other elements?</p><p>Thanks.paradroid666</p>","363436","","","","","2011-02-28 16:10:00","Android: TabHost","<android><android-tabhost>","1","6","","",""
"3014364","1","3014460","","2010-06-10 12:39:20","2","2822","<p>The Google Market offers an application purporting to run J2ME MIDP applications on the Nexus One.</p><p>I have tried this application but it only appears to run MIDP applications that are downloaded from particular web sites; it does not seem capable of picking up a MIDP application that is stored on the SD card in the phone.</p><p>I have suggested to the developers that they might like to add such functionality, but they have not been particularly responsive to my messages.</p><p>So I would like to build my own MIDP runner for Android and would like to see if I can find a pointer as to where to start, or even whether this is possible.</p><p>The MIDP application in question was supplied on CD along with a security camera system and permits remote viewing and remote control over the security system.</p><p>Clearly it wasn't built with the Android platform in mind. However, if it is possible somehow to run MIDP applications on Android (perhaps by creating some kind of sandbox environment for example) then I'd be quite keen to develop it.</p>","363359","","","","","2012-10-08 06:48:24","Is it possible to run a MIDP application under Android","<android><midp>","2","0","","",""
"3014369","1","3015631","","2010-06-10 12:39:57","12","14377","<p>I am trying to create a PHP script to get the app version from Android APK file. Extracting xml file from the APK (zip) file and then parsing XML is one way, but I guess it should be simpler. Something like <a href=""http://si2.php.net/manual/en/zip.examples.php"" rel=""nofollow"">PHP Manual</a>, example #3.Any ideas how to create the script?</p>","264618","","2360535","","2014-01-07 12:18:41","2014-01-07 13:05:27","PHP: How to get version from android .apk file?","<php><xml><android><version><apk>","3","3","10","",""
"3014597","1","3014616","","2010-06-10 13:08:59","6","12305","<p>I have many RadioButtons in mein App. The RadioButtons are too big for me. Is there any way to make it smaller?</p>","353857","","114066","","2012-04-18 08:46:52","2012-10-17 14:32:57","Android: How to change the Size of the RadioButton","<android><size><radio-button>","3","1","","",""
"3014638","1","","","2010-06-10 13:14:16","1","2099","<p>Hi<br> i have very large database so i am not able to store it in...   \data\data\""PACKAGE_NAME""\databases <br>so i want to store database in Assets and access it from there .I do not want to copy database from assets into \data\data\""PACKAGE_NAME""\databases ..<br> So any fertile brain there to  plant solution.....</p>","281307","","12183","","2010-06-10 13:24:12","2010-06-10 13:24:12","Store database in /assets and access it","<android><database><assets>","1","0","1","",""
"3014699","1","3015198","","2010-06-10 13:20:02","2","2983","<p>I have written some software which uses Wifi as a possible internet-connection medium..I did notice though, that after some time (I am guessing around the 15-20 minutes) after the device has gone into power save mode (anyways when the screen has gone black) the Wifi connection will simply be dropped, even though it is still being used :( This on a ADP 2 (thus a Google Ion with Android 1.6)...I was able to get the following Log :</p><pre><code>06-10 15:04:27.009: DEBUG/WifiService(72): got ACTION_DEVICE_IDLE06-10 15:04:27.069: ERROR/wpa_supplicant(538): Set_key: Wrong Key06-10 15:04:27.069: ERROR/wpa_supplicant(538): Set_key: Wrong Key06-10 15:04:27.069: ERROR/wpa_supplicant(538): Set_key: Wrong Key06-10 15:04:27.069: ERROR/wpa_supplicant(538): Set_key: Wrong Key06-10 15:04:27.069: ERROR/wpa_supplicant(538): Set_key: Wrong Key06-10 15:04:27.069: VERBOSE/WifiMonitor(72): Event [CTRL-EVENT-STATE-CHANGE id=0 state=8]06-10 15:04:27.079: VERBOSE/WifiStateTracker(72): Changing supplicant state: COMPLETED ==&gt; DORMANT06-10 15:04:27.079: DEBUG/WifiStateTracker(72): Deconfiguring interface and stopping DHCP06-10 15:04:27.099: VERBOSE/WifiMonitor(72): Event [CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys]06-10 15:04:27.099: VERBOSE/WifiMonitor(72): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=8]06-10 15:04:27.139: WARN/Smack/Packet(169): notify conn break (IOEx), close connection06-10 15:04:27.139: DEBUG/Smack(169): [XMPPConn] close connection, notifyClosed=false06-10 15:04:27.139: ERROR/MediaPlayer(390): error (1, -17)06-10 15:04:27.139: ERROR/MediaPlayer(390): Error (1,-17)06-10 15:04:28.109: VERBOSE/WifiMonitor(72): Event [CTRL-EVENT-DRIVER-STATE STOPPED]06-10 15:04:28.129: VERBOSE/WifiStateTracker(72): New network state is DISCONNECTED06-10 15:04:28.129: VERBOSE/WifiStateTracker(72): Changing supplicant state: DORMANT ==&gt; DORMANT06-10 15:04:28.189: INFO/MediaUploader(199): No need to wake up06-10 15:04:28.189: DEBUG/GpsLocationProvider(72): updateNetworkState available06-10 15:04:28.189: DEBUG/GpsLocationProvider(72): NetworkThread wait for 4484259ms06-10 15:04:28.289: DEBUG/NetworkLocationProvider(72): onDataConnectionStateChanged 306-10 15:04:28.299: DEBUG/GpsLocationProvider(72): state: CONNECTING apnName: iinternet reason: null06-10 15:04:32.979: DEBUG/NetworkLocationProvider(72): onDataConnectionStateChanged 306-10 15:04:33.029: DEBUG/GpsLocationProvider(72): state: CONNECTED apnName: iinternet reason: null06-10 15:04:33.099: DEBUG/GpsLocationProvider(72): updateNetworkState available06-10 15:04:33.099: DEBUG/GpsLocationProvider(72): NetworkThread wait for 4479355ms06-10 15:04:33.129: INFO/MediaUploader(199): No need to wake up06-10 15:04:33.299: INFO/ActivityManager(72): Stopping service: com.android.mms/.transaction.TransactionService06-10 15:04:33.339: ERROR/TransactionSettings(156): Invalid APN setting: MMSC is empty06-10 15:04:33.419: INFO/ActivityManager(72): Stopping service: com.android.providers.downloads/.DownloadService06-10 15:04:38.309: DEBUG/dalvikvm(199): GC freed 301 objects / 19232 bytes in 92ms06-10 15:04:43.349: DEBUG/dalvikvm(216): GC freed 1430 objects / 84920 bytes in 121ms06-10 15:04:48.319: DEBUG/dalvikvm(156): GC freed 323 objects / 15152 bytes in 96ms</code></pre><p>Is this some kind of known bug/feature ? If so how to get around it ? Also is there someway to actually intercept this EVENT and then soimehow ignore it or re-setup a wifi connection ?Thanks in advance</p>","162147","","","","","2014-01-02 22:21:24","Wifi just goes into IDLE","<android><wifi><standby><power-saving>","3","2","2","",""
"3014912","1","3015180","","2010-06-10 13:41:43","1","572","<p>![alt text][1]Hi folks </p><p>i am using admob ads for my android applicaiton.in portrait mode it fixed top of the screen when i changed to landscape mode.that add disply size of the portrait mode add size</p><p>how i get fill parent in landscape mode </p><pre><code>+import com.admob.android.ads.AdManager; import com.admob.android.ads.AdView; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.Window; import android.view.ViewGroup.LayoutParams; import android.widget.LinearLayout;public class narasimha extends Activity   {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        AdView adView = new AdView(this);        adView.setVisibility(AdView.VISIBLE);        adView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));        adView.setPrimaryTextColor(Color.BLACK);        adView.setBackgroundColor(Color.WHITE);        adView.setSecondaryTextColor(Color.LTGRAY);        adView.setRequestInterval(20);       AdManager.setTestDevices(new String[]{ AdManager.TEST_EMULATOR});        ((LinearLayout)findViewById(R.id.ad)).addView(adView);</code></pre><blockquote>  <p>portrait mode   [1]:  [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/afd7c173cb.png[/img][/url]</p>    <p>landscape mode  [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/1758519975.png[/img][/url]</p>    <p>how can resolve this problem</p></blockquote>","254790","","","","","2010-06-10 14:11:44","how to handle orientation of an linearlayout control in android","<android>","1","0","1","",""
"3015359","1","3015479","","2010-06-10 14:31:21","1","178","<p>I'm doing some initial research on smart phone development, and I noticed that Android and Windows Mobile both support c++ for application development.  I was curious if anyone had any experience trying to manage shared files between both Android and Windows Mobile, and to what extent that code can be shared?  e.g. no user interface can be shared, but web service and business logic classes can be shared, etc.</p>","357499","","","","","2010-06-10 14:45:21","Sharing code between Android and Windows Mobile","<android><windows-mobile>","1","0","","",""
"3015448","1","","","2010-06-10 14:42:04","1","1825","<p>I used <code>com.android.camera.NEW_PICTURE</code> to check whether an image is captured or not.</p><pre><code>(receiver android:name=""NewPhotoReceiver"")    (intent-filter)            (action android:name=""com.android.camera.NEW_PICTURE""/)            (data android:mimeType=""image/*""/)    (/intent-filter)(/receiver)</code></pre><p>But <code>com.android.camera.NEW_PICTURE</code> is not discussed any where in android developers site.</p>","363159","","704374","","2012-08-21 10:03:02","2012-08-21 10:03:02","where is android.camera.NEW_PICTURE defined?","<android><camera>","3","0","1","",""
"3015586","1","5135941","","2010-06-10 14:57:01","49","32044","<ol><li>Is there a simple way to do the Curl page flipping animation? A Curl animation is animation of pages flipping, including the page above rolling and the shadows over the lower page. </li><li><p>What is the recommended way to do a ""gallery"" that displays two pages at a time (just like a book)?</p><p>Is it:</p><ol><li>Letting the adapter display a linear layout of two images at a time? (it won't let me show a page flipping over the other like a book)</li><li>Using two pages, placing somehow one near the other, and then when it's time to animate -move the next two pages over?What is the better way that would enable displaying the left page flipping over the right page?</li></ol></li></ol>","361169","","1340329","","2012-07-05 11:51:48","2013-05-24 10:21:32","Android page Curl animation","<android><curl><android-animation><flip>","4","1","28","",""
"3015658","1","3015760","","2010-06-10 15:07:52","0","571","<p>I'm new to Eclipse/Android development so I'm hoping this is something basic that I'm just doing wrong.  Basically I've been playing around with developing Android apps and I was editing one earlier.  I changed my main.xml file and when I went back to my class that runs the app all references to the ""R"" class were broken.  I looked in the ""gen"" folder (Generated Java Files) and saw that the class was completely gone from the solution.  </p><p>I had been debugging not 5 minutes before and didn't have any problems doing so.  The only things I had done since debugging were moving 2 files from the ""drawable-hdpi"" folder to the assets folder and I had edited the ""main.xml"" file.</p><p>I've tried cleaning the project and restarting Eclipse but neither of those ideas worked.  Any suggestions?</p>","363591","","","","","2011-08-30 09:52:56","In Eclipse, when building an Android app I've somehow deleted the ""R"" class and cannot get Eclipse to generate it again","<java><android><eclipse>","3","0","","",""
"3015684","1","10231358","","2010-06-10 15:10:52","2","1185","<p>I do want to implement the Google Analytics for mobile on my android application using the sdk provided on this page <a href=""http://code.google.com/intl/it-IT/mobile/analytics/docs/android/"" rel=""nofollow"">http://code.google.com/intl/it-IT/mobile/analytics/docs/android/</a></p><p>Does someone know, before i start to integrate it, if it tracks the keywords people used on the android market in order to find and install my application ? </p>","314407","","314407","","2012-06-19 21:53:32","2012-06-19 21:53:32","Google Analytics for Android tracking Market keywords?","<android><google-analytics>","3","0","1","",""
"3015770","1","3067580","","2010-06-10 15:18:38","4","1121","<p>I have a graphic in Adobe Illustrator (lets say a cat) that I want to use in an Android application. I would like to have the user be able to change the color of the fur using a color picker. What can I save the graphic as (SVG?) to allow me to programatically control the color from with the android app? Do I have to have a separate image for each color of the cat?</p>","40149","","","","","2010-06-20 06:42:58","How can I change the color of a complex graphic?","<android>","5","0","1","",""
"3016056","1","3016391","","2010-06-10 15:50:48","1","147","<p>I was wondering about the wizard of eclipse, what the difference was between the keystore password and that asked in the after screen? And what if i post both the same?</p><p>Tnk's</p><p>Valerio From Italy</p>","314554","","","","","2010-06-10 16:32:56","Signing a Android App: What about the various fields?","<android><signing>","1","0","1","",""
"3016062","1","4960253","","2010-06-10 15:51:04","3","1083","<p>In an Android app I'm developing, I've got a need for LocationManager to give me location fixes.  That part is all nice and good; it's working, it has been for quite some time, and all is happy there.</p><p>However, now that I've also recently added a feature that allows the location tracking part to go to the background, I also want to allow it to slow down updates in that case to conserve battery power.  In effect, the way I'm trying to do this is by reissuing the requestLocationUpdates call with new parameters if my background service detects that there aren't any listeners registered anymore (it provides something to the notification bar, so I still want it getting updates).  Let's call that service ""Servicemajig"".  The way I'm doing that, in short:</p><pre><code>private void setMode(boolean foreground) {    // This sets whether we're in foreground or background mode.  If we're    // not changing anything, though, don't do anything.    if(foreground == mForeground) return;    // Set the current mode...    mForeground = foreground;    // ...and switch!    if(mForeground) {        // Foreground mode means we go full tilt.        Log.i(DEBUG_TAG, ""Switching to foregroud mode..."");        mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, Servicemajig.this);    } else {        // Background mode means we slow down.  Like, say, 30 seconds.        Log.i(DEBUG_TAG, ""Switching to background mode..."");        mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30000, 0, Servicemajig.this);    }}</code></pre><p>Now, this works, for the most part.  I don't get double-updates (i.e. I don't unregister first yet it still does the trick), and on my Nexus One and G1, this properly switches between background and foreground mode as need be.  That is, it'll properly wait around 30 seconds (give or take) before trying to get another location fix, conserving battery power.</p><p>The problem comes when I test it on a Motorola Droid.  On the Droid and on it alone, once I put it in background mode, it'll wait 30 seconds (again, give or take) between fixes, but if it DOES get at least one fix in that manner, it won't return to foreground mode later.  That is, even after I've re-entered the actual app where foreground mode desired and requested, it still waits 30 seconds per fix, and I can't seem to get around this, apart from shutting down Servicemajig and restarting it.  The logs show that it IS passing through that part of code, so it's at least getting that far.</p><p>So my question is, is this just a bug specific to the Droid firmware?  Is there some way I can work around this?  Or is this even the right way to do something like this?  I'll note that it doesn't matter if I add in a removeUpdates call before the if block with the registerLocationUpdates calls.</p>","360994","","","","","2011-02-10 17:04:21","Android's LocationManager is ignoring changes in requestLocationUpdates calls, but only on the Droid","<android><gps>","1","2","","",""
"3016386","1","3509946","","2010-06-10 16:32:27","1","1999","<p>I'm trying to write a wrapper around Android's AdbWinApi.dll.</p><p>I've run dumpbin on the DLL and found a number of entry points.  The problem is I don't really understand how to use those entry points and tie them up to the ADB API.</p><p>What is a good starting point to write this wrapper?</p>","24108","","","","","2010-09-18 02:49:35","Write a .Net wrapper around AdbWinApi.dll","<.net><android><dllimport><adb>","1","1","1","",""
"3016606","1","3016920","","2010-06-10 16:57:33","14","16177","<p>I am able to create, write and read an SQLite Database in my Android App. I have a copy of the Database that is fully populated with data, and I want to get that data into the App's Database. Is it possible to access my populated database from inside my App? Or can I at least create a copy of the populated database and then use that copy? Or do I need to do a .dump and put all the inserts into the Android code? </p>","300129","","444705","","2013-05-06 01:57:55","2013-05-06 01:57:55","Loading SQLite Database into Android App","<android><sqlite>","2","1","1","",""
"3016729","1","3016789","","2010-06-10 17:12:11","3","454","<p>I am attempting to learn how to develop on the Android platform but do not quite understand the relationship between Activities and Views, because according to the documentation an Activity is almost always linked to a UI object that the user can interact with, but if this is the case where does the whole idea of Views come in?</p><p>There is probably a very basic explanation but I would appreciate a few pointers all the same. Thanks</p>","300037","","75170","","2010-06-10 17:36:06","2010-06-10 17:36:06","How are activities and views related in the Android platform?","<android><view><activity>","1","0","3","",""
"3016844","1","3233300","","2010-06-10 17:25:08","2","1813","<p>I have a listview with two labels, title and subtitle. I want to have dark and light background as user options. Title has textAppearanceMedium and subtitle has textAppearanceSmall. I want the style, MyTheme.Dark to have white color text and MyTheme.Light to have black color text. Is there a way to define multiple textAppearance attribute for the same TextView widget?</p><pre><code>&lt;style name=""MyTheme.Dark""&gt;    &lt;item name=""android:windowBackground""&gt;@color/black&lt;/item&gt;    &lt;item name=""android:colorBackground""&gt;@color/black&lt;/item&gt;    &lt;item name=""android:background""&gt;@color/black&lt;/item&gt;    &lt;item name=""android:divider""&gt;@color/white&lt;/item&gt;        --cannot put textAppearance here since it is different for title and subtitle    &lt;/style&gt;</code></pre>","349161","","","","","2011-01-02 20:42:24","How to allow users to choose themes in android list view?","<android><themes>","3","0","1","",""
"3017074","1","3017588","","2010-06-10 17:57:08","1","903","<p>I'm working on an Android project that focuses on knowing how close you are to buildings. I wanted to know if there is some way to extract the geographic information about the outlines of buildings out of the Google Maps API. Thanks.</p><p>EDIT: The functionality I'm looking for is similar to what's going on in this app. (Click the link near the top of the page that says ""View Live Sample"".)</p><p><a href=""http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/gmaps/help/google_start.htm#topics/samples/identify_features.html"" rel=""nofollow"">http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/gmaps/help/google_start.htm#topics/samples/identify_features.html</a></p>","363779","","881229","","2013-12-12 06:04:33","2013-12-12 06:04:33","Building Outline Data in Google Maps (Android)","<android><google-maps>","1","1","","",""
"3017177","1","3017979","","2010-06-10 18:11:04","0","796","<p>We have been using XMLRPC for android and it was working well until we got our hands dirty with Base64 encoding for byte[] (images) -- (we did base64_string.replace(""/"",""$$"") for transmission). We have tried undoing the changes and its looking like an XMLRPC error.</p><p>We are getting the following error in the DDMS:</p><pre><code>06-10 23:27:02.970: DEBUG/Test(343): org.xmlrpc.android.XMLRPCFault: XMLRPC Fault:  [code 0]06-10 23:27:02.970: DEBUG/Test(343):     at org.xmlrpc.android.XMLRPCClient.callEx(XMLRPCClient.java:308)06-10 23:27:02.970: DEBUG/Test(343):     at org.xmlrpc.android.XMLRPCMethod.run(XMLRPCMethod.java:33)</code></pre><p>Just before this I checked the body (xml message -- which is perfect) and the response received:</p><pre><code>06-10 23:27:02.940: INFO/System.out(343): Response received: org.apache.http.message.BasicHttpResponse@437762f8</code></pre><p>Since the message is not even reaching our cloud, the issue is mostly with XMLRPC for android.</p><p>Any help will be most appreciated. Thanks</p><p>BestSameer</p>","356580","","","","","2010-12-01 18:22:31","Android XMLRPC Fault Code","<android><rpc><xml-rpc><fault>","1","0","1","",""
"3017375","1","3018103","","2010-06-10 18:36:49","4","4840","<p>I have looked at the Android API and other posts here on stackoverflow, but have not been able to figure this out.</p><p>My app downloads files to the sd card. I would like to pop a ""loading..."" dialog while the file is downloading and then have it disappear when the download is finished. This is what i came up with using the android API:</p><pre><code>ProgressDialog pd = ProgressDialog.show(this,"""",""Loading. Please wait..."",true);//download filepd.cancel();</code></pre><p>however the dialog doesn't actually show. when i debug it, it claims that it is showing, but it is obviously not on the screen.</p><p>what can i do?</p>","339428","","","","","2013-01-04 11:11:36","android: showing a progress dialog","<android><dialog><progressdialog>","2","3","3","",""
"3017496","1","3017534","","2010-06-10 18:52:44","5","1905","<p>I'm really hoping someone can help me out with this one.  I've been stuck on it forever.  Occasionally, when someone is using my app, it'll force close with this exception:</p><pre><code>java.lang.ArrayIndexOutOfBoundsException    at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:3572)    at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2487)    at android.widget.AbsListView.onTouchEvent(AbsListView.java:2001)    at android.widget.ListView.onTouchEvent(ListView.java:3234)    at android.view.View.dispatchTouchEvent(View.java:3709)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:874)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695)    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)    at android.app.Activity.dispatchTouchEvent(Activity.java:2068)    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695)    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)    at android.app.Activity.dispatchTouchEvent(Activity.java:2068)    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679)    at android.view.ViewRoot.handleMessage(ViewRoot.java:1697)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4568)    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>However, I cannot figure out why.  It's relatively rare, non-reproducable, and the stacktrace is completely unhelpful because it doesn't include any of my code.</p><p>Is it a bug in Android itself?</p>","238849","","1267661","","2012-10-21 18:24:43","2012-10-21 18:24:43","ArrayAdapter and ListView - ArrayIndexOutOfBoundsException","<android><android-listview>","2","1","2","",""
"3017530","1","3055015","","2010-06-10 18:57:20","0","1322","<p>I'm having troubles using AudioRecord.</p><p>An example using some of the code derived from the <a href=""http://code.google.com/p/splmeter/"" rel=""nofollow"">splmeter</a> project:</p><pre><code>private static final int FREQUENCY = 8000;private static final int CHANNEL = AudioFormat.CHANNEL_CONFIGURATION_MONO;private static final int ENCODING = AudioFormat.ENCODING_PCM_16BIT;private int BUFFSIZE = 50;private AudioRecord recordInstance = null;...android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, FREQUENCY, CHANNEL, ENCODING, 8000);recordInstance.startRecording();short[] tempBuffer = new short[BUFFSIZE];int retval = 0;while (this.isRunning) {   for (int i = 0; i &lt; BUFFSIZE - 1; i++) {      tempBuffer[i] = 0;   }   retval = recordInstance.read(tempBuffer, 0, BUFFSIZE);   ... // process the data}</code></pre><p>This works on the HTC Dream and the HTC Magic perfectly without any log warnings/errors, but causes problems on the emulators and Nexus One device.</p><p>On the Nexus one, it simply never returns useful data. I cannot provide any other useful information as I'm having a remote friend do the testing.</p><p>On the emulators (Android 1.5, 2.1 and 2.2), I get weird errors from the AudioFlinger and Buffer overflows with the AudioRecordThread. I also get a major slowdown in UI responsiveness (even though the recording takes place in a separate thread than the UI).</p><p>Is there something apparent that I'm doing incorrectly? Do I have to do anything special for the Nexus One hardware?</p><p><b>EDIT</b></p><p>I've partially solved the problem...The Documentation for <a href=""http://developer.android.com/reference/android/media/AudioRecord.html"" rel=""nofollow"">AudioRecord</a> says:</p><pre><code>public static int getMinBufferSize (int sampleRateInHz, int channelConfig, int audioFormat)</code></pre><blockquote>  <p>Returns the minimum buffer size  required for the successful creation  of an AudioRecord object. Note that  this size doesn't guarantee a smooth  recording under load, and higher  values should be chosen according to  the expected frequency at which the  AudioRecord instance will be polled  for new data.for new data.</p></blockquote><p>So I changed the buffer length to</p><pre><code>private static final int BUFFSIZE = AudioRecord.getMinBufferSize(FREQUENCY, CHANNEL, ENCODING);</code></pre><p>And now the Emulators run well.</p><p>But</p><p>Hardware doesn't. While the emulators return a value of 640 from that call (giving 12.5 polls per second) based on 8khz, the HTC hardware returns 4096! Meaning roughly 2 polls per second and an audio delay of half a second!Furthermore, that same call on the Nexus One returns 8192! So a full second delay!</p><p>I wish it ended at that, but the nexus one <em>still</em> doesn't return any audio (still don't have one myself, so I can't get proper debugging information from one), even though the HTC devices and all emulators now work (even if some are more laggy than others).</p><p>Am I doing something horribly wrong here?</p>","86348","","1534123","","2012-10-26 15:50:18","2012-10-26 15:50:18","AudioRecord problems with non-HTC devices","<android><android-emulator><buffer-overflow><nexus-one><android-audiorecord>","1","0","","",""
"3017618","1","","","2010-06-10 19:09:38","0","1563","<p>I get a .apk does not exist error  when exporting Android project in Eclipse using android-sdk_r06-mac_86.</p><p>I never got the error in the previous version of the SDK.Off course the .apk file doesn't exist. I'm trying to build and sign it.</p><p>How do I fix this problem?I prefer to getting it to work in Eclipse again.</p><hr><p>Here are some more details about the problem.</p><p>I am running Eclipse on a Mac.Everything was ok, until I updated the SDK version (and ADT plugin) tothe sdk 2.2.</p><p>Now I can't use the emulator, or export .apk files for most of my pre Android-sdk-2.2 projects.</p><p>The error message contains something like: "".apk file not found"".When looking in the projects bin directory the .apk file isn't there.How did that happen. I didn't delete them.</p><p>When I use the ""android update project"" on the command line I can generate a build.xml file.</p><p>However when I use ant debug to export or build the .apk file I get the following error message:</p><p>BUILD FAILED/Applications/apps/android-sdk-mac_86/platforms/android-4/ant/ant_rules_r2.xml:220: null returned: 139</p><p>I have also tried to use the project clean option in Eclipse.</p><p>It looks like countless hours of work have been wasted.</p><p>Since I can't build the .apk file I can't move it to the emulator, or phone.This wasn't a problem in the previous Android-SDK version.</p><p>Any solution? </p>","363852","","298479","","2013-03-09 15:59:05","2013-03-09 15:59:05",".apk does not exist error when exporting Android project in Eclipse using android-sdk_r06-mac_86","<eclipse><android>","1","0","","",""
"3017622","1","","","2010-06-10 19:10:09","0","157","<p>So I have 2 layout files (main.xml, featured.xml) and both each have a single WebView.  When the application starts ""main.xml"" loads a html file into it's WebView.  In this html file I have a link that calls javascript that runs code in the Activity that loaded the html.  Once back in this Activity code though I try running <strong>setContentView(R.layout.featured)</strong> but it just bombs out on me.  If I debug it just dies without any real error and if I run it the application just <em>Force</em> closes.</p><p>Am I going about this correctly or should I be doing something differently?</p><pre><code>    final private int MAIN = 1;    final private int FEATURED = 2;    /** 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.wvMain);        webview.getSettings().setJavaScriptEnabled(true);        webview.getSettings().setSupportZoom(false);        webview.addJavascriptInterface(new EHJavaScriptInterface(), ""eh"");        webview.loadUrl(""file:///android_asset/default.html"");                 }    final class EHJavaScriptInterface {        EHJavaScriptInterface() {        }        public void loadLayout(final String lo) {            int i = Integer.parseInt(lo.trim());            switch (i) {            /****** THIS IS WHERE I'M BOMBING OUT *********/            case FEATURED: setContentView(R.layout.featured);break;            case MAIN: setContentView(R.layout.main);break;            }                   }    }</code></pre>","363591","","","","","2010-06-10 19:10:09","How can a link within a WebView load another layout using javascript?","<java><android><eclipse>","0","2","","",""
"3017628","1","","","2010-06-10 19:10:39","0","111","<p>So, I've been doing android application tutorials and everytime I create a package, for example the helloAndroid tutorial is com.example.android.  When it saves this to src it creates a folder for com, another for example and one last one for android. So it gives me the error ""class com.example.android does not exist"" because its broken into different folders. </p>","363856","","9167","","2010-06-10 19:27:49","2010-12-31 16:03:50","question on src folders in eclipse","<java><android>","2","3","0","",""
"3018017","1","3018062","","2010-06-10 20:01:21","0","651","<p>I have added a menu to ListView Activity and wanted to allow the user to select the information that would be displayed in the ListView. So for example:</p><ul><li>The ListView is populated in the onCreate method.</li><li>The user selects an option in the menu.</li><li>Upon the user making this selection the ListView would be populated with a different array. </li></ul><p>Is onResume() executed after the menu is closed? I would test this but I am not currently home. What is the best way to do this? </p><p>Thanks,Rob</p>","289153","","","","","2010-06-10 20:06:32","Changing the content of a ListView (Android)","<android><listview><menu>","1","0","","",""
"3018050","1","","","2010-06-10 20:05:41","4","3481","<p>I'm trying to figure out how to embed things, <em>other</em> than Drawables, inside an EditText widget. Specifically the example I'm thinking of is from the Google Buzz widget:</p><p><a href=""http://greydream.org/pics/buzz.png"" rel=""nofollow"">screenshot</a>(no inline image, sorry, I'm a newb)</p><p>It appears to the casual observer that there's an entire layout object pinned to the bottom of the EditText, containing an ImageView, a TextView, and a Button.</p><p>Anyone have any idea how to pull this off? Or do we think this is a custom subclass of EditText?</p>","363871","","","","","2010-11-23 18:46:55","How to embed a View (with Buttons, etc.) inside an EditText?","<android><android-widget>","3","0","4","",""
"3018203","1","3018269","","2010-06-10 20:24:10","0","103","<p>I'm writing an android application that maintains a lot of ""state"" data...some of it I can save in the form of onSaveInstanceState but some of it is just to complex to save in memory.</p><p>My problem is that sliding the phone open destroys/recreates the app, and I lose all my application state in the process.  The same thing happens with the ""back"" button, but I overloaded that function on my way.  Is there any way to overload the phone opening to prevent it from happening?</p><p>Thanks in advance.</p>","355663","","225647","","2012-10-29 20:41:34","2012-10-29 20:41:34","Android - Opening phone deletes app state","<java><android>","2","0","","",""
"3018587","1","","","2010-06-10 21:16:10","0","1002","<p>I am trying to set the class for an intent to the address listed in a string value, so that I can launch a given activity.  The string is composed dynamically during runtime.</p><p>Is there anyway to make something like the code below run:</p><pre><code>String target=com.test.activity1.class;Intent intent=new intent();intent.setClass(this, target);</code></pre><p>Thanks</p>","360964","","","","","2011-10-08 18:30:37","How can I set an intent's class from a string value?","<android><string><activity><android-intent>","2","0","","",""
"3018619","1","","","2010-06-10 21:20:34","1","3238","<p>I am developing an Android app but I'm still pretty new. I want to have a button, and when you push that button, a few TextViews and Buttons will appear. So I have a main linear layout, and then another linear layout nested inside containing the things I want hidden. I have the nested linear layout set to android:visibility=""gone"".</p><p>The problem I am having is that it only shows the first item inside the hidden linear layout instead of all of them. The way I try to make it appear is </p><pre><code>    vgAddView = (ViewGroup)findViewById(R.id.add_details);    btnAche.setOnClickListener(new OnClickListener(){        public void onClick(View v){            vgAddView.setVisibility(0);        }    });</code></pre><p>My XML file is 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;Button     android:text=""@string/but_stomach_ache""     android:id=""@+id/but_stomach_ache""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;Button     android:text=""@string/but_food""     android:id=""@+id/but_food""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;&lt;/Button&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/add_details""    android:visibility=""gone""&gt;    &lt;TextView        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:text=""@string/when_happen""&gt;        &lt;/TextView&gt;    &lt;Button         android:text=""@string/happen_now""         android:id=""@+id/happen_now""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;        &lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","363990","","","","","2012-02-11 11:13:29","Nested Linear layout only shows first view after being set from gone to visible in Android","<android><layout><visible>","2","0","","",""
"3018716","1","3019219","","2010-06-10 21:35:22","5","10335","<p>My app allows the user to access their corporate voice mail. Normally, durring a phone call when the user holds the device up to their ear, the screen shuts off so they wont accidentally push buttons with their face. I would like to make my app do the same thing when the user is listening to their voice mail.</p><p>anyone know how to do this?</p>","339428","","","","","2013-02-21 11:51:10","android: turn off screen when close to face","<android><screen>","3","0","5","",""
"3018807","1","3021500","","2010-06-10 21:48:36","0","892","<p>how to add contact groups in the  emulator or sync with Google contacts or device contacts?</p>","301132","","","","","2010-06-11 08:58:38","Android 2.0: how to add contact groups in the emulator?","<android><emulator><group><contacts>","1","0","0","",""
"3018809","1","3019161","","2010-06-10 21:49:05","2","1812","<p>This one is different than the other one I posted.  Any ideas?</p><blockquote>  <p>java.lang.IndexOutOfBoundsException:  Invalid location 14, size is 1         at java.util.ArrayList.get(ArrayList.java:341)         at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:188)         at android.widget.AbsListView.obtainView(AbsListView.java:1256)         at android.widget.ListView.makeAndAddView(ListView.java:1668)         at android.widget.ListView.fillUp(ListView.java:667)         at android.widget.ListView.fillGap(ListView.java:613)         at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2531)         at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:2353)         at android.os.Handler.handleCallback(Handler.java:587)         at android.os.Handler.dispatchMessage(Handler.java:92)         at android.os.Looper.loop(Looper.java:123)         at android.app.ActivityThread.main(ActivityThread.java:4595)         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)</p></blockquote>","238849","","","","","2012-01-01 00:04:20","Another ArrayIndexOutOfBoundsException in ListView","<android>","1","2","1","",""
"3018834","1","3019173","","2010-06-10 21:52:50","0","110","<p>The sample in question is: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">CameraPreview</a></p><p>I was wondering what piece of code is making the preview become rotated 90 degrees to the left? I'm certain there's something very obvious I'm overlooking but I just can't seem to find the culprit. Thanks in advance, I really appreciate it.</p>","359850","","","","","2010-06-10 23:09:01","What is rotating the preview in the Android sample ""CameraPreview""?","<android>","1","0","","",""
"3019108","1","3019323","","2010-06-10 22:49:59","0","148","<p>When it comes to threads and orientation changes, it seems the normal thing to do is something like this:</p><pre><code>public class Bwent extends Activity {    private static Bwent instance;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        instance = this;    }    //...</code></pre><p>That way, if you're making a network request with a thread, and someone changes the orientation of the phone, the thread will know to use the new Activity.</p><p>However, is it possible that the thread could finish during the time Android is destroying the old Activity and creating a new one?</p><p>Is there a moment in the process where the thread still might be pointing to the wrong Activity, or a partially destroyed activity?</p><p>It seems like there shouldn't be, but even using a Handler created in the main thread, I'm having intermittent issues with a thread trying to update an object that no longer exists.  It's rare, but it does happen.</p>","238849","","","","","2010-06-10 23:41:29","More threads and orientation changes questions","<android>","1","0","","",""
"3019370","1","","","2010-06-10 23:57:35","0","1178","<p>I need to have two activities in an Android app that can be switched between each other with UI persistence as follows:</p><ol><li><p>Activity A launches Activity B.</p></li><li><p>User triggers some UI changes in Activity B.</p></li><li><p>Activity B returns to Activity A (by a call to <code>onBackPressed()</code> or something similar)</p></li><li><p>Activity A re-launches Activity B.</p></li></ol><p>I would like the changes made in step 2 to be visible in step 4.</p><p>I have tried using the <code>singleInstance</code> activity tag on Activity B to no avail.  I would also prefer a more elegant solution than simply writing all object properties to a file or SQLite table.It seems that this behaviour must be easily achievable given that Android does it automatically for calls to <code>onBackPressed()</code> where the parent Activity's UI is saved.</p><p>Any help is much appreciated.</p>","348010","","","","","2010-06-11 08:24:32","Android Activities UI Persistence","<android><user-interface><persistence><activity>","2","0","","",""
"3019571","1","","","2010-06-11 01:09:31","1","3108","<pre><code>  try {     Runtime rt = Runtime.getRuntime();     Process pcs = rt.exec(""ls -l /data"");     BufferedReader br = new BufferedReader(new InputStreamReader(pcs           .getInputStream()));     String line = null;     while ((line = br.readLine()) != null) {        Log.e(""line"",""line=""+line);     }     br.close();     pcs.waitFor();     int ret = pcs.exitValue();     Log.e(""ret"",""ret=""+ret);  } catch (Exception e) {     Log.e(""Exception"", ""Exception"", e);  }</code></pre><p>only print ""ret=0"",How to print the correct path?</p>","364112","","","","","2011-05-04 07:01:39","Can not access android /data folder?","<android>","4","0","","",""
"3019606","1","3026985","","2010-06-11 01:20:22","9","5421","<p>If I physically slide out the keyboard on my Moto Droid A855, it crashes my test app with the stack trace pasted below. I don't understand why? </p><p>Also, if I start my app with the keyboard out, my app crashes immediately on startup. </p><p>The app consists of an activity, which contains a viewflipper as the main view layout. The viewflipper contains two linearlayouts... </p><p>Stack trace: </p><pre><code>06-10 21:10:17.652 E/AndroidRuntime( 3785): Uncaught handler: thread main exiting due to uncaught exception06-10 21:10:17.668 E/AndroidRuntime( 3785): java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@447af0b806-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:667)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ApplicationContext.unregisterReceiver(ApplicationContext.java:747)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:321)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.widget.ViewFlipper.onDetachedFromWindow(ViewFlipper.java:104)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.View.dispatchDetachedFromWindow(View.java:5835)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1076)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1074)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1074)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1074)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1570)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewRoot.doDie(ViewRoot.java:2556)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.ViewRoot.die(ViewRoot.java:2526)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3498)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3599)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread.access$2300(ActivityThread.java:119)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1867)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.os.Handler.dispatchMessage(Handler.java:99)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.os.Looper.loop(Looper.java:123)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at java.lang.reflect.Method.invokeNative(Native Method)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at java.lang.reflect.Method.invoke(Method.java:521)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-10 21:10:17.668 E/AndroidRuntime( 3785):     at dalvik.system.NativeStart.main(Native Method)06-10 21:10:17.684 I/Process ( 1017): Sending signal. PID: 3785 SIG: 3</code></pre><p>EDIT: added XML layout and relevant snippets from main activity.</p><p>Entire XML layout file</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ViewFlipper        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/vFlipper""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;                &lt;!--  Linear Layout 1: messages and overview.  --&gt;                &lt;LinearLayout                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    &gt;                &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;                &lt;TextView                        android:text=""Connection info""                        android:id=""@+id/tvCon1""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:background=""#F0F0F0""                        android:textColor=""#FF0000""                        /&gt;                &lt;/TableRow&gt;                &lt;ScrollView                        android:id=""@+id/ScrollView01""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""&gt;                                &lt;TextView                                          android:id=""@+id/tvMessages""                                    android:layout_width=""fill_parent""                                    android:layout_height=""fill_parent""                                    android:text=""""                                    /&gt;                &lt;/ScrollView&gt;        &lt;/LinearLayout&gt;        &lt;!--  Linear Layout 2: settings --&gt;        &lt;LinearLayout                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    &gt;                &lt;TableRow                        android:id=""@+id/TableRow03""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""&gt;                                &lt;TextView                                android:text=""hello world""                                android:id=""@+id/asdfasdf2""                                android:layout_width=""fill_parent""                                android:layout_height=""wrap_content""                                /&gt;                &lt;/TableRow&gt;                        &lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;</code></pre><p>Code snippets from Main Activity: </p><pre><code>/** * Attempt (not currently working) to work around this bug: http://code.google.com/p/android/issues/detail?id=6191 * TODO: make it work. */@Overridepublic void onDetachedFromWindow() {        Log.d(""Dash"",""OnDetachedFromWindow()"");        try {        super.onDetachedFromWindow();    }    catch (Exception e) {        ViewFlipper v = (ViewFlipper)findViewById(R.id.vFlipper);        if (v != null) {                Log.d(""Dash"",""De-Bug hit. e="" + e.getMessage());                v.stopFlipping();        }    }}</code></pre>","268803","","268803","","2010-06-11 15:16:02","2012-05-24 15:09:48","Why does keyboard-slide crash my app?","<android><crash><viewflipper>","3","0","5","",""
"3019677","1","3019687","","2010-06-11 01:40:15","1","204","<p>Based on the user requirements, he wants to use our android application via pin code access like login whenever he starts to use this application. In Android or any mobile, most of the applications start again the last using layout. so which event should i call this login alertdialog to access each time users start to use it? Or let me know the better. Thank you.</p>","305732","","","","","2010-06-11 01:44:04","secure from unauthorised access","<android><password-protection>","1","0","","",""
"3019742","1","","","2010-06-11 01:59:48","2","2001","<p>im trying to build android from source on ubuntu 10.04. when i enter the repo command:</p><p>repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair</p><p>it get this error back</p><p>exec: 23: python: not found</p><p>any ideas.</p>","364133","","12423","","2010-06-11 22:40:46","2010-11-14 15:04:09","exec: 23: python: not found error?","<python><android>","1","1","","",""
"3019965","1","3019998","","2010-06-11 03:09:37","9","10593","<p>In edittext, after typing 'Enter' key, system make a new line inside it. I'd like to focus on next edittext, no new line. how to code? my code in xml is below</p><pre><code>    &lt;EditText    android:id=""@+id/txtNPCode""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""18sp""    android:layout_alignLeft=""@+id/lblNPCode""    android:layout_below=""@+id/lblNPCode""    android:layout_centerHorizontal=""true""/&gt;&lt;EditText    android:id=""@+id/txtCNPCode""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""18sp""    android:layout_alignLeft=""@+id/lblCNPCode""    android:layout_below=""@+id/lblCNPCode""    android:layout_centerHorizontal=""true""    /&gt;  </code></pre><p>I also caputer key code in setOnKeyListener</p><pre><code>        tCNPCode.setOnKeyListener(new OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event) {// TODO Auto-generated method stubif(keyCode == 66){ Toast.makeText(S_PCode.this,    ""Enter Key"",                    Toast.LENGTH_LONG).show();//tNPCode.setFocusable(true);    }return false;   }  });</code></pre>","305732","","305732","","2010-06-11 03:35:33","2013-02-12 13:19:02","KeyCode_Enter to next edittext","<android><edittext><setfocus>","4","0","3","",""
"3020405","1","3021005","","2010-06-11 05:33:08","3","2999","<p>I would like to know the best practices for running a Service every day at 4AM.</p><p>The way I <em>think</em> I should be doing it is to create a new repeating alarm using AlarmManager and having it run the service at 4AM.  Problem is, I'm not sure where to put the code to set the alarm.  </p><p>Do I do it in my main activity as one of the first tasks in the OnCreate method? Do I do some funky stuff with BroadcastReceivers and intents? What happens when a user updates my app? What happens when a user restarts?</p><p>Any help with these questions would be much appreciated :)  Sample code would be helpful as well!</p><p>Bara</p>","164312","","","","","2010-06-11 07:38:01","Android - Having a service run every day at 4AM","<android><broadcastreceiver><alarmmanager><android-service>","1","0","4","",""
"3020407","1","3039928","","2010-06-11 05:34:10","2","9673","<p>In one of my applications, I need to display all the wi-fi and Bluetooth devices which are paired to my mobile, and their signal strengths. With wi-fi, it's okay for me to display signal strength (RSSI). But I have a problem with the Bluetooth. I searched for some method which is suitable for this task; I found one method:</p><pre><code>intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE);</code></pre><p>But it is displaying only the new device RSSI which is not paired to my mobile. Is there any idea for getting all Bluetooth devices RSSI?</p>","362544","","1438733","","2013-03-09 16:17:55","2013-03-09 16:17:55","how to find Signal Strength of connected bluetooth devices","<android><bluetooth><rssi>","1","0","3","",""
"3020478","1","3020507","","2010-06-11 05:51:32","2","4811","<p>I m making an application which requires me to list all the images available on the SD-Card of the phone.</p><p>i tried querying the ContentResolver way i.e. </p><pre><code>Cursor image = getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, new String[]{Images.Media._ID,Images.Media.DATA,Images.Media.DISPLAY_NAME}, null, null, null);</code></pre><p>but without any result. Is there any way i can get the list or if thats not possible then is there any possible intent (e.g. PICK) by which i can allow the user to select a file and then access the path of the file the user selected??</p><p>Helppppp guys...</p>","238071","","","","","2012-04-05 18:08:32","Android list all images available","<android><list><image><cursor>","2","0","","",""
"3020612","1","","","2010-06-11 06:26:52","3","5426","<p>I have a program in which I would like to place an image at the coordinates of a touch event. I have the coordinates now I just need help with placing an image there. I will be using a drawable. </p><p>Edit**I also want to overlay it over another image. I cant find any documentation on this what so ever. I would think it should be easy.</p><p>Can anyone help me?</p><p>EDIT*<em>*</em>Got it, now I just have to figure out how to get the middle of the image at the touch spot and not the top left corner:</p><pre><code> final View touchView2 = findViewById(R.id.ImageView02);    touchView.setOnTouchListener(new View.OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            Log.v(""x,y"",event.getY()+"",""+event.getX());            touchView2.bringToFront();            int y = (int)event.getY();            int x = (int)event.getX();            touchView2.layout(x, y, x+48, y+48);                return true;        }    });</code></pre>","282475","","282475","","2010-06-11 21:17:09","2014-04-13 22:27:43","Place image at coordinates Android","<android><image>","3","0","","",""
"3020782","1","","","2010-06-11 06:59:36","0","2383","<p>Can anyone please provide me some example on how to save an image i fetch from websites into a cache. I had try to include the following function into my code and call it once i run the activity. </p><blockquote><pre><code>public void getRemoteImage(String imageUrl) {    imageUrl = ""http://marga.mobile9.com/download/thumb/295/sexylady7_xo6npovn.jpg"";      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();            CacheManager.saveCacheFile(imageUrl, cache_result);        } catch (Exception e) {            //return null;        }    }    bmp = BitmapFactory.decodeStream(cache_result.getInputStream());*/    Toast.makeText(context,""It works"", Toast.LENGTH_SHORT).show();    //return bmp;}</code></pre></blockquote><p>However, I got a nullPointerException. Can someone please help me with it as i'm quite new in android.</p><p>I got this from logcat :</p><pre><code>06-17 19:07:51.291: ERROR/AndroidRuntime(464): Uncaught handler: thread main exiting due to uncaught exception06-17 19:07:51.301: ERROR/AndroidRuntime(464): java.lang.RuntimeException: Unable to start activity ComponentInfo{mobile9.android.gallery/mobile9.android.gallery.GalleryWallpapers}: java.lang.NullPointerException06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.os.Handler.dispatchMessage(Handler.java:99)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.os.Looper.loop(Looper.java:123)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.main(ActivityThread.java:4310)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at java.lang.reflect.Method.invokeNative(Native Method)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at java.lang.reflect.Method.invoke(Method.java:521)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at dalvik.system.NativeStart.main(Native Method)06-17 19:07:51.301: ERROR/AndroidRuntime(464): Caused by: java.lang.NullPointerException06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.webkit.CacheManager.getCacheFile(CacheManager.java:296)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at mobile9.android.gallery.GalleryWallpapers.hahatest(GalleryWallpapers.java:558)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at mobile9.android.gallery.GalleryWallpapers.onCreate(GalleryWallpapers.java:132)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)06-17 19:07:51.301: ERROR/AndroidRuntime(464):     ... 11 more</code></pre>","679696","","261542","","2011-12-07 03:33:11","2012-06-13 02:34:16","android - how to cache an image from a remote site","<android><caching>","1","3","","",""
"3020866","1","","","2010-06-11 07:13:44","5","245","<p>I'm looking to build an application similar to Google Sky Map, and was wondering if it was possible to hook into any of the APIs it uses. If so, which ones? If not, how else can it be done?</p><p>From what i've read so far, I can do a search via an intent for any the objects in Google's sky map db.. but i'd like to have my own db of satellites going around the earth, and be able to track those, get reminders on fly-overs and so-on.. so i'd like to build this app, but i just need a jumping off point.</p><p>Thanks!</p>","350237","","","","","2011-11-11 03:40:15","Are the Sky Map APIs available?","<android>","1","0","1","",""
"3020889","1","3324137","","2010-06-11 07:18:32","1","1399","<p>I have an audio file in .3gp format on my Android device which I wishto upload to YouTube. I know that YouTube is a video upload site andthat I need to convert this sound file to video.</p><p>I just want an image to display all the time the audio is playing.</p><p>Google tells me there are number of tools that can help me. But I wantto do this via java code from my Android device.</p><p>Please help.</p><p>Thanks. </p>","236128","","236128","","2010-06-11 09:15:20","2010-10-29 02:40:56","Converting audio files(.3gp) to video with Album cover and uploading to YouTube","<java><android><youtube><youtube-api>","3","2","2","",""
"3020927","1","3021784","","2010-06-11 07:26:08","5","5912","<p>Hi guys i am using android ndk and for that i am trying to create a c header file using javah tool how to use and where to use this tool i am unable to understand so please any one can tell me the procedure how to do that i am waiting for the reply please.........</p>","343678","","149841","","2011-12-30 16:44:21","2011-12-30 16:44:21","How to Create C header file using Javah tool","<java><android><android-ndk><jni><javah>","1","0","1","",""
"3020968","1","3021015","","2010-06-11 07:33:43","3","4777","<p>I have a very small activity that must show an image.</p><p>If picture is not very small (for example 1.12 Mb 2560x1920) it produces out of memory on change screen orientation. I tried getDrawable.setCallback(null) but no luck.</p><p>Where am I wrong?</p><pre><code>public class Fullscreen extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    System.gc();    setContentView(R.layout.fullscreen);    ImageView imageView = (ImageView) findViewById(R.id.full_screen_image);    long imageId = 2;    imageView.setImageURI(Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, """" + imageId));    }}</code></pre>","357542","","","","","2013-07-09 12:50:41","Android setImageURI out of memory error","<android><image><memory>","4","0","","",""
"3021054","1","3789655","","2010-06-11 07:45:47","12","16838","<p>Is there any Java API for that? How can I read this information.</p>","31207","","","","","2013-09-25 06:39:23","How to read cpu frequency on android device","<android><api><cpu>","3","0","7","",""
"3021155","1","3021171","","2010-06-11 08:03:39","2","1012","<p>Is it possible to toggle WiFi radio (On/Off) programatically on android phones?thanks!</p>","445548","","","","","2013-11-11 13:40:22","Toggle WIFI radio programatically","<android><wifi>","3","0","","",""
"3021401","1","3080016","","2010-06-11 08:43:51","4","5171","<p>I need help on making the touched areas of bitmap image transparent(seems like erasing) while I am moving my finger on that image.</p><p>I am having a PNG file with Alpha channel in it. I want to turn the touched pixels to transparent so that, the user can feel that he is actually erasing it.</p><p>For this I am using frame layout to load 2 layers. Down layer is for content and upper layer is an Imageview for erasing. I need erase the upper layer when user touch and move his finger on it.</p><p>I am not getting how to make it transparent. can anyone please help me in this. If possible please direct me to any sample code, as I am very new to this image processing.</p><p>Thanks in advance. </p>","269304","","","","","2013-12-26 12:12:22","Making Overlaid image transparent on touch in Android?","<android><image-processing><android-custom-view>","3","0","8","",""
"3021816","1","3022303","","2010-06-11 09:56:01","1","617","<p>I have a <strong>TabView</strong> and on its first tab I have a <strong>ViewFlipper</strong> displaying <strong>two pages of ImageButtons</strong> (say <em>buttonsPage1</em> and <em>buttonsPage2</em>). </p><p>When in landscape orientation, I need the image buttons pages to be scrollable, so I tried to add a <strong>ScrollView</strong> on <em>buttonsPage1</em> and another on <em>buttonsPage2</em>. I get a StackOverflowError.</p><p>I tried then to suppress the ScrollView from the pageButtons1 and 2 and to include the ViewFlipper in a ScrollView. I got the same StackOverflowError.</p><p>If I completely remove the ViewFlipper, the applications runs as expected, no error occurs, only I <strong>DO</strong> need the scrolling when in landscape orientation.</p><p>Can anybody, please, give me hand to solve this issue?</p>","364420","","","","","2010-06-11 11:30:03","Android: Is it possible to have a scrollview in a flipper in a tabview?","<android><vertical-scrolling>","1","1","","",""
"3021825","1","3021855","","2010-06-11 09:56:58","3","859","<p>I want to trigger an application after the arrival of the sms. I using android based mobile phone. Can any body help?</p>","244884","","","","","2010-06-11 10:02:11","Triggering an application on the arrival of a message(sms) in android phone","<android>","1","0","0","",""
"3021977","1","","","2010-06-11 10:22:02","0","496","<p>I'd like to create a custom component which supports voice recognition. It will primarily be an extended EditText which should show the microphone button for voice recognition if it is available. I wanted to to look at the search app-widget on the homescreen but I don't find it in the source.</p><p>This is intended to use the voice recognition as some sort of dictation device, i.e. the user does not have to type but use his voice instead.</p><p>So could anyone please point me in some direction?<br>Thanks in advance,<br>Steff</p>","289849","","289849","","2010-06-11 10:28:40","2010-11-05 11:52:00","Custom component which displays voice recognition button if available","<android><extend><edittext><voice-recognition><appwidget>","1","0","","",""
"3022177","1","3024171","","2010-06-11 11:03:26","1","1350","<p>In web view, the overview mode method does not works in Android 1.6. Because of the API Level restrictions. is there any possible to show the web view in zoomed out completely? Any Idea?</p><p>WebSetting.Zoomdensity is available in API Level 7 only. </p>","267269","","267269","","2010-06-11 11:25:36","2012-12-17 06:53:05","Zoom out Problem on webview in Android 1.6?","<android><webview>","1","0","","",""
"3022187","1","","","2010-06-11 11:04:29","7","3141","<p>helloi hope someone put me on the right direction with my problem</p><p>i want to work on supporting my language, specially the writing on android</p><p>we use Arabic characters with little modification ( like parsi, urdu etc)..</p><p>i was hoping android has fully supported Arabic , then i would make changes to work with my language. but even 2.2 dosn't support Arabic . it just show Arabic characters and it is not connected.  that is ""????? "" is displayed ""? ? ? ? ?"".</p><p>some individuals have made <a href=""http://code.google.com/p/arabicandroid"" rel=""nofollow"">Arabic</a> support on CyanogenMod ROM's for some HTC phones, but they would not tell how they made it.I'v got the android source code, i want to know where to start, where to make changes , what is the library that handle fonts , shaping engine etc ..</p><p>ps : android.com and other android related google groups are blocked in my country. </p>","86169","","86169","","2010-06-11 11:17:10","2011-09-19 11:34:33","how to add language support to android","<android><kernel><source>","4","4","2","",""
"3022188","1","3022295","","2010-06-11 11:04:31","0","1615","<p>First of all i'm sorry for my english...  </p><p>I've a problem getting phone numbers from contacts.</p><p>That's my code</p><pre><code>import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.provider.ContactsContract;import android.widget.SimpleAdapter;import android.widget.Toast;import java.util.ArrayList;import java.util.HashMap;public class TestContacts extends ListActivity {private ArrayList&lt;HashMap&lt;String,String&gt;&gt; list = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;(); private SimpleAdapter numbers; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);  setContentView(R.layout.contacts);  numbers = new SimpleAdapter(     this, list,R.layout.main_item_two_line_row,new String[] { ""line1"",""line2"" },new int[] { R.id.text1, R.id.text2 }  );  setListAdapter( numbers );  Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,     null, null, null, null);   while (cursor.moveToNext()) {    String contactId = cursor.getString(cursor.getColumnIndex(      ContactsContract.Contacts._ID));    String hasPhone = cursor.getString(cursor.getColumnIndex(      ContactsContract.Contacts.HAS_PHONE_NUMBER));                     //check if the contact has a phone number   if (Boolean.parseBoolean(hasPhone)) { Cursor phones = getContentResolver().query(   ContactsContract.CommonDataKinds.Phone.CONTENT_URI,   null,   ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ""+ contactId,   null, null); while (phones.moveToNext()) {  // Get the phone number!? String contactName = phones.getString(    phones.getColumnIndex(      ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));  String phoneNumber = phones.getString(    phones.getColumnIndex(      ContactsContract.CommonDataKinds.Phone.NUMBER));  Toast.makeText(this, phoneNumber, Toast.LENGTH_LONG).show();      drawContact(contactName, phoneNumber);} phones.close();    }   }cursor.close(); } private void drawContact(String name, String number){  HashMap&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();  item.put( ""line1"",name);  item.put( ""line2"",number);  list.add( item );  numbers.notifyDataSetChanged(); }}</code></pre><p>It'seems that no contact have a phone number (i've added 2 contacts on the emulator and i've tried also on my HTC Desire). The problem is that if (Boolean.parseBoolean(hasPhone)) returns always false.. How can i get correctly phone numbers?</p><p>I've tried to call drawContact(String name, String number) before the if statement without querying for the phone number, and it worked (it draws two times the name). but on the LinearLayout they are not ordered alphabetically... how can i order alphabetically (similar to the original contacts app)?</p><p>thank you in advice,Luca</p>","364468","","","","","2012-02-05 14:01:02","get Phone numbers from android phone","<java><android>","1","0","","",""
"3022454","1","3024261","","2010-06-11 11:53:49","22","18374","<p>I'm wondering if and how one can load dex or class files dynamically in dalvik, some quick'n'dirty test function I wrote was this: </p><pre><code>    public void testLoader() {             InputStream in;             int len;             byte[] data = new byte[2048];             try {                     in = context.getAssets().open(""f.dex"");                     len = in.read(data);                     in.close();                     DexFile d;                     Class c = defineClass(""net.webvm.FooImpl"", data, 0, len);                     Foo foo = (Foo)c.newInstance();             } catch (IOException e1) {                     // TODO Auto-generated catch block                     e1.printStackTrace();             } catch (IllegalAccessException e) {                     // TODO Auto-generated catch block                     e.printStackTrace();             } catch (InstantiationException e) {                     // TODO Auto-generated catch block                     e.printStackTrace();             }     } </code></pre><p>whereas the Foo interface is this </p><pre><code>    public interface Foo {             int get42();     } </code></pre><p>and f.dex contains some dx'ed implementation of that interface: </p><pre><code>    public class FooImpl implements Foo {             public int get42() {                     return 42;             }     } </code></pre><p>The above test driver throws at defineClass() and it doesn't work and I investigated the dalvik code and found this: </p><p><a href=""http://www.google.com/codesearch/p?hl=en#atE6BTe41-M/vm/Jni.c&amp;q=Jni.c"">http://www.google.com/codesearch/p?hl=en#atE6BTe41-M/vm/Jni.c&amp;q=Jni.c</a>... </p><p>So I'm wondering if anyone can enlighten me if this is possible in some other way or not supposed to be possible. If it is not possible, can anyone provide reasons why this is not possible?</p>","4735","","","","","2012-10-25 21:12:14","How to load a Java class dynamically on android/dalvik?","<java><android><classloader><dalvik>","1","7","26","",""
"3022566","1","3027656","","2010-06-11 12:12:13","3","7000","<p>Retrieving data from the REST Server works well, but if I want to post an object it doesn't work:</p><pre><code>public static void postJSONObject(int store_type, FavoriteItem favorite, String token, String objectName) {        String url = """";        switch(store_type) {            case STORE_PROJECT:                url = URL_STORE_PROJECT_PART1 + token + URL_STORE_PROJECT_PART2;                 //data = favorite.getAsJSONObject();            break;        }        HttpClient httpClient = new DefaultHttpClient();        HttpPost postMethod = new HttpPost(url);        try {               HttpEntity entity = new StringEntity(""{\""ID\"":0,\""Name\"":\""Mein Projekt10\""}"");            postMethod.setEntity(entity);            HttpResponse response = httpClient.execute(postMethod);            Log.i(""JSONStore"", ""Post request, to URL: "" + url);            System.out.println(""Status code: "" + response.getStatusLine().getStatusCode());        } catch (ClientProtocolException e) {</code></pre><p>I always get a 400 Error Code. Does anybody know whats wrong?</p><p>I have working C# code, but I can't convert:</p><pre><code> System.Net.WebRequest wr = System.Net.HttpWebRequest.Create(""http://localhost:51273/WSUser.svc/pak3omxtEuLrzHSUSbQP/project"");            wr.Method = ""POST"";            string data = ""{\""ID\"":1,\""Name\"":\""Mein Projekt\""}"";            byte [] d = UTF8Encoding.UTF8.GetBytes(data);            wr.ContentLength = d.Length;            wr.ContentType = ""application/json"";             wr.GetRequestStream().Write(d, 0, d.Length);            System.Net.WebResponse wresp = wr.GetResponse();            System.IO.StreamReader sr = new System.IO.StreamReader(wresp.GetResponseStream());            string line = sr.ReadToEnd();</code></pre>","","anon","","anon","2010-06-11 13:36:49","2012-07-31 02:29:28","How to send a JSONObject to a REST service?","<java><android><json><rest>","3","5","2","",""
"3022891","1","","","2010-06-11 12:59:11","0","694","<p>I am trying to extract information from the call log of theandroid. I am getting the call date that is one month back from theactual time of call. I mean to say that the information extracted bymy code for the date of call is one mont back than the actual calldate.</p><p>I have the following in the Emulator:</p><p>I saved a contact. Then I made a call to the contact.</p><p>Code: </p><p>I have 3 ways of extracting call Date information but getting the samewrong result.  My code is as follows:</p><pre><code>/*  Make the query to call log content */Cursor callLogResult = context.getContentResolver().query(    CallLog.Calls.CONTENT_URI, null, null,  null, null);int columnIndex =  callLogResult.getColumnIndex(Calls.DATE);Long timeInResult = callLogResult.getLong(columnIndex);/* Method 1 to change the milliseconds obtained to the readable date formate */            Time time = new Time();            time.toMillis(true);            time.set(timeInResult);String callDate= time.monthDay+""-""+time.month+""-""+time.year;/*  Method 2 for extracting the date from tha value read from the column */           Calendar calendar =  Calendar.getInstance();           calendar.setTimeInMillis(time);           String  Month = calendar.get(Calendar.MONTH) ;/* Method 3 for extracting date from the result obtained  */          Date date = new Date(timeInResult);          String mont = date.getMonth()</code></pre><p>While using the Calendar method , I also tried to set the DayLightSAving Offset but it didnot worked,</p><pre><code>      calendar.setTimeZone(TimeZone.getTimeZone(""Europe/Paris""));      int DST_OFFSET = calendar.get(  Calendar.DST_OFFSET );   // DST_OFFSET      Boolean isSet = calendar.getTimeZone().useDaylightTime();      if(isSet)      calendar.set(Calendar.DST_OFFSET , 0);      int reCheck = calendar.get(Calendar.DST_OFFSET );</code></pre><p>But the value is not set to 0 in recheck.  I am getting the wrongmonth value by using this also.</p><p>Please some one  help me where I am wrong?  or is this the error inemulator ??</p><p>Thanks,Nishant KumarEngineering Student</p>","364551","","26494","","2012-08-13 20:21:37","2012-08-13 20:21:37","Cannot get Correct month for a call from call log history","<android>","2","0","1","",""
"3022972","1","","","2010-06-11 13:10:58","1","730","<p>How can we update the View of a Home Screen Widget on the onReceive method of AppWidgetProvider?.</p><p>I am trying to update the TextView of my Home screen widget but it seems that I cant access the TextView of my AppWidgetProvider on onReceive method. </p><p>Here is a sample code of my onReceive</p><pre><code>public void onReceive(Context context,Intent intent) {    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 {        if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) {            String msg = ""null"";            try {                msg = intent.getStringExtra(""msg"");            } catch (NullPointerException e) {            }            Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();            // code for gathering the text to update the TextView            }    }        super.onReceive(context, intent);}</code></pre>","364556","","","","","2010-06-11 13:17:27","Updating Android Home Screen TextView","<android><widget><homescreen>","1","0","","",""
"3023095","1","3023357","","2010-06-11 13:25:27","0","568","<p>The documentation describes the class as a helper object to create, open, and/or manage a database. Having that in mind wouldn't you say that the name is a little misleading?</p>","200145","","200145","","2010-06-11 13:31:29","2010-06-11 13:59:35","Why isn't the SQLiteOpenHelper called just SQLiteHelper?","<android><naming-conventions>","2","0","","",""
"3023164","1","5196735","","2010-06-11 13:34:55","1","2783","<p>Does anyone know of a walk-through or any examples of any code to setup sensors in android.</p><p>I have the drivers available to me.</p><p>Also i have implemented the sensors library as instructed<br>in the Android-Reference along the sensors.h template.</p><p>I am still unable to get any response at the apps level.</p><p>How do i trace this issue? what might be the problem?</p><p>Thanks in advance</p><hr><p><strong>UPDATE:</strong></p><p><strong>Jorgesys</strong>'s link below points to a great APP to test if the sensor drivers are functioning properly or not.</p><p>Now that i know they are not functioning, Any ideas of on where to dig??...</p>","319204","","319204","","2012-09-15 09:52:43","2013-11-27 14:47:15","How to implement/debug a sensor driver in ANDROID","<android><device-driver><linux-device-driver><sensor>","2","0","3","",""
"3023167","1","","","2010-06-11 13:35:11","2","939","<p>I am trying to search for a particular contact number in call log and in contact book of the android phone.<br>But I found that the contact number are stored in different way in contact book and call log.  For e.g. I have a contact number 9889880912 to search in the call log and contact book.</p><p>To do this, I do the following:</p><p>add a contact in the android emulator. When i write the contact number for the contact as 9889880912 , it automaticlly gets changed to 988-988-0912  The dash sign (-) are authomatically inserted in the contact number. I saved the number.</p><p>Make a call to this number from the emulator.</p><p>Now, using my code,          when I am searching for a contact number in contact list by 9889880912,it shows no result    when I am trying to search by contact number 988-988-0912 , the contact information from contact book is displayed.</p><p>However, when I am trying to search for 988-988-0912 in call log history, it is displayed. but when I am trying to search for 9889880912 in call history , I get no result.</p><p>Please help me in solving my problem.  Ho can I get the contact search by 9889880912 in contact book.</p><p>MY code :</p><pre><code>/**  Search from contact book  **/Cursor phoneResult = context.getContentResolver().query(     ContactsContract.CommonDataKinds.Phone.CONTENT_URI ,    columnNames,    queryString,    new String[] {String.valueOf(phoneNumber)},     null);if(phoneResult.getCount() &gt; 0)    Log.d(""DEBUG"",""at least one contact with phonenumber"");/**  Search from call log   **/Cursor callLogResult = context.getContentResolver().query(    callLogURI,     columnNames,    Calls.NUMBER + ""=?"",     new String[]{ String.valueOf(mobileNumber) },    null);if(callLogResult.getCount() &gt; 0)     Log.d(""DEBUG"",""At least one call Log found"");</code></pre><p>Please help me in solving my problem. I am stuck with this since a long time and cant find solution.</p>","364551","","206367","","2013-01-29 02:03:44","2013-01-29 02:03:44","Cannot get same Contact Number from Call log and Contact History in Android","<android>","1","0","1","",""
"3023226","1","3388910","","2010-06-11 13:42:42","18","15470","<p>What is the API call I need to make in Android 2.2 (Froyo) to create a Wifi hotspot (as seen in the Tethering and Portable Hotspot settings item).</p>","364593","","","","","2012-11-20 15:15:05","Android 2.2 wifi hotspot API","<java><android><wifi><jvm-hotspot>","3","2","27","",""
"3023556","1","","","2010-06-11 14:22:47","0","785","<p>hi  i am new to android programming, can someone please tell me how to get access to the files in a directory , i am using Environment.getExternalStorageDirectory() method?</p>","238505","","265570","","2011-07-02 07:26:20","2011-07-02 07:26:20","how to access the files in a directory ","<android>","1","0","","",""
"3023668","1","3023703","","2010-06-11 14:37:11","1","1728","<p>I have read on the market support that ""If you have previously published an application for free, you cannot change it to have a price.""</p><p>But I was wondering, if at the contrary I change my app from payed to free and after some time I want to re change it from free to payed! Can I? And if yes, do I have to wait some period (I have read something like this in the contract)?</p><p>Tnk's</p><p>Valerio From Italy</p>","314554","","1110748","","2013-01-20 21:17:33","2013-01-20 21:17:33","What if I change my Android App price to free and after i change idea?","<android><google-play>","3","0","","",""
"3023960","1","3024064","","2010-06-11 15:11:28","27","16292","<p>I am attempting to use a custom font for a TextView on Android, following the guide <a href=""http://whyandroid.com/android/177-fun-with-fonts.html"">here</a>  and <a href=""http://www.androidguys.com/2008/08/18/fun-with-fonts/"">here</a>. Using the same font, same code, same everything, I get this in adb logcat:</p><pre><code>W/dalvikvm(  317): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  317): FATAL EXCEPTION: mainE/AndroidRuntime(  317): java.lang.RuntimeException: Unable to start activity  ComponentInfo{org.evilx.quacklock/org.evilx.quacklock.MainActivity}:             java.lang.RuntimeException: native typeface cannot be madeE/AndroidRuntime(  317):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  317):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  317):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  317):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  317):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  317):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  317):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  317):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  317):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  317):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  317):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  317):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  317): Caused by: java.lang.RuntimeException: native typeface cannot be madeE/AndroidRuntime(  317):        at android.graphics.Typeface.&lt;init&gt;(Typeface.java:147)E/AndroidRuntime(  317):        at android.graphics.Typeface.createFromAsset(Typeface.java:121)E/AndroidRuntime(  317):        at org.evilx.quacklock.MainActivity.onCreate(MainActivity.java:24)E/AndroidRuntime(  317):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  317):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  317):        ... 11 moreW/ActivityManager(   59):   Force finishing activity org.evilx.quacklock/.MainActivityW/ActivityManager(   59): Activity pause timeout for HistoryRecord{43e80368 org.evilx.quacklock/.MainActivity}D/dalvikvm(  247): GC_EXPLICIT freed 711 objects / 53160 bytes in 20922ms</code></pre><p>Hmm... okay. I'm using the font Molot.otf, which was successfully used in one of the blogs. I'm also using predator.ttf, another custom font but in TrueType format</p><p>Relevant code:</p><pre><code>public class MainActivity extends Activity {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle icicle) {            super.onCreate(icicle);            Typeface tf = Typeface.createFromAsset(getAssets(), ""fonts/Molot.otf"");            TextView tv = (TextView) findViewById(R.id.CustomFontText);            tv.setTypeface(tf);        }    }</code></pre><p></p><p>and </p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;LinearLayout    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;    android:orientation=&quot;vertical&quot;    android:layout_width=&quot;fill_parent&quot;    android:layout_height=&quot;fill_parent&quot;&gt;    &lt;TextView        android:id=&quot;@+id/CustomFontText&quot;        android:layout_width=&quot;wrap_content&quot;        android:layout_height=&quot;wrap_content&quot;        android:textSize=&quot;30sp&quot;        android:text=&quot;Here is some text.&quot;&gt;        &lt;/TextView&gt;&lt;/LinearLayout&gt;</pre><p>What would be causing this? It worked for the people in the blogs, so why not me? Did something significant change in the API that's preventing me from doing this?</p>","342518","","","","","2013-10-20 09:45:58","Crash when loading font","<java><android>","7","5","3","",""
"3023975","1","4559269","","2010-06-11 15:13:54","0","1382","<p>Has anyone already used Flot in Android?</p><p>I've been reading this <a href=""http://rapidandroid.org/wiki/Graphing"" rel=""nofollow"">http://rapidandroid.org/wiki/Graphing</a> and i've re-used a code that i had that is working on a web site.</p><p>The problem is that the graphic doesn't render.</p><p>Something like this:</p><p>-------------- JAVASCRIPT THAT GETS THE DATA  --------------------</p><pre><code>    if ($('#newsStatsCheckbox').is(':checked')) {        $.ajax( {            url : mobileClippingStatistics.baseUrl                    + ""countNews.json?aggregation=""                    + $(""#aggregation"").val() + ""&amp;start=""                    + $(""#start"").val() + ""&amp;end="" + $(""#end"").val(),            type : ""GET"",            dataType : ""json"",            success : mobileClippingStatistics.addToGraphic,            error : function(xhr, ajaxOptions, thrownError) {                console.error(""News hits data is not available..."");                console.error(xhr.status);                console.error(thrownError);                alert(""News hits data is not available..."");            }        });    }</code></pre><p>------------- OTHER METHODS ----------</p><pre><code>          addToGraphic : function(jsonData) {    // To keep the colors the same      if (typeof jsonData == 'string') {        var splitData = jsonData.split("" "");        for ( var i = 0; i &lt; splitData.length - 1; i++) {            var json = eval('(' + splitData[i] + ')');            json.color = mobileClippingStatistics.plotDataColor;            mobileClippingStatistics.plotData.push(json);            mobileClippingStatistics.plotDataBackup.push(json);            var div = $(""&lt;div style='padding-right:10px; position:relative; float:left;' /&gt;"");            var label = $(""&lt;label/&gt;"");            label                    .html(mobileClippingStatistics.plotData[mobileClippingStatistics.plotData.length - 1].label);            var check = $('');            check.attr('id', ""checkbox""                    + mobileClippingStatistics.plotDataColor);            div.append(label);            div.append('&lt;input id=""checkbox'+mobileClippingStatistics.plotDataColor+'"" type=""checkbox"" checked=""checked"" onchange=""mobileClippingStatistics.refreshGraphic()"" /&gt;');            $(""#plotOptions"").append(div);            mobileClippingStatistics.plotDataColor++;        }    }    else {        jsonData.color = mobileClippingStatistics.plotDataColor;        mobileClippingStatistics.plotData.push(jsonData);        mobileClippingStatistics.plotDataBackup.push(jsonData);        div = $(""&lt;div style='padding-right:10px; position:relative; float:left;' /&gt;"");        var label = $(""&lt;label/&gt;"");        label                .html(mobileClippingStatistics.plotData[mobileClippingStatistics.plotData.length - 1].label);        check = $('&lt;input type=""checkbox"" checked=""checked"" onchange=""mobileClippingStatistics.refreshGraphic()"" style=""padding-right:10px; /&gt;');        check.attr('id', ""checkbox""                + mobileClippingStatistics.plotDataColor);        div.append(label);        div.append('&lt;input id=""checkbox'+mobileClippingStatistics.plotDataColor+'"" type=""checkbox"" checked=""checked"" onchange=""mobileClippingStatistics.refreshGraphic()"" /&gt;');        $(""#plotOptions"").append(div);        mobileClippingStatistics.plotDataColor++;    }    mobileClippingStatistics.plotGraphic();},</code></pre><p>plotGraphic : function() {</p><pre><code>    // Plot graphic    var plot = $.plot($(""#plot""), mobileClippingStatistics.plotData,            mobileClippingStatistics.options);    var overview = $.plot($(""#plotOverview""),            mobileClippingStatistics.plotData, {                series : {                    lines : {                        show : true,                        lineWidth : 1                    },                    shadowSize : 0                },                xaxis : {                    ticks : [],                    mode : ""time""                },                yaxis : {                    ticks : [],                    autoscaleMargin : 0.1                },                selection : {                    mode : ""x""                },                legend : {                    show : false                }            });    mobileClippingStatistics.showPlots();    $(""#plot"").bind(            ""plotselected"",            function(event, ranges) {                // do the zooming                plot = $.plot($(""#plot""),                        mobileClippingStatistics.plotData, $.extend(true,                                {}, mobileClippingStatistics.options, {                                    xaxis : {                                        min : ranges.xaxis.from,                                        max : ranges.xaxis.to                                    }                                }));                // don't fire event on the overview to prevent eternal loop                overview.setSelection(ranges, true);            });    $(""#plotOverview"").bind(            ""plotselected"",            function(event, ranges) {                // plot.setSelection(ranges);                $(""#plot"").html("""");                $.plot($(""#plot""), mobileClippingStatistics.plotData, $                        .extend(true, {}, mobileClippingStatistics.options,                                {                                    xaxis : {                                        min : ranges.xaxis.from,                                        max : ranges.xaxis.to                                    }                                }));            });},defineOptions : function() {    mobileClippingStatistics.options = {        lines : {            show : true        },        points : {            show : true        },        xaxis : {            mode : ""time""        },        yaxis : {            min : 0        },        grid : {            markings : mobileClippingStatistics.weekendAreas        }    };},</code></pre><p>The graphic doesn't render, although the divs/checkboxs with the data name render.</p><p>Ideias?</p>","327011","","327011","","2010-12-30 01:09:57","2010-12-30 01:13:49","Problem about using Flot + JQuery in Android","<jquery><android><flot>","1","4","","",""
"3024047","1","3036688","","2010-06-11 15:23:55","3","4646","<p>Greetings,</p><p>I'm trying to create a single-choice android control, in a horizontal layout, by making use of the RadioGroup behaviour. I can assign the drawable just fine, but i would like to position the label of each RadioButton inside the drawable, is this possible using the standard APIs?</p><pre><code>&lt;RadioGroup     android:id=""@+id/switchcontainer""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:checkedButton=""@+id/RadioButton02""    android:padding=""3dip""&gt;                 &lt;RadioButton         android:text=""id RadioButton02""         android:id=""@+id/RadioButton02""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:button=""@drawable/radio_button""        android:paddingRight=""2dip"" /&gt;    &lt;RadioButton         android:text=""@+id/RadioButton03""         android:id=""@+id/RadioButton03""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:button=""@drawable/radio_button""        android:paddingRight=""2dip"" /&gt;&gt; &lt;/RadioGroup&gt;</code></pre>","195450","","195450","","2010-06-22 16:17:20","2010-06-22 16:17:20","Android RadioButton like Behaviour","<android><radio-button><android-widget>","2","0","1","",""
"3024243","1","3024247","","2010-06-11 15:52:23","0","616","<p>The layout is basic: an EditText at the top followed by a ListView. EditText has a TextWatcher.onTextChanged implemented so that ArrayAdapter.getFilter.filter is called with the entered text. ArrayAdapter's data is refreshed asynchronously on resume (see code snippet below). Easy enough, works just fine too... right up until the screen orientation is changed. Why would filtering suddenly break when the phone is turned sideways? </p><pre><code>public class SometActivity extends ListActivity{    @Override    public void onCreate(Bundle savedInstanceState)    {        ...        listAdapter = new ArrayAdapter&lt;MemoryStatistic&gt;(this, R.layout.list_item);        setListAdapter(listAdapter);        searchText = (EditText)findViewById(R.id.searchText);        searchText.addTextChangedListener(new TextWatcher()        {            @Override            public void onTextChanged(CharSequence text, int start, int before, int count)            {                listAdapter.getFilter().filter(text);            }            ...        }        ...    }    @Override    protected void onResume()    {        asyncRefreshListAdapter();//refresh the data asynchronously when activity is resumed    }}</code></pre>","350103","","","","","2010-06-11 15:52:50","Why doesn't ArrayAdapter filter correctly after screen orientation change?","<android><filter><orientation><screen-orientation>","1","0","","",""
"3024335","1","","","2010-06-11 16:05:24","2","4371","<p>HiThis is with regards to post <a href=""http://stackoverflow.com/questions/2977572/smack-api-giving-error-while-logging-into-tigase-server-setup-locally"">here</a></p><p>I am able to connect my PC to the local tigase server setup locally(I am using Smack API). Now I am facing problems when I want to connect Android Phone to that server over Wi-Fi. I am able to connect to the local server by using client Beem for android.My XMPP Domain name of the server is my PC name ""mwbn43-1"" and IP address is ""192.168.0.221""(I am able to ping this server from Android Terminal Emulator). In Beem Settings there is an Advanced option where I can specify server I want to connect with(which I have given as IP address).If I don't set this option I am not able to conect.Now here is the snippet of the code I have used for my android client.</p><pre><code>    XMPPConnection.DEBUG_ENABLED = true;    ConnectionConfiguration config = new ConnectionConfiguration(""mwbn43-1"",5222);    //ConnectionConfiguration config = new ConnectionConfiguration(""192.168.0.221"",5222);                 config.setSASLAuthenticationEnabled(false);    config.setCompressionEnabled(false);    XMPPConnection xmpp = new XMPPConnection(config);    try {            xmpp.connect();             xmpp.login(""admin@mwbn43-1"", ""tigase"");            String host = xmpp.getHost();            String id = xmpp.getConnectionID();            int port = xmpp.getPort();            boolean i = false;            i = xmpp.isConnected();            if(i)            {answer = ""Connected to "" + host + "" via port "" + port + "" with ID "" + id;            answerfield.setText(answer);}          }//end try     catch (XMPPException e) {       answerfield.setText(""Failed to connect"");     Log.v(TAG, ""Failed to connect to "" + xmpp.getHost());            e.printStackTrace();</code></pre><p>I am also able to connect to google talk server with help of this code.While making connection with local server I tried giving IP adress as well as Host Name to connect.When I give IP addr(192.168.0.221) I get 'No response from server error' with stream:error(host-unknown) and when I give host name(mwbn43-1) I get 'remote-server-timeout(504)' with host unresolved.</p><p>I looked at the code of Beem to see how it connects with server but could not find much.I have also given user permissions for Internet.Can anyone please tell me what lines of code should I add to communicate with the local server.</p>","355833","","","","","2014-04-08 16:01:33","Not able to connect Android client with local XMPP server","<android><client-server><xmpp><smack><tigase>","5","2","","",""
"3024395","1","3024597","","2010-06-11 16:14:48","3","4753","<p>I have a ListView. When I select an item in the ListView, I would like to have a Subview slide in from the right, the way that it does in many Apps. </p><p>I have been searching for tutorials on this topic but am spinning  my wheels. Maybe Android uses a term different than ""Subview"" ?</p><p>Here's what I ended up doing:</p><ol><li><p>Create a New Class for the SubView</p></li><li><p>Add the Subview class to the Manifest with <code>&lt;activity android:name="".SubViewClassName"" /&gt;</code> inside the <code>&lt;application&gt;</code> tag</p></li><li><p>Add this to the main Class (""lv"" is the ListView)   </p><blockquote>  <p>lv.setOnItemClickListener(new OnItemClickListener() {<br>          public void onItemClick(AdapterView parent,  View view,int position, long id) {    </p><pre><code>       Intent myIntent = new Intent(view.getContext(),SubView.class);<pre><code>       startActivityForResult(myIntent, 0);  </code></pre>   } </code></pre>    <p>});</p></blockquote></li></ol>","300129","","300129","","2010-06-14 15:08:31","2013-10-07 19:01:16","Android ListView - Slide Subview in from Right?","<android><listview><subview>","4","4","5","",""
"3024420","1","3024435","","2010-06-11 16:18:40","3","1633","<p>I want to upload a txt file to a website, I'll admit I haven't looked into it in any great detail but I have looked at a few examples and would like more experienced opinions on whether I'm going in the right direction.</p><p>Here is what I have so far:</p><hr><pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();HttpContext localContext = new BasicHttpContext();private String ret;HttpResponse response = null;HttpPost httpPost = null;public String postPage(String url, String data, boolean returnAddr) {    ret = null;    httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);    httpPost = new HttpPost(url);    response = null;    StringEntity tmp = null;             try {        tmp = new StringEntity(data,""UTF-8"");    } catch (UnsupportedEncodingException e) {        System.out.println(""HTTPHelp : UnsupportedEncodingException : ""+e);    }    httpPost.setEntity(tmp);    try {        response = httpClient.execute(httpPost,localContext);    } catch (ClientProtocolException e) {        System.out.println(""HTTPHelp : ClientProtocolException : ""+e);    } catch (IOException e) {        System.out.println(""HTTPHelp : IOException : ""+e);    }             ret = response.getStatusLine().toString();            return ret;}</code></pre><hr><p>And I call it as follows:</p><hr><pre><code>postPage(""http://www.testwebsite.com"", ""data/data/com.testxmlpost.xml/files/logging.txt"", true));</code></pre><hr><p>I want to be able to upload a file from the device to a website.</p><p>But when trying this way I get the following response back.</p><hr><pre><code>HTTP/1.1 405 Method Not Allowed</code></pre><hr><p>Am I trying the correct way or should I be doing it another way?</p>","243999","","","","","2010-06-11 16:39:20","Android - How can I upload a txt file to a website?","<java><android><http><upload><http-post>","1","0","","",""
"3024624","1","3024642","","2010-06-11 16:50:25","2","16165","<p>Why is this so hard to find out?</p><pre><code>public boolean onTouch(View v, MotionEvent event)</code></pre><p>I need to convert <code>float event.getY()</code> to an int.</p><p>Is this possible?</p><p><code>event.getY().intValue()</code> will not work at all.</p><p>Any ideas?</p>","282475","","698590","","2012-08-22 14:24:11","2012-08-22 14:24:11","Android Float To Int","<android><floating-point><integer>","2","0","1","",""
"3024656","1","","","2010-06-11 16:54:40","26","48899","<p>How can I show a combobox in Android?</p>","655814","","496830","","2011-11-08 14:28:52","2013-04-16 21:19:47","How can I show a combobox in Android?","<android><combobox>","4","5","1","",""
"3024664","1","","","2010-06-11 16:55:58","2","408","<p>I'm running into an issue with the Quick Search Bar that I'm hoping someone can help me with.</p><p>My application includes a Searchable activity used to provide search behavior within my application.  That search activity is designed to trigger a separate Intent when the search item is clicked on so as to cause a different Activity to handle the viewing.  When used within the application, the search behavior works perfectly every time.</p><p>My application also includes a ContentProvider used to provide search suggestions and is also configured to allow use in the Quick Search Bar.  When used within the application itself, use of the search suggestions works fine every time it is used.  When triggered from the QSB, the initial search suggestion brings up the viewing activity just as it should.  After that point, however, any use of the search suggestions from within the application (i.e. bringing up the search and selecting a search suggestion) fails to trigger the viewing application.  In fact, I've put debug statements in every single ""onXXX()"" method within the Searchable activity and I never see any of them get triggered.  On the flip side, when I trigger a standard search at that same point (i.e. enter a query string and hit enter, rather than navigating to a search suggestion), the search dialog comes up, as expected, and selecting an item from that list successfully triggers my application.</p><p>I'm currently at a loss trying to determine why this would be occurring.  Any ideas</p><p>As as some additional information, my manifest contains the following in regards to the searchable activity ("".activity.SearchableActivity""), the suggestions provider ("".content.TestSuggestionProvider"") and the activity used to display the content ("".activity.TestDisplayActivity""):</p><pre><code>    &lt;activity         android:name="".activity.TestDisplayActivity""        android:label=""@string/app_name""        android:launchMode=""singleTask""        android:finishOnTaskLaunch=""true""        android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""        android:screenOrientation=""landscape""        android:configChanges=""orientation|keyboardHidden""&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;meta-data android:name=""android.app.default_searchable"" android:value="".activity.SearchableActivity"" /&gt;    &lt;/activity&gt;    &lt;activity         android:name="".activity.SearchableActivity""        android:launchMode=""singleTop""        android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&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;    &lt;provider         android:name="".content.TestSuggestionProvider""         android:authorities=""com.test.provider.suggest""         android:syncable=""false""         /&gt;</code></pre><p>And the following is the XML used to further define the settings of the searchable activity:</p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""    android:label=""@string/search_app_label""    android:hint=""@string/search_app_hint""    android:searchSettingsDescription=""@string/search_app_settings_description""    android:includeInGlobalSearch=""true""    android:voiceSearchMode=""showVoiceSearchButton|launchRecognizer""    android:searchSuggestAuthority=""com.test.provider.suggest""    android:searchSuggestIntentAction=""android.intent.action.VIEW""&gt;&lt;/searchable&gt;</code></pre><p>Any thoughts?  At the moment I'm at a complete loss…</p>","353320","","157882","","2011-10-14 05:06:03","2011-10-23 17:19:48","Search suggestions causing inconsistent behavior in application after triggered from Quick Search Bar","<android><search><quick-search>","0","0","1","",""
"3024983","1","3443358","","2010-06-11 17:45:44","14","12555","<p>I have an <code>ImageButton</code> in my app and I need to change the tint of the image when the button is <code>pressed/focused</code>. I have the <code>ImageButton</code> set to get its <code>src</code> from an XML file which as follows:</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;!-- pressed --&gt;    &lt;item         android:state_pressed=""true""        android:tint=""@color/black""        android:drawable=""@drawable/search""        /&gt;    &lt;!-- focused --&gt;    &lt;item         android:state_focused=""true""        android:tint=""@color/black""        android:drawable=""@drawable/search""        /&gt;    &lt;!-- default --&gt;    &lt;item        android:tint=""@null""        android:drawable=""@drawable/search""        /&gt;&lt;/selector&gt;</code></pre><p>However the tint isn't applied when the <code>ImageButton</code> is pressed or focused - the image just displays as normal. The color black is defined as <code>#000000</code> as always. Any ideas?</p>","290028","","1364896","","2014-03-12 15:48:43","2014-03-12 15:48:43","How do I change the tint of an ImageButton on focus/press","<android><image><selector><imagebutton><tint>","3","1","1","",""
"3024994","1","","","2010-06-11 17:47:36","0","1442","<p>I'm using Eclipse and have an emulator running Android 2.1 and my IntentService.  I'd like to step through my onHandleIntent() overridden function.  I've put in a breakpoint on the first statement of the function, which is Context context = getBaseContext();.  When the intent is called the program just fails and does not go to debug view in Eclipse.</p>","364800","","","","","2011-01-13 12:32:08","How do you debug an Android IntentService?","<android><eclipse><debugging><android-intent>","2","0","2","",""
"3025037","1","","","2010-06-11 17:53:36","1","487","<p>I have this App, which will help tune camera to to zoom in or zoom out and adjust contrast and stuff, but the image that camera focuses on is displayed with swapped vertical and horizontal axis. So when I run this app and focus on vertical text it is displayed as portrait and vice versa. It is not problem with the way we hold camera but the way text is displayed</p>","357349","","","","","2010-06-11 17:53:36","Droid camera screen upside down display","<android>","0","0","","",""
"3025048","1","4100694","","2010-06-11 17:55:09","11","9494","<p>I'm loading navigation from a website, where each item has a title, description, and image. I want to have all of the titles and descriptions centered along the same axis.</p><p>I'm using the following layout for each item in a ListView. It works fine when the images are half as wide as they are tall, but not if they are any wider - the text goes under the image.</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""    android:orientation=""horizontal""&gt;    &lt;LinearLayout        android:orientation=""horizontal""        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:layout_weight=""1""&gt;            &lt;TextView                android:layout_height=""wrap_content""                android:textSize=""10pt""                android:id=""@+id/title""                android:gravity=""center_horizontal""                android:layout_width=""fill_parent"" /&gt;            &lt;TextView                android:layout_height=""wrap_content""                android:id=""@+id/description""                android:layout_width=""fill_parent""                android:gravity=""center_horizontal"" /&gt;        &lt;/LinearLayout&gt;        &lt;View            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            android:layout_weight=""3"" /&gt;    &lt;/LinearLayout&gt;    &lt;ImageView        android:id=""@+id/icon""        android:adjustViewBounds=""true""        android:layout_width=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_centerVertical=""true""        android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Is it possible to force the image to stay at 25% of the RelativeLayout's width or less?</p>","347947","","","","","2013-01-22 19:42:44","Set ImageView's max width as a percent of its parent's width","<android><imageview>","1","0","4","",""
"3025089","1","","","2010-06-11 18:01:07","0","178","<p>How can I connect to and insert and select data from a database in Android?</p>","655814","","496830","","2011-11-08 13:48:19","2011-11-08 13:48:19","How can I work with a database in Android?","<android>","1","1","","",""
"3025163","1","","","2010-06-11 18:13:21","17","5310","<p>I'm creating a game and I would like to display a simple ""score""-animation to the player when credits are given to him. This is the view I throw onto the screen:</p><pre><code>public class Score extends FrameLayout {  public Score(Context context, int score) {    super(context);    TextView txt = new TextView(context);    txt.setText(String.valueOf(score).toUpperCase());      addView(txt);    Animation anim = AnimationUtils.loadAnimation(context, R.anim.score);    startAnimation(anim);    anim.setAnimationListener(animationListener);  }  private void Remove(){    ViewGroup parent = (ViewGroup)getParent();      parent.removeView(this);  }   private AnimationListener animationListener = new AnimationListener() {    @Override    public void onAnimationEnd(Animation animation) {      Remove();    }    };}</code></pre><p>This code actually works pretty well as long as there is only ONE score animation on screen at any given time. If the player scores again, before the last score was removed, the app crashes - probably because the second score gets the event to remove itself during animation.. Is this a bad practice of using Animation? How would you guys handle this?</p>","364821","","","","","2011-02-02 15:06:39","How to remove a View when animation ends?","<android>","1","0","6","",""
"3025185","1","3025369","","2010-06-11 18:16:02","4","2791","<p>In my app I bring up a context menu on long click in a ListActivity.  One of the options ""Priority"" pops up an AlertDialog with 3 radio button choices.  The problem is, it displays an empty dialog box without my 3 choices, or the message that I set.  Here is my code..</p><pre><code>protected Dialog onCreateDialog(int id) {    AlertDialog dialog;    switch(id) {    case DIALOG_SAB_PRIORITY_ID:        final CharSequence[] items = {""High"", ""Normal"", ""Low""};        AlertDialog.Builder builder = new AlertDialog.Builder(SabMgmt.this);        builder.setMessage(""Select new priority"")               .setSingleChoiceItems(items, 0, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();            }        });        dialog = builder.create();                    break;    default:        dialog = null;    }    return dialog;}</code></pre><p>If I replace the .setSingleChoiceItems with a positive and negative button instead, it displays the buttons and the message as expected.  What am I doing wrong in setting up my list of radio buttons?  Here is my calling code as well..</p><pre><code>public boolean onContextItemSelected(MenuItem item) {    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();    switch (item.getItemId()) {    case R.id.sabdelete:        // Correct position (-1) for 1 header        final SabQueueItem qItem = (SabQueueItem) itla.getItem(info.position-1);        SabNZBdUtils.deleteItem(qItem.getNzo_id());        getQueue();        ListView lv = getListView();        View v = lv.findViewById(R.id.sablistheader);        setHeader(v);        itla.notifyDataSetChanged();        return true;    case R.id.sabpriority:        showDialog(DIALOG_SAB_PRIORITY_ID);        return true;    default:        return super.onContextItemSelected(item);    }}</code></pre>","326430","","","","","2010-06-11 18:44:48","Android AlertDialog not showing radio buttons or message","<android><radio-button><alertdialog>","1","0","1","",""
"3025284","1","3025375","","2010-06-11 18:30:01","3","1680","<p>I'm trying to create a setup activity for my Android application which my users would see the first time they opened the app, but never again unless they wanted to redo the setup. How do I create this setup activity as the first activity without giving it MAIN/LAUNCHER intent-filters? (I want to use those for my home activity.)</p>","364832","","","","","2013-03-09 14:59:45","One time Android setup screen?","<android>","1","0","1","",""
"3025299","1","3025346","","2010-06-11 18:33:10","2","3865","<p>I'm starting a service in my application using startService.</p><p>I do not want to use bindService as I want to handle the service life time myself.</p><p>How can I get an instance to the service started if I do not use bindService? I want to be able to get a handler I've created in the service class to post messages from the activity.</p><p>Thanks.</p><p>/ Henrik</p>","226342","","","","","2012-09-17 11:11:54","How to get Android Local Service instance","<android><service>","1","0","","",""
"3025468","1","","","2010-06-11 18:59:08","2","4085","<p>I have created a widget that is an extension of <code>SurfaceView</code> (very similar to <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/VideoView.java;h=8142a823474ebb6c00b5b52697e270dafbe0c4ec;hb=HEAD"" rel=""nofollow"">VideoView</a>) and I am working on a feature to stretch the video fully across the device screen when certain action is taken. I've looked at <code>onMeasure</code> function of <code>VideoView</code> and re-wrote it this way:</p><pre><code>@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    if (mStretchVideo) {        super.onMeasure(widthMeasureSpec, heightMeasureSpec);    } else {        int width = getDefaultSize(mVideoWidth, widthMeasureSpec);        int height = getDefaultSize(mVideoHeight, heightMeasureSpec);        if (mVideoWidth &gt; 0 &amp;&amp; mVideoHeight &gt; 0) {            if (mVideoWidth * height &gt; width * mVideoHeight) {                height = width * mVideoHeight / mVideoWidth;            } else if (mVideoWidth * height &lt; width * mVideoHeight) {                width = height * mVideoWidth / mVideoHeight;            }        }        setMeasuredDimension(width, height);    }}</code></pre><p>This seems to work fine if I completely stop the video and start playing again. Now I am trying to force the refresh of this <code>SurfaceView</code> after setting the stretch flag so that the video gets stretched while it is playing, but I couldn't figure out how to force a refresh on <code>SurfaceView</code>. I tried <code>android.view.View.invalidate()</code>, <code>android.view.View.refreshDrawableState()</code> and calling <code>android.view.View.measure(int, int)</code> directly with different combinations but did not get any success. Any ideas?</p>","231747","","231747","","2010-06-11 19:06:12","2012-11-12 10:45:09","Stretch video to full screen in a SurfaceView extension","<android><android-widget>","2","0","1","",""
"3025526","1","3025723","","2010-06-11 19:09:25","1","303","<p>In the <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">Supporting Multiple Screens</a> document in the Android Dev Guide, some <a href=""http://developer.android.com/guide/practices/screens_support.html#range"" rel=""nofollow"">example screen configurations</a> are given.  One of them states that the <code>small-ldpi</code> designation is given to QVGA (240x320) screens with a physical size of 2.6""-3.0"".  According to <a href=""http://members.ping.de/~sven/dpi.html"" rel=""nofollow"">this DPI calculator</a>, a 2.8"" QVGA display equates to 143 dpi.  However, further down the page the document <a href=""http://developer.android.com/guide/practices/screens_support.html#qualifiers"" rel=""nofollow"">explicitly states</a> that all screens over 140 dpi are considered ""medium"" density.</p><p>So which is it, <code>ldpi</code> or <code>mdpi</code>?  Is this a mistake?  Does anyone know what the HTC Tattoo or similar device actually reports?  I don't have access to any devices like this.</p><p>Also, with the recent publishing of this document, I'm glad to see we <em>finally</em> have an explicit statement of the exact DPI ranges of the three density categories.  But why haven't we been given the same for the <code>small</code>, <code>medium</code>, and <code>large</code> screen size categories?  I'd like to know the exact ranges for all these.</p><p>Thanks in advance for your help!</p>","213525","","","","","2010-06-11 19:42:34","Does the ""Supporting Multiple Screens"" document contradict itself?","<android>","1","0","","",""
"3025657","1","","","2010-06-11 19:29:55","6","12594","<p>I have a <a href=""http://developer.android.com/reference/android/webkit/WebView.html"">WebView</a> which I'm trying to have scale to a certain percent on loading the page. The iPhone version of this software uses the HTML meta-tag:</p><pre><code>&lt;meta name=""viewport"" content=""width=320, initial-scale=0.95, maximum-scale=2.0, user-scalable=1""&gt;</code></pre><p>Since Android's WebView doesn't seem to respect that tag I hard-coded the percent using <a href=""http://developer.android.com/reference/android/webkit/WebView.html#setInitialScale%28int%29"">setInitialScale()</a>. However, the WebView is just flat-out ignoring this method call. No matter what number I put in there it shows at 100%.</p><p>Ideas?</p><p><strong>Update:</strong> It's not working in the emulator, on my Droid (Motorola), or on my G1 (HTC).</p>","76835","","76835","","2010-06-11 22:27:07","2011-09-29 03:26:14","Android WebView not respecting scaling percentage","<android><webview>","6","2","9","",""
"3025832","1","3025855","","2010-06-11 20:01:59","0","2380","<p>I have working in Facebook for my app in Android. I have to use the string to pass as a url. But my description value has a lot of spaces and line breaks. I have to rectify while passing that value as url without spaces. But it will poste on the facebook wall with the spaces. Is it possible? Any Idea.</p>","267269","","914220","","2012-09-12 10:09:25","2013-03-26 16:23:53","how to replace the \n in java?","<java><android>","2","2","","",""
"3025939","1","","","2010-06-11 20:19:09","4","2072","<p>I'd like to make an Android app that lets a user apply cool effects to photos taken with the camera. There are already a few out there, I know, but I'd like to try my own hand at one. </p><p>I have been googling and stack-overflowing, but so far I've mostly found some references to published papers or books. I am ordering this one from Amazon presently - <a href=""http://rads.stackoverflow.com/amzn/click/1846283795"" rel=""nofollow"">Digital Image Processing: An Algorithmic Introduction using Java</a></p><p>After some reading, I think I have a basic understanding of manipulating the RGB values for all the pixels in the image. My main question is how do I come up with a transformation that produces cool effects?</p><p>By cool effects I mean some like those in these iPhone apps:</p><ul><li><a href=""http://artandmobile.com/toycamera"" rel=""nofollow"">ToyCamera</a></li><li><a href=""http://itunes.apple.com/us/app/polarize/id301027161?mt=8#"" rel=""nofollow"">Polarize</a></li></ul><p>I already have quite a bit of experience with Java, and I've made my first app for android already. Any ideas? Thanks in advance.</p>","72315","","72315","","2010-06-11 20:55:26","2011-06-21 17:45:29","How can I create photo effects in Android?","<android><algorithm><image-processing><photo>","1","2","4","",""
"3026291","1","3072317","","2010-06-11 21:12:28","0","1164","<p>When i'm in onActivityResult and i try to show a custom progress dialog,<br>The dialog is not show, but the function is called, but nothing is displayed<br>If i put this dialog in Oncreate it's working i see the dialogbox,Is it possible to show a custom dialog on return of Intent.ACTION_GET_CONTENT / MediaStore.ACTION_IMAGE_CAPTURE</p><p>Thanks</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {  Parseur UploadPhoto = new Parseur();  showDialog(PROGRESS_DIALOG);  if (requestCode == z_const.REQUEST_INTENT_CODE_PHOTO_CHOISIR) {   String selectedImagePath;   Uri selectedImageUri;   if (data != null){    selectedImageUri = data.getData();    selectedImagePath = getPath(selectedImageUri);    Log.e(TAG, ""PHOTO CHOISIR "" + selectedImagePath+""Res""+resultCode);    UploadPhoto.uploadPhoto(InfoPasse,selectedImagePath);   }  }  finish(); } protected Dialog onCreateDialog(int id) {  Log.e(TAG,"" DIAL appeller ""+id);  switch(id) {  case PROGRESS_DIALOG:   progressDialog = new ProgressDialog(Photo.this);   progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);   progressDialog.setMessage(""Loading..."");   progressThread = new ProgressThread(handler);   progressThread.start();   return progressDialog;  default:   return null;  } }</code></pre>","144587","","243782","","2010-06-11 21:14:08","2010-06-18 18:48:56","Android : showDialog not displayer inside onActivityResult after take photo","<android><dialog>","1","0","","",""
"3026368","1","3096502","","2010-06-11 21:30:13","0","213","<p>When I add the following line to my GLSurfaceView class I get an IllegalArgumentException from some random place. I don't know where the problem is because it doesn't give a stack trace.</p><pre><code>setEGLContextClientVersion(2);</code></pre><p>What else do I need to do to get an OpenGL ES 2.0 application to work?</p><p>NB: I'm trying to run the application on the emulator.</p>","986","","986","","2010-06-22 19:36:50","2010-06-22 19:37:33","IllegalArgumentException when trying to run an OpenGL ES 2.0 application","<android><opengl-es>","1","0","","",""
"3026389","1","","","2010-06-11 21:35:33","15","8950","<p>I've written an app which contains a large textview for displaying notes.  Is it possible to have the textview highlight any phone numbers or hyperlinks without underlining the entire view?</p>","364947","","","","","2011-03-01 03:49:09","TextView underline phone number and hyperlink","<android>","2","0","3","",""
"3026639","1","3026680","","2010-06-11 22:23:36","1","8971","<p>I need a help with setting a random image using setImageResource method.In the drawable folder, I have a jpeg file named photo0.jpg, photo1.jpg...photo99.jpg.And the following code works:</p><pre><code>int p = R.drawable.photo1;image.setImageResource(p);</code></pre><p>The above will display photo1.jpg but I want to show a random image.I tried the following but it doesn't work.</p><pre><code>String a = ""R.drawable.photo"";int n = (int) (Math.random()*100)String b = Integer.toString(n);String c = a+b;int p = Integer.parseInt(c);//checkpointimage.setImageResource(p);</code></pre><p>It seems like the string ""R.drawable.photoXX"" isn't being changed to integer at the checkpoint.Could someone please teach me a right code?Thank you in advance.</p>","364970","","81398","","2011-05-20 20:24:15","2011-08-20 07:05:38","Android: Set a random image using setImageResource","<android>","2","0","0","",""
"3026707","1","3026950","","2010-06-11 22:41:57","-1","88","<p>I'd started for about a mouth and I have some problems now  :(</p><p>1.I create a TabActivity and it has three Activity(tab1,tab2,tab3).I wanna realize that if I press a button in tab1,then TextView in tab2 can be changed. I've tried Intent and Bundle , but that didn't work and force close  . Maybe because of the TabActivity I think .</p><p>2.If I have a layout and there are many TextView on it. But some are out of the screen. How can I scroll the screen? </p><p>3.Is it possible that TextView in Tablelayout can be clicked ?</p><p>I've sreached there problems on Google for there days but still bother me . Really need help, Thanks  :)</p>","364979","","","","","2010-06-11 23:58:32","I'm new one in Android and HELP :)","<android>","1","3","","",""
"3026721","1","","","2010-06-11 22:46:07","2","2666","<p>I have set negative paddings on my custom seekbar so that the round thumb image can go outside the bar, but the thumb isn't rendered out there, is there anyway to force the thumb to be drawn outside those bounds?</p><p>Sorry guys, I'm new to Android development, and have been tasked with fixing an existing application. The problem is that we have a custom rounded looking track bar, which consists of two rounded 'end cap' images and a 1 px background that is tiled to create the seekbar. As far as I can tell there was never one image that could be set as the background of a normal SeekBar, which is why a custom one was created. </p><p>The thumb is a circle and needs to 'fit' into the end caps - the three pieces of the bar are in a relative layout. Right now I'm kind of unclear as to how the 1 px background png gets stretched as the seekbar bg, otherwise I would try to tack on the two endcaps onto that drawable some how ... ?  </p><p>Please let me know if this was unclear and I'll try to post any followup info. Thanks in advance for any advice!!</p><p>Oh, I'm using Android 2.1 if that's relevant to anyone's interests :)</p><p>EDIT: Here is screenshots (sadly I can't post the images directly bc I'm a new user :(</p><p>This is what it looks like when the thumb all the way over - outside of the seekbar. Ideally what I need is for the thumb to be shown as 'inside' the endcap image :-/<a href=""http://po-ko.com/android/device.png"" rel=""nofollow"">http://po-ko.com/android/device.png</a></p>","364937","","364937","","2010-06-14 14:05:56","2012-09-14 12:50:03","Is it possible to have a SeekBar's thumb image extend outside the bar?","<android><offset><margins><seekbar><thumb>","3","2","1","",""
"3026750","1","3027998","","2010-06-11 22:52:16","1","3551","<p>I would manipulate the contact groups in Android 2.O. My code is following:</p><p>To get a list of group (with id and title):</p><pre><code>final String[] GROUP_PROJECTION = new String[] { ContactsContract.Groups._ID, ContactsContract.Groups.TITLE };Cursor cursor = ctx.managedQuery(ContactsContract.Groups.CONTENT_URI, GROUP_PROJECTION, null, null, ContactsContract.Groups.TITLE + "" ASC"");</code></pre><p>Later, on an ListView, I select a group (onClick event) and read all contacts belong to this selected group by following code:</p><pre><code>    String where = ContactsContract.CommonDataKinds.GroupMembership.GROUP_ROW_ID            + ""=""            + groupid            + "" AND ""            + ContactsContract.CommonDataKinds.GroupMembership.MIMETYPE            + ""='""            + ContactsContract.CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE            + ""'"";</code></pre><p>Problem: ContactsContract.Groups._ID in the first query does not match with the ContactsContract.CommonDataKinds.GroupMembership.GROUP_ROW_ID in the second query.</p><p>Any solution/suggestion?</p><p>Thanks </p>","301132","","","","","2011-05-25 07:00:41","Android 2.0 contact groups manipulation","<android><contacts><groups>","1","0","2","",""
"3026861","1","","","2010-06-11 23:28:50","1","1160","<p>I searched in the web but i couldn find a single article dealing in a straight forward way on how to find the vibrate on/off logs in logcat. If anybody who is aware of the procedure, please enlighten me. Once again i need it specifically to check if my app triggers vibrator or not... </p>","347783","","","","","2010-06-12 19:12:52","How to check if vibration happened, in logcat?","<android><android-emulator>","1","0","","",""
"3027066","1","3027225","","2010-06-12 00:57:39","63","95983","<p>I want to send  the following <code>JSON</code> text <code>{""Email"":""aaa@tbbb.com"",""Password"":""123456""}</code> to a web service and read the response. I know to how to read <code>JSON</code>. The problem is that the above <code>JSON</code> object must be sent in a variable name <code>jason</code>. </p><p>How can I do this from android? What are the steps such as creating request object, setting content headers, etc.</p>","365019","","109941","","2014-02-27 03:00:55","2014-04-05 18:33:52","How to send a JSON object over Request with Android?","<android><json><post><httprequest>","4","0","70","",""
"3027140","1","3027147","","2010-06-12 01:31:06","0","1037","<p>In my app I have a textView which contains real-time messages from my app, as things happen, messages get printed to this text box. Each message is time-stamped with HH:MM:SS. </p><p>Up to now, I had also been chasing what seemed to be a memory leak, but as it turns out, it's just my time-stamp formatting method (see below), It apparently produces thousands of objects that later get gc'd. For 1-10 messages per second, I was seeing 500k-2MB of garbage collected every second by the GC while this method was in place. After removing it, no more garbage problem (its back to a nice interval of about 30 seconds, and only a few k of junk typically)</p><p>So I'm looking for a new, more lightweight method for producing a HH:MM:SS timestamp string :)</p><p>Old code: </p><pre><code>/** * Returns a string containing the current time stamp.  * @return - a string.  */public static String currentTimeStamp() {    String ret = """";    Date d = new Date();    SimpleDateFormat timeStampFormatter = new SimpleDateFormat(""hh:mm:ss"");    ret = timeStampFormatter.format(d);    return ret;}</code></pre>","268803","","","","","2010-06-12 01:38:02","Getting a nicely formatted timestamp without lots of overhead?","<java><android><time><formatting>","1","0","","",""
"3027218","1","3027395","","2010-06-12 02:13:26","0","279","<p>I'm very new to java and am working on my first Android app. I am using the webview demo as a template. I am trying to generate a random integer between 1 and 12 and then call a certain javascript function based on the result. Here's what I have:</p><pre><code>int number = 1 + (int)(Math.random() * ((12 - 1) + 1));number = (int) Math.floor(number);String nextQuote = ""javascript:wave"" + number + ""()"";mWebView.loadUrl(nextQuote);</code></pre><p>So <code>mWebView.loadUrl(nextQuote)</code> will be the same as something like <code>mWebView.loadUrl(""javascript:wave1()"")</code></p><p>I just want to know if what I have here is correct and will work the way I think it will. The application isn't responding as expected and I suspect this bit of code is the culprit. </p>","90903","","139985","","2010-06-12 03:30:54","2010-06-12 09:36:24","generating function arguments in java","<java><android>","2","0","","",""
"3027243","1","3027639","","2010-06-12 02:30:25","2","1063","<p>I realize that it would probably require boosting antenna power and thus reduce battery life but, if I am prepared to accept that, can I programatically extend wifi range?</p><p>I don't find anything at <a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/net/wifi/WifiManager.html</a></p>","192910","","192910","","2010-06-12 02:39:30","2012-06-28 23:44:31","Android: can I programatically extend wifi range?","<android>","2","0","0","",""
"3027428","1","3028518","","2010-06-12 04:00:52","4","3459","<p>I have a Cursor that returns rows I use with a SimpleCursorAdapter to populate a ListView.  I would like to filter some of the rows so they don't get displayed in my ListView.  I use the data from the rows elsewhere in my Activity so I don't want to change my SQL to filter them with a WHERE clause.</p><p>What is the best way to keep a row from being displaying in my ListView?  Ideally I would check a column in my row and then only add rows to the ListView that satisfy a condition.</p>","233202","","","","","2013-04-17 00:46:45","Filter rows from Cursor so they don't show up in ListView","<android>","2","2","6","",""
"3027866","1","","","2010-06-12 07:24:49","1","324","<p>Recently myself and a small group of friends became interested in developing a game for a mobile platform. Originally we considered the iPhone but none of us use macs, so we decided Android would be a more realistic platform to use. Before we get started, I was hoping that I might find some answers to a couple questions so we don't waste our time if this project isn't feasible. Any help is appreciated!</p><ol><li><p>I can't seem to find out how many programming languages Android supports. Java is obvious, but what about C+? It seems that Android supports C and C++ through Eclipse, but is that it? (I'm not the programmer for the project which is why I'm asking this. He's comfortable in C+).</p></li><li><p>Our game involves the use of two digital analog sticks (it's not a twin-stick shooter but it's a similar concept). It would seem that most Droid devices unfortunately don't use multi-touch though... Are there many devices out there right now which support this functionality and I'm just not seeing them, or should we possibly consider the development of a different game that would only use a single input?</p></li><li><p>Assuming there's no snags following those first two questions, what would you consider the best screen resolution to develop in? It seems like there are a variety of resolutions out there right now and we can't decide which is the best to use.</p></li></ol><p>Again, any answers are appreciated!</p>","365123","","","","","2010-06-12 19:47:17","Want to develop for Android. Have a few basic, non-FAQ questions","<android>","3","2","1","",""
"3028221","1","5248027","","2010-06-12 09:51:30","7","5018","<p>I want to set property ""Layout to right of"" of control at runtime in android. Actually I want to adjust controls when screen changes orientation.</p>","301549","","","","","2011-03-09 15:28:59","programmatically set ""Layout to right of"" property in android","<android>","1","1","2","",""
"3028306","1","3028660","","2010-06-12 10:22:56","339","159112","<p>I am trying to write a simple application that gets updated. For this I need a simple function that can download a file and show the current progress in a ProgressDialog. I know how to do the ProgressDialog, but I'm not sure how to display the current progress and how to download the file in the first place.</p>","363606","","244296","","2010-06-12 13:05:37","2014-02-10 00:17:04","Download a file with Android, and showing the progress in a ProgressDialog","<java><android><download><android-asynctask>","5","2","382","",""
"3028332","1","3028782","","2010-06-12 10:30:11","3","1720","<p>I have made a Custom Component in XML, consisting of a button with an imageview stacked on top of it:</p><pre><code>&lt;myapp.widget.ClearableCaptionedButtonxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;Button    android:id=""@+id/ccbutton_button""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_vertical|left""    android:textAppearance=""?android:attr/textAppearanceMedium""    android:background=""@android:drawable/edit_text""/&gt;&lt;ImageView    android:id=""@+id/ccbutton_clear""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginRight=""5dip""    android:layout_alignRight=""@id/ccbutton_button""    android:layout_alignTop=""@id/ccbutton_button""    android:layout_alignBottom=""@id/ccbutton_button""/&gt;  &lt;/myapp.widget.ClearableCaptionedButton&gt;</code></pre><p>extract of java source code:</p><pre><code>public class ClearableCaptionedButton extends RelativeLayout implements OnClickListener {...public ClearableCaptionedButton(Context context, AttributeSet attrs) {    super(context, attrs);// some stuff that works fine}..protected void onFinishInflate() {  super.onFinishInflate();  mButton = (Button) findViewById(R.id.ccbutton_button);  mClear = (ImageView) findViewById(R.id.ccbutton_clear);  mButton.setText("""");  // error here: mButton == null}</code></pre><p>My problem is similar to <a href=""http://stackoverflow.com/questions/1691569/findviewbyid-returns-null-for-custom-component-in-layout-xml-not-for-other-com"">this</a> one. When i try to find the views inside the custom compound, findViewById returns null. But, as you can see, i already added super(context, attrs); to the constructor.i am using the custom component directly in xml layout, like this:</p><pre><code>&lt;LinearLayout&gt;&lt;!-- some stuff --&gt;&lt;myapp.widget.ClearableCaptionedButton                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    app:caption=""to""/&gt;&lt;/LinearLayout&gt;</code></pre><p>can anybody spot something? thanks.</p>","333350","","333350","","2010-06-12 18:02:49","2010-06-12 18:02:49","Android - Views in Custom Compound Component are not inflated (findByView returns null)","<android><relativelayout>","1","1","","",""
"3028339","1","3028792","","2010-06-12 10:32:04","4","566","<p>I am developing a few mobile apps for different platforms including Blackberry, Windows Mobile, Android and Symbian S60.</p><p>I want my mobile apps to have the capability of checking for updates before starting and in case a new version is available, prompt the user to upgrade. Moreover in certain cases (like security patches), the user must be forced to update or the app won't work.</p><p>Surely I can cook some code to achieve the task but I was wondering if there are already existing framework to serve the purpose so that I don't have to re-invent the wheel and test all over?</p>","116540","","","","","2010-06-12 13:18:24","Mobile Application Upgrade/Update Framework","<android><blackberry><symbian>","1","0","1","",""
"3028403","1","","","2010-06-12 10:48:46","4","411","<p>I've found some wierd behaviour related to scrolling and rendering and javascript. </p><p>How to make it happen:</p><p>On any webpage that is long enough to scroll on. Start to scroll pretty fast (fling the page). then release the touch.Now while the page is still scrolling because of the momentum. Tap the screen to stop the scroll.</p><p>This make the browser enter a wierd mode. </p><p>On the nexus one it behaves like this:The updating of what's shown on the screen stops, you can still click on links and the go to where they are supposed to but what's shown on the screen stays the same.</p><p>If you then scroll the screen a bit the update of the screen kicks in again and what you you where suppsed to see all the time is shown. </p><p>On all phones with HTC Sense I've tried (Hero, Desire, Legend) this happens:</p><p>The updating of the screen is stopped just like on the nexus one, but also the execution of any javascript is stopped. If you click on a link that takes you to another page however things return to normal again.</p><p>The way I tested this was I created a page like this:</p><p><a href=""http://pastebin.ca/1881620"" rel=""nofollow"">http://pastebin.ca/1881620</a></p><p>The changeColor function simply changed the background color of 'container' to a few different colors.</p><p>So before the error what happens is that when you click any link the color changes.</p><p>after the error this happens:</p><p>Nexus one: when you click on the links nothing happens (except the ""orange link selected rounded corner box thing"" is shown as if the link is clicked). Then when you scroll abit. You can see the color has changed (and equal amount of times to the number of times I clicked the link).</p><p>On Sense:The links take me to google.com </p><p>Has anyone else noticed this problem? Is there anyway to work around it? </p><p>Thanks.</p>","357303","","357303","","2010-06-14 06:29:56","2012-03-15 18:42:43","Javascript and rendering pauses and stays paused on scroll in the android browser","<javascript><android><rendering><htc><locks>","1","7","2","",""
"3028410","1","3028616","","2010-06-12 10:50:31","0","1373","<p>I want to prevent my application from restarting when orientation of device changes. I have lock the app orientation as per below code but it doesn't help for the same.</p><pre><code>&lt;activity android:name="".CheckMemory""    android:configChanges=""orientation""    android:screenOrientation=""portrait""    android:theme=""@style/customTheme""              android:label=""@string/app_name""&gt;    &lt;/activity&gt; </code></pre><p>and </p><pre><code>@Override    public void onConfigurationChanged(final Configuration newConfig) {        super.onConfigurationChanged(newConfig);    //Do nothing here    }</code></pre>","301549","","301549","","2010-06-12 11:07:08","2010-06-12 12:10:53","application restarting when changing orientation even after locking in android","<android>","2","2","","",""
"3028705","1","","","2010-06-12 12:50:48","0","676","<p>I want to know if we can display multiple activities in a single activity using ActivityGroup.Can anyone please help me out with this ?</p><p>Thanks in advance.</p><p>Regards,Serenity.</p>","365233","","","","","2010-11-28 01:19:05","can we display multiple activities in a single activities?","<android>","1","1","","",""
"3028717","1","","","2010-06-12 12:54:19","22","52652","<p>I am trying to play a video in android emulator I have the video in my assets folder as well as the raw folderBut after doing some research still i cant play video in my emulatori am working on android 2.1 My video format is mp4 so i don't think that should be a problemCould anyone just give me an example code so that i can understand a bit more?</p><p>The problem is that the VideoView that I need to display the Video will take only a URI or a File path to point to the Video. </p><p>If I save the video in the raw or assets folder I can only get an input stream or a file descriptor and it seems nothing of that can be used to initialize the VideoView.</p><p><strong>Update</strong></p><p>I took a closer look at the MediaPlayer example and tried to start a MediaPlayer with a FileDescriptor to the assets files as in the code below:</p><pre><code>SurfaceView videoView = (SurfaceView) findViewById(gettingStarted)SurfaceHolder holder = videoView.getHolder();holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);final MediaPlayer player = new MediaPlayer();player.setDisplay(holder);player.setDataSource(getAssets().openFd(fileName).getFileDescriptor());player.prepareAsync();player.setOnPreparedListener(new OnPreparedListener() {   @Override   public void onPrepared(MediaPlayer mp) {      mp.start();   }});</code></pre><p>Now I get a the following exception: </p><pre><code>java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed</code></pre><p>It seems there is no other way then copying the file to the sdcard on startup and that seems like a waste of time and memory.</p>","236197","","114066","","2010-08-19 12:31:50","2013-12-18 08:05:55","How to play videos in android from assets folder or raw folder?","<android><video><assets>","13","2","12","",""
"3028838","1","3029070","","2010-06-12 13:37:06","0","154","<p>As part of my widget, I use an instance of the Camera object. </p><p>This is what I want to do.  The user will click on my widget, I get an instance of the Camera(if it's not already stored), use it, then store it.  If they click the widget again, I want to use that same instance that I used previously.</p><p>Is this possible?</p><p><strong>EDITED</strong>:  I can't release the Camera(<code>android.hardware.Camera</code>) until the user clicks on the widget the second time.  So the user clicks on the widget the first time, I get the camera and hold on to it until they click the widget again.</p><p>The problem I am running into is on the second click, I am trying to get the Camera again, which I can't because I currently have it in use.</p>","137825","","137825","","2010-06-12 14:02:32","2010-06-12 15:01:23","Saving an Object for use later","<android>","2","1","","",""
"3028896","1","","","2010-06-12 13:52:52","2","463","<p>i tried the following on the emulator but the as the app starts it gives a runtime error . could someone please help me on this . Heres' the code i tried </p><pre><code>package com.example.TextSpeaker;import java.util.Locale;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener;public class TextSpeaker extends Activity {/** Called when the activity is first created. */int MY_DATA_CHECK_CODE = 0;private TextToSpeech mtts;String test1=""hello world"";String test2=""hi i am working fine"";    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Intent myintent = new Intent();    myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);    startActivityForResult(myintent, 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 so create the TTS engine                mtts = new TextToSpeech(this,(OnInitListener) this);                mtts.setLanguage(Locale.ENGLISH);                mtts.speak(test1, TextToSpeech.QUEUE_FLUSH, null);                mtts.speak(test2, TextToSpeech.QUEUE_FLUSH, null);            }            else            {                //install the Engine                Intent install = new Intent();                install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                startActivity(install);            }        }    }}</code></pre>","238505","","","","","2011-10-13 21:29:51","a basic Text to speech app not working","<android>","1","6","","",""
"3028974","1","","","2010-06-12 14:27:03","13","33227","<p>If I try</p><pre><code>nltxt = nllen.toString();</code></pre><p>with <code>nllen</code> being</p><pre><code>int nllen = nl.getLength();</code></pre><p>I get the error</p><blockquote>  <p>Cannot invoke <code>toString()</code> on the primitive type int.</p></blockquote><p>I want to convert the int to string so i can display the number of entries with Log...Why doesn't it work?</p>","117701","","276052","","2011-10-28 14:48:03","2011-10-28 14:48:03","Android: Cannot invoke toString() on the primitive type int","<java><android><string>","3","0","3","",""
"3029055","1","3029143","","2010-06-12 14:57:41","1","581","<p>In Virgil Dobjanschi's talk, ""Developing Android REST client applications"" (link <a href=""http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html#"" rel=""nofollow"">here</a>), he said a few things that took me by surprise. Including:</p><ul><li><p>Don't run http queries in threads spawned by your activities.  Instead, communicate with a service to do them, and store the information in a ContentProvider.  Use a ContentObserver to be notified of changes.</p></li><li><p><em>Always</em> perform long running tasks in a Service, never in your Activity.</p></li><li><p>Stop your Service when you're done with it.</p></li></ul><p>I understand that he was talking about a REST API, but I'm trying to make it fit with some other ideas I've had for apps.   One of APIs I've been using uses long-polling for their chat interface.  There is a loop http queries, most of which will time out. </p><p>This means that, as long as the app hasn't been killed by the OS, or the user hasn't specifically turned off the chat feature, I'll never be done with the Service, and it will stay open forever.  This seems less than optimal.  </p><p>Long question short:</p><p><b>For a chat application that uses long polling to simulate push and immediate response, is it still best practice to use a Service to perform the HTTP queries, and store the information in a ContentProvider?</b></p>","238849","","","","","2010-06-12 15:23:03","Chat app vs REST app - use a thread in an Activity or a thread in a Service?","<android>","1","1","","",""
"3029074","1","","","2010-06-12 15:02:59","8","24826","<p>I'd like to my Android tabs to look flat and simple like the ones in the official TWitter app. How can I override the default (light) theme and change the background images for the tabs using style/theme definitions? </p>","141281","","","","","2012-10-21 08:38:45","How to change tab style in Android?","<android><coding-style><tabs><themes>","3","2","6","",""
"3029144","1","","","2010-06-12 15:23:26","0","807","<p>I have the below code to read from a URL object:</p><pre><code>URL url= new URL(""http://datasource.com"");     BufferedReader reader = new BufferedReader(                                new InputStreamReader(url.openStream()));</code></pre><p>After I am done getting the data, is this sufficient to close and release all the resrouces:</p><pre><code>reader.close();</code></pre><p>I did not see a method for URL to close it, like URL.close()...but wondering if I shouldn't do something more like this:</p><pre><code>InputStreamReader inputStreamReader = new InputStreamReader(url.openStream());BufferedReader reader = new BufferedReader(inputStreamReader);// Do StuffinputStreamReader.close();reader.close();</code></pre>","341447","","","","","2010-06-13 12:31:21","Closing inputstreams","<android><url><close>","1","0","","",""
"3029281","1","","","2010-06-12 16:12:01","3","863","<p>Is there a way, to make view's background animated? Android cant handle animated GIFs in 1.5 afaik, and I can't set video for BG resource.</p>","365304","","","","","2010-06-12 19:54:35","android view animated background","<android><video><background>","1","0","1","",""
"3029539","1","3029552","","2010-06-12 17:38:04","1","3690","<p>I am want to pass data back from a <code>Thread</code> to <code>Activity</code> (which created the thread). </p><p>So I am doing like described on <a href=""http://developer.android.com/guide/appendix/faq/commontasks.html#threading"" rel=""nofollow"">Android documentation</a>:</p><pre><code>public class MyActivity extends Activity {    [ . . . ]    // Need handler for callbacks to the UI thread    final Handler mHandler = new Handler();    // Create runnable for posting    final Runnable mUpdateResults = new Runnable() {        public void run() {            updateResultsInUi();        }    };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        [ . . . ]    }    protected void startLongRunningOperation() {        // Fire off a thread to do some work that we shouldn't do directly in the UI thread        Thread t = new Thread() {            public void run() {                mResults = doSomethingExpensive();                mHandler.post(mUpdateResults);            }        };        t.start();    }    private void updateResultsInUi() {        // Back in the UI thread -- update our UI elements based on the data in mResults        [ . . . ]    }}</code></pre><p>Only one thing I am missing here - where and how should be defined <code>mResults</code> so I could access it from both <code>Activity</code> and <code>Thread</code>, and also would be able to modify as needed? If I define it as <code>final</code> in <code>MyActivity</code>, I can't change it anymore in <code>Thread</code> - as it is shown in example...</p><p>Thanks!</p>","283037","","","","","2010-06-12 17:42:31","Pass data from thread into Activity","<android><multithreading><communication><activity>","1","0","","",""
"3029598","1","","","2010-06-12 17:56:00","1","3479","<p>I have an activity with ListView and buttons 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=""fill_parent""    android:orientation=""vertical""&gt;    &lt;ListView android:id=""@+id/lvLamps"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:listSelector=""@null""        android:choiceMode=""none"" android:scrollbarStyle=""insideInset""        android:layout_weight=""1.0"" /&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:orientation=""horizontal""        android:layout_weight=""0.0""&gt;        &lt;Button android:id=""@+id/btnAdd"" android:background=""@null""            android:drawableLeft=""@drawable/btn_upgrade""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:drawableRight=""@drawable/lbl_upgrade""            android:textSize=""0pt"" android:text=""""            android:layout_alignParentLeft=""true"" android:padding=""20px"" /&gt;        &lt;Button android:id=""@+id/btnNext"" android:background=""@null""            android:drawableRight=""@drawable/next_btn""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:drawableLeft=""@drawable/lbl_next""            android:textSize=""0pt"" android:text=""""            android:layout_alignParentRight=""true"" android:padding=""20px""            android:visibility=""gone"" /&gt;        &lt;ImageButton android:id=""@+id/btnListExit""            android:background=""@null"" android:src=""@drawable/btn_x""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true"" android:padding=""20px"" /&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>ListView row contains delete button:  </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"" android:focusable=""true""&gt;    &lt;RelativeLayout android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:orientation=""horizontal"" android:focusable=""true""&gt;        &lt;ImageButton android:id=""@+id/btnRowDelete""             android:src=""@drawable/btn_x""            android:background=""@null"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentLeft=""true"" android:padding=""4px""              android:focusable=""true"" android:focusableInTouchMode=""true""/&gt;            &lt;TextView android:id=""@+id/txtLampRowFrom"" android:text=""123""                android:layout_width=""wrap_content""                     android:layout_height=""wrap_content"" android:textSize=""6pt""                    android:layout_toRightOf=""@id/btnRowDelete""                    android:focusable=""false""                    android:textColor=""@color/textColor""/&gt;            &lt;TextView android:id=""@+id/txtLampRowTo"" android:text=""123""                android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                android:textSize=""6pt""                    android:layout_toRightOf=""@id/btnRowDelete""                    android:layout_alignParentBottom=""true""                    android:focusable=""false""                    android:textColor=""@color/textColor""/&gt;        &lt;ImageView android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/arrow_upgrade_to""            android:layout_alignParentRight=""true""            android:layout_centerVertical=""true"" android:focusable=""false""/&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In Adapter, Button onClickListener is set, also there are dummies to make list non-selectable:  </p><pre><code>    // disabling list items select    public boolean areAllItemsEnabled() {        return false;    }    public boolean isEnabled(int position) {        return false;    }</code></pre><p>What I want is:  </p><ul><li>always show buttons in the bottom of screen after list (no matter how long it is, there should be scroll if it's too long)</li><li>ListView should not be selectable, I don't want row selection</li><li>row delete button should be selectable (focusable) with touch and with trackball  </li></ul><p>And everything works except I can't focus row delete button <strong>with trackball</strong> (although it's working with touch). Can you help me?  </p><p>Thanks!</p>","67407","","","","","2013-06-19 06:01:01","Android ListView delete row button - focus issue","<android><gui><listview><button><focus>","1","0","","",""
"3029634","1","","","2010-06-12 18:11:09","0","275","<p>I wanna add three layout in a TabActivity, but it was force closed when I ran it.</p><h2>Here is the code:</h2><p>import android.app.TabActivity;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;</p><p>public class Test1 extends TabActivity {</p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     Resources res = getResources();      TabHost tabHost = getTabHost();          tabHost.addTab(tabHost.newTabSpec(""egcquery"").setIndicator(""EGCQuery"").setContent(R.layout.main1));     tabHost.addTab(tabHost.newTabSpec(""PatientInfo"").setIndicator(""PatientInfo"").setContent(R.layout.main2));     tabHost.addTab(tabHost.newTabSpec(""Comp_Interp"").setIndicator(""Comp_Interp"").setContent(R.layout.main3));}</code></pre><p>}</p>","364979","","","","","2010-08-22 09:28:18","An Exception occur in Tablayout","<android>","1","0","","",""
"3029679","1","3032950","","2010-06-12 18:23:36","0","4642","<p>On my Mac I installed Eclipse, the SDK and created a new project, then hit build expecting to see my first helloworld app.</p><p>I got the error ""the project cannot be built until build path errors are fixed"".</p><p>After going thru all the path-like options in Preferences, I noticed that on the tab ""Java Build Path""  the ""Google APIs [Android 2.2]"" option did not have its check box checked.</p><p>Checking it made the problem go away.</p><p>It works now and I can see the app in the Emulator</p><p>Have I not set up my environment correctly? I used all the defaults in Eclipse and the Android SDK.</p>","172861","","","","","2012-04-05 13:19:37","Android HelloWorld Build Path error","<android><eclipse><build>","2","1","","",""
"3029698","1","","","2010-06-12 18:28:12","0","327","<p>How can we pass Android Home Screen Widget info ( putExtra maybe ) to an Activity.. What particular method callback will handle this one?</p>","364556","","","","","2010-06-12 20:35:17","Passing Integer from Android Home Screen Widget to an Activity opened by the Android Home Screen","<android><widget><homescreen>","1","1","","",""
"3029703","1","3029779","","2010-06-12 18:28:58","1","805","<p>I read somewhere (and have observed) that starting threads is slow. I always assumed that AsyncTask created and reused a single thread because it required being started inside the UI thread.</p><p>The following (anonymized) code is called from a ListAdapter's getView method to load images asynchronously. It works well until the user moves the list quickly, and then it becomes ""<a href=""http://www.youtube.com/watch?v=c4znvD-7VDA"" rel=""nofollow"">janky</a>"".</p><pre><code>final File imageFile = new File(getCacheDir().getPath() + ""/img/"" + p.image);image.setVisibility(View.GONE);view.findViewById(R.id.imageLoading).setVisibility(View.VISIBLE);(new AsyncTask&lt;Void, Void, Bitmap&gt;() {    @Override    protected Bitmap doInBackground(Void... params) {        try {            Bitmap image;            if (!imageFile.exists() || imageFile.length() == 0) {                image = BitmapFactory.decodeStream(new URL(                        ""http://example.com/images/""                                + p.image).openStream());                image.compress(Bitmap.CompressFormat.JPEG, 85,                        new FileOutputStream(imageFile));                image.recycle();            }            image = BitmapFactory.decodeFile(imageFile.getPath(),                bitmapOptions);            return image;        } catch (MalformedURLException ex) {            // TODO Auto-generated catch block            ex.printStackTrace();            return null;        } catch (IOException ex) {            // TODO Auto-generated catch block            ex.printStackTrace();            return null;        }    }    @Override    protected void onPostExecute(Bitmap image) {        if (view.getTag() != p) // The view was recycled.            return;            view.findViewById(R.id.imageLoading).setVisibility(                View.GONE);        view.findViewById(R.id.image)                .setVisibility(View.VISIBLE);        ((ImageView) view.findViewById(R.id.image))                .setImageBitmap(image);    }}).execute();</code></pre><p>I'm thinking that a queue-based method would work better, but I'm wondering if there is one or if I should attempt to create my own implementation.</p>","347947","","","","","2010-06-24 23:51:54","Does Android AsyncTaskQueue or similar exist?","<android>","2","2","","",""
"3029783","1","6863897","","2010-06-12 19:04:49","7","4718","<p>I want to add a non-native shared library to Android so every application on the device would be able to use it. I mean using packaged classes just like a core library as if they were present in the application itself.</p><p>I studied Android source code to figure out a way to add a new path to the application <code>ClassLoader</code> and found out that it is created during startup and there's no way to change the paths later. I can use my own <code>ClassLoader</code>, but all I will get after loading a class will be a reference to a <code>Class</code> object. This way I will be bound to work through reflection mechanism, which is slower than the native execution system.</p><p>Is there any way to organise a shared library on Android?</p><p><strong>Update:</strong> just to be clear here, I <em>don't</em> need interaction between applications. I need classes which I can reuse in any application. Also static libraries don't really suit my needs because this will bloat the applications.</p>","45668","","45668","","2010-06-13 09:48:49","2012-09-04 20:39:50","How to add a dynamic library to Android?","<java><android><shared-libraries>","4","1","2","",""
"3029819","1","9850215","","2010-06-12 19:16:58","37","15261","<p>Is it possible to automatically detect, which certificate was used for signing APK? I'd like to have both debug and release Maps certificates in application and pass valid one to MapView constructor.</p><p>With such setup I will not make mistake while releasing application - I'm using debug certificate on emulator and my device, then sign with release one before sending app to Market.</p><p>I was thinking about detecting my particular device or whether debugger is connected but it is not perfect. Maybe some file marking need for debug certificate? Is there any better way?</p>","7162","","736054","","2013-12-31 07:24:04","2013-12-31 07:24:04","Android: automatically choose debug/release Maps api key?","<android><google-maps><debugging><key><android-mapview>","9","1","31","",""
"3029876","1","3860926","","2010-06-12 19:40:56","2","4922","<p>My goal is to set the users notification sound from a file that is stored onto the SD card from with in the application. I am using this code:</p><pre><code>if(path != null){    File k = new File(path, ""moment.mp3"");    ContentValues values = new ContentValues();    values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());    values.put(MediaStore.MediaColumns.TITLE, ""My Song title"");    values.put(MediaStore.MediaColumns.SIZE, 215454);    values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/mp3"");    values.put(MediaStore.Audio.Media.ARTIST, ""Some Artist"");    values.put(MediaStore.Audio.Media.DURATION, 230);    values.put(MediaStore.Audio.Media.IS_RINGTONE, false);    values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);    values.put(MediaStore.Audio.Media.IS_ALARM, false);    values.put(MediaStore.Audio.Media.IS_MUSIC, false);    values.put(MediaStore.MediaColumns.DISPLAY_NAME, ""Some Name"");    //Insert it into the database    Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());    Uri newUri = MainActivity.this.getContentResolver().insert(uri, values);    RingtoneManager.setActualDefaultRingtoneUri(      MainActivity.this,      RingtoneManager.TYPE_NOTIFICATION,      newUri    );    //RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_NOTIFICATION, newUri);    Toast.makeText(this, ""Notification Ringtone Set"", Toast.LENGTH_SHORT).show();}</code></pre><p>When I run this on the device I keep getting the error: </p><pre><code>06-12 15:19:36.741: ERROR/Database(2847): Error inserting is_alarm=false is_ringtone=false artist_id=35 is_music=false album_id=-1 title=My Song title duration=230 is_notification=true title_key=%D%\%%P%H%F%8%%R%&lt;%R%B%4% mime_type=audio/mp3 date_added=1276370376 _display_name=moment.mp3 _size=215454 _data=/mnt/sdcard/Android/data/_MY APP PATH_/files/moment.mp306-12 15:19:36.741: ERROR/Database(2847): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed</code></pre><p>I have seen others using this technique and I can't find any documentation on which values actually need to be passed in to successfully add the file into the Android system so that it can be set as a notification.</p>","317862","","","","","2013-08-02 02:04:53","Setting Ringtone notification from SD card file","<android><ringtone><mediastore>","3","0","1","",""
"3029911","1","3029915","","2010-06-12 19:55:11","0","155","<p>I need to create a map with items on it (the map consists of a drawable object, which represents a room) and I thought about using buttons with background images for the items so that they are clickable.</p><p>I guess the AbsoluteLayout fits here the best, but unfortunately it's deprecated.What layout would you recommend me for this kind of application ? Is there another layout which supports X/Y coordinates ?</p>","331556","","","","","2010-06-12 21:04:15","Android Layout question","<android><layout>","2","0","","",""
"3029926","1","","","2010-06-12 20:02:44","2","1392","<p>There's a webpage I pull up with webview, however i'd like to hide the 1 text link at the top. Is there a way to do this? The link is in the body, so I can't hide the body element in whole.The webpage is all text, and one tiny image at the bottom, but the text is generated each time you load it, so I can't just copy/paste the body.</p><p>Thanks</p>","365372","","","","","2012-12-06 05:07:27","Any way to hide elements from webview? (android)","<android>","1","0","","",""
"3030012","1","3030442","","2010-06-12 20:37:26","1","2111","<p>I am new to android, I have learned how to display drawable pic in gallery, and display a url pic use ImageView. Now I dont know how to display online pictures in gallery. Should I use listview or not?  In addtion, I want to know how to get pictures urls from flickrs with given userid  </p>","365384","","","","","2010-06-12 23:13:33","adding flickr pictures to android gallery and display it","<android><image><gallery><flickr>","1","0","","",""
"3030183","1","3030827","","2010-06-12 21:35:47","0","493","<p>I’m doing an application that listens to the android.intent.action.SCREEN_OFF in a Service (if that matter) and then it is supposed to wait a few seconds and launch an action, I’ve tried a timer schedule method, thread and handler postDelay method but all of them seems to fail, they are never executed on a device, it seems like it’s being freezed/killed after phone is locked. It works on emulator and on device attached to USB, but never with device working on battery only, which actually is a main scenario.</p><p>Do you know any solutions to this?</p>","31207","","","","","2010-06-15 05:05:31","Problem with thread after SCREEN_OFF in Android","<android><service><multithreading><timer><action>","3","0","","",""
"3030194","1","3030689","","2010-06-12 21:40:46","3","8914","<p>I'd like to use a small (icon size) image as the background for my view, but it gets stretched to fill all the view.</p><p>Any solution (including some way to place a view under my current one and make the latter transparent) will be appreciated.</p><p>Thanks !</p><p>current code:</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:background=""@drawable/icon""  android:id=""@+id/layout_main"" &gt;</code></pre>","358813","","541137","","2013-08-30 22:47:18","2013-08-30 22:47:18","Android: how to have a centered background image in a view","<android><views><background>","1","4","2","",""
"3030250","1","3030450","","2010-06-12 22:01:09","0","1562","<p>I came across <a href=""http://code.google.com/p/and-bookworm/source/browse/trunk/src/com/totsp/bookworm/ManageData.java?spec=svn251&amp;r=251"" rel=""nofollow"">this android example</a> that runs an AsyncTask from a UI thread. The class ExportDatabaseTask is declared and instantiated in the Activity, and apparently it is possible to reference the activity's UI context from the onPreExecute and onPostExecute events, like this:</p><pre><code>public class ManageData extends Activity {   private ExportDatabaseTask exportDatabaseTask;   [...]  @Override   public void onCreate(final Bundle savedInstanceState) {     [...]    ManageData.this.exportDatabaseTask = new ExportDatabaseTask();     ManageData.this.exportDatabaseTask.execute();     [...]  }   private class ExportDatabaseTask extends AsyncTask&lt;String, Void, Boolean&gt; {     private final ProgressDialog dialog = new ProgressDialog(ManageData.this);     protected void onPreExecute() {       this.dialog.setMessage(""Exporting database..."");       this.dialog.show();     }     protected Boolean doInBackground(final String... args) {       [...]    }     protected void onPostExecute(final Boolean success) {       if (this.dialog.isShowing()) {          this.dialog.dismiss();       }     } } </code></pre><p>I am trying to refactor this so that the ExportDatabaseTask is declared in another class that is not the Activity, for various reasons, and I can't quite figure out how to make it work. I am lacking some basic Java concepts here, which I readily admit.</p><p>Specifically, myActivity is null in onPreExecute(). Why is that?</p><pre><code>// this is a click event handler in my activity that starts the exportpublic void onClick(View v) {  Exporter ex = new Exporter(getApplicationContext(), ActivityMain.this);  ex.exportDatabaseTask.execute();} //this is the utility classpublic class Exporter {    public ExportDatabaseTask exportDatabaseTask;       private Context myContext;    private ActivityMain myActivity;    public Exporter(Context ctx, ActivityMain act) {            myContext = ctx;            myActivity = act;            this.exportDatabaseTask = new ExportDatabaseTask();     }    public class ExportDatabaseTask extends AsyncTask&lt;Void, Void, Boolean&gt; {            private final ProgressDialog dialog = new ProgressDialog(myContext);       // can use UI thread here?       protected void onPreExecute() {         // ====&gt; this throws a Nullpointer exception:         myActivity.dialog.setMessage(""Exporting database..."");         myActivity.dialog.show();       }       protected Boolean doInBackground(final Void... args) {      }       protected void onPostExecute(final Boolean success) {         if (myActivity.dialog.isShowing()) {           myActivity.dialog.dismiss();         }       }     }}</code></pre><p>I realize that I can take the code from the pre and post-execute events and put it into the onclick handler in my activity, avoiding this question, but I am still curious why the code above does not work.</p>","58880","","58880","","2010-06-12 22:26:23","2010-06-12 23:16:17","Accessing UI context from asynch task","<android><user-interface><multithreading>","1","0","","",""
"3030485","1","","","2010-06-12 23:30:21","1","1401","<p>I am working on an app that beeps every second. When I hit the home button I want it to close the program and stop beeping. Right now it closes the program but continues to beep.</p><p>What am I doing wrong?</p><pre><code>        if ((keyCode == KeyEvent.KEYCODE_HOME)) {        isdone = true;        mp.release();        counter.cancel();        finish();    }</code></pre>","282475","","","","","2010-06-13 13:38:22","Android Stop Counter and Destroy Media Player","<android><timer><media-player>","3","0","","",""
"3030582","1","3030601","","2010-06-13 00:14:01","2","15854","<p>I have a android webservice client application.  I am trying to use the java standard WS library support.  I have stripped the application down to the minimum, as shown below, to try and isolate the issue.  Below is the application,</p><pre><code>package fau.edu.cse;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class ClassMap extends Activity {    TextView displayObject;    @Override    public void onCreate(Bundle savedInstanceState) {        // Build Screen Display String        String screenString = ""Program Started\n\n"";        // Set up the display        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        displayObject = (TextView)findViewById(R.id.TextView01);        screenString = screenString + ""Inflate Disaplay\n\n"";        try {        // Set up Soap Service        TempConvertSoap service = new TempConvert().getTempConvertSoap();        // Successful Soap Object Build        screenString = screenString + ""SOAP Object Correctly Build\n\n"";        // Display Response        displayObject.setText(screenString);        }        catch(Throwable e){    e.printStackTrace();    displayObject.setText(screenString +""Try Error...\n"" + e.toString());        }    }}</code></pre><p>The classes tempConvert and tempConvertSoap are in the package fau.edu.cse.  I have included the java SE javax libraries in the java build pasth.  When the android application tries to create the ""service"" object I get a ""java.lang.noclassdeffounderror"" exception.  The two classes tempConvertSoap and TempConvet() are generated by wsimport.  I am also using several libraries from javax.jws.. and javax.xml.ws..  Of course the application compiles without error and loads correctly.  I know the application is running becouse my ""try/catch"" routine is successfully catching the error and printing it out.  Here is what is in the logcat says (notice that it cannot find TempConvert),</p><pre><code>06-12 22:58:39.340: WARN/dalvikvm(200): Unable to resolve superclass of Lfau/edu/cse/TempConvert; (53)06-12 22:58:39.340: WARN/dalvikvm(200): Link of class 'Lfau/edu/cse/TempConvert;' failed06-12 22:58:39.340: ERROR/dalvikvm(200): Could not find class 'fau.edu.cse.TempConvert', referenced from method fau.edu.cse.ClassMap.onCreate06-12 22:58:39.340: WARN/dalvikvm(200): VFY: unable to resolve new-instance 21 (Lfau/edu/cse/TempConvert;) in Lfau/edu/cse/ClassMap;06-12 22:58:39.340: DEBUG/dalvikvm(200): VFY: replacing opcode 0x22 at 0x002706-12 22:58:39.340: DEBUG/dalvikvm(200): Making a copy of Lfau/edu/cse/ClassMap;.onCreate code (252 bytes)06-12 22:58:39.490: DEBUG/dalvikvm(30): GC freed 2 objects / 48 bytes in 273ms06-12 22:58:39.530: DEBUG/ddm-heap(119): Got feature list request06-12 22:58:39.620: WARN/Resources(200): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}06-12 22:58:39.620: WARN/System.err(200): java.lang.NoClassDefFoundError: fau.edu.cse.TempConvert06-12 22:58:39.830: WARN/System.err(200):     at fau.edu.cse.ClassMap.onCreate(ClassMap.java:26)06-12 22:58:39.830: WARN/System.err(200):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)06-12 22:58:39.830: WARN/System.err(200):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)06-12 22:58:39.830: WARN/System.err(200):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)06-12 22:58:39.830: WARN/System.err(200):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)06-12 22:58:39.880: WARN/System.err(200):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)06-12 22:58:39.880: WARN/System.err(200):     at android.os.Handler.dispatchMessage(Handler.java:99)06-12 22:58:39.880: WARN/System.err(200):     at android.os.Looper.loop(Looper.java:123)06-12 22:58:39.880: WARN/System.err(200):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-12 22:58:39.880: WARN/System.err(200):     at java.lang.reflect.Method.invokeNative(Native Method)06-12 22:58:39.880: WARN/System.err(200):     at java.lang.reflect.Method.invoke(Method.java:521)06-12 22:58:39.880: WARN/System.err(200):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-12 22:58:39.880: WARN/System.err(200):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-12 22:58:39.880: WARN/System.err(200):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>...bla...bla...bla</p><p>It would be great if someone just had an answer, however I am looking at debug strategies.  I have taken this same application and created a standard java client application and it works fine -- of course with all of the android stuff taken out.  What would be a good debug strategy?  What methods and techniques would you recommend I try and isolate the problem?  I am thinking that there is some sort of Dalvik VM incompatibility that is causing the TempConvert class not to load.  TempConvert is an interface class that references a lot of very tricky webservice attributes.  Any help with debug strategies would be gladly appreciated.</p><p>Thanks for the help,Steve</p>","365435","","37213","","2010-06-13 00:23:15","2012-03-31 07:32:11","Android ""java.lang.noclassdeffounderror"" exception","<android><web-services>","3","1","","",""
"3030626","1","19953888","","2010-06-13 00:35:07","6","8084","<p>I am using some home replacement that allow me to hide the notification Bar and that's something I really like.</p><p>All the informations can be replaced by some widgets, but I would like to display the notifications too.</p><p>As I already developed some applications, I would like to know if there is a command line that allow an application to get all the notifications. I plan to add this to a widget or a toast.</p><p>Thank a lot for any clue or help.</p>","327402","","","","","2013-11-13 12:31:58","Android: get all the notifications by code","<java><android><notifications>","2","0","2","",""
"3030706","1","","","2010-06-13 01:15:55","0","650","<p>is it possible to port android (android tv) on Nokia booklet 3G , i like the booklet hardware (built in 3g modem and hdmi port and overall build) but windows 7 is horrible.</p><p>it would be great to have android with android tv port on nokia booklet 3G</p><p>any idea how to do?  </p>","365468","","","","","2010-06-20 09:14:54","Port android / android tv on nokia booklet 3G","<android><nokia><tv>","2","0","","",""
"3030793","1","","","2010-06-13 01:53:49","1","1191","<p>In Android, I am trying to make it so that the user downloads a font from the browser, and I am able to view the font when downloaded. After multiple issues, I still have one lingering one: Registering the filetype with the browser.</p><p>When trying to download with the Emulator (2.1-u1), I get ""Cannot download. The content is not supported on this phone"". Okay, so maybe its my manifest file. Updated with this:</p><pre><code>    &lt;activity android:name="".MainActivity"" android:label=""MainActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;            &lt;catagory android:name=""android.intent.category.BROWSABLE""/&gt;            &lt;data android:scheme=""http""/&gt;            &lt;data android:scheme=""https""/&gt;            &lt;data android:scheme=""ftp""/&gt;            &lt;data android:host=""*""/&gt;            &lt;data android:mimeType=""*/*""/&gt;            &lt;data android:pathPattern="".*zip""/&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>Went back to the browser, and fails again. Restart the Emulator, still fails.</p><p>Note that I got this format from posts <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg47872.html"" rel=""nofollow"">here</a>.</p><p>Any suggestions on what to do?</p>","342518","","","","","2010-10-15 09:24:32","Register filetype with the browser?","<android><android-manifest><android-browser>","2","6","","",""
"3030916","1","3030937","","2010-06-13 03:03:45","2","867","<p>How can I store and retrieve preferences in Android?</p>","655814","","496830","","2011-11-08 13:46:58","2011-11-08 13:46:58","How can I store and retrieve preferences in Android?","<android>","1","0","4","",""
"3030972","1","3030998","","2010-06-13 03:34:42","0","2925","<p>I've searched high and low for something that seems to be a simple task.  Forgive me, I am coming to Android from other programming languages and am new to this platform and Java.</p><p>What I want to do is create a dialog pop-up where a user enters text to search for and the code would take that text and search for it within all the text in an EditText control and if it's found, highlight it.</p><p>I've done this before, for example in VB and it went something similar to this pseudo code:</p><ol><li>grab the text from the (EditText) assign it to a string</li><li>search the length of that string (character by character) for the  substring, if it's found return the position (index) of the substring within the string.</li><li>if found, start the (EditText).setSelection highlight beginning on the returned position for the length of </li></ol><p>Does this make sense?</p><p>I just want to search a EditText for  and when found, scroll to it and it'll be highlighted.  Maybe there's something in Android/Java equivalent to what I need here?</p><p>Any help / pointers would be greatly appreciated</p>","297856","","","","","2010-06-13 03:48:01","How to search and Highlight Text within an EditText","<android><string><edittext>","1","0","1","",""
"3031095","1","","","2010-06-13 04:36:23","1","281","<p>New to this and a bit confused as to why calling the following method creates a force close:</p><pre><code>AudioManager myaudiomanager;public void toggleSilent(){  myaudiomanager.setRingerMode(AudioManager.RINGER_MODE_SILENT);}</code></pre><p>I don't see any blatant errors and I have added permissions to the manifest regarding the audio manager.</p><p>Anyone able to direct me further?</p>","365525","","491044","","2012-01-30 11:43:18","2012-01-30 11:43:18","Android audio manager method causing a force close","<android><android-audiomanager>","2","1","","",""
"3031132","1","3032507","","2010-06-13 04:55:43","0","256","<p>Created a profile using  content provider. After running it correctly, added 3 fields to the table. But now its not working correctly.It shows an error like <code>android.content.res.Resources$NotFoundException: String resource ID #0x4d2</code>.Any solution?</p>","357112","","1043882","","2012-08-16 01:57:30","2012-08-16 01:57:30","Content Provider Resources$NotFoundException","<android><android-contentprovider>","1","0","","",""
"3031280","1","","","2010-06-13 06:11:54","9","3510","<p>I am currently developing Android app, it needs download content from internet. I use thread to do that and then call runOnUiThread method to update GUI. </p><ol><li>I placed a refresh menu on it, if user tried to refresh the content, the download thread will be created and started. The problem is that how can I control the thread order, I need to accept the latest request's response and abandon previous thread requests if there were some other requests still running because the request parameters may have been changed by user. Currently I was using a threadId to do this thing, when a thread finished, it will check its threadId, if it was the latest recored one, it then takes control and render the response. <strong>My question is that is there any other proper better solution for this?</strong></li><li><strong>Do I need to stop threads when user exit the app?</strong> I remember that some book said that do not try stop thread manually and wait itself finish is a good practice, is that true? Should I stop them by calling ""stop"" or ""interrupt"" method? </li><li>I read some documents around threading in Android and found the class <strong>HandlerThread</strong>, what is it? In what kind of situation I need to use it?</li></ol>","238061","","","","","2010-06-18 19:03:25","Threading in Android","<java><android><multithreading>","3","1","1","",""
"3031465","1","","","2010-06-13 07:41:48","0","258","<p>i intend to develop an app which would speak to the user the message he desires in the inbox. I have successfully created an app where there is a text box and when the user finishes typing in it and presses a speak button, he can hear what he has written, now how do i extend this to the desired app? please could someone please guide me on this?</p>","238505","","","","","2010-06-13 11:59:36","need help in sms reader","<android>","1","0","","",""
"3031481","1","3032404","","2010-06-13 07:47:05","2","3410","<p>I have a web view that is loaded with an HTML that contains links.when I switch to another activity (say to another tab in a tabactivity) and then switching back to it, the link is surrounded withan orange rectangle. also happens in the GoogleAdView which reallymakes it impossible to view.</p>","258429","","73488","","2010-10-23 01:50:00","2011-02-02 14:44:11","Orange rectangle around links in WebView","<android>","3","0","1","",""
"3031556","1","","","2010-06-13 08:17:05","0","1197","<p>whenever I recreate the home screen widget on my phone, the onReceive() method is not called. </p><p>the problem would be that it doesn't respond to Button press that I assign which its function resides in the onReceive method..</p><p>The issue does not reside on the emulator but when I tested it with my phone, it doesnt respond to it.</p><p>What would be the best solution for it?</p>","364556","","","","","2010-06-19 14:59:07","onReceive of Android Home Screen Widget not working when recreating the widget","<android><widget><homescreen>","1","0","","",""
"3031630","1","3032556","","2010-06-13 08:52:25","2","1242","<p>I registered a PendingIntent to requestLocationUpdates(provider, minTime, minDistance, PendingIntent). But when my broadcast receiver receives this intend, how do I remove this request with removeUpdates(PendingIntent)? The receiver doesn't hold a reference to the original PendingIntent.</p>","109704","","","","","2010-06-13 14:30:13","Android: how to cancel a request of Location update with intent?","<android>","1","0","1","",""
"3031643","1","3073045","","2010-06-13 08:59:13","11","4450","<p>I am looking for resources to develop HTML5 apps for iphone primarily. Are their frameworks and tools that I can use to get started? I am looking for:</p><ul><li>Javascript frameworks that help with UI layout</li><li>Touch based controls for phones</li><li>Articles on iphone development, best practices, etc.</li></ul><p>I searched stackoverflow and was not able to come up with a good list of resources. I am looking for examples like these <a href=""http://jqtouch.com/"">http://jqtouch.com/</a></p>","170883","","63094","","2010-06-24 04:20:18","2012-01-28 03:10:55","Resources & Frameworks for mobile development (iphone,android) using HTML5","<iphone><android><html5><jqtouch><sencha-touch>","7","1","5","2012-01-28 21:09:57",""
"3031674","1","","","2010-06-13 09:10:23","0","282","<p>06-13 08:58:24.114: ERROR/AndroidRuntime(627): java.lang.RuntimeException: Unable to start activity ComponentInfo{irdc.tabuse/irdc.tabuse.TabUse}: java.lang.RuntimeException: Could not create tab content because could not find view with id 2131034112</p><p>I don't understand what it means.</p><h2>Here is the code:</h2><pre><code>package irdc.test2;import android.app.TabActivity;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class Test2 extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources();         TabHost tabHost = getTabHost();        tabHost.addTab(tabHost.newTabSpec(""artists"").setIndicator(""Artists"")                                  .setContent(R.id.widget0));        tabHost.addTab(tabHost.newTabSpec(""albums"").setIndicator(""Albums"")                                  .setContent(R.id.widget1));    }}</code></pre>","364979","","1147787","","2014-02-20 20:02:55","2014-02-20 20:02:55","A error message from log when running my tab program","<android>","0","2","","",""
"3031718","1","","","2010-06-13 09:26:52","6","1533","<p>I try to open a specific email attachment type with my activity, the attachment itself is a plain text windows style ini file with the extension *.os. In the email this file is attached as ""application/octet-stream"". I tried the following intent-filter to catch the attachment with my activity:</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=""http"" android:host=""*"" android:pathPattern="".*\\.os""/&gt;            &lt;data android:scheme=""https"" android:host=""*"" android:pathPattern="".*\\.os""/&gt;            &lt;data android:scheme=""content"" android:host=""*"" android:pathPattern="".*\\.os""/&gt;            &lt;data android:scheme=""file"" android:host=""*"" android:pathPattern="".*\\.os""/&gt;        &lt;/intent-filter&gt;</code></pre><p>The Email app is fetching the attachment but is then telling me ""The attachment cannot be displayed"". What can I do? How can I debug this?</p>","45419","","","","","2011-01-13 21:41:44","Opening email attachments in Android","<android>","2","4","1","",""
"3031739","1","5804836","","2010-06-13 09:34:11","0","619","<p>I'm looking for a way in an Android application to store a password within the memory <strong>as long as the application is running (cf. different activities)</strong>. I was first thinking about the SharedPreferences, but then it's saved in the flash memory, which isn't that good for a password, I guess.</p><p>I'm unsure, what's the best way. What would you recommend me?</p>","331556","","","","","2011-04-27 13:24:53","Store password temporarily in memory","<android><passwords>","2","1","","",""
"3031740","1","3035487","","2010-06-13 09:34:11","5","3073","<p>What I'm trying to do is create a layout like this:</p><pre><code>       +--------+ Search |EditText| [Button]       +--------++---------+|Tab 1    |---------+|         |Tab 2    ||---------+---------+-----------------+| ListView Item 1                     || ListView Item 2                     || ListView Item 3                     || ListView Item 4                     || ListView Item 5                     || ListView Item 6                     || ListView Item 7                     || ListView Item 8                     || ListView Item 9                     || ListView Item 10                    |+-------------------------------------+    </code></pre><p>So that's a TextView saying 'Search', an EditText and a button.</p><p>Then below it the tabs - Tab 1 has a ListView, Tab 2 some other stuff. I can get a simple TabHost setup with two tabs working fine but can't get the above to lay out properly. </p><p>The issue is that that it installs and runs fine - just the layout is wrong. I've tried weighted views and so on but I can't get things to position as per the ASCII diagram above.</p><p>I'd create the UI in the Eclipse designer and check the XML from that, except the designer doesn't work with TabHost. And DroidDraw doesn't seem to know about TabHost.</p><p>Here's the 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=""@+id/TabHost""        android:layout_width=""fill_parent""          android:layout_height=""fill_parent""&gt;        &lt;LinearLayout             android:id=""@+id/LinearLayout01""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            android:orientation=""vertical""            android:padding=""5dp""&gt;            &lt;TextView android:id=""@+id/SearchTextView""                android:text=""Search""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:layout_weight=""10""&gt;            &lt;/TextView&gt;            &lt;EditText                 android:text=""@+id/SearchEditText""                 android:id=""@+id/SearchEditText""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:singleLine=""true""                android:layout_weight=""10""&gt;            &lt;/EditText&gt;            &lt;TabWidget android:id=""@android:id/tabs""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:layout_weight=""10""/&gt;            &lt;FrameLayout android:id=""@android:id/tabcontent""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:layout_weight=""70""&gt;                &lt;LinearLayout android:id=""@+id/Tab1ListLayout""                     android:layout_width=""fill_parent""                     android:layout_height=""fill_parent""&gt;                &lt;/LinearLayout&gt;                     &lt;Button android:id=""@+id/tab2""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:text=""Tab 2 button""/&gt;            &lt;/FrameLayout&gt;              &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>... and here's the Activity:</p><pre><code>    public class tabtest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TabHost tabs = (TabHost)findViewById(R.id.TabHost);        tabs.setup();        TabHost.TabSpec spec = tabs.newTabSpec(""tag1"");        spec.setContent(R.id.Tab1ListLayout);        spec.setIndicator(""Tab 1"");        tabs.addTab(spec);        spec=tabs.newTabSpec(""tag2"");        spec.setContent(R.id.tab2);        spec.setIndicator(""Tab 2"");        tabs.addTab(spec);        EditText et = (EditText)findViewById(R.id.SearchEditText);        et.setText(""Some text."");    }</code></pre>","205546","","205546","","2010-06-13 15:17:25","2011-07-27 06:14:38","Problem with TabHost UI layout","<android><android-tabhost>","1","4","6","",""
"3031796","1","3039807","","2010-06-13 09:56:03","18","19974","<p>I'm developing a program in which, from an Android Phone, I have to connect as a client to a Bluetooth medical sensor. I'm using the official Bluetooth API and no problem during connection (SPP profile), but when I end the socket, the sensor is still connected to my phone (although I have close the connection).</p><p>Are there any way to make a Bluetooth disconnection? I think there is an intent called ACTION_ACL_CONNECTED, which does that. Can anyone explain me how to use this?</p><p>Thanks in advance.</p><p>EDITED: Here is the code, if anyone needs additional info, it's a Nonin 4100 medical sensor.</p><pre><code>Set&lt;BluetoothDevice&gt; pairedDevices = Activa.myBluetoothAdapter.getBondedDevices();        // If there are paired devices        if (pairedDevices.size() &gt; 0) {            // Loop through paired devices            for (BluetoothDevice device : pairedDevices) {                // Add the name and address to an array adapter to show in a ListView                String name = device.getName();                if (name.contains(""Nonin"")) {                    try {                        found = true;//                      socket = device.createRfcommSocketToServiceRecord(UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));//                      handler.sendEmptyMessage(5);//                      Activa.myBluetoothAdapter.cancelDiscovery();//                      socket.connect();                        BluetoothDevice hxm = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(device.getAddress());                        Method m;                        try {                            m = hxm.getClass().getMethod(""createRfcommSocket"", new Class[]{int.class});                            socket = (BluetoothSocket)m.invoke(hxm, Integer.valueOf(1));                            handler.sendEmptyMessage(5);                            socket.connect();                        } catch (Exception e) {                            handler.sendEmptyMessage(7);                            e.printStackTrace();                            break;                        }                        handler.sendEmptyMessage(6);                        InputStream in = socket.getInputStream();                        OutputStream out = socket.getOutputStream();                        byte[] retrieve = { 0x44, 0x31};                        out.write(retrieve);                        byte [] ack = new byte [1];                        in.read(ack);                        if (ack[0] == 0x15) {                            cancelMeasurement();                            return;                        }                        byte [] data = new byte [3];                        long timeStart = System.currentTimeMillis();                        this.timePassed = System.currentTimeMillis() - timeStart;                        while ((this.timePassed &lt; (this.time))&amp;&amp;(this.finished)) {                            try {                                in.read(data);                                processData(data);                                Thread.sleep(1000);                                this.timePassed = System.currentTimeMillis() - timeStart;                            } catch (Exception e) {                                e.printStackTrace();                            }                        }                        in.close();                        out.close();                        socket.close();                    } catch (IOException e) {                        e.printStackTrace();                    }                }            }        }}</code></pre>","365610","","365610","","2010-06-16 12:03:58","2014-04-11 15:11:17","Disconnect a bluetooth socket in Android","<android><bluetooth><disconnection>","7","0","21","",""
"3031836","1","","","2010-06-13 10:11:03","1","161","<p>I am new to android. I need to add events to Google calendar from my application. How to integrate with google calendar? What are the jar files are needed? Is it needed to enable any gmail setting? I need some help .Can anyone help me to solve this??</p>","365616","","1175051","","2012-04-16 09:31:35","2012-04-16 09:31:35","Google Calendar doubt?","<android><google-calendar>","0","2","","",""
"3031887","1","3032071","","2010-06-13 10:33:50","21","10310","<p>how do I catch specific key events from the soft keyboard?specifically I'm interested in the ""Done"" key.</p><p>thanks, Ori</p>","258429","","","","","2013-10-10 21:27:29","How to catch a ""Done"" key press from the soft keyboard","<android>","4","0","1","",""
"3031978","1","","","2010-06-13 11:05:41","1","664","<p>I have a tabhost, e.g:              </p><pre><code>final TabHost tabs = getTabHost();tabs.setup();TabHost.TabSpec spec = null;spec = tabs.newTabSpec(""search"");spec.setContent(new Intent(this, Search.class));spec.setIndicator(""search"");tabs.addTab(spec);</code></pre><p>in this tabhost is a Intent,and in the activity must change to other activity,question is I hope the other actitivy at same tabhost switch? Can do this?</p>","365634","","1465910","","2012-12-31 06:18:44","2013-11-03 16:52:40","How can change my TabHost?","<android><android-tabhost>","1","2","","",""
"3032016","1","","","2010-06-13 11:15:34","0","1907","<p>I have an existing Windows app for which I'm writing an Android port. The app uses a unique string as the primary key, but the SQLite methods in Android all seem to work with integers and a column names _id, whereas my ID column isn't called this. Is there a way to let Android know I have a key with a different column name?</p>","30512","","","","","2010-06-13 14:23:15","Android: Text primary key with different name","<android><sqlite><primary-key>","1","0","","",""
"3032042","1","3032286","","2010-06-13 11:22:13","2","12255","<p>I've been banging my head trying to figure out how to send a post method in Android. This is how my code look like:</p><pre><code>public class HomeActivity extends Activity implements OnClickListener {    private TextView textView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        textView = (TextView) findViewById(R.id.text);        Button button = (Button)findViewById(R.id.button);        button.setOnClickListener(this);    }    @Override    public void onClick(View view) {            HttpPost httpMethod = new HttpPost(""http://www.example.com/"");        httpMethod.addHeader(""Accept"", ""text/html"");        httpMethod.addHeader(""Content-Type"", ""application/xml"");        AndroidHttpClient client = AndroidHttpClient.newInstance(""Android"");        String result = null;        try {            HttpResponse response = client.execute(httpMethod);            textView.setText(response.toString());            HttpEntity entity = response.getEntity();            Log.i(HomeActivity.class.toString(), result);            textView.setText(""Invoked webservice"");        } catch (IOException e) {            e.printStackTrace();            Log.e(HomeActivity.class.toString(), e.getMessage());            textView.setText(""Something wrong:"" + e.getMessage());        }    }}</code></pre><p>This is the exception that I get:</p><pre><code>I/ARMAssembler(   59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x334348:0x334510] in 1430659 nsW/System.err(  272): java.net.UnknownHostException: www.example.comW/System.err(  272):    at java.net.InetAddress.lookupHostByName(InetAddress.java:513)W/System.err(  272):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)W/System.err(  272):    at java.net.InetAddress.getAllByName(InetAddress.java:242)W/System.err(  272):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)W/System.err(  272):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)W/System.err(  272):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)W/System.err(  272):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)W/System.err(  272):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)W/System.err(  272):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)W/System.err(  272):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)W/System.err(  272):    at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:243)W/System.err(  272):    at com.collaboapp.android.HomeActivity.onClick(HomeActivity.java:152)W/System.err(  272):    at android.view.View.performClick(View.java:2408)W/System.err(  272):    at android.view.View$PerformClick.run(View.java:8816)W/System.err(  272):    at android.os.Handler.handleCallback(Handler.java:587)W/System.err(  272):    at android.os.Handler.dispatchMessage(Handler.java:92)W/System.err(  272):    at android.os.Looper.loop(Looper.java:123)W/System.err(  272):    at android.app.ActivityThread.main(ActivityThread.java:4627)W/System.err(  272):    at java.lang.reflect.Method.invokeNative(Native Method)W/System.err(  272):    at java.lang.reflect.Method.invoke(Method.java:521)W/System.err(  272):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)W/System.err(  272):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)W/System.err(  272):    at dalvik.system.NativeStart.main(Native Method)E/class android.HomeActivity(  272): www.example.comD/ThrottleService(   59): finally have imsi - retreiving dataD/ThrottleService(   59): onPollAlarm - roaming =false, read =0, written =0, new total =0D/SntpClient(   59): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>What am I doing wrong here? Is there anything that I may need to configure from the Android emulator to get this working? </p><p>Thank you for your help.</p>","141186","","141186","","2010-06-13 12:11:10","2011-08-09 12:42:21","Android: Can not send http post","<java><android><http-post>","4","5","4","",""
"3032046","1","3059478","","2010-06-13 11:22:34","1","667","<p>I have started with the HelloTabwidget example and it works fine. Now what I am trying to do is have a layout inside each tab. here is what the code looks like</p><pre><code>myApp extends TabActivity {  TabHost tabHost;  onCreate() {      setContentView (R.layout.main);      tabHost = getTabHost();      TabHost.tabspec spec = tabHost.newTabSpec(..).setIndicator(...).               setContent(new Intent().setClass(...));       tabHost.addTab(spec);       :  }}myTab1Actvity extends Activity {  ListView myLV;  EditText myET;  onCreate() {    setcontentView (TAB1_LAYOUT);        myLV = findViewById(..);  :     myLV.setAdapter(aa);     myET.setOnKeyListener(....)    registerforContextMenu(myLV)  }}</code></pre><p>when I run here is the stack trace</p><p><pre> <code>ERROR/AndroidRuntime(691): java.lang.NullPointerExceptionERROR/AndroidRuntime(691):     at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:295)ERROR/AndroidRuntime(691):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)ERROR/AndroidRuntime(691):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)ERROR/AndroidRuntime(691):     at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:295)ERROR/AndroidRuntime(691):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)ERROR/AndroidRuntime(691):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)ERROR/AndroidRuntime(691):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)ERROR/AndroidRuntime(691):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)ERROR/AndroidRuntime(691):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(691):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(691):     at android.app.ActivityThread.main(ActivityThread.java:4363)ERROR/AndroidRuntime(691):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(691):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(691):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)ERROR/AndroidRuntime(691):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)</pre> </code></p><p>Does the code's flow look OK? basically each Tab has its own activity and each tab has its own layout.</p><p>It appears that something is wrong in the TabHost - but I am unable to pinpoint it. Any suggestions/Qs you hav e will be very helpful.  </p>","355975","","","","","2010-06-17 06:51:38","embedding layout inside each tab? - (each tab has its own activity)","<android><android-tabhost>","1","0","1","",""
"3032109","1","3032584","","2010-06-13 11:48:17","0","997","<p>In my TabActivity the user may be asked to switch to browser activity for OAuth phase, and if the phase takes too much time, my activity will be killed. After the user switches back to my activity, its onCreate() method is invoked again and tabs are recreated.</p><p>So I would like to know if there is any simple way to switch back to previous tab, and keep the tab as what it was. For example, one of the tab views contains a ViewSwitcher child, and I want to switch back to the switched view after recreating the activity.</p>","111896","","","","","2010-08-30 11:11:37","Switch back to previously selected tab after the activity is recreated","<android><android-tabhost>","2","0","","",""
"3032130","1","3038786","","2010-06-13 11:55:03","2","366","<p>I've got a simple application with 3 activities:     </p><ul><li>the first contains a search box which calls a web service and show the results (restaurants) below in a listview   </li><li>when a restaurant is clicked another activity is started showing the description of the restaurant and a button ""show map""    </li><li>when the button ""show map"" is clicked, guess what, the map is shown in a third activity.</li></ul><p>All the data is loaded in the first activity by a web service (restaurant descriptions and coordinates), and data required by each activity is passed in a bundle using <code>intent.putExtra</code>.</p><p>Now everything seems to run smoothly when clicking on the <code>back button</code> (eg. clicking on the back button from the map resumes the <code>restaurant description</code> activity with all data set properly), while I haven't done anything about the lifecycle yet.</p><p>Why? Are all variables saved automatically? Should I use <code>onSaveInstanceState()</code> and <code>onRestoreInstanceState()</code> anyway?</p><p>Thanks</p><p>Jul</p>","326849","","1043882","","2012-08-25 16:56:10","2012-12-12 15:36:38","Lifecycle of a simple Android application","<android><lifecycle>","2","2","","",""
"3032143","1","","","2010-06-13 12:00:30","0","259","<p>Hallo all,</p><p>I have a SQliteDatabase object db, i want to create a table in db with the following code</p><pre><code>db.execSQL(""CREATE TABLE IF NOT EXISTS ""+ TABLE2_NAME + "" (exer_nr INTEGER PRIMARY KEY ,exerText       varchar(250),answerA varchar(250),answerB varchar(250),answerC varchar(250),answerD varchar(250))"");</code></pre><p>An Error occur. Why? Is this too large? How can i fix it?</p><p>Another problem: I want to insert a row into the table, whose ""exerText"" column contains the following code as part of it's content. </p><pre><code>main( ){ int m=12, n=34;printf(""%d%d"", m+ +,+ +n);printf(""%d%d\n"",n+ +,+ +m);}</code></pre><p>An Error occur because of the """" and '' symbols in the code. How can i fix this problem ?</p><p>Thanks a lot</p>","353857","","","","","2010-10-23 22:15:54","SQLite: 2 Problems by working with table","<android><sqlite>","3","2","","",""
"3032154","1","","","2010-06-13 12:03:55","0","822","<p>I'am looking for a way to have a webview content selectable in the very same way as the stock browser does.</p><ul><li>user long presses the text</li><li>the whole word is selected</li><li>two pins appear at the word's boundary allowing the user to stretch/shrink the selection.</li></ul><p>I should note that Dolphin HD shows exactly the same text select functionality as the default browser (same icons, animation, etc), so it really should be possible. But I can't figure out how.</p><p>Until now, all i found was this function, which kind of work, but doesn't allow the user to expand/shrink the selection.</p><pre><code>public void selectAndCopyText() {    try {     KeyEvent shiftPressEvent = new KeyEvent(0,0,KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_SHIFT_LEFT,0,0);     shiftPressEvent.dispatch(mWebView);    } catch (Exception e) {        throw new AssertionError(e);    }}</code></pre><p><strong>EDIT:</strong> I just discovered that long touch copy/paste is part of HTC Sense, not Stock android. Still, it'd be useful to find out how to enable that on a webview, even just for HTC users. Anybody knows ?</p>","358813","","358813","","2010-06-13 15:22:15","2011-06-03 13:19:51","Android: Enable selection in webkit","<android><text><webkit><selection><htcsense>","0","3","","",""
"3032240","1","","","2010-06-13 12:37:42","3","841","<p><br>I would like to display the gallery item the user clicked on in full screen, however, only if it is the item in the center.<br>If the clicked item is not in the center I would want it just to be centered.<br>Any idea how to distinguish the item which is currently in the center from all other items?</p><p>Thanks, Rob</p>","283630","","","","","2011-11-29 18:23:53","Android: How can I tell if clicked gallery item is the center one?","<android><gallery>","1","2","","",""
"3032294","1","3035277","","2010-06-13 12:57:37","0","3727","<p>I'm trying to create a game with a 9x9 grid with GridView. Each item in the grid is a TextView.I am able to set the initial values of each item in the grid within the getView() method to ""0"", however I want to change the value of each grid individually after this but have been unable to do so.</p><p>I tried adding an update() function in my extended GridAdapter class that takes a position and a number to update at that position but this doesnt seem to be working.</p><pre><code>public void update(int position, int number) { TextView cell; cell = (TextView) getItem(position); if (cell != null) {  cell.setText(Integer.toString(number)); }}</code></pre><p>Doe anyone know how this can be achieved?</p><p>Here's the whole GridAdapter class in case require,</p><pre><code>public class SudokuGridAdapter extends BaseAdapter { private Context myContext; private TextView[] myCells; public SudokuGridAdapter(Context c) {  myContext = c;  myCells = new TextView[9*9]; } @Override public int getCount() {  // TODO Auto-generated method stub  return 9*9; } @Override public Object getItem(int position) {  return myCells[position]; } @Override public long getItemId(int position) {  // TODO Auto-generated method stub  return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) {  TextView cell;  if (myCells[position] == null)     {   cell = myCells[position] = new TextView(myContext);   cell.setText(""0"");        }     else     {      cell = myCells[position];     }     return cell; } public void update(int position, int number) {  TextView cell;  cell = (TextView) getItem(position);  if (cell != null)  {   cell.setText(Integer.toString(number));  } }}</code></pre>","365681","","857390","","2013-03-23 12:17:46","2013-03-23 12:17:46","How to access individual items in Android GridView?","<android><gridview>","1","1","","",""
"3032358","1","3036024","","2010-06-13 13:20:57","0","515","<p>I'm trying to get multiple pieces of data from an SQLite database into a ListView but it doesn't seem to be working.</p><p>I'm using the code from developer.android.com's Notepad example and it works fine for 1 piece of data but not 2.</p><p>I'm trying to get the title and body of each database entry from the database, through a cursor and into a view, I think my problem is with 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""&gt;    &lt;TextView android:id=""@+id/text1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""28dip"" /&gt;    &lt;TextView android:id=""@+id/text2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""28dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is my code for trying to bind the values:</p><pre><code>mNotesCursor = mDbHelper.fetchAllNotes();        startManagingCursor(mNotesCursor);String[] from = new String[]{NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY};int[] to = new int[]{R.id.text1, R.id.text2};SimpleCursorAdapter notes =         new SimpleCursorAdapter(this, R.layout.notes_row, mNotesCursor, from, to);    setListAdapter(notes);</code></pre><p>If I am only getting KEY_TITLE into an .xml with only one TextView (like in the Notepad tutorial) then it is fine, but if I try and run it with the xml defined above, it force closes.</p><p>Any ideas why?</p><p>Thanks for your time,</p><p>InfinitiFizz</p>","224216","","","","","2010-06-14 09:06:12","using SimpleCusorAdapter to populate a ListView for android","<android><sqlite><listview><cursor><cursors>","1","2","","",""
"3032426","1","","","2010-06-13 13:43:01","8","2442","<p>Hi: I want to integrate i-jetty into an Android application and not the other way around. Has anyone included i-jetty before and got it to run under Android 2.1 or 2.2? </p>","281535","","50776","","2012-01-16 05:24:56","2013-08-25 05:13:11","How to embed i-jetty server into android application?","<java><android><jetty><embedded-jetty><ijetty>","2","2","3","",""
"3032461","1","3034943","","2010-06-13 13:53:27","1","353","<p>What im trying to accomplish is to send a notification through the notification managerthat once clicked will do something in the application only if its currently running.i have tried to use:</p><pre><code>notification.contentIntent = PendingIntent.getActivity(this, nNotificationCounter, Someintent, PendingIntent.FLAG_NO_CREATE)</code></pre><p>Which allways caused an exception once trying to use the notify.I switched to:</p><pre><code>Notification notification = new Notification(icon, tickerText, when);RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.some_notification);contentView.setTextViewText(R.id.title, sTitle);contentView.setTextViewText(R.id.text, sText);notification.contentView = contentView;notification.defaults |= Notification.DEFAULT_SOUND;notification.number = nNotificationCounter;Intent notificationIntent = new Intent(this, MainWindow.class).setAction(ACTION_RESET_MESSGE_COUNTER);notification.contentIntent = PendingIntent.getBroadcast(this, nNotificationCounter, notificationIntent, 0);</code></pre><p>and although this code doesn't cause an exception. it doesnt call my BroadcastReceiver which is defined as follows:</p><pre><code>public class IncomingReceiver extends BroadcastReceiver {            @Override            public void onReceive(Context context, Intent intent) {                if (intent.getAction().equals(ACTION_RESET_MESSGE_COUNTER)) {                    System.out.println(""GOT THE INTENT"");                    return;                }            }        }</code></pre><p>and set in the onCreate:</p><pre><code>IntentFilter filter = new IntentFilter(ACTION_RESET_MESSGE_COUNTER);        IncomingReceiver receiver = new IncomingReceiver();        context.registerReceiver(receiver, filter);</code></pre><p>Does anyone see something wrong with the code?Or how would i go about to get messages when the notification is clicked, but not create any activity if it isn't already created.</p><p>edit: added the intent creation and notification creation.</p><p>Thanks,  Tom</p>","274180","","274180","","2010-06-13 15:44:42","2010-06-14 04:23:08","PendingIntent sent from a notication","<android><notifications><android-intent>","1","2","","",""
"3032497","1","3032521","","2010-06-13 14:07:59","17","16823","<p>I am running into a problem with bitmaps on an Android application I am working on. What is suppose to happen is that the application downloads images from a website, saves them to the device, loads them into memory as bitmaps into an arraylist, and displays them to the user. This all works fine when the application is first started. However, I have added a refresh option for the user where the images are deleted, and the process outlined above starts all over.</p><p>My problem: By using the refresh option the old images were still in memory and I would quickly get OutOfMemoryErrors. Thus, if the images are being refreshed, I had it run through the arraylist and recycle the old images. However, when the application goes to load the new images into the arraylist, it crashes with a ""Trying to use recycled bitmap"" error.</p><p>As far as I understand it, recycling a bitmap destroys the bitmap and frees up its memory for other objects. If I want to use the bitmap again, it has to be reinitialized. I believe that I am doing this when the new files are loaded into the arraylist, but something is still wrong. Any help is greatly appreciated as this is very frustrating. The problem code is below. Thank you!</p><pre><code>public void fillUI(final int refresh) { // Recycle the images to avoid memory leaksif(refresh==1) {    for(int x=0; x&lt;images.size(); x++)        images.get(x).recycle();    images.clear();    selImage=-1; // Reset the selected image variable}final ProgressDialog progressDialog = ProgressDialog.show(this, null, this.getString(R.string.loadingImages));// Create the array with the image bitmaps in itnew Thread(new Runnable() {    public void run() {        Looper.prepare();        File[] fileList = new File(""/data/data/[package name]/files/"").listFiles();        if(fileList!=null) {            for(int x=0; x&lt;fileList.length; x++) {                try {                    images.add(BitmapFactory.decodeFile(""/data/data/[package name]/files/"" + fileList[x].getName()));                } catch (OutOfMemoryError ome) {                    Log.i(LOG_FILE, ""out of memory again :("");                }            }            Collections.reverse(images);        }        fillUiHandler.sendEmptyMessage(0);    }}).start();fillUiHandler = new Handler() {    public void handleMessage(Message msg) {        progressDialog.dismiss();    }};</code></pre><p>}</p>","365713","","","","","2013-02-06 17:28:53","Android ""Trying to use recycled bitmap"" error?","<android><bitmap>","2","0","6","",""
"3032525","1","3032612","","2010-06-13 14:19:28","0","2345","<p>I have a flipper:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/ParentLayout""    xmlns:android=""http://schemas.android.com/apk/res/android"" style=""@style/MainLayout"" &gt;            &lt;LinearLayout android:id=""@+id/FlipperLayout"" style=""@style/FlipperLayout""&gt;                &lt;ViewFlipper android:id=""@+id/viewflipper"" style=""@style/ViewFlipper""&gt;                    &lt;!--adding views to ViewFlipper--&gt;                    &lt;include layout=""@layout/home1"" android:layout_gravity=""center_horizontal"" /&gt;                    &lt;include layout=""@layout/home2"" android:layout_gravity=""center_horizontal"" /&gt;                &lt;/ViewFlipper&gt;            &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The first layout,<em>home1</em>, consists of a scroll view.What should I do to distinguish between the flipping gesture and the scrolling?Presently:</p><ul><li>if I remove the scroll view, I can swipe across</li><li>if I add the scroll view, I can only scroll.</li></ul><p>I saw a suggestion that I should override onInterceptTouchEvent(MotionEvent), but I do not know how to do this. My code, at this moment, looks like this:</p><pre><code>public class HomeActivity extends Activity {-- declares@Overridepublic void onCreate(Bundle savedInstanceState) {    -- declares &amp; preliminary actions    LinearLayout layout = (LinearLayout) findViewById(R.id.ParentLayout);    layout.setOnTouchListener(new OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {            if (gestureDetector.onTouchEvent(event)) {                return true;            }            return false;        }});@Override public boolean onTouchEvent(MotionEvent event) {     gestureDetector.onTouchEvent(event);     return true;    }class MyGestureDetector extends SimpleOnGestureListener {    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {    // http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/    }}</code></pre><p>}</p><p>Can anybody please guide me in the right direction?</p><p>Thank you.</p>","364420","","","","","2013-12-19 13:09:24","Android: ScrollView in flipper","<android><scroll><flip>","3","0","2","",""
"3032566","1","","","2010-06-13 14:32:44","0","1657","<p>Is it possible to run the JumpNote demo application for Android Cloud to Device Messaging<a href=""http://code.google.com/p/jumpnote/"" rel=""nofollow"">http://code.google.com/p/jumpnote/</a>on an unrooted Google Nexus1 phone?Did anyone install and run JumpNote on an unrooted Nexus1?(JumpNote works with Android 2.0+, it needs Android 2.2 for push-sync, but it can run and be sync-ed manually in Android 2.1)</p>","365699","","102703","","2010-06-13 17:29:34","2010-06-14 10:35:29","Has anyone installed the JumpNote Android C2DM demo application on an unrooted Nexus 1?","<android><android-c2dm>","1","9","","",""
"3032586","1","","","2010-06-13 14:37:47","0","368","<p>I have a question on the Android Activity, for example I have a TabHost, and there are included four Activities, the first tab is a search Activity, enter a keyword in the current result of this Activity to return, and in the current Activity display. Is called to display the search results themselves. And after searching several times, and then return to key mobile phone keypad, the display is the result of the last search keyword, I want the press back key to return to the last call of the Activity or TabHost. Should I do? </p><p>By the way, in a tab in the use of Intent calls a Activity, </p><p>eg: <code>host.addTab (host.newTabSpec (""friend""). setIndicator (""search"") . SetContent (new Intent (this, Search.class)));</code> </p><p>In this Activity in the need to call another Activity, </p><p>e.g: <code>startActivity (new Intent (this, Other.class));</code></p><p>Also called another Activity displayed on this tab, but not yet jump out of the show. I ask how you can achieve this?</p>","365723","","","","","2010-08-17 00:27:13","Android on TabHost little more depth of the problem, there is the hard return key on the treatment","<android><android-tabhost>","1","0","","",""
"3032591","1","3116706","","2010-06-13 14:38:41","1","1234","<p>Ahoy,</p><p>I'm working on an OpenGL ES based game for Android using the NDK. My application is targeted towards SDK 1.6 and above.</p><p>I seem to be having a problem creating a canvas of the phones native size. My rendering is done through a native gameloop that uses OpenGL 1.0. I'm using the emulator and that gives me a 480x320 canvas -- this is totally fine. Then, when I run the same application on my HTC Desire which has a native resolution of 800x480 I'm getting a canvas of 533x320. </p><p>Anyone have any information on how to deal with/solve this? Any other information about this is also appreciated.</p><p>Thanks in advance!</p>","109097","","","","","2010-06-25 08:51:19","OpenGL ES canvas size","<android><3d><opengl-es><android-ndk>","1","1","","",""
"3032754","1","","","2010-06-13 15:28:13","0","1442","<p>AFAIK accessing thumbnails for images via <code>MediaStore.Images.Thumbnails</code> would generate thumbnails at first attempt, and that's what I need to perform against specific location on sd card.</p><p>The question is how to make valid URI to content under specific folder?</p><p>All answers I can find use just <code>MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI</code> as uri to make <code>managedQuery</code>. And result of it is Cursor that points to all sdcard images, while none examples can be found on how to access only specific folder.</p>","348417","","186535","","2011-11-25 12:59:38","2012-09-29 19:19:45","Android: getting thumbnails from specific location on sd card","<android><uri><thumbnails><android-contentresolver>","2","0","1","",""
"3032857","1","","","2010-06-13 15:56:42","3","10388","<p>I'm trying to add ZXing to my project (add a button which calls the scanner upon press). I found this: <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/788eb52a765c28b5"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/788eb52a765c28b5</a> and of course the ZXing homesite: <a href=""http://code.google.com/p/zxing/"" rel=""nofollow"">http://code.google.com/p/zxing/</a>, but still couldn't figure out what to include in the project classpath to make it all work!</p><p>As for now, I copied the classes in the first link to my project (with some package name changes), and it runs but crashes after pressing the button and trying to install the barcode scanner.</p><p>Some code:</p><pre><code>private void setScanButton(){    Button scan = (Button) findViewById(R.id.MainPageScanButton);    scan.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            IntentIntegrator.initiateScan(MyActivity.this);        }    });}</code></pre><p>Resulting error (from logcat):</p><pre><code>06-13 15:26:01.540: ERROR/AndroidRuntime(1423): Uncaught handler: thread main exiting due to uncaught exception06-13 15:26:01.560: ERROR/AndroidRuntime(1423): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://search?q=pname:com.google.zxing.client.android }</code></pre><p>Ideas?</p>","271362","","63550","","2010-08-08 23:47:00","2014-01-04 21:20:09","Getting started with ZXing on Android","<android><barcode-scanner><zxing>","7","3","2","",""
"3032964","1","3032981","","2010-06-13 16:21:31","0","1886","<p>How can I browse and copy out the files in my Android AVD? I wish to view the contents of the Sqlite file the app modifies.</p>","172861","","265167","","2012-07-01 08:06:49","2012-07-01 08:06:49","Android AVD SQLite Files - Browse?","<android><file><avd>","1","0","","",""
"3033007","1","3036086","","2010-06-13 16:30:41","3","4501","<p>I'm stuck with a memory leak that I cannot fix. I identified where it occurs, using the MemoryAnalizer but I vainly struggle to get rid of it. Here is the code:</p><pre><code>public class MyActivity extends Activity implements SurfaceHolder.Callback { ...Camera.PictureCallback mPictureCallbackJpeg = new Camera.PictureCallback() {    public void onPictureTaken(byte[] data, Camera c) {        try  {            // log the action            Log.e(getClass().getSimpleName(), ""PICTURE CALLBACK JPEG: data.length = "" + data);            // Show the ProgressDialog on this thread             pd = ProgressDialog.show(MyActivity.this, """", ""Préparation"", true, false);             // Start a new thread that will manage the capture             new ManageCaptureTask().execute(data, c);         }        catch(Exception e){            AlertDialog.Builder dialog = new AlertDialog.Builder(MyActivity.this);            ...            dialog.create().show();        }    }    class ManageCaptureTask extends AsyncTask&lt;Object, Void, Boolean&gt; {         protected Boolean doInBackground(Object... args) {            Boolean isSuccess = false;            // initialize the bitmap before the capture            ((myApp) getApplication()).setBitmapX(null);            try{                // Check if it is a real device or an emulator                TelephonyManager telmgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);                String deviceID = telmgr.getDeviceId();                boolean isEmulator = ""000000000000000"".equalsIgnoreCase(deviceID);                // get the bitmap                if (isEmulator) {                    ((myApp) getApplication()).setBitmapX(BitmapFactory.decodeFile(imageFileName));                } else {                    ((myApp) getApplication()).setBitmapX(BitmapFactory.decodeByteArray((byte[]) args[0], 0, ((byte[])args[0]).length));                }                ((myApp) getApplication()).setImageForDB(ImageTools.resizeBmp(((myApp) getApplication()).getBmp()));                // convert the bitmap into a grayscale image and display it in the preview                ((myApp) getApplication()).setImage(makeGrayScale());                isSuccess = true;            }            catch (Exception connEx){                errorMessageFromBkgndThread = getString(R.string.errcapture);            }            return isSuccess;         }         protected void onPostExecute(Boolean result) {             // Pass the result data back to the main activity             if (MyActivity.this.pd != null) {                 MyActivity.this.pd.dismiss();             }             if (result){                ((ImageView) findViewById(R.id.apercu)).setImageBitmap(((myApp) getApplication()).getBmp());                    ((myApp) getApplication()).setBitmapX(null);            }            else{                // there was an error                ErrAlert();            }        }     }     };private void ErrAlert(){    // notify the user about the error    AlertDialog.Builder dialog = new AlertDialog.Builder(this);    ...    dialog.create().show();}</code></pre><p>}</p><p>The activity is terminated on a button click, like this:</p><pre><code>Button use = (Button) findViewById(R.id.use);use.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        Intent intent = new Intent(MyActivity.this, NextActivity.class);        intent.putExtra(""dbID"", ""-1"");        intent.putExtra(""category"", category);        ((myApp) getApplication()).setBitmapX(null);        MyActivity.this.startActivity(intent);        MyActivity.this.finish();        }    });</code></pre><p>MemoryAnalyzer indicated the memory leak at:</p><p><em>((myApp) getApplication()).setBitmapX(BitmapFactory.decodeByteArray((byte[]) args[0], 0, ((byte[])args[0]).length));</em></p><p>I am grateful for any suggestion, thank you in advance.</p>","364420","","364420","","2010-06-14 09:07:36","2010-06-14 09:16:47","Android: Memory leak due to AsyncTask","<android><memory><leak><android-asynctask>","1","3","2","",""
"3033097","1","","","2010-06-13 17:00:12","1","4598","<p>I've got two activities.  One is supposed to be a blur in front of the other.  </p><p>The background activity has several ImageViews which are set up as thin gradients extending across most of the screen and 10dip high.  When I start the second activity it sets the background as a gradient occupying the entire window space, that is it appears to be fill_parent'd for both height and width.  If I comment out the ImageViews then it blurs and looks as expected.  </p><p>Any thoughts?</p><p>Here's the code doing the blur.</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.WindowManager;import android.view.View.OnClickListener;public class TransluscentBlurSummaryB extends Activity { @Override    protected void onCreate(Bundle icicle) {        super.onCreate(icicle);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                WindowManager.LayoutParams.FLAG_BLUR_BEHIND);        getWindow().getAttributes().dimAmount = 0.5f;        getWindow().setFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND,          WindowManager.LayoutParams.FLAG_DIM_BEHIND);        setContentView(R.layout.sheetbdetails);        OnClickListener clickListener = new OnClickListener() {            public void onClick(View v) {             TransluscentBlurSummaryB.this.finish();            }        };        findViewById(R.id.sheetbdetailstable).setOnClickListener(clickListener);    }}</code></pre><p>And here's the layout with the ImageView gradients.</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/summarysparent"" &gt;   &lt;!-- view1 goes on top --&gt;   &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/view2""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""&gt;        &lt;Button android:layout_height=""wrap_content""       android:id=""@+id/ButtonBack""       android:layout_width=""wrap_content""       android:text=""Back""       android:width=""100dp""&gt;&lt;/Button&gt;     &lt;Button android:layout_height=""wrap_content""       android:id=""@+id/ButtonNext""       android:layout_width=""wrap_content""       android:layout_alignParentRight=""true""       android:text=""Start Over""       android:width=""100dp""&gt;&lt;/Button&gt; &lt;/RelativeLayout&gt;    &lt;TextView        android:id=""@+id/view1""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_width=""wrap_content""         android:layout_centerHorizontal=""true""         android:textSize=""10pt"" android:text=""Summary""/&gt; &lt;ScrollView  xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:id=""@+id/summaryscrollview""     android:layout_below=""@+id/view1""     android:layout_above=""@+id/view2""&gt;     &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:id=""@+id/summarydetails"" &gt;      &lt;!-- view2 goes on the bottom --&gt;      &lt;TextView android:id=""@+id/textview2""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_below=""@+id/view1""       android:layout_centerHorizontal=""true""       android:text=""Recommended Child Support Order""        android:layout_marginTop=""10dip"" /&gt;      &lt;ImageView    android:id=""@+id/horizontalLine1""    android:layout_width=""fill_parent""    android:layout_marginLeft=""5dip""    android:layout_marginRight=""5dip""    android:layout_height=""10dip""    android:src=""@drawable/black_white_gradient""    android:layout_below=""@+id/textview2""    android:layout_marginTop=""10dip""     /&gt;       &lt;TextView android:id=""@+id/textview3""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_below=""@+id/horizontalLine1""       android:layout_centerHorizontal=""true""       android:text=""You""        android:layout_marginTop=""10dip"" /&gt;      &lt;TextView android:id=""@+id/textview10""       android:layout_height=""wrap_content""       android:layout_width=""150dp""       android:layout_below=""@+id/textview3""       android:layout_centerHorizontal=""true""       android:layout_marginTop=""10dip""       android:gravity=""center_horizontal"" /&gt;      &lt;ImageView    android:id=""@+id/horizontalLine2""    android:layout_width=""fill_parent""    android:layout_marginLeft=""5dip""    android:layout_marginRight=""5dip""    android:layout_height=""10dip""    android:src=""@drawable/black_white_gradient""    android:layout_below=""@+id/textview10""    android:layout_marginTop=""10dip"" /&gt;       &lt;TextView android:id=""@+id/textview4""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_below=""@+id/horizontalLine2""       android:layout_centerHorizontal=""true""       android:text=""Other Parent""        android:layout_marginTop=""10dip"" /&gt;      &lt;TextView android:id=""@+id/textview11""       android:layout_height=""wrap_content""       android:layout_width=""150dp""       android:layout_below=""@+id/textview4""       android:layout_centerHorizontal=""true""        android:layout_marginTop=""10dip""        android:text=""$536.18""        android:gravity=""center_horizontal"" /&gt;      &lt;ImageView    android:id=""@+id/horizontalLine3""    android:layout_width=""fill_parent""    android:layout_marginLeft=""5dip""    android:layout_marginRight=""5dip""    android:layout_height=""10dip""    android:src=""@drawable/black_white_gradient""    android:layout_below=""@+id/textview11""    android:layout_marginTop=""10dip"" /&gt;       &lt;TextView android:id=""@+id/textview5""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_below=""@+id/horizontalLine3""       android:layout_centerHorizontal=""true""       android:text=""Calculation Details""        android:layout_marginTop=""15dip"" /&gt;      &lt;ImageView android:id=""@+id/infoButton""       android:src=""@drawable/ic_menu_info_details""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_below=""@+id/horizontalLine3""       android:layout_toRightOf=""@+id/textview5""        android:clickable=""true""       /&gt;      &lt;ImageView    android:id=""@+id/horizontalLine4""    android:layout_width=""fill_parent""    android:layout_marginLeft=""5dip""    android:layout_marginRight=""5dip""    android:layout_height=""10dip""    android:src=""@drawable/black_white_gradient""    android:layout_below=""@+id/textview5""    android:layout_marginTop=""18dip"" /&gt;  &lt;/RelativeLayout&gt; &lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre><p>The gradient drawable is this.</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=""#FFFFFF"" android:centerColor=""#000000"" android:endColor=""#FFFFFF""             android:angle=""270""/&gt;    &lt;padding android:left=""7dp"" android:top=""7dp""            android:right=""7dp"" android:bottom=""7dp"" /&gt;    &lt;corners android:radius=""8dp"" /&gt;&lt;/shape&gt;</code></pre><p>And here's the layout from the activity doing the blurring on top.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/sheetbdetails"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent""    android:clickable=""true"" &gt; &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:scrollbars=""vertical""     android:shrinkColumns=""0""     android:id=""@+id/sheetbdetailstable"" &gt;     &lt;TableRow&gt;         &lt;TextView             android:padding=""3dip"" /&gt;         &lt;TextView             android:text=""You""             android:padding=""3dip"" /&gt;         &lt;TextView             android:text=""@string/otherparent""             android:padding=""3dip"" /&gt;            &lt;TextView             android:text=""Combined""             android:padding=""3dip"" /&gt;     &lt;/TableRow&gt; &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>The transparent windows are themed from styles.xml in the apidemos using @style/Theme.Transparent.</p>","52115","","","","","2012-10-22 08:38:59","Why is android:FLAG_BLUR_BEHIND creating a gradient background in my new activity instead of bluring the window?","<android><gradient><blur><imageview>","1","0","","",""
"3033107","1","3034344","","2010-06-13 17:03:41","0","1897","<p>I want to get the bitmap that is drawn when a textview is displayed but without displaying the textview in the activity. something like this:</p><pre><code>TextView t = new TextView(this);t.forceToDrawItself();Bitmap b=t.getViewBitmap();</code></pre><p>how is this possible?</p>","165106","","","","","2011-09-03 10:49:36","get bitmap from textview in android","<android><uiview><bitmap><draw>","1","0","1","",""
"3033135","1","3033672","","2010-06-13 17:16:21","27","15148","<p>does anyone know how to define a SeekBar's minimum value? Is this done in the XML layout or do I need to define it programatically?</p><p>Basically I need to change my minimum value from 0 to 0.2</p>","339036","","","","","2013-06-04 00:38:18","Android SeekBar Minimum Value","<android>","3","0","1","",""
"3033179","1","","","2010-06-13 17:26:21","-1","462","<p>I don't know why.All my Tab programs have exception.Even from API Demo.</p><h2>Here is the code:</h2><p>package com.example.android.apis.view;</p><p>import android.app.TabActivity;import android.os.Bundle;import android.widget.TabHost;import android.widget.TabHost.TabSpec;import android.view.LayoutInflater;import android.view.View;</p><p>public class Tab1 extends TabActivity {<br> @Override<br> protected void onCreate(Bundle savedInstanceState)  {<br>  super.onCreate(savedInstanceState);<br>  TabHost tabHost = getTabHost();<br>  LayoutInflater.from(this).inflate(R.layout.main,tabHost.getTabContentView(), true);<br>  tabHost.addTab(tabHost.newTabSpec(""tab1"")<br>    .setIndicator(""tab1"")<br>    .setContent(R.id.view1));<br>  tabHost.addTab(tabHost.newTabSpec(""tab2"")<br>    .setIndicator(""tab2"")<br>    .setContent(R.id.view2));<br>  tabHost.addTab(tabHost.newTabSpec(""tab3"")<br>    .setIndicator(""tab3"")<br>    .setContent(R.id.view3));<br> }}</p><h2>Here is the log:</h2><p>06-13 17:24:38.336: WARN/jdwp(262): Debugger is telling the VM to exit with code=106-13 17:24:38.336: INFO/dalvikvm(262): GC lifetime allocation: 2511 bytes06-13 17:24:38.416: DEBUG/Zygote(30): Process 262 exited cleanly (1)06-13 17:24:38.456: INFO/ActivityManager(54): Process com.example.android.apis.view (pid 262) has died.06-13 17:24:38.696: INFO/UsageStats(54): Unexpected resume of com.android.launcher while already resumed in com.example.android.apis.view06-13 17:24:38.736: WARN/InputManagerService(54): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44dc4b3806-13 17:24:48.337: DEBUG/AndroidRuntime(269): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;06-13 17:24:48.346: DEBUG/AndroidRuntime(269): CheckJNI is ON06-13 17:24:48.856: DEBUG/AndroidRuntime(269): --- registering native functions ---06-13 17:24:49.596: DEBUG/ddm-heap(269): Got feature list request06-13 17:24:50.576: DEBUG/AndroidRuntime(269): Shutting down VM06-13 17:24:50.576: DEBUG/dalvikvm(269): DestroyJavaVM waiting for non-daemon threads to exit06-13 17:24:50.576: DEBUG/dalvikvm(269): DestroyJavaVM shutting VM down06-13 17:24:50.576: DEBUG/dalvikvm(269): HeapWorker thread shutting down06-13 17:24:50.586: DEBUG/dalvikvm(269): HeapWorker thread has shut down06-13 17:24:50.586: DEBUG/jdwp(269): JDWP shutting down net...06-13 17:24:50.586: INFO/dalvikvm(269): Debugger has detached; object registry had 1 entries06-13 17:24:50.596: ERROR/AndroidRuntime(269): ERROR: thread attach failed06-13 17:24:50.606: DEBUG/dalvikvm(269): VM cleaning up06-13 17:24:50.676: DEBUG/dalvikvm(269): LinearAlloc 0x0 used 628628 of 5242880 (11%)06-13 17:24:51.476: DEBUG/AndroidRuntime(278): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;06-13 17:24:51.486: DEBUG/AndroidRuntime(278): CheckJNI is ON06-13 17:24:51.986: DEBUG/AndroidRuntime(278): --- registering native functions ---06-13 17:24:52.746: DEBUG/ddm-heap(278): Got feature list request06-13 17:24:53.716: DEBUG/ActivityManager(54): Uninstalling process com.example.android.apis.view06-13 17:24:53.726: INFO/ActivityManager(54): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.android.apis.view/.Tab1 }06-13 17:24:53.876: DEBUG/AndroidRuntime(278): Shutting down VM06-13 17:24:53.886: DEBUG/dalvikvm(278): DestroyJavaVM waiting for non-daemon threads to exit06-13 17:24:53.916: DEBUG/dalvikvm(278): DestroyJavaVM shutting VM down06-13 17:24:53.926: DEBUG/dalvikvm(278): HeapWorker thread shutting down06-13 17:24:53.936: DEBUG/dalvikvm(278): HeapWorker thread has shut down06-13 17:24:53.936: DEBUG/jdwp(278): JDWP shutting down net...06-13 17:24:53.936: INFO/dalvikvm(278): Debugger has detached; object registry had 1 entries06-13 17:24:53.957: DEBUG/dalvikvm(278): VM cleaning up06-13 17:24:54.026: ERROR/AndroidRuntime(278): ERROR: thread attach failed06-13 17:24:54.146: DEBUG/dalvikvm(278): LinearAlloc 0x0 used 638596 of 5242880 (12%)06-13 17:24:54.286: INFO/ActivityManager(54): Start proc com.example.android.apis.view for activity com.example.android.apis.view/.Tab1: pid=285 uid=10054 gids={1015}06-13 17:24:54.676: DEBUG/ddm-heap(285): Got feature list request06-13 17:24:55.006: WARN/ActivityThread(285): Application com.example.android.apis.view is waiting for the debugger on port 8100...06-13 17:24:55.126: INFO/System.out(285): Sending WAIT chunk06-13 17:24:55.186: INFO/dalvikvm(285): Debugger is active06-13 17:24:55.378: INFO/System.out(285): Debugger has connected06-13 17:24:55.386: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:55.586: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:55.796: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:55.996: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:56.196: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:56.406: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:56.606: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:56.806: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:57.016: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:57.216: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:57.416: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:57.626: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:57.836: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:58.039: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:58.246: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:58.451: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:58.656: INFO/System.out(285): waiting for debugger to settle...06-13 17:24:58.866: INFO/System.out(285): debugger has settled (1367)06-13 17:24:59.126: ERROR/gralloc(54): [unregister] handle 0x129980 still locked (state=40000001)06-13 17:25:03.816: WARN/ActivityManager(54): Launch timeout has expired, giving up wake lock!06-13 17:25:04.906: WARN/ActivityManager(54): Activity idle timeout for HistoryRecord{44d60e10 com.example.android.apis.view/.Tab1}</p>","364979","","","","","2010-11-18 08:08:39","The Tab1.java from API Demo has exception","<android>","1","2","","",""
"3033227","1","3033255","","2010-06-13 17:37:32","4","3330","<p>I'm just putting the finishing touches to my Android app. Unfortunately, I dug straight into development without reading the documentation and built my layout with AbsoluteLayout and it turned out to look terrible when I loaded the app on my phone. Now I'm redoing the UI in a RelativeLayout and I want to put empty canvas space in between my ViewGroups in the y-direction. I am currently achieving this by putting random TextView sentences that are of the same color as my View's background in order to make psuedo-empty space. Is there a better way to do this, because right now when I define a specific ViewGroup to be placed below another View, it gets stuck right below the top View.</p><p>As I was writing this, it dawned upon me that using padding might be the answer.... Any other suggestions?</p>","339036","","","","","2010-06-13 17:46:29","Android RelativeLayout spacing","<android>","1","0","","",""
"3033256","1","3033264","","2010-06-13 17:46:44","2","829","<p>I'm trying to build a simple Android app that increments a number displayed every time a button is pressed, but I can't work out how to fix the ""illegal start of expression"" error I keep getting.</p><p>My code:</p><pre><code>package com.clicker;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;public class Clicker extends Activity{    private int clickerNumber = 0;    private TextView clickerText;    private Button clickerButton;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        clickerText = (TextView)findViewById(R.id.clickerText);        final Button clickerButton = (Button)findViewById(R.id.clickerButton);             clickerButton.setOnClickListener(new View.OnClickListener());                {                 public void onClick();                    {                    clickerNumber = clickerNumber++;                    clickerText.setText(Integer.toString(clickerNumber));                    }                }    }}</code></pre><p>And compiler output:</p><pre><code>compile:[javac] Compiling 2 source files to /home/fraser/Applications/Android/Code/Clicker/bin/classes[javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:24: ')' expected[javac]              clickerButton.setOnClickListener(new View.OnClickListener();[javac]                                                                         ^[javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: illegal start of expression[javac]                  public void onClick();[javac]                  ^[javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: illegal start of expression[javac]                  public void onClick();[javac]                         ^[javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:26: ';' expected[javac]                  public void onClick();[javac]                                     ^[javac] /home/fraser/Applications/Android/Code/Clicker/src/com/clicker/Clicker.java:29: ';' expected[javac]                     clickerText.setText(Integer.toString(clickerNumber)));[javac]                                                                         ^[javac] 5 errors</code></pre>","365807","","","","","2010-06-13 18:12:44","Illegal start of expression?","<java><android>","2","0","","",""
"3033422","1","3033600","","2010-06-13 18:35:21","13","12340","<p>I have an android spinner that's populated by a list of strings using an ArrayAdapter and it operates fine, however because of the way the spinner is displayed I'm running into a display height problem with the list items.</p><p>At first glance it would seem that the ArrayAdapter can use a single layout for displaying options which leads to the problem I'm having. When displaying the current item in the spinner (when the user is not selecting a new item from the list) the spinner pads the text so that the spinner is a reasonable size for clicking on.  However when the user taps on it and brings up the list to select a new item, the list items presented are way to small height-wise.  If I use an item layout that presents the list items at a reasonable height, then the spinner itself becomes exorbitantly huge due to it's own padding of the list item.</p><p>Any ideas on how I can manage the height of these two item display modes so that effectively they display with the same height value instead of the spinner height being larger than the list item display height?</p>","354271","","","","","2011-05-31 21:34:18","How can I manage the height of android spinner items?","<android><height><spinner><listadapter>","2","0","3","",""
"3033474","1","3033681","","2010-06-13 18:54:16","0","424","<p><a href=""http://code.google.com/p/and-bookworm/source/browse/trunk/src/com/totsp/bookworm/data/DataHelper.java?r=251"" rel=""nofollow"">This Android application on Google</a> uses the following method to refresh the database after replacing the database file with a backup:</p><pre><code>public void resetDbConnection() {     this.cleanup();     this.db =         SQLiteDatabase.openDatabase(           ""/data/data/com.totsp.bookworm/databases/bookworm.db"",            null, SQLiteDatabase.OPEN_READWRITE); } </code></pre><p>I did not build this app, and I am not sure what happens.I am trying to make this idea work in my own application, but the data appears to be cached by the views, and the app continues to show data from the database that was replaced, even after I call cleanup() and reopen the database. I have to terminate and restart the activity in order to see the new data. </p><p>I tried to call <em>invalidate</em> on my TabHost view, which pretty much contains everything. I thought that the views would redraw and refresh their underlying data, but this did also not have the expected result. </p><p>I ended up restarting the activity programmatically, which works, but this seems to be a drastic measure. Is there a better way?</p>","58880","","","","","2010-06-13 19:55:20","Resetting or refreshing a database connection","<android><sqlite><database-connection>","1","1","","",""
"3033540","1","3034151","","2010-06-13 19:14:32","3","648","<p>In .NET land I would normally query the database and populate a generic List kind of collection. Then the app would use this.</p><p>In Android land I have been reading about DB access and use in apps. Why do most of the docs show the use of a cursor and use of constants to access it? Is this to save on resources perhaps?</p>","172861","","","","","2010-06-13 22:34:41","Android Cursor over Generic list of business objects?","<android><database>","2","0","","",""
"3033748","1","3033819","","2010-06-13 20:18:14","7","4388","<p>I need to remove a file from the /data/data folder my app added. I am looking at the file with the DDMS in Eclipse.</p><p>If DDMS can't , how would I delete it otherwise?</p>","172861","","","","","2012-01-25 00:00:59","Android Remove file with DDMS","<android><ddms>","2","1","2","",""
"3033758","1","","","2010-06-13 20:19:27","1","140","<p>I'm new to android app development but I've successfully created my first real application in eclipse. It runs perfectly in the eclipse emulator so I compiled it and tried to install it on another emulator. It installs successfully, but won't run at all. I'm not even sure how to begin finding the error since everything works so well in eclipse. Can someone refer me to a resource to help me start troubleshooting the problem. I think it might have something to do with the compilation, but I just don't know.</p><p>Thanks!</p>","349159","","","","","2010-06-13 20:19:27","Application runs on eclipse emulator, but not others","<android><android-emulator>","0","2","0","",""
"3033791","1","3035341","","2010-06-13 20:31:08","18","28160","<p>I  am completely new  to  java &amp; android, so  I tried to find useful samples from android &amp; databases.  I found this blog with a project:</p><p><a href=""http://saigeethamn.blogspot.com/2009/10/android-developer-tutorial-part-12.html"" rel=""nofollow"">http://saigeethamn.blogspot.com/2009/10/android-developer-tutorial-part-12.html</a></p><p>I ran the project and it works fine,  but I  was trying to create a new project to copy &amp; paste the code in it  and  this is not working  :( </p><p>I had a problem on this line: </p><pre><code>this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,results));</code></pre><p>This is the error I get:</p><blockquote>  <p>The method setListAdapter(ArrayAdapter) is undefined for the type create</p></blockquote><p>It looks like a method in C#, but I can find it in the original  project.</p><p>Where did I make a mistake?</p>","365860","","213489","","2014-03-19 05:14:36","2014-03-19 05:14:36","""The method setListAdapter(ArrayAdapter) is undefined for the type create""","<android><database>","2","0","2","",""
"3033875","1","3034224","","2010-06-13 20:53:51","0","1449","<p>So I'm having pretty much exactly the problem described here:</p><p><a href=""http://code.google.com/p/android/issues/detail?id=6191"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=6191</a></p><p>and until the ViewFlipper issue in 2.1 and 2.2 has been resolved, I'm attempting to customize my own ViewFlipper in the manner described:</p><pre><code>@Overrideprotected void onDetachedFromWindow() {    try {        super.onDetachedFromWindow();    }    catch (IllegalArgumentException e) {        // Call stopFlipping() in order to kick off updateRunning()        stopFlipping();    }}</code></pre><p>But I've never done this sort of thing before and am hoping to get a little guidance (as my own efforts are coming up short).</p><p>Here's what I have so far.</p><p>FixedFlipper.java:</p><pre><code>import android.content.Context;import android.util.AttributeSet;import android.widget.ViewFlipper;public class FixedFlipper extends ViewFlipper{public FixedFlipper(Context context){    super(context);}public FixedFlipper(Context context, AttributeSet attrs){    super(context, attrs);}@Overrideprotected void onDetachedFromWindow(){    try{        super.onDetachedFromWindow();    }catch(Exception e){        super.stopFlipping();    }}}</code></pre><p>main.xml:</p><pre><code>&lt;com.site.TestApp.FixedFlipper     style=""@style/body"" android:id=""@+id/flipper""&gt;    ...&lt;/com.site.TestApp.FixedFlipper&gt;</code></pre><p>And in my activity, I invoke it like so:</p><pre><code>FixedFlipper flipper = (FixedFlipper)findViewById(R.id.flipper);</code></pre><p>It seems like it should be pretty straightforward, but I keep getting this:</p><pre><code>Binary XML file line #4: Error inflating class com.site.TestApp.FixedFlipper</code></pre><p>I appreciate any suggestions.  I've been chasing my tail for hours trying to figure out what piece of the puzzle I'm missing.</p>","365863","","","","","2010-06-13 22:59:41","Android customizing ViewFlipper","<android><android-widget><android-sdk-2.2>","1","0","","",""
"3033902","1","3034169","","2010-06-13 21:02:35","14","23193","<pre><code>InputStream myInput = myContext.getAssets().open(""MyFolder/"" + ""MyFile.db3"");</code></pre><p>I have a file in the assets folder in a sub folder as above. It doesn't get the file though, is there a special way to specify a sub folder in the assets folder?</p><p>Ian</p>","172861","","1068248","","2012-02-11 21:59:30","2012-02-21 11:57:38","Android Assets with sub folders","<android><assets>","3","4","4","",""
"3034165","1","3034208","","2010-06-13 22:36:55","1","1434","<p>I'm trying to do a simple global exception handler in my Android app and I am having troubles:</p><pre><code>public class TicTacToe extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Thread.currentThread().setUncaughtExceptionHandler(new UncaughtExceptionHandler() {        @Override        public void uncaughtException(Thread thread, Throwable ex) {            Toast.makeText(this, ""TOAST"", Toast.LENGTH_LONG);        }    });    setContentView(R.layout.main);    }}</code></pre><p>I'm a rather new with both Android AND java but in .NET that would work. Can't I access local variable from anonymous methods in java? If so, how should I rewrite it?</p><p>Thanks,Vitaly</p>","126574","","126574","","2010-07-03 11:39:04","2010-07-04 16:08:16","Accessing 'this' in anonymous methods","<java><android>","2","0","","",""
"3034170","1","3050025","","2010-06-13 22:40:30","0","323","<p>Does anyone know how I can use the Magento API to get sales data on Android using XMLRPC?</p>","365709","","","","","2010-06-16 00:34:19","Android XMLRPC and Magento","<android>","1","0","","",""
"3034287","1","3034639","","2010-06-13 23:25:26","2","4106","<p>I have an EditText field for the user to enter their weight in lbs. How can I override the traditional keyboard and display the numeric keypad instead?</p>","365912","","","","","2012-01-17 00:06:30","How can I default to the numeric keypad on focus of an EditText view?","<android><android-widget>","2","0","","",""
"3034316","1","4891508","","2010-06-13 23:36:04","0","159","<p>I am trying to call an Activity from another instance of the activity. The code is supposed to be a simple file browser (part of a larger application). I am using a ListActivity, and when an item (such as a folder) is selected, it is supposed to open it up in the new Activity. I have a feeling it is a problem with the AndroidManifest (which just has the basic  tag). Any assistance would be appreciated.</p><p>Thanks,Steve</p>","341652","","","","","2011-02-03 20:43:53","Exception when creating an activity: Could not select item Parcel unable to marshal value","<android><android-manifest><listactivity>","1","0","","",""
"3034417","1","3034438","","2010-06-14 00:08:27","0","2111","<p>Using this code it should return a list of the assets. But it crashes, with a ""Source not found, Edit Source Lookup Path..."" message in the debugger when I call the list method:</p><pre><code>    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    AssetManager assets = this.getAssets();    try {          //error happens on this next line        String[] l = assets.list(null);    } catch (IOException e) {    }}</code></pre>","172861","","","","","2010-06-14 00:17:22","Android Assets - Unable to access","<android><assets>","2","0","","",""
"3034459","1","","","2010-06-14 00:25:21","0","3520","<p>06-14 00:21:30.398: ERROR/AndroidRuntime(332): Caused by: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'</p><p>what it means? I've already given the id for tabhost.And I can see the id in R.java.</p><h2>Here is the .xml:</h2><p>TabHost xmlns:android=""http://schemas.android.com/apk/res/android""<br>    android:id=""@+id/tabhost""<br>    android:layout_width=""fill_parent""<br>    android:layout_height=""fill_parent""<br>    LinearLayout<br>        android:orientation=""vertical""<br>        android:layout_width=""fill_parent""<br>        android:layout_height=""fill_parent""<br>        android:padding=""5dp""<br>        TabWidget<br>            android:id=""@+id/tabs""<br>            android:layout_width=""fill_parent""<br>            android:layout_height=""wrap_content""<br>        FrameLayout<br>            android:id=""@+id/tabcontent""<br>            android:layout_width=""fill_parent""<br>            android:layout_height=""fill_parent""<br>            android:padding=""5dp""<br>    LinearLayout<br>TabHost</p>","364979","","364979","","2010-06-14 00:30:34","2012-03-29 07:30:57","A Tab Exception Message","<android>","3","0","","",""
"3034513","1","3042590","","2010-06-14 00:45:24","2","1539","<p>I have a widget that you press and it then it will update the text on the widget.  I have set an on click listener to launch another activity to perform the text update, But for some reason it only works temporarily and then it will become unresponsive and not do anything when pressed.  Does anyone know why it might be doing that?  i have posted my widget code below in case it is helpful.</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {    thisWidget = new ComponentName(context, MemWidget.class);    Intent intent = new Intent(context, updatewidget.class);    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);    // Get the layout for the App Widget and attach an on-click listener to the button    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);    views.setOnClickPendingIntent(R.id.ImageButton01, pendingIntent);    // Tell the AppWidgetManager to perform an update on the current App Widget    appWidgetManager.updateAppWidget(thisWidget, views);}@Overridepublic void onReceive(Context context, Intent intent) {    appWidgetManager = AppWidgetManager.getInstance(context);    remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);    thisWidget = new ComponentName(context, MemWidget.class);    // 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>Here is code that is called from my activity</p><pre><code>thisWidget = new ComponentName(this, MemWidget.class);appWidgetManager = AppWidgetManager.getInstance(this);remoteViews = new RemoteViews(this.getPackageName(), R.layout.widget);//do workremoteViews.setTextViewText(R.id.ImageButton01,""setting text here"");appWidgetManager.updateAppWidget(thisWidget, remoteViews);</code></pre>","274365","","274365","","2010-06-15 14:59:55","2010-06-16 04:05:13","android widget unresponsive","<android><widget><unresponsive>","1","0","4","",""
"3034575","1","3034717","","2010-06-14 01:14:02","6","2321","<p>I have a content provider that is custom to my set of Android applications, and one of the things it needs to expose is a small (20-30 KiB) byte array. The URI for these blobs looks like:</p><pre><code>content://my.authority/blob/#</code></pre><p>where <code>#</code> is the row number; the resulting cursor has the standard <code>_id</code> column and a data column. I'm using a <code>MatrixCursor</code> in the provider's <code>query()</code> method:</p><pre><code>byte[] byteData = getMyByteData();MatrixCursor mc = new MatrixCursor(COLUMNS);mc.addRow(new Object[] { id, byteData });</code></pre><p>Later, in the application consuming the data, I do:</p><pre><code>Cursor c = managedQuery(uri, null, null, null, null);c.moveToFirst();byte[] data = c.getBlob(c.getColumnIndexOrThrow(""data""));</code></pre><p>However, data does not contain the contents of my original byte array; rather, it contains something like <code>[B@435cc518</code>, which looks more like the address of the array than the contents. I tried wrapping the byte array in an implementation of <code>java.sql.Blob</code>, figuring that it might be looking for that since the content provider subsystem was written to be easy to use with SQLite, but it didn't help.</p><p>Has anyone gotten this to work? If the data was in the file system, there are methods in <code>ContentProvider</code> that I could use to provide a marshalled <code>InputStream</code> to the client, but the data I'm trying to send back lives as a resource in the content provider's APK.</p>","308405","","168868","","2013-03-13 06:38:16","2013-03-13 06:38:16","Passing binary blob through a content provider","<java><android><android-contentprovider><android-cursor><matrixcursor>","3","2","3","",""
"3034593","1","5511610","","2010-06-14 01:27:25","0","762","<p>I have used some sample code and am trying to tweak it to let me allow the user to touch the screen and zoom in the code runs fine with no errors but when I touch the screen nothing happens</p><pre><code>package com.thomas.zoom;import android.content.Context;import android.graphics.Canvas;import android.graphics.drawable.Drawable;import android.view.KeyEvent;import android.view.MotionEvent;import android.view.View;public class Zoom extends View {        private Drawable image;        private int zoomControler=20;        public Zoom(Context context)        {                super(context);                image=context.getResources().getDrawable(R.drawable.icon);                setFocusable(true);        }        @Override        protected void onDraw(Canvas canvas) {                // TODO Auto-generated method stub                super.onDraw(canvas);        //here u can control the width and height of the images........ this line is very important        image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);                image.draw(canvas);        }        public boolean onTouch(int action, MotionEvent event) {               action= event.getAction();               if(action == MotionEvent.ACTION_DOWN){                   zoomControler+=10;                                  }                invalidate();                return true;        }}</code></pre>","357032","","180538","","2011-05-19 13:28:59","2011-05-19 13:29:25","using ontouch to zoom in","<android><zoom><ontouchlistener>","1","0","","",""
"3034615","1","3038829","","2010-06-14 01:36:52","1","2177","<pre><code>        AssetManager assets = myContext.getAssets();        String[] files = assets.list(""MyFolder"");        InputStream myInput = assets.open(""MyFolder/"" + files[0]);        int i = myInput.read();</code></pre><p>in this case 'i' is -1 meaning nothing read. </p><p>Why would nothing be there if the file is there, the variable 'files' has the file as well.</p><p>Do I need to do anything to the file I put into the Assets folder in get it to be readable?</p><p>NOTE: <strong>When I use a small text file it works. When I use a 10 meg file, it does not. (The 10 meg is a Sqlite database I need to install)</strong></p>","172861","","172861","","2010-06-14 01:48:08","2010-06-14 16:13:10","Android Assets No Value Read?","<android><assets>","2","0","","",""
"3034720","1","3034742","","2010-06-14 02:28:55","1","93","<p>If I wanted to reference an int from another class how would I go about doing that?</p><pre><code>public class Zoom extends View {    private Drawable image;    public int zoomControler = 20;    public Zoom(Context context) {        super(context);        image=context.getResources().getDrawable(R.drawable.icon);        setFocusable(true);          }    @Override                protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        image.setBounds((getWidth ()/2)-zoomControler,                        (getHeight()/2)-zoomControler,                        (getWidth ()/2)+zoomControler,                        (getHeight()/2)+zoomControler);        image.draw(canvas);    }}class HelloOnTouchListener implements OnTouchListener{    @Override    public boolean onTouch(View arg0, MotionEvent arg1) {        return true;    }}</code></pre><p>In this case I want to reference the <code>zoomControler</code> from the first class in the second <code>HelloOnTouchListener</code> class.</p>","357032","","68587","","2010-06-14 02:35:39","2010-06-14 03:11:51","referencing ints from other classes","<java><android>","2","2","","",""
"3034796","1","3035045","","2010-06-14 03:10:12","1","1753","<p>My application supports twitter and needs to open browser for OAuth. When the user clicks the Share on Twitter button, the main activity will create another subactivity (TwitterActivity) to handle twitter authentication issues.</p><p>Here is a flow graph showing how activities are invoked currently. Main is short for MainActivity and Twit for TwitterActivity.</p><pre><code>     startActivity()       OAuth intent           OAuth callback       finish()Main ---------------&gt; Twit ------------&gt; Browser  --------------&gt; Twit --------&gt; Browser</code></pre><p>As you may notice, after the TwitterActivity calls finish() to stop, it will now return back to MainActivity, but Browser instead. How can I make it return back to MainActivity? Many thanks</p>","111896","","","","","2010-06-14 06:55:53","Return back to the parent activity from subactivity","<android><activity>","2","0","","",""
"3034890","1","3035347","","2010-06-14 03:57:33","10","779","<p>I am trying to determine if an Android user has had a close proximity to a list of predetermined locations. I'd like to do this with the least amount of drain on the phone's battery. The two mechanisms I see for accomplishing this are <a href=""http://developer.android.com/reference/android/location/LocationManager.html#addProximityAlert"">proximity alerts</a> and <a href=""http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates"">requesting location updates</a>. What are the pros and cons of the two methods? Will one have less affect on the battery than the other? In either case I would guess the specific <a href=""http://stackoverflow.com/questions/2657766/how-can-reduce-power-usage-in-location-based-application-in-android-how-can-imple/2660337#2660337"">location manager used would have some affect power usage (existing Stack Overflow answer)</a>.</p>","61654","","61654","","2010-06-14 06:34:02","2010-06-15 00:47:22","Determine Android phone's proximity to known point while conserving power","<android><battery><proximity><android-location>","1","0","2","",""
"3035050","1","3035437","","2010-06-14 05:07:04","2","5412","<p>I was trying to make an app which also had the facility to let user select wallpaper he would like to set. I have managed this by calling the Gallery Intent. Once the user selects a specific image, the data path of the image is returned to me which then i preview to the user by setting the image onto an imageview.</p><p>The problem crops up when the image size (and/or resolution) is greater than what android expects. This results in failure of my module. </p><p>And as if this was not enough, wen the user tries to select some other wallpaper(and in my test case the ""other"" wallpaper was also of size >700kb) then the app crashes with the ""OutOfMemoryException""...</p><p>Helppp me here guys!!!</p><p>For Gallery Intent i use:</p><pre><code>Intent intent = new Intent();intent.setType(""image/*"");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent, ""Select Picture""),SELECT_IMAGE);</code></pre><p>For setting the wallpaper i use: </p><pre><code>InputStream is = getContentResolver().openInputStream(Uri.parse(uri_returned_from_intent)); Bitmap bgImage = BitmapFactory.decodeStream(is);//OutOfMemory error thrown heresetWallpaper(bgImage);</code></pre><p>So i have 2 problems to deal with:</p><ol><li>How to crop the image before setting it as wallpaper...</li><li>Cant understand y OutOfMemoryException is thrown, coz none of my image sizes exceed even 1mb... and i guess the VM budget in case Of N1 is 24Mb if m not mistaken...</li></ol>","238071","","569101","","2013-07-04 11:48:47","2013-07-04 11:48:47","setting wallpaper through code","<android><image><out-of-memory><crop><wallpaper>","2","2","4","",""
"3035228","1","3035424","","2010-06-14 06:03:07","2","3190","<p>I am using following code to display bitmap in my ImageView.When I try to load image of size for example bigger than 1.5MB it give me error.Any one suggest me solution?</p><pre><code>  try {                           URL aURL = new URL(myRemoteImages[val]);                           URLConnection conn = aURL.openConnection();                          conn.connect();                           InputStream is = null;                         try                         {                             is= conn.getInputStream();                           }catch(IOException e)                         {                             return 0;                         }                         int a=  conn.getConnectTimeout();                         BufferedInputStream bis = new BufferedInputStream(is);                           Bitmap bm;                         try                         {                             bm = BitmapFactory.decodeStream(bis);                         }catch(Exception ex)                         {                             bis.close();                              is.close();                               return 0;                          }                         bis.close();                           is.close();                           img.setImageBitmap(bm);                    } catch (IOException e) {                          return 0;                    }                      return 1;</code></pre><p>Log cat:</p><pre><code>06-14 12:03:11.701: ERROR/AndroidRuntime(443): Uncaught handler: thread main exiting due to uncaught exception06-14 12:03:11.861: ERROR/AndroidRuntime(443): java.lang.OutOfMemoryError: bitmap size exceeds VM budget06-14 12:03:11.861: ERROR/AndroidRuntime(443):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)</code></pre>","249991","","991737","","2012-01-10 17:35:27","2013-09-10 03:01:09","How to handle out of memory error?","<android>","3","0","3","",""
"3035254","1","3036664","","2010-06-14 06:11:36","4","826","<p>I want to know when a close method of a sqlite database should be called in a life cycle, since the NotePad sample in the sdk (http://developer.android.com/resources/tutorials/notepad/index.html) doesn't call NotesDbAdapter.close(), it implements that method though.</p><p>My application accesses the db not so frequently, but some, it depends on user requests. I think I should open the db at the onCreate, and close it at the onDestroy. Is that a good practice?</p><p>Thanks in advance,yokyo</p>","366049","","","","","2011-05-20 15:10:29","When should I call a close method of a SQLite database in Android","<android>","1","0","1","",""
"3035692","1","3036187","","2010-06-14 07:46:35","248","163621","<p>I would like to set a certain <code>Drawable</code> as the device's wallpaper, but all wallpaper functions accept <code>Bitmap</code>s only. I cannot use <code>WallpaperManager</code> because I'm pre 2.1.</p><p>Also, my drawables are downloaded from the web and do not reside in <code>R.drawable</code>.</p>","283630","","267269","","2013-05-28 11:35:02","2014-04-16 18:10:30","How to convert a Drawable to a Bitmap?","<android><bitmap><wallpaper><android-drawable>","10","0","88","",""
"3035997","1","","","2010-06-14 09:01:19","0","1062","<p>i have written a application for android phone (nexus1) which collects some information regularly at some intervals.Now i want to transfer the information collected to some particular server regularly as the information is collected by phone?</p>","363159","","","","","2010-06-14 09:24:58","Transfer data from android phone to another server","<android><data><transfer>","1","0","1","",""
"3036004","1","3036369","","2010-06-14 09:02:06","2","1268","<p>I have noticed that by shaking or tapping the phone (an SE Xperia x10 mini) several times recalibrates the magnetometer. Is there any way of doing this software-wise in a more controlled way?</p>","356297","","","","","2010-06-14 10:08:39","Soft reset of magnetometer in Android","<android><magnetometer>","1","0","1","",""
"3036139","1","3038419","","2010-06-14 09:27:08","4","10375","<p>I have a class that extends Overlay and implemments Overlay.Snappable. I have overriden its <strong>draw</strong> method:</p><pre><code>@Overridepublic void draw(Canvas canvas, MapView mv, boolean shadow){    Projection projection = mv.getProjection();    ArrayList&lt;GeoPoint&gt; geoPoints = new ArrayList&lt;GeoPoint&gt;();    //Creating geopoints - ommited for readability    Path p = new Path();    for (int i = 0; i &lt; geoPoints.size(); i++) {    if (i == geoPoints.size() - 1) {        break;    }    Point from = new Point();    Point to = new Point();    projection.toPixels(geoPoints.get(i), from);    projection.toPixels(geoPoints.get(i + 1), to);    p.moveTo(from.x, from.y);    p.lineTo(to.x, to.y);    }    Paint mPaint = new Paint();    mPaint.setStyle(Style.FILL);    mPaint.setColor(0xFFFF0000);    mPaint.setAntiAlias(true);    canvas.drawPath(p, mPaint);    super.draw(canvas, mv, shadow);}</code></pre><p>As you can see, I make a list of points on a map and I want them to form a polygonal shape.</p><p>Now, the problem is that when I set paint style to be FILL or FILL_AND_STROKE nothing shows up on the screen, but when I set it to be just stroke, and set stroke width, it acctually draws what it is supposed to draw.</p><p>Now, I looked for solution, but nothing comes up. Can you tell me if I something missed to set in the code itself, or are there some sorts of constraints when drawing on Overlay canvases?</p><p>Thanks </p>","366156","","","","","2010-06-14 15:20:20","Android - drawing path as overlay on MapView","<java><android><overlay><android-mapview><draw>","1","0","3","",""
"3036168","1","","","2010-06-14 09:31:00","0","861","<p>I used a gridview in this app.</p><p>When i run it at Verison 1.6 or newer, it's OK. But i can not get this gridview in 1.5.</p><p>I always show this info and exception:</p><pre>Unable to resolve drawable ""com.android.layoutlib.utils.DensityBasedResourceValue@397660"" in attribute ""listSelector""org.xmlpull.v1.XmlPullParserException: Binary XML file line #3:  tag requires a 'drawable' attribute or child tag defining a drawable    at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:151)    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779)    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720)    at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)    at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668)    at android.widget.AbsListView.(AbsListView.java:514)    at android.widget.GridView.(GridView.java:69)    at android.widget.GridView.(GridView.java:65)    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)    at android.view.LayoutInflater.createView(LayoutInflater.java:499)    at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77)    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)    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.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.gle1.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:3910)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)    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)</pre><p>This is the layout xml:</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:background=""@drawable/menu_background2""&gt;    &lt;LinearLayout android:id=""@+id/logopanel""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_alignParentTop=""true""    android:layout_marginTop=""50dip"" android:gravity=""center""    android:layout_marginBottom=""10dip""&gt;            &lt;ImageButton android:id=""@+id/searchbar""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:background=""@drawable/fake_search_bar""&gt;&lt;/ImageButton&gt;   &lt;/LinearLayout&gt; &lt;LinearLayout android:id=""@+id/iconpanel""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@+id/logopanel""    android:layout_above=""@+id/allbotpanel"" android:layout_marginTop=""10dip""&gt;           &lt;GridView android:id=""@+id/gridcontent"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:gravity=""center""        android:numColumns=""3"" android:layout_gravity=""center""        android:layout_centerInParent=""true"" android:background=""@drawable/transparent_backgroud""        android:listSelector=""@drawable/gridviewselector""&gt;          &lt;/GridView&gt; &lt;/LinearLayout&gt; &lt;RelativeLayout android:id=""@+id/allbotpanel""    android:layout_width=""fill_parent"" android:layout_height=""75dip""    android:background=""@drawable/amex_bottom_bar""    android:layout_alignParentBottom=""true""&gt;            &lt;LinearLayout android:id=""@+id/noticebar""        android:orientation=""horizontal"" android:layout_width=""fill_parent""        android:layout_height=""29dip"" android:layout_above=""@+id/homebottombar""&gt;                    &lt;ImageButton android:id=""@+id/infoicon""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_gravity=""left|center_vertical""            android:layout_marginLeft=""10dip"" android:background=""@drawable/amex_info_button"" android:src=""@drawable/infoselector""&gt;&lt;/ImageButton&gt;                   &lt;TextView android:id=""@+id/noticeicon"" android:gravity=""center""            android:layout_gravity=""right|center_vertical"" android:layout_width=""wrap_content""            android:layout_height=""25dip"" android:layout_weight=""1""            android:clickable=""true"" android:focusable=""true"" android:text=""@string/notice_string""&gt;&lt;/TextView&gt;          &lt;/LinearLayout&gt;         &lt;LinearLayout android:id=""@+id/homebottombar""        android:orientation=""horizontal"" android:layout_width=""fill_parent""        android:layout_height=""46dip"" android:gravity=""center""        android:layout_alignParentBottom=""true"" android:background=""@drawable/amex_bottom_bar""        android:layout_marginBottom=""3dip""&gt;&lt;/LinearLayout&gt;  &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","275788","","40342","","2010-06-14 09:44:20","2010-12-11 13:33:46","Android 1.5 Gridview Problem","<android>","1","3","","",""
"3036239","1","3723145","","2010-06-14 09:43:01","5","3953","<p>I know that unfortunately detecting and changing programmatically data connection (GPRS/UMTS) on vanilla Android is not possible, and the common workaround is to edit APN settings. This is hardly a nice solution.</p><p>However on my device (Xperia X10) I have an additional setting near ""data roaming"", that allows to enable or disable MMS and data. I suppose that this is a personalization made by Sony Ericsson, and maybe even other vendors have something like this. Is there a way to access this setting?</p>","297373","","","","","2010-10-14 13:19:36","Detecting and changing programmatically data connection (GPRS/UMTS) on Android","<android><gprs>","2","2","4","",""
"3036265","1","3037101","","2010-06-14 09:49:14","3","9008","<p>I'm wondering why the Motorola Milestone with 2.1-update1 behaves differently from the Emulator or e.g. the Nexus One. I am trying to exit my app with:</p><pre><code>@Overrideprotected void onPause() {    if(mayDestroyActivity) this.finish();    super.onPause();}</code></pre><p>This works well on either Emulator or Nexus One. <code>onDestroy()</code> gets called immediatly after <code>onPause()</code> and <code>onStop</code>. But not for the Milestone. Instead, <code>onDestroy()</code> gets called when another Activity is started. Its section in the Manifest looks like this:</p><pre><code>&lt;activity android:name="".MyActivity""      android:configChanges=""orientation|keyboardHidden""   android:label=""@string/questionnaire_item"" android:launchMode=""singleInstance""    android:theme=""@android:style/Theme.NoTitleBar.Fullscreen"" android:windowSoftInputMode=""adjustPan""&gt; &lt;intent-filter&gt;  &lt;category android:name=""android.intent.category.OPENABLE"" /&gt; &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>Does anyone have a hint on this? My app depends on exiting properly since I save all progress in <code>onDestroy()</code></p><p>Thanks,<br>Steff</p>","289849","","812149","","2012-07-25 11:45:31","2012-07-25 11:45:31","onDestroy() won't get called after this.finish()","<android><milestone>","3","0","","",""
"3036296","1","3036724","","2010-06-14 09:55:41","0","3073","<p>I have a long scrolling list of EditText items created by a SimpleCursorAdapter and prepopulated with values from an SQLite database.</p><p>I make this by:</p><pre><code>cursor = db.rawQuery(""SELECT _id, criterion, localweight, globalweight FROM "" + dbTableName + "" ORDER BY criterion"", null);startManagingCursor(cursor);mAdapter = new SimpleCursorAdapter(this, R.layout.weight_edit_items, cursor, new String[]{""criterion"",""localweight"",""globalweight""}, new int[]{R.id.criterion_edit, R.id.localweight_edit, R.id.globalweight_edit});    this.setListAdapter(mAdapter);</code></pre><p>The scrolling list is several emulator screens long. The items display OK - scrolling through them shows that each has the correct value from the database.</p><p>I can make an edit change to any of the EditTexts and the new text is accepted and displayed in the box.</p><p>But...if I then scroll the list far enough to take the edited item off the screen, when I scroll back to look at it again its value has returned to what it was before I made the changes, ie. my edits have been lost.</p><p>In trying to sort this out, I've done a getText to look at what's in the EditText after I've done my edits (and before a scroll) and getText returns the <strong>original</strong> text, even though the EditText is displaying my <strong>new</strong> text. It seems that the EditText has only accepted my edits superficially and they haven't been bound to the EditText, meaning they get dropped when scrolled off the screen.</p><p>Can anyone please tell me what's going on here and what I need to do to force the EditText to retain its edits? </p><p>Thanks</p><p>Ian</p>","366189","","","","","2012-11-09 16:51:05","EditText items in a scrolling list lose their changes when scrolled off the screen","<android><scrolling><edittext>","2","0","","",""
"3036708","1","3036865","","2010-06-14 11:10:58","1","2866","<p>I'm just wondering what consequences the method </p><pre><code>isRouteDisplayed()</code></pre><p>has, regarding to functionality of a map view...</p><p>I have two activities, one displays a route and one doesn't. Is it mandatory to let the first isRouteDisplayed()-Method return true? What effects does it have?</p><p>greets, poeschlorn</p>","317301","","","","","2010-06-14 11:35:58","Consequences of isRouteDisplayed() on map view","<android><gps><android-mapview>","1","0","","",""
"3036816","1","","","2010-06-14 11:29:22","1","1672","<p>I am streaming an rtsp video to Android.<br />How could I calculate network metrics like packet loss, jitter or delay?</p>","54211","","54211","","2010-06-14 11:47:10","2011-03-19 22:57:02","Calculating packet loss, jitter and delay","<android><metrics><delay><packet><rtsp>","2","0","","",""
"3036952","1","","","2010-06-14 11:52:20","0","836","<p>I have a problem while using the following import functions..Can any1 help me how to solve it</p><pre><code>import android.net.http.RequestQueue;  import org.apache.commons.codec.binary.Base64;</code></pre><p>My intent is to send a tweet using Android..</p>","362307","","12183","","2010-06-14 11:59:13","2010-10-22 06:17:22","Packages for import android.net.http.RequestQueue;","<java><android>","1","2","","",""
"3037027","1","","","2010-06-14 12:02:50","32","25338","<p>I am having an OutOfMemory exception with a gallery over 600x800 pixels JPEG's.</p><hr><p><strong>The environment</strong></p><p>I've been using Gallery with JPG images around 600x800 pixels.</p><p>Since my content may be a bit more complex than just images, I have set each view to be a RelativeLayout that wraps ImageView with the JPG.</p><p>In order to ""speed up"" the user experience I have a simple cache of 4 slots that prefetches (in a looper) about 1 image left and 1 image right to the displayed image and keeps them in a 4 slot HashMap. </p><p><strong>The platform</strong></p><p>I am using AVD of 256 RAM and 128 Heap Size, with a 600x800 screen.It also happens on an Entourage Edge target, except that with the device it's harder to debug.</p><hr><p><strong>The problem</strong></p><p>I have been getting an exception:</p><pre><code>OutofMemoryError: bitmap size exceeds VM budget</code></pre><p>And it happens when fetching the fifth image. I have tried to change the size of my image cache, and it is still the same.</p><hr><p><strong>The strange thing: There should not be a memory problem</strong></p><p>In order to make sure the heap limit is very far away from what I need, I have defined a dummy 8MB array in the beginning, and left it unreferenced so it's immediately dispatched. It is a member of the activity thread and is defined as following</p><pre><code>static { @SuppressWarnings(""unused"")byte dummy[] = new byte[ 8*1024*1024 ]; }    </code></pre><p>The result is that the heap size is nearly 11MB and it's all free.<em>Note</em> I have added that trick after it began to crash. It makes OutOfMemory less frequent.</p><p>Now, I am using DDMS. Just before the crash (does not change much after the crash), DDMS shows:</p><pre><code>ID  Heap Size   Allocated   Free       %Used    #Objects1   11.195 MB   2.428 MB    8.767 MB   21.69%   47,156  </code></pre><p>And in the detail table it shows:</p><pre><code>Type  Count  Total Size   Smallest   Largest   Median    Averagefree  1,536  8.739MB      16B        7.750MB   24B       5.825KB</code></pre><p>The largest block is 7.7MB. And yet the LogCat says:</p><pre><code>ERROR/dalvikvm-heap(1923): 925200-byte external allocation too large for this process.</code></pre><p>If you mind the relation of the median and the average, it is plausible to assume that most of the available blocks are very small. However, <strong>there is a block large enough for the bitmap, it's 7.7M. How come it is still not enough?</strong></p><p>Note: I recorded a heap trace. When looking at the amount of data allocated, it does not feel like more than 2M is allocated. It does match the free memory report by DDMS.</p><hr><ul><li>Could it be that I experience some problem like heap-fragmentation?</li><li>How do I solve/workaround the problem?</li><li>Is the heap shared to all threads?</li><li>Could it be that I interpret the DDMS readout in a wrong way, and there is really no 900K block to allocate? If so, can anybody please tell me where I can see that?</li></ul><p>Thanks a lot</p><p>Meymann</p>","361169","","361169","","2010-06-14 12:20:36","2013-01-05 14:12:04","Android: OutofMemoryError: bitmap size exceeds VM budget with no reason I can see","<android><gallery><imageview><out-of-memory><ddms>","2","3","6","",""
"3037037","1","","","2010-06-14 12:04:10","1","724","<p>I am facing the problem with openfileinput class.First thing is , I am saving my username and password in the file.On sucessful login, I will be saving and moving to internal home screen.The problem is when I logout or close the application, and reopen the application I am able to read the data but when I convert it to String I get Out put as AAAAAA(each as 4 bytes). On succesful login on moving to Home screen , I am able to read it properly.I get this output before login. </p><p>This is something like , saving username and password in internal memory of android.</p><p>Regards:</p><p>Jayanth Gande </p>","320276","","","","","2010-06-14 12:04:10","Problem facing in reading file from Internal memory of android","<android><memory><internal>","0","3","","",""
"3037246","1","","","2010-06-14 12:39:58","2","1191","<p>Can anyone tel me how to tweet using Android?How can i send tweets using Android?</p>","362307","","","","","2010-06-14 15:09:17","Sending tweets using Android","<android>","3","1","1","",""
"3037303","1","","","2010-06-14 12:48:32","5","1408","<p>I'm developing an app in which i need the TCP connection to stay alive. I've implemented a kind of ping/pong system to do this. It works perfectly when the screen is on, but when it goes of the phone stops responding to the pings after a while. I've created a Wi-Fi wake lock but i'm still experiencing still the same problem..</p><p>This is my code:</p><pre><code>private static WifiManager wm = getSystemService(this.WIFI_SERVICE);private static WifiLock wl = null;public static void lock(){    wl = wm.createWifiLock(WifiManager.WIFI_MODE_FULL , App.TAG);    if(!wl.isHeld()){        wl.acquire();    }}public static void unlock(){    if(wl != null){        if(wl.isHeld()){            wl.release();        }    }}</code></pre><p>Any ideas?</p>","366330","","366330","","2010-06-14 15:35:36","2010-06-15 12:53:21","Wake lock does not seem to work","<android><networking><wifi>","1","3","","",""
"3037310","1","","","2010-06-14 12:49:48","3","800","<p>I have fairly large map overlay that I am displaying over the google maps data but would still like to see the country/state/province lines through my overlay (so the lines would essentially be <em>on top</em> of my overlay).</p><p>As I understand, these lines are simply polygons drawn over the maps.  Is there any way to access these?  If so, how do I get them to show up through my overlay images?</p>","361672","","","","","2011-02-09 23:15:22","How do you access country/state/province polygons in google maps api?","<android><overlay><google-maps>","1","0","","",""
"3037375","1","","","2010-06-14 13:01:13","8","6956","<p>In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line in onCreate method, but it does not work.</p><pre><code>((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(EditText.getWindowToken(), 0);</code></pre>","278194","","","","","2011-03-14 05:22:20","How to keep soft keyboard from opening on activity launch in Android?","<android>","4","0","5","",""
"3037479","1","","","2010-06-14 13:16:44","0","587","<p>refering to this question: <a href=""http://stackoverflow.com/questions/2949994/how-does-scrolling-in-android-listview-work"">http://stackoverflow.com/questions/2949994/how-does-scrolling-in-android-listview-work</a></p><p>on change from state 2 to 3 the clicked listitem is increased in its size to show more information. if the clicked item was the last one on screen, the extended listitem is not fully visible because the new content flows out at the bottom of the screen.</p><p>my current solution is to call ""setSelection(index)"", if the last visible listitem was clicked. this results in a state were the selection is brought to the top of the screen. this is annoying because the listitem moves from bottom to top.</p><p>is there a way to avoid this? this means, is there something to let the listview know, that is should scroll only the minimum amount of pixels, so that the clickeditem is fully visible?or have i to programm this functionality on my own?</p>","345596","","21234","","2010-06-25 13:19:06","2011-01-10 18:14:55","Minimum scroll amount when programmatically selecting ListItem in android ListView","<android><listview><layout>","1","0","","",""
"3037512","1","3038450","","2010-06-14 13:21:02","4","9573","<p>Before u start: I searched the google and stackoverflow, none of them gave clear answer.</p><p>Situation: I'm using Eclipse on Windows to develop Android application. So when I'm trying to run the app, the system outputs to console</p><pre><code>[2010-06-14 17:04:39 - HelloLinearLayout] ------------------------------[2010-06-14 17:04:39 - HelloLinearLayout] Android Launch![2010-06-14 17:04:39 - HelloLinearLayout] adb is running normally.[2010-06-14 17:04:39 - HelloLinearLayout] Performing com.example.HelloLinearLayout.HelloLinearLayout activity launch[2010-06-14 17:04:39 - HelloLinearLayout] Automatic Target Mode: launching new emulator with compatible AVD 'Default_2.1'[2010-06-14 17:04:39 - HelloLinearLayout] Launching a new emulator with Virtual Device 'Default_2.1'</code></pre><p>starts the emulator, but doesn't upload the .apk and doesn't start the activity. So, app is not started anyway.</p><p>I found a ""solution"" <a href=""http://developer.android.com/resources/faq/troubleshooting.html#eclipse"" rel=""nofollow"">here</a>, but it's unclear and seems to not work. For example, I don't know, which ""emulator processed"" are meant to be killed. I found adb.exe only. And that's the main point: sometimes I'm lucky enough to kill all that they wanted and start the app. But it's undetermined.</p><p>Please help, I'm completely stuck with this trouble.</p>","113134","","","","","2012-06-30 17:32:01","Android application doesn't start from Eclipse","<android><eclipse><android-emulator>","3","1","1","",""
"3037767","1","3037807","","2010-06-14 13:53:06","5","29643","<p>I want to create a SQLite database in my app, which contains three tables, I will add data into tables and will use them later on.</p><p>but I like to keep database ,as if when app is first time installed it checks whether the database exist or not, if exists it updates it else if not then creates a new database.</p><p>further more I am making a DB class to facilitate my app,so  I wont be creating an activity for my database creation.</p><p>if there are possible advices, please share with me</p>","328518","","114066","","2010-07-21 09:46:22","2014-01-05 03:18:46","Create SQLite database in android","<android><database><sqlite>","5","0","3","",""
"3038130","1","","","2010-06-14 14:38:34","6","3014","<p>I'm interested in android activity lifecycle and I would like to get more detailed description/documentation/reference than widely available basic (onCreate->onStart->onResume)<a href=""http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle""> one</a>. </p><p>My need comes from realizing that starting new activity (<code>Theme.Dialog</code> styled) from <code>onAttachedToWindow()</code> greatly improves response time if comparing to starting it from onCreate(). I wonder how this <code>onAttachedToWindow()</code> fits into whole android activity lifecycle. Official API ref description <em>""Called when the window has been attached to the window manager""</em> doesn't help a lot.</p>","18104","","","","","2010-06-14 16:12:41","Detailed android activity lifecycle (onAttachedToWindow())","<android><dialog><activity>","1","2","2","",""
"3038165","1","3038477","","2010-06-14 14:44:07","5","9991","<p>Calling a .net SOAP1.1 web service from android using ksoap2 lib I met a problem of casting response to a custom object. For instance the code below is called correct after httpTransport.call(soapAction, soapEnvelope); and have data inside. But I cant't cast it to specific object neither to SoapObject or Vector as I saw in several examples, I get CastException or simple nothing. If somebody knows how to deal with it, please help.</p><pre><code>public StatusSetting[] GetAllStatuses(String installation){    StatusSetting[] statuses = null;    String methodName =  ""GetAllStatuses"";    String soapAction = NAMESPACE + ""/"" + methodName;    SoapObject request = new SoapObject(NAMESPACE, methodName);    request.addProperty(""installation"", installation);    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    soapEnvelope.dotNet = true;    soapEnvelope.setOutputSoapObject(request);    AndroidHttpTransport httpTransport = new AndroidHttpTransport(SERVICE_URL);    try {        httpTransport.call(soapAction, soapEnvelope);        statuses = (StatusSetting[])soapEnvelope.getResponse();    } catch (Exception e) {        e.printStackTrace();    }    return statuses;}</code></pre>","323128","","323128","","2010-06-15 06:14:52","2012-08-15 11:35:55","ksoap2 casting getResponse()","<android><casting><web-services><ksoap2>","3","0","3","",""
"3038409","1","3038747","","2010-06-14 15:18:47","6","24622","<p>I'm going to create mobile application that works with CommuniGate Pro server.</p><p>For example, I need to make the following Android Client <code>C</code> - CGP Server <code>S</code> conversation and get <code>XIMSS.nonce</code> node value:</p><pre><code>C:GET /ximsslogin/ HTTP/1.1  Host: myserver.com  Content-Type: text/xml  Content-Length: 42  &lt;XIMSS&gt;&lt;listFeatures id=""list"" /&gt;&lt;XIMSS&gt;S:HTTP/1.1 200 OK  Content-Length: 231  Connection: keep-alive  Content-Type: text/xml;charset=utf-8  Server: CommuniGatePro/5.3  &lt;XIMSS&gt;&lt;nonce&gt;2C3E575E5498CE63574D40F18D00C873&lt;/nonce&gt;&lt;language&gt;german&lt;/language&gt;&lt;response id=""s""/&gt;&lt;/XIMSS&gt; </code></pre><p>Example, in ActionScript 3.0 it looks this way:</p><pre><code>var loader:Loader = new Loader();loader.addEventListener(Event.COMPLETE, completeHandler);var urlRequest:URLRequest = new URLRequest(...);urlRequest.method = ...;urlRequest.data = ...;loader.load(urlRequest);private function completeHandler(...):void { ... };</code></pre><p>How will it look in Java for <strong>Android 2.1</strong>?</p>","366411","","759866","","2013-12-28 10:44:52","2013-12-28 10:44:52","How to send HTTP POST request and receive response?","<android>","1","1","13","",""
"3038474","1","","","2010-06-14 15:26:20","10","9251","<p>I'm trying to provide my users with the ability to use either external or internal storage. I'm displaying both images and videos (of a scientific nature). When storing the media on the SD card, all is fine. But when I store the media internally, only the images will display. No matter what I try I get various errors when trying to load and display the media stored under the applicationcontext.getFilesDir().</p><p>Is there a trick to setting a videoview's content to such a file? </p><p>Can a ContentResolver help me?</p><p>On a related note, is it considered bad form to assume that external storage exists?</p><p>Thanks in advance,</p><p>Sid</p><p>Below is one version that fails with ""Cannot play video. Sorry, this video cannot be played"". But I have many other modes of failure. I can copy the internal video to temp storage (external) and play it, so this copy to internal does indeed create a valid movie. It only fails when I try to play it directly from the internal storage.</p><pre><code>videoFile = new File(this.getFilesDir() + File.separator + ""test.mp4"");InputStream data = res.openRawResource(R.raw.moviegood);try {    OutputStream myOutputStream = new FileOutputStream(videoFile);    byte[] buffer = new byte[8192];    int length;    while ( (length = data.read(buffer)) &gt; 0 ) {        myOutputStream.write(buffer);    }    //Close the streams    myOutputStream.flush();    myOutputStream.close();    data.close();} catch (FileNotFoundException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();}vview.setKeepScreenOn(true);vview.setVideoPath(videoFile.getAbsolutePath());vview.start();</code></pre>","366448","","1134705","","2012-10-11 16:53:25","2013-03-08 21:20:35","Can a videoview play a video stored on internal storage?","<android><internal><videoview>","4","3","5","",""
"3038532","1","3039424","","2010-06-14 15:32:53","1","4729","<p>I'm having trouble displaying SOME images on my android app. Just normal display image from certain URL. Some images works, some just doesn't work. For instance try displaying this image from URL:</p><p><a href=""http://img191.imageshack.us/img191/7379/tronlegacys7i7wsjf.jpg"" rel=""nofollow"">http://img191.imageshack.us/img191/7379/tronlegacys7i7wsjf.jpg</a></p><p>It doesn't work. Doesn't even work in emulator.</p><p>Could it be the EXIF info for the image is problematic? Can anyone try to see they are able to display that image on android app, and share the code/method to display that image on screen?</p><p>Thank you!</p>","243832","","","","","2012-03-30 15:11:05","Android how to display and image from URL","<android>","3","0","","",""
"3038714","1","3039190","","2010-06-14 15:58:00","5","256","<p>I was wondering if any one had compiled a list of the most commonly used Android devices so I can get an idea of what I should test for. Even better would be suggested configurations for emulating each device.</p><p>Thanks,Rob</p>","289153","","","","","2014-02-21 13:31:27","Testing an application for Android","<android>","2","0","3","",""
"3038771","1","","","2010-06-14 16:06:35","1","1741","<p>I want to connect my Motorola droid to <code>OBDKey</code> by Bluetooth. I use <code>BluetoothChat</code> as an example to connect to Bluetooth, with KWP as protocol</p><p>Then I write byte[] command </p><pre><code> command[0]=rawToByte(0x02); command[1]=rawToByte(0x85); command[2]=rawToByte(0x05); command[3]=rawToByte(0xc7); command[4]=rawToByte(0x33); command[5]=rawToByte(0xf1); command[6]=rawToByte(0x00); command[7]=rawToByte(0x00); command[8]=rawToByte(0x00); command[9]=rawToByte(0x00); command[10]=rawToByte(0x00); command[11]=rawToByte(0x00); command[12]=rawToByte(0x00); command[13]=rawToByte(0x00); command[14]=rawToByte(0x76);</code></pre><p>where function ""rawToByte"" is:</p><pre><code>public static byte rawToByte(int b) {    return (byte) (0xff &amp; b);}</code></pre><p>In the result OBDKey sent to device byte 0x02 This value is the first command, so it copy value. What did I do wrong?</p>","366494","","844882","","2012-03-17 19:19:38","2012-06-25 14:55:56","OBDKey Bluetooth","<android><bluetooth>","2","0","1","",""
"3038834","1","3039174","","2010-06-14 16:13:46","3","1049","<p>I am creating a file in my Android application as follows:</p><hr><pre><code>HEADINGSTRING = new String(""Android Debugging "" + ""\n""                    ""XML test Debugging"");}public void setUpLogging(Context context){    Log.d(""LOGGING"", ""Setting up logging....."");    try { // catches IOException below         FileOutputStream fOut = context.openFileOutput(FILE_NAME,Context.MODE_APPEND);         OutputStreamWriter osw = new OutputStreamWriter(fOut);          // Write the string to the file         osw.write(HEADINGSTRING);        /* ensure that everything is        * really written out and close */        osw.flush();       osw.close();} catch (FileNotFoundException e) {    e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}    finally{        Log.d(""LOGGING"", ""Finished logging setup....."");    }}</code></pre><hr><p>And I write to the file during the running of the app as follows:</p><hr><pre><code>public void  addToLog(File file, String text) throws IOException {         BufferedWriter bw = new BufferedWriter (new FileWriter(file, true));         bw.write (""\n"" + text);         bw.newLine();         bw.flush();         bw.close();}</code></pre><hr><p>This works fine but when my app closes the file gets deleted and when the app is run again all the information I wrote to it is gone.</p><p>How can I make sure the file persists even after closure of the app?</p><p><strong>Update:</strong></p><p>I have changed MODE_PRIVATE to MODE_APPEND and the problem is fixed, thanks Skirmish.</p>","243999","","243999","","2010-06-15 08:46:47","2010-06-15 08:46:47","Android - Persist file when app closes","<java><android><file><outputstream><bufferedwriter>","1","0","3","",""
"3038854","1","","","2010-06-14 16:16:28","0","292","<p>i run the following program in my emulator and got my desired output.</p><pre><code>MyHandler handler=new MyHandler();        XMLReader xr = parser.getXMLReader();        xr.setContentHandler(handler);        xr.parse(new InputSource(XML_FILE_URL));        tv.setText(handler.getParsedData());</code></pre><p>But when i run it on my device (HTC my touch slide) i am getting error. I have added internet permission to my apps. Hear is the log cat out put</p><pre><code>E/PackageInstallationReceiver(  244): Remove /data/local/tmp/com.dlp.apk Fail!W/System.err(  244): java.io.IOException: Error running exec(). Commands: [/system/xbin/su, 0, /system/bin/rm, /data/local/tmp/com.dlp.apk] Working Directory: null Environment: nullW/System.err(  244):    at java.lang.ProcessManager.exec(ProcessManager.java:196)W/System.err(  244):    at java.lang.Runtime.exec(Runtime.java:225)W/System.err(  244):    at java.lang.Runtime.exec(Runtime.java:313)W/System.err(  244):    at java.lang.Runtime.exec(Runtime.java:246)W/System.err(  244):    at com.htc.android.psclient.PackageInstallationReceiver.removeTempPackageFile(PackageInstallationReceiver.java:34)W/System.err(  244):    at com.htc.android.psclient.PackageInstallationReceiver.access$000(PackageInstallationReceiver.java:8)W/System.err(  244):    at com.htc.android.psclient.PackageInstallationReceiver$1.run(PackageInstallationReceiver.java:24)W/System.err(  244): Caused by: java.io.IOException: No such file or directoryW/System.err(  244):    at java.lang.ProcessManager.exec(Native Method)W/System.err(  244):    at java.lang.ProcessManager.exec(ProcessManager.java:194)W/System.err(  244):    ... 6 moreD/RegisterService(  547): insert plugin size 1</code></pre><p>any suggestion?</p><p>/minhaz</p>","366489","","366489","","2013-09-25 02:48:01","2013-09-25 02:48:01","Android: Sax: IO exception on device but in emulator running fine","<android><sax>","0","3","","",""
"3038924","1","","","2010-06-14 16:24:46","0","659","<p>Recently a client asked me to make their site ""work on smart phones"", which normally wouldn't be too much of an issue... However it's a video site, and I have absolutely no idea where to even begin. Right off the bat I'm not even going to consider allowing the site to even function in anything other than Android (Maybe even 2.0+) and iPhone, maybe Blackberry and WinMo. But beyond that... What do I do? I'm looking at using the  tag, however I'm unsure what, if any, codecs which phone uses. Is HTML5 even adopted in their browsers yet?<br /><br />Could someone please point me in the right direction? Am I going about this the right way, using the  tag? Or is there some magical html element both iPhone and Android (And BB and WMo) that lets them run video in their native video players (Like on youtube).</p>","200025","","49246","","2010-06-14 19:16:52","2010-11-24 14:15:49","Getting WAP embedded video in android AND iphone?","<iphone><android><video><html5><embedded-video>","1","1","","",""
"3038927","1","3039102","","2010-06-14 16:24:58","0","3283","<p>I have a ListView that shows a list of names. When you select a name, I want to pass the selected person' ID to the next view (Profile) and retreieve their data based on their ID.</p><p>I am able to load the Profile View, but do not know how to pass the ID from the ListView to the Profile. Here is how I am loading the Profile:</p><pre><code>    lv.setOnItemClickListener(new OnItemClickListener() {           public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {                   Intent myIntent = new Intent(view.getContext(), SubView.class); // when a row is tapped, load SubView.class             startActivityForResult(myIntent, 0); // display SubView.class                          }    }); </code></pre>","300129","","","","","2010-06-14 16:46:41","Android - Passing Value from ListView to a new Activity?","<android><listview><subview>","2","2","","",""
"3038958","1","3042279","","2010-06-14 16:28:47","5","6074","<p>I've read about intents in android but here goes my question. I'd like to launch an app on my android phone with the click of a link in the web browser. Example:If the link is ""mycam://http://camcorder.com"", ""mycam://"" acts as some kind of ""tag"" to launch my app but I'd like to pass ""http://camcorder.com"" as a string to that app on start.</p><p>Help please!</p><p>Thanks!</p>","353162","","","","","2010-06-15 04:37:20","Launch app with URL","<android><android-intent>","2","0","4","",""
"3039053","1","3039060","","2010-06-14 16:40:07","4","878","<p>We all know that Android runs Dalvik VM programs.</p><p>Normally developers write programs in Java and they compile it to Dalvik bytecode.</p><p>I wonder if it would be possible to create a compiler that can take C# code and compile it into Dalvik bytecode.</p>","66803","","14357","","2010-06-14 16:41:29","2010-06-14 16:41:29","Is it possible to write apps for Android in C#?","<c#><android><compiler>","1","2","5","","2010-06-14 16:40:07"
"3039078","1","","","2010-06-14 16:42:38","5","10490","<p>If I play a single sound, it runs fine. </p><p>Adding a second sound causes it to crash. </p><p>Anyone know what is causing the problem?</p><pre><code>private SoundManager mSoundManager;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.sos);    mSoundManager = new SoundManager();    mSoundManager.initSounds(getBaseContext());    mSoundManager.addSound(1,R.raw.dit);    mSoundManager.addSound(1,R.raw.dah);    Button SoundButton = (Button)findViewById(R.id.SoundButton);    SoundButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            mSoundManager.playSound(1);            mSoundManager.playSound(2);        }    });}</code></pre>","366519","","390278","","2011-10-17 08:42:41","2011-10-17 08:42:41","Playing multiple sounds using SoundManager","<android><audio><soundpool>","1","1","5","",""
"3039137","1","","","2010-06-14 16:49:23","12","25797","<p>Okay, I have an android application that has a form in it, two EditText, a spinner, and a login button. The user selects the service from the spinner, types in their user name and password, and clicks login. The data is sent via POST, a response is returned, it's handled, a new webview is launched, the html string generated from the response is loaded, and I have the home page of whatever service the user selected. </p><p>That's all well and good. Now, when the user clicks on a link, the login info can't be found, and the page asks the user to login again. My login session is being dropped somewhere, and I'm not certain how to pass the info from the class that controls the main part of my app to the class that just launches the webview activity.</p><p>The on click handler from the form login button:</p><pre><code> private class FormOnClickListener implements View.OnClickListener {  public void onClick(View v)     {  String actionURL, user, pwd, user_field, pwd_field;  actionURL = ""thePageURL"";  user_field = ""username""; //this changes based on selections in a spinner  pwd_field = ""password""; //this changes based on selections in a spinner  user = ""theUserLogin"";  pwd = ""theUserPassword"";  List&lt;NameValuePair&gt; myList = new ArrayList&lt;NameValuePair&gt;();        myList.add(new BasicNameValuePair(user_field, user));         myList.add(new BasicNameValuePair(pwd_field, pwd));        HttpParams params = new BasicHttpParams();        DefaultHttpClient client = new DefaultHttpClient(params);        HttpPost post = new HttpPost(actionURL);        HttpResponse response = null;        BasicResponseHandler myHandler = new BasicResponseHandler();        String endResult = null;        try { post.setEntity(new UrlEncodedFormEntity(myList)); }         catch (UnsupportedEncodingException e)         { e.printStackTrace(); }         try { response = client.execute(post); }         catch (ClientProtocolException e)         { e.printStackTrace(); }         catch (IOException e)         { e.printStackTrace(); }          try { endResult = myHandler.handleResponse(response); }         catch (HttpResponseException e)         { e.printStackTrace(); }         catch (IOException e)         { e.printStackTrace(); }        List&lt;Cookie&gt; cookies = client.getCookieStore().getCookies();        if (!cookies.isEmpty()) {        for (int i = 0; i &lt; cookies.size(); i++) {        cookie = cookies.get(i);}        }       Intent myWebViewIntent = new Intent(MsidePortal.this, MyWebView.class);       myWebViewIntent.putExtra(""htmlString"", endResult);       myWebViewIntent.putExtra(""actionURL"", actionURL);       startActivity(myWebViewIntent);    }}</code></pre><p>And here is the webview class that handles the response display:</p><pre><code>public class MyWebView extends android.app.Activity{ private class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) {     view.loadUrl(url);     return true;} }@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.web);    MyWebViewClient myClient = new MyWebViewClient();    WebView webview = (WebView)findViewById(R.id.mainwebview);    webview.getSettings().setBuiltInZoomControls(true);     webview.getSettings().setJavaScriptEnabled(true);     webview.setWebViewClient(myClient);    Bundle extras = getIntent().getExtras();    if(extras != null)     {      // Get endResult         String htmlString = extras.getString(""htmlString"");         String actionURL = extras.getString(""actionURL"");         Cookie sessionCookie = MsidePortal.cookie;         CookieSyncManager.createInstance(this);         CookieManager cookieManager = CookieManager.getInstance();         if (sessionCookie != null) {             cookieManager.removeSessionCookie();         String cookieString = sessionCookie.getName() + ""="" + sessionCookie.getValue() + ""; domain="" + sessionCookie.getDomain();         cookieManager.setCookie(actionURL, cookieString);         CookieSyncManager.getInstance().sync();         }           webview.loadDataWithBaseURL(actionURL, htmlString, ""text/html"", ""utf-8"", actionURL);} }}</code></pre><p>I've had mixed success implementing that cookie solution. It seems to work for one service I log into that I know keeps the cookies on the server (old, archaic, but it works and they don't want to change it.) The service I'm attempting now requires the user to keep cookies on their local machine, and it does not work with this setup.</p><p>Any suggestions?</p>","361675","","361675","","2010-07-26 17:51:50","2014-03-18 08:58:57","Maintain cookie session in Android","<android><session><cookies><login><webview>","7","0","12","",""
"3039277","1","","","2010-06-14 17:09:18","0","3829","<p>My DBHelper class</p><pre><code>public class DBHelper extends SQLiteOpenHelper { public DBHelper(Context context) {  super(context,""SIMPLE_DB"",null,1); } @Override public void onCreate(SQLiteDatabase db) {  db.execSQL(""CREATE TABLE SIMPLE_TABLE ( "" +     ""ID INTEGER PRIMARY KEY "" +    ""DESC TEXT);""); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { }}</code></pre><p>Activity class</p><pre><code>    public class SimpleDatabase extends Activity {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            DBHelper dbHelper = new DBHelper(this);            SQLiteDatabase db = dbHelper.getReadableDatabase();            db.execSQL(""INSERT INTO SIMPLE_TABLE VALUES (NULL, 'test');"");            Cursor cursor = db.rawQuery(""SELECT * FROM SIMPLE_TABLE"", null);            TextView text = (TextView)findViewById(R.id.textbox);            text.setText(cursor.getString(0));        }}</code></pre><p>I figure it crashed (application has stopped unexpectedly!) at SQLiteDatabase db = ... because if I commented the code out from there to the end then it worked fine. But I have no idea whatsoever why it does that.Any help would be appreciated.</p>","366539","","473070","","2010-12-01 16:15:57","2010-12-01 16:15:57","Followed the official android documentations but still could not use SQLite in app","<android><sqlite>","3","0","","",""
"3039366","1","","","2010-06-14 17:23:52","1","787","<p>I successfully compiled an android analog clock, but now i want to include more clocks in the same application so a user can install one app but see 2-3 different clock widgets on their phone.I have searched the internet but the tutorials do not include any examples.</p><p>Thanks.</p>","364418","","","","","2010-06-14 17:23:52","Android Analog Clock - How to add more clocks in one widget","<android><widget>","0","1","","",""
"3039369","1","3050509","","2010-06-14 17:24:08","12","5895","<p>The NDK download page notes that, ""Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on.""</p><p>I came from a C background and was excited to try to use the NDK to operate most of my OpenGL ES functions and any native functions related to physics, animation of vertices, etc... I'm finding that I'm relying quite a bit on Native code and wondering if I may be making some mistakes. I've had no trouble with testing at this point, but I'm curious if I may run into problems in the future.</p><p>For example, I have game struct defined (somewhat like is seen in the San-Angeles example). I'm loading vertex information for objects dynamically (just what is needed for an active game area) so there's quite a bit of memory allocation happening for vertices, normals, texture coordinates, indices and texture graphic data... just to name the essentials. I'm quite careful about freeing what is allocated between game areas.</p><p>Would I be safer setting some caps on array sizes or should I charge bravely forward as I'm going now?</p>","351060","","","","","2010-06-16 03:17:22","How much is too much memory allocation in NDK?","<android><android-ndk>","1","0","6","",""
"3039503","1","3039541","","2010-06-14 17:43:32","1","548","<p>For some odd reason, my project is generating two icons, same name, launches the same project, in the app drawer. I can't figure out what is causing this. Does anyone have any suggestions?</p><p><a href=""http://gimli.morningside.edu/~jcf002/images/android_duplicate_icon.png"" rel=""nofollow"">Link to screenshot</a></p><p>The M in the white circle is my default icon. If you view the screenshot, you'll see it appears twice. I've checked the applications area, and it is only installed once.</p>","361675","","","","","2010-06-14 17:49:10","Android Icon Duplicates in Application Dock","<android><icons><duplicates>","1","0","","",""
"3039540","1","3039791","","2010-06-14 17:49:04","0","365","<p>This is probably an easy one. I have about 20 TextViews/ImageViews in my current project that I access like this:</p><pre><code>((TextView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Text)).setText("""");//or((ImageView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Right)).setVisibility(View.INVISIBLE);</code></pre><p>My question is this, am I better off, from a performance standpoint, just assigning these object variables? Further, am I losing some performance to the constant ""search"" process that goes on as a part of the findViewById(...) method? (i.e. Does findsViewById(...) use some sort of hashtable/hashmap for look-ups or does it implement an iterative search over the view hierarchy?)</p><p>At present, my program never uses more than 2.5MB of RAM, so will assigning 20 or so more object variables drastically affect this? I don't think so, but I figured I'd ask.</p><p>Thanks.</p>","272302","","","","","2010-06-14 18:25:06","Android -- Object Creation/Memory Allocation vs. Performance","<android><performance><memory>","1","0","","",""
"3039555","1","3071747","","2010-06-14 17:50:56","7","9630","<p>I have a WebView in my Android App that is loading an HTML string using the loadDataWithBaseURL() method.  The problem is that local anchor links (<code>&lt;a href=""#link""&gt;</code>...) are not working correctly.  When the link is clicked, it becomes highlighted, but does not scroll to the corresponding anchor.</p><p>This also does not work if I use the WebView's loadUrl() method to load a page that contains anchor links.  However, if I load the same URL in the browser, the anchor links do work.</p><p>Is there any special handling required to get these to work for a WebView?</p><p>I am using API v4 (1.6).</p><p>There isn't much to the code, here are the relevant parts of some test code I've been working with:</p><pre><code>WebView detailBody = (WebView) findViewById(R.id.article_detail_body);String s = ""&lt;a href=\""#link\""&gt;LINK!&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a name=\""link\""&gt;&lt;/a&gt;Testing!"";detailBody.loadDataWithBaseURL(API.HomeURL(this), s, ""text/html"", ""utf-8"", """");</code></pre>","302749","","709626","","2012-06-10 13:29:37","2013-07-15 13:32:54","Android Webview Anchor Link (Jump link) not working","<android><webview><anchor>","6","4","1","",""
"3039674","1","3039709","","2010-06-14 18:06:55","3","2291","<p>I set my tabWidget at the bottom. When i want to edit the edittext the keyboard will raise up. But the tab widget come above the keyboard. To support for the multiple screen i set the android:layout_weight=""1.0"". After that, I got this problem i added my layout code below. any idea to make the TabWidget at the bottom stably?</p><p>Code:</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;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@android:id/tabcontent"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_weight=""1.0""&gt;    &lt;/FrameLayout&gt;    &lt;TabWidget android:id=""@android:id/tabs""        android:layout_gravity=""bottom"" android:background=""@drawable/gradient_black""        android:listSelector=""@color/transparent"" android:layout_width=""fill_parent""        android:layout_height=""63dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","267269","","267269","","2013-05-08 06:07:51","2013-05-08 06:07:51","TabWidget not stable at the bottom in Android? Why?","<android><android-layout><android-tabs>","1","1","2","",""
"3039962","1","","","2010-06-14 18:46:24","1","362","<p>I'm seeing a strange issue with a TableLayout after the device is rotated from either orientation.  If you load the view in either portrait or landscape mode, the table loads fine.  But once you rotate the device, the columns collapse to just fit their width.  I would expect that after rotation, the columns would still stretch to fit the width of the screen.  Any ideas on what can be done to resolve this?  Screenies and layout code below.</p><p>Before Rotation:</p><p><img src=""http://dl.dropbox.com/u/334957/normal_from_portrait.png"" alt=""before rotation""></p><p>After Rotation:</p><p><img src=""http://dl.dropbox.com/u/334957/after_rotate_portrait.png"" alt=""after rotation""></p><p>Table Layout:</p><pre><code>    &lt;TableLayout android:id=""@+id/dataTable""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:layout_weight=""1""    android:layout_below=""@id/chart"" android:stretchColumns=""*""    android:shrinkColumns=""*""    android:padding=""6dip"" &gt;   &lt;/TableLayout&gt;</code></pre><p>Table Row:</p><pre><code>    &lt;TableRow 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/col1""          android:layout_marginRight=""2dip""          android:textColorLink=""#FF21759b""          android:text=""Column 1""          android:padding=""4dip""          android:textColor=""#FF464646""/&gt;          &lt;TextView android:id=""@+id/col2"" android:text=""Column 2""          android:textColor=""#FF464646""          android:padding=""4dip""/&gt;&lt;/TableRow&gt; </code></pre><p>Thanks!</p>","309558","","","","","2010-08-30 02:35:43","TableLayout formatting loss after device rotation","<android><layout><rotation><orientation><tablelayout>","1","1","","",""
"3040085","1","3040671","","2010-06-14 19:02:38","1","1305","<p>I am trying to populate a TextView based on the current selected options in 3 Spinner(s) but cant seem to figure out how to retrieve the selected values from the Spinners to invoke the update function with.Here is my current code (quite messy but I'm just learning Java :)),</p><pre><code>public class AgeFun extends Activity {private String[] dayNames;private String[] yearArray;private final static int START_YEAR = 1990;private static TextView textDisp;private Button calcButton; private static Spinner spinnerDay, spinnerYear, spinnerMonth;private static ArrayAdapter&lt;?&gt; monthAdapter, dayAdapter, yearAdapter;private int year, month, day;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    year = 2000;    month = 1;    day = 1;    textDisp = (TextView) findViewById(R.id.textView1);    calcButton = (Button) findViewById(R.id.button);    calcButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            AgeFun.updateAge(year, month, day);        }    });    // Month spinner    spinnerMonth = (Spinner) findViewById(R.id.spinnerFirst);    monthAdapter = ArrayAdapter.createFromResource(            this, R.array.monthList, android.R.layout.simple_spinner_item);    monthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinnerMonth.setAdapter(monthAdapter);    // Day spinner    dayNames = new String[31];    for(int i =1; i &lt;= 31; ++i)    {        dayNames[i-1] = Integer.toString(i);    }    spinnerDay = (Spinner) findViewById(R.id.spinnerSecond);    dayAdapter = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_item, dayNames);    spinnerDay.setAdapter(dayAdapter);    // Year spinner    yearArray = new String[40];    for(int i =0; i &lt; 40; ++i)    {        yearArray[i] = Integer.toString(START_YEAR+i);    }    spinnerYear = (Spinner) findViewById(R.id.spinnerThird);    yearAdapter = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_item, yearArray);    spinnerYear.setAdapter(yearAdapter);    updateAge(2000,1,1);}private static void updateAge(int year, int month, int day) {    Date dob = new GregorianCalendar(year, month, day).getTime();    Date currDate = new Date();    long age = (currDate.getTime() - dob.getTime()) / (1000 * 60 * 60 * 24) / 365;    textDisp.setText(""Your are "" + Long.toString(age) + "" years old"");}</code></pre><p>}</p><p>Any help with this would be great.</p><p>TIA</p>","365681","","","","","2010-06-14 20:39:39","How to update a TextView on ButtonClick with Spinner(s) values","<java><android>","2","0","","",""
"3040307","1","","","2010-06-14 19:35:04","3","6665","<pre><code> 06-14 22:13:33.992: ERROR/AndroidRuntime(331): Uncaught handler: thread main exiting due to uncaught exception06-14 22:13:34.031: ERROR/AndroidRuntime(331): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.HelloMap}: android.view.InflateException: Binary XML file line #6: Error inflating class com.google.android.maps.MapView06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.os.Handler.dispatchMessage(Handler.java:99)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.os.Looper.loop(Looper.java:123)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread.main(ActivityThread.java:4363)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at java.lang.reflect.Method.invokeNative(Native Method)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at java.lang.reflect.Method.invoke(Method.java:521)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at dalvik.system.NativeStart.main(Native Method)06-14 22:13:34.031: ERROR/AndroidRuntime(331): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.google.android.maps.MapView06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.Activity.setContentView(Activity.java:1622)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.example.HelloMap.onCreate(HelloMap.java:16)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     ... 11 more06-14 22:13:34.031: ERROR/AndroidRuntime(331): Caused by: java.lang.reflect.InvocationTargetException06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:237)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at java.lang.reflect.Constructor.constructNative(Native Method)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     ... 21 more06-14 22:13:34.031: ERROR/AndroidRuntime(331): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:281)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:254)06-14 22:13:34.031: ERROR/AndroidRuntime(331):     ... 25 more</code></pre><p>I had done all configuration.</p><p>Here 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.example""      android:versionCode=""1""      android:versionName=""1.0""&gt;         &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;     &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;      &lt;uses-sdk android:minSdkVersion=""3"" /&gt;     &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;        &lt;activity android:name=""com.example.HelloMap""                  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;and my layout file main.xml is&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/mainlayout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""*************""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And my Hellomap.java</p><pre><code>public class HelloMap extends Activity {    LinearLayout linearLayout;    MapView mapView;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapview);        mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);    }    protected boolean isRouteDisplayed() {        return false;    }   }</code></pre><p>Something I am missing I guess, or maybe the issue is with 2.1 Google API?</p>","366621","","779408","","2012-10-27 07:39:29","2012-11-28 19:29:25","android hellomap example giving exception","<android>","4","4","1","",""
"3040374","1","","","2010-06-14 19:45:17","60","53054","<p>I am getting a run time exception</p><blockquote>  <p>java.lang.RuntimeException: Your content must have a ListView whose id  attribute is 'android.R.id.list'</p></blockquote><p>I don't know what is wrong.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.newslist);    mDbHelper.open();    fillData();}private void fillData() {    Bundle extras = getIntent().getExtras();    long catID = extras.getLong(""cat_id"");    Cursor c = mDbHelper.fetchNews(catID);    startManagingCursor(c);    String[] from = new String[] { DBHelper.KEY_TITLE };    int[] to = new int[] { R.id.newslist_text };    SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.text_newslist, c, from, to);    setListAdapter(notes);}</code></pre><p><strong>newslist.xml</strong></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;ListView          android:id=""@+id/catnewslist""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>text_newslist.xml</strong></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;TextView         android:text=""@+id/newslist_text""        android:id=""@+id/newslist_text""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","356632","","2117960","","2013-12-06 16:00:45","2013-12-06 16:00:45","RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'","<android>","7","2","14","",""
"3040587","1","3040710","","2010-06-14 20:19:07","0","167","<p>I'm a VB/vba coder and would like to start android dev. Currently I'm learning Java from scratch and. Its quite tough. I've read about oop but never actually written any OO code. Java syntax is also quite foreign but I'm getting the hang of it. My question is, which is absolutely the best transition path for a vb old dog to writing for froyo?</p>","366654","","995926","","2012-05-05 13:32:35","2012-05-05 13:32:35","vb classic coder to android how to transition?","<android><vb6><android-2.2-froyo>","1","0","","",""
"3040863","1","3041090","","2010-06-14 20:56:46","0","3566","<p>Hallo all,</p><p>I have a ListView which contains a Button in each line. The following code is part of the getView() Method</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {        View row = convertView;        TextView tv;        Button saveA_button;        EditText edittext;        FITB_ViewWrapper wrapper;  if (row == null) {       LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);       if (ChooseMode_Act.modeInfo.equalsIgnoreCase(""Training"")) {              row = li.inflate(R.layout.exercise_for_training_fitb,parent, false);       }else {              row = li.inflate(R.layout.exercise_for_exam_fitb,parent, false);       }       wrapper=new FITB_ViewWrapper(row);       row.setTag(wrapper);       if (ChooseMode_Act.modeInfo.equalsIgnoreCase(""Exam"")) {           saveA_button=wrapper.getSaveAnswer_Button();           OnClickListener l=new OnClickListener() {               @Override               public void onClick(View v) {                     Integer mp=(Integer)v.getTag();                     Log.i(""mp"",""my Position is: ""+mp);               }          };          saveA_button.setOnClickListener(l);       }   }else {           wrapper=(FITB_ViewWrapper) row.getTag(); }</code></pre><p>For my App i need to known to which item the Button belongs to, so i try to detect it. The code</p><pre><code>Log.i(""mp"",""my Position is: ""+mp);</code></pre><p>puts out a message:    mp   myPosition is: null</p><p>I can't understand, why do i get a ""null"" but not an Integer? How can i find out the Position of an Item in a ListView?</p><p>Thanks a lot.</p>","353857","","","","","2010-06-14 21:31:53","Android ListView: getTag() returns null","<android><listview><null>","2","0","","",""
"3040933","1","","","2010-06-14 21:06:18","1","485","<p>I have an application that utilizes the phones DeviceID in various ways.  I am now getting emails from users who have the HTC Droid Incredible phone that they are getting the error message I have added to the app that is showing the DeviceID being returned is not valid - which means it is either empty/null or the default ID used in the emulator.  I require a valid DeviceID to use my app, and the permissions are all set fine in the XML.  It works just fine on every other device, and now suddenly it seems to stop working on this phone. Anyone else having this issue?  Anyone find out what is causing it? Does HTC now block this ID on this device?  Any information would be helpful.</p><p>Thanks, Josh</p>","366697","","","","","2010-06-14 21:06:18","Droid Incredible Not Returning Valid DeviceID?","<android><htc>","0","4","","",""
"3040965","1","3041003","","2010-06-14 21:10:30","0","2527","<p>I have a view in which there is a text box where user enters data, when clicks on submit, I want to store the input and display in another box.</p><pre><code>final EditText edittext = (EditText) findViewById(R.id.edittext);mText = (TextView) findViewById(R.id.timepicker_input);</code></pre><p>How can I do it, please help</p>","357349","","431537","","2011-08-23 23:26:17","2012-02-13 04:44:21","How to display data in TextView","<android>","3","0","0","",""
"3041039","1","5027953","","2010-06-14 21:20:58","9","2597","<p>Is it possible to write a Vala application and get it to run on an Android device?</p>","53475","","","","","2013-04-20 10:56:58","Vala for Android?","<android><vala>","4","0","3","",""
"3041183","1","3041199","","2010-06-14 21:45:24","5","3718","<p>I just started to play with android dev and java+eclipse is pretty new to me. I managed to create simple project and run it on my device. Now I want to create simple game (more of them actually) and I would love to use shared code base for all of them (game loop, initialization, etc..).</p><p>Problem is that I have no idea how to correctly do this. I created android project called engine with all basic stuff that I need and made it work on device. Now I tried to create another project in same workspace called mygame. Main class (activity) of mygame is MyGameApp which inherits from EngineApp (main activity of my engine project) which inherits from Activity. </p><p>I added engine project into required projects in mygame build path tab in properties. Problem is that when I try to run this project it crashes on ClassNotFoundException trying to find my MyGameApp class. </p><p>Any help (or pointer to some articles that explain how this is done) is greatly appreciated. few hours of googling didn't help much :/</p>","124649","","124649","","2010-06-14 22:18:41","2010-06-14 22:18:41","multiple dependent android projects in eclipse","<android><eclipse>","1","0","3","",""
"3041218","1","3057348","","2010-06-14 21:53:25","5","4108","<p>I have a ListView. When an item on the ListView is tapped, it loads a SubView. I want to assign an ID to each row of the ListView, so I can pass that ID along to the SubView. How do I assign a specific ID to each row in the ListView?</p><p>Here is how I am currently loading the ListView:</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, mArrayList));</code></pre>","300129","","114066","","2012-01-27 08:50:28","2012-01-27 08:50:28","Assigning ID to a Row in an Android ListView","<android><android-listview><row>","3","0","3","",""
"3041275","1","3043565","","2010-06-14 22:02:46","1","3440","<p>Can you run the Android market app from a virtual device or in the emulator?</p>","200145","","200145","","2011-07-30 10:01:02","2013-08-31 23:47:31","Can you run Android Market from a virtual device?","<android>","6","0","","",""
"3041473","1","","","2010-06-14 22:50:40","5","230","<p>This is my first post ever -- I love the Android SDK (been at it for a week), but I did notice a small typo in the official documentation that needs correcting.</p><p>On <a href=""http://developer.android.com/reference/android/os/CountDownTimer.html"">this page</a> within the example source code, the source says ""<code>CountdownTimer</code>"" on line 1 when it should say ""<code>CountDownTimer</code>"" (notice the capitalization of the letter ""D"").  An easy fix for one with programming experience, but the code as written will not compile, which could be confusing for someone using this code for the first time.</p><p>Is this where documentation bugs are submitted, and if not, where should I go to request the fix?</p>","366756","","125389","","2010-06-14 23:11:28","2010-06-14 23:11:28","Where should I report mistakes in Android documentation?","<android><documentation>","1","0","0","",""
"3041623","1","3041995","","2010-06-14 23:25:32","0","526","<p>Today i installed Ubuntu 10.4 and Eclipse Galileo. Then I downloaded the Android SDK and tried to install all packages via the Android SDK Tools. But unfortunately, only the Target Levels 3, 4, 7 and 8 were available. API Level 5 and 6 are missing.</p><p>Does anybody know the reason for this? I already did a Google search and there seems to be nobody with the same problem. I also tried to restart it and nothing happens, the API Levels are still missing.</p>","","anon","","","","2011-05-18 23:48:41","Android API Target Level 5 and 6 for Ubuntu","<android><eclipse><api><ubuntu>","1","0","","",""
"3041692","1","3042498","","2010-06-14 23:45:25","2","2248","<p>I am designing a framework for a client/server application for Android phones. I am fairly new to both Java and Android (but not new to programming in general, or threaded programming in particular).</p><p>Sometimes my server and client will be in the same process, and sometimes they will be in different processes, depending on the exact use case.  The client and server interfaces look something like the following:</p><p>IServer.aidl:</p><pre><code>package com.my.application;interface IServer {    /**     * Register client callback object     */    void registerCallback( in IClient callbackObject );    /**     * Do something and report back     */    void doSomething( in String what );  .  .  .}</code></pre><p>IClient.aidl:</p><pre><code>package com.my.application;oneway interface IClient {    /**     * Receive an answer     */    void reportBack( in String answer );  .  .  .}</code></pre><p>Now here is where it gets interesting.  I can foresee use cases where the client calls <code>IServer.doSomething()</code>, which in turn calls <code>IClient.reportBack()</code>, and on the basis of what is reported back, <code>IClient.reportBack()</code> needs to issue another call to <code>IClient.doSomething()</code>.</p><p>The issue here is that <code>IServer.doSomething()</code> will not, in general, be reentrant.  That's OK, as long as <code>IClient.reportBack()</code> is always invoked in a new thread.  In that case, I can make sure that the implementation of <code>IServer.doSomething()</code> is always <code>synchronized</code> appropriately so that the call from the new thread blocks until the first call returns.</p><p>If everything works the way I think it does, then by declaring the IClient interface as <code>oneway</code>, I guarantee this to be the case.  At least, I can't think of any way that the call from <code>IServer.doSomething()</code> to <code>IClient.reportBack()</code> can return immediately (what <code>oneway</code> is supposed to ensure), yet <code>IClient.reportBack</code> still be able to reinvoke <code>IServer.doSomething</code> recursively in the same thread.  Either a new thread in IServer must be started, or else the old IServer thread can be re-used for the inner call to IServer.doSomething(), but only after the outer call to <code>IServer.doSomething()</code> has returned.</p><p>So my question is, does everything work the way I think it does?  The Android documentation hardly mentions <code>oneway</code> interfaces.</p>","301877","","","","","2010-06-15 04:28:06","Does oneway declaration in Android .aidl guarantee that method will be called in a separate thread?","<java><android><multithreading><aidl>","1","0","5","",""
"3041763","1","3041855","","2010-06-15 00:04:49","8","8957","<p>How do I set up an audiofile to play when a user touches an image.</p><p>Where should I store the audio file and what code should I use to actually play the file?I don't want to bring up the MediaPlayer interface or anything like that.</p><p>I was thinking of doing it like this:</p><pre><code>foo = (ImageView)this.findViewById(R.id.foo);    foo.setOnClickListener(this);public void onClick(View v) {if (foo.isTouched()) { playAudioFile();  }}</code></pre><p>Thanks</p>","339036","","","","","2013-10-10 17:08:49","Android: Playing an audio clip onClick","<android><audio>","1","0","3","",""
"3041783","1","","","2010-06-15 00:10:12","-1","103","<p>I am new to Android and am trying to create a very basic app that calculates and displays the GCF of two numbers entered by the user. Here is a copy of my GCF.java:</p><pre><code>package com.example.GCF;import java.util.Arrays;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class GCF extends Activity {private TextView mAnswer;    private EditText mA, mB;    private Button ok;    private String A, B;    private int iA, iB;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mA = (EditText) findViewById(R.id.entry);        mB = (EditText) findViewById(R.id.entry1);        ok = (Button) findViewById(R.id.ok);        mAnswer = (TextView) findViewById(R.id.answer1);        ok.setOnClickListener(new OnClickListener() {         public void onClick(View v)          {                           A = mA.getText().toString();              B = mB.getText().toString();           }         });        // the String to int conversion happens here        iA = Integer.parseInt(A.trim());        iB = Integer.parseInt(B.trim());        while (iA != iB) {        int[] nums={ iA, iB, Math.abs(iA-iB) };        Arrays.sort(nums);            iA=nums[0];        iB=nums[1];         }         updateDisplay();    }        private void updateDisplay() {          mAnswer.setText(            new StringBuilder().append(iA));        }}</code></pre><p>Any Suggestions? Thank you!</p>","366793","","","","","2010-06-15 01:56:33","Attempted GCF app for Android","<java><android>","1","1","","",""
"3041857","1","3042030","","2010-06-15 00:31:58","1","7231","<p>If I try to use my HTC Desire to test Apps I'm developing with Eclipse, then in the screen where I can choose the emulators and connected devices, it is only listed as unknown and a few question marks.</p><p>I read that on Windows you need HTC Sync respectively the drivers in this program, but how can I solve this problem on Ubuntu?</p>","","anon","387076","","2012-05-12 20:36:47","2012-05-12 20:36:47","How to use HTC Desire and Eclipse on Ubuntu 10.4 to test Android Apps?","<eclipse><ubuntu><htc><android>","1","0","2","",""
"3041909","1","","","2010-06-15 00:46:48","0","249","<p>i have written a simple app which would speak out to the user any incoming message. Both programmes seem to work perfectly when i lauched them as two separate pgms , but on keeping them in the same project/package only the speaker programme screen is seen and the receiver pgm doesn't seem to work . Can someone please help me out on it?</p><p>the speaker pgm is:</p><pre><code>package com.example.TextSpeaker;import java.util.Locale;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;// the following programme converts the msg user to speechpublic class TextSpeaker extends Activity  implements OnInitListener {/** Called when the activity is first created. */int MY_DATA_CHECK_CODE = 0;public TextToSpeech mtts;public Button button;@Override public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    button = (Button)findViewById(R.id.button);    button.setOnClickListener(new OnClickListener(){  @Override  public void onClick(View v) {  Toast.makeText(getApplicationContext(), ""The service has been started\n Every new   message will now be read out"", Toast.LENGTH_LONG).show();   }    });    Intent myintent = new Intent();    myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);    startActivityForResult(myintent, 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 so create the TTS engine       mtts = new TextToSpeech(this,this);       mtts.setLanguage(Locale.ENGLISH);      }      else      {       //install the Engine       Intent install = new Intent();       install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);       startActivity(install);      }     }    }    public void onDestroy(Bundle savedInstanceStatBundle)    {      mtts.shutdown();    }    public void onPause()    {      super.onPause();     // if our app has no focus     if(mtts!=null)      mtts.stop();    } @Override public void onInit(int status) { if(status==TextToSpeech.SUCCESS)  button.setEnabled(true);}}</code></pre><p>and the Receiver programme is:</p><pre><code>package com.example.TextSpeaker;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.telephony.SmsMessage; // supports both gsm and cdmaimport android.widget.Toast;public class Receiver extends BroadcastReceiver{ @Overridepublic void onReceive(Context context, Intent intent) {Bundle bundle = intent.getExtras();SmsMessage[] msgs = null;String str="""";if(bundle!=null){// retrive the sms receivedObject[] pdus = (Object[])bundle.get(""pdus"");msgs = new SmsMessage[pdus.length];for(int i=0;i&lt;msgs.length;i++){msgs[i]=SmsMessage.createFromPdu((byte[]) pdus[i]);str+=""Message From ""+msgs[i].getOriginatingAddress()+""."";str+=""Message ""+msgs[i].getMessageBody().toString();}Toast.makeText(context,str,Toast.LENGTH_SHORT).show();TextSpeaker tsp  = new TextSpeaker();tsp.mtts.speak(str, TextToSpeech.QUEUE_ADD,null);}}</code></pre><p>}</p>","238505","","","","","2010-06-15 03:44:58","app not working","<android>","1","1","","",""
"3041971","1","3043696","","2010-06-15 01:09:16","11","11444","<p>I have a Service running in the same process as my Application.</p><p>Sometimes the Android OS decides to kill my service (probably due to low memory).</p><p>My question is: does my Application get killed along with the Service? or how does it work exactly?</p><p>Thanks!</p>","338981","","","","","2012-01-31 03:09:02","Android service killed","<android><service>","3","0","3","",""
"3042010","1","3046522","","2010-06-15 01:25:20","0","2139","<p>He is an example of my TextView, which goes off the right side of the screen. I tried setting paddings and stuff, but nothing seemed to work. Any ideas? Here is my hierarchy, ScrollView,TableLayout</p><pre><code>  &lt;TableRow&gt;   &lt;TextView    android:layout_column=""1""       android:id=""@+id/text_price""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:inputType=""textCapCharacters""       android:padding=""2dip""       android:text=""@string/game_price""   /&gt;   &lt;EditText       android:id=""@+id/gameprice""       android:inputType=""textCapCharacters""       android:gravity=""right""       android:minWidth=""120dip""   /&gt;  &lt;/TableRow&gt;</code></pre>","325400","","","","","2010-07-26 19:17:10","Android: Content goes off screen","<android>","1","0","","",""
"3042155","1","","","2010-06-15 02:23:40","0","968","<p>I noticed that the position of the builtInZoomControls in WebView (bottom, horizontal right) is not consistent with the default position in the MapView (bottom, horizontal center).</p><p>1) Why is that not consistent? (Probably a question to be asked to Google)</p><p>2) Is there a way to horizontal center the builtInZoomControls of the WebView without applying custom Zoom controls? Or is that the only way?</p>","241475","","","","","2011-05-27 01:58:34","Position of builtInZoomControls in WebView and MapView","<android><android-widget><android-maps><android-webview>","2","0","","",""
"3042189","1","6445812","","2010-06-15 02:34:59","1","6803","<p>I've been able to successfully display the notification number count on the Android emulator.  However, it doesn't display anything when I use it on an actual Android phone.  Any suggestions on why there might be a difference?</p>","48784","","","","","2011-11-02 09:36:10","Android Notification Bar Number","<android><notifications>","4","3","","",""
"3042212","1","","","2010-06-15 02:44:04","3","6661","<p>Is it possible to change the android application icon at run time? I've read through <a href=""http://stackoverflow.com/questions/2718947/changing-the-application-icon-text-dynamically-in-android"">Changing the application icon text dynamically in Android</a>and <a href=""http://stackoverflow.com/questions/1103027/how-can-i-change-an-application-icon-programmatically-in-android"">How can i change an application icon programmatically in Android?</a>. All answered can't. I use Android 1.6. Is there any way?</p>","305732","","","","","2013-12-10 04:57:00","Android Application Icon Change","<android><icons><android-manifest>","1","1","","",""
"3042231","1","","","2010-06-15 02:50:22","2","830","<p>My widget stops working (becomes unresponsive to a button press) when the view changes from portrait to landscape or vica versa, does anyone know why it does this and if there is a fix?</p><p>EDIT: found the solution. I needed to sending all PendingIntents across with each RemoteViews update, even if they've already been set. When the orientation changes, the layout is inflated and only the most-recently cached RemoteViews is applied over it.</p>","274365","","274365","","2010-06-16 02:42:32","2010-06-16 02:42:32","android widget stops working when view changes from potrait to landscape or vica versa","<android><widget>","1","2","","",""
"3042420","1","","","2010-06-15 03:53:57","9","6592","<p>While developing a sample android application i have constructed two activities1)Activity 12)Activity 2</p><p>Now Activity 2 is the foreground activity whereas Activity 1 is the background one. Now user presses Home key. The application(i.e. both the activities) dissappear. Now is we relaunch the application we see Activity 1 as the foreground activity. My question is:</p><p>1)Does the platform maintain any history entry when pressed home key?2)How do we take the user to the last launch activity on relaunching the application?</p>","366880","","","","","2013-09-25 06:27:19","Home key press behaviour","<android>","7","2","1","",""
"3042589","1","","","2010-06-15 04:54:08","0","857","<p>I want to send a tweet from Android.I have executed the following code.But I am not bale to send any tweets.Avtually the button I created is not working.Can anybody tel me wats the prob?</p><p>This is my code..</p><p>package samplecode.sampleapp.sampletwidgitpublicintent;</p><p>import android.app.Activity;</p><p>import android.content.ActivityNotFoundException;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.os.Bundle;</p><p>public class TwidgitPublicIntent extends Activity implements OnClickListener {</p><pre><code>private static final int TWIDGIT_REQUEST_CODE = 2564;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ((Button)findViewById(R.id.tweet_button)).setOnClickListener(this);    ((Button)findViewById(R.id.mention_button)).setOnClickListener(this);    ((Button)findViewById(R.id.retweet_button)).setOnClickListener(this);    ((Button)findViewById(R.id.message_button)).setOnClickListener(this);}public void onClick(View v) {    switch(v.getId()) {        case R.id.tweet_button:            // Standard tweet            Intent tIntent = new Intent(""com.disretrospect.twidgit.TWEET"");            tIntent.putExtra(""com.disretrospect.twidgit.extras.MESSAGE"", ""_message_in_here_"");            try {                this.startActivityForResult(tIntent, TWIDGIT_REQUEST_CODE);            } catch (ActivityNotFoundException e) {                // If Twidgit is not installed            }            break;        case R.id.mention_button:            // Mention            Intent mIntent = new Intent(""com.disretrospect.twidgit.MENTION"");            mIntent.putExtra(""com.disretrospect.twidgit.extras.TO"", ""_username_to_xmention_"");            mIntent.putExtra(""com.disretrospect.twidgit.extras.MESSAGE"", ""_message_in_here_"");            try {                this.startActivityForResult(mIntent, TWIDGIT_REQUEST_CODE);            } catch (ActivityNotFoundException e) {                // If Twidgit is not installed            }            break;        case R.id.retweet_button:            // Retweet a tweet            Intent rtIntent = new Intent(""com.disretrospect.twidgit.RETWEET"");            rtIntent.putExtra(""com.disretrospect.twidgit.extras.MESSAGE"", ""_message_in_here_"");            rtIntent.putExtra(""com.disretrospect.twidgit.extras.VIA"", ""_original_author_of_tweet_name_"");            try {                this.startActivityForResult(rtIntent, TWIDGIT_REQUEST_CODE);            } catch (ActivityNotFoundException e) {                // If Twidgit is not installed            }            break;        case R.id.message_button:            // Send DM            Intent dmIntent = new Intent(""com.disretrospect.twidgit.DIRECT_MESSAGE"");            dmIntent.putExtra(""com.disretrospect.twidgit.extras.TO"", ""_username_to_send_dm_to_"");            dmIntent.putExtra(""com.disretrospect.twidgit.extras.MESSAGE"", ""_message_in_here_"");            try {                this.startActivityForResult(dmIntent, TWIDGIT_REQUEST_CODE);            } catch (ActivityNotFoundException e) {                // If Twidgit is not installed            }            break;    }}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    // Check result code    if(resultCode == Activity.RESULT_OK) {        // Check requestCode        switch(requestCode) {            case TWIDGIT_REQUEST_CODE:                // Handle successful return            break;        }    } else if(resultCode == Activity.RESULT_CANCELED){        // Handle canceled activity    }}</code></pre><p>}</p>","362307","","","","","2010-06-15 09:17:23","Sending tweets using Android","<android><twitter>","1","0","","",""
"3042603","1","","","2010-06-15 04:57:42","7","2218","<p>As you all might be knowing that Paypal has launched an in-App purchase model for Anroid. I will like to know whether this is legally allowed in Android market or not. </p><p>I know this may not be the best place to ask this but being developers if anyone has developed an application which uses Paypal In-App and is on Android Market then it would be a great help.</p>","261566","","810368","","2013-09-11 09:41:27","2013-09-11 09:41:27","Is Paypal In-App model for Android legal on Android Market?","<android><paypal><in-app-purchase><google-play><legal>","2","4","1","",""
"3042752","1","3047498","","2010-06-15 05:34:33","2","3364","<p>I am working on speech recognition and need some sample programs.</p><p>Can anyone guide me?</p>","366916","","418183","","2011-07-27 20:05:55","2012-06-25 08:56:16","Speech recognition in Android","<java><android>","2","0","5","",""
"3042946","1","","","2010-06-15 06:20:38","3","4654","<p>I made a very simple application to start playing around with Android development.</p><p>It works fine on the emulator, but it gives me the following error when I try to install it on my HTC Hero (v1.5):</p><p>Sorry!The application Simple Dial (process com.foo.simpledial) has stopped unexpectedly.  Please try again. (Force Close button)</p><p>and on in the Eclipse console, I get the following message:</p><p>[2010-06-14 23:10:52 - Simple Dial] Uploading Simple Dial.apk onto device 'HT9BSHF00222'</p><p>[2010-06-14 23:10:53 - Simple Dial] Installing Simple Dial.apk...</p><p>[2010-06-14 23:10:56 - Simple Dial] Success!</p><p>[2010-06-14 23:10:56 - Simple Dial] Starting activity com.alanvaghti.simpledial.DialActivity on device </p><p><strong>[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined</strong></p><p><strong>[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined</strong></p><p>[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.alanvaghti.simpledial/com.alanvaghti.simpledial.DialActivity} }</p><p>I did put 'android:debuggable=""true""' inside the application tag on the manifest.xml</p><p>Any ideas on what is going on??  Thanks in advance!</p>","366951","","366951","","2010-06-15 06:27:52","2014-04-16 14:11:32","Android app works on emulator but not on phone (""Can't dispatch DDM chunk XXXX: no handler defined"")","<java><xml><android><mobile><android-emulator>","3","4","","",""
"3042961","1","","","2010-06-15 06:24:03","64","33856","<p>How can i get the resource id of an image if I know its name (in Android)?</p>","366953","","56285","","2014-02-18 17:10:37","2014-02-18 17:10:37","How can i get the resource id of an image if I know its name?","<android><android-image><android-resources>","4","1","25","",""
"3042988","1","","","2010-06-15 06:32:12","2","1112","<p>I want to communicate two emulators via DatagramSocket in Android. Each of them is a Node in a P2P system. Thus each of them has a server Thread and client Thread (created per GUI event). This is how I create server</p><pre><code>public static final String SERVERIP = ""10.0.2.15"";    //...    run() {                InetAddress serverAddr = InetAddress.getByName(SERVERIP);                DatagramSocket socket = new DatagramSocket(SERVERPORT,serverAddr);                while(true) {                    byte[] buf = new byte[29];                    DatagramPacket packet = new DatagramPacket(buf, buf.length);                    socket.receive(packet);                //...                 }     }</code></pre><p>The port is given by the user during initializing application.The client part (requesting some data)</p><pre><code>InetAddress serverAddr = InetAddress.getByName(""10.0.2.2"");//...Log.i(""Requester"", ""Trying to connect to device port = ""+target);DatagramSocket socketJ = new DatagramSocket();byte[] bufJ = Adaptor.createStringMsg(Adaptor.createJoingMsg(id, Location.getX(), Location.getY())).getBytes();             DatagramPacket packetJ = new DatagramPacket(bufJ, bufJ.length, serverAddr, target);Log.i(""Requester"", ""Sending: '"" + new String(bufJ) + ""'"");socketJ.send(packetJ);Log.i(""Requester"", ""Done."");</code></pre><p>Some additional info. The Node1 (emulatorA) has a server on port 8000 and Node2 (emulatorB) has a server on port 8001. The target port for ""client part"" is read properly. What tried to do is to set the redirection as such:</p><pre><code>//emulatorAredir add tcp:8000:8000//emulatorBredir add tcp:8001:8001</code></pre><p>However I can not get any communication beetwen those 2 emulators. As far as I understood the android tutorial about it should work like this <code>redir add tcp:localhostPort:emulatorPort</code>. I'm stuck with it :/. Can anyone point me the mistake or give some good advice. For the record while I was testing communication on a single device (client faking other node) everything worked, so I don't think there is a bug in the code. </p><p>Btw does any one knows how can I get 2 set of logs for those 2 emulators (logA, logB)? It would help me a lot.</p><p>@Fred Grott Yes I have conected through telnet to each emulator. Thx for the tip with logs.</p>","362529","","362529","","2010-06-16 06:10:56","2010-08-18 06:20:12","Interconnecting Emulator Instances Android","<android><communication><emulator>","1","2","0","",""
"3042998","1","","","2010-06-15 06:33:24","0","343","<pre><code>[2010-06-15 12:01:37 - helloNDK]Android Launch![2010-06-15 12:01:37 - helloNDK]adb is running normally. [2010-06-15 12:01:37 - helloNDK]Performing com.android.helloNDK.helloNDK activity launch[2010-06-15 12:01:37 - helloNDK]Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'my_avd'[2010-06-15 12:01:37 - helloNDK]Uploading helloNDK.apk onto device 'emulator-5554'[2010-06-15 12:01:37 - helloNDK]Installing helloNDK.apk...[2010-06-15 12:01:40 - helloNDK]Success![2010-06-15 12:01:40 - helloNDK]Starting activity com.android.helloNDK.helloNDK on device [2010-06-15 12:01:41 - helloNDK]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-06-15 12:01:42 - helloNDK]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-06-15 12:01:42 - helloNDK]ActivityManager: Starting: Intent { comp={com.android.helloNDK/com.android.helloNDK.helloNDK} }</code></pre><p>When I run the application in eclipse it says there is a problem with the application and it needs to close. ""Cant dispatch DDM"" is the error message.</p>","366959","","102703","","2010-06-15 08:21:43","2010-06-15 08:54:46","Android app not running on emulator","<android><emulator><android-ndk>","1","2","","",""
"3043168","1","3043183","","2010-06-15 07:10:00","0","1400","<p>friends,</p><p>i am using following code to display bitmap on screen and having next and previous buttons to change images.</p><p>and getting out of memory error</p><p><strong>New Code</strong></p><pre><code>HttpGet httpRequest = null;                              try {                                      httpRequest = new HttpGet(mImage_URL[val]);                              } catch (Exception e) {                                  return 0;                             }                              HttpClient httpclient = new DefaultHttpClient();                              HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);                              Bitmap bm;                             HttpEntity entity = response.getEntity();                              BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);                              InputStream is = bufHttpEntity.getContent();                              try                             {                                 bm = BitmapFactory.decodeStream(is);                                                                              }catch(Exception ex)                             {                             }                             is.close(); </code></pre><p><strong>Old Code</strong></p><pre><code>URL aURL = new URL(mImage_URL[val]);                               URLConnection conn = aURL.openConnection();                              conn.connect();  InputStream is = null;                             try                             {                                 is= conn.getInputStream();                               }catch(IOException e)                             {                             }BufferedInputStream bis = new BufferedInputStream(is);   bm = BitmapFactory.decodeStream(bis); bis.close();   is.close();  img.setImageBitmap(bm);</code></pre><p>and it was giving me error decoder->decode return false.</p><p>on images of size bigger than 400kb.</p><p>so after googling i got new code as answerthe old code was not giving me out of memory error on those images but decoder->decode return false, so i choosed new code.</p><p>any one guide me what is the solution and which is the best approach to display live images?</p>","249991","","","","","2010-06-15 07:12:08","java.lang.OutOfMemoryError: bitmap size exceeds VM budget?","<android>","1","0","2","",""
"3043330","1","3243433","","2010-06-15 07:39:16","3","2870","<p>I'm working on an app that uses AudioRecord class to get input data from the phone mic. For some reason I'm unable to mute the mic. I have tried with different AudioSources (DEFAULT, MIC and VOICE_UPLINK) when creating the AudioRecord object, but there's no difference in the muting behaviour.</p><p>The muting itself, I'm trying to achieve with AudioManager#setMicrophoneMute() method.</p><p>Any ideas?</p><p>Thanks.</p>","337120","","","","","2012-01-13 12:43:06","Unable to mute the microphone in Android","<android>","3","0","2","",""
"3043365","1","","","2010-06-15 07:48:01","-2","1977","<p>I need to insert two images and two buttons.  The action required is that when I click on the first button, the corresponding image should be displayed.  The same action is required for other button also, but the second image should be displayed. </p>","367000","","1288","","2011-02-07 12:45:43","2011-03-20 20:55:28","How to insert both an image and a button in an Android application at once?","<android><image><switching>","4","1","","",""
"3043464","1","3043494","","2010-06-15 08:09:02","0","873","<p>I am trying to draw a cupola circles at random positions in an Android application.I draw them on a bitmap and then draw that bitmap on the canvas. This is the function where a draw the circles:</p><pre><code>private void drawRandomCircles(int numOfCircles) {    Canvas c = new Canvas(b);    Paint cPaint = new Paint;    cPaitn.setColor(Color.RED);    for(int i = 0; i &lt; numOfCircles; i++) {        int x = Math.Random % 100;        int y = Math.Random % 100;        c.drawCircle(x, y, 20, cPaint)      }}</code></pre><p>The Bitmap b is global.And after calling this function I just draw the bitmap in the onDraw method.Now the problem is that I only get one circle drawn on the screen, no matter the size of numOfCircles.</p><p>Any clue what is happening here?</p>","367017","","","","","2010-06-15 08:14:25","Drawing random circles","<android>","1","0","","",""
"3043595","1","3153527","","2010-06-15 08:26:58","1","1603","<p>I have an Android application that makes use of TTS (Text to speech) API. Everything is working perfectly, but now i want to fade in/out or even stop music (in case user is playing music with prebuilt Music Player), when application speaks a text. Right now, i think both music and TTS messages are played on the same stream (MUSIC), and it can be difficult to understand the voice messages. </p><p>I've tried to play the text on a different stream, like AudioManager.STREAM_NOTIFICATIONS. It does stop the music, but doesn't come back when the text is spoken, so i didn't achieve the goal. Haven't found anything yet, so i hope someone can help here. Thanks!</p>","367029","","168868","","2012-01-01 21:34:31","2012-01-01 21:34:31","fade in and out music while speaking a text","<android><text-to-speech><background-music>","2","0","","",""
"3043824","1","","","2010-06-15 09:00:13","0","1576","<p>android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found</p><p>I configured Android  plateform on netbeans6.8 and created an android project, getting compile time error: android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found</p><p>Please any solution?.</p>","367053","","","","","2014-01-11 19:55:20","android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found","<android>","2","0","","",""
"3043938","1","","","2010-06-15 09:21:45","2","959","<p>Starter question: My ""Hello World"" attempt won't run, (""No compatible targets were found""), I think this is bacause I selected the latest version for my project (2.2), and the highest AVD version is 2.0.1. Does this make sense? Can I change my project version (haven't been able to find a way to do this), or do I have to start again? If the versions are not backwards compatible, what is the best version to use for the majority of Android devices out there?</p><p>Thanks</p>","367076","","","","","2011-10-16 07:16:07","Android ""hello world"" - versions","<android>","1","0","","",""
"3043941","1","3057061","","2010-06-15 09:22:11","3","1083","<p>i have two applications which i want them to share the same arraylist.</p><p>how could i achive something like that? is there anything in Android for sharing such a prefrenceses?</p><p>thanks,</p>","273550","","","","","2010-06-16 20:49:41","Share an Arraylist between applications","<android>","2","0","1","",""
"3044049","1","","","2010-06-15 09:41:08","0","1501","<p>I'm just a newbie in Android world.I tried to add a ListView inside a tab (or actually in activity),and each listview will be displaying another view that contains component such text, image and etc.this components is got to be dynamic, will be set within the source program</p><p>listview layout :</p><pre><code>&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;LinearLayout android:layout_width=""80dip""    android:layout_height=""?android:attr/listPreferredItemHeight"" android:gravity=""center""&gt;    &lt;ImageView android:id=""@+id/img"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" &gt;    &lt;TextView android:id=""@+id/name"" android:layout_width=""fill_parent""        android:layout_height=""?android:attr/listPreferredItemHeight"" android:textSize=""18dip""        android:paddingLeft=""10dip"" android:gravity=""center_vertical"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>onListItemClick :</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    try {        // TODO Auto-generated method stub        super.onListItemClick(l, v, position, id);        // TODO Auto-generated method stub        LayoutInflater factory = getLayoutInflater();        View detailview = factory.inflate(R.layout.top_detail,null);        ImageView detailimg = (ImageView) detailview.findViewById(R.id.img_detail);        TextView detailtxt = (TextView) detailview.findViewById(R.id.txt_detail);        if (position == SUKIMA) {            detailimg.setImageResource(R.drawable.sukima);            detailtxt.setText(R.string.sukima_detail);        } else if (position == TAJUUJIN) {            detailimg.setImageResource(R.drawable.pu_tajuujin);            detailtxt.setText(R.string.tajuujin_detail);        } else if (position == LOVERS) {            detailimg.setImageResource(R.drawable.pu_lovers);            detailtxt.setText(R.string.lovers_detail);        }        this.flipper.setInAnimation(AnimationSanmon.inFromRightAnimation());        this.flipper.setOutAnimation(AnimationSanmon.outToLeftAnimation());        this.flipper.showNext();        detailimg.setImageDrawable(detailview.getResources().getDrawable(R.drawable.sukima));        detailtxt.setText(R.string.sukima_detail);    } catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>you could see that I'm trying to set image and text using setImageResource and setText, but after I run it, this text and image component didn't updated.</p><p>I'll be appreciate to the solution of this problem.</p><p>Kind Regards,Aru</p>","367088","","","","","2010-06-15 12:23:35","Android : ListView onClick event in the tabs","<android><listview><android-tabhost>","1","0","","",""
"3044259","1","3045235","","2010-06-15 10:17:49","0","1511","<p>I am a new user of google maps API in android OS. I have made a small application in which i am using google maps. I want to add a functionality that when i double click (multi touch) on a map the map should zoom in. IS there anybody who has an idea how to do this or if it is possible please provid a code example.Thanks in advance.</p><p>BR,SilentCoders</p>","367121","","21234","","2010-11-17 11:21:33","2010-11-17 11:21:33","google maps in android","<android><google-maps>","1","0","1","",""
"3044275","1","","","2010-06-15 10:19:53","0","1275","<p>I have a widget for a music player and want to be able to send broadcasts when pushing the different buttons. What I want to do is when a button is pushed, the widget sends a public broadcast to another BroadcastReceiver so it can handle the different actions.</p><p>In my activity class with the BroadcastReceiver:</p><pre><code>private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {  @Override  public void onReceive(Context context, Intent intent) {    String action = intent.getAction();    if (action.equals(Constants.ACTION_NEXT)) {      Log.d(""RECEIVER"", ""ACTION_NEXT"");    }  }};@Overrideprotected void onStart() {  super.onStart();  IntentFilter filter = new IntentFilter();  //Widget actions  filter.addAction(Constants.ACTION_NEXT);  registerReceiver(broadcastReceiver, new IntentFilter(filter));}</code></pre><p>In my Widget:</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {  RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);  PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(Constants.ACTION_NEXT), 0);  views.setOnClickPendingIntent(R.id.WidgetNextButton, pendingIntent);  appWidgetManager.updateAppWidget(appWidgetId, views);}</code></pre><p>Any help or other solutions are very much appreciated!</p><p>EDIT: Forgot to mention my actual problem: The BroadcastReceiver never receive the broadcast</p>","367101","","367101","","2010-06-15 11:17:53","2010-06-15 11:17:53","Send a public broadcast from an AppWidget in Android","<android><widget><android-widget><broadcast>","0","6","2","",""
"3044533","1","","","2010-06-15 11:04:29","0","1220","<p>I am writing my first Android app.<br>The app is displays bus stop information i want to have a panel for each stop that the user can scroll sideways through, like a weather app with a panel for each city.<br>Looking at the Dev Guide I don't see how to do this.<br>What Layout Object/ViewGroup should I be using? or should i looking somewhere else?</p>","367153","","","","","2011-05-24 06:54:26","create a slide scrolling series of panels","<android><user-interface>","1","1","","",""
"3044545","1","3044835","","2010-06-15 11:05:51","24","29171","<p>I'm trying to call the contact picker, get the persons name, phone and e-mail into strings and send them to another activity using an intent. So far this works:</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);  startActivityForResult(intent, 1);  // ...@Override  public void onActivityResult(int reqCode, int resultCode, Intent data) {      super.onActivityResult(reqCode, resultCode, data);      if (resultCode == Activity.RESULT_OK) {          Uri contactData = data.getData();          Cursor c =  managedQuery(contactData, null, null, null, null);          if (c.moveToFirst()) {              String name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));              Intent intent = new Intent(CurrentActivity.this, NewActivity.class);              intent.putExtra(""name"", name);              startActivityForResult(intent, 0);          }      }  }</code></pre><p>But if i add in:</p><pre><code>String number = c.getString(c.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER)); </code></pre><p>it force closes</p><p>Maybe theres another way to get their number?</p>","364727","","1401895","","2013-04-08 18:46:43","2013-04-08 18:46:43","get contact info from android contact picker","<android><contacts><contactscontract><google-contacts>","1","0","28","",""
"3044552","1","","","2010-06-15 11:07:24","3","1826","<p>The application I'm working on is a service which runs in the background in android.The problem is that I need to determine the height of the notification bar for some functionality of the service.</p><p>I found a number of solutions for this, for regular activities - a view inside an activity can determine its own height without the notification bar, based on checking its actual view size from its onSizeChanged event, after it is already drawn.However, this is not applicable to a service which has no physical view drawn.</p><p>I would really appreciate any ideas on getting the size of the notification bar at a system level, perhaps?</p><p>Thanks so much!</p><p>Vitaliy</p>","367169","","","","","2010-09-21 14:58:42","Android - Notification bar height from a service","<android>","3","0","1","",""
"3044722","1","","","2010-06-15 11:36:35","0","727","<p>I want use point sprite (OpenGLES Extension) API in Android NDK(r4).right here  int att[] = {0,0,1};  glPointParameterxv( GL_POINT_DISTANCE_ATTENUATION, att );</p><p>But, doesn't work it.</p>","367144","","44729","","2010-07-04 20:46:52","2010-07-04 20:46:52","How to use point sprite API in Android NDK","<android><opengl-es><android-ndk>","1","0","","",""
"3044737","1","","","2010-06-15 11:38:10","1","763","<p>I am using AsyncTask in my application and sometimes when I run the application I get the error as java.util.cancellationexception.</p><p>Can someone let me know the reason of this error or the way this can be removed?</p><pre><code>import java.util.concurrent.ExecutionException;import com.babbleville.io.BabbleVilleSyncTask;import com.babbleville.io.GetCurrentLocation;import com.babbleville.utils.BabbleVilleWebServiceUrl;import com.babbleville.utils.ConstantCodes;import com.babbleville.utils.LoadContent;import com.babbleville.io.LoginParse;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.Gravity;import android.view.View;import android.view.Window;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class BabbleVilleMainActivity extends Activity implements OnClickListener{    private Button btnLogin = null;    private Button btnNewUserSignUp = null;    private Button btnForgotPwd = null;    //private boolean loginFlag = false;    private EditText emailId = null;      private EditText password = null;    private String userName = null;       private String pwd = null;      String url = null;    /** Called when the activity is first created. */           @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.login);        btnLogin = (Button) findViewById (R.id.btnLogin);        btnNewUserSignUp = (Button) findViewById(R.id.btnNewUser);        btnForgotPwd = (Button) findViewById(R.id.btnForgotPwd);        emailId = (EditText) findViewById(R.id.emailId);           password = (EditText) findViewById(R.id.password);        //Temporary. Should be removed later on.    emailId.setText(""sunil@softwebsolutions.com"");    password.setText(""sunil123"");        btnLogin.setOnClickListener(this);        btnNewUserSignUp.setOnClickListener(this);           btnForgotPwd.setOnClickListener(this);    }/** *  This is the overriden method for getting the click events. *  @param View v = is the view on which click event this method is called.  *  For eg, on Login click button v will btnLogin. */public void onClick(View v) {    if(v == btnLogin)    {        userName = emailId.getText().toString().trim();        pwd = password.getText().toString().trim();        System.out.println(""User name ==&gt; "" + userName);        System.out.println(""Password ==&gt; "" + pwd);        if(userName ==  null || pwd == null || userName.equals("""") || pwd.equals(""""))        {            Toast toast = Toast.makeText(BabbleVilleMainActivity.this, ""Please enter your Username and Password!"", 50);            toast.setGravity(Gravity.CENTER, 0, 0);            toast.show();        }        else        {            url = null;            /*url = ConstantCodes.LOGIN_URL + ConstantCodes.ACTION + ""="" + ConstantCodes.LOGIN_ACTION + ""&amp;"" +                        ConstantCodes.EMAILID + ""="" + this.userName + ""&amp;"" + ConstantCodes.PWD + ""=""  + this.pwd ;*/            url = BabbleVilleWebServiceUrl.getLoginURL() + ConstantCodes.EMAILID + ""="" + this.userName + ""&amp;"" + ConstantCodes.PWD + ""=""  + this.pwd ;             System.out.println(""Login URL ==&gt; "" + url);            BabbleVilleSyncTask loginTask = new BabbleVilleSyncTask(v.getContext());            loginTask.execute(url);            //System.out.println(""status===&gt;""+loginTask.getStatus());            try             {                String result = loginTask.get().trim();                System.out.println(""Result returned from Login Task ==&gt; "" + result);                LoginParse.loginParser(result);                if(LoginParse.getLoginAck())                {                    /*ConstantCodes.BABBLE_START_NUM = 0;                    ConstantCodes.BABBLE_END_NUM = 5;*/                //  loadBabbles();                    GetCurrentLocation location = new GetCurrentLocation(v.getContext());                    String lat = location.getCurrentLatitude();                    String lon = location.getCurrentLongitude();                    System.out.println(""Latitude ==&gt; "" + lat + "" Longitude ==&gt; "" + lon);                    //Babble babble_add_data = new Babble(BabbleVilleMainActivity.this,""babble"");                    LoadContent loadContent = new LoadContent(BabbleVilleMainActivity.this);                    loadContent.loadBabbles(lat, lon);                    loadContent.loadVilles();                     //loadContent.loadUserDetails();                    //mContext = v.getContext();                    Intent homeScreenIntent = new Intent(BabbleVilleMainActivity.this, HomeScreenActivity.class);                    BabbleVilleMainActivity.this.startActivity(homeScreenIntent);                }                else                {                    Toast toast = Toast.makeText(BabbleVilleMainActivity.this, ""Username or Password is incorrect"", 50);                    toast.setGravity(Gravity.CENTER, 0, 0);                    toast.show();                }            }            catch (InterruptedException e)             {                e.printStackTrace();            }            catch (ExecutionException e)             {                e.printStackTrace();            }         }    }    else if(v == btnForgotPwd)    {        Intent forgetPwdIntent = new Intent(BabbleVilleMainActivity.this, ForgotPasswordActivity.class);        BabbleVilleMainActivity.this.startActivity(forgetPwdIntent);    }    else if(v == btnNewUserSignUp)    {        Intent newUserIntent = new Intent(BabbleVilleMainActivity.this, NewUserSignUpActivity.class);        BabbleVilleMainActivity.this.startActivity(newUserIntent);      }    }}</code></pre><p>The exception occurs at String result = loginTask.get().trim().</p><p>Can you let me know now what is the problem?</p><pre><code>package com.babbleville.io;import java.io.IOException;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.ResponseHandler;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.BasicResponseHandler;import org.apache.http.impl.client.DefaultHttpClient;import android.app.ProgressDialog;import android.content.Context;import android.os.AsyncTask;import android.util.Log;public class BabbleVilleSyncTask extends AsyncTask&lt;String, Void, String&gt; {private Context context = null;private final HttpClient httpClient = new DefaultHttpClient();private String content = null;private String error = null;private ProgressDialog progressDialog = null; private String finalResult = null;public BabbleVilleSyncTask(Context context){    this.context = context;     progressDialog = new ProgressDialog(this.context);}protected void onPreExecute() {    progressDialog.setMessage(""Please Wait...."");    progressDialog.show();}protected String doInBackground(String... urls) {    try     {        HttpGet httpget = new HttpGet(urls[0]);        ResponseHandler&lt;String&gt; responseHandler = new   BasicResponseHandler();        content = httpClient.execute(httpget, responseHandler);    }    catch (ClientProtocolException e)     {        error = e.getMessage();        Log.e(""ClientProtocolException"", error);        cancel(true);    }    catch (IOException e)     {        error = e.getMessage();        Log.e(""IOException"", error);        cancel(true);    }    httpClient.getConnectionManager().shutdown();    return content;}protected void onPostExecute(String result) {    progressDialog.dismiss();}}</code></pre><p>Please let me know how can I use the result returned in onPostExecute.</p>","261566","","1471203","","2013-01-09 10:48:56","2013-01-09 10:48:56","CancellationException while using AsyncTask in Android?","<android><exception><android-asynctask>","0","3","","",""
"3045120","1","","","2010-06-15 12:35:08","0","268","<p>I facing a problem of Filtered list view not updated.</p><p>In my application there is a custom list view which has a two text view and one image view as a row elements.</p><p>Filter works fine but my Custom list view not updated,Result show the first rows of the List.</p><p>This is my code,</p><ol><li>abc.java file</li></ol><p>public class abc extends ListActivity {</p><p>private ArrayList m_orders = null;</p><p>private OrderAdapter m_adapter;</p><p>List Title_List=new ArrayList();</p><p>List Author_List=new ArrayList();</p><p>private ArrayAdapter adapter = null;</p><p>private LayoutInflater mInflater;</p><p>private Vector data;</p><p>private EditText filterText = null;</p><p>/** Called when the activity is first created. */</p><p>@Override</p><p>public void onCreate(Bundle savedInstanceState) {</p><pre><code>    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</code></pre><p>}</p><pre><code>@Override</code></pre><p>public void onStart()</p><pre><code>{</code></pre><p>super.onStart();</p><p>m_orders = new ArrayList();</p><p>filterText = (EditText) findViewById(R.id.search_box);</p><p>filterText.addTextChangedListener(filterTextWatcher);</p><p>setListAdapter(m_adapter=new OrderAdapter(this,R.layout.list_row, m_orders));</p><p>m_adapter.notifyDataSetChanged();</p><p>getListView().setTextFilterEnabled(true);</p><p>}</p><p>private TextWatcher filterTextWatcher = new TextWatcher() {</p><p>@Override</p><p>public void beforeTextChanged(CharSequence s, int start, int count,                int after) </p><p>{</p><pre><code>    }    @Override</code></pre><p>public void onTextChanged(CharSequence s, int start, int before,                int count) {</p><pre><code>       m_adapter.getFilter().filter(s, new Filter.FilterListener() {                                   public void onFilterComplete(int count) {                              Log.d(null, ""filter complete! count: ""+ count);                                       m_adapter.notifyDataSetChanged();                                   }                               });   }    @Override    public void afterTextChanged(Editable s) {        // TODO Auto-generated method stub    }};</code></pre><p>private class OrderAdapter extends ArrayAdapter {</p><pre><code>        private ArrayList&lt;String&gt; items; public OrderAdapter(Context context, int textViewResourceId, ArrayList&lt;String&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.list_row, null);                }                String order = m_orders.get(position);                String description = Item_List.get(position);                if (order != null)                {                    TextView tt = (TextView) v.findViewById(R.id.toptext);                    TextView bt = (TextView) v.findViewById(R.id.bottomtext);                        if (tt != null) {                              tt.setText(""Title: ""+order);                              }                        if (bt != null) {                         bt.setText(""des: ""+description);                                                              }                }                return v;        }}  @Override</code></pre><p>public void onListItemClick(ListView parent, final View v, int pos, long id) {</p><p>}</p><p>}</p><p>and this is my list_row.xml file </p><p>2.</p><p>                <pre><code>        android:marqueeRepeatLimit=""marquee_forever""         android:lines=""1""         android:scrollHorizontally=""true""    /&gt;    &lt;TextView        android:paddingTop=""1pt""        android:layout_width=""200px""        android:layout_height=""0dip""        android:layout_weight=""1""        android:id=""@+id/bottomtext""        android:paddingBottom=""2pt""        android:ellipsize=""marquee""         android:marqueeRepeatLimit=""marquee_forever""         android:lines=""1""         android:scrollHorizontally=""true""    /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>I think filter works but only result is not updated in list view.</p><p>Help Me..</p>","316451","","","","","2011-05-20 14:50:45","Filtered Listview not updated","<android><listview><updated>","1","0","","",""
"3045227","1","","","2010-06-15 12:47:57","7","1023","<p>I'm trying to draw an image in a view but having problems trying to maintain the scale of the original image. Basically, I have a small view and I would like to show part of the image in the view. The intention then is to perform a translation on the image so that a different part appears in the view.</p><p>No matter what I try, either the image is down-scaled automatically to fit the view or the whole image is viewable. I've tried playing about with the settings on BitmapDrawable, ImageView and Layout to no avail.</p><p>Anyone know a good way to achieve this?</p>","367262","","","","","2010-06-18 14:53:30","Android : Stop image scaling down","<android><image><user-interface><view><scale>","3","0","3","",""
"3045383","1","3045431","","2010-06-15 13:06:34","1","906","<p>I've got a question on making an navigation app more faster and more stable.</p><p>The basic layer of my app is a simple mapview, covered with several overlays (2 markers for start and destination and one for the route).</p><p>My idea is to implement a thread to display the route, so that the app won't hang up during the calculation of a more complex route (like it does right now).</p><p>After implementing the thread there are no updates shows any more, maybe you can help me with a short glance at an excerpt of my code below:</p><pre><code>    private class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        posUser = new GeoPoint((int) (loc.getLatitude() * 1E6), (int) (loc                .getLongitude() * 1E6));        new Thread(){        public void run(){            mapView.invalidate();            // Erase old overlays            mapView.getOverlays().clear();            // Draw updated overlay elements and adjust basic map settings            updateText();            if(firstRefresh){                adjustMap();                firstRefresh = false;            }            getAndPaintRoute();            drawMarkers();        }        };    }</code></pre><p>Some features have been summarized to a method like ""drawMarkers()"" or ""updateText()""...(they don't need any more attention ;-))</p>","317301","","","","","2011-01-14 23:02:16","Performance issue on Android's MapView Navigation-App","<android><performance><multithreading><navigation><android-mapview>","4","0","","",""
"3045405","1","3047891","","2010-06-15 13:09:27","13","4598","<p>I found a <a href=""http://stackoverflow.com/questions/371538/any-good-orm-tools-for-android-development"">post</a> from a while ago that addresses a similar question but I think it's a bit outdated. I realize implementations of JPA tend to be more on the heavy/dense side, so if you know of any lightweight (non-JPA) ORMs I'll most certainly appreciate your input. I did see the answer about <a href=""https://www.activeandroid.com"">ActiveAndroid</a> in the other post and am curious to know if anyone tried it out.</p><p><strong>Update</strong>:</p><p>In the end, I decided to go with a more lightweight solution and chose <a href=""http://developer.db4o.com/"">DB4O</a>. So far I've been very happy with my choice. It's <a href=""http://developer.db4o.com/Projects/html/projectspaces/android_password_manager.html"">extremely easy to use</a> and requires a minimal amount of configuration. The website contains a wealth of information including <a href=""http://developer.db4o.com/Projects/starter_kits.html"">sample projects</a> and an in-depth <a href=""http://developer.db4o.com/Documentation/Reference/db4o-8.0/java/tutorial/"">tutorial</a> that covers just about everything a developer might need to know about DB4O. Oh, and did I mention that it's free (unlike some other alternatives... *cough*ActiveDroid*cough*)?</p>","350103","","350103","","2011-09-28 15:33:27","2013-08-22 08:20:09","Are there any good ORMs (preferably JPA implementations) that support SQLite (on Android)?","<java><android><sqlite><jpa><orm>","3","4","8","2013-09-07 14:11:51",""
"3045406","1","","","2010-06-15 13:09:48","2","1131","<p>I need to launch a Dialog from home screen widget, so I created an Activity with <code>android:theme=""@android:style/Theme.Dialog""</code></p><p>The problem is, that I would like make it look like standard dialog window ( buttons on the gray background, font and text size, paddings etc), like here:</p><p><img src=""http://developer.android.com/images/dialog_buttons.png"" alt=""alt text""></p><p>This is how my ""dialog"" Activity looks like:</p><p><img src=""http://imgur.com/O7H1j.png"" alt=""alt text""></p><p>Is there some standard way (theme?) to make it look like standard system dialogs? Or do I have to imitate it in my own layout?</p>","306831","","","","","2011-01-19 09:19:59","Tunning up Activity with dialog theme","<android><android-widget><android-layout>","2","0","","",""
"3045458","1","3045773","","2010-06-15 13:16:20","2","4150","<p>I have name, phone number and E-mail infomation of a contact. I just want to insert the additional email and phone for the existing contact. My questions are</p><ol><li>How to find the contact is already existing or not?</li><li>How to insert the values on the additional or secondary address option?</li></ol><p>Thanks in Advance.</p>","267269","","267269","","2010-06-16 11:29:12","2010-06-16 11:29:12","How insert the contact info on the existing contact in Android 1.6?","<android><android-intent><contacts>","1","1","3","",""
"3045536","1","3045893","","2010-06-15 13:25:17","10","6443","<p>I was trying to get the purpose of the <a href=""http://developer.android.com/intl/zh-TW/reference/android/app/IntentService.html"" rel=""nofollow""><code>IntentService</code></a>, and when should I use it?</p><p>I tried to understand from the API, but not enough details on that one.</p><p>Is there any analogy between this and running long-task on a working thread?</p><p>Any further explanation and samples on why I would use <code>IntentService</code> would be very welcome.</p><p>Thanks,</p><p>ray.</p>","260511","","260511","","2010-06-15 14:04:28","2013-11-12 22:32:44","Further explanation about IntentService","<android><android-intent>","3","0","1","",""
"3045549","1","","","2010-06-15 13:26:43","0","1753","<p>As a communications method is TCP best way to get lots of data through to multiple android devices from another android device over 3g?  Also are there recommended ports to use for 3g data transfer? </p><p>I want to rule out using a web service intermediary as I want this app to be decentralised if possible.</p><p>Cheers,James</p>","362602","","","","","2010-08-18 15:49:10","Android - Over 3g which ports to use and is TCP best connection method?","<java><android><sockets><grid><3g>","3","0","1","",""
"3045832","1","","","2010-06-15 13:58:37","0","1886","<p>I want my circle image (ImageView) to rotate as the user touch and drag it. If the user drags it to the right, it should spin right and vice versa. Like when you spin a DJ disc, if you know what i mean. I've played around a bit with OnTouchListener and RotateAnimation but i'm getting nowhere.</p><p>Any ideas?</p>","366330","","","","","2013-01-12 19:29:10","How can i use RotateAnimation to rotate a circle?","<android><rotation><imageview>","1","2","5","",""
"3045872","1","4976712","","2010-06-15 14:02:13","34","35484","<p>I want to display a button inside the listview.The goal should be to click on the listview line or on the button.</p><p>Click on the line it shows more info.Click on the button it shows at the bottom more buttons.</p><p>The same as the GMAIL app.</p><p>On the right there is a checkbox and after clicking on the checkbox at the bottom, the button bar appears.</p><p>My problem is after inserting the button into the listview, the button is not clickable.If I add the to the LinearLayout from the button <code>llButton.setClickable</code> it works. But, only the button. The ListView itself don't react on clicks anymore!</p><p>I have tried <a href=""http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons"">this example</a>.</p><p>The same issue as above...</p>","242070","","1904504","","2013-12-24 10:17:07","2014-03-22 20:47:50","ListView and Buttons inside ListView","<android><listview><button>","4","4","10","",""
"3046215","1","3046781","","2010-06-15 14:40:43","3","6042","<p>I want to access the messages stored in inbox through my androidproject. I have tried the method of forming URI for sms (content://sms/inbox) and then quering it for various parametres.</p><p>But I cannot find any documentation for reading inbox sms in thestandard Android Developr Docs.It was mentioned at various websites that this content has beenremoved from the standard sdk. The application may not support higherversion of android.</p><p>So, how can I create an apllication to read sms from inbox that isreliable in furture version of android.</p><p>Please help !!</p>","364551","","","","","2010-06-16 02:10:06","Access message inbox without Content UrI (content//:sms)","<android>","2","1","5","",""
"3046220","1","3052636","","2010-06-15 14:41:04","2","1537","<p>I am currently trying the activity testing tutorial (<a href=""http://developer.android.com/resources/tutorials/testing/activity_test.html"" rel=""nofollow"">Found here</a>), and have a problem. It seems that whenever I try to call something inside the UIThread, I get a java.lang.NullPointerException.</p><pre><code>public void testSpinnerUI() {    mActivity.runOnUiThread( new Runnable() {          public void run() {              mSpinner.requestFocus();        }      });  }</code></pre><p>This gives me:</p><blockquote>  <p>Incomplete: java.lang.NullPointerException</p></blockquote><p>and nothing else. I have tried this on two different samples now, with the same result. I tried with a try/catch clause around the mSpinner.requestFocus() call, and it seems that mSpinner is null inside the thread. I have set it properly up with the setUp() function found in the same sample, and a quick assertNotNull( mSpinner ) shows me that mSpinner is in fact not null after the setUp() function. What can be the cause of this?</p><p>EDIT; ok, some more testing has been done. It seems that the application that is being tested resets between each test. This essentially makes me have to reinstantiate all variables between each test. Is this normal?</p>","367379","","367379","","2010-06-18 06:08:21","2012-01-31 14:18:01","NullPointerException on Activity Testing Tutorial","<android><eclipse>","6","0","1","",""
"3046396","1","3046661","","2010-06-15 15:01:15","2","3169","<p>I would need to know how to handle the intent between tabs. For example, I have a tab activity with two tabs. First on content is a text view. another one is a map view. When i  click that text view it redirects to the tab2. it can be easily achieved by setCurrentTab(1) or setCurrentTabByTag(""tab2"") methods. But i want to pass lat and long values to that Map Activity to drop pin. What is the better way to use intents or getter/setter in java? What do you prefer? if your answer is ""Intents"". How?</p>","267269","","114066","","2012-01-27 12:22:26","2012-01-27 12:22:26","How to use intent between tabs in java/Android?","<android><android-intent><android-tabhost>","4","2","","",""
"3046424","1","3047328","","2010-06-15 15:04:40","33","14562","<blockquote><b>Update: </b>Found the answer myself, see below :-)</blockquote><p>Hi, </p><p>I'am currently coding an android app that submits stuff in the background using HTTP Post and AsyncTask. I use the <a href=""http://developer.android.com/reference/org/apache/http/client/package-summary.html"">org.apache.http.client</a> Package for this. I based my code on <a href=""http://www.androidsnippets.org/snippets/36/"">this example</a>.</p><p>Basically, my code looks like this: </p><pre><code>public void postData() {    // Create a new HttpClient and Post Header    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(""http://192.168.1.137:8880/form"");    try {        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);        nameValuePairs.add(new BasicNameValuePair(""id"", ""12345""));        nameValuePairs.add(new BasicNameValuePair(""stringdata"", ""AndDev is Cool!""));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        // Execute HTTP Post Request        HttpResponse response = httpclient.execute(httppost);    } catch (ClientProtocolException e) {     Log.e(TAG,e.toString());    } catch (IOException e) {     Log.e(TAG,e.toString());    }}</code></pre><p>The problem is that the <b>httpclient.execute(..) line takes around 1.5 to 3 seconds</b>, and I do not understand why. Just requesting a page with HTTP Get takes around 80 ms or so, so the problem doesn't seem to be the network latency itself.</p><p>The problem doesn't seem to be on the server side either, I have also tried POSTing data to <a href=""http://www.disney.com/"">http://www.disney.com/</a> with similarly slow results. And Firebug shows 1 ms response time when POSTing data to my server locally.</p><p>This happens on the Emulator and with my Nexus One (both with Android 2.2).</p><p>If you want to look at the complete code, I've put it on <a href=""http://github.com/pableu/http-post-example/blob/master/src/com/gaga/project/newA.java"">GitHub</a>.</p><p>It's just a dummy program to do HTTP Post in the background using AsyncTask on the push of a button. It's my first Android app, and my first java code for a long time. And incidentially, also my first question on Stackoverflow ;-)</p><p>Any ideas why httpclient.execute(httppost) takes so long? </p>","367197","","367197","","2010-06-15 16:58:00","2011-10-30 04:24:59","HTTP Post requests using HttpClient take 2 seconds, why?","<android><http><httpclient>","2","1","17","",""
"3046489","1","3096021","","2010-06-15 15:12:55","2","4063","<p>I've seen topics discussing this but no one has seemed to post a solution. At the moment, I'm testing passing parameters to my .Net web service. When the parameters reach the web service it adds it with an additional string then returns it too my application; but all I'm returning is the string message, not the parameter I passed. Is there something wrong with my web service or my soap method?</p><p>Soap:</p><blockquote>  <p>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);</p></blockquote><pre><code>    request.addProperty(""A"", ""workowr"");    SoapSerializationEnvelope envelope =        new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet = true;        envelope.setOutputSoapObject(request);        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);            try {            androidHttpTransport.call(SOAP_ACTION, envelope);            SoapPrimitive result = (SoapPrimitive) envelope.getResponse();            //SoapObject result = (SoapObject)envelope.getResponse();                   String resultData = result.toString();            testTV.setText(resultData);        }        catch(Exception e)        {            testTV.setText(e.getMessage());        }</code></pre><p>Here is my simple .Net web service:</p><blockquote>  <p>Public Function getRegInfo(ByVal A As String) As String</p>    <p>Return A + ""String message""</p>    <p>End Function</p></blockquote><p>I would appreciate any help.</p>","356615","","","","","2012-04-05 10:07:47","Web service recieves null parameters from application using ksoap method","<.net><android><web-services><ksoap>","3","1","","",""
"3046573","1","4941410","","2010-06-15 15:22:57","3","10828","<p>i am trying to embed the openssl library in my Android application using Android NDK but i don't know how to use exactly that library and so please any one can tell me how to use that please send a source code for my reference.......   </p><p>Related :</p><p><a href=""http://stackoverflow.com/questions/5728828/openssl-android-build-problem"">OpenSSL + Android: Build problem</a></p>","343678","","149841","","2012-02-01 14:56:39","2013-07-01 22:14:26","How to use openSSL Library in the ANDROID application","<android><android-ndk><jni><openssl><native>","1","0","2","",""
"3046613","1","","","2010-06-15 15:28:03","17","12065","<p>I have a TextView that holds a Spannable string.  The string contains a bunch of text, the first word of which is double the typesize as the rest of the string.</p><p>The problem is that the line spacing between the first and second line is much larger than the line spacing between subsequent lines due to the increased size of the first word.</p><p><img src=""http://img.skitch.com/20100615-fwd2aehbsgaby8s2s9psx3wwii.png""/></p><p>The spannable string was created using the following code snippet:</p><pre><code>    // Price    CharSequence text = ""$30 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""    final Pattern priceRegex = Pattern.compile(""^(.[0-9]+)\\s.*"");    final Matcher m = priceRegex.matcher(text!=null ? text : """");    if( m.matches() ) {        text = new SpannableString(text);        ((SpannableString)text).setSpan(new RelativeSizeSpan(2), 0, m.end(1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);    }</code></pre><p>How can I fix my TextView so that all lines have the same spacing?</p>","82156","","","","","2011-12-28 21:42:31","How to adjust line height in TextView with multiple type sizes?","<android><textview>","3","0","6","",""
"3046615","1","5211315","","2010-06-15 15:28:27","2","450","<p>I have an EditText with a compound drawable at right. I want to hide the soft keyboard when i press the drawable and clear the text. For that, i have the following code:</p><pre><code>        filterText.setOnTouchListener(new OnTouchListener() {         public boolean onTouch(View v, MotionEvent event) {                 if (filterText.getCompoundDrawables()[2] == null) {                         // cross is not being shown so no need to handle                         return false;                 }                 if (event.getAction() != MotionEvent.ACTION_DOWN) {                         // only respond to the down type                         return false;                 }                 if (event.getX() &gt; filterText.getMeasuredWidth() -                         filterText.getPaddingRight() - d.getIntrinsicWidth()) {                         filterText.setText("""");                         InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);                        imm.hideSoftInputFromWindow(v.getWindowToken(), 0);                        return false;                 }                 else {                    return true;                 }         }     }); </code></pre><p>But it doesn't work because the editText seems to maintain the focus. I've tried to filterText.clearFocus but no way.</p><p>Thanks</p>","258863","","","","","2011-03-06 15:22:47","Android hide soft keyboard from compound drawable","<android><keyboard>","1","0","","",""
"3046636","1","3047495","","2010-06-15 15:30:12","0","590","<p>I've got an app which dynamically generates anywhere from 6 to 100 small bitmaps for the user to move around the screen in a given session.  I currently generate them in <code>onCreate</code> and store them to the sd card, so that after an orientation change I can grab them out of external storage and display them again.  However, this takes time (the loading) and I'd like to keep the bitmap references around between lifecyle changes for quicker access.</p><p>My question is, is there a better place to store my generated bitmaps?  I was thinking about creating a static storage library in my base activity, something that would only need to be reloaded when the app is completely removed from memory (shutdown, other apps need resources, 30 minute restart, etc).</p><p>Ideally, I'd like the user to be able to back out to the title screen, click a ""Resume"" button, and in <code>onCreate</code> I just have access to those resident bitmap references instead of having to load them from storage again.  For this reason I don't think <code>Activity.onRetainNonConfigurationInstance</code> is what I need.</p><p>Alternatively, is there a better way to handle multiple generated bitmaps than what I'm doing or the plan I described?</p>","335650","","","","","2010-06-15 17:29:50","Android - Where to store generated bitmaps?","<android><persistence><bitmap><storage><lifecycle>","1","0","1","",""
"3046766","1","3063454","","2010-06-15 15:44:55","9","11449","<p>Please explain how does the drawing cache work in Android. I'm implementing a custom View subclass. I want my drawing to be cached by the system. In the View constructor, I call</p><pre><code>setDrawingCacheEnabled(true);</code></pre><p>Then in the draw(Canvas c), I do:</p><pre><code>    Bitmap cac = getDrawingCache();    if(cac != null)    {        c.drawBitmap(cac, 0, 0, new Paint());        return;    }</code></pre><p>Yet the getDrawingCache() returns null to me. My draw() is not called neither from setDrawingCacheEnabled(), nor from getDrawingCache(). Please, what am I doing wrong?</p>","219159","","","","","2012-09-07 12:14:50","Android drawing cache","<android><view>","2","3","2","",""
"3046997","1","3064815","","2010-06-15 16:17:03","0","769","<p>I am trying to get a better grip on Android's ConnectivityManager and how it really works under the hood.  Using the API is simple enough but I am looking for something lower level such as when it starts and the dirty details of what its doing in the background.  I can't seem to find a good resource about it.  Everything is just about using the API.  </p><p>Does anyone understand this or have any resources that they could point me to, website, book, white paper, or otherwise?  I would really appreciate it.  </p><p>Thanks</p>","336861","","","","","2010-06-17 19:12:03","Android ConnectivityManager information","<android><network-programming>","1","4","","",""
"3047356","1","","","2010-06-15 17:02:01","1","1064","<p>Hello Can you help me I want to create application ,which can connect Droid and another device with bluetoothI use BluetoothChat as for example to connect Motorola Droid and Nokia N97</p><p>They were paired and connect. But when I send message ,connection lost immediatly</p><p>How can I solve this problem? </p><hr><p>This is my code: </p><pre><code>private void sendMessage(String message) {   // Check that we're actually connected before trying anything    if (mChatService.getState() != BluetoothChatService.STATE_CONNECTED) {        Toast.makeText(this, R.string.not_connected, Toast.LENGTH_SHORT).show();        return;    }    // Check that there's actually something to send    if (message.length() &gt; 0) {        // Get the message bytes and tell the BluetoothChatService to write        byte[] send = message.getBytes();        mChatService.write(send);        // Reset out string buffer to zero and clear the edit text field        mOutStringBuffer.setLength(0);        mOutEditText.setText(mOutStringBuffer);    }</code></pre><p>This is ConnectThread</p><pre><code>private class ConnectThread extends Thread {    private final BluetoothDevice mmDevice;    public ConnectThread(BluetoothDevice device) {        mmDevice = device;        BluetoothSocket tmp = null;        // Get a BluetoothSocket for a connection with the        // given BluetoothDevice        int RFCOMM_CHANEL = 1; //SPP chanel         Method m;            try {                m = mmDevice.getClass().getMethod(""createRfcommSocket"", new                  Class[] { int.class });                mmSocket = (BluetoothSocket) m.invoke(mmDevice,                          RFCOMM_CHANEL);             } catch (SecurityException e) {                e.printStackTrace();            } catch (NoSuchMethodException e) {                e.printStackTrace();            } catch (IllegalArgumentException e) {                e.printStackTrace();            } catch (IllegalAccessException e) {                e.printStackTrace();            } catch (InvocationTargetException e) {                e.printStackTrace();            }    }    public void run() {        Log.i(TAG, ""BEGIN mConnectThread"");        setName(""ConnectThread"");        // Always cancel discovery because it will slow down a connection        mAdapter.cancelDiscovery();        // Make a connection to the BluetoothSocket        try {            // This is a blocking call and will only return on a            // successful connection or an exception            mmSocket.connect();        } catch (IOException e) {            connectionFailed();            // Close the socket            try {                mmSocket.close();            } catch (IOException e2) {                Log.e(TAG, ""unable to close() socket during connection failure"", e2);            }            // Start the service over to restart listening mode            BluetoothChatService.this.start();            return;        }        // Reset the ConnectThread because we're done        synchronized (BluetoothChatService.this) {            mConnectThread = null;        }        // Start the connected thread        connected(mmSocket, mmDevice);    }    public void cancel() {        try {            mmSocket.close();        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}</code></pre><p>private class ConnectedThread extends Thread {</p><pre><code>    private final InputStream mmInStream;    private final OutputStream mmOutStream;    public ConnectedThread(BluetoothSocket socket) {        Log.d(TAG, ""create ConnectedThread"");        mmSocket = socket;        InputStream tmpIn = null;        OutputStream tmpOut = null;        // Get the BluetoothSocket input and output streams        try {            tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();        } catch (IOException e) {            Log.e(TAG, ""temp sockets not created"", e);        }        mmInStream = tmpIn;        mmOutStream = tmpOut;        Log.i(""BluetoothChatService"",""InputStream""+mmInStream);    }    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        byte[] buffer = new byte[1024];        int bytes;        // Keep listening to the InputStream while connected        while (true) {            try {                // Read from the InputStream                bytes = mmInStream.read(buffer);                // Send the obtained bytes to the UI Activity                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }    /**     * Write to the connected OutStream.     * @param buffer  The bytes to write     */    public void write(byte[] buffer) {        try {            mmOutStream.write(buffer);            // Share the sent message back to the UI Activity            mHandler.obtainMessage(BluetoothChat.MESSAGE_WRITE, -1, -1, buffer)                    .sendToTarget();        } catch (IOException e) {            Log.e(TAG, ""Exception during write"", e);        }    }    public void cancel() {        try {            mmSocket.close();        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}</code></pre><p>Can you help me to solve this problem?</p>","366494","","92837","","2011-03-16 08:15:40","2011-03-16 09:59:02","BluetoothChat problems send message","<android><bluetooth>","0","5","1","",""
"3047453","1","3047503","","2010-06-15 17:23:03","1","4650","<p>I need to pass data's (String) from one screen to another screen. At the time of button click i need to pass values from first screen to the next screen.</p>","365616","","114066","","2010-06-16 08:58:42","2010-06-16 08:58:42","pass values from one screen to another?","<android><android-intent>","3","0","","",""
"3047519","1","3047710","","2010-06-15 17:32:44","0","122","<p>The TabHost widget has a setOnTabChangedListener() method to run code when the tab changes, but I need to run code before the tab changes, in order to validate the data entered. Is this possible? I was thinking about using a click listener but it seems like it would be fiddly to get it to detect clicks on items, and I'm still not sure how you'd cancel changing the tab and show a message.</p>","30512","","","","","2010-06-15 17:58:42","Android OnTabChangingListener","<java><android><events><tabs><android-tabhost>","1","1","","",""
"3047817","1","","","2010-06-15 18:11:24","1","1107","<p>Occasionally when I have a lot going on in my app, and I am playing a number of sounds using SoundPool, my app just completely freezes.  Looking at the logs, I see this: I/AudioHardwareMSM72XX(   56): AudioHardware pcm playback is going to standby. </p><p>My app must then be force closed and restarted.  Does anyone know what may be causing this, or a possible workaround?  I cannot reproduce this in the emulator - only on my HTC Hero, so I am wondering if this may be a device specific bug.</p>","208501","","208501","","2010-06-15 22:51:56","2011-05-17 13:45:41","Android AudioHardware pcm playback is going to standby","<android><soundpool>","1","2","","",""
"3047978","1","","","2010-06-15 18:29:27","1","358","<p>I'm trying to host a webview on a dialog, without a titlebar, but I'm getting odd layout results. Example test:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);    Display display = wm.getDefaultDisplay();    LinearLayout ll = new LinearLayout(getContext());    ll.setOrientation(LinearLayout.VERTICAL);    ll.setLayoutParams(new LayoutParams(        LinearLayout.LayoutParams.FILL_PARENT,         LinearLayout.LayoutParams.FILL_PARENT));    ll.setMinimumWidth(display.getWidth() - 10);    ll.setMinimumHeight(display.getHeight() - 10);    WebView wv = new WebView(getContext());    wv.setLayoutParams(new LayoutParams(        LinearLayout.LayoutParams.FILL_PARENT,         LinearLayout.LayoutParams.FILL_PARENT));    wv.getSettings().setJavaScriptEnabled(true);    ll.addView(mWebView);    setContentView(ll, new LinearLayout.LayoutParams(        LinearLayout.LayoutParams.FILL_PARENT,         LinearLayout.LayoutParams.FILL_PARENT));}</code></pre><p>the dialog is inflated at startup, but the webview is not visible. If I rotate the device, it becomes visible, and fills the whole parent layout as requested.</p><p>What is the right way to do this? I simply want a dialog which occupies most of the device screen, and has a WebView on it which fills the entire space.</p><p>Thanks</p>","246114","","","","","2010-06-15 18:29:27","Can't get Dialog hosting a WebView to layout properly","<android>","0","1","","",""
"3047994","1","","","2010-06-15 18:30:55","6","6168","<p>I currently have a game written using the Android canvas.  It is completely 2D, and I draw bitmaps as sprites on the canvas, and it technically works, but I have a few features that I need to add that will require drawing many more bitmaps on the screen, and there will be a lot more movement.</p><p>The app needs more power.</p><p>What is the best way to go from this method of drawing Bitmaps on a canvas to using OpenGL so I can draw them faster?</p>","179518","","44729","","2010-06-15 19:18:35","2013-04-10 23:53:58","Drawing bitmaps faster on Android canvas or OpenGL","<android><opengl-es>","3","1","5","",""
"3047999","1","3048633","","2010-06-15 18:31:30","2","1941","<p>I have a problem with my ListActivity, i use a thread to show a ProgressDialog where get a list of all installed applications. I turn it into a list adapter and than i want to set the listadapter of the activity but i can't do that from the thread.</p><p>I get the following error: <code>ERROR/AndroidRuntime(14429): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></p><pre><code>progressDialog = new ProgressDialog(this);progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);progressDialog.setMessage(""Loading..."");progressDialog.show();new Thread() {        public void run() {              showList(); // the method where i get all the apps and have the setListAdapter(); method              progressDialog.dismiss();        }}.start();</code></pre><p>How do I get it so I can use the setListAdapter from inside my thread</p>","355651","","355651","","2010-06-15 19:35:03","2010-06-15 20:38:18","call setListAdapter() from inside a thread","<android><listactivity><listadapter>","2","0","","",""
"3048105","1","3048186","","2010-06-15 18:49:15","0","555","<p>I am writing a custom component (derived from a relative layout) which has to show a dialog, Is there a way to do this using callbacks like oncreatedialog or onpreparedialog?</p><p>if not: if i have to create the dialog outside oncreatedialog, i have to ""attach it to an Activity with setOwnerActivity(Activity)"". How can the custom component access the activity it is used in, when it is used in the activity's xml-layout and not created from code?</p>","333350","","","","","2010-06-15 19:02:14","Android - Showing Dialog from custom component","<android>","1","0","","",""
"3048110","1","3048174","","2010-06-15 18:49:51","2","1001","<p>I would like to know as to what will happen to the thread which has been created by an activity and the device is rotated. I have observed that the onDestroy method is called when this happens. Will the thread be killed too?</p><p>If the thread is not killed, how can I reassociate the thread with the activity as a new instance of the activity is created on rotation.</p><p>Thanks,</p><p>Lakshmie</p>","239850","","","","","2010-06-15 18:58:57","What happens to thread as onDestroy is called when device is rotated","<android><multithreading><persistence><activity><destroy>","1","0","","",""
"3048315","1","3048589","","2010-06-15 19:22:24","3","1177","<p>I have a listlayout with items in it that looks like this:</p><p><img src=""http://dl.dropbox.com/u/370165/bilder/switchtrl-stackoverflow.png"" alt=""alt text""></p><p>There is first an ImageView (the light) and then two textViews. All of this inside a TableLayout. (source here: <a href=""http://code.google.com/p/switchctrl/source/browse/trunk/android/res/layout/device_switch.xml"" rel=""nofollow"">http://code.google.com/p/switchctrl/source/browse/trunk/android/res/layout/device_switch.xml</a>)</p><p>I want to have a rotating animation of a loading indicator Ontop of this light when this particular device (light) performs an action or an action is performed on it.</p><p>How do I put an animation ontop of this light imageview?</p>","247004","","114066","","2010-06-16 09:04:55","2010-06-16 09:04:55","Imageview ontop of another imageview","<android><listview><animation><imageview>","1","0","","",""
"3048427","1","","","2010-06-15 19:39:45","1","811","<p>I find plenty of examples of downstreaming a video from a server to an android, but I actually want to stream live images from my droid to a server.</p>","367628","","","","","2010-08-30 04:36:22","Does anyone have an example of how to stream the camera to a server on android?","<android><streaming><live>","1","0","","",""
"3048637","1","3048657","","2010-06-15 20:06:52","4","803","<p>The Android virtual device (a simulated Android environment) doesn't run very smoothly on my machine. Scrolling is quite sluggish.</p><p>Is that normal?</p><p>EDIT: Just noticed that a AVD running Android 1.6 has a significantly better performance compared to the AVDs running on 2.1 and 2.2.</p>","200145","","200145","","2012-03-12 14:08:37","2012-10-20 22:23:35","Performance of the Android Virtual Device","<android><performance>","2","1","","",""
"3048781","1","","","2010-06-15 20:28:10","1","809","<p>I have an Android application that parses an XML file for users and displays results in a much more mobile friendly format. The app works great for most users, but some users have lots and lots of data and the app crashes on them because it runs out of memory.</p><p>Is there any way I have a DOM style XML parser quit parsing data after a certain amount of parsing? I only need the first 30 or so elements so it would make the application much more efficient.</p><p>I'd like to use a SAX or pull parser instead, but the XML I'm parsing is <strong>not valid</strong> and I have no control over it. Unless anyone has some good SAX solutions that let me parse messy, invalid XML, I think DOM is the only way to go.</p><p>Thanks for reading!</p>","215056","","","","","2010-06-15 22:34:36","Memory Issues When DOM Parsing A Large XML File on Android Devices","<xml><android><dom><memory><parsing>","1","3","","",""
"3048832","1","","","2010-06-15 20:36:56","1","416","<p>Is it possible to get Autocomplete or Something when i work with the eclipse form editor?I write a color in the strings.xml and then i want to select it by the propertys for the text color, but there is no autocomplete or something equal</p>","367671","","","","","2010-06-15 21:16:37","Howto get Autocomplete for the Propertys in Eclipse","<android>","1","0","","",""
"3048845","1","","","2010-06-15 20:39:58","3","797","<p>I have a ScrollView that contains an number of other views (TextViews, ImageViews, etc.).  The ScrollView is taller than the screen.  I have an AsyncTask that updates the children of the ScrollView based on an http response.</p><p>I've discovered an interesting behavior that I can't figure out how to work around.  If I set any of the children's visibilities to View.INVISIBLE as part of the AsyncTask.onPostExecute(), everything works fine.</p><p>However, if I set any of the children's visibilities to View.GONE, the ScrollView jumps down from the top when onPostExecute() is called.  Exactly how far seems to vary.  I'm guessing that re-laying out the ScrollView is causing it to scroll away from the top for some reason.</p><p>So the question is: is there a way to either prevent or work around this behavior?  </p><p>PS. Using ScrollView.jump(FOCUS_UP) as a workaround isn't ideal since that'll force the user to the top even if they had intended to scroll down.</p><p><strong>EDIT</strong>: Actually, I was wrong.  The problem wasn't with a child view being marked gone, the problem was with a sibling view being marked gone and the ScrollView getting resized.  My ScrollView is inside a LinearLayout that also contains a Button.  When the button is set to GONE, the ScrollView gets resized to take up the available space, causing it to scroll away from the top.  Different cause, still looking for a workaround though if possible.</p>","82156","","82156","","2010-06-15 22:40:16","2010-06-15 22:40:16","Android ScrollView jumps around when resized","<android><scrollview>","0","4","2","",""
"3049184","1","3049481","","2010-06-15 21:26:49","0","140","<p>Now that I sort of know my way around the SDK/API, I've switched from Eclipse back to my favorite text editor, which means I have to use ant to build my project, however:</p><p>It seems every other time I compile the project, a lot of drawables get corrupted, resources lose their ids (resulting in NPEs in the code), or classes throw ""Verify Errors"".</p><p>The only way to fix this is by removing the <code>bin</code> and <code>gen</code> folders, and recompiling, which is obviously annoying.</p><p>Is there any way to avoid this?</p><p>btw, I'm using ant 1.7.1, java version ""1.6.0_20""</p>","238849","","33732","","2010-06-15 21:40:05","2010-06-15 22:20:01","Why do I get so many errors building my Android project with Ant?","<android><ant>","1","2","","",""
"3049436","1","3055053","","2010-06-15 22:11:41","1","1325","<p>Is there a dictionary API for Android. I am mainly looking for simple features like:</p><p>-- Given a word, look up its meaning-- Look up all words that begin with ""cat""</p><p>ThanksChris</p>","334802","","115145","","2010-06-15 22:23:47","2010-06-16 16:02:16","Android Dictionary","<java><android><api><dictionary><jar>","2","1","1","",""
"3049532","1","3049650","","2010-06-15 22:29:08","0","2596","<p>I tried to add these views to list view using <a href=""http://pastebin.com/x0Hu8Lsn"" rel=""nofollow"">this kind of factory</a>  but everytime I try and add the view to a ListActivity, it comes up with nothing. What am I doing wrong? I set my list views like so:</p><pre><code> List&lt;View&gt; views = new ArrayList&lt;View&gt;(); for(int x =0;x&lt;tagg_views.size();x++){      lv.addHeaderView(views.get(x)); }</code></pre>","354247","","114066","","2012-01-27 08:48:20","2012-01-27 08:48:20","Adding multiple views to a listview","<android><gui><android-listview>","3","0","","",""
"3049626","1","3049638","","2010-06-15 22:46:40","4","3001","<p>Android supports a limited version of apache's http client(v4).typically if I want to send binary data using content type= application/octet-stream via POST,I do the following:</p><pre>              HttpClient client = getHttpClient();              HttpPost method=new HttpPost(""http://192.168.0.1:8080/xxx"");              System.err.println(""send to server ""+s);              if(compression){                  byte[]compressed =compress(s);                  RequestEntity entity = new ByteArrayRequestEntity(compressed);                    method.setEntity(entity);              }              HttpResponse resp=client.execute(method);</pre><p>however ByteArrayRequestEntity is not supported on android. what can I do?</p>","157195","","","","","2010-06-15 22:48:29","sending binary data via POST on android","<android><http><client>","1","0","2","",""
"3049821","1","","","2010-06-15 23:34:20","1","3432","<p>I'm using ListView to display images which I provide through an ImageAdapter class.it works great on my device (and on many other devices which I tested it on), but somehow when I'm using the emulator and I'm long-pressing the up/down button - I'm getting an outOfMemory error after 10-15 seconds.</p><p>I tried clearing cache, canceling cache, etc. - nothing helped.</p><p>I know this crash is pretty rare (i couldn't reproduced it on any ""real"" device), but I can see on DDMS that ""GC freed"" are getting bigger during that long press and I can't find a way to clear them.</p><p>Any help will be appreciated, Tnx.</p>","","user367785","","","","2012-02-24 19:06:31","ImageAdapter and ListView (java.lang.OutOfMemoryError: bitmap size exceeds VM budget)","<android><out-of-memory>","3","0","1","",""
"3049834","1","3050079","","2010-06-15 23:38:25","0","1497","<p>I have 2 activities. In child activity i have put something like that in onPause():</p><pre><code>if (isFinishing()) { final Intent intent = new Intent(); intent.putExtra(SOME_DATA, value); setResult(RESULT_OK, intent); Log.i(""test"", ""Result set to RESULT_OK"");}</code></pre><p>In parent activity i check resultCode when child activity is destroyed, and this is what i have noticed:</p><ol><li>If i destroy child activity by some action (in some condition i invoke finish()), then resultCode is RESULT_OK</li><li>But when i destroy by pressing return key (i works only in emulator so its ESC) who kills activity, then resultCode read in parent onActivityResult method equals 0 (RESULT_CANCELD).</li></ol><p>""test"" log read in each case is the same.</p>","367786","","","","","2010-06-16 08:37:30","Why activity result code is diffrent then I expected","<android>","2","0","0","",""
"3050239","1","3050633","","2010-06-16 01:53:01","0","800","<p>I am working on an application that downloads images from a url. The problem is that only some images are being correctly downloaded and others are not.First off, here is the problem code:</p><pre><code>public Bitmap downloadImage(String url) {    HttpClient client = new DefaultHttpClient();    HttpResponse response = null;     try {         response = client.execute(new HttpGet(url));     } catch (ClientProtocolException cpe) {        Log.i(LOG_FILE, ""client protocol exception"");         return null;     } catch (IOException ioe) {            Log.i(LOG_FILE, ""IOE downloading image"");            return null;     } catch (Exception e) {            Log.i(LOG_FILE, ""Other exception downloading image"");            return null;     }     // Convert images from stream to bitmap object     try {         Bitmap image = BitmapFactory.decodeStream(response.getEntity().getContent());         if(image==null)             Log.i(LOG_FILE, ""image conversion failed"");         return image;     } catch (Exception e) {         Log.i(LOG_FILE, ""Other exception while converting image"");         return null;     }}</code></pre><p>So what I have is a method that takes the url as a string argument and then downloads the image, converts the HttpResponse stream to a bitmap by means of the BitmapFactory.decodeStream method, and returns it. The problem is that when I am on a slow network connection (almost always 3G rather than Wi-Fi) some images are converted to null--not all of them, only some of them. Using a Wi-Fi connection works perfectly; all the images are downloaded and converted properly.</p><p>Does anyone know why this is happening? Or better, how can I fix this? How would I even go about testing to determine the problem? Any help is awesome; thank you!</p>","365713","","","","","2013-02-10 18:15:14","Android: Problems downloading images and converting to bitmaps","<android><networking><bitmap>","2","0","3","",""
"3050662","1","","","2010-06-16 04:07:37","2","1065","<p>I am an android application developer. I was curious as to how does voice recognition could be implemented using android. There is inbuilt support for speech recognition in android, but how can it be used to implement voice recognition...Are there any links which would help me in learning on this topic..</p><p>Thanks</p>","364216","","254830","","2013-09-10 23:48:26","2013-09-10 23:48:26","voice recognition in android","<android><voice-recognition>","1","1","3","2013-09-07 19:38:12",""
"3050717","1","3089935","","2010-06-16 04:27:07","4","2681","<p>I'm implementing a custom video player because I need custom video controls. I have an app with only one activity, which on startup shall start playing a video right away.</p><p>Now, the problem I have is: </p><p>I don't want the video to start from the beginning, but from a later position. Therefore I do a seekTo(16867). Since seekTo is asynchronous, I place the start call of the mediaplayer (player.start()) in the onSeekComplete of the onSeekCompleteListener.</p><p><strong>The strange behaviour I experience though is that I can see/hear the video playing from the beginning for a few millisecs before it actually plays from/jumps to the position I seeked to.But - on the other hand - the Log output I call before the player.start returns the correct position 16867, where I seeked to.</strong></p><p>Below is the relevant code section, the complete class is at <a href=""http://pastebin.com/jqAAFsuX"" rel=""nofollow"">http://pastebin.com/jqAAFsuX</a></p><p>(I'm on Nexus One / 2.2 StageFright)</p><pre><code>private void playVideo(String url) {    try {        btnVideoPause.setEnabled(false);        if (player==null) {            player=new MediaPlayer();            player.setScreenOnWhilePlaying(true);        }        else {            player.stop();            player.reset();        }        url = ""/sdcard/myapp/main/videos/main.mp4"";  // &lt;--- just for test purposes hardcoded here now             player.setDataSource(url);        player.setDisplay(holder);        player.setAudioStreamType(AudioManager.STREAM_MUSIC);        player.setOnCompletionListener(this);        player.setOnPreparedListener(this);        player.setOnSeekCompleteListener(new MediaPlayer.OnSeekCompleteListener() {            public void onSeekComplete(MediaPlayer mediaPlayer) {                    Log.d(""APP"", ""current pos... ""+ player.getCurrentPosition() );                    player.start();          // &lt;------------------ start video on seek completed                    player.setOnSeekCompleteListener(null);                }        });                    player.prepareAsync();    }    catch (Throwable t) {        Log.e(TAG, ""Exception in btnVideoPause prep"", t);    }}public void onPrepared(MediaPlayer mediaplayer) {    width=player.getVideoWidth();    height=player.getVideoHeight();    if (width!=0 &amp;&amp; height!=0) {        holder.setFixedSize(width, height);        progressBar.setProgress(0);        progressBar.setMax(player.getDuration());        player.seekTo(16867);                   // &lt;------------------ seeking to position    }       btnVideoPause.setEnabled(true);}</code></pre>","241475","","","","","2010-06-22 02:49:45","Strange behaviour with mediaplayer and seekTo","<android><android-video-player>","1","4","4","",""
"3050749","1","3051505","","2010-06-16 04:38:45","0","1798","<p>i am trying to send MMS using code sample from <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android/2973016#2973016"">here</a>. I am not sure I understand how to deal with <code>MMSPart part</code> and <code>parts</code> vars: where and how should they be filled? </p><p>Thanks in advance</p>","367677","","","","","2010-06-16 07:53:34","Sending MMS using httpConnection (Android 2.1)","<android><mms>","1","0","2","",""
"3050937","1","3050960","","2010-06-16 05:37:42","1","1287","<p>I'm writing an Android app. I have a main method, which creates and runs a new Thread using an anonymous inner Runnable class. The run() method, when it's done, calls a method on it's parent class (in the main thread) that calls notifyDataSetChanged() so that the main thread can redraw the new data. This is causing all kinds of trouble (ViewRoot$CalledFromWrongThreadException).</p><p>The thing is, this method being called from the worker thread is on the class that's created in the UI thread. Shouldn't that be running on the UI thread? Or am I missing something?</p><p>Here's some code about what I'm talking about:</p><pre><code>public class Mealfire extends Activity {    @Override    public void onCreate(Bundle icicle) {        (new Thread() {            public void run() {                // Do a bunch of slow network stuff.                update();            }        }).start();    }    private void update() {        myAdapter.notifyDatasetChanged();    }}</code></pre>","131854","","","","","2010-06-16 05:43:17","Java Thread Message Passing","<java><android>","1","0","1","",""
"3051032","1","3051044","","2010-06-16 06:02:03","5","2089","<p>I have tried other methods to download info from a URL, but needed a faster one.  I need to download and parse about 250 separate pages, and would like the app to not appear ridiculously slow. This is the code I am currently using to retrieve a single page, any insight would be great.</p><pre><code>try {    URL myURL = new URL(""http://www.google.com"");    URLConnection ucon = myURL.openConnection();    InputStream inputStream = ucon.getInputStream();    BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);    ByteArrayBuffer byteArrayBuffer = new ByteArrayBuffer(50);    int current = 0;    while ((current = bufferedInputStream.read()) != -1) {        byteArrayBuffer.append((byte) current);    }    tempString = new String(byteArrayBuffer.toByteArray());} catch (Exception e) {    Log.i(""Error"",e.toString());}</code></pre>","367918","","147463","","2010-06-16 06:06:38","2010-06-17 09:46:06","Is there a faster way to download a page from the net to a string?","<android><url><download>","3","2","1","",""
"3051046","1","3051096","","2010-06-16 06:05:38","3","1578","<p>i have downloaded Eclipse Galileo and install Android SDK for the first time.</p><p>I have try to create an simple Userinterface, but i have see that i can't movethe ""object"" directly from the stage. But i need to edit the Code or open the Property panelin order to change the position of an Element on the Stage.</p><p>Isn't Eclipse WYSIWYG?</p><p>D.</p>","411161","","","","","2010-06-17 21:42:03","Android - Isn't Eclipse WYSIWYG?","<android>","4","1","1","2012-08-23 09:28:06",""
"3051179","1","","","2010-06-16 06:43:53","1","370","<p>I would like to build a library and be able to distribute it as a jar without having to give the source. In the library, layouts are used for specifying the UI, however android doesn't seem to facilitate easily bundling a jar and distributing it, as it doesn't properly scope the resources (anything in '/res/*') in this jar file, the references made with R.xxxx within the jar don't work. I can give the xml layouts and other resources to the client and ask them to put them into their resources directory, thus their R.java would have these references, now, how can the client pass this R.java to the library when invoking a method in the library? Guess, answer to part of the question would be through answer to 'How to pass class in java?"" Yes, I am new to android and java too.</p><p>Thanks,Krishna</p>","362953","","","","","2010-06-16 07:01:57","Building an android library and passing the client's R.java when making the library call, how?","<android>","1","0","0","",""
"3051554","1","","","2010-06-16 08:02:43","0","1629","<p>HI, I've made an application B called by app A with the startActivityForResult method.When B try to return the result to A the application crashes and I get this error (by the way com.sistematica.carichispeciali.MobiWork is the application A, the one that calls B with startActivityForResult)</p><pre><code>06-16 09:40:32.506: WARN/dalvikvm(744): threadid=3: thread exiting with uncaught exception (group=0x4001b390)06-16 09:40:32.506: ERROR/AndroidRuntime(744): Uncaught handler: thread main exiting due to uncaught exception06-16 09:40:32.526: ERROR/AndroidRuntime(744): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.sistematica.carichispeciali/com.sistematica.carichispeciali.MobiWork}: java.lang.NullPointerException06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3504)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3546)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread.access$2700(ActivityThread.java:126)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1962)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.os.Handler.dispatchMessage(Handler.java:99)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.os.Looper.loop(Looper.java:123)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread.main(ActivityThread.java:4595)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at java.lang.reflect.Method.invokeNative(Native Method)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at java.lang.reflect.Method.invoke(Method.java:521)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at dalvik.system.NativeStart.main(Native Method)06-16 09:40:32.526: ERROR/AndroidRuntime(744): Caused by: java.lang.NullPointerException06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at com.sistematica.carichispeciali.MobiWork.onActivityResult(MobiWork.java:96)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.Activity.dispatchActivityResult(Activity.java:3868)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3500)06-16 09:40:32.526: ERROR/AndroidRuntime(744):     ... 11 more</code></pre><p>this is how B returns the result</p><pre><code>private void risultato(final String paper)      {          AlertDialog.Builder builder = new AlertDialog.Builder(this);          builder.setIcon(R.drawable.alt);          builder.setTitle(""risultato"");          builder.setMessage(""è ""+paper+"" la targa?"");          builder.setPositiveButton(""si"", new DialogInterface.OnClickListener(){              @Override              public void onClick(DialogInterface dialog, int which)              {                dialog.dismiss();                resultIntent = new Intent();                resultIntent.putExtra(""1"", paper);                setResult(Activity.RESULT_OK, resultIntent);                finish();              }          });          builder.setNegativeButton(""no"", new DialogInterface.OnClickListener(){              @Override              public void onClick(DialogInterface dialog, int which)              {                 delRES();              }          });          builder.show();      };</code></pre><p>and this is how A uses it (it should take the string returned and put it into an editText, never menaged to see if it really works since it crash before)</p><pre><code>  public void onActivityResult(int requestCode, int resultCode, Intent data) {           super.onActivityResult(requestCode, resultCode, data);       switch(requestCode) {         case (1) : {           if (resultCode == Activity.RESULT_OK) {           String newText = data.getStringExtra(""1"");          m_plateField.setText(newText);          }           break;         }       }     }</code></pre>","343169","","","","","2010-06-18 18:00:00","activity started by ""startActivityForResult"" crashes when returning data","<android>","1","2","","",""
"3051583","1","","","2010-06-16 08:07:41","6","5226","<p>How do you align views relative to the ""middle"" part of another view?</p><p>I think it is best explained with a pic of the UI I'm trying to create in android.</p><p><img src=""http://i.stack.imgur.com/oUtFa.png"" alt=""alt text""></p>","357652","","114066","","2010-10-07 15:36:33","2012-02-02 12:30:34","How to align views in the middle of another views baseline?","<android><views>","4","0","2","",""
"3051643","1","","","2010-06-16 08:20:13","3","3179","<p>I need a small help on rotating one image around its center of axis among multiple images which are drawn to canvas in android.</p><p>I am loading images to canvas like below.</p><pre><code>canvas.drawBitmap(mMachineBackground, 0, 0, null);canvas.drawBitmap(mMachineRotator, 0, 0, null);</code></pre><p>I want to rotate only the second bitmap around its center of axis instead of rotating the entire canvas(which includes first bitmap also).</p><p>Thanks in advance.</p>","269304","","269304","","2010-06-29 00:22:53","2011-06-06 11:36:50","How to rotate particular image among multiple images drawn to canvas in android?","<android><animation><canvas>","3","0","2","",""
"3051759","1","4800516","","2010-06-16 08:39:01","2","623","<p>I have been trying to create a web page that will redirect the user after he has watched a video (or if he aborted the playback). I've got this working on the iphone but can't really figure out how it works on the android.</p><p>On the Iphone i have found two ways of doing this. using the  tag to embed the quicktime plugin and then adding a event listener with javascript to listen to the 'qt_ended' event. This does obviously not work on android because there is no quicktime plugin. </p><p>The second thing i tried was using the html5 -tag and listening to the 'ended' event, again this worked on the iphone but to my surprise not on android. In this case i got the video playing on the android phone but no redirect occurred after the video had reached the end. So my guess is that the android browser does not fully support the video-tag and that it does not fire the event.</p><p>So at this time i don't really know how to proceed. I'm guessing i could do something similar to the quicktime embed solution but using a plugin available on android. But i cant find any information on what plugins is available on the android and if they support some kind of 'ended'-event. </p>","37486","","","","","2013-08-21 14:00:08","Javascript ended event when video playback ends on android","<android><video><android-browser>","3","2","","",""
"3051795","1","","","2010-06-16 08:45:13","1","562","<blockquote>  <p>The emulator provides a default user-data disk image. At startup, the emulator creates <strong><em>the default image</em></strong> as a copy of <strong><em>the system user-data image</em></strong> (user-data.img), described above. The emulator stores the new image with the files of the active AVD.</p></blockquote><p>from:<a href=""http://androidappdocs.appspot.com/guide/developing/tools/emulator.html"" rel=""nofollow"">http://androidappdocs.appspot.com/guide/developing/tools/emulator.html</a></p><p>1)What does the default images mean?(userdata.img?)<br>2)What does the system user-data image mean?(userdata-qemu.img?)</p>","10927","","","","","2010-06-16 08:57:03","about android emulator diskimage","<android><diskimage>","1","0","","",""
"3051946","1","","","2010-06-16 09:08:20","1","154","<p>What is the best way of replacing an image with a throbber image inside webview? onclick is responses slow inside webview... </p>","349352","","","","","2011-04-29 00:15:44","Image replacement with throbber inside webview - Android","<android>","0","0","","",""
"3051981","1","3054534","","2010-06-16 09:14:19","31","15215","<p>I know what it does. If I dont use sometimes I can see the difference in alignments, sometimes I dont. My question is if canvas.restore restores the state previous to when it was saved. Why arent the changes made after save and before restore undone ? The changes remain same. Why ?</p>","368084","","","","","2013-07-10 08:48:47","Why do we use canvas.save or canvas.restore?","<android>","1","0","8","",""
"3052119","1","","","2010-06-16 09:37:18","4","7019","<p>I am trying to design a widget which looks like the ""spinning wheel"" (I am not sure it is appropriate name for it) widget that you can use to set up alarms or counters on the clock app provided with HTC Hero. For those who do not know this application, this widget is made up with wheels that you scroll to specify hours, minutes, seconds. I think it could be something like a kind of listview with a mask on it that isolate the selected element or a costumized timePicker but I do not manage to implement my widget from them and I did not find any tutorial on this topic. </p><p>Is there an easy way to do this based on ListViews? </p><p>Anyone has got an idea? </p><p>Thanks !</p>","268541","","","","","2012-08-06 22:51:31","Spinning wheel on Android","<android>","1","0","1","",""
"3052149","1","3058837","","2010-06-16 09:42:03","7","20839","<p>I have searched a lot of places but couldnt find a clean sequential explanation of how to start a service (or if thats not possible then an activity) at a specific time daily using the AlarmManager??</p><p>I want to register several such alarms and triggering them should result in a service to be started. I'll be having a small piece of code in the service which can then execute and i can finish the service for good....</p><pre><code>Calendar cal = Calendar.getInstance();Calendar cur_cal = Calendar.getInstance();cur_cal.setTimeInMillis(System.currentTimeMillis());Date date = new Date(cur_cal.get(Calendar.YEAR), cur_cal.get(Calendar.MONTH), cur_cal.get(Calendar.DATE), 16, 45);cal.setTime(date);Intent intent = new Intent(ProfileList.this, ActivateOnTime.class);intent.putExtra(""profile_id"", 2);PendingIntent pintent = PendingIntent.getService(ProfileList.this, 0, intent, 0);AlarmManager alarm = (AlarmManager)getSystemService(Context.ALARM_SERVICE);alarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pintent);System.out.println(""The alarm set!!"");</code></pre><p>i tried this code to activate the alarm at 4.45... but its not firing the service... do i have to keep the process running??M i doing anything wrong???</p><p>One more thing, my service gets perfectly executed in case i use the following code:</p><pre><code>long firstTime = SystemClock.elapsedRealtime();alarm.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime, 30*1000,pintent);</code></pre>","238071","","238071","","2010-06-16 11:57:57","2012-05-25 11:46:25","Using Alarmmanager to start a service at specific time","<android><service><alarm><alarmmanager>","2","2","10","",""
"3052196","1","","","2010-06-16 09:50:37","0","1191","<p>I'm new to android programming. just to improve my skills, i started with some project in my mind.when app starts, it will show a button. on click of it, it will allow me to select a contact from the address book. then i want to retrieve all the sms sent to that contact (if they are stored in sms outbox). Is it possible. Can some one guide me. If there is some tutorial on these topics, can you let me know the URL or source code?Thanks in Advance.</p>","265341","","","","","2010-06-16 11:16:22","Android - Get all sms in phone sent to a peson","<android><sms><addressbook>","2","1","","",""
"3052218","1","","","2010-06-16 09:52:57","0","782","<p>I'm trying to make a bundle for Felix on Android which may take photos regularly.All the code compiles well and it can be resolved by Felix, but when I try to start it, I get an exception (java.lang.VerifyError) and this trace in logcat :</p><pre><code>I/dalvikvm(  738): Failed resolving Lbarcode/android/CameraHandler; interface 1 'Landroid/hardware/Camera$PictureCallback;'W/dalvikvm(  738): Link of class 'Lbarcode/android/CameraHandler;' failedE/dalvikvm(  738): ERROR: defineClass(0x40093110, barcode.android.CameraHandler, 0x400c93b8, 0, 1769, 0x40204708)</code></pre><p>The CameraHandler class opens a Camera object, and implements PictureCallback and AutoFocusCallback.</p><p>The .jar file has been 'dexed', via a simple 'dx --dex --output=classes.dex ... &amp;&amp; aapt add ... classes.dex'.</p><p>I don't know why this error raise, so if someone has a solution...</p><p>Thanks</p>","368094","","","","","2010-09-05 21:47:24","Resolve error while loading 'dexed' JAR on Android","<android><jar><bundle><dalvik>","1","0","","",""
"3052250","1","3052662","","2010-06-16 09:58:06","0","194","<p>i developed application with map service and webservices when i run application its became very slow and continuosly it is showing activity not responding force close or wait</p><p>how to resolve this issue</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2010-06-16 11:02:51","Android application error","<android>","1","4","","",""
"3052517","1","13807786","","2010-06-16 10:39:10","40","19314","<p>Does anyone know the proper interpretation of the accuracy measurements returned by getAccuracy()? For instance, are they calculated as:</p><ul><li><p>Circular Error Probability (meaning, if i understand correctly, radius of a 50% confidence circle)?</p></li><li><p>Radius of 95% confidence circle?</p></li><li><p>something else?</p></li></ul><p>In addition, what are the actual calculations that are used and how much can we rely on them? Does it depend on the source of the location estimate (GPS vs. network)?</p><p>Many thanks for any advice you can give me.</p>","368157","","368157","","2010-06-16 11:58:46","2013-08-27 08:49:42","How is location accuracy measured in Android?","<android><location>","6","2","13","",""
"3052671","1","","","2010-06-16 11:03:25","1","137","<p>I have an app which also includes a service with a Notification.Right now I am experiencing the foillowing problem :</p><ul><li>I start my app which will work fine</li><li>after couple of minutes the powersave kicks in and I get a black screen</li><li>I (or hte user) click the Menu-button to dismiss the black screen and to unlock the screenlock</li><li>Now my (fullscreen) app will have ""moved"" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will ""fix"" the view...</li></ul><p>or</p><ul><li>I start my app which will work fine</li><li>I press the Home button exiting the app, my service though will (correctly) keep running</li><li>when selecting my service from the notification-bar I will get once again :-Now my (fullscreen) app will have ""moved"" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will ""fix"" the view...</li></ul><p>Any idea what the problem is ? The app is running on a ADP2 with Android 1.6Thanks in advance !</p><p>Ok, after some testing I noticed that if I don't run the Activity on Fullscreen, but just leave the TtileBar away this won't happen...Still this is no solution to me, I want it to be fullscreen...</p><p>Noticed siomething else, when I have the View with the black bar, and I press the home button it will ""refresh"" the View correctly just before actually going to the Home Screen :(</p>","162147","","162147","","2010-06-17 09:28:09","2010-06-17 09:28:09","Misplaced Layout after ""home""-button and/or powersave screen","<android><layout>","0","0","","",""
"3052678","1","3052809","","2010-06-16 11:05:42","2","11221","<p>There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like:</p><pre><code>Text11 Text12 Button1 Button2Text21 Text22 Button1 Button2...</code></pre><p>At first obvious way to accomplish that seemed to be <code>TableLayout</code>. I was expecting to have layout/styling data specified in res/layout/*.xml and to populate it with some dataset from java code (as with <code>ListView</code>, for which its possible to specify <code>TextView</code> of item in *.xml and bind it to some array using <code>ArrayAdapter</code>). But after playing for a while, all I found to be possible is fully populating <code>TableLayout</code> programatically. Still, creating <code>TableRow</code> by <code>TableRow</code> and setting layout attributes directly in java code doesn't seem elegant enough.</p><p><strong>So the question is:</strong> am I at the right path? Is <code>TableLayout</code> really best View to accomplish that? Maybe it's more appropriate to extend <code>ListView</code> or something else to meet such requirements?</p>","18104","","18104","","2010-06-17 08:45:54","2010-06-17 08:45:54","Fancy dynamic list in Android: TableLayout vs ListView","<android><listview><tablelayout><android-arrayadapter>","2","0","","",""
"3052743","1","3053047","","2010-06-16 11:16:40","8","11762","<p>I'm having a problem getting my android dev environment setup in Windows 7.  I follow the instructions <a href=""http://developer.android.com/guide/tutorials/hello-world.html"">here,</a> as well as several environment sublinks.  I am using Eclipse with the Android plugin.  I have installed the Java JDK several times, in various locations (jdk-6u20-windows-i586.exe) - but I am obviously missing something.  </p><p>Every time I run ""android create avd --target 2 --name my_avd"" I get an error:</p><pre><code>    C:\Users\andrew&gt;android create avd --target 2 --name my_avdWARNING: Java not found in your path.Checking it it's installed in C:\Program Files\Java instead.ERROR: No suitable Java found. In order to properly use the Android DeveloperTools, you need a suitable version of Java installed on your system. Werecommend that you install the JDK version of JavaSE, available here:  http://java.sun.com/javase/downloads/You can find the complete Android SDK requirements here:  http://developer.android.com/sdk/requirements.html</code></pre><p>This error message is the reason for me installing the JDK several times over.  First I tried installing to a location on my e: drive.  I then moved it to the default loc (program files (x86)\java\jdk.6.something.  I also tried forcing it to go into the program files\ path, but it still automatically installs into the (x86) path.  I have added the install path to my path environment variable every single time, yet I still continue to get this error.  My suspicion is that windows 7 and the android tools are not playing together well in terms of finding the JDK, but who knows, it may be something entirely different.  If you have seen this error before, I would appreciate a hint.</p>","357499","","","","","2012-10-19 22:07:29","""Android Create"" call fails in windows 7 - missing JDK","<windows><android><windows-7><jdk>","8","2","3","",""
"3052748","1","3054004","","2010-06-16 11:17:27","3","1368","<p>How long does <a href=""http://code.google.com/p/robotium/"" rel=""nofollow"">robotium</a> wait for a new activity to show up? Is it possible to set the timeout manually for the Solo instance?</p>","339853","","119895","","2010-06-16 14:11:53","2012-11-26 20:34:28","Synchronization in Robotium","<android><testing><robotium>","2","0","","",""
"3052774","1","","","2010-06-16 11:23:04","1","274","<p>After login button click I am waiting for the webservice response. At that time I need to display a progress message after receiving response I have to close that message. How to do this ?</p>","324223","","","","","2010-06-16 11:32:17","How to display Progress message?","<android>","1","0","","",""
"3052916","1","3053196","","2010-06-16 11:46:39","2","1893","<p>I am using 2 map Activities. do i want to register multiple Map APi key for each? Now I am getting this exception:</p><pre><code>06-16 18:49:41.498: INFO/MapActivity(11067): Handling network change notification:CONNECTED06-16 18:49:41.498: ERROR/MapActivity(11067): Couldn't get connection factory client</code></pre><p>I googled about this exception. It concludes that must be a API Key Problem? Is that true? Why it happens?</p><p>This is my code for mapview tag:</p><pre><code>&lt;com.google.android.maps.MapView    xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/mapview_id""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:clickable=""true"" android:apiKey=""my_api_key"" /&gt;</code></pre><p>i got this exception while creating the object for the mapview iteself. That is:</p><pre><code>MapView mv=(MapView)findViewById(R.id.mapview_id);</code></pre>","267269","","114066","","2012-02-01 14:14:00","2012-02-01 14:14:00","How do I register a correct Google Maps Api Key?","<android><google-maps><android-mapview>","3","0","1","",""
"3052964","1","","","2010-06-16 11:55:49","2","367","<p>Does anyone know of a way to tell which folder Android system will resolve to when I request a particular drawable from the Resources (<code>drawable-long</code> vs. <code>drawable-notlong</code>, for example)?  I want to make sure it's loading resources the way I would expect it to (for instance, to make sure the Tattoo is really <code>ldpi</code> and not <code>mdpi</code> since it's right on the borderline).</p><p>I could always print out the intrinsic size of the drawable after I fetch it from Resources, and check that against the various image sizes I have, but that's kind of a pain.  Plus, my company allows its clients to skin their app before it's released, so after it's been skinned I won't be able to rely on that method.</p><p>I tried using <code>Resources.getName(resId)</code> but that doesn't give the folder name, and as far as I know you can get a <code>AssetFileDescriptor</code> for the resource but you can't get an actual filename.</p><p><strong>UPDATE:</strong>Since asking this question I have discovered that you can access many of the <a href=""http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources"" rel=""nofollow"">resource qualifier names</a> through the <code>Configuration</code> and <code>DisplayMetrics</code> classes (both accessible via <code>getResources()</code>).  <code>DisplayMetrics</code> can give you the <code>ldpi</code>/<code>mdpi</code>/<code>hdpi</code> designation, and <code>Configuration</code> can give you <code>small</code>/<code>normal</code>/<code>large</code> screen size, <code>long</code>/<code>notlong</code> aspect ratio, locale, mobile network codes, and other hardware information.  However, this still does not positively confirm that you are getting the resources you expect if you have a complicated resource set.  It also does not protect you from bugs that report the incorrect values, like the Motorola Droid bug where the <code>DisplayMetrics</code> reports the wrong <code>xdpi</code> and <code>ydpi</code> (it reports 96dpi where the real value is more like 265dpi!  Terrible bug.).</p>","213525","","213525","","2010-07-13 16:16:46","2012-01-19 08:40:29","Is there any way to tell what folder a drawable resource was inflated from?","<android>","2","3","1","",""
"3052972","1","3053044","","2010-06-16 11:58:44","1","1216","<p>hi ive got a working sms receiver but when i try to load another class using:</p><blockquote>  <p>Intent intent = new Intent(SMSReceiver.this, SMSNotifier.class);<br>  startActivityForResult(intent, 0);</p></blockquote><p>i get the error:</p><pre><code>The constructor Intent(SMSReceiver, Class&lt;SMSNotifier&gt;) is undefined</code></pre><p>for the first line and:</p><pre><code>The method startActivityForResult(Intent, int) is undefined for the type SMSReceiver</code></pre><p>for the second line</p><p>id really appreciate some advice as to whats going wrong</p><p>thanks,ng93</p><p>edit:</p><pre><code>package com.prototype.messages;import android.app.Notification;  import android.app.NotificationManager;  import android.app.PendingIntent;  import android.content.BroadcastReceiver;  import android.content.Context;  import android.content.Intent;  import android.os.Bundle;   import android.telephony.gsm.SmsMessage;    &gt; public class SMSReceiver extends BroadcastReceiver {      @Override      public void onReceive(Context context, Intent intent) {          Bundle bundle = intent.getExtras();                  SmsMessage[] msgs = null;          String str = """";                      if (bundle != null) {              Object[] pdus = (Object[]) bundle.get(""pdus"");              msgs = new SmsMessage[pdus.length];                          for (int i=0; i&lt;msgs.length; i++){                  msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                                  str += ""SMS from "" + msgs[i].getOriginatingAddress();                                       str += "" :"";                  str += msgs[i].getMessageBody().toString();                  str += ""\n"";                      }          }  //      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(SMSReceiver.this, Messages.class);  //        notificationIntent.setFlags(  Intent.FLAG_ACTIVITY_NEW_TASK);  //        PendingIntent contentIntent = PendingIntent.getActivity(this,0,notificationIntent,0);          notification.setLatestEventInfo(context, contentTitle, contentText, null);          NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);          mNotificationManager.notify(1, notification);      }  }  </code></pre>","364727","","568471","","2011-08-09 22:04:34","2011-08-09 22:04:34","how to use intent from receiver android","<android><android-intent><receiver>","1","0","","",""
"3052973","1","3053852","","2010-06-16 11:58:47","2","490","<p>I am basically bb programmer and i used NetBeans ,BB JDE for BB development.</p><p>I am partially switching over to android also.So i want to know how to use Eclipse IDE that should be compatible to Both Blackberry JDE and android SDK.</p><p>What is IDE' that needs to be downloaded</p><p>.I downloaded BlackBerry_JDE_PluginFull_1.0.0.67.exe.</p><p>I have a doubt of adding JDE's to IDe and i want to know whether can i load the android SDK to this Eclipse IDE</p><p>Version: 3.4.1Build id: M20080911-1700</p><p>Any Ideas will be useful</p><p>Regards</p><p>Rakesh Shankar.P</p>","138030","","21234","","2010-06-16 12:00:34","2010-06-16 14:08:38","Usuage Of Eclipse for BB and Android Development","<android><eclipse><blackberry>","1","0","","",""
"3053062","1","3053071","","2010-06-16 12:10:23","71","38214","<p>I wrote the following in the strings.xml file:</p><pre><code>&lt;string name=""game_settings_dragNDropMove_checkBox""&gt;Move by Drag&amp;Drop&lt;/string&gt;</code></pre><p>I got the following error:</p><pre><code>The reference to entity ""Drop"" must end with the ';' delimiter.</code></pre><p>How can I write character &amp; in the strings.xml?</p>","285174","","","","","2013-07-30 06:32:08","How can I write character & in android strings.xml","<android><string><special-characters>","2","0","15","",""
"3053195","1","","","2010-06-16 12:28:37","1","724","<p>In my application , i have an option to capture the hprof dump. Iused</p><p>android.os.Debug.dumpHprofData (String fileName)</p><p>Initially i though the hprof data generated by the method above is forthe entire device , which is not so . The hprof data generated is onlyfor my process.</p><p>Now i am trying to generate hprof data for other process as well. Ineed to get the Hprof dump for all the running processes fromapplication code.</p><p>from adb shell i tried ""kill -10 "" , This command will generatethe hprof file for the corresponding  process in the data/misc folder.</p><p>Now the problem is this command is working perfectly from the adbshell prompt , but i am not able to embed the command to mycode.</p><p>My code is like</p><p>Runtime.getRuntime().exec(""chmod 777 /data/misc"")Runtime.getRunTime().exec(""kill -10 "")</p><p>No exceptions are thrown , but somehow  it is not working. The samecode above is capturing Hprof dump for my process, when i give myprocess ID.</p><p>I tried with ""android.os.Process.sendSignal (int pid,android.os.Process.SIGNAL_USR1) ;"" also.Getting the same problem.It iscapturing Hprof dump for my process. For other processes it is notworking.</p><p>Do we need to have any special permission to kill other process fromour process ? Or is it a built issue ? can you please suggest somepossible way to get Hprof dump for other processes from applicationcode?</p><p>Thanks</p>","368228","","353852","","2010-06-16 12:44:41","2010-06-16 14:09:34","Getting Hprof dump for other processes from application code","<java><android><hprof>","1","0","","",""
"3053203","1","3093130","","2010-06-16 12:29:59","3","2326","<p>I want to use following selector drawable for android gallery image will it work ?</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;item state_selected=""true"" android:drawable=""@drawable/selected_icon"" &gt;     &lt;/item&gt;    &lt;item        android:drawable=""@drawable/unselected_icon"" &gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre><p>i tried but it is not working</p>","216431","","","","","2010-06-22 12:37:57","android gallery item selector","<android><gallery><selecteditem>","1","2","","",""
"3053554","1","3054083","","2010-06-16 13:18:32","4","1455","<p>I want to get the nickname of a contact from addressbook. I start with his phone number, query it and want the nickname (aka alias) as a result.</p><pre><code>Cursor cur = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.NUMBER + "" = "" + incomingNumber, null, null);        if (cur.moveToFirst()) {            Log.e(""saymyname"", cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Nickname.NAME)));            Log.e(""saymyname"", cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Nickname.LABEL)));        }</code></pre><p>Output of the logs is the incomingNumber (first Log.e() ) and null (second Log.e() ), but I want to get the contact's nickname!</p><p>ThanksTom</p>","198996","","","","","2013-09-09 14:53:34","retrieve contact's nickname","<android><contacts>","2","0","","",""
"3053594","1","3053701","","2010-06-16 13:23:29","6","1372","<p>I've found a sample to download a large data file at the following link,<a href=""http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples/Downloader"" rel=""nofollow"">http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples/Downloader</a></p><p>It seems to be pretty nice (I haven't yet tested it). But I also have read some posts at the stackoverflow to do the same thing by using the AsyncTask class, not using the Thread class as the above sample.</p><p>What I want to know is, which should I use to achieve downloading a file? And if AsyncTask is better, would you point me to a sample code?</p>","366049","","114066","","2010-07-19 12:18:15","2012-10-19 11:11:52","To download a large file, which is a better approach to use either AsyncTask or Thread?","<android>","3","0","2","",""
"3053761","1","3424931","","2010-06-16 13:41:47","42","72338","<p>Is it a good practice to reload an activity in Android?</p><p>What would be the best way to do it? <code>this.finish</code> and then <code>this.startActivity</code> with the activity intent?</p>","143378","","","","","2013-10-09 12:11:32","Reload activity in Android","<android><activity>","7","2","21","",""
"3053864","1","3057049","","2010-06-16 13:54:53","4","9506","<p>friends,</p><p>i want to set android:layout_centerVertical=""true"" property of layoutthrough java code of an image.</p><p>can any one guide me how to achieve this. here is my code.</p><pre><code>RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);params.height = (int)totalHeight;img.setLayoutParams(params);</code></pre><p>i have tried using setScaleType(ScaleType.FIT_CENTER) but no use.</p><p>any help would be appriciated. </p>","249991","","","","","2012-09-14 04:27:41","how to center layout to vertical in android through java code?","<android>","3","0","","",""
"3053908","1","","","2010-06-16 13:59:35","1","1248","<p>I am looking at the possibility of using Android as a secure corporate mobile platform.</p><p>One of the pre-requisites for this will be a way of managing multiple devices, security policies, software deployment, that sort of thing - essentially the things the BlackBerry Enterprise Server handles for BlackBerry or MDM (or something 3rd party like SOTI) handles for Windows Mobile.</p><p>Does such a thing exist for Android?  It's a platform we're interested in but without this right now (and we're not in a position to build it ourselves) it's a non-starter.</p>","89382","","299797","","2012-02-19 06:16:32","2012-02-19 06:16:32","Android Device Management","<android><deployment><policy><mdm>","1","5","4","",""
"3054545","1","3055375","","2010-06-16 15:06:15","-2","246","<p>How can I load an image in Android?</p>","655814","","496830","","2011-11-08 13:46:28","2011-11-08 13:46:28","How can I load an image in Android?","<android>","1","2","0","2010-06-16 15:57:16",""
"3054973","1","","","2010-06-16 15:54:00","4","15020","<p>I am trying to execute a command from within my code, the command is ""echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness"" and I can run it without problems from adb shell</p><p>I am using Runtime class to execute it :</p><pre><code>Runtime.getRuntime().exec(""echo 125 &gt; /sys/devices/platform/flashlight.0/leds/flashlight/brightness"");</code></pre><p>However I get a permissions error since I am not supposed to access the sys directory. I have also tried to place the command in a String[] just in case spaces caused a problem but it didn't make much differense.</p><p>Does anyone know any workaround for this ?</p>","357636","","","","","2013-03-12 10:14:35","android : how to run a shell command from within code","<android><shell><command>","6","0","6","",""
"3055017","1","","","2010-06-16 15:58:23","6","1006","<p>I work for an operator, and we preload applications on Android phones.  </p><p>However, some preloaded applications, once upgraded from Market, crash.  </p><p>The problem is this:<br>- the application contains a .so library file<br>- in order to preload the complete application on a phone, the .so library file has to be placed separately into the lib directory (/system/lib/libXXXXjni.so)<br>- when the preloaded application is upgraded from Market and run, instead of the .so library file in the new APK being found, the older preloaded .so file is found first - causing a crash, because the two .so fiels have differing contents  </p><p>Does anyone have a suggested work-around, or knowledge of the library-searching algorthim which may help me solve this?  </p><p>One possible solution might be to simply rename the library file, but is that enough?  </p><p>Thanks in advance...</p>","368420","","","","","2011-10-11 18:32:34","Preloaded Android application with .so library file cannot be upgraded","<android><preload>","1","0","2","",""
"3055133","1","","","2010-06-16 16:11:38","14","33587","<p>I'm displaying an image on full screen now i want to zoom it in or out.Any one guide on how I can implement multi touch image zooming?</p><p>I am using the 2.1 sdk version.</p>","249991","","114066","","2010-06-17 07:50:09","2012-09-13 16:50:28","android multitouch image zooming?","<android><imageview><multi-touch>","5","2","2","",""
"3055174","1","","","2010-06-16 16:16:18","1","12002","<p>I am getting ""javax.net.ssl.SSLException: Not trusted server certificate"" exception when I am trying to hit https URL (.Net Webservice) from my android app.Can anyone please help me out?Below is my code: HttpParams myParams = new BasicHttpParams();        HttpProtocolParams.setVersion(myParams, HttpVersion.HTTP_1_1);        HttpProtocolParams.setContentCharset(myParams, ""utf-8"");        myParams.setBooleanParameter(""http.protocol.expect-continue"", false);</p><pre><code>    HttpConnectionParams.setConnectionTimeout(myParams, 100000);     HttpConnectionParams.setSoTimeout(myParams, 100000);    //    KeyStore trusted;</code></pre><p>try {  </p><p>trusted = KeyStore.getInstance(""pkcs12"");   trusted.load(null, """".toCharArray());   SSLSocketFactory sslf = new SSLSocketFactory(trusted);      sslf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); </p><pre><code>  SchemeRegistry schemeRegistry = new SchemeRegistry();   schemeRegistry.register(new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));  schemeRegistry.register(new Scheme(""https"", sslf, 443));      ThreadSafeClientConnManager manager = new ThreadSafeClientConnManager(myParams, schemeRegistry);  httpClient = new DefaultHttpClient(manager, myParams); </code></pre><p>} catch (KeyStoreException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (NoSuchAlgorithmException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (CertificateException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (KeyManagementException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (UnrecoverableKeyException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }<br>        //</p><pre><code>    localContext = new BasicHttpContext();  </code></pre><p>httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109); </p><pre><code>    httpPost = new HttpPost(""https://...."");     response = null;     StringEntity tmp = null;             httpPost.setHeader(""SOAPAction"", ""SoapActionURL"");     if (contentType != null) {         httpPost.setHeader(""Content-Type"", contentType);     } else {         httpPost.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");     }     try {         tmp = new StringEntity(data,""UTF-8"");     } catch (UnsupportedEncodingException e) {         Log.e(""Your App Name Here"", ""HttpUtils : UnsupportedEncodingException : ""+e);     }     httpPost.setEntity(tmp);     try {         response = httpClient.execute(httpPost,localContext);         if (response != null) {             ret = EntityUtils.toString(response.getEntity());         }     } catch (Exception e) {         Log.e(""Your App Name Here"", ""HttpUtils: "" + e);     }  </code></pre>","342823","","","","","2014-03-25 20:55:19","""javax.net.ssl.SSLException: Not trusted server certificate"" exception in android","<android>","1","1","1","",""
"3055198","1","8380788","","2010-06-16 16:18:46","0","548","<p>I have the following code which gets call in my main activity's onCreate method</p><pre><code> public static ErrorReporter getInstance(){  if (instance == null){   instance = new ErrorReporter();  }  return instance; }</code></pre><p>Only on android 1.5 calling the above method causes java.lang.VerifyError. I am not able to figure out why this is happening. Any hints on how to solve this problem</p>","254103","","","","","2012-04-16 05:01:10","Android java.lang.VerifyError only on 1.5","<android>","3","4","","",""
"3055211","1","3061985","","2010-06-16 16:19:36","4","3907","<p>I have a class that extends the Thread class and has its run method implemented as so.</p><pre><code>public void run(){    while(!terminate){        if(paused){            Thread.yield();        }else{            accummulator++;        }    }}</code></pre><p>This thread is spawned from the onCreate method.</p><p>When my UI is hidden (when the Home key is pressed) my onPause method will set the paused flag to true and yield the tread.  However in the DDMS I still see the uTime of the thread accumulate and its state as ""running"".</p><p>So my question is.  What is the proper way to stop the thread so that it does not use up CPU time?</p>","279750","","","","","2010-06-17 13:25:12","android thread management onPause","<android><multithreading>","3","0","","",""
"3055251","1","","","2010-06-16 16:24:45","1","138","<p>I am developing an App in which I need to authenticate password, store user personal information and setting details / preferences. All these are user-mobile specific or rather App specific and are unique for each user,the password and settings info should not be lost once phone is switched off or user exits the App, which data storage rocedure is recommended for such App?</p>","357349","","","","","2010-06-17 04:25:13","which database to use","<android>","3","1","","",""
"3055296","1","","","2010-06-16 16:29:23","0","92","<p>I want to show an image in the screen in ANDROID.please anyone help me how to do it?</p>","655814","","","","","2010-06-16 16:41:25","Loading image in ANDROID","<android>","0","0","0","",""
"3055437","1","","","2010-06-16 16:51:20","2","779","<p>Hey, I'm a real gcc newbee so excuse me if this is a silly question.</p><p>I want to use opencv in android and therefore try to compile it into a static library that get's used in the android ndk build process to build a shared library that I intent to use for my android app. The build of the statc library works fine, but when building the shared library I get complaints about undefined references. Since the file seemed to be correctly compiled and included I checked with ar -tv and see the following:</p><pre><code>---------       0/0         27304 Jun 16 18:15 2010 /  ---------       0/0            24 Jan  1 01:00 1970 //  rw-r--r--     501/501       11192 Jun 16 18:13 2010 cxalloc.o/  rw-r--r--     501/501      289760 Jun 16 18:13 2010 cxarithm.o/  rw-r--r--     501/501      197368 Jun 16 18:13 2010 cxarray.o/  rw-r--r--     501/501      335112 Jun 16 18:13 2010 cxcmp.o/  rw-r--r--     501/501      422872 Jun 16 18:13 2010 cxconvert.o/  rw-r--r--     501/501      127160 Jun 16 18:13 2010 cxcopy.o/  rw-r--r--     501/501      191208 Jun 16 18:13 2010 cxdatastructs.o/  rw-r--r--     501/501      141536 Jun 16 18:13 2010 cxdrawing.o/  rw-r--r--     501/501      170936 Jun 16 18:13 2010 cxdxt.o/  rw-r--r--     501/501       29008 Jun 16 18:13 2010 cxerror.o/  rw-r--r--     501/501       48304 Jun 16 18:13 2010 cximage.o/  rw-r--r--     501/501       23376 Jun 16 18:13 2010 /0  rw-r--r--     501/501       61024 Jun 16 18:13 2010 cxlogic.o/  rw-r--r--     501/501       39520 Jun 16 18:13 2010 cxlut.o/  rw-r--r--     501/501      122064 Jun 16 18:14 2010 cxmathfuncs.o/  rw-r--r--     501/501      600368 Jun 16 18:14 2010 cxmatmul.o/  rw-r--r--     501/501      135824 Jun 16 18:14 2010 cxmatrix.o/  rw-r--r--     501/501      140464 Jun 16 18:14 2010 cxmean.o/  rw-r--r--     501/501      339224 Jun 16 18:14 2010 cxmeansdv.o/  rw-r--r--     501/501      118208 Jun 16 18:14 2010 cxminmaxloc.o/  rw-r--r--     501/501      497760 Jun 16 18:14 2010 cxnorm.o/  rw-r--r--     501/501      119712 Jun 16 18:14 2010 cxouttext.o/  rw-r--r--     501/501      346624 Jun 16 18:14 2010 cxpersistence.o/  rw-r--r--     501/501        1688 Jun 16 18:14 2010 cxprecomp.o/  rw-r--r--     501/501       86856 Jun 16 18:14 2010 cxrand.o/  rw-r--r--     501/501      242768 Jun 16 18:15 2010 cxsumpixels.o/  rw-r--r--     501/501       82320 Jun 16 18:15 2010 cxsvd.o/  rw-r--r--     501/501      102024 Jun 16 18:15 2010 cxswitcher.o/  rw-r--r--     501/501        5968 Jun 16 18:15 2010 cxtables.o/  rw-r--r--     501/501       43720 Jun 16 18:15 2010 cxutils.o/  </code></pre><p>There are two lines that I don't understand, the second one with the date 1970 and the one with \0 as filename. I also wondered because nm doesn't return anything. When I try a randlib I get:</p><pre><code>ranlib: warning for library: libcxcore.a the table of contents is empty (no object file members in the library define global symbols)  </code></pre><p>The file that should figure at the place of \0 is the one that defines one of the functions that can not be referenced.</p><p>I tried this under OS X 10.6 and Ubuntu 10.04.</p><p>Any insights on this or what else I could do to find the problem?</p>","368479","","368479","","2010-06-16 17:22:16","2012-03-05 05:09:17","undefined reference and strange content of static library","<c++><android><gcc><opencv>","1","0","","",""
"3055524","1","","","2010-06-16 17:03:54","2","305","<p>I have some required try/catch statements in my application that in my testing never get called.  I have sent them up with: </p><pre><code>Log.e(""messaage"", e.toString());</code></pre><p>for my debugging and now that I'm ready to release I am not sure if I should take that out or not.  I see in android market you can get error/crash reports and while I do not expect my app to catch any errors, I would like to know if that happens and wondering if I need specific syntax for that.  My question is what should I do in the catch statement for these errors?  I'm already handling the error from a user standpoint...</p><p>Thanks!</p>","341447","","","","","2010-06-16 17:56:47","Android Market Error Handling","<android><google-play>","1","1","","",""
"3055599","1","3055749","","2010-06-16 17:17:20","18","11250","<p>I have an Activity calling a Service defined in IDownloaderService.aidl:</p><pre><code>public class Downloader extends Activity { IDownloaderService downloader = null;// ...</code></pre><p>In Downloader.onCreate(Bundle) I tried to bindService</p><pre><code>Intent serviceIntent = new Intent(this, DownloaderService.class);if (bindService(serviceIntent, sc, BIND_AUTO_CREATE)) {  // ...</code></pre><p>and within the ServiceConnection object sc I did this</p><pre><code>public void onServiceConnected(ComponentName name, IBinder service) {  Log.w(""XXX"", ""onServiceConnected"");  downloader = IDownloaderService.Stub.asInterface(service);  // ...</code></pre><p>By adding all kinds of Log.xx I found that the code after if(bindService(...))  actually goes BEFORE ServiceConnection.onServiceConnected is being called - that is, when downloader is still null - which gets me into trouble. All the samples in ApiDemos avoid this timing problem by only calling services when triggered by user actions. But what should I do to right use this service after bindService succeeds? How can I wait for ServiceConnection.onServiceConnected being called reliably? </p><p>Another question related. Are all the event handlers: Activity.onCreate, any View.onClickListener.onClick, ServiceConnection.onServiceConnected, etc. actually called in the same thread (mentioned in the doc as the ""main thread"")? Are there interleaves between them, or Android would schedule all events come into being handled one-by-one? Or, When exactly is ServiceConnection.onServiceConnected actually going to be called? Upon completion of Activity.onCreate or sometime when A.oC is still running?</p>","368496","","6391","","2010-06-17 02:46:19","2013-10-02 10:37:56","Android how do I wait until a service is actually connected?","<android><binding><service><serviceconnection>","4","1","10","",""
"3055614","1","","","2010-06-16 17:19:47","5","3785","<p>i have a aplication on the android market , in wich exceptions and errors are catched and sent to me by acra.</p><p>But i receive quite a lot out of memory errors..In different kind of classes...some my app, some general java..</p><p>Does this always mean there is a problem in my app, or can it also be the phone ran out of memory due to a other process?</p><p>Will users also get a fc dialog ?</p><p><strong>Additional Information</strong></p><p>There is nothing memory intensite in my app..</p><p>no images...no big chunks of data..only a simple view..and most intensive a mobclix ad..</p><p>i'm new to java...so i may have a leak somewhere..but i do find it hard to debug that.But at this point i'm not even sure there is someting wrong...</p><p>i get about 25 -50 OOM error's daily..but compared to 60.000 ads it shows a day.(i show only 1 or 2 ads for each time it's started) that is not too much.</p><p>1 receive errors like :</p><pre><code>""java.lang.OutOfMemoryErrorat org.apache.http.impl.io.AbstractSessionInputBuffer.init(AbstractSessionInputBuffer.java:79)at org.apache.http.impl.io.SocketInputBuffer.&lt;init&gt;(SocketInputBuffer.java:93)at android.net.http.AndroidHttpClientConnection.bind(AndroidHttpClientConnection.java:114)at android.net.http.HttpConnection.openConnection(HttpConnection.java:61)at android.net.http.Connection.openHttpConnection(Connection.java:378)at android.net.http.Connection.processRequests(Connection.java:237)at android.net.http.ConnectionThread.run(ConnectionThread.java:125)</code></pre><p>""</p><pre><code>""java.lang.OutOfMemoryErrorat java.io.BufferedReader.&lt;init&gt;(BufferedReader.java:102)at com.mobclix.android.sdk.Mobclix$FetchResponseThread.run(Mobclix.java:1422)at com.mobclix.android.sdk.MobclixAdView$FetchAdResponseThread.run(MobclixAdView.java:390)at java.util.Timer$TimerImpl.run(Timer.java:290)</code></pre><p>""</p><pre><code>""java.lang.OutOfMemoryErrorat org.apache.http.util.ByteArrayBuffer.&lt;init&gt;(ByteArrayBuffer.java:53)at org.apache.http.impl.io.AbstractSessionOutputBuffer.init(AbstractSessionOutputBuffer.java:77)at org.apache.http.impl.io.SocketOutputBuffer.&lt;init&gt;(SocketOutputBuffer.java:76)at android.net.http.AndroidHttpClientConnection.bind(AndroidHttpClientConnection.java:115)at android.net.http.HttpConnection.openConnection(HttpConnection.java:61)at android.net.http.Connection.openHttpConnection(Connection.java:378)at android.net.http.Connection.processRequests(Connection.java:237)at android.net.http.ConnectionThread.run(ConnectionThread.java:125)</code></pre><p>""</p><p>So the main question is..am i leaking somewhere..or can this be considered normal because in a small % of cases the phone may be out of memory due to other aplications running on it.</p>","368501","","3205","","2012-01-31 10:46:58","2012-01-31 10:46:58","out of memory error , my app's fault?","<java><android><out-of-memory>","6","2","1","",""
"3055877","1","3364670","","2010-06-16 17:56:38","3","1090","<p>I'm new to android... having trouble trying to open a URL from a live wallpaper..</p><p>Code to open the url:</p><pre><code>            Intent intent = new Intent(Intent.ACTION_VIEW);            intent.setData(Uri.parse(url));            Activity activity = new Activity();            activity.startActivity(intent);</code></pre><p>But I just get a NullpointerException:</p><pre><code> java.lang.NullPointerException     at android.app.Activity.startActivityForResult(Activity.java:2749)     at android.app.Activity.startActivity(Activity.java:2855)     at org.amble.graphics.HToolbar$URLEntry.run(HToolbar.java:81)     at org.amble.graphics.HToolbar.doTouch(HToolbar.java:188)     at com.mobstar.undeadpirate.autopaper.PiratePaperPainter.doTouchEvent(PiratePaperPainter.java:245)     at com.mobstar.undeadpirate.autopaper.LiveWallpaperService$WallpaperEngine.onTouchEvent(LiveWallpaperService.java:117)     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:832)     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:45)     at android.os.Handler.dispatchMessage(Handler.java:99)     at android.os.Looper.loop(Looper.java:123)     at android.app.ActivityThread.main(ActivityThread.java:4363)     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>My 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""    android:versionCode=""1""    android:versionName=""1.0"" package=""com.nubjub.wallpapertest""&gt;    &lt;application         android:label=""@string/app_name"" android:debuggable=""true"" android:icon=""@drawable/icon""&gt;        &lt;service             android:name=""WallpaperTest""            android:enabled=""true""            android:icon=""@drawable/icon""            android:label=""@string/app_name""            android:permission=""android.permission.BIND_WALLPAPER""&gt;            &lt;intent-filter android:priority=""1"" &gt;                &lt;action android:name=""android.service.wallpaper.WallpaperService"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data                 android:name=""android.service.wallpaper""                 android:resource=""@xml/wallpaper"" /&gt;        &lt;/service&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre>","62709","","","","","2010-07-30 11:36:20","Can I open a URL from android Live Wallpaper?","<android><url><wallpaper>","1","0","1","",""
"3055984","1","","","2010-06-16 18:11:34","0","2355","<p>I'm using the code shown below to get an updated value for location every time a button is clicked. When my activity is resumed I get an update every second, so that when I call getLastKnownLocation I expect to have a location that have been updated in the last second.</p><p>Is that the correct way to do that?</p><p>I would expect the onLocationChanged event to be triggered every time I execute a 'geo fix' command (or max after 1s since I request update every 1s), but it's only triggered the first time. Why?</p><p>Any help/suggestion welcome!</p><p>Thanks</p><pre><code>package org.digitalfarm.atable;...public class Atable extends Activity {    private Button mSearchButton;    private TextView mytext;    private LocationManager locationManager;        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);           setContentView(R.layout.main);        mSearchButton = (Button)this.findViewById(R.id.button);        mytext = (TextView) findViewById(R.id.dude);        locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        final Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);                       mSearchButton.setOnClickListener(new OnClickListener() {          @Override          public void onClick(View v) {                  String provider = locationManager.getBestProvider(criteria, true);                  Location location = locationManager.getLastKnownLocation(provider);                       }        });    }     //Start a location listener    LocationListener onLocationChange=new LocationListener() {        public void onLocationChanged(Location loc) {            //sets and displays the lat/long when a location is provided            String latlong = ""Lat: "" + loc.getLatitude() + "" Long: "" + loc.getLongitude();               mytext.setText(latlong);        }        public void onProviderDisabled(String provider) {        // required for interface, not used        }        public void onProviderEnabled(String provider) {        // required for interface, not used        }        public void onStatusChanged(String provider, int status,        Bundle extras) {        // required for interface, not used        }    };    //pauses listener while app is inactive    @Override    public void onPause() {        super.onPause();        locationManager.removeUpdates(onLocationChange);    }    //reactivates listener when app is resumed    @Override    public void onResume() {        super.onResume();        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,1000,100.0f,onLocationChange);    }}</code></pre>","326849","","","","","2010-06-16 18:48:51","Getting an updated location in Android","<android><location>","1","0","","",""
"3056095","1","3057697","","2010-06-16 18:26:52","1","1583","<p>In my application, I am trying to pass a serializable object through an intent to another activity. The intent is not entirely created by me, it is created and passed through a search suggestion. </p><p>In the content provider for the search suggestion, the object is created and placed in the <code>SUGGEST_COLUMN_INTENT_EXTRA_DATA</code> column of the MatrixCursor. However, when in the receiving activity I call <code>getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY)</code>, the returned object is of type String and I cannot cast it into the original object class. </p><p>I tried making a parcelable wrapper for my object that calls <code>out.writeSerializable(...)</code> and use that instead but the same thing happened. </p><p>The string that is returned is like a generic Object toString(), i.e. <code>com.foo.yak.MyAwesomeClass@4350058</code>, so I'm assuming that toString() is being called somewhere where I have no control. </p><p>Hopefully I'm just missing something simple. Thanks for the help!</p><p>Edit: Some of my code</p><p>This is in the content provider that acts as the search authority:</p><pre><code>//These are the search suggestion columns private static final String[] COLUMNS = {    ""_id"",  // mandatory column    SearchManager.SUGGEST_COLUMN_TEXT_1,    SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA};//This places the serializable or parcelable object (and other info) into the search suggestionprivate Cursor getSuggestions(String query, String[] projection) {    List&lt;Widget&gt; widgets = WidgetLoader.getMatches(query);    MatrixCursor cursor = new MatrixCursor(COLUMNS);    for (Widget w : widgets) {        cursor.addRow(new Object[] {                           w.id                           w.name                           w.data //This is the MyAwesomeClass object I'm trying to pass                           });    }    return cursor;}</code></pre><p>This is in the activity that receives the search suggestion:</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Object extra = getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY);     //extra.getClass() returns String, when it should return MyAwesomeClass, so this next line throws a ClassCastException and causes a crash    MyAwesomeClass mac = (MyAwesomeClass)extra;    ... }</code></pre>","304742","","1228","","2013-06-07 15:23:51","2013-06-07 15:23:51","Serializable object in intent returning as String","<android><search><android-intent><serializable>","1","0","","",""
"3056230","1","","","2010-06-16 18:45:22","1","392","<p>Is there any way to make it so my app can set itself as the default Home app without any user interaction?</p>","368542","","","","","2010-06-16 18:48:45","Changing default Home application in android without user interaction","<android>","1","0","","",""
"3056232","1","","","2010-06-16 18:46:01","21","15882","<p>I want to make a shape with with left-top rounded corner and left-bottom rounded corner:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;solid android:color=""#555555""/&gt;        &lt;stroke android:width=""3dp""            android:color=""#555555""            /&gt;    &lt;padding android:left=""1dp""             android:top=""1dp""             android:right=""1dp""             android:bottom=""1dp""             /&gt;     &lt;corners android:bottomRightRadius=""0dp"" android:bottomLeftRadius=""2dp""      android:topLeftRadius=""2dp"" android:topRightRadius=""0dp""/&gt; &lt;/shape&gt;</code></pre><p>But the shape above didn't give me what I want. It gives me a rectangle without any rounded corners.</p><p>Can anyone help?</p><p>Thanks.</p>","256239","","256239","","2010-06-16 19:21:31","2013-05-08 14:35:23","How to make a shape with left-top round rounded corner and left-bottom rounded corner?","<android>","4","0","11","",""
"3056383","1","","","2010-06-16 19:09:02","3","1900","<p>I have a camera by Cisco and like to stream it's video stream to my android phone.It's coded in MPEG4 so there should be no problem, but it's not working anymore (it worked with another camera a few weeks ago). Any idea what I might try ? I don't know what's wrong here.</p><pre><code>I/ActivityManager(   79): Starting activity: Intent { cmp=com.Projekt1/.CameraView }I/System.out(18792): SDPURL - rtsp://10.42.0.103:554/live.sdpI/NotificationService(   79): enqueueToast pkg=com.Projekt1 callback=android.app.ITransientNotification$Stub$Proxy@44a22218 duration=0D/MediaPlayer(18792): Couldn't open file on client side, trying server sideI/ActivityManager(   79): Displayed activity com.Projekt1/.CameraView: 270 ms (total 270 ms)W/MediaPlayer(18792): info/warning (1, 26)I/MediaPlayer(18792): Info (1,26)E/PlayerDriver(   52): Command PLAYER_INIT completed with an error or info PVMFFailureE/MediaPlayer(18792): error (1, -1)E/MediaPlayer(18792): Error (1,-1)D/VideoView(18792): Error: 1,-1W/PlayerDriver(   52): PVMFInfoErrorHandlingComplete</code></pre>","331556","","","","","2011-03-08 09:43:44","Android RTSP - MediaPlayer init failure / PVMFFailure","<android><media-player><rtsp>","1","0","","",""
"3056455","1","4533190","","2010-06-16 19:19:13","0","2403","<p>I'd like to recognize arrival of new MMS msg (after it is downloaded to inbox). I am doing the following:</p><pre><code>private MMSContentObserver mMmsCO;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    h = new Handler();    mMmsCO = new MMSContentObserver(h);    getContentResolver().registerContentObserver (Uri.parse(""content://mms""), true, mMmsCO);}</code></pre><p>where</p><pre><code>    private class MMSContentObserver extends ContentObserver {    public MMSContentObserver(Handler h) {        super(h);    }                   @Override    public boolean deliverSelfNotifications() {        return false;    }    @Override    public void onChange(boolean selfChange) {        super.onChange(selfChange);    }}</code></pre><p>However, onChange is not getting called. What am I missing?Thanks in advance.</p>","367677","","","","","2010-12-26 08:20:35","Detecting new MMS (Android 2.1)","<android><mms>","1","2","","",""
"3056650","1","3217595","","2010-06-16 19:46:53","1","545","<p>Does anyone have any idea (numbers?) that shows the difference between reading image files from a SQLite database vs reading it directly from the file system in a SD card. Which one is faster ? </p>","306346","","135152","","2011-06-28 14:49:19","2011-06-28 14:49:19","Reading images (jpeg) files from SD Cards Vs SQLite DB","<android><performance><sqlite><filesystems>","2","0","","",""
"3056690","1","","","2010-06-16 19:52:24","0","944","<p>I'm developing an application that shows a path on a map, determined by a KML file.  Specifically, in the MapActivity that is starting the map:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    Uri uri = Uri.parse(""geo:0,0?q=http://urltokml"");    Intent mapIntent = new Intent(Intent.ACTION_VIEW, uri);    mapIntent.setData(uri);    startActivity(Intent.createChooser(mapIntent, kmlFile));    finish();}</code></pre><p>The map loads fine and after a few seconds the path described by the KML shows up.  The problem is, when I press the ""Back"" button, it does not return to the previous screen but instead just hides the KML overlay.  If the ""Back"" button is pressed again, it will return to the previous screen.</p><p>Any ideas of how to solve this?</p>","333799","","","","","2010-06-16 20:07:16","Android Maps Back Button","<java><android><google-maps><kml>","2","0","1","",""
"3057031","1","","","2010-06-16 20:44:58","3","1505","<p>My app has a single entry activity called ""Main"". In ""Main"" I call one of three   other activities A, B, or C (based on a preference) and then immediately exit/finish    ""Main"" so that only A, B, or C are active.</p><p>I also have a permanent notification in the notification bar    that users can pull down (at any time) to conveniently restart my App (calls intent    with ""Main"" component).</p><p>The problem is that if my app is already running and users pull down the notification   and restart, I get A or B or C running on top of the previous activity (also A, or   B, or C). How can I avoid this (i.e. reuse the activity on top of the stack)?</p><p>I've tried Intent.FLAG_ACTIVITY_* and nothing seems to work. I've tried launchModes<br>   in the Manifest and it also didn't seem to work. Any ideas? Any help appreciated....jh</p>","225405","","","","","2010-06-16 22:12:03","How To Reuse Activity on Top of Stack","<android>","1","0","1","",""
"3057623","1","3057641","","2010-06-16 22:27:45","1","510","<p>I'm making a scrolling game on Android and am having a hard time figuring out why the code below does not decrement past 0.</p><p>Objects start at the end of the screen (so the x position is equal to the width of the screen) the objects move accross the screen by decrementing their x positions. I want them to scroll off of the screen, but when the x position hits 0, the objects just stay at 0, they do not move into the negatives.</p><p>Here is my code to move objects on the screen</p><pre><code>private void incrementPositions(long delta) {    float incrementor = (delta / 1000F) * Globals.MAP_SECTION_SPEED;            for(Map.Entry&lt;Integer, HashMap&lt;Integer, MapSection&gt;&gt; column : scrollingMap.entrySet()) {        for(Map.Entry&lt;Integer, MapSection&gt; row : column.getValue().entrySet()) {            MapSection section = row.getValue();            section.x -= incrementor;                   }    }       }</code></pre><p>It works ok if I change</p><pre><code>section.x -= incrementor;</code></pre><p>to</p><pre><code>section.x = section.x - (int)incrementor;</code></pre><p>but if i do that the scrolling doesn't appear as smooth.</p>","67510","","","","","2010-06-16 22:32:07","Problem decrementing in Java with '-='","<java><android>","1","7","","",""
"3057685","1","","","2010-06-16 22:39:51","0","556","<p>I'm currently developing an app in android that is accessing wifi values, that is, the application needs to scan for all access point and their specific signal strengths.I know that I have to extend the class <code>BroadcastReceiver</code> overwriting the method <code>BroadcastReceiver.onReceive(Context context, Intent intent)</code> which is called when the values are ready.<br>Perhaps there exist solutions provided by the android system itself but I'm relatively new to android so I could need some help. <br>The problem I encountered is that I got one class (an activity, thus controlled by the user) that needs this scan results for two different things (first to save the values in a database or second, to use them for further calculations but not both at one moment!)So how to design the callback system in order to ""transport"" the scan results from <code>onReceive(Context context, Intent intent)</code> to the operation intended by the user?My first solution was to define enums for each use case (save or use for calculations) which wlan-interested classes have to submit when querying for the values. But that would force the <code>BroadcastReceiver</code>extending class to save the current enum and use it as a parameter in the callback function of the querying class (this querying class needs to know what it asked for when getting backcalled)<br>But that seems to me kind of dirty ;) <br>So anyone a good idea for this?</p>","347471","","6391","","2010-06-17 01:54:22","2010-06-17 01:54:22","Design problem with callback functions in android","<android><design><callback><broadcast><broadcastreceiver>","1","0","","",""
"3057728","1","","","2010-06-16 22:50:40","0","1978","<p>So, I know that this has been done with a few Android apps before, but I cannot for the life of me figure out how, since it's not currently possible through the API.</p><p>How does one adjust the playback rate of a sound played through MediaPlayer; either with or without adjusting the pitch is fine for now, though the latter is definitely preferred.  If someone can point me in the direction of an open source app that I can use as guidance, that would also be fine.</p><p>Thanks in advance.</p>","368752","","","","","2011-04-01 19:43:29","Audio Playback Rate in Android","<android><audio><playback>","1","1","","",""
"3057771","1","3057965","","2010-06-16 22:57:39","13","16747","<p>I'm developing an application that will most likely be preinstalled on devices. It will be also available on Google Play. Is there a way to update those instances that are not downloaded through Google Play, since Google Play won't notify users about an update. </p><p>I was thinking about, as <a href=""http://stackoverflow.com/questions/1660740/android-application-update-how-to"">suggested here</a>, trying to contact my site periodically, and when update is available, download it. </p><p>Is there a way to do this update automatically, or even silently, so that user doesn't have to do anything (like running the package manually). Or, when my site shows update is available, to offer users an update through Google Play, even though it's not installed through Market (EDIT: This Google play option would be preferable, because than users wouldn't have to check ""allow install of non-Market sources"".)</p>","347891","","94363","","2013-01-21 18:18:24","2014-03-01 11:35:27","Is there a way to automatically update application on Android?","<android><updates>","6","4","26","",""
"3058164","1","3732377","","2010-06-17 00:36:39","12","33386","<p>I have an ImageView that is twice the height of a normale screen ( 960 dip). I would like to scroll it nicely up and down on the screen. The bottom of the screen should contain a button. I have tried various combinations of ScrollView and Imageviews without any success. I have also thinkered with the :isScrollContainer attribute without results. Anyone knows how to do this?Cheers,Luca</p>","368819","","156771","","2011-08-15 21:01:55","2012-08-30 20:17:25","Android: Scrolling an Imageview","<android><scrolling><imageview>","6","1","31","",""
"3058357","1","3058637","","2010-06-17 01:36:03","0","455","<p>I am working on an app that has multiple tabs. In the first tab the user will enter values. In the other tabs it will display the results of calculations based off of those values.</p><p>Like in tab 1, the user will enter ""3"" and ""2"".In tab 2, the program will add them and display ""5"".</p><p>In tab 2 how do I access the ints ""3"" and ""2""?</p><p>Thanks</p>","368845","","","","","2010-06-17 03:16:31","How do I get parameters between activities?","<android>","1","1","","",""
"3058422","1","","","2010-06-17 01:56:07","27","1218","<p>What are some things you wish you had known about Android when you first started out or before you published your first app on the market? I am nearing completion on my first and am starting to make sure I have crossed my proverbial Ts and dotted the Is</p>","40714","","114066","","2010-06-17 13:54:54","2014-01-07 09:13:00","Android gotchas and lessons learned","<android>","4","0","24","2014-01-07 12:40:34",""
"3058448","1","12378461","","2010-06-17 02:02:33","2","697","<p>I'm using a default Eclipse project file generated for my Android application, and I want to keep it in a targets/ directory (along with other eclipse-specific files) in order to better organize my project structure (I also plan on adding a target for NetBeans).</p><p>Simple question, I suppose: Is this possible?</p>","118398","","","","","2012-09-11 21:52:14","Place Eclipse Project File in Separate Directory","<android><eclipse><project><target>","2","2","","",""
"3058499","1","","","2010-06-17 02:15:55","-2","756","<p>How to add rotation effect when change mode portrait to landscape ? </p><p>I want to make it smooth .</p><p>Please help me.</p><p>I want to sleep. T-T</p>","368841","","","","","2010-09-13 17:44:04","How to add rotation effect when portrait to landscape","<android>","2","1","","",""
"3058622","1","","","2010-06-17 03:05:13","2","1184","<p>I have been working with Android contacts. I am able to show them, update butwhen I want to delete any, it is not deleted completely. In Contactsapplication is shown as (Unknown) without any data. Here is my example:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();ops.add(ContentProviderOperation.newDelete(Data.CONTENT_URI).withSelection(Data.CONTACT_ID + ""=?"", new String[]{selectedid}).build());getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);</code></pre><p>Should I do anything else to delete contact entirely?It seems that these code delete info in table ContactsContract.Data but it does not delete element related in table ContactsContract.Contacts or ContactsContract.RawContacts.how can i do to delete an contact completely?</p><p>============================================================================</p><p>also, i tried deprecated method. It dose work, but i do not want to do so. Here is the sample code:</p><pre><code>ContentResolver contentResolver = m_cContent.getContentResolver();contentResolver.delete(People.CONTENT_URI, People.NAME + ""=?"", new String[] { SelectedName });</code></pre><p>and if i modify this code to </p><pre><code>ContentResolver contentResolver = m_cContent.getContentResolver();contentResolver.delete(ContactsContract.Contacts, ContactsContract.Contacts._ID + ""=?"", new String[] { Selectedid });</code></pre><p>It has no effect. </p><p>Does it mean that one can only delete a contact by name instead of by its id?What on earth can i do to delete contact?</p><p>Thanks,Enchor</p>","368868","","427763","","2012-07-02 22:20:17","2012-07-02 22:20:17","Failure to delete entire contact using ContentProviderOperation","<android><contacts>","0","3","","",""
"3058681","1","3058712","","2010-06-17 03:24:11","4","650","<p>When you first use a name from the android XML namespace, you have to say where to find it, with an attribute in XML like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""</code></pre><p>However, that URL is a 404 - nothing found there.</p><p>The android: namespace is actually included under the locally-installed SDK.</p><p>So what's going on here?   Why do I need to include a dead URL?   Why doesn't the build system pick it up from the SDK like all the other libraries?</p><p>Thanks, just looking for the back story on this.</p><p>Peter</p>","253661","","","","","2010-06-17 03:37:25","what's the story with the android XML namespace?","<xml><android><url><namespaces>","1","0","","",""
"3058831","1","","","2010-06-17 04:18:48","0","281","<p>I have no working code at all, but I will post my method of displaying images I need to bobble.</p><pre><code>public void onDraw(Canvas can){    can.drawBitmap(bobbleHead , xpos, ypos, p);}</code></pre><p>I have declared <code>xpos</code> and <code>ypos</code>.</p>","337865","","1287593","","2012-10-09 01:03:06","2012-10-09 01:03:06","Creating a Bobblehead Effect in Android","<java><android><physics><gravity>","1","0","","",""
"3058842","1","","","2010-06-17 04:21:01","3","2048","<p>I have a pretty big library I developed specifically for use in my Android Application.  However business logic itself has no dependency on Android.  To preserve that, I used Commons Logging throughout this library and it's respective JUnit tests (which I run in Eclipse).</p><p>However now that I am starting to integrate it into an Activity which I launch on Android, I am unable to get my logging to work.  In Eclipse/JUnit, I had simply pulled in log4j's jar file as well as a log4j.properties file.  This doesn't seem to work when deploying to a device.  After struggling with attempting to get that to work for several hours, I gave up and tried replacing all my commons logging stuff with android.util.Log.  Now I can log on the device.. but all JUnit tests are broken.  When any JUnit tries to log using android.util.Log, it throws a RuntimeException 'Stub!'.</p><p>I would prefer to revert to my commons logging approach.. if anyone can help with that.. otherwise.. what can I do to get my JUnit test cases running using 'android.util.Log'?</p><p>Many thanks in advance.. I've spent more than a few hours on this and I'd like to move on to writing real code again!</p>","368922","","114066","","2010-06-17 07:55:20","2012-01-31 14:25:23","No Commons Logging in Android?","<android><logging><log4j><apache-commons>","5","0","1","",""
"3058847","1","","","2010-06-17 04:22:15","0","624","<p>I usually make functions used in libraries layer in android.These day, I need to make new function using http protocol.So I found httpclient in Java layer.But I want to know how to open pdp context(2G, 3G) in libraries layerwithout using httpclient in java layer directly.</p><p>Tthanks in advancemark.</p>","368916","","","","","2011-04-27 05:02:51","How to open pdp context(2G, 3G) in the libraries layer without using httpclient directly","<android>","1","0","","",""
"3058868","1","3059294","","2010-06-17 04:27:04","6","8043","<p>I'm trying to make an easy side scrolling game just to learn the ropes of game programming on android. I came up with a solution of how to make it but I don't really think it is the most elegant solution. I wanted to get some different ideas on how to implement my game, as I really have no other solution right now.</p><p>Here is a quick explanation of how it works..</p><p>I basically have blocks or objects fall from the top of the screen. The blocks are defined from a pre-defined string I create using a custom 'map-editor'.</p><p>I create all the blocks at compile time, position them on or off the screen and simply increment their coordinates with each iteration of the gameloop. </p><p>It is actually done a little bit better then that, but that gives a short easy explanation on the basic idea.</p><p>I heard from a few people that instead of incrementing each block position, have the blocks stay there and simply change the viewable area. That makes sense, but I have no idea how to do it.</p><p>Can anyone share some ideas or links on how I can implement something like this? I know my current solution isn't the greatest.</p><p>Thanks!</p>","67510","","","","","2010-06-17 06:15:45","Java side scrolling game on android","<java><android>","3","0","5","",""
"3058909","1","3064342","","2010-06-17 04:40:06","31","40986","<p>I have an android app that needs to check if there's already a record in the database, and if not, process some things and eventually insert it, and simply read the data from the database if the data does exist. I'm using a subclass of SQLiteOpenHelper to create and get a rewritable instance of SQLiteDatabase, which I thought automatically took care of creating the table if it didn't already exist (since the code to do that is in the onCreate(...) method). </p><p>However, when the table does NOT yet exist, and the first method ran upon the SQLiteDatabase object I have is a call to query(...), my logcat shows an error of ""I/Database(26434): sqlite returned: error code = 1, msg = no such table: appdata"", and sure enough, the appdata table isn't being created.</p><p>Any ideas on why? </p><p>I'm looking for either a method to test if the table exists (because if it doesn't, the data's certainly not in it, and I don't need to read it until I write to it, which seems to create the table properly), or a way to make sure that it gets created, and is just empty, in time for that first call to query(...)</p><p><strong>EDIT</strong><br/>This was posted after the two answers below:<br/>I think I may have found the problem. I for some reason decided that a different SQLiteOpenHelper was supposed to be created for each table, even though both access the same database file. I think refactoring that code to only use one OpenHelper, and creating both tables inside it's onCreate may work better...</p>","368918","","368918","","2010-06-17 15:11:21","2013-03-08 16:28:13","How does one check if a table exists in an Android SQLite database?","<android><sqlite>","8","0","7","",""
"3058919","1","3059271","","2010-06-17 04:43:02","9","11085","<p>I am new to the android platform. Now I am working on TTS(Text to Speech). I enter the text in a TextArea and would like it to be converted to speech when i click the speak button. Can anyone help me out?</p>","366916","","2067199","","2013-04-24 05:28:35","2014-03-08 05:24:36","Text to speech(TTS)-Android","<android><text-to-speech>","3","0","6","",""
"3058922","1","3119644","","2010-06-17 04:44:06","3","8708","<p>I was just wondering if Android had built in code so that I could select multiple images in a gallery-view and then have those images exported as filenames in a string array(ex /sdcard/~f1.jpg, /sdcard/~f2.jpg,...).</p><p>Again any help is appreciated! Just to let you guys know, the gallery I'm using works fine (for one image) -- as in it exports the filename correctly. Just need to know if there is an easy way to select multiples and export them. Thanks again!</p>","354247","","354247","","2012-08-04 22:50:55","2014-02-13 09:08:04","Select Multiple Images Using GalleryView","<android><gui><android-gallery>","2","0","1","",""
"3059155","1","3619450","","2010-06-17 05:42:13","84","42686","<p>I'm interested in incorporating the Android UI pattern called ""Quick Action"". Basically, it's a context menu that doesn't cover up the data that is being acted on. I'd like to implement this but I cannot find some sample code or an API to help me out.</p><p>Note this UI pattern is discussed in the YouTube video, <a href=""http://www.youtube.com/watch?v=M1ZBjlCRfz0#t=15m20s"" rel=""nofollow"">http://www.youtube.com/watch?v=M1ZBjlCRfz0#t=15m20s</a>.</p><p>Does anyone have an implementation of this or know what Google's standard is for adding this to an application?</p><p><img src=""http://i48.tinypic.com/33m6hwo.png"" /></p>","42005","","1576010","","2014-04-05 06:19:20","2014-04-05 06:19:20","Android Quick Actions UI Pattern","<android><android-ui>","5","4","82","",""
"3059304","1","","","2010-06-17 06:14:30","0","151","<p>My question is: can i have 2 repositories without losing my original repository. </p><p>Lets say i want the the eclair source repository </p><blockquote>  <p>repo init -u  git://android.git.kernel.org/platform/manifest.git  -b eclair</p></blockquote><p>(already synced and working)</p><p>and i would also like to sync with cyanogens repository </p><blockquote>  <p>repo init -u  git://github.com/cyanogen/android.git  -b eclair</p></blockquote><p>All i basically want to do is have both repositories without altering or messing up the original.</p><p>thanks.</p>","364133","","9167","","2010-06-17 06:26:46","2010-06-18 15:05:30","Setting up 2 or more Repositories?","<android><git><repository>","2","0","","",""
"3059322","1","3253508","","2010-06-17 06:18:17","8","2734","<p>My application integrates with <a href=""http://en.wikipedia.org/wiki/AdMob"" rel=""nofollow"">AdMob</a> ads. When I change the orientation it should fit the screen depending on orientation. In portrait mode it is working fine, but when I changed to landscape  mode the ad size I am getting in portrait mode is the same size of the ad displayed in landscape mode.</p><p>I am adding the following in layout page.</p><pre><code>&lt;com.admob.android.ads.AdView   android:id=""@+id/ad""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   myapp:backgroundColor=""#000000""   myapp:primaryTextColor=""#FFFFFF""   myapp:secondaryTextColor=""#CCCCCC""/&gt;</code></pre>","1746300","","63550","","2010-07-31 19:17:33","2010-07-31 19:17:33","AdMob orientation problem in Android","<android><layout><admob>","2","1","2","",""
"3059406","1","3059428","","2010-06-17 06:36:15","6","507","<p>I started developing android applications. And am testing with the android emulator. Do I really need android phone before releasing it for public usage?</p>","368999","","114066","","2010-06-17 10:26:24","2010-06-18 11:49:46","Do I need a Android phone for creating android applications?","<android><development-environment>","6","0","","",""
"3059630","1","","","2010-06-17 07:20:16","2","2408","<p>For example if a have two directories <code>/sdcard/Music/Music-1</code> and <code>/sdcard/Music/Music-2</code> how can I construct a URI to get the files in <code>Music-1</code> dir for example. I can use <code>MediaStore.Audio.Media.EXTERNAL_CONTENT_URI</code> to get the content of all external storage but how to do the trick only for specific dir. </p>","184601","","311941","","2011-04-27 11:57:44","2012-12-02 19:53:52","Construct MediaStore URI for specific folder","<android>","3","0","1","",""
"3059764","1","3069696","","2010-06-17 07:46:21","1","402","<p>I want to work dynamically therefore I want to bind text views dynamically I think an example would explain me the best </p><p>assuming I want to bind 7 image views i can do it like this :</p><pre><code> Country = (EditText)findViewById(R.id.CountryEditText); City = (EditText)findViewById(R.id.CityEditText); LivinigCreture = (EditText)findViewById(R.id.LivingCretureE); Nature =(EditText)findViewById(R.id.NatureEditText); Inanimate = (EditText)findViewById(R.id.InanimateEditText); KnowenPersonality = (EditText)findViewById(R.id.KnowenPersonalityEditText); Occupation = (EditText)findViewById(R.id.OccupationEditText);</code></pre><p>but lets change 7 with NUMOFFILEDS as a final where i want to do the previous ?</p><pre><code>   myImages = new ImageView [7];   for (int i = 0; i&lt;7;i++,????)   myImages[i] = (ImageView)findViewById(R.id.initialImageView01);</code></pre><p>notice : in my R file the R.id.initialImageView01 - R.id.initialImageView07 are not generate in a cont gap between them therefore I don't know how to make this architecture possible .and if there's a way can someone show me an example how to work dynmiclly (like using jsp on android combined way or something  ?)</p><p>id its possiable to do so constant  times is it possible to build an the same xml constant num of times like jsp does<br>thank u pep:) </p>","368440","","368440","","2010-06-17 08:15:47","2010-06-18 12:58:55","android dynamical binding","<android><android-widget>","1","0","0","",""
"3059807","1","3060228","","2010-06-17 07:51:52","2","134","<p>I'm currently making a SMS Application in Android, the following is a code snippet from Inbox Listactivity, I have requested a cursor from the contentresolver and used a custom adapter to add custom views into the list.</p><p>Now, in the custom view i've got 2 TextViews (<em>tvFullBody</em>,*tvBody*)...<em>tvFullBody</em> contains the Full SMS Text while <em>tvBody</em> contains a short preview (35 characters)The <em>tvFullBody</em> Visibility is by default set to GONE. </p><p>My idea is, when the user clicks on a list item, the <em>tvBody</em> should dissappear(GONE) and the <em>tvFullBody</em> should become visible (VISIBLE). On Clicking again, it should revert back to its original state.</p><pre><code>//isExpanded is a BitSet of the size = no of list items...keeps track of which items are expanded and which are not@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    if(isExpanded.get(position))    {        v.findViewById(R.id.tvFullBody).setVisibility(View.GONE);        v.findViewById(R.id.tvBody).setVisibility(View.VISIBLE);    }else    {        v.findViewById(R.id.tvFullBody).setVisibility(View.VISIBLE);        v.findViewById(R.id.tvBody).setVisibility(View.GONE);    }    isExpanded.flip(position);    super.onListItemClick(l, v, position, id);}</code></pre><p>The Code works as it is supposed to :) except for an undesired sideeffect....Every 10th (or so) List Item also gets ""toggled"".eg. If i Expand the 1st, then the 11th, 21th list items are also expanded...Although they remain off screen, but on scrolling you get to see the undesired ""expansion"".</p><p>By my novice analysis, i'm guessing Listview keeps track of 10 list items that are currently visible, upon scrolling, it ""reuses"" those same variables, which is causing this problem...(i didn't check the android source code yet.)I'd be gratefull for any suggestion, on how i should tackle this! :)I'm open to alternative methods aswell....Thanks in advance! :)</p>","216517","","216517","","2010-06-17 07:58:57","2010-06-17 09:08:26","Unknown ListView Behavior","<android><listactivity>","1","0","","",""
"3059897","1","","","2010-06-17 08:06:28","1","273","<p>can I genrate java code instead using xml code ? lets say i want to do this xml code in a loop :</p><pre><code>&lt;TableRow  android:id=""@+id/LivingCreture"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt; &lt;TextView android:text=""LivingCreture""  android:gravity=""left"" android:id=""@+id/LivingCretureT"" android:layout_width=""45dp"" android:layout_height=""45dp""&gt;&lt;/TextView&gt; &lt;EditText android:text="" "" android:gravity=""center"" android:id=""@+id/LivingCretureE""  android:layout_width=""45dp"" android:layout_height=""45dp""&gt;&lt;/EditText&gt;&lt;ImageView android:id=""@+id/ImageView03"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;       </code></pre><p></p><p>is it possiable ?</p>","368440","","286595","","2010-06-17 08:09:54","2010-06-17 08:17:56","android R.layout concept","<android><layout><android-widget>","1","2","0","",""
"3060025","1","3061189","","2010-06-17 08:26:35","0","61","<p>is there a syntax to work dynamical in android xml files ?</p>","368440","","","","","2010-06-17 11:23:27","jsp look alike syntax in android does it exist?","<android><jsp>","1","0","","2012-08-24 12:19:28",""
"3060032","1","","","2010-06-17 08:27:25","0","534","<p>From ApplicationInfo we can get the name of the package of the apk running. For exampleI have in my code{ApplicationInfo xyz;String abc= xyz.packageName;}</p><p>This would return the name of the package of the application running. But can we find out the name of the class as well from the name of the .apk running or the one we are trying to access. I want to know how to get the name of the main class of the apk at the run time. </p><p>Thanks a lotAviral</p>","369082","","","","","2010-06-17 08:35:38","finding out Class Name","<android>","1","0","","",""
"3060296","1","","","2010-06-17 09:12:06","5","2576","<p>Can Asio or Boost.Asio be used in iPhone or Android development? I'm considering using it so I don't need to use different network libraries for each of my targeted platforms.</p>","300039","","2228070","","2014-01-11 18:26:33","2014-01-11 18:26:33","Will Asio or Boost.Asio work on iPhone or Android?","<android><c++><iphone><boost><boost-asio>","1","4","","",""
"3060360","1","3060410","","2010-06-17 09:24:17","2","1933","<p>I want to set the color of the TextView by the function getcolorss. I tried a lot of different ways but i cant get in it. Please help me i think the solution is easy.</p><pre><code>import java.awt.*;import android.graphics.Color;public class test extends Activity {TextView text1 = (TextView) findViewById(R.id.text1);text1.setTextColor(getcolorss(1));public Color getcolorss(int x){ switch(x) { case 1: return Color.BLUE;  case 2: return Color.RED; } }</code></pre><p>}</p>","369150","","32090","","2010-06-17 12:20:23","2010-06-17 12:20:23","Java - Set Color by switch case function","<java><android><colors>","2","1","","",""
"3060531","1","3060691","","2010-06-17 09:47:41","-5","553","<p>What is the most common approach to storing and retreiving data from text files in Java and more specifically in Android projects?</p>","200145","","200145","","2012-06-10 10:40:26","2012-06-10 10:40:26","Storing and retrieving data from text files in Java","<java><android><data>","1","3","","2012-06-07 15:52:13",""
"3060619","1","3068713","","2010-06-17 09:58:59","10","12930","<p>How can I know the visible size of my activity?  </p><p>I'm trying to get the Activity real size,<br>not the height and width from <code>getHeight()</code> and <code>getWidth()</code>,<br>which gives me the screen full size.</p>","243376","","26428","","2010-07-10 22:06:22","2012-12-02 06:55:40","How to get the visible size on an Activity?","<android><screen><screen-size>","4","4","0","",""
"3060638","1","3062422","","2010-06-17 10:02:24","0","4644","<p>MY issue is that only the last option text is changing on the click of the Next button and the rest remain same. There is some problem with the loop i think.Can someone sort this out please.Thank you</p><p>Here's the db class:</p><pre><code>package com.myapps.quiz;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;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.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;public class DataBaseHelper extends SQLiteOpenHelper{    //The Android's default system path of your application database.    private static String DB_PATH = ""/data/data/com.myapps.quiz/databases/"";    private static String DB_NAME = ""quiz"";    private static String Table_name=""Quiz"";    private SQLiteDatabase myDataBase;     private SQLiteDatabase myData;     private final Context myContext;    /**     * Constructor     * Takes and keeps a reference of the passed context in order to access to the application assets and resources.     * @param context     */    public DataBaseHelper(Context context) {        super(context, DB_NAME, null, 1);        this.myContext = context;    }   /**     * Creates a empty database on the system and rewrites it with your own database.     * */    public void createDataBase() throws IOException{        boolean dbExist = checkDataBase();        if(dbExist){            //do nothing - database already exist        }else{              CopyFiles();        }    }    private void CopyFiles()    {        try        {            InputStream is = myContext.getAssets().open(DB_NAME);            File outfile = new File(DB_PATH,DB_NAME);           outfile.getParentFile().mkdirs();           outfile.createNewFile();          if (is == null)          throw new RuntimeException(""stream is null"");          else          {             FileOutputStream out = new FileOutputStream(outfile);                // BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream(outfile));              byte buf[] = new byte[128];                do {              int numread = is.read(buf);                    if (numread &lt;= 0)                        break;              out.write(buf, 0, numread);               } while (true);                is.close();                out.close();          }           //AssetFileDescriptor af = am.openFd(""world_treasure_hunter_deluxe.apk"");        }        catch (IOException e)        {              throw new RuntimeException(e);         }    }        /**     * Check if the database already exist to avoid re-copying the file each time you open the application.     * @return true if it exists, false if it doesn't     */    private boolean checkDataBase(){        SQLiteDatabase checkDB = null;        try{            String myPath = DB_PATH + DB_NAME;            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }catch(SQLiteException e){        }        if(checkDB != null){            checkDB.close();        }        return checkDB != null ? true : false;    }    /**     * Copies your database from your local assets-folder to the just created empty database in the     * system folder, from where it can be accessed and handled.     * This is done by transfering bytestream.     * */    private void copyDataBase() throws IOException{        //Open your local db as the input stream        InputStream myInput = myContext.getAssets().open(DB_NAME);        // Path to the just created empty db        String outFileName = DB_PATH + DB_NAME;        //Open the empty db as the output stream        OutputStream myOutput = new FileOutputStream(outFileName);        //transfer bytes from the inputfile to the outputfile        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) {    }      /// Get Book content////////      public Cursor getQuiz_Content(int bookId)           {        String myPath = DB_PATH + DB_NAME;        myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);               Cursor cur;        cur=myData.rawQuery(""select quiz_text from Quiz where quiz_id='""+bookId+""'"",null);        cur.moveToFirst();        myData.close();        return cur;      };      //////////////////////////      /// Get Book content////////      public Cursor getQuiz_List()           {        String myPath = DB_PATH + DB_NAME;        myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);               int i;        Cursor cur;        cur=myData.rawQuery(""select quiz_id,quiz_text,correct_answer from quiz"",null);        cur.moveToFirst();        i = cur.getCount();        myData.close();        return cur;      };      //////////////////////////      public Cursor getAns(int quizid)      {          String myPath = DB_PATH + DB_NAME;          myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);          Cursor cur;          cur = myData.rawQuery(""select answers from answer where quiz_id='""+quizid+""'"", null);          cur.moveToFirst();          myData.close();          return cur;      }      public Cursor getAnsList()      {          String myPath = DB_PATH + DB_NAME;          myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);          Cursor cur;          cur = myData.rawQuery(""select answers from answer"", null);          cur.moveToFirst();          myData.close();          return cur;        }      //---updates a title---     /* public boolean UpdateFavourite_Individual(long rowid,String fav)       {        String myPath = DB_PATH + DB_NAME;        myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);          ContentValues args = new ContentValues();          args.put(""bookmark"", fav);          return myData.update(""lyrics"", args,                            ""rowid="" + rowid, null) &gt; 0;                           }*/      //////////////////}</code></pre><p>Here's Quiz.java:</p><pre><code>    package com.myapps.quiz;import java.io.IOException;import android.app.Activity;import android.database.Cursor;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.LinearLayout;import android.widget.RadioButton;import android.widget.RadioGroup;import android.widget.TextView;public class Quiz extends Activity{    /** Called when the activity is first created. */    final DataBaseHelper db = new DataBaseHelper(this);    Cursor c3;    Cursor c4;    int counter=1;      String label;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String options[] = new String[19];     // get reference to radio group in layout        RadioGroup radiogroup = (RadioGroup) findViewById(R.id.rdbGp1);        // layout params to use when adding each radio button        LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(                RadioGroup.LayoutParams.WRAP_CONTENT,                RadioGroup.LayoutParams.WRAP_CONTENT);        c4 = db.getAnsList();        c4.moveToFirst();        for (int k=0;k&lt;19;k++)        {                   options[k]=c4.getString(0);            c4.moveToNext();            Log.e(""value:"", options[k]);        }        for (int i = 0; i &lt; 4; i++){            final RadioButton newRadioButton = new RadioButton(this);            c3 = db.getAns(3);        for (int j=0;j&lt;i;j++)                c3.moveToNext();           label = c3.getString(0);        newRadioButton.setText(label);        newRadioButton.setId(6);        radiogroup.addView(newRadioButton, layoutParams);        //getOptions();        try {            db.createDataBase();            db.openDataBase();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        final Cursor c1;        c1= db.getQuiz_Content(counter);        //rdoAns1.setText(""Lisbon"");        final TextView tvQuizText = (TextView)findViewById(R.id.TextView01);        tvQuizText.setText(c1.getString(0));        Button btnNext = (Button)findViewById(R.id.btnNext);        btnNext.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                    Cursor c2 = null ;                    Cursor c3 =null;                        if (counter &lt; 5)                    {                    counter +=1;                        c2 = db.getQuiz_Content(counter);                    c3 = db.getAns(counter);                    //Log.e(""Row Position after increment:"",Integer.toString(c2.getPosition()));                    tvQuizText.setText(c2.getString(0));                    }                    for (int j=0;j&lt;3;j++)                        {                           c3.moveToNext();                       label = c3.getString(0);                    newRadioButton.setText(label);                    }                    //Log.e(""value:"",Integer.toString(counter));                    //Log.e(""value"",c3.getString(0));            }        });        //c3 = db.getAns(4);     // rdoAns1.setText(c3.getString(0));      //rdoAns2.setText(c3.getString(1));      //rdoAns3.setText(c3.getString(2));      //rdoAns4.setText(c3.getString(3));    }    /** add radio buttons to the group */   // private void getOptions()    {        // get reference to radio group in layout        //RadioGroup radiogroup = (RadioGroup) findViewById(R.id.rdbGp1);        // layout params to use when adding each radio button        //LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(          //      RadioGroup.LayoutParams.WRAP_CONTENT,            //    RadioGroup.LayoutParams.WRAP_CONTENT);        // add 20 radio buttons to the group        //for (int i = 0; i &lt; 4; i++){          //  RadioButton newRadioButton = new RadioButton(this);           // c3 = db.getAns(4);        //for (int j=0;j&lt;i;j++)              //  c3.moveToNext();           // String label = c3.getString(0);        //newRadioButton.setText(label);        //newRadioButton.setId(i);        //radiogroup.addView(newRadioButton, layoutParams);        }    }    }</code></pre><p>Here's my XML layout:</p><pre><code>&lt;AbsoluteLayout android:id=""@+id/AbsoluteLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;                &lt;RadioGroup                android:id=""@+id/rdbGp1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_y=""30dip""                xmlns:android=""http://schemas.android.com/apk/res/android""                android:orientation=""vertical""                &gt;                &lt;/RadioGroup&gt;&lt;Button android:text=""Save"" android:id=""@+id/btnSave"" android:layout_width=""100dip"" android:layout_height=""wrap_content"" android:layout_x=""50dip"" android:layout_y=""250dip""&gt;&lt;/Button&gt;&lt;Button android:text=""Next"" android:id=""@+id/btnNext"" android:layout_width=""100dip"" android:layout_height=""wrap_content"" android:layout_x=""175dip"" android:layout_y=""250dip""&gt;&lt;/Button&gt;&lt;TextView android:layout_x=""17dip"" android:layout_y=""15dip"" android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:text=""@+id/TextView01"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/AbsoluteLayout&gt;</code></pre>","2355649","","","","","2010-06-17 14:16:07","Help needed for android quiz app","<android>","1","6","2","",""
"3060720","1","5698840","","2010-06-17 10:15:12","2","971","<p>I'm trying to enter more than 2000 - 3000 characters in an android TextView</p><p>it does not display anything.</p><p>any one guide is there character limit on android textview or what ?</p>","249991","","249991","","2010-06-17 10:53:55","2011-04-18 05:26:13","Is there any character limit in android textview?","<android><textview>","1","1","1","",""
"3060982","1","3061076","","2010-06-17 10:52:58","3","10495","<p>For my android app development, I am trying to get logcat messages from my real device (when starting an app on it from eclipse) and not just from my emulator.</p><p>Does someone know how to enable such a feature?</p>","317301","","777408","","2012-06-26 11:38:46","2014-03-10 08:28:00","Enable Log messages from real device on Logcat ","<android><eclipse><debugging><logcat>","4","0","","",""
"3061239","1","","","2010-06-17 11:32:07","0","172","<p>I have a listview with radio button. when i click any option and scroll that list view the previous select will cleared.How to do this. The actual problem is when scroll the view on every scorll the view is refreshed, that's why every time the view is refreshed. How to do this I can't get any solution, Plz. Help.</p>","369262","","1471203","","2013-01-09 10:49:19","2013-01-09 10:49:19","issue while place the radio buttons inside the liview in android?","<android>","1","0","","",""
"3061249","1","3062054","","2010-06-17 11:33:49","4","14409","<p>I have an app with a View based on the SurfaceHolder (similar to the Lunar Lander tutorial).The whole GUI is drawn on a canvas, and I want to be able to prompt for user text input at a given moment using a custom layout Dialog, that is then taken care of and rendered to the canvas using standard procedure.</p><p>My problem, however, is that it seems that best practice is to open Dialogs from the Activity.This is no problem either, since i thought i might create a Handler and then pass it to the View that could in turn use it to pass Messages from the GUI thread in the View on to the Activity, that in turn could fetch the input, and send a reply back, etc.</p><p>Problem is, after I call <code>setContentView(R.layout.main)</code>, which contains the whole app, i want to call <code>MyAppView mMyAppView = (MyAppView) findViewById(R.id.app_view_id)</code>.</p><p>This call returns <code>null</code>.</p><p>What is considered to be best practice here? I can't find any good examples and the API is turning up, well, not much.</p><p>I would appreciate any help here.</p>","369264","","1225413","","2013-02-01 05:27:38","2013-02-01 05:27:38","Opening a Dialog with text input from within a View in Android","<android><dialog><user-input>","2","0","9","",""
"3061288","1","","","2010-06-17 11:39:30","2","11381","<p>I need to set alternate color in list view rows but when i do that it removes/ disables the on focus default yellow background</p><p>I tried with backgroundColorrowView.setBackgroundColor(SOME COLOR);</p><p>also with backgrounddrwable.</p><blockquote><pre><code>rowView.setBackgroundColor(R.drawable.view_odd_row_bg);</code></pre></blockquote><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_window_focused=""false""      android:drawable=""@color/odd"" /&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=""@color/highlight"" /&gt;   &lt;item      android:state_focused=""true""      android:state_enabled=""false""      android:drawable=""@color/highlight"" /&gt;   &lt;item      android:state_focused=""true""      android:state_pressed=""true""      android:drawable=""@color/highlight"" /&gt;   &lt;item      android:state_focused=""false""      android:state_pressed=""true""      android:drawable=""@color/highlight"" /&gt;   &lt;item      android:state_focused=""true""      android:drawable=""@color/highlight"" /&gt;&lt;/selector&gt;</code></pre><p>but it wont work.</p><p>is there any way we can set background color and on focus color simultaneously which will work.</p>","288156","","114066","","2010-06-17 12:01:25","2011-07-27 14:03:13","Android ListView with alternate color and on focus color","<android><listview><colors><alternate>","2","0","1","",""
"3061330","1","","","2010-06-17 11:46:38","1","2000","<p>my main.xml look like this:</p><pre><code>&lt;AbsoluteLayout   android:id=""@+id/AbsoluteLayout01""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ImageView      android:layout_height=""wrap_content""      android:layout_x=""247dip""      android:layout_width=""wrap_content""      android:layout_y=""96dip""      android:id=""@+id/Ball""      android:src=""@drawable/ball""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>And Java</p><pre><code>ball = (ImageView) findViewById(R.id.Ball);</code></pre><p>How do I do if I whant to move the ball from x=247dip y=96dip to x=100 and y=100 while my app is running?</p>","301549","","114066","","2010-06-17 11:59:10","2013-06-29 17:19:27","How do I move an image (ImageView) in AbsoluteLayout to X Y [android]","<android><layout>","3","0","","",""
"3061399","1","3062004","","2010-06-17 11:56:33","3","2979","<p>I want to implement RadioButton and EditText inside a row of a ListView. I am using an ArrayAdapter to populate the List. But the problem is that when i am selecting a RadioButton and scroll down the list and scroll up again the Radiobutton which had been selected is unselected. Same with the content of the EditText. The text getting removed when I scroll up.</p>","307585","","114066","","2012-01-27 08:48:00","2012-09-19 14:11:14","How to show a RadioButton and an EditText inside ListView?","<android><android-listview>","2","0","1","",""
"3061467","1","3061854","","2010-06-17 12:07:44","1","1382","<p>I am having a problem where in the started Intent, the findViewById returns null.</p><p>Is there anything special I should know about starting a new intent?</p><p>It goes something like this for me:</p><pre><code>//in the MainList classIntent stuffList = new Intent(this, StuffList.class);</code></pre><p>then in the new Stuff's constructor:</p><pre><code>public class StuffList extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          this.setContentView(R.layout.stuff_list);          ...          this.setListAdapter(new StuffAdapter(this, my_cursor));</code></pre><p>and in the StuffAdapter I do my usual view and data retrieval. </p><p>Note the line where findViewById returns null:</p><pre><code>class ViewWrapper{    View base;    TextView label = null;    ViewWrapper(View base){         this.base = base; }    TextView getLabel(){        if(label == null){            label = (TextView)base.findViewById(R.id.my_label); // returns NULL        }        return label;}      }class StuffAdapter extends CursorAdapter{        StuffAdapter(Context context, Cursor cursor){            super(context, cursor);        }               @Override        public View newView(Context context, Cursor cursor, ViewGroup parent) {               LayoutInflater inflater = getLayoutInflater();               View row = inflater.inflate(R.layout.stuff_list, parent, false);               ViewWrapper wrapper = new ViewWrapper(row);               row.setTag(wrapper);               return(row);        }               @Override        public void bindView(View row, Context context, Cursor cursor) {              ViewWrapper wrapper = (ViewWrapper)row.getTag();              TextView label = wrapper.getLabel(); // also NULL              //this throws exception of course              label.setText(cursor.getString(""title""));                  }}</code></pre><p>The curious thing is that in the class that calls intent (MainList class), I do Exactly the same thing (i list a bunch of objects), and it Works! however when I try to do it in an Intent - it can't seem to find the view by id.</p><p>For completeness I wanted to add that my list resource file is call ""stuff_list.xml"" and my row layout file is called ""stuff_row.xml"".</p>","74865","","74865","","2010-06-17 13:09:11","2010-06-17 13:09:11","findViewById returns null in new Intent","<android>","2","3","","",""
"3061579","1","3061690","","2010-06-17 12:29:31","2","20273","<p>I have defined a List View in xml as below</p><pre><code>     &lt;ListView android:id=""@+id/mylist""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:cacheColorHint=""#00000000""           android:layout_weight=""1""           android:layout_marginTop=""95dip""/&gt;</code></pre><p>And i need to re-define the layout margin upon some result in my programe ,how i can achieve this </p>","286044","","55093","","2011-11-08 10:13:32","2011-11-08 10:13:32","how to change the layout margin for an Android ListView Programmatically","<android><listview>","2","0","","",""
"3061593","1","3061634","","2010-06-17 12:32:26","1","90","<p>friends,</p><p>i have a custom view class</p><pre><code>public class Zoom extends View {        private Drawable image;        private int zoomControler=20;         public Zoom(Context context)        {            super(context);            image=context.getResources().getDrawable(R.drawable.icon);            setFocusable(true);        }        @Override        protected void onDraw(Canvas canvas) {            super.onDraw(canvas);            //TransparentPanel tp = new TransparentPanel(this.getContext());            //Button MyButton = new Button(this.getContext());            //MyButton.setText(""Press me"");            //tp.addView(MyButton);            image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);            image.draw(canvas);        }}</code></pre><p>can i use SetContentView(R.layout.mylayout) in this custom view  to display that design?</p><p>or </p><p>how can i display button with image ondraw method as i have commented the code ?</p><p>any help would be appreciated.</p>","249991","","","","","2010-06-17 12:39:11","can we use layout in Customview?","<android>","1","0","","",""
"3061673","1","3061688","","2010-06-17 12:44:26","1","1341","<p>Can someone explain to me why this AlertDialog crashes?</p><pre><code>package com.clicker;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.DialogInterface.OnClickListener;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;public class Clicker extends Activity{    public int clickerNumber = 0;    private TextView clickerText;    private Button clickerButton;    private Button resetButton;    // Called when the activity is first created.    @SuppressWarnings(""null"")    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Declare each of the layout objects        clickerText = (TextView)findViewById(R.id.clickerText);        clickerButton = (Button)findViewById(R.id.clickerButton);        resetButton = (Button)findViewById(R.id.resetButton);        clickerText.setText(""0"");        final AlertDialog.Builder resetQuestion = null;        resetQuestion.setTitle(""Reset?"");        resetQuestion.setMessage(""Are you sure you want to reset the counter?"");        resetQuestion.setPositiveButton(""Yes"", new OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                    clickerNumber = 0;                    clickerText.setText(""0"");            }        });        resetQuestion.setNegativeButton(""No"", new OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                dialog.dismiss();            }         });        clickerButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                clickerNumber++;                clickerText.setText(Integer.toString(clickerNumber));            }        });        resetButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                resetQuestion.show();            }        });    };};</code></pre>","365807","","","","","2010-06-17 12:51:51","AlertDialog crashes application","<android><alertdialog>","1","0","0","",""
"3061724","1","3062112","","2010-06-17 12:51:24","3","3117","<p>Every time I try to run an Android project from Eclipse with the Android plugin (Run -> Run), the emulator starts up just fine, but the upload fails, and the Console puts out this error message:</p><pre><code>[2010-06-17 08:17:55 - HelloAndroid] Failed to upload HelloAndroid.apk on device 'emulator-5554'[2010-06-17 08:17:55 - HelloAndroid] java.io.IOException: Unable to upload file: Local file doesn't exist.[2010-06-17 08:17:55 - HelloAndroid] Launch canceled!</code></pre><p>It seems as though the apk compilation is failing, but there are no other errors in the Console at all except for a lone warning about the project not specifying an API Level requirement:</p><pre><code>[2010-06-17 08:17:55 - HelloAndroid] WARNING: Application does not specify an API level requirement![2010-06-17 08:17:55 - HelloAndroid] Device API version is 8 (Android 2.2)</code></pre>","325228","","","","","2011-05-25 23:27:34","IOException when running Android projects in Eclipse","<java><android><eclipse><ioexception>","2","0","","",""
"3061868","1","6302596","","2010-06-17 13:08:39","8","6572","<p>I try to integrate an existing database file into my Android project. I follow the instructions on this <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"">blog</a>. They write that I have to add a table <code>android_metadata</code> with a column called locale and put en_US into it. </p><p>I try to figure out what this table is used for. Because my database content is german. Maybe i then should not put en_US into it? Is this required for localisation of the database content or is the table not needed at all?</p>","114066","","","","","2012-09-25 02:53:08","What is the android_metadata table?","<android><sqlite>","3","1","","",""
"3061930","1","3062023","","2010-06-17 13:17:21","15","13789","<p>Is it possible to change the unit for Paint.setTextSize()? As far as I know, it's pixel but I like to set the text size in DIP for multiple screen support.</p><p>Thanks</p>","324021","","82187","","2010-06-17 13:21:11","2014-02-17 16:23:37","How to set unit for Paint.setTextSize()","<java><android><view>","3","0","2","",""
"3062109","1","","","2010-06-17 13:40:46","1","1034","<p>I try to use the MediaRecorder class to record a video but I get an exception : failed to get Camera parameters. Prepare failed. </p><p>Here's my code : </p><pre><code>        camera = Camera.open();        recorder = new MediaRecorder();        recorder.setCamera(camera);        recorder.setVideoSource(VideoSource.CAMERA);        recorder.setPreviewDisplay(m_holder.getSurface());        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);        recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);        recorder.setMaxDuration(10000);        recorder.setOutputFile(file.getPath());        recorder.prepare();</code></pre><p>Any idea ?</p>","164460","","213269","","2011-08-12 09:10:54","2011-08-16 09:40:49","android mediarecorder exception","<android><video><mediarecorder>","2","0","","",""
"3062202","1","3062228","","2010-06-17 13:52:27","9","18718","<p>I started to develop android apps a few days ago, but I'm stuck with this problem. </p><p>I'm using Eclipse with ADT and have created the simple <code>Hello World</code> or any of the other sample applications, and when I run the project, Eclipse launches the Android emulator but it shows only the skin, with the screen saying ""ANDROID"" and nothing else, it's unresponsive to anything I do in the code.</p><p>It happens targeting both 2.2 and 1.5 versions, why is this happening and how can I fix this?</p>","369372","","1700486","","2012-12-14 13:50:24","2013-09-07 19:28:44","Android emulator not showing the app- it only shows the skin","<android><eclipse><adt>","2","2","","",""
"3062685","1","3062857","","2010-06-17 14:43:12","5","8118","<p>I`am trying to download and install an apk from some link, </p><p>but for some reason i get an exception.</p><p>I have one method downloadfile() which downloading the file and a call </p><p>to and installFile() method, which supposed to install it in the device.</p><p>some code:</p><pre><code>public void downloadFile(){    String fileName = ""someApplication.apk"";    MsgProxyLogger.debug(TAG, ""TAG:Starting to download"");    try    {        URL u = new URL(                ""http://10.122.233.22/test/someApplication.apk"");        try        {            HttpURLConnection c = (HttpURLConnection) u.openConnection();            try            {                c.setRequestMethod(""GET"");                c.setDoOutput(true);                try                {                    c.connect();                    FileOutputStream f = context.openFileOutput(fileName,                            context.MODE_WORLD_READABLE);                    try                    {                        InputStream in = c.getInputStream();                        byte[] buffer = new byte[1024];                        int len1 = 0;                        int totsize = 0;                        try                        {                            while ((len1 = in.read(buffer)) &gt; 0)                            {                                totsize += len1;                                f.write(buffer, 0, len1);// .write(buffer);                            }                        } catch (IOException e)                        {                            e.printStackTrace();                        }                        f.close();                        MsgProxyLogger.debug(TAG, TAG                                + "":Saved file with name: "" + fileName);                                    InstallFile(fileName);                    } catch (IOException e)                    {                        e.printStackTrace();                    }                } catch (IOException e)                {                    e.printStackTrace();                }            } catch (ProtocolException e)            {                e.printStackTrace();            }        } catch (IOException e)        {            e.printStackTrace();        }    } catch (MalformedURLException e)    {        e.printStackTrace();    }}</code></pre><p>and this is the install file method:</p><pre><code> private void InstallFile(String fileName){    MsgProxyLogger.debug(TAG, TAG + "":Installing file  "" + fileName);    String src = String.format(            ""file:///data/data/com.test/files/"",            fileName);    Uri mPackageURI = Uri.parse(src);    PackageManager pm = context.getPackageManager();    int installFlags = 0;    try    {        PackageInfo pi = pm.getPackageInfo(""com.mirs.agentcore.msgproxy"",                PackageManager.GET_UNINSTALLED_PACKAGES);        if (pi != null)        {            MsgProxyLogger.debug(TAG, TAG + "":replacing  "" + fileName);            installFlags |= PackageManager.REPLACE_EXISTING_PACKAGE;        }    } catch (NameNotFoundException e)    {    }    try    {        // PackageInstallObserver observer = new PackageInstallObserver();        pm.installPackage(mPackageURI);    } catch (SecurityException e)    {                       //!!!!!!!!!!!!!here i get an security exception!!!!!!!!!!!        MsgProxyLogger.debug(TAG, TAG + "":not permission?  "" + fileName);    }</code></pre><p>this is the exception details:""Neither user 10057 nor current process has android.permission.INSTALL_PACKAGES"".</p><p>and i have set in my main app that permission in the manifest.</p><p>anyone has any idea?</p><p>thanks,</p><p>ray.</p>","260511","","1288","","2010-06-17 15:34:28","2010-06-17 15:34:28","Download And Install apk from a link","<android>","2","1","3","",""
"3062774","1","3181938","","2010-06-17 14:52:22","1","742","<p>I am looking for a solution for facebook connect for Android.</p><p>Before I used an open source solution from codecarpet:  <a href=""http://code.google.com/p/fbconnect-android/"" rel=""nofollow"">http://code.google.com/p/fbconnect-android/</a></p><p>but now it doesnt work anymore.</p><p>Now the Official facebook connect for Android is out, but there are about 11 big time issues and it fails almost all the time, so its not a real solution. <a href=""http://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">http://github.com/facebook/facebook-android-sdk/</a></p><p>Any idea how to resolve this issue?</p><p>Thanks</p>","237115","","","","","2010-07-05 20:17:16","facebook connect for android","<android><facebook>","2","4","","",""
"3062946","1","","","2010-06-17 15:13:17","38","6770","<p>Let's say for example that I have some Android app that does X.  The free version has ads or basic features.  I want to have a paid version that removes the ads and adds extra features.</p><p>How can I use the paid app as a ""license key"" to unlock the features in the free app?</p><p>So the user would install the free app, then install the paid app to get the extra features, but they would still run the free app (which would now be unlocked).  What's the best approach to doing this?</p>","396","","321731","","2013-11-05 18:23:11","2013-11-05 18:23:11","How can I use the paid version of my app as a ""key"" to the free version?","<android><key>","7","7","46","",""
"3063108","1","","","2010-06-17 15:28:49","4","4615","<p>How to store username password in device memory.Even after the user closes the application and returns back , he should be able to authenticate his username and password. Right now I am testing in Eclipse... so please help me with some pointers/links which will allow me to test in Eclipse and eventually run on Mobile. </p>","357349","","","","","2011-04-14 10:21:42","how to store username password in device memory","<android>","2","0","","","2010-06-17 15:28:49"
"3063295","1","","","2010-06-17 15:48:51","2","2241","<p>Hello I want to make conversation between android devices. I use BluetoothChat to do this  but it doesn't work I can't read correctly data from another device. </p><p>Conversation is :</p><p>Me: privet</p><p>Device: pDevice: rivet</p><p>Can you help me?</p><p>private class ConnectedThread extends Thread {</p><pre><code>    private final InputStream mmInStream;    private final OutputStream mmOutStream;    public ConnectedThread(BluetoothSocket socket) {        Log.d(TAG, ""create ConnectedThread"");        mmSocket = socket;        //InputStream tmpIn = null;        OutputStream tmpOut = null;        BufferedInputStream tmpIn=null;        int INPUT_BUFFER_SIZE=32;        // Get the BluetoothSocket input and output streams        try {            //tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();            tmpIn = new BufferedInputStream(socket.getInputStream(),INPUT_BUFFER_SIZE);        } catch (IOException e) {            Log.e(TAG, ""temp sockets not created"", e);        }        mmInStream = tmpIn;        mmOutStream = tmpOut;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        byte[] buffer = new byte[1024];        int bytes;        // Keep listening to the InputStream while connected        while (true) {            try {                // Read from the InputStream              bytes = mmInStream.read(buffer);                // Send the obtained bytes to the UI Activity                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }</code></pre>","369511","","","","","2014-04-05 03:10:28","BluetoothChat doesn't work","<android><bluetooth>","1","1","1","",""
"3063304","1","","","2010-06-17 15:50:10","0","3666","<p>is it possibe to disable incoming calls.</p>","369514","","","","","2010-06-17 16:09:13","disable incoming calls","<android>","2","2","","",""
"3063410","1","3065304","","2010-06-17 16:03:19","4","9310","<p>So I have two Activities. The main is called <strong>Main</strong>, and the child one is called <strong>Child</strong>. When a button is clicked in the main activity it triggers the following piece of code:</p><pre><code>Intent i = new Intent(Main.this, Child.class);Main.this.startActivity(i);</code></pre><p>That opens the <strong>Child</strong> activity.</p><p>As soon as I call <strong>finish()</strong> or press the back button within the child activity instead of going back to the main one, the app just closes. Can you give me a hint where the problem might be :(</p><p><em>P.S.</em> By trial and error I found out that if edit <em>AndroidManifest.xml</em> and add </p><pre><code>android:theme=""@android:style/Theme.Dialog""</code></pre><p>within the declaration of <strong>Child</strong> the back button and calling <strong>finish()</strong> behaves as expected: closes the child activity and brings the main into focus. The problem is that when I start typing in an <strong>EditText</strong> the screen starts flickering (rather bizzare). So I can't use it as a dialog. My main activity uses the camera, so that might be making problems. Although when the child activity is started, the <strong>onPause</strong> event is fired and it stops the camera until <strong>onResume</strong> is called.</p><p>Edit:</p><p>So I tried using <strong>startActivityForResult</strong> and added</p><pre><code>Toast.makeText(this, ""onPause"", Toast.LENGTH_SHORT).show();</code></pre><p>to the <strong>onPause</strong> and a similar one to the <strong>onResume</strong> methods. When the Child returns <strong>onResume</strong> doesn't get triggered. I even overrided <strong>onActivityResult</strong> and even that doesn't get triggered. :( So bizarre...</p><p><strong>I think I found the problem but I can't solve it myself</strong></p><p>When the <strong>Child</strong> activity is activated, <strong>onStop</strong> and immediately after that <strong>onDestroy</strong> are invoked within the <strong>Main</strong> activity. But why?!?</p>","369531","","369531","","2010-06-18 09:50:02","2010-06-19 16:23:29","Child Activity in Android","<java><android><activity><android-manifest>","3","6","2","",""
"3063648","1","3063724","","2010-06-17 16:38:56","2","524","<p>I know iPhone development fairly well. From personal experience, how hard would it be for me to get into Android? I am concerned less about code than I am about distribution of my software, given the fragmentation of the Android OS on compatible devices. </p><p>EDIT:</p><p>Thanks for all the great input so far. I just have one more point to clarify. How does app distribution work in terms of carriers, app stores and how do I get my money from sales? Does Google or the Carrier handle it? Do I need to process credit cards myself?</p><p>EDIT2:</p><p>One last question. Does the Android App store tell the developer how many times the app was downloaded?</p>","224988","","760306","","2012-05-03 13:05:15","2012-05-03 13:05:15","How does Android development compare to iOS development for an experience iOS dev?","<android><iphone><comparison>","9","0","","",""
"3063892","1","","","2010-06-17 17:10:04","3","590","<p>on Android, there's a Canvas class that represents a drawing surface. It has a clipping rect. Question - are the rect's right and bottom borders inclusive or exclusive? In other words - if the rect is (0, 0)-(10, 10), will the Canvas allow drawing in pixels at coordinates 10?</p>","219159","","","","","2014-02-18 06:33:01","Canvas clipping rect - right/bottom edge inclusive?","<android><canvas>","1","6","","",""
"3063976","1","","","2010-06-17 17:23:38","0","388","<p>HiAnybody knows how to write upside down text of edit text in Android</p><p>thanks</p><p>/minhaz</p>","366489","","","","","2013-07-20 18:42:25","Text Invertion Android","<android><text><inversion>","2","0","","",""
"3064292","1","9018964","","2010-06-17 18:04:20","0","1537","<p>In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.</p><p>What I want to do is show the default bubble the maps App shows when you tap on a POI.</p><p>Is there a way to do this? Am I missing something here?</p>","190330","","","","","2012-01-26 13:41:13","Android Map Itemized Overlay","<android><google-maps><overlay>","2","1","","",""
"3064346","1","3065277","","2010-06-17 18:11:17","3","1267","<p>Trying to activate the LED to use as a flashlight on the HTC EVO 4G. I know this is possible because there at least a couple applications in the Android Market (LED Desire Light, Tesla) that do this.</p><p>I've tried using <code>setFlashlightEnabled</code>, which I'm told works on the Droid. On my Nexus One with Froyo I used <code>setFlashMode</code> to set the mode to <code>FLASH_MODE_TORCH</code>, which works fine. But I can't figure out how to get the same effect on the HTC EVO 4G.</p>","288425","","","","","2010-06-17 20:13:39","How do you activate the LED light on an HTC EVO 4G?","<android><htc>","1","0","1","",""
"3064406","1","3070846","","2010-06-17 18:20:14","5","5412","<p>the Java sources for the Android framework are available at source.android.com. Can I download and feed them to Eclipse so that I can step into framework methods while debugging? Better yet, does anyone know of an Eclipse plug-in that would get them from Android Git automatically as needed?</p><p>EDIT: during debugging, I can step through the framework code; I can see local variables by their declared names, and line numbers as well. It seems like the debug info is already there - only the source file is missing. While I can open it in parallel and watch the execution unfold, the question of version matching remains. Of many versions of the class file in Git, how do I pick one that matches whatever is running on the device (or emulator)? This is more of a Git navigation question - how do I pick up the very version of the file that went into Android release, say, 2.2?</p><p>EDIT much later: now sources come prepackaged with Android SDK. This question is somewhat obsolete.</p>","219159","","219159","","2013-03-28 00:19:20","2013-03-28 00:19:20","Android framework source level debugging in Eclipse","<android><eclipse>","1","0","3","",""
"3064437","1","3064553","","2010-06-17 18:25:55","7","1905","<p>Would it be there noticeable speed improvement if I would create local references to needed view elements (e.g. <code>EditText</code> or <code>Button</code>) in my activity (in <code>onCreate()</code>) and use them for accessing needed elements or it does not much matter if I always use <code>findViewById()</code> when I need to access some particular element?</p>","283037","","","","","2013-03-31 15:59:38","findViewById vs local reference in Activity","<android><performance>","3","1","1","",""
"3064439","1","","","2010-06-17 18:26:07","2","520","<p>I have Two activities One splash screen, Player screen. </p><p>When user clicks on my app icon first splash screen is displayed and then player screen</p><p>When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again.</p><p>can any one please help me out how to do any one of below</p><p>1) I need to close current running activity and reload application.or2) I need to resume to the player screen directly.</p><p>Please give me an example or reference to follow, Im beginner in android programing</p><p>Thanks In advance</p>","341443","","","","","2011-01-26 03:57:57","how to Set already running activity, when user clicks on app icon on home screen","<android><android-emulator><android-widget>","3","3","0","",""
"3064499","1","3066026","","2010-06-17 18:35:31","3","1194","<p>I am using static Arrays and HashMaps to store some values in my AppWidgetProvider class. But they are becoming null when the process dies, so the widget does not work anymore. Are there any alternatives to using static members to store data for an AppWidgetProvider in Android?</p>","369678","","","","","2011-04-30 22:35:05","Alternatives to static variables in Android","<java><android><static><android-widget>","3","2","","",""
"3064637","1","3064753","","2010-06-17 18:51:02","1","3392","<p>Is it possible to create a dynamic context menu in android?</p><p>What I mean is, for example, if I have a list of items, that can be in two states: ""read"" and ""unread"". I want to be able to bring up a context menu with an option of ""Mark as Read"" for the unread items, and ""Mark as Unread"" for the read items.</p><p>So clicking on:</p><pre><code>&gt; read&gt; unread &lt;-- click&gt; read </code></pre><p>will show context menu ""Mark as Read"" resulting in:</p><pre><code>&gt; read&gt; read&gt; read   &lt;-- click</code></pre><p>will show the menu ""Mark as Unread"".</p><p>Is there some function that allows me to customize the creation of the context menu, just before it is displayed?</p><p>Any help is welcome!</p>","74865","","","","","2012-06-18 18:08:37","Dynamic Context Menu options","<android>","2","0","1","",""
"3064776","1","3065037","","2010-06-17 19:06:47","0","1035","<p>I am not sure what the proper term is, but I am trying to add a ""TitleBar"" to the top of one of the windows in my App. Much like the Contacts App, I have several Tabs along the top of the screen. When you select an item from the list, it loads the next Activity, but that Activity no longer has the Tabs at the top of the screen. </p><p>I don't know if it is called a TitleBar or what. The Contacts App has this TitleBar along the top of the screen when you select a person from the list of Contacts.</p><p>I am trying to mimick the Grey Bar that says ""George Washington""</p><p><img src=""http://www.chicagohotblog.com/images/gw.bmp"" alt=""alt text""></p>","300129","","","","","2010-06-17 19:39:25","Android TitleBar / NavBar?","<android><titlebar>","1","0","","",""
"3064793","1","3065059","","2010-06-17 19:09:18","0","1480","<p>I am trying to import projects into the Eclipse IDE from a book ""Beginning Android 2"" but when I choose the root directory the ""Finish"" button is still grayed out. I've tried importing the project from scratch with no success, and I've also tried to create a template project with the same name and everything and then importing into that (Import existing projects into workspace) but it always says ""No projects are found to import"". </p><p>The contents of the folder are: <code>Res</code> folder, <code>src</code> folder with <code>.java</code> file, the manifest, build, and <code>default.properties</code> files.</p>","369706","","62576","","2012-05-25 18:52:15","2013-03-01 20:43:13","Unable to import example projects in eclipse from book","<android><eclipse>","2","2","","",""
"3065219","1","3191817","","2010-06-17 20:06:08","6","1846","<p>I'm trying to write an Android 2.2 app that will find installed apps that can be moved to the SD card.  The permission to do this is encoded in the <a href=""http://developer.android.com/guide/topics/manifest/manifest-intro.html"">AndroidManifest.xml</a> file as the root-level attribute ""<a href=""http://developer.android.com/guide/appendix/install-location.html"">android:installLocation</a>"".  <a href=""http://developer.android.com/reference/android/content/pm/PackageInfo.html"">PackageInfo</a> seems to have an interface to everything but this attribute.  I can open the installed apk and extract the AndroidManifest.xml file, but it seems to be in some binary encoding format, which some random internet people have written a decoder for, but that seems like an awful lot of work.</p><p>Is there an interface that I'm missing?</p>","147202","","","","","2012-02-08 23:25:53","Accessing android:installLocation manifest attribute","<xml><android><android-manifest>","3","0","3","",""
"3065243","1","","","2010-06-17 20:08:45","0","192","<p>i m new to android....i m stuck at a point would really appreciate if ne1 cn help pls..i m developing an pp which has grid of colored rectangles..made  changing the background of textView..dere are 3 buttons which cause the backgroundcolor to change according to some algo..n 2 textview which show the current sts f game</p><p>now the problem is i hv button example (one f the three buttons) which chnges</p><pre><code>example.setOnClickListener(new Button.OnClickListener() {     public void onClick(View v) {          status_val.setText(""true board-example working"");         level_1_true();      }});</code></pre><p>level_1_true();-sets background color f rectanglesdis above code results in ""activity not responding""..ie onclick listner does not change the view.someone suggested me runonuithread..but i cnt get how n what to do..how do i change the d view of screen by clicking the button?</p>","369750","","742660","","2014-02-17 03:43:45","2014-02-17 03:43:45","Android onClick(View v) not working?","<android>","0","2","","",""
"3065292","1","3065990","","2010-06-17 20:15:17","0","695","<p>I have an app that puts the date in the status bar, but in order to make it look decent, I have to use two notifications.  This causes it to use two expanded notifications when you pull down the status bar.  Is there any way to get rid of one of the expanded views(or both of them)?</p>","274365","","","","","2010-06-17 22:02:49","android expanded notification view","<android><notifications>","1","0","","",""
"3065465","1","","","2010-06-17 20:39:53","1","1353","<p>Is there a way to change the sync settings of a Gmail account programmatically with an Android app?  For instance, I'd like to enable/disable syncing of a Gmail account from my app, without the user having to do anything.</p><p>I took a look at <a href=""http://developer.android.com/reference/android/accounts/AccountManager.html"" rel=""nofollow""><code>AccountManager</code></a>, but that doesn't seem to be the right place to look.</p>","135180","","","","","2011-02-25 15:51:01","How to change sync settings through Android API?","<android>","2","0","1","",""
"3065505","1","","","2010-06-17 20:46:33","1","1129","<p>I have a layout in xml that, when the user clicks a ""next"" button I inflate, populate with the next screen's data, and create and set the onclicklistener for an imagebutton in the new view.  I then add this view to my main ViewFlipper and call showNext() on it.  The view slides into place and the button is there but there are problems:</p><ol><li><p>The button image is a square but is transparent so the only viewable part is a circle, except when the second view gets shown you see a gray square button with a circle on top of it.  </p></li><li><p>The click event never fires.  The gray square changes color to indicate a click (not the circular portion that is what should be seen and if it were working correctly would have its color changed) but the onClick event in the listener never executes.</p></li></ol><p>This works perfectly the first time I do this procedure (inflate, create onClickListener, add to ViewFlipper- although the first time I don't call showNext obviously).</p><p>Anyone seen anything like this? It's driving me crazy</p>","369773","","102703","","2010-06-18 23:50:25","2011-12-15 07:47:00","Button click event not firing in second view of a viewflipper","<android><events><viewflipper>","2","0","","",""
"3065610","1","","","2010-06-17 21:00:32","0","1329","<p>I'm trying to make a ScrollView with a list of numbers in it that the user can select from. After the user touches and scrolls, after the finger is lifted I want the scroll to ""snap"" to the item in the middle of the ScrollView and give me the output. My ScrollView contains a vertical linear layout with TextView objects in it. The ScrollView's vertical size is about 60sp.</p><p>I think this would involve the ScrollView.onTouch with a ACTION_UP, but I don't know how to use it. Also, is there a way to get an item's index or value based on a position in the list?</p><p>Thanks!</p>","368845","","","","","2011-02-08 12:13:33","How to change ScrollView's position after touch?","<android>","1","0","1","",""
"3065618","1","","","2010-06-17 21:02:24","0","1711","<p>My users are asking me to make one of my apps into a widget. Is there a way to ask if they want a widget in app and then add the widget to their home screen? I am having a tough time finding this on Google.</p><p>Edit:Is there add a widget option to an existing app or do I have to have to write a whole new program?</p>","282475","","282475","","2010-06-24 02:14:07","2013-07-09 19:26:55","Give my android app a widget option","<android><widget>","2","1","","",""
"3065850","1","3066579","","2010-06-17 21:39:01","4","6936","<p>I want to create an app that contains a Service S and an Activity A. The Service S is responsible for preprocessing, such as preparing the data shown on the UI of the Activity A, before the Activity A gets invoked.</p><p>I want to be able to invoke the Service S from outside the package, say from another Android app's Activity class B, do the preprocessing, and then when the data is ready, invoke Activity A. </p><p>My questions are:</p><ol><li>What is the best way to share data between the Service S and Activity A?</li><li>How can the external activity B communicate with the Service S to determine if it has completed with all its preprocessing, and the Activity A is ready to be invoked?</li></ol><p>ThanksChris</p>","334802","","","","","2010-06-18 00:52:41","Android - Service and Activity interaction","<android><service><activity>","1","1","3","",""
"3065963","1","3065976","","2010-06-17 21:57:51","0","1187","<p>I have been trying to build only the ""/libcore"" directory of the Android platform.  When I try <code>mmm libcore</code> I end up with the following output:</p><pre><code>============================================PLATFORM_VERSION_CODENAME=RELPLATFORM_VERSION=2.1-update1TARGET_PRODUCT=genericTARGET_BUILD_VARIANT=engTARGET_SIMULATOR=falseTARGET_BUILD_TYPE=releaseTARGET_ARCH=armHOST_ARCH=x86HOST_OS=linuxHOST_BUILD_TYPE=releaseBUILD_ID=ECLAIR============================================make: Entering directory `/home/chris/android/platform'target Prebuilt:  (out/target/product/generic/system/etc/security/cacerts.bks)host Prebuilt: run-core-tests-on-ri (out/host/linux-x86/obj/EXECUTABLES/run-core-tests-on-ri_intermediates/run-core-tests-on-ri)target Prebuilt: run-core-tests (out/target/product/generic/obj/EXECUTABLES/run-core-tests_intermediates/run-core-tests)Copy: out/target/product/generic/system/etc/apns-conf.xmlCopying: out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jarCopying: out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes-full-debug.jar/bin/bash: jar: command not foundmake: *** [out/host/common/core-tests.jar] Error 127make: *** Deleting file `out/host/common/core-tests.jar'make: Leaving directory `/home/chris/android/platform'</code></pre><p>Does anyone have any suggestions on what Error 127 is, or another method I can go about building ""libcore"" without having to build the entire platform again?</p><p>Thanks,Chris</p>","175280","","","","","2010-06-17 22:00:43","Building a specific piece of Android platform?","<android><build><make><compilation>","1","0","","",""
"3066006","1","","","2010-06-17 22:05:12","2","1487","<p>I implemented a WebView in my android app displaying a web form. One of the fields ask for the user to manually enter his phone number (in case the phone does not allow extracting of phone number).</p><p>Right now, the qwerty soft keyboard pops up when user selects the field. Is there a way I can have the numberpad display instead?</p><p>(Remember I'm using HTML and not native controls)</p><p>Thanks!Shaun  </p>","369829","","","","","2012-12-17 18:15:03","Android Webview : Display numberpad?","<android><keyboard><webview>","2","0","","",""
"3066024","1","3066115","","2010-06-17 22:08:22","4","795","<p>I have a list management appliaction that stores its data in a many-to-many relationship database.</p><p>I.E. A note can be in any number of lists, and a list can have any number of notes.</p><p>I also can export this data to and XML file and import it in another instance of my app for sharing lists between users.  However, this is based on a legacy system where the list to note relationship was one-to-many (ideal for XML).</p><p>Now a note that is in multiple lists is esentially split into two identical rows in the DB and all relation between them is lost.</p><p><strong>Question: How can I represent this many-to-many relationship in a simple, standard file format? (Preferably XML to maintain backwards compatibility)</strong></p>","131871","","","","","2010-06-18 19:07:37","How to represent a Many-To-Many relationship in XML or other simple file format?","<java><xml><android><database><database-design>","4","0","2","",""
"3066301","1","","","2010-06-17 23:20:54","0","471","<p>I'm getting ready to release my first application the marketplace. It's being written for devices running Android 1.5 and above, however there aren't any specific folders for the three different screen densities (I think those came around in 1.6). Should I make these folders myself? Where should I put image resources for the different densities and what should I put in my Manifest?? </p>","339036","","","","","2010-06-18 02:14:32","Android Screen Density Compatibility on 1.5","<android>","2","0","","",""
"3066318","1","3066660","","2010-06-17 23:25:16","3","1513","<p>I'm writing a Service, a Content Provider, and multiple apps. The Service writes new data to the Content Provider's SQLite database every 5 minutes or so plus at user input, and is intended to run pretty much forever in the background. The app, when running, will display data pulled from the Content Provider, and will be refreshed whenever the Service puts more data into the Content Provider's database.</p><p>Given that the Service only inserts into the database once every five minutes, when is the right time to call SQLiteOpenHelper's <code>getWritableDatabase()</code> / <code>getReadableDatabase()</code>? Is it on the <code>onCreate()</code> of the Content Provider, or should I run it every time there is an <code>insert()</code> and close it at the end of <code>insert()</code>? The data being inserted every 5 minutes will contain multiple inserts.</p>","321554","","321554","","2010-06-18 21:07:34","2010-06-18 21:07:34","How often to run getWritableDatabase() and getReadableDatabase()?","<android><database><sqlite>","1","0","1","",""
"3066507","1","","","2010-06-18 00:31:09","3","3206","<p>I have a quick question about the usage of ActivityManager.</p><p>I've looked at the source code and read through it and as expectedly, it gave info about how it worked.</p><p>However, I am interested in at what place(s) in Android OS uses this activity to actually manage activities.</p><p>For example, when an activity starts, Android will keep track of activities using the ActivityManager's method and I want to find out where that happens.</p>","247804","","213269","","2010-12-06 13:55:17","2010-12-06 13:55:17","Usage of ActivityManager","<android><activity>","1","0","1","",""
"3066867","1","","","2010-06-18 02:23:24","0","420","<p>I'm writing a Android.mk to make a APK-A. and APK-A would use other classes defined in APK-B. I wonder that how should I wrote the Android.mk to include APK-B. Which tag should I use? Thanks.</p>","369924","","","","","2010-06-18 23:48:06","include an APK in Android.mk","<android>","1","0","","",""
"3066892","1","3073723","","2010-06-18 02:34:23","1","1890","<p>I've been trying to import shape xml to customized View. like this, </p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle""&gt;&lt;solid   android:color=""#f0600000""/&gt;&lt;stroke  android:width=""10dp""   android:color=""#00FF00""/&gt;&lt;corners   android:radius=""15dp"" /&gt;&lt;padding   android:left=""10dp""  android:top=""10dp""  android:right=""10dp""  android:bottom=""10dp""/&gt;</code></pre><p></p><p>and in my customized view code, I try to call it from my external resources</p><pre><code>    private void initTestView(){    Resources res = this.getResources();    mDrawable = (ShapeDrawable)res.getDrawable(R.drawable.recshape);}</code></pre><p>but if this ruuning on emulator, it called error because mDrawable should be ""GradidentDrawable"". but what doesn't make it sense is the upper xml code is only for ""ShapeDrawable"". I don't understand why it happen, does anybody know why it happen? </p>","369929","","","","","2010-08-07 12:18:11","How to import shape resource(xml) to code?","<xml><android>","1","2","","",""
"3066967","1","3067332","","2010-06-18 03:03:23","3","890","<p>I'm trying to learn how to build apps for Android.</p><p>The first simple app, which will become a component of a bigger app I hope to build, is to have a button on the screen where, when tapped, it adds something new to the view.</p><p>For instance:</p><p>Imagine a layout that only has a button:</p><pre><code>[Create!]</code></pre><p>When that button is pressed, the view gets a new row added to it:</p><pre><code>[Create!]A Something!</code></pre><p>Upon subsequent presses, more rows are added</p><pre><code>[Create!]A Something!A Something!</code></pre><p>And so on.</p><p>I've made a LinearLayout and placed the button in it, and have attached a click listener to it.  That all works great.  What I can't figure out is how to get a handle on the LinearLayout in the onClick function with which I'll addView() the new TextView that says ""A Something!""</p><p>Am I on the right track? What basic thing am I missing? Thanks!</p>","283952","","283952","","2010-06-18 23:33:45","2010-06-18 23:33:45","New to Android: Dynamically changing views","<android><dynamic><android-linearlayout>","2","0","","",""
"3067017","1","3067084","","2010-06-18 03:22:27","2","1797","<pre><code>public void MoveMyButton (int x) //where the button suppose to move to{TranslateAnimation anim=new TranslateAnimation(this.getLeft() ,x, this.getTop() ,20));anim.setFillAfter(true);anim.setDuration(1000);this.setAnimation(anim);anim.start();}</code></pre><ul><li>button's x at start is 1.</li><li>I call the method to move it to 100, and it goes from 1 to 100</li><li>I call it to go to 200, and it goes from 1 to 200, instead of 100 to 200</li></ul><p>Is there any way to make the animation to save the location of the button as it animates it?Thanks</p><p><em><strong></em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__</strong><em>UPDATE</em><strong><em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>_</strong>Please correct me if i am wrong.An animation set is to combine multiple animations, so move from position 1 to position 2and then from position 2 to position 3.The problem is that my animations are not predictable. My application is a multiplayer game which 10 players play together.Every time a player gets a turn the timer button should move toward that player. then when another player gets a turn the button suppose to move from the previous player to the new player.So I have to show animations when i receive messages from the server. example:- Move the button from current position to player 1- Move the button from player 1 to player 3- Move the button from player 3 to player 9- ........... etc</p><p>As you can see i can't predict where the button is suppose to go.I hope i explained well enough (The youtube link i posted above is exactly what i am trying to achieve)Any new suggestions?</p><p>Thanks for the replies</p>","242769","","242769","","2010-06-18 16:34:58","2010-06-18 16:34:58","Android ==> Simple 2d Animation?","<android><animation><2d>","1","0","","",""
"3067196","1","","","2010-06-18 04:22:40","1","10524","<p>I have a thread running in my program When Mouse-down Event generates I want to put that thread in wait() and in Mouse-up I want to Notify that thread </p><p>But when I tried to do this It is giving me error like ""Object not locked by Thread"" so can anyone help me how to solve this..</p>","356158","","","","","2010-09-18 15:49:34","how to put a thread in Wait in Android","<android>","3","1","1","",""
"3067206","1","","","2010-06-18 04:28:22","0","2185","<p>I create a program to add check boxes dynamically.But i cant scroll down.I add the code here ,Pls HELP......</p><pre><code>package dyntodo.pack;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.CheckBox;import android.widget.EditText;import android.widget.LinearLayout;import android.widget.Button;import android.widget.TextView;public class dynact extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);TextView tv = (TextView)findViewById(R.id.textview);final EditText task = (EditText)findViewById(R.id.task);Button add = (Button)findViewById(R.id.add);add.setOnClickListener(new View.OnClickListener() {public void onClick(View v){addTask(task.getText().toString());}});}public void addTask(String task){LinearLayout layout = (LinearLayout) findViewById(R.id.layout);final CheckBox chk = new CheckBox(this); //Creating checkbox objects…..chk.setText(task);layout.addView(chk);chk.setOnClickListener(new View.OnClickListener() {public void onClick(View v){chk.setVisibility(5);}});}}</code></pre>","369972","","114664","","2010-06-18 05:08:03","2010-11-12 13:11:10","how to scroll in android?","<android>","1","2","","",""
"3067266","1","","","2010-06-18 04:52:21","1","890","<p>How could I set x,y coordination of an ImageView ?</p><p>The layout of application is AbsoluteLayout, I tried to call layout() but seems not working (the ImageView stay at 0,0) and setPadding() seems not a feasible solution because I need to do collision detection later.</p><p>Sorry, new to Android, thanks in advance.</p>","366048","","","","","2010-06-18 04:52:21","How to position a view in AbsoluteLayout dynamically (Android)","<android><imageview>","0","2","0","",""
"3067314","1","","","2010-06-18 05:06:13","4","820","<p>I'm trying to figure out the best way to make an image rotate alongwith a user's finger dragging it left or right.  I want to try andmatch the rate a user's finger is moving with the rate the image isrotating.</p><p>I've got the basic setup for my application going, with the menus andwhatnot I want to have, and that's all running great on the emulator,I'm just not sure how to approach this part. </p><p>I can code all the logic I need for my app, I'm just not doing to welldesigning the UI, I have a picture in mind, I've actually made acouple mock images of it, I just can't figure out how to get it goingin Android, and any help would be appreciated. </p>","369990","","369990","","2010-06-18 05:26:37","2012-04-22 19:59:37","How to create a gesture controlled rotating image for a UI","<android><rotation><imageview>","1","0","1","",""
"3067324","1","3067521","","2010-06-18 05:10:32","5","8798","<p>In Android, if I want to do some background work, what is the difference between</p><p>Creating a Service to do the work, and having the Activity start the ServiceVS.Creating a standard java class to do the work, and having the Activity create an object of the class and invoke methods, to do the work in separate thread.</p>","321927","","114066","","2010-06-18 10:43:03","2010-06-18 10:43:03","Android - Run in background - Service vs. standard java class","<android><class><service><background><activity>","3","1","3","",""
"3067343","1","3067613","","2010-06-18 05:18:02","18","65489","<p>I have just started learning to write apps for android using Eclipse. Where can I find free source code that I can use during my learning experience? Thanks.</p>","369997","","23897","","2010-06-18 05:26:10","2012-12-30 17:00:28","Source code for android apps?","<android><source-code><app-store>","6","0","19","2012-12-30 21:29:35",""
"3067388","1","3069078","","2010-06-18 05:29:19","3","2502","<p>I wanted to change the divider height dynamically. From whatever I have searched it seems that it is possible through setting divider as part of each item in listview. But I am not very clear with this. </p><p>So, can someone be more specific as how can one make the divider as part of item in listview?</p>","261566","","114066","","2012-01-27 08:50:09","2012-01-27 08:50:09","How to make divider part of each item in listview in android?","<android><android-listview><divider>","3","0","2","",""
"3067586","1","3068355","","2010-06-18 06:22:35","30","60587","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2661536/how-to-programatically-take-a-screenshot-on-android"">How to programatically take a screenshot on Android?</a>  </p></blockquote><p>How to capture the android device screen content and make  an image file using the snapshot data? Which API should I use or where could I find related resources?</p><p>BTW:not camera snapshot, but device screen</p>","355393","","176873","","2012-12-01 20:34:45","2014-02-20 11:13:58","How to capture the android device screen content? ","<android><screen-capture>","8","0","29","2012-10-24 12:00:22",""
"3067627","1","3238197","","2010-06-18 06:31:25","2","5510","<p>Hi I am new to android Programming and NDK.Yet i am not clear with working in NDK.I just downloaded android ndk r4.If i want to develop appln using NDK,and i refered </p><p><a href=""http://marakana.com/forums/android/android_examples/49.html"" rel=""nofollow"">http://marakana.com/forums/android/android_examples/49.html</a></p><p>for reference,But still not clear how to create the header file and implementation,I did nt have any previuos exp in c language.And they asked for run javah tool to create the JNI header file.</p><p>I dont know how to use javah tool,but i found it in java bin directory and i tried using cmd</p><pre><code>javah -jni com.sarmal.MyLib</code></pre><p>It shows as  <code>class file not found</code>,</p><p>Hello Guys,when i list the folders and files,it is shown,this is the <a href=""http://www.filefactory.com/file/b21c48d/n/Error.JPG"" rel=""nofollow"">Image</a></p><p>What could be the problem?</p><p>What's requirement of Cygwin here?</p>","138030","","138030","","2010-06-18 07:57:45","2012-11-03 03:36:27","How To create a Simple NDK Program in Android NDK","<android><android-ndk>","3","2","2","",""
"3067695","1","3067895","","2010-06-18 06:50:20","0","311","<p>I'm in the middle of developing android app using google map. My question is - how to store coordinates with google map and display them later on? I know how to use canvas, how to draw it etc. but I want to store those coordinates with google map - just like with the google maps feature on internet. When I log in I can see points I've put on the map straight away. Can someone please tell me how to do that? There must be a way. Any answers greatly appreciated! </p>","359656","","","","","2010-06-18 07:37:04","Is there a ways to make google store coordinates in the android map?","<android><google-maps>","1","0","1","",""
"3067780","1","","","2010-06-18 07:12:39","2","1236","<p>I've an android application that needs to navigate to a google service webpage (say calendar). Because I already have a Auth Token (using Android Accounts manager), I want to skip user being redirected to web login. Would auto-login be possible using authtoken ? If yes, what is the exact Url with params</p>","345766","","","","","2010-08-26 11:17:23","Google Auth using Token","<android><google-account>","2","1","","",""
"3067792","1","3073593","","2010-06-18 07:14:49","3","5012","<p>I want to develop an android application, but i dont want to use the default controls(buttons, checkboxes, radio buttons, etc.,). Is there any way to customize those controls to make it appear nicer. If so some tutorial or guide will help me a lot. Thanks....</p>","209523","","","","","2012-05-22 16:43:45","Guide for custom UI controls","<android>","1","1","6","",""
"3067827","1","3067927","","2010-06-18 07:21:47","3","6748","<p>I'm trying to download a website source code and display it in a textbox but I seem to get an error and can't figure it out :s</p><pre><code> public void getHtml() throws ClientProtocolException, IOException{    HttpClient httpClient = new DefaultHttpClient();    HttpContext localContext = new BasicHttpContext();    HttpGet httpGet = new HttpGet(""http://www.spartanjava.com"");    HttpResponse response = httpClient.execute(httpGet, localContext);    String result = """";    BufferedReader reader = new BufferedReader(        new InputStreamReader(          response.getEntity().getContent()        )      );    String line = null;    while ((line = reader.readLine()) != null){      result += line + ""\n"";      Toast.makeText(activity.this, line.toString(), Toast.LENGTH_LONG).show();    }}</code></pre><p>how come this doesn't work and throw an IOException?</p>","219554","","219554","","2010-06-18 07:23:30","2012-01-23 14:33:03","download html source android?","<java><android>","1","2","2","",""
"3067856","1","3073529","","2010-06-18 07:27:22","1","870","<p>Can someone please tell me how to change tab by clicking on element INSIDE the tab? I already tried it with global data. The code looks like this:</p><pre><code>public class Tabs extends TabActivity {int tabNumber = 0;private TabHost tabHost;int returnedTabNumber = 0;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Resources res = getResources(); // Resource object to get Drawables    tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Resusable TabSpec for each tab    Intent intent;  // Reusable Intent for each tab    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, Tribocracy.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""map"").setIndicator(""Map"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, Areas.class);    spec = tabHost.newTabSpec(""areas"").setIndicator(""Areas"",                      res.getDrawable(R.drawable.ic_tab_albums))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, Settings.class);    spec = tabHost.newTabSpec(""settings"").setIndicator(""Settings"",                      res.getDrawable(R.drawable.ic_tab_albums))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(tabNumber);}protected void onResume() {    super.onResume();            GlobalData globalData = ((GlobalData)getApplicationContext());            returnedTabNumber = globalData.getTabNumber();            tabHost.setCurrentTab(returnedTabNumber);   }</code></pre><p>}</p><p>The global adapter looks like this:</p><pre><code>public class GlobalData extends Application {//----------------------------------------------------      private int Point1;   //define the vars here      private int Point2;   //define the vars here      private int Point3;   //define the vars here      private int Point4;   //define the vars here      private int Point5;   //define the vars here      private int Point6;   //define the vars here      private int tabNumber;      public int getTabNumber() //getter of the value      {             return tabNumber;      }      public int setTabNumber(int number)     //setter of the value      {        tabNumber = number;        return tabNumber;      }</code></pre><p>}</p><p>Now when I'm trying to change tab in my ListActivity tab by clicking on one of the items it doesn't do anything and stays on the ListActivity tab. Perhaps I shouldn't use onResume() here. Basically I want to go to first tab when I click on one of the items in the list. Please help!</p>","359656","","359656","","2010-06-18 09:04:50","2010-06-19 13:43:37","Change tab using onClickItem in ListActivity","<android>","1","0","1","",""
"3067902","1","","","2010-06-18 07:39:36","0","93","<p>Hi i have imageview inside layout when i touch the view in emulator its taking more than one events why please tell me what is the problem.</p><p>Thanks</p>","370078","","","","","2010-06-18 15:43:53","android touch issue","<android>","1","1","","",""
"3067915","1","","","2010-06-18 07:43:51","3","494","<p>I would like to show an image in the left cell and text in the right cell of a tablerow.</p><p>My problem is that the text-view is floating outside the visible screen, so I can't see the whole text. The text should break at the visible right end of screen. I've tried to set a <code>maxWidth</code> with a pixel value but that doesn't work.</p><p>Can anyone offer a solution to my problem. Maybe there is a better layout option?</p><p>my layout-definition:</p><pre><code>&lt;TableRow&gt;    &lt;ImageView         android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:tint=""#55ff0000""      android:src=""@drawable/bla""/&gt;     &lt;TextView          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""@string/aboutblaImageText""         android:textSize=""6pt""         android:textColor=""#FFF""        android:maxWidth=""100px""            /&gt;        &lt;/TableRow&gt; </code></pre>","216569","","300863","","2011-11-15 19:55:01","2012-10-31 11:30:32","TableLayout with images and text","<android><tablelayout>","2","3","","",""
"3068180","1","3068521","","2010-06-18 08:36:48","2","2128","<p>I'm wondering how Android's implementation of SQLite handles long Strings. Reading from online documentation on sqlite, it said that strings in sqlite are limited to 1 million characters. My strings are definitely smaller.</p><p>I'm creating a simple RSS application, and after parsing a html document, and extracting text, I'm having problem saving it to a database. I have 2 tables in database, <code>feeds</code> and <code>articles</code>. RSS feeds are correctly saved and retrieved from <code>feeds</code> table, but when saving to the <code>articles</code> table, logcat is saying that it cannot save extracted text to it's column. I don't know if other columns are making problems too, no mention of them in logcat. </p><p>I'm wondering, since text is from an article on web, are signs like ("",',;) creating problems? Is Android automaticaly escaping them, or I have to do that. I'm using a technique for inserting similar to one in notepad tutorial:</p><pre><code>public long insertArticle(long feedid, String title, String link, String description, String h1,tring h2, String h3, String p, String image, long date) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_FEEDID, feedid);    initialValues.put(KEY_TITLE, title);    initialValues.put(KEY_LINK, link);    initialValues.put(KEY_DESCRIPTION, description );    initialValues.put(KEY_H1, h1 );    initialValues.put(KEY_H2, h2);    initialValues.put(KEY_H3, h3);    initialValues.put(KEY_P, p);    initialValues.put(KEY_IMAGE, image);    initialValues.put(KEY_DATE, date);    return mDb.insert(DATABASE_TABLE_ARTICLES,null, initialValues);}</code></pre><p>Column P is for extracted text, h1, h2 and h3 are for headers from a page. Logcat reports only column p to be the problem. The table is created with following statement:</p><pre><code>private static final String DATABASE_CREATE_ARTICLES =    ""create table articles( _id integer primary key autoincrement, feedid integer, title text, link text not null, description text,"" + ""h1 text, h2 text, h3 text, p text, image text, date integer);"";</code></pre>","347891","","114066","","2010-06-18 09:41:17","2013-03-27 14:16:48","How SQLite on Android handles long strings?","<android><sqlite>","1","2","1","",""
"3068275","1","","","2010-06-18 08:50:55","1","665","<p>I have tried to use xpath in Android 1.5, but it does not seem to work?</p><p>Could someone please tell me the best practice on retrieving a value from XML in this case?  If you have any worked through examples, that would be a real help!</p><p>Also, my XML is as a string, so I will need to convert it to be an xml document resource?</p>","370124","","","","","2012-03-26 07:22:53","Get data from XML in Android?","<xml><android><xpath>","1","1","","",""
"3068320","1","3069263","","2010-06-18 08:56:38","27","40381","<p>i'm getting a ""Finalizing a Cursor that has not been deactivated or closed"" error on this piece of code. The code is used to fill a listview. </p><p>Since it's a non-fatal error , there is no crash and all seems to works fine..but i don't like the error. </p><p>If i close the cursor at the end of this code..the listview stay's empty. if i close the cursor in onStop , i get the same error. </p><p>How do i fix this?? </p><pre><code>private void updateList() {         DBAdapter db = new DBAdapter(this);         db.open();             //load all waiting alarm             mCursor=db.getTitles(""state&lt;2"");             setListAdapter(new MyCursorAdapter(this, mCursor));             registerForContextMenu(getListView());             db.close();         } error : E/Cursor  ( 2318): Finalizing a Cursor that has not been deactivated or closed. database = /data/data/xxxxxxxxxxxxxxx.db, table = alerts, query = SELECT _id, alert_id, E/Cursor  ( 2318): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here E/Cursor  ( 2318):      at android.database.sqlite.SQLiteCursor.&lt;init&gt;(SQLiteCursor.java:210) E/Cursor  ( 2318):      at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDr­iver.java: 53) E/Cursor  ( 2318):      at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.j­ava: 1345) E/Cursor  ( 2318):      at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java­: 1229) .... .... </code></pre>","368598","","","","","2012-12-31 17:44:02","Finalizing a Cursor that has not been deactivated or closed non-fatal error","<android><cursor>","9","0","17","",""
"3068378","1","3068858","","2010-06-18 09:05:20","6","3771","<p>i am new for NDK. i want to know what is the benefit of native code in android . By this can we improve our application performance. and main thing exactly when we will use this native code. please clear it. and from where i can get more information............</p>","304961","","21234","","2010-06-18 09:57:35","2011-03-18 04:19:38","Use Of Android NDK","<android><android-ndk>","2","1","2","2013-06-15 16:00:35",""
"3068388","1","3175385","","2010-06-18 09:07:04","2","4277","<p>I've never used git before, but I'd like to download the android source code as I'm getting a crash in the 2.2 emulator and I'd like to see exactly where in the android source code it's crashing (so I can file a better bug report). </p><p><strong>Edit</strong> A decent answer would include instructions on using git to download a specific repository. I'm on windows, but have installed Msysgit.</p>","986","","986","","2010-06-20 11:12:42","2011-12-06 23:23:00","How do you download a specific release of Android source code (e.g. Android 2.2)","<android><git><android-2.2-froyo>","5","0","","",""
"3068571","1","","","2010-06-18 09:38:50","0","1507","<p>I have an android application which starts a new activity</p><pre><code>Intent startAuthorization = new Intent(AndroidActivity, AuthorizeUser.class);       startActivityForResult(startAuthorization,4711);</code></pre><p>When that new activity is done (a ok button is clicked) I call</p><pre><code>setResult(RESULT_OK, returnResult);finish();</code></pre><p>Which works fine. In case the user doesn't click the okay button but uses the return button of the phone (this arrow pointing around to the left) the application has a force close. I have set a breakpoint on the first line of my method onActivityResult but the debugger never stops there. I have no idea where the issue comes up - how can I find out? Is there a method I have to overwrite to handle this back button?</p>","363436","","114066","","2010-06-18 09:42:35","2010-06-18 09:44:55","App crashes on back button / Activities & Intents","<android><android-intent>","1","1","","",""
"3068763","1","3069088","","2010-06-18 10:16:20","0","578","<p>I have a main activity which calls a child one via</p><pre><code>Intent I = new Intent(this, Child.class);startActivityForResult(I, 0);</code></pre><p>But as soon as <strong>Child</strong> becomes visible the main activity gets its <strong>onStop</strong> and immediately after that <strong>onDestroy</strong> method triggered. And as soon as I call <strong>finish()</strong> within the <strong>Child</strong> activity or press the back button, the <strong>Child</strong> activity closes and the home screen shows (instead of the main activity).</p><p>How can I prevent the main activity from being destroyed? :\</p>","369531","","114066","","2010-06-18 10:49:44","2012-12-26 06:58:06","Prevent an Activity from being killed by the OS while starting a child activity","<java><android><activity>","3","1","1","",""
"3068848","1","3068902","","2010-06-18 10:31:50","4","5801","<p>This is my first Android app. I need to email what I have so far to someone for testing.</p><p>How should I do it?</p>","200145","","200145","","2011-11-15 08:06:23","2013-04-12 20:18:53","How can I send an Android app that I'm developing to someone over e-mail?","<android>","6","0","5","",""
"3068916","1","3069024","","2010-06-18 10:42:53","4","505","<p>I have an Android application from which I want to upload some data to a database on my web server. As the MySql java library has a size of about 5 mb, I don't want to include it with the application.So I'll make a HTTP request for a php script and send the data with the URL as parameters. How do I make sure that only I can call this? I don't want people to sniff up the URL and call it outside my application.</p><p>Thanks</p>","236130","","","","","2010-06-18 11:54:47","Protect HTTP request from being called by others","<php><android><http><httprequest>","3","1","1","",""
"3069124","1","","","2010-06-18 11:16:11","16","39364","<p>I have a javascript that plays audio in the browser, using the html5 <code>&lt;audio&gt;</code> tag. It works fine in the iPhone browser, but not in Android. (Testing using a htc desire with android 2.1.) Anyone know why?</p><p>My code:</p><pre><code>   function playHTML5(sound, soundcv){                // sound = url to m4a audio file                // soundcv = div in which the audioplayer should go  var audio = document.createElement('audio');  audio.src = sound;  audio.controls = ""controls"";  if (currentSound != null){   soundcv.replaceChild(audio,currentSound);  } else {   soundcv.appendChild(audio);  }  currentSound = audio; }</code></pre><p>By the way, I am also trying to enlarge the audio button that shows up in the iphone (the default one is quite small), with no luck so far - would be grateful for any ideas!</p>","344871","","187606","","2010-06-18 11:17:29","2013-10-09 16:25:49","Playing html5 audio in android browser","<javascript><iphone><android><audio><html5>","8","1","5","",""
"3069296","1","","","2010-06-18 11:47:03","0","217","<p>I want to be able read all contacts in Android mobile version 1.5.</p><p>Please help me. list readble contant and example please thanks in advance</p>","370253","","134754","","2010-06-18 11:49:27","2010-06-18 12:25:26","How can I read all contacts in Android 1.5 mobile?","<android>","1","1","","",""
"3069393","1","3073475","","2010-06-18 12:05:43","1","894","<p>Is there any way i can make my listactivity (rather listview) highlight the List Item when it is clicked (<em>pressed</em>) upon? (...and remain highlighted)The default behavior, simply highlights the item for a moment, and it gradually fades to black...</p><p>Currently, the highlighting only happens when we use the DPad...</p><p>It'd be ideal if atleast one list item is ""highlighted"" at all times.</p><p>Worst case scenario, i may have to keep track of the ""last clicked item"" (by default the first) and change its background or something...but i was hoping there was an easier way...</p><p>Thanks in advance! :)</p>","216517","","","","","2010-06-19 22:42:47","Change default onListItemClick Behavior of ListView","<android><listview><highlighting><listactivity>","1","2","2","",""
"3069409","1","","","2010-06-18 12:08:15","12","5008","<p>I have multiple activities in my app, every activity calls <code>bindservice</code> and <code>unbindservice</code> to fetch data. In the first activity <code>bindservice</code> and <code>unbindservice</code> work fine. In the second activity (which reuses the same service) bind service method works fine, but <code>unbindservice</code> method gives exception:</p><pre><code>IllegalArgumentException: Service not registered:</code></pre><p>Please help.</p>","370268","","276780","","2013-03-27 15:00:13","2013-09-05 02:19:23","IllegalArgumentException: Service not registered:","<android>","3","2","","",""
"3069412","1","3069509","","2010-06-18 12:08:49","5","489","<p>Can some one explain how the cursor exactly works ? Or the flow of the following part of the code ? I know that this is sub activity and all but I did not understand how Cursor works exactly.</p><pre><code>final Uri data = Uri.parse(""content://contacts/people/"");final Cursor c = managedQuery(data, null, null, null, null);String[] from = new String[] { People.NAME };int[] to = new int[] { R.id.itemTextView };SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.listitemlayout, c, from, to);ListView lv = (ListView) findViewById(R.id.contactListView);lv.setAdapter(adapter);lv.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; parent, View view, int pos, long id) {           c.moveToPosition(pos);          int rowId = c.getInt(c.getColumnIndexOrThrow(""_id""));          Uri outURI = Uri.parse(data.toString() + rowId);          Intent outData = new Intent();          outData.setData(outURI);          setResult(Activity.RESULT_OK, outData);          finish();     }});</code></pre><p>Thanks.</p>","368084","","","","","2010-06-18 12:22:12","Can someone please explain Cursor in android?","<android>","1","0","","",""
"3069586","1","","","2010-06-18 12:34:27","5","3011","<p>I want to invoke the android calculator from within my app.  I don't want to pass anything to it, just provide a quick launch button to it.  Can anyone show me how or point me to an example of how to do this? </p>","158757","","","","","2010-06-18 12:41:04","How to invoke the Android calculator from an app","<android><invoke><calculator>","1","0","4","",""
"3069617","1","3070345","","2010-06-18 12:40:19","5","3303","<p>as the world cup is the main sport event and the Vuvuzelas are the most annoying sound in the world, I had an idea to remove them definitively by reading this new ( <a href=""http://www.popsci.com/diy/article/2010-06/simple-software-can-filter-out-vuvuzela-whine"">http://www.popsci.com/diy/article/2010-06/simple-software-can-filter-out-vuvuzela-whine</a>) that told us that the sound has some frequencies at 233Hz + 466,932,1864Hz.</p><p>I have already made a lot of Android application by myself but never touching the signal analysis and filtering part, so here are a few questions, I do not ask for precise answer but maybe links and tutorial to find something to work on. I guess that a new Android phone has the CPU and power to make real-time filtering.</p><p>1) How can I intercept the sound coming from the Jack microphone - Line-IN plug- ( I plan to link my TV to my phone with Jack to Jack plug). My question is totally software and coding, I have all the wires and adapters to plug a jack into my android phone Line IN.</p><p>2) Are there some Fourier analysis librairies, may I have a look to Java libraries on the web and import them to my Android project?</p><p>I really apologize because my question seem not precise, but I think that would be something great.</p><p>Thank you for your answers.</p>","327402","","327402","","2010-06-18 12:45:39","2010-06-18 14:39:50","Android Signal analysis + some filters","<java><android><filter><audio><signal-processing>","2","0","4","",""
"3069757","1","","","2010-06-18 12:59:29","1","326","<p>I use the following code in Java. It works well and it adds events into Google Calendar. But in Android it gives the Exception <code>Error connecting with login URI</code>. Can anyone help me to solve this?</p><pre><code>CalendarService myService = new CalendarService(""calendarTest"");String userName = ""mytest.test@gmail.com"";String userPassword = ""xxxxxxx"";// Create the necessary URL objects.try {    metafeedUrl = new URL(METAFEED_URL_BASE + userName);    eventFeedUrl = new URL(METAFEED_URL_BASE + userName        + EVENT_FEED_URL_SUFFIX);} catch (MalformedURLException e) {    // Bad URL    strbuf.append(e.getMessage());    System.err.println(""Uh oh - you've got an invalid URL."");    e.printStackTrace();    return;}try{    myService.setUserCredentials(userName, userPassword);    // Demonstrate creating a single-occurrence event.    CalendarEventEntry singleEvent = createSingleEvent(myService,""Event Title"", ""Event Description "");     System.out.println(""Successfully created event "" +singleEvent.getTitle().getPlainText() );    // Demonstrate creating a quick add event.    CalendarEventEntry quickAddEvent = createQuickAddEvent(myService,""Tennis with me June 22 3pm-3:30pm"");    System.out.println(""Successfully created quick add event ""       + quickAddEvent.getTitle().getPlainText());}// catch.......</code></pre>","324223","","496830","","2011-10-10 12:28:51","2011-10-10 12:28:51","How can I fix the ""Error connecting with login URI"" exception I get when adding events to Google Calendar?","<android><google-calendar>","1","2","","",""
"3069822","1","3070062","","2010-06-18 13:07:36","2","10539","<p>I'm trying to display the content of a html file with the <a href=""http://developer.android.com/reference/android/webkit/WebView.html#loadDataWithBaseURL%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29"" rel=""nofollow"">loadDataWithBaseURL()</a> method in android.</p><p>I just have a String that contains the Html file data in one String called source and I then pass this to the method.</p><p>for e.g </p><pre><code>String source; //contain html tags with imagesView.loadDataWithBaseURl(null,source,""text/html"",""UTF-8"",""about:blank"");</code></pre><p>The data displayed in view is fine.My problem is if my html file contains any images then I couldn't displayed it?how can I do that?</p>","370305","","114066","","2010-06-18 13:52:57","2014-04-14 09:28:34","Is it possible to display image with loadDataWithBaseURL() method in android?","<html><android><image><webview>","4","1","1","",""
"3070015","1","","","2010-06-18 13:31:47","-3","93","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3069757/how-can-i-fix-the-error-connecting-with-login-uri-exception-i-get-when-adding-e"">How can I fix the &ldquo;Error connecting with login URI&rdquo; exception I get when adding events to Google Calendar?</a>  </p></blockquote><p>I am new to android. I can able to add the data to google calendar via my java application.But the same code is not working in the android.It gives the Exception message</p><p><strong>Error connecting with login URI</strong></p><p>how to solve this???</p>","370334","","","","","2010-06-18 13:40:12","how to solve this in android?","<android>","1","1","","2011-10-10 12:36:42",""
"3070144","1","","","2010-06-18 13:49:04","14","6373","<p>I´m trying to get hold of the addresses to the currently used DNS-servers in my application, either I´m connected thru Wifi or mobile.The DhcpInfo object should provide this but how can I get hold of a valid DhcpInfo object?</p><p>Best regardsJohn</p>","370344","","","","","2013-09-13 13:12:36","How do you get the current DNS servers for Android?","<android>","6","1","3","",""
"3070159","1","3070470","","2010-06-18 13:51:47","31","28876","<p>I have 6 months experience with Android, developing simple UI-based applications. Now I want to write applications targeting the Android core Kernel.  For example, I want to develop a framework which is not present in Android.  To achieve that, we have to write the code for the Kernel. I don't know where and how to start Android Kernel programming. </p><p>If anybody knows the way to start it please help me.</p>","131062","","2185093","","2013-06-18 03:33:26","2013-10-16 23:50:07","How to start Android Kernel programming?","<android>","3","0","30","",""
"3070303","1","3071453","","2010-06-18 14:10:09","0","354","<p>every time i am using the db its null and i just dont get it i use this code for the SQL when I have quarry   :</p><p>public class GameSQLHelper {</p><pre><code>    static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra""         };    private static final String DB_PATH = ""/countryCityGame/databases/"";    private static final String DATABASE_NAME = ""events.db"";    private static final int DATABASE_VERSION = 1;    private final Context mCtx;    // Table name    public static final String TABLE = ""myDataBase"";    // Columns    public static final String LETTER = ""letter"";    public static final String TYPE = ""type"";    public static final String VALUE = ""value"";    //my database    SQLiteDatabase myDataBase;     private static class DatabaseHelper extends SQLiteOpenHelper {            private static final String TAG = null;            DatabaseHelper(Context context) {                super(context, DATABASE_NAME, null, DATABASE_VERSION);            }            @Override            public void onCreate(SQLiteDatabase db) {                String sql = ""create table "" + TABLE + ""( "" + BaseColumns._ID                + "" integer primary key autoincrement, "" + LETTER  + "" text not null, ""                + TYPE + "" text not null,"" + VALUE + "" text not null );"";                Log.d(""EventsData"", ""onCreate: "" + sql);                db.execSQL(sql);                insertValuesToDB(db);            }            private void insertValuesToDB(SQLiteDatabase db) {                if (db == null){                }                else{                db.execSQL(""INSERT INTO ""                                                + TABLE                                                + "" (""+LETTER+"",""+ TYPE +"","" + VALUE +"")""                                                + "" VALUES ('A', 'country', 'Angola');"");                  ContentValues initialValues = new ContentValues();                  for (int i = 0 ; i &lt; COUNTRIES.length ; i++){                      Character tmp = (Character)COUNTRIES[i].charAt(0);                      initialValues.put(VALUE, COUNTRIES[i]);                      initialValues.put(TYPE, ""country"");                      initialValues.put(LETTER,tmp.toString(tmp));                  db.insert(TABLE, null, initialValues);                  }                }            }            @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 GameSQLHelper(Context ctx) {            this.mCtx = ctx;        }        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        if (oldVersion &gt;= newVersion)            return;        String sql = null;        if (oldVersion == 1)             sql = ""alter table "" + TABLE + "" add note text;"";        if (oldVersion == 2)            sql = """";        Log.d(""EventsData"", ""onUpgrade  : "" + sql);        if (sql != null)            db.execSQL(sql);    }     public void openDataBase() throws SQLException{            //Open the database            String myPath = DB_PATH + DATABASE_NAME;            myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);        }        public boolean existInDataBase(String serchStr ){            Cursor c = null ;            try{            openDataBase();            c =  myDataBase.query(true, TABLE, new String[] {TYPE                    }, VALUE + ""="" + serchStr, null,                    null, null, null, null);            }            catch(Exception e){                Log.d(""sqlExacption"", e.getMessage());            }            if (c == null)                 return false;            return true;        }}</code></pre><p>whenever i call this class (i hold an instace of him initialized : mDbHelper = new GameSQLHelper(this); where this is an activity )</p><p>i always get my mDbHelper as null how can i change it , its my first time working with sql outside of mysql platform so i am kind of having problmes understanding tje concept , and the android notepad example didnt help me .</p>","368440","","","","","2010-06-18 16:31:53","Android sqlight problem always null","<android><system.data.sqlite>","1","0","","",""
"3070377","1","3070453","","2010-06-18 14:19:18","1","11339","<p>How can i retrieve the text of a dynamically created radio button selected by the user? Here's my code: </p><pre><code>RadioGroup radiogroup = (RadioGroup) findViewById(R.id.rdbGp1);         // layout params to use when adding each radio button         LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(                 RadioGroup.LayoutParams.WRAP_CONTENT,                 RadioGroup.LayoutParams.WRAP_CONTENT);  for (int i = 0; i &lt; 4; i++){             final RadioButton newRadioButton = new RadioButton(this);             c3 = db.getAns(3);         for (int j=0;j&lt;i;j++)             c3.moveToNext();            label = c3.getString(0);         newRadioButton.setText(label);         newRadioButton.setId(6);         radiogroup.addView(newRadioButton, layoutParams); </code></pre><p>Waiting for the reply, Maqsood</p>","2355649","","","","","2014-01-04 07:55:52","Android: How to get text of dynamically created radio button selected by the user?","<android>","5","0","1","",""
"3070619","1","3071887","","2010-06-18 14:47:45","0","702","<p>I have looked everywhere for the answer to this question, but cannot find anything on it. Is there anyone that can help me with this predicament? Thank you. </p><p>P.S. - I apologize if this question does not belong here, if it does not I will remove it.</p>","345256","","","","","2010-06-18 17:36:12","Android Eclipse plugin missing options menu to edit XML's","<android><eclipse><eclipse-plugin>","2","2","","",""
"3071068","1","3072038","","2010-06-18 15:41:03","15","9383","<p>Is it possible to change the color or appearance of the scrollbar in a ScrollView or ListView?</p>","249871","","","","","2014-02-17 07:27:10","Change scrollbar color in Android","<android><listview><scrollview>","2","0","4","",""
"3071207","1","","","2010-06-18 16:00:39","0","182","<p>I would like to create a Java-written RESTFul Web Service, possibly using an eclipse plugin.</p><p>This service should be consumed by an android application, using the apache HttpClient.</p><p>But my question is, which is the best/ideal technology (server side) to implement this kind of web service?</p>","246435","","","","","2010-06-18 17:10:58","Which technology should I use to implement a Java-written WebService, to consume with the apache HttpClient in android?","<android>","2","1","","",""
"3071233","1","3071303","","2010-06-18 16:03:40","1","583","<p>I have just finished my android application and now it's time to test it under real-life conditions.  The only problem is I'm clueless as to how to take the application and transfer it over to a device.  I have already signed the application.  What's next?</p><p>Thanks in advance for your help!</p>","351338","","","","","2010-10-11 17:00:49","Android -- Transferring Application to a Device","<android><mobile-phones><transfer>","1","0","0","",""
"3071318","1","3071738","","2010-06-18 16:13:01","0","538","<p>I am creating a application that requires to store multiple attributes, and it will look up DB while running (this means multiple DB lookups). This App. should have low overhead hence, I need your suggestion whether to create multiple columns in single table or multiple tables with minimum columns. </p>","357349","","243782","","2010-06-18 16:41:51","2010-06-18 17:13:01","Sqlite in Android one table or many tables","<sql><android><sqlite>","1","2","","",""
"3071343","1","3856472","","2010-06-18 16:15:53","3","1639","<p>How can I detect programmatically if a phone has a camera ?</p>","164460","","","","","2010-10-04 15:03:39","android camera detection","<android><camera>","2","0","0","",""
"3071368","1","","","2010-06-18 16:19:51","1","6486","<p>Subject says it all. I have seen examples implementing a custom Filter. The Android developer docs talk about implementing a Filterable interface. Does anyone have any advice and/or sample code on the best way to implement filtering in a ListView ?</p>","246793","","","","","2013-07-25 10:44:09","I have a ListView using a custom ArrayList adapter - what's the best way to implement filtering ? Anyone have a example code to study?","<android><listview><filter>","4","0","4","",""
"3071588","1","3071699","","2010-06-18 16:52:06","1","927","<p>My question appears to be linked to the following question:</p><p><a href=""http://stackoverflow.com/questions/2398209/how-to-handle-in-code-illegalstateexception-on-cursor"">http://stackoverflow.com/questions/2398209/how-to-handle-in-code-illegalstateexception-on-cursor</a></p><p>The code for the offending method is as follows:</p><pre><code>    public boolean isPermanent(String screen_name) {    boolean output = false;    try {        Cursor c = mDb.query(USERS, new String[] {PERMANENT}, NAME + ""='"" + screen_name + ""'"", null, null, null, null);        if (c != null &amp;&amp; c.getCount() &gt; 0) {            c.moveToFirst();            output = c.getString(0).contentEquals(""C"");            c.close();        }    }    catch (Exception e) {        Log.e(""DBERR"", e.getMessage());    }    return output;}</code></pre><p>However, I am looking at the Cursor in question when the exception is thrown, I can see the following in Eclipse:</p><pre><code>this    SQLiteCursor  (id=830061188288) mClosed true    mColumnNameMap  null    mColumns    String[1]  (id=830061188608)    mContentObservable  ContentObservable  (id=830061188456)    mContentResolver    null    mCount  0   mCurrentRowID   null    mCursorState    0   mDatabase   SQLiteDatabase  (id=830060407768)   mDataSetObservable  DataSetObservable  (id=830061188408)    mDriver SQLiteDirectCursorDriver  (id=830061143904) mEditTable  ""users"" (id=830060403008)   mInitialRead    2147483647  mLock   null    mMaxRead    2147483647  mNotificationHandler    null    mNotifyUri  null    mPendingData    false   mPos    -1  mQuery  SQLiteQuery  (id=830061143936)  mRowIdColumnIndex   -1  mSelfObserver   null    mSelfObserverLock   Object  (id=830061188504)   mSelfObserverRegistered false   mStackTraceElements null    mUpdatedRows    HashMap  (id=830061144056)  mWindow null    </code></pre><p>And this clearly shows that the state of the Cursor is closed, as it should be - so does anyone have any clues as to why this should be throwing an exception?</p>","206546","","","","","2010-06-18 17:07:52","IllegalStateException on closed Cursor","<android><cursor>","1","4","","",""
"3071788","1","3295011","","2010-06-18 17:21:40","0","405","<p>I am working on sending Meeting Invites from my Android app. </p><p>Here is the generated <a href=""http://en.wikipedia.org/wiki/ICalendar"" rel=""nofollow"">iCal</a>. </p><pre><code>BEGIN:VCALENDARVERSION:2.0PRODID:Test//Outlook//ENMETHOD:REQUESTBEGIN:VTIMEZONETZID:GMT-6 standard timeBEGIN:STANDARDDTSTART:16010101T020000TZOFFSETFROM:-0500TZOFFSETTO:-0600RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SUEND:STANDARDBEGIN:DAYLIGHTDTSTART:16010101T020000TZOFFSETFROM:-0600TZOFFSETTO:-0500RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SUEND:DAYLIGHTEND:VTIMEZONEBEGIN:VEVENTDESCRIPTION;ENCODING=QUOTED-PRINTABLE:this is a recurring eventSUMMARY;ENCODING=QUOTED-PRINTABLE:RecurringEventDTSTART:20100618T010000ZDTEND:20100618T020000ZDTSTAMP:20100618T004215ZLOCATION;ENCODING=QUOTED-PRINTABLE:SomeplaceATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Sagar:MAILTO:sagar.hatekar@gmail.comRRULE:FREQ=WEEKLY;BYDAY=THSEQUENCE:0UID:040000008200E00074C5B7101A82E008000000000000000000000000000000000000000010000000251D69F4288A137B1891F782A1836CCBEND:VEVENTEND:VCALENDAR</code></pre><p>This event starts at 8 p.m. <a href=""http://en.wikipedia.org/wiki/North_American_Central_Time_Zone"" rel=""nofollow"">CDT</a> and ends at 9 p.m. CDT. However, when this meeting request is received in Outlook, the ""when"" section reads as ""Thursday, June 17, 2010 01:00AM-02:00AM GMT-5 standard time"". </p><p>EDIT:I am sending a meeting request from using Android 2.x (Eclair) source code for email and calendar.</p>","302969","","302969","","2011-04-10 07:33:08","2011-04-10 07:33:08","Recurring events show up in UTC time ","<android><icalendar>","1","2","","",""
"3072024","1","3075289","","2010-06-18 17:57:01","3","5210","<p>I am trying to create custom background selector for my ExpandableListView. It works fine for all states other than focused. I am unable to identify which row is currently focused. Here is the code:</p><p><strong>im_selector.xml</strong></p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true""        android:drawable=""@drawable/list_selector_background_focus"" /&gt;    &lt;item android:state_pressed=""true""        android:drawable=""@drawable/list_selector_background_pressed"" /&gt;    &lt;item         android:drawable=""@drawable/list_bg"" /&gt;&lt;/selector&gt;</code></pre><p><strong>my listview in the layout file</strong></p><pre><code>&lt;ExpandableListView android:id=""@+id/android:list""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:layout_weight=""1""              android:scrollbars=""horizontal""              android:layout_below=""@id/top_bar""              android:layout_marginBottom=""45px""              android:divider=""#00000000""              android:cacheColorHint=""#00000000""              android:listSelector=""@layout/im_selector""              android:focusable=""true""                          /&gt;</code></pre>","278194","","1233659","","2014-01-29 09:56:33","2014-01-29 09:56:33","android Custom Listview Background Focus State not working","<android>","1","1","","",""
"3072147","1","3075093","","2010-06-18 18:17:52","10","8533","<p>Im using a SpinnerAdapter to display a Spinner. For that i defined a class which implements SpinnerAdapter. Unfortunately I don't know how to override some methods of SpinnerAdapter:</p><pre><code>@Overridepublic View getDropDownView(int position, View arg1, ViewGroup arg2) {}@Overridepublic int getItemViewType(int arg0) {}@Overridepublic boolean hasStableIds() {}@Overridepublic void registerDataSetObserver(DataSetObserver arg0) {}@Overridepublic void unregisterDataSetObserver(DataSetObserver observer) {}</code></pre><p>Does anybody know what i have to code in each of these methods?</p>","329637","","296108","","2012-11-28 23:25:48","2013-01-03 15:05:43","How to correctly overwrite methods of SpinnerAdapter","<android>","3","0","6","",""
"3072171","1","","","2010-06-18 18:23:49","1","1260","<p>How do I access the clipboard on HTC hero?</p>","370578","","105224","","2010-06-18 18:30:41","2010-06-18 18:30:41","how do i access clipboard","<android><clipboard>","1","2","1","",""
"3072173","1","3072338","","2010-06-18 18:24:19","99","80396","<p>I want to be able to call the following method after a specified delay. In objective c there was something like:</p><pre><code>[self performSelector:@selector(DoSomething) withObject:nil afterDelay:5];</code></pre><p>Is there an equivalent of this method in java?For example I need to be able to call a method after 5 seconds.</p><pre><code>public void DoSomething(){     //do something here}</code></pre>","242769","","242769","","2012-02-29 05:15:05","2013-03-22 01:57:57","How to call a method after a delay","<java><android><handler><delay>","8","1","40","",""
"3072274","1","3073426","","2010-06-18 18:42:03","0","3847","<p>I am creating a dialog to zoom in on an image,<br>However, my content is 240px and I would like to resize it to the screen width, to ""fill_parent"". Could you tell me what's wrong here? My picture stays small, 240px, not 480px.  </p><pre><code>final Dialog dialog = new Dialog(myview);dialog.setContentView(R.layout.zoom);dialog.setTitle(""""+passInfoNom+"" "");imgView2 = (ImageView)dialog.findViewById(R.id.ImageZoom);imgView2.setImageDrawable(image);dialog.show();</code></pre><p>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=""fill_parent""    android:background=""#ffffffff""&gt;&lt;ImageView android:id=""@+id/ImageZoom""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","144587","","72882","","2013-01-18 15:53:26","2013-01-18 15:55:01","dialog doesn't take parent size","<android><layout><dialog>","3","1","","",""
"3072615","1","","","2010-06-18 19:42:18","1","559","<p>I'm trying to tell a <code>WebView</code> to scale the page down to a certain percent. I've tried using <a href=""http://developer.android.com/reference/android/webkit/WebView.html#setInitialScale%28int%29"" rel=""nofollow"">setInitialScale()</a> as that seems to be exactly what I want, but it seemed to have no effect.</p><p>Am I just missing something obvious? </p><p>Thanks in advance!</p>","76835","","","","","2010-06-30 23:00:44","How can I tell a (Android) WebView to start off at a custom scale?","<android><webview>","1","5","","",""
"3072661","1","3072780","","2010-06-18 19:54:31","0","162","<p>My question are commented in the code</p><pre><code>ImageView img = new ImageView();this.layout.addView(img);MyObject o = new Object(img);// Do i need to set img to null?ArrayList &lt;MyObject&gt; myArray = new ArrayList &lt;MyObject&gt;();MyObject obj = new MyObject();myArray.add(obj);// Do i need to set obj to null?</code></pre>","242769","","","","","2010-06-19 11:59:40","Android ==> Mmory Management Questions?","<android><memory-management>","2","0","","",""
"3072683","1","3075619","","2010-06-18 19:59:17","3","4005","<p>I am trying to consume a .net web service, and get the following error when I run it(debug) from my phone</p><p>java.lang.NoClassDefFoundError: javax.microedition.io.Connector</p><p>I get the error when I make the call to the transport object</p><pre><code>ht.call(SOAP_ACTION, soapEnvelope);</code></pre><p>while in the eclipse ide, the (context sensitive model) does not show this in the object model when i try to add it i only see javax.microedition.khronos.* , no javax.microedition.io, which confuses me more.</p><p>When I try to debug this in the emulator, I only get a VerifyError</p><pre><code>        private static final String SOAP_ACTION = ""http://ikonicsoft.com/CheckTrial"";private static final String METHOD_NAME = ""CheckTrial"";private static final String NAMESPACE = ""http://ikonicsoft.com"";private static final String URL = ""http://ikonicsoft.com/WebService.asmx"";     SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);    request.addProperty(""deviceid"", deviceid);    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    soapEnvelope.dotNet = true;    soapEnvelope.setOutputSoapObject(request);    HttpTransport ht = new HttpTransport(URL);    Boolean bValid = false;    try{        ht.call(SOAP_ACTION, soapEnvelope);        Boolean result = (Boolean) soapEnvelope.getResponse();         if((Boolean)result){            bValid = true;        }else{            bValid = false;        }    }catch(Exception e){        e.printStackTrace();        bValid = false;    }</code></pre><p>let me know if you need more info</p><p>thanks in advance</p><p>patrick</p>","244190","","244190","","2010-06-19 13:30:26","2010-06-19 13:30:26","java.lang.NoClassDefFoundError: javax.microedition.io.Connector","<android><ksoap2>","2","3","1","",""
"3072776","1","3098220","","2010-06-18 20:15:23","4","14704","<p>I am developing an application which uses Bluetooth to connect to a device and send/receive data. I am doing all of my testing with a Nexus One phone.</p><p>I have never been able to establish a SPP (serial port) connection from my phone to any device. However, I <b>have</b> been able to connect from a device (my laptop) to my phone using a Mac equivalent of PuTTY (The only exception to this is the ""Bluetooth File Transfer"" app from the Marketplace seems to work, but I don't think that uses RFCOM/SPP...).</p><p>I keep seeing this message in my LogCat logs:</p><pre><code>ERROR/BluetoothService.cpp(78): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)</code></pre><p>as well as these:</p><pre><code>java.io.IOException: Operation Canceledjava.io.IOException: Software caused connection abort</code></pre><p></p><p>I have tried using the UUID of ""00001101-0000-1000-8000-00805F9B34FB"" and I have also tried using the:</p><pre><code>Method m = device.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));</code></pre><p>method instead of <code>device.createRfcommSocketToServiceRecord(UUID);</code> as well--with no luck.</p><p>I am using the <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">BluetoothChat example</a> and variations of that code to do all of my testing...</p><p>Solutions or suggestions would be great...or even a better/less complex example of some testing code I can run on the phone, or a python script or something I can run on my computer to help debug?</p><p>Thanks! I hope this isn't a bug with the Android OS, but if it is I hope to find a workaround.</p><hr><p>EDIT: I should also note that most devices show up as ""paired, but not connected"" in the Bluetooth settings.</p><hr><p>EDIT 2: The solution seems to be simply disabling any Bluetooth listening. See my answer post for more information.</p>","2359478","user370382","2359478","user370382","2010-06-23 18:55:55","2011-07-16 10:34:36","Android Bluetooth - Can't connect out","<java><android><bluetooth><serial-port><uuid>","2","3","7","",""
"3072846","1","3072998","","2010-06-18 20:27:38","1","551","<p>I want to look more into the workings of Android. More specifically I want to know how Applications (including Activities and Services) get launched by the system. I also want to be able to see who calls their lifecycle methods and how objects get allocated and recycled.</p><p>I have downloaded the Android source from git and browsed around for a bit, but since it's a little large any pointer would be appreciated.</p><p>Thanks!</p>","338981","","102703","","2010-06-18 21:01:59","2011-04-07 14:35:02","Looking into the Android source, specifically around activity & service lifecycle","<android><source><lifecycle>","3","0","","",""
"3073160","1","3085891","","2010-06-18 21:19:41","5","3550","<p>I'm trying to set up an Android application with an Android library project dependence in Eclipse. I've set up a project called AnTest and a library project called AnLib. I've provided a reference to AnLib in the project properties of AnTest. Now I'm trying to refer to some library code (a static public method) from AnTest. Eclipse throws ""com.anlib.Hello cannot be resolved to a type"".</p><p>And it's not that the reference is dangling - I can see the resources properly merged. But from within AnTest, the only class in package com.anlib is ""R"".</p><p>Please, what am I doing wrong? Some very basic step must be missing...</p><p>EDIT: I've added AnLib to the Java build path/Projects in AnTest project properties. Now it compiles, but running throws a NoClassDefFoundError exception...</p>","219159","","219159","","2010-06-18 21:45:51","2012-03-09 14:15:17","Android library: resources are merged, code is not","<android><eclipse><android-sdk-2.2>","2","2","2","",""
"3073319","1","","","2010-06-18 21:58:32","0","1847","<p>Has anyone seen this problem? </p><p>I'm in the middle of updating my SDK to add Android 2.2, on my Mac.You don't have to download the entire SDK -- there is a tool already on your system which can download just the extra parts of Adroid 2.2  This page explains: <a href=""http://developer.android.com/sdk/adding-components.html"" rel=""nofollow"">http://developer.android.com/sdk/adding-components.html</a></p><p>The tool is called the ""Android SDK and AVD manager"".    There are two ways to start this tool. </p><ol><li>You can start it from within Eclipse, via: Window > ""Android SDK and AVD Manager""</li></ol><p>or</p><ol><li>You can start it from the command line, via  cd /tools ; ./android &amp;</li></ol><p>To my surprise, the tool is slightly different, when started from the different places.  In particular, starting it from Eclipse, and pressing the ""Available Packages"" button, did NOT show the new Android 2.2 release.  Starting it from the command line <em>does</em> show the new Android 2.2 release, and enables me to install it.</p><p>It's very easy to install the 2.2 update, but you have to start the SDK manager from the command line on Mac.  It looks like all the downloads will take a hour or two.</p><p>Has anyone else noticed this problem, and what is the place to report Android tools bugs?</p><p>Peter</p>","253661","","","","","2010-06-18 22:12:27","Android SDK manager fails, if launched from Eclipse","<android><sdk><manager>","1","0","","",""
"3073447","1","3074364","","2010-06-18 22:25:21","4","7916","<p>I'm using this sample code to populate the Spinner. Data is read from database. The selection displays correctly - in this case, it shows ""Green"" and ""Red"".</p><pre><code>    Spinner spinnerColor = (Spinner) findViewById(R.id.spinnertProfile);    mProfileDbHelper = new ProfileDbAdapter(this);    mProfileDbHelper.open();    Cursor profilesCursor = mProfileDbHelper.fetchAllProfiles();    startManagingCursor(profilesCursor);    // Create an array to specify the fields we want to display in the list    String[] from = new String[] { ProfileDbAdapter.COL_PROFILE_TITLE };    // and an array of the fields we want to bind those fields to    int[] to = new int[] { R.id.textviewColors };    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter profilesAdapter = new SimpleCursorAdapter(this,            R.layout.profile_color, profilesCursor, from,            to);    spinnerColor.setAdapter(profilesAdapter);}</code></pre><p>However, when I changed to use a different layout <strong>android.R.layout.simple_spinner_dropdown_item</strong>. The Spinner Text disappeared.</p><pre><code>    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter profilesAdapter = new SimpleCursorAdapter(this,            R.layout.profile_color, profilesCursor, from,            to);    profilesAdapter            .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinnerColor.setAdapter(profilesAdapter);</code></pre><p>See snapshots of without and with <strong>simple_spinner_dropdown_item</strong> below:<img src=""http://i.stack.imgur.com/HSLbr.gif"" alt=""enter image description here""></p><p>Anything I may miss?</p>","370640","","2065587","","2014-03-04 09:02:56","2014-03-04 09:02:56","Android - Text dropdown/selection of Spinner does not show","<android><android-widget><spinner>","3","2","1","",""
"3073454","1","3073515","","2010-06-18 22:26:56","0","199","<p>I need a custom dialog to appear on button press. Here is my code: </p><pre><code>Button button3 = (Button) findViewById(R.id.Button03);     button3.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {        final Dialog custdialog = new Dialog(this);        custdialog.setContentView(R.layout.custom_drink);        custdialog.setTitle(""Custom Drink"");        custdialog.setCancelable(false); /etc.</code></pre><p>However, on this line: final Dialog custdialog = new Dialog(this);</p><p>I get an error saying ""The constructor Dialog(new View.OnClickListener(){}) is undefined"".</p><p>I've tried replacing ""this"" with other things, but with no luck. It's odd that I get an error on this line because I have the exact same thing (except different names and stuff) in my project, beneath a switch (like this:</p><pre><code>@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) {    case R.id.settings:  final Dialog settingsdialog = new Dialog(this);    settingsdialog.setContentView(R.layout.custom_dialog);    settingsdialog.setTitle(""Settings"");    settingsdialog.setCancelable(false);</code></pre><p>and that one works fine... hmmm.</p>","359045","","","","","2010-06-18 22:42:59","What context do I use for a new Dialog?","<java><android><button><dialog><customdialog>","1","3","","",""
"3073468","1","3073527","","2010-06-18 22:30:26","1","1793","<p>Is there a way to start an activity from a view?  I have this nice view that renders these menu buttons and when they click a particular button (Trapped in an onTouch event) I want to start the ""clicked"" activity.</p><p>It seems that there from my view startActivity method is uncallable.  So that leads me to believe that there is no way to do this, in which case I guess I am asking, what do I do here when I want this menu to have a view that animates drawables and can get touches to know what ""button"" was pressed to know what activity to start?</p><p>I have been searching and nothing seems to fit what I am looking for.  I suspect since I cannot find it that it probably breaks convention in some way and in which case, what is the proper way to do this?</p><p>I have another Activity that starts this cool scrolling tile map view.  When the user clicks on a specific tile I would like to load up an entirely different view (maybe even activity not sure which I need) based on the tileID clicked.  This new View or activity would show all the items in the cell that was clicked (imagine the map with cells , each cell has stuff in it.  When the user clicks on the cell then a new view happens that shows all this stuff as cool drawables, like it ""zoomed in"" on the cell).</p><p>I would think I need the same thing, when the user is inside my scrolling map view and they push down then up I get what cell they clicked on and use that to initialize the activity that will launch showing the zoomed in state of things (via drawables using a new kind of view i suspect)</p>","327258","","327258","","2010-06-18 22:37:43","2010-06-18 22:46:30","Starting an activity from a view in android?","<android>","2","0","2","",""
"3073497","1","3074013","","2010-06-18 22:38:16","0","1001","<p>I created two Spinners to display the data in my application. In my first Spinner, the first item of the list is always displayed directly, but in the second Spinner nothing is displayed, even if I click on an item on the drop down view. Can anybody explain this behaviour?</p><p>Here is the code of the initialisation of the two spinners:</p><pre><code>projects = new Spinner(lexs);projectAdapter = new ProjectAdapter();projects.setAdapter(projectAdapter);projects.setMinimumWidth(250);projects.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {@Overridepublic void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {   updateSpinners(position);                    }@Overridepublic void onNothingSelected(AdapterView&lt;?&gt; parent) {   // do nothing    }});projectsList = new Spinner(lexs);projectsList.setMinimumWidth(250);listAdapter = new ListAdapter();projectsList.setAdapter(listAdapter);projectsListLayer.addView(projectsList);</code></pre><p>The Spinner projects is the first Spinner which works correctly. projectsList is the second Spinner which doesn't work correctly. Here are the two implementations of the adapters:</p><pre><code>private class ProjectAdapter implements SpinnerAdapter {        @Override        public View getDropDownView(int position, View arg1, ViewGroup arg2) {            TextView text = new TextView(lexs);            text.setText(allProjects.get(position).getName());            return text;        }        @Override        public int getCount() {            return allProjects.size();        }        @Override        public Object getItem(int position) {            return allProjects.get(position);        }        @Override        public long getItemId(int position) {            return position;        }        @Override        public int getItemViewType(int arg0) {            // TODO Auto-generated method stub            return 0;        }        @Override        public View getView(int position, View arg1, ViewGroup arg2) {            TextView text = new TextView(lexs);            text.setText(allProjects.get(position).getName());            return text;        }        @Override        public int getViewTypeCount() {            // TODO Auto-generated method stub            return 0;        }        @Override        public boolean hasStableIds() {            return false;        }        @Override        public boolean isEmpty() {            if (allProjects.size() == 0) {                return true;            } else {                return false;            }        }        @Override        public void registerDataSetObserver(DataSetObserver arg0) {            // TODO Auto-generated method stub        }        @Override        public void unregisterDataSetObserver(DataSetObserver observer) {            // TODO Auto-generated method stub        }    }    private class ListAdapter implements SpinnerAdapter {        @Override        public View getDropDownView(int position, View view, ViewGroup parent) {            TextView text = new TextView(lexs);            text.setText(allLists.get(position).getName());            return text;        }        @Override        public int getCount() {            return allLists.size();        }        @Override        public Object getItem(int position) {            return allLists.get(position);        }        @Override        public long getItemId(int position) {            return position;        }        @Override        public int getItemViewType(int position) {            // TODO Auto-generated method stub            return 0;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            TextView text = new TextView(lexs);            text.setText(allLists.get(position).getName());            return text;        }        @Override        public int getViewTypeCount() {            // TODO Auto-generated method stub            return 0;        }        @Override        public boolean hasStableIds() {            // TODO Auto-generated method stub            return false;        }        @Override        public boolean isEmpty() {            if (allLists.size() == 0) {                return true;            } else {                return false;            }        }        @Override        public void registerDataSetObserver(DataSetObserver observer) {            // TODO Auto-generated method stub        }        @Override        public void unregisterDataSetObserver(DataSetObserver observer) {            // TODO Auto-generated method stub        }    }</code></pre><p>Here I attached a picture of the problem:</p><p>http://www.freeimagehosting.net/image.php?7684c157b8.png</p>","","anon","","anon","2010-06-18 22:44:15","2010-06-19 02:07:47","How to display selected Item in Spinner?","<java><android>","1","0","","",""
"3073596","1","","","2010-06-18 23:07:16","1","252","<p>I'm trying to write a free mobile app that would make payments merchant-agnostic for the customer. </p><p>Context: Most web-apps are merchant centric and allow for multiple payment types from the customer. But the problem I'm trying to additionally solve is to have, say, a mobile app that is capable of paying as many merchants as possible using your debit, credit or PayPal account. It shouldn't rely on per-merchant technical partnerships to work. It should just be able to talk to any merchant after writing the upfront code.</p><p>There are a few solutions that come to mind: Integrate with VISA, Mastercard, or PayPal. However, my goal is to integrate with stores that sometimes only take debit, sometimes only VISA, sometimes only PayPal, etc, while re-inventing the wheel as little as possible. I'm wondering if anybody has already solved a problem like this before? </p><ol><li>Which APIs are the easiest to integrate against? Could you name a few?</li><li>Are there well known merchant-aggregating APIs that are already very popular? Do they cover much larger merchants like Costco and Walmart?</li><li>Are there partnership costs (with say VISA) I need to be aware of?</li><li>Is there one API to rule them all that would aggregate even across Debit, VISA, PayPal, etc to reduce things to one integration point?</li></ol><p>I need this for a free consumer Android app and would really appreciate any help I can get - especially if it's cost-effective.</p><p>Best!Amin</p>","279707","","","","","2011-04-10 06:53:57","How to quickly integrate with multiple merchants from one app","<android><api><mobile><paypal><payment>","1","0","","",""
"3073601","1","3074016","","2010-06-18 23:09:11","0","1152","<p>I have a shared project that I'd like to split up in Eclipse.It's an android shared library which some packages should just be jar files others need to be smaller shared libraries.</p><p>What is the best way to handle this other than manually creating smaller projects?</p><p>Also is there a way to create a script to create exported jar files from eclipse if I gave it a project path?</p>","42005","","","","","2010-06-19 02:07:47","Eclipse Jar export script","<java><android><eclipse><jar><build-script>","1","0","","",""
"3073679","1","","","2010-06-18 23:28:10","2","636","<p>I just downloaded android SDK for linux_x86.I cannot find dx though. Document says it should be on /tools/ .is dx not included any more from some point?</p>","370766","","","","","2012-07-05 11:37:47","No dx in android SDK?","<android><dx>","1","1","","",""
"3073964","1","","","2010-06-19 01:20:18","3","2189","<p>I have a simple grid with rows of items and columns of options on each item. Of course I can manually link OnClick actions to cell items through specific resource IDs:</p><pre><code> views.setOnClickPendingIntent(R.id.row1column1, launchA); views.setOnClickPendingIntent(R.id.row1column2, launchB);    // ... views.setOnClickPendingIntent(R.id.row2column1, launchC);    // ...</code></pre><p>What I'd prefer to to is use a ListView or a GridView and an Adapter.  Is there a way to get cell id's from one of those?  I was hoping that ListView setOnItemClickListener() would call me with the view id of a view within row 'position':</p><pre><code>onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { ... }</code></pre><p>but no go.  Maybe a different approach?</p><p>Thanks.</p><p>Update:</p><p>I started with this:</p><pre><code>contactsView.setAdapter(new ContactAdapter(this.getApplicationContext(), R.layout.contact, contacts));contactsLV.setOnItemClickListener(new OnItemClickListener() { ... });</code></pre><p>I'd assumed that I couldn't go into my Adapter and set child view OnClickListeners.  Bad assumption.  When I went back at this I gave it a try:</p><pre><code>Button x  = (Button)newView.findViewById(R.id.contact_x);Button y = (Button)newView.findViewById(R.id.contact_y);x.setOnClickListener(new OnClickListener() { ... });y.setOnClickListener(new OnClickListener() { ... });...</code></pre><p>Voila!</p>","294973","","159769","","2012-12-12 05:43:03","2012-12-12 05:43:03","Android multiple column list/grid with adapter and OnItemClickListener?","<java><android><list><onclick><adapter>","0","1","","",""
"3074041","1","","","2010-06-19 02:04:02","1","1305","<p>I am new to Android app. development. I need to change the existing style at runtime or can create new styles at runtime and I need to apply it for my buttons and textviews..</p><p>Can any one suggest me?</p>","370804","","","","","2010-06-19 14:49:46","How to create and apply styles through programming in android?","<android><coding-style>","2","0","","",""
"3074051","1","3074151","","2010-06-19 02:06:04","0","601","<p>The screen shot below is of a simplified version of the application from the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Tab Layout tutorial</a>. You can see a black horizontal line below the tabs. Why is it there and how can I remove it?</p><p><img src=""http://i48.tinypic.com/o5rjw2.png"" alt=""alt text""></p>","200145","","6391","","2010-06-19 03:05:50","2010-06-19 03:39:32","Unexpected visual element in a simple Tab layout","<android><layout><android-tabhost>","2","0","","",""
"3074076","1","3075806","","2010-06-19 02:24:16","1","369","<p>Is there any way to log within the application without being in debug mode.When i am in debug mode the application runs tooo slow.</p><p>Thanks</p>","242769","","","","","2010-06-19 14:25:06","Android ==> Loggin witthout going to debug mode?","<android><debugging><logging>","1","5","","",""
"3074374","1","3075430","","2010-06-19 04:41:30","5","869","<p>I have a large data file, which is zipped, and approximately 20MB. When it's unzipped, it's up to about 50MB. The following source code works fine. I found the original on the web somewhere else and modified it a bit. And this method is called within the AsyncTask.doInBackground.</p><p>So, what I want to know is, how can I save the on going status(? sorry, I don't know the proper English word) and resume the procedure later? I mean, this method takes a bit long time (about a minute on an emulator), and I know there is no way since the data is kind of huge. So, if a main activity of this method gets killed, I want to save the current status of decompressing the file, and when the activity gets active, I want to resume decompressing from the last point. Hope my explanation clears my intent.</p><p>I was thinking using a service, but I also want to interact with UI, such as showing a progress or whatever. I can't find good information to do that in the service when I roughly scan the reference, but is there a way to do that in the service? And do you think I should use it?</p><p>Anyway, my main point is how to resume decompressing a file.</p><pre><code>private final static int CHUNK_SIZE = 32 * 1024;byte[] _fileIOBuffer = new byte[CHUNK_SIZE];public void unzipFile(DBFileDownloader downloader, File zipFile, String directory)     throws IOException{     ZipInputStream in = null;     FileOutputStream os = null;     try     {        in = new ZipInputStream (new FileInputStream(zipFile));         ZipEntry entry = null;         while ((entry = in.getNextEntry ())!= null)         {             String entryName = entry.getName();                             if (entry.isDirectory ()) {                 File file = new File (directory, entryName);                 file.mkdirs();             }             else {                 File file = new File(directory, entryName);                if (file.exists()){                    file.delete();  // I don't know how to append, so delete it always                }                os = new FileOutputStream (file);                 int bytesRead = 0;                 while ((bytesRead = in.read (_fileIOBuffer))!= -1) {                    os.write(_fileIOBuffer, 0, bytesRead);                    // progress procedure                }                os.close();            }        }    }    catch (FileNotFoundException e) {                Log.v(""unzip"", e.getMessage());    }     catch (IOException e) {        Log.v(""unzip"", e.getMessage());    }     finally{        if (in != null ){            in.close();        }        if (os != null ){            os.close();        }    }}       </code></pre><p>Thanks in advance,yokyo</p>","366049","","","","","2010-06-19 12:13:29","How should I decompress a large data file in AsyncTask.doInBackground?","<android>","1","2","2","",""
"3074398","1","3076125","","2010-06-19 04:54:06","6","7034","<p>My app correctly runs in full screen when it's started. However after minimizing and then returning to the app, the status bar pops up and pushes my views down a little. How can I keep the status bar from moving my views?</p><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""xmlns:myapp=""http://schemas.android.com/apk/res/com.example.draw""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;    &lt;com.example.draw.DrawView         android:id=""@+id/draw""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:visibility=""visible""        android:fitsSystemWindows=""false""    /&gt;      &lt;com.admob.android.ads.AdView            android:id=""@+id/ad""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""       myapp:backgroundColor=""#000000""       myapp:primaryTextColor=""#FFFFFF""       myapp:secondaryTextColor=""#CCCCCC""       android:layout_gravity=""bottom""/&gt;     </code></pre><p></p><p>Here is part of my activity's onCreate:</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);  </code></pre><p>I also have the fullscreen theme in the manifest:</p><pre><code>android:theme=""@android:style/Theme.Black.NoTitleBar.Fullscreen""</code></pre><p>Thanks</p>","359917","","","","","2011-05-11 05:38:40","Android - status bar prevents full screen","<android><layout><fullscreen><statusbar>","3","1","4","",""
"3074438","1","3074807","","2010-06-19 05:10:47","1","1543","<p>Can I use getCacheDir() only in a class that extends Activity? I would like to use it in an AsyncTask so that I can do the time intensive cache file saving in it. </p><p>ThanksChris</p>","321927","","","","","2010-06-19 07:53:54","Android getCacheDir in AsyncTask","<android><caching><activity><android-asynctask>","1","0","","",""
"3074447","1","3075434","","2010-06-19 05:17:21","2","980","<p>i have been using a SQLite database, Theres a situation where i have a list which displays all the ""name"" field data of a table ""table1"". Now i have a button to insert data in ""table1"". The list is populated using a simple cursor adapter which is passed a cursor ""cursor1"" populated with the data. ""cursor1"" is prepared using the SQLite query - ""SELECT * FROM table1"". Now the moment i insert data, i need to update the list too.</p><p>My question is- </p><ol><li>will the Adapter sense the database change automatically (i guess not)?</li><li>using <code>cursor1.requery()</code> is correct or should i use <code>cursor1 = db.query(""table1"", null, null, null, null, null, null);</code></li></ol><p>It would be helpful if you can throw some light on which 1 is better and in which situation. Coz for the situation which i explained above, the <code>requery()</code> command is not giving a valid result while the later 1 works fine. still cant understand what the problem could be.</p>","238071","","238071","","2010-06-19 09:16:08","2010-06-19 12:15:25","choosing between requery or firing the query again in SQLite","<android><sqlite><sqlite3>","1","0","","",""
"3074679","1","3147676","","2010-06-19 07:03:42","17","2610","<p>I've got an android app that authenticates to an appengine app. I've had it working for a little while, until the authToken supplied to me (by android's AccountManager) expired, causing a 500 error when I tried to use it to get a session cookie.</p><p>I have now invalidated the authToken, but after that I still cannot authenticate. However, instead of throwing a 500 (as it did with the invalid auth token), it responds just like the successful case - but instead of setting a ""ACSID"" cookie as I expect, it sets ""SACSID"". It looks a lot like an authentication cookie (in that it's random-looking and long), but attempting to access authenticated resources using this cookie redirects me to the login page.</p><p>Any idea what's going on?</p>","144135","","","","","2012-03-01 19:58:43","Why am I getting a SACSID cookie from google appengine login instead of an ACSID?","<android><google-app-engine><authentication>","1","0","8","",""
"3074740","1","","","2010-06-19 07:27:21","2","740","<p>I am working on Android applictions since last 8 months. Iam interested in learning android middleware devlopement.I searched on google for this.But i haven't found any material.please send me,is there any material or tutorial or links to learn. Give me guidance to quick learning? </p><p>Regards,Rajendar</p>","362544","","","","","2010-06-19 07:27:21","Is there any material on Android middleware developement?","<android><middleware>","0","1","","2012-08-21 03:20:42",""
"3075009","1","3077050","","2010-06-19 09:23:15","34","27059","<p>I use an AsyncTask for loading operations that I implemented as an inner class. In onPreExecute() I show a loading dialog which I then hide again in onPostExecute(). But for some of the loading operations I know in advance that they will finish very quickly so I don't want to display the loading dialog. I wanted to indicate this by a boolean parameter that I could pass to onPreExecute() but apparently for some reason onPreExecute() doesn't take any parameters.The obvious workaround would probably be to create a member field in my AsyncTask or in the outer class which I would have to set before every loading operation but that does not seem very elegant. Is there a better way to do this?</p>","213817","","","","","2013-04-22 06:13:07","Android: How can I pass parameters to AsyncTask's onPreExecute()?","<android><methods><parameters><android-asynctask>","2","0","12","",""
"3075015","1","3075277","","2010-06-19 09:26:25","0","2161","<p>my app crashes with a null pointer exception on the code below.i have an xml preference file under res/xml/defaults.xmlAny idea why it's crashing?    </p><pre><code>public class Preference extends Activity {    public Preference()    {    }    public String getPreference(String key)    {                //it still crashes here        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());        String result = settings.getString(key,  null);        return result;    }}</code></pre>","242769","","242769","","2010-06-19 15:23:22","2010-08-19 06:08:13","Android ==> Preference?","<android><preferences><shared><android-preferences><sharedpreferences>","4","0","0","",""
"3075139","1","","","2010-06-19 10:19:50","1","6131","<p>I use the following code to take values from the textbox.But it's not working it gives the exception and force to close only.How to get the value of the textbox ?can anyone help me? </p><pre><code>public class alertwithlogin extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    showDialog(1);}@Overrideprotected Dialog onCreateDialog(int id) {  LayoutInflater factory = LayoutInflater.from(this);      final View textEntryView = factory.inflate(R.layout.alertedit, null);      return new AlertDialog.Builder(alertwithlogin.this)                      .setTitle(R.string.alert_dialog_text_entry)         .setView(textEntryView)         .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int whichButton) {              EditText edittext = (EditText) findViewById(R.id.username_edit);               Toast.makeText(getApplicationContext(),edittext.getText(),        Toast.LENGTH_SHORT).show();             }         })         .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int whichButton) {                                  }         })         .create();     }</code></pre><p>}</p><p>alertedit.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;TextView     android:id=""@+id/username_view""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_marginLeft=""20dip""    android:layout_marginRight=""20dip""    android:text=""@string/alert_dialog_username""    android:gravity=""left""    android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;EditText    android:id=""@+id/username_edit""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:layout_marginLeft=""20dip""    android:layout_marginRight=""20dip""    android:scrollHorizontally=""true""    android:autoText=""false""    android:capitalize=""none""    android:gravity=""fill_horizontal""    android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;        &lt;/LinearLayout&gt;</code></pre>","324223","","324223","","2010-06-19 10:37:01","2010-06-19 14:59:39","how to gettext from edittext in android?","<android>","1","1","2","",""
"3075149","1","6121240","","2010-06-19 10:21:32","2","1609","<p>In Android, is there a similar method to the repaint() in java?</p>","226220","","","","","2011-05-25 07:55:00","In Android, is there a similar method to the repaint() in java?","<android>","2","0","","",""
"3075165","1","3075423","","2010-06-19 10:25:39","7","5101","<p>i'm a bit stuck with remote services in android. thing is i implemented a remote service in package ""a.b.c"" and i want other applications to be able to access this service. i got rid of the whole crappy aidl-stuff and designed the ""interface"" of the service to work via broadcasted intents. works fine so far...</p><p>problem is: how do i get a <code>different</code> application (different package, different project, maybe even a different developer, ...) to start/stop the service?</p><pre><code>package d.e.f;import a.b.c.*;public class main extends Activity {    protected ImyService myService;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent intent = new Intent(ImyService.class.getName());        bindService(intent, sConnection, Context.BIND_AUTO_CREATE);    }    protected ServiceConnection sConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder binder) {            wlService = ImyService.Stub.asInterface(binder);            ServiceConnected = true;            Toast.makeText(main.this, ""service connected"", Toast.LENGTH_SHORT).show();        }        public void onServiceDisconnected(ComponentName className) {            wlService = null;            ServiceConnected = false;            Toast.makeText(main.this, ""service disconnected"", Toast.LENGTH_SHORT).show();        }    };}</code></pre><p>this will crash my app immediately on startup. what did i do wrong? how will i get this to work?</p><p>once it's running, commands and data will be passed via broadcasts. so that should be no real problem...</p>","370969","","","","","2010-06-19 12:11:22","how do i start (and bind) a remote service in android that is implemented in another app (different package)?","<android><service>","1","0","1","",""
"3075205","1","3075350","","2010-06-19 10:43:02","1","526","<p>For example: Say I searched something on the <a href=""http://www.walmart.com"" rel=""nofollow"">Walmart homepage</a>. Like <a href=""http://www.walmart.com/search/search-ng.do?search_constraint=0&amp;ic=48_0&amp;search_query=ipod&amp;Find.x=0&amp;Find.y=0&amp;Find=Find"" rel=""nofollow"">this</a>. How would I retrieve the information from the first product listed. Information like product name, price, details, rating, model. And how would I search in the box. The only way it seems like to me is to replace <i>http://www.walmart.com/search/search-ng.do?search_constraint=0&amp;ic=48_0&amp;search_query=<b>someProduct</b>&amp;Find.x=0&amp;Find.y=0&amp;Find=Find</i>. Then replace someProduct with the seach and call it in an HttpClient.</p>","200477","","","","","2010-06-19 11:43:38","Get web results from HttpClient for Android","<java><android><httpclient><webpagescraping>","1","0","","",""
"3075468","1","3076946","","2010-06-19 12:27:59","9","4572","<p>I've read about phonegap which enables users to write web-based apps for android and i was wondering:</p><ol><li>how is the performance of phonegap compared to a ""real"" android app</li><li>what would NOT work in phonegap?</li><li>i know it's possible to implement google maps with phonegap but i guess there's a lots of limitation compared to direct coding the maps under android?</li><li>as a newbie to android (but intermediate in web-programming), should I go for direct android coding instead of phonegap? </li></ol><p>i'm planning to write an app which uses google maps service+gps, database access and such, and i'm afraid it's not really possible with phonegap.</p><p>thx</p>","202862","","703019","","2012-03-04 22:18:42","2012-04-17 22:44:48","android / phonegap performance","<android><phonegap>","4","0","3","2012-08-21 03:57:45",""
"3075470","1","3165668","","2010-06-19 12:28:42","2","815","<p>I added a custom menu to the menu button using the following code:</p><pre><code>@Override    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        if (getDisplayedView() instanceof WorkspaceView) {            ((WorkspaceView) getDisplayedView()).showEditMenu();        }        return true;    }</code></pre><p>and</p><pre><code>public void showEditMenu() {        new EditMenu(lexs, ((Project) projects.getSelectedItem()).getName(), ((ProjectList) projectsList.getSelectedItem()).getName()).show();    }</code></pre><p>The EditMenu is implemented the following way:</p><pre><code>public class EditMenu {    private final String DELETE_PROJECT = ""Projekt löschen"";    private final String DELETE_LIST = ""Liste löschen"";    private final String RENAME_PROJECT = ""Projekt umbenennen"";    private final String RENAME_LIST = ""Liste umbenennen"";    private final String CLOSE = ""Menü schliessen"";    private Context context;    private String projectName;    private String listName;    private AlertDialog alert;    private final CharSequence[] items = {DELETE_PROJECT, DELETE_LIST, RENAME_PROJECT, RENAME_LIST, CLOSE};    public EditMenu(Context context, String projectName, String listName) {        this.context = context;        this.projectName = projectName;        this.listName = listName;    }    public void show() {        AlertDialog.Builder builder = new AlertDialog.Builder(context);        builder.setTitle(projectName + "": "" + listName);        builder.setItems(items, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                if (items[item].equals(DELETE_PROJECT)) {                    deleteProject();                } else if (items[item].equals(DELETE_LIST)) {                    deleteList();                } else if (items[item].equals(RENAME_PROJECT)) {                    renameProject();                } else if (items[item].equals(RENAME_LIST)) {                    renameList();                } else if (items[item].equals(CLOSE)) {                    close();                }            }        });        alert = builder.create();        alert.show();    }    private void deleteProject() {    }    private void deleteList() {    }    private void renameProject() {    }    private void renameList() {    }    private void close() {    }}</code></pre><p>This works correctly if I click the menu button the first time. But if the context menu is closed and i click the menu button a second time, nothing happens.</p><p>I also tried to call</p><p>alert.close(), alert.hide(), alert.dismiss(), etc in the method close(), but it doesn't improve the situation. any hints? thankS¨!</p>","","anon","","","","2010-07-02 12:34:52","Menu button can only be clicked one time","<android>","1","1","","",""
"3075506","1","3075732","","2010-06-19 12:42:26","28","29180","<p>I'm writing an application that connects to a webservice and I don't want it to wait too long if it can't get a connection. I therefore set the connectionTimeout of the httpparams. But it doesn't seem to have any effect whatsoever.</p><p>To test I turn of my WLAN temporarily. The application tries to connect for quite some time (way more than the 3 seconds I want) and then throws an UnknownHostException.</p><p>Here is my code:</p><pre><code>try{    HttpClient httpclient = new DefaultHttpClient();    HttpParams params = httpclient.getParams();    HttpConnectionParams.setConnectionTimeout(params, 3000);    HttpConnectionParams.setSoTimeout(params, 3000);    httppost = new HttpPost(URL);    StringEntity se = new StringEntity(envelope,HTTP.UTF_8);    httppost.setEntity(se);    //Code stops here until UnknownHostException is thrown.    BasicHttpResponse httpResponse = (BasicHttpResponse) httpclient.execute(httppost);    HttpEntity entity = httpResponse.getEntity();    return entity;}catch (Exception e){    e.printStackTrace();}</code></pre><p>Anyone have any ideas what I missed?</p>","308788","","244296","","2010-12-08 14:04:34","2014-04-09 05:52:58","Http connection timeout on Android not working","<android><http><post><timeout>","5","0","24","",""
"3075556","1","","","2010-06-19 13:00:01","1","652","<pre><code>    public class a extends Activity {    public static final String SOAP_ACTION = ""http://vladozver.org/GetAllCategories"";    public static final String METHOD_NAME = ""GetAllCategories"";    public static final String NAMESPACE = ""http://vladozver.org/"";    public static final String URL = ""http://192.168.1.3/Services/CategoryServices.asmx"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv = (TextView)findViewById(R.id.TextView01);        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet = true;        envelope.setOutputSoapObject(Request);        envelope.addMapping(NAMESPACE, ""Category"",new Category().getClass());        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);        try        {            androidHttpTransport.call(SOAP_ACTION, envelope);            SoapObject response = (SoapObject)envelope.getResponse();            Object o = (Object)envelope.getResponse();            SoapObject obj = (SoapObject)o;             // DOESNT WORK ...             Category[] res = new Category[obj.getPropertyCount()];            for (int i = 0; i &lt; res.length; i++) {                res[i] = (Category)obj.getProperty(i);            }// DOESNT WORK ...                Vector&lt;Category&gt; cat = (Vector&lt;Category&gt;)response.getProperty(0);        }        catch(SoapFault sf)        {            sf.printStackTrace();        }        catch(Exception e)        {            e.printStackTrace();        }    }}public class Category implements KvmSerializable{    public int CategoryId;    public String Name;    public String Description;    @Override    public Object getProperty(int arg0) {        switch(arg0)        {        case 0:            return CategoryId;        case 1:            return Name;        case 2:            return Description;        }        return null;    }    @Override    public int getPropertyCount() {        // TODO Auto-generated method stub        return 3;    }    @Override    public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {        // TODO Auto-generated method stub        switch(index)        {        case 0:            info.type = PropertyInfo.INTEGER_CLASS;            info.name = ""CategoryId"";            break;        case 1:            info.type = PropertyInfo.STRING_CLASS;            info.name = ""Name"";            break;        case 2:            info.type = PropertyInfo.STRING_CLASS;            info.name = ""Description"";            break;        default:break;        }    }    @Override    public void setProperty(int index, Object value) {        // TODO Auto-generated method stub        switch(index)        {        case 0:            CategoryId = Integer.parseInt(value.toString());            break;        case 1:            Name = value.toString();            break;        case 2:            Description = value.toString();            break;        default:            break;        }    }}</code></pre>","371006","","","","","2010-06-19 17:01:47","How to retrieve array ( list, vector , anything ) of objects as a result from .NET web service in Android?","<.net><android><web-services>","1","0","3","",""
"3075603","1","","","2010-06-19 13:14:09","0","330","<p>when I am trying to install my application apk into suitable emulator the followingerrors are coming</p><p>C:\Program Files\android-sdk-windows\tools>adb install TeslaWorldNet.apk1583 KB/s (2911477 bytes in 1.796s)Can't dispatch DDM chunk 46454154: no handler definedCan't dispatch DDM chunk 4d505251: no handler defined        pkg: /data/local/tmp/TeslaWorldNet.apkFailure [INSTALL_FAILED_OLDER_SDK]</p><p>What is the problem .Thanks in advance</p>","454808","","","","","2013-08-25 05:47:34","Application install problem","<android>","3","1","","",""
"3075637","1","3075945","","2010-06-19 13:25:58","8","10841","<p>In Android, what is the simplest approach to the following:</p><ol><li>Load an image from a remote server.  </li><li>Display it in an ImageView.</li></ol>","200145","","200145","","2012-03-09 10:35:11","2012-10-30 16:26:47","Loading remote images","<android><image><imageview>","4","0","4","",""
"3075781","1","","","2010-06-19 14:19:17","0","341","<p>I am compressing a bitmap object to OutputStream using <strong>""Compress""</strong> function. Here is my code:</p><pre><code>try {                    if (bitmap != null) {                        bitmap.compress(Bitmap.CompressFormat.JPEG, 100,                                bytes);                    } else {                        Message message = handler.obtainMessage(1, ""false"");                        handler.sendMessage(message);                        return;                    }                } catch (OutOfMemoryError oom) {                    System.gc();                    Message message=handler.obtainMessage(1,""false"");                    handler.sendMessage(message);                    return;                } catch (NullPointerException npe) {                    System.gc();                    Message message = handler.obtainMessage(1, ""false"");                    handler.sendMessage(message);                    return;                } catch (Exception e) {                    System.gc();                    Message message = handler.obtainMessage(1, ""false"");                    handler.sendMessage(message);                    return;                }</code></pre><p>when i am running this code on G1 and hero, i am getting a proper output stream( which i later save to a image file on sdcard). But when i test this code on Google nexus, i am getting a blurry image after converting the output stream in an image file.</p><p><strong>FYI</strong></p><p>OS: Android 1.5;G1 and Hero are on 1.5 OS and nexus is on 2.0</p><p>Please help.. is there a known issue in nexus?? or am i doing something wrong??</p>","152867","","31161","","2011-08-05 11:15:10","2011-08-05 11:15:10","discripencies while compressing a bitmap on Google nexus","<android><nexus-one><nexus-s>","1","0","","",""
"3075857","1","3075868","","2010-06-19 14:42:38","0","175","<p>Some on of you saw <a href=""https://squareup.com/features"" rel=""nofollow"">this</a>.</p><p>So the question is, how to access mobile audio out in read mode?</p><p>Thank you!</p>","359839","","","","","2010-06-19 14:47:12","Read from ""output"" as from ""input""","<iphone><android><windows-mobile><symbian><maemo>","1","0","","",""
"3075963","1","3075982","","2010-06-19 15:10:00","0","348","<p>iam using  intent to call activity here and i need to send  to long variable to the other  acitivity ?<br>Porjct.java</p><pre><code>      Intent i = new Intent(ProjectList.this,RoleList.class);  Bundle c = new Bundle();              c.putLong(""PID"", projectID );  c.putLong(""CTSID"", castingTimeSlotID);  i.putExtras(c);  startActivityForResult(i,0);  finish();</code></pre><p>RoleList.java</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent data) {                Bundle c = new Bundle();        c = data.getExtras();    projectID = b.getLong(""PID"");    castingTimeSlotID = b.getLong(""CTSID"");}</code></pre><p>this is not working , Please  help me out?</p>","164850","","164850","","2010-06-21 08:34:19","2010-06-21 14:01:12","i need to send two long variable to the other acitivity ? Please help me out?","<android>","2","0","","",""
"3075989","1","3259307","","2010-06-19 15:17:43","1","2570","<p><em>EDIT:</em> This problem may be related to <a href=""http://stackoverflow.com/questions/3121153/baseadapter-causing-listview-to-go-out-of-order-when-scrolled"">http://stackoverflow.com/questions/3121153/baseadapter-causing-listview-to-go-out-of-order-when-scrolled</a></p><hr><p>My main application screen uses a GridView to display a grid of icons. Each icon has an image, name, and Intent. I have the Activity set to handle orientation changes so I can change the background. The onCreate method sets up the GridView with 3 test icons that don't do anything and a preferences icon which opens a PreferencesActivity:</p><pre><code>super.onCreate(savedInstanceState);setContentView(R.layout.main);GridView gv = (GridView) findViewById(R.id.main_grid);if (getResources().getConfiguration().orientation ==        Configuration.ORIENTATION_LANDSCAPE)    gv.setBackgroundResource(R.drawable.main_bg_horiz);else    gv.setBackgroundResource(R.drawable.main_bg);ArrayList&lt;Icon&gt; icons = new ArrayList&lt;Icon&gt;();icons.add(new Icon(""Test 1"", R.drawable.test1, null));icons.add(new Icon(""Test 2"", R.drawable.test2, null));icons.add(new Icon(""Test 3"", R.drawable.test3, null));icons.add(new Icon(""Preferences"", R.drawable.perferences, new Intent(this,        AlertPreferences.class)));IconAdapter ia = new IconAdapter(icons);gv.setAdapter(ia);gv.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3){        Intent i = ((IconAdapter)arg0.getAdapter()).getItem(arg2).getIntent();        if (i != null)            HomeActivity.this.startActivity(i);    }});</code></pre><p>And the onConfigurationChanged is very simple:</p><pre><code>super.onConfigurationChanged(newConfig);    GridView gv = (GridView) findViewById(R.id.main_grid);if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)    gv.setBackgroundResource(R.drawable.main_bg_horiz);else    gv.setBackgroundResource(R.drawable.main_bg);</code></pre><p>The background changes just fine but the code introduces a new problem with the GridView. Whatever orientation I start the application in it works just fine. However, when I change orientation, the order of the icons in the GridView reverses. And when I rotate the screen back to the orientation it started in, everything goes back to normal. What's going on here?</p>","370556","","370556","","2010-06-25 20:18:19","2010-07-15 19:39:59","Android GridView Reversing After Handling Orientation Change","<android><gridview><screen-orientation>","2","0","1","",""
"3076031","1","","","2010-06-19 15:32:16","5","9171","<p>I'm currently working on my first android application. I am using a tabbed layout for my application. I followed the tutorial for this on the dev guide and ran into a problem. The tutorial only used three tabs, but I have a need for more. As such, the tabs resize and bunch up. I was hoping someone could tell me how I can make them scroll, like in dolphin browser when using multiple tabs. Thanks!</p><p>~aaron</p>","371018","","","","","2012-11-22 10:11:15","Android: Scrollable tabs","<android><tabs>","3","0","5","",""
"3076061","1","3076185","","2010-06-19 15:41:24","0","1008","<p>I have been developing an Android app and testing with a 1.5 AVD and the manifest setting of </p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p>My goal is to make this app available to all phones running 1.5 and greater. I had thought that as long as I develop to 1.5 then that was basically all I had to worry about and any phone running 1.5 or higher would see my app in the market and be able to install it. The following documentation however has me concerned that the app may not in fact be visible to all phones in the market unless I go through the following steps to manage various screen sizes and densities.</p><p>My layout is very basic and I do not manage any alternate layouts for high resolution, I just let android manage the scaling. Do I need to follow these guidelines in order to have my app visible to all phones 1.5 and higher? Or is this only necessary in certain circumstances?</p><p>From<a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a></p><pre><code>Strategies for Legacy ApplicationsIf you have already developed and published an Android application based on Android 1.5 or earlier platform version, you need to consider how you will adapt your application so that it is deployable to* Existing devices, which may be running Android 1.5 (or lower) platform version, as well as to* Newer devices that are running Android 1.6 (or higher) and offering various screen sizes and resolutionsTo support the newer devices and the different screens they use, you might need to make some changes in your app, but at the same time your app may be very stable and so you want to minimize the changes. There are a variety of ways that you can extend your existing application to support new devices with multiple screens and existing devices running older platform versions. You should be able to make these changes to your application such that you can distribute a single .apk to any and all devices.The recommended strategy is to develop against the most recent version of the platform you are targeting, and test on the minimum one you want to run on. Here's how to do that:   1. Maintain compatibility with existing devices by leaving your application's android:minSdkVersion attribute as it is. You do not need to increment the value of the attribute to support new devices and multiple screens.   2. Extend compatibility for Android 1.6 (and higher) devices by adding a new attribute — android:targetSdkVersion — to the uses-sdk element. Set the value of the attribute to ""4"". This allows your application to ""inherit"" the platform's multiple screens support, even though it is technically using an earlier version of the API.   3. Add an empty &lt;supports-screens&gt; element as a child of &lt;manifest&gt;. If you need to enable size or density attributes later, this is where you will add them.   4. Change your application's build properties, such that it compiles against the Android 1.6 (API Level 4) library, rather than against the Android 1.5 (or earlier) library. You will not be able to compile your application against the older platform because of the new manifest attribute.   5. Set up AVDs for testing your application on Android 1.6 and higher releases. Create AVDs that use the screen sizes and densities that you want to support. When you create the AVDs, make sure to select the Android 1.6 or higher platform as the system image to run. For more information, see How to Test Your Application on Multiple Screens, below.   6. Set up AVDs for testing your application on Android 1.5 (or earlier platform). You need AVDs running the older platforms you are targeting, so that you can test for compatibility and ensure that there are no functional regressions.   7. Compile your application against the Android 1.6 library and run it on the AVDs you created. Observe the way your application looks and runs, and test all of the user interactions.   8. Debug any display or functional issues. For issues that you resolve in your application code, make certain not to use any APIs introduced in API Level 4 or later. If you are in doubt, refer to SDK reference documentation and look for the API Level specifier for the API you want to use. Using an API introduced in API Level 4 or later will mean that your application will no longer be compatible with devices running Android 1.5 or earlier.   9. For resource-related issues, you can try resolving them by:      * Adding a anyDensity=""false"" attribute to &lt;supports-screens&gt;, to enable density-compatibility scaling.      * Creating any size- or density-specific resources you need and placing them in directories tagged with the correct qualifiers. Qualifiers must be arranged in a proscribed order. See Alternative Resources for more information.      * Note that if you add size- or density-specific resource directories tagged with any of the resource qualifiers listed in this document, you should make sure to also tag those directories with the v&lt;api-level&gt; qualifier (for example, -v4). This ensures that those resources will be ignored when the application is run on Android 1.5 or lower platform versions.  10. If your application does not offer support (such as custom layouts) for large screens and you want the platform to display your application in screen-compatibility mode on larger screens, add a largeScreens=""false"" attribute to the &lt;supports-screens&gt; element in the manifest. See Screen-Compatibility Examples for illustrations of how the platform displays your application in this case.  11. If your application does not offer support (such as custom layouts) for small screens (such as on a QVGA low-density screen) and you do not want Android Market to offer the application to users of small-screen devices, you must add a smallScreens=""false"" attribute to the &lt;supports-screens&gt; element.  12. Continue testing and debugging until your application performs as expected on all of the platforms and screen sizes your application will support.  13. Export, zipalign, and sign your application using the same private key you used when publishing the previous version, then publish the application to users as an update.</code></pre>","268648","","","","","2012-10-25 14:52:32","Android - how to design an app that targets all platforms (1.5 and higher)","<android>","1","0","1","",""
"3076139","1","","","2010-06-19 16:02:02","5","2263","<p>I have defined a splashscreen to be shown during loading. But depending on the internet connection it can takes only 600ms to load or sometimes 5000ms. So i defined that the splashscreen is at least shown 3000ms so that the user is not irritated by flackering screen.</p><p>I define the start of the splashscreen the following way:</p><pre><code> private void splashScreen() {        setContentView(R.layout.splashscreen);        splash = (ImageView) findViewById(R.id.splashscreenLayer);        startSplashTime = new Date();        new LoadingThread().start();     }</code></pre><p>In the LoadingThread I check the network and load data from the Internet:</p><pre><code>private class LoadingThread extends Thread {        @Override        public void run() {            checkNetwork();        }    }</code></pre><p>As soon as loading is done, i send a message to my handler defined in the MainActivity:</p><pre><code>public void stopSplash() {        Message msg = new Message();        msg.what = STOPSPLASH;        Date endSplashTime = new Date();        long time = endSplashTime.getTime() - startSplashTime.getTime();        System.out.println(""Time Splashscreen was displayed: "" + time);        if (time &lt; SPLASH_MIN_TIME) {            long delay = SPLASH_MIN_TIME - time;            System.out.println(""Delay Splashscreen for: "" + delay);            splashHandler.sendMessageDelayed(msg, delay);        } else {            System.out.print(""Show Splashscreen now"");            splashHandler.sendMessage(msg);        }    }</code></pre><p>Some code lines on the LoadingThreads are called by runOnUIThread(). Unfortunately, if time &lt; SPLASH_MIN_TIME the message isn't delayed but send instantly. I think with sendMessageDelayed() this shouldn't be the case. Anybody knows why?The sysout shows that the delay time is calculated correctly. Thanks!</p>","","anon","935627","","2012-08-24 19:08:24","2013-11-26 07:44:32","Handler.sendMessageDelayed(msg, delay) not working correctly","<android><multithreading><handler><android-handler>","1","1","","",""
"3076197","1","3076890","","2010-06-19 16:14:33","3","2187","<p>I have a variable of type Bitmap and I would like to assign it to a Contact from my contact list as the CalledID picture, how would I do that?</p>","290613","","918414","","2012-06-30 04:15:22","2012-06-30 04:15:22","How to programmatically assign a picture (Bitmap) to a contact?","<android><bitmap><contacts><google-contacts>","1","1","1","",""
"3076213","1","3076559","","2010-06-19 16:16:28","0","1224","<p>I'm really new in Android programming, so I have a simple question getting a phone number from contacts in my application. The method I want to implement is that the user clicks a button in my app and will be forwarded to the contacts. In contacts user has to click on a phone number and this number should be returned to a textfield. Is there a simple way to do this instead to implement it by ContentResolver?</p><p>Thanks for your answer.</p>","371089","","","","","2012-01-03 14:18:39","Android: Simple way to call phone book and return number","<android>","1","0","","",""
"3076286","1","3077729","","2010-06-19 16:33:15","1","1240","<p>What's the easiest way to display an active (initiating a call on click) phone number in an Android app? </p><p>It would have been great if there was a View subclass, called something like PhoneNumberView, that has all the functionality and UI integrated.</p>","200145","","200145","","2010-06-19 16:59:17","2010-06-20 00:17:37","Displaying phone numbers in Android","<android>","3","0","","",""
"3076446","1","3076471","","2010-06-19 17:08:46","1","154","<p>Given an Android app that does NOT require any of the features that need to be declared in the </p><pre><code>&lt;uses-feature&gt; </code></pre><p>element of the manifest, is it best to omit this element entirely or include it with no attributes? Will either option have any different effects on your apps visibility/availability in the market?</p>","268648","","","","","2010-06-19 17:14:43","Android - is <uses-feature> element necessary?","<android>","1","0","","",""
"3076457","1","3077602","","2010-06-19 17:11:30","5","8659","<p>Is it possible to load an image from a remote server using ImageView.setImageURI(Uri uri)?</p>","200145","","200145","","2012-10-10 15:12:52","2012-10-10 15:12:52","Does ImageView.setImageURI(Uri uri) work with remote files?","<android>","2","3","","",""
"3076529","1","","","2010-06-19 17:29:39","1","6587","<p>I want to write a native application in Android for testingsurfaceflinger. Is there any simple program that shows how to createsurface, register buffers and post buffers on Surfaceflinger.</p>","371134","","777408","","2012-07-19 16:10:48","2013-05-17 06:59:54","surfaceflinger test program","<android><android-ndk><native><platform><surfaceflinger>","5","0","1","",""
"3076747","1","3076800","","2010-06-19 18:35:15","1","2644","<p>How can i set  the button to show a different image after it's been tapped?Either a different image, or maybe some kind of highlighting that shows the button was tapped/</p><p>Thanks</p>","242769","","","","","2010-06-19 18:50:14","Android Button ==> Set highlighted image?","<android><button><background-image><highlight><selected>","1","0","","",""
"3076749","1","3076765","","2010-06-19 18:35:31","1","1724","<p>I have some web pages that I want to bundle with my Android application and display as static pages.  Where do I put them?  How do I access them?  I'm working in Eclipse, so I want a solution that automatically bundles them.</p><p>I've tried putting my web pages in res/raw, and I can read them as an input stream from there, so I could push that into a WebView.  But I'd really prefer if I could stick them somewhere and access them with a URL.  I've tried file:///android_asset/about.html but that didn't work.  Surely there's a way to form a URL to display bundled pages.</p>","85348","","","","","2010-08-04 22:12:34","How do I access local web pages on the Android?","<android>","1","0","","",""
"3076889","1","","","2010-06-19 19:15:19","0","4488","<p>I'm trying to make a ticker widget for BBC News, most of it was working perfectly well last night, but I had a few issues getting the permissions for the configuration activity correct. After re-writing my Manifest nothing works at all, despite being completely how it should be as far as I can tell.</p><p>Here's my 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.news.bbcwidget""    android:versionCode=""1""    android:versionName=""101""&gt;    &lt;application        android:label=""@string/app_name""        android:icon=""@drawable/logo""        android:permission=""android.permission.INTERNET""        android:persistent=""true""        android:debuggable=""true""        android:enabled=""true""&gt;        &lt;activity            android:name=""BBCWidgetConfig""            android:permission=""android.permission.INTERNET""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.appwidget.action.APPWIDGET_CONFIGURE"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity            android:name=""Launcher""            android:permission=""android.permission.INTERNET"" /&gt;        &lt;receiver            android:name=""BBCNewsWidget""            android:permission=""android.permission.INTERNET""&gt;            &lt;service                android:permission=""android.permission.INTERNET""                android:name=""BBCNewsService"" /&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data                android:resource=""@xml/bbcnews""                android:name=""android.appwidget.provider"" /&gt;        &lt;/receiver&gt;        &lt;service android:name=""BBCNewsWidget$BBCNewsService"" /&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>and here are the key bits of the errors received:</p><blockquote>  <p>06-19 20:06:34.339: WARN/ActivityManager(58): Permission Denial: Accessing service ComponentInfo{com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget$BBCNewsService} from pid=58, uid=1000 requires android.permission.INTERNET<br>  06-19 20:06:34.529: ERROR/AndroidRuntime(247): java.lang.RuntimeException: Unable to start receiver com.news.bbcwidget.BBCNewsWidget: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET<br>  06-19 20:06:34.529: ERROR/AndroidRuntime(247): Caused by: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET<br>  06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DELETED cmp=com.news.bbcwidget/.BBCNewsWidget (has extras) } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget<br>  06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DISABLED cmp=com.news.bbcwidget/.BBCNewsWidget } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget</p></blockquote><p>It was previously giving ""bad process"" errors but that seems to have stopped now. From what I understand the Manifest is giving android.permission.INTERNET to all of my services, activities and the AppWidgetProvider, so I don't understand why this is happening. it used to work before!</p><p>Cheers!</p>","371189","","436938","","2012-03-19 10:33:08","2012-03-19 10:33:08","Manifest file not giving permissions as it should. Permission denied when they're given in Manifest","<android>","1","0","","",""
"3076893","1","3076945","","2010-06-19 19:17:18","0","335","<p>There are a few G1 users reporting that my app won't display images.  I can only imagine this is because they don't have an SD card.</p><p>My app is heavy on images.  Is it appropriate to store images on the internal memory?  I don't even know if there'd be enough space.</p>","238849","","","","","2010-06-20 00:14:11","Where should I store images if the user doesn't have an SD card?","<android>","2","0","","",""
"3076931","1","3077323","","2010-06-19 19:28:09","4","914","<p>For an improved bugreporting I'd like if the tag <code>android:versionName</code> automatically contains the number of the revision on the svn server. Anyone knows how to do that? Thanks</p><p>`</p>","","anon","","","","2010-06-25 12:48:05","How to automatically update android:versionName?","<android><svn><manifest>","2","2","1","",""
"3076983","1","3077012","","2010-06-19 19:46:12","1","586","<p>i want to achieve this kinda of row look in my app.</p><p>I already have a ImageView/TextView layout, but i want that 'positive' little image in the right always being displayed at the exact same place!</p><p><img src=""http://cache.ctoof.com/2010/03/gowalla-1.png""></p><p>Thanks!</p>","2443607","","","","","2010-06-19 19:54:20","Various items in a ListView row - screenshot example","<android><listview><row><imageview>","1","0","1","",""
"3077056","1","","","2010-06-19 20:07:33","1","400","<blockquote>  <blockquote>    <p>CoreStartHere.java</p>  </blockquote></blockquote><pre><code> public class CoreStartHere extends TabActivity {    : t = getTabHost(); t.newTabSpec(""tTask""); t.setIndicator(...); t.setContent(new Intent().setClass(this, T1Task.class); :}</code></pre><blockquote>  <blockquote>    <p>t1Task.java</p>  </blockquote></blockquote><pre><code>    T1Task extends Activity { : onCreate(Bundle ...) {  :  myListview = (ListView) findViewById(R.id.hdListView);  myEditText = (EditText) findViewById(R.id.hdEditText);  hdItems  = newArrayList &lt;String&gt;();  aa = new ArrayAdapter &lt;String&gt;(this, R.layout.hditemview, hdItems);  :  setOnKeyListener (new OnKeyListener() {   onKey(...) {    :    hdItems.add(0, myEditText.getText().toString());    aa.notifyDatasetChanged();    :   }  } }}</code></pre><blockquote>  <blockquote>    <p>hditemview.xml</p>  </blockquote></blockquote><pre><code>    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android"" class=""com.a1.hd.hdRecordTaskListItemView"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""10dp"" android:scrollbars=""vertical"" android:textColor=""@color/HD_Text"" android:fadingEdge=""vertical"" /&gt;</code></pre><blockquote>  <blockquote>    <p>hdRecordTaskListItemView.java</p>  </blockquote></blockquote><pre><code>    hdRecordTaskListItemView extends TextView { // has 3 constructors // onDraw}</code></pre><p>None of the constructor in hdRecordTaskListItemView  get invoked and not surprisingly onDraw does not get called either.  What is missing? - any suggestions or questions - please let me know. The text appears with the default style. The onDraw is supposed to draw on the ""canvas"".Thank you</p>","355975","","243782","","2010-06-19 20:11:20","2010-06-20 01:07:33","using a class derived from TextView","<android><draw>","1","0","","",""
"3077231","1","","","2010-06-19 21:07:08","2","983","<p>Hi im retrieving image from URI and displaying in Imageview.</p><p>I need to re-size image from URI to fit size of the Imageview.</p><p>Pls help me how i can do this.</p><p>Thanks</p>","341443","","","","","2010-06-19 22:02:08","How to resize image from Uri?","<android><android-emulator><android-widget>","1","0","","",""
"3077283","1","","","2010-06-19 21:21:28","1","1602","<p>How do I track the memory used by OpenGL textures in Android? I understand the texture memory is on the Video RAM, but do they get swapped in with the RAM? If I call glGenTextures and do not call glDeleteTextures, how does it impact the memory usage of my current process?</p>","277450","","","","","2010-06-20 16:23:11","Track opengl texture memory in Android","<android><opengl-es><android-ndk>","1","0","1","",""
"3077289","1","3077403","","2010-06-19 21:24:24","8","2692","<p>i have a problem with this intent. this intent is supose to send a text type of message. everything works email,sms,twitter and whatever is on the phone. but the only one that has a problem is facebook, it will try to post as a link and not a text.</p><pre><code>Intent s = new Intent(android.content.Intent.ACTION_SEND);  s.setType(""text/plain"");  s.putExtra(Intent.EXTRA_SUBJECT, ""Quote"");  s.putExtra(Intent.EXTRA_TEXT, qoute);  startActivity(Intent.createChooser(s, ""Quote""));</code></pre>","326423","","808940","","2011-09-14 22:40:51","2012-07-17 07:35:14","Facebook Android Intent","<android><facebook>","1","8","2","",""
"3077432","1","3077449","","2010-06-19 22:12:48","0","44","<p>I am using Gamelogic class which implements no one (just object to be honest )</p><p>I want from him to set a database where the game screen ask the logic questions and the last ask the sql question without all the Context usage , just to keep it simple .</p><p>is it possible ? if not what is the alternative?</p><p>Can someone show me little example?  I am lost and the notepad example does not help </p><p>thanks, yoav. </p>","368440","","67097","","2012-05-31 01:40:34","2012-05-31 01:40:34","android sqlight invoked from class","<java><sql><android><android-widget>","1","0","","",""
"3077453","1","","","2010-06-19 22:17:50","0","740","<p>I'm writing an app that will periodically send information out to a remote server, and then get relevant information about other users from that server back to the local database.  What's the best way to handle sending out this info (i.e.: XML or binary) and writing it to the remote server.  </p><p>Also, how can I assure that, when 500+ users' data get's to the server or FTP (or better alternative?) at once, the appropriate fields gets overwritten or added, without skipping any or overwriting the entire thing?  Thanks for the help.</p>","356976","","","","","2012-07-24 10:50:05","Reading/writing data to server, ftp, or website","<android><database><field><read-write>","2","0","","",""
"3077461","1","3077508","","2010-06-19 22:21:35","86","21267","<p>I'm new to Android programming and I'm using <code>AsyncTask</code>s to fetch data in response to the user pressing a button. This works well and keeps the interface responsive while fetching the data, but when I checked out what was going on in the Eclipse debugger, I found out that every time a new <code>AsyncTask</code> was created (which is quite often, because they can only be used once), a new thread was being created but never terminated. The result is a large number of <code>AsyncTask</code> threads just sitting there. I'm not sure if this is a problem in practice or not, but I'd really like to get rid of those extra threads. How can I kill these threads?</p><p>Thanks!</p>","118391","","","","","2014-01-25 16:27:07","AsyncTask threads never die (Android)","<android><multithreading><android-asynctask>","3","2","32","",""
"3077462","1","3094098","","2010-06-19 22:21:55","3","1744","<p>I have been developing an Android application for about two months now, and the guy I'm writing it for wants me to use this instead of the android SDK so we can deploy the application for multiple smart phones: <a href=""http://rhomobile.com/"" rel=""nofollow"">http://rhomobile.com/</a></p><p>he says you can write the application in one language and it can be deployed for most smart phones. Has anyone used this website to do something similar? Any advantages or disadvantages I should know about and tell him? Maybe someone could give me a better explanation on what this really does.</p><p>I'm current a one man army. He wants the application out for most smart phones but can afford to hire more developers.</p>","110368","","508666","","2013-11-03 18:03:16","2013-11-03 18:03:16","developing smartphone apps using Rhomobile","<android><mobile-website><smartphone>","2","1","1","",""
"3077480","1","","","2010-06-19 22:28:00","1","1117","<p>I want to write the application which will transfer file from android (nexus1) to some other server by using GPRS.which protocol should i use and how to implement that?</p>","371271","","","","","2010-06-19 22:56:32","Transfer file from android(nexus1) to other server using GPRS","<android><file><transfer><gprs>","1","0","","",""
"3077727","1","3077974","","2010-06-20 00:16:39","1","13343","<p>I want to create a search bar just like the one in the <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"" rel=""nofollow"">twitter app</a>.  Is this possible?</p>","371301","","623518","","2012-05-01 08:38:17","2012-05-01 08:38:17","Creating a search bar","<android><searchbar>","2","0","","",""
"3077809","1","6146145","","2010-06-20 00:54:07","3","4023","<p>1) How would one go about altering/extending TextView to render inline images?</p><p>It seems that setText(Html.fromHtml(...image tags...)) might actually allow image insertion if set up correctly, but I haven't tried myself. Even if, I would still need fine grained control over the image drawing (my final goal is to display inline animated smiley images). So unfortunately a view based on WebKit or similar is not an option either.</p><p>2) As an alternative solution I thought of mixing TextViews and ImageViews (or more specifically, custom subclasses thereof which allow animation), but I'm not sure how I could achieve proper wrapping there (I'm fairly new to Android).</p>","371306","","","","","2012-07-21 05:46:20","Images in TextView","<android><animation><textview><imageview>","2","1","","",""
"3077826","1","3077849","","2010-06-20 00:58:39","1","121","<p>I'm making a calculator-type application and it will have a resulting string that is generated by user-given inputs.  This is my first android app, so I am not too familiar with the SDK.  In main.xml I can make the static, non-changing strings, but how can I similarly display a string that can change and has no set value?</p>","371312","","","","","2010-06-20 01:12:58","Displaying a non-static string on an Android app?","<java><android><user-interface><mobile>","1","0","","",""
"3077854","1","3077892","","2010-06-20 01:17:02","1","580","<p>Let's say you want to have a TextView and a Button in a Layout with horizontal orientation. Can you have the TextView aligned to the left and the Button - to the right?</p><pre><code>---------------------TextView       Button---------------------</code></pre>","200145","","200145","","2010-06-20 01:30:03","2010-06-20 05:12:11","How do you put two Views in a horizontal Layout so that one is aligned to the left and the other one - to the right?","<android><layout><user-interface>","2","0","","",""
"3077916","1","3077932","","2010-06-20 01:44:38","0","502","<p>I am developin with Eclipse on an Android device. Each time I want to install the new version of the app on the device I need to connect it, enable USB Debugging, install the app, disable USB Debugging, unplug the device (optional). I was wondering if it was safe to just unplug the device without disabling USB Debugging. After all, the device is not mounted, right? But there is the adb, talking to it. It would be much more convenient to be able to do that. Does anyone know if it is safe or unsafe?</p>","363293","","","","","2010-06-20 01:50:01","Is it safe to unplug the phone while USB Debugging is turned on?","<android>","1","0","","",""
"3077977","1","3077998","","2010-06-20 02:11:48","2","662","<p>Curious, if I can invoke some 3rd party activity, and then in onActivityResult read my original intent data.</p>","62192","","","","","2010-06-20 02:22:39","Can I get original request data (intent extras) in onActivityResult callback?","<android>","1","0","0","",""
"3077994","1","3078721","","2010-06-20 02:21:11","2","7665","<p>I want to know the distance of two points or the width and height distance of my current mapview in km unit. Is there any android map api to do that?</p>","238061","","","","","2010-06-20 09:10:48","How to calculate distance between two GeoPoints with Android MapView","<android><google-maps>","1","0","","",""
"3078081","1","3166865","","2010-06-20 03:07:55","24","12333","<p>Let's say I want all the TextView instances in my app to have textColor=""#ffffff"". Is there a way to set that in one place instead of setting it for each TextView?</p>","200145","","200145","","2012-08-30 21:31:05","2012-11-10 14:14:43","Setting global styles for Views in Android","<android>","3","2","15","",""
"3078301","1","3078659","","2010-06-20 05:13:39","5","5773","<p>I am currently considering to develop an application for processing ofimages captured by the camera of mobile phones using the Android OS.Before I make the decision to go forth, I have done some research andfound out there are some complaints regarding the limits of the memoryallocated by the Dalvik VM, which seem to be limiting to applicationsthat require manipulation and processing of images.Which limits should i have in mind if i would have to process forexample 3 photos taken with the camera, in my process, applyingfilters, transforms and other types of mathematical operations?</p><p>I would like to know if it is possible to change the default value ofmemory allocated by the Dalvik VM for each application (this defaultis of 16 MB), in any way, using the Android 1.6 OS. Has anybody lookedinto this that can help me out please?</p><p>I have also read in the Android 2.1 compatibility definition document(available here:<a href=""http://static.googleusercontent.com/external_content/untrusted_dlcp/source.android.com/pt-PT//compatibility/android-2.1-cdd.pdf"">http://static.googleusercontent.com/external_content/untrusted_dlcp/source.android.com/pt-PT//compatibility/android-2.1-cdd.pdf</a>)that it is possible to change the allocation of memory by the DalvikVM from 16 MB to 24 MB or even a bigger amount if it is necessary, butit is not mentioned anywhere how this can be done.</p><p>If someone has looked into those issues before and could give me somehelp or hints, it would be greatly appreciated.Thank you.  </p>","371388","","","","","2013-02-01 00:34:44","Dalvik Memory Allocation - How to change the default limits?","<android>","2","1","2","",""
"3078323","1","3079097","","2010-06-20 05:30:56","1","1199","<p>I've got a ListView that works just great, except for this minor annoyance.  I can use the trackball/dpad to move up and down my list, and the background changes according to which row has focus.  But when I touch the row (click or long click), there's no background change letting me know what's been focused.  I've tried setting 'focusable' and 'focusable in touch mode' to true on the rows, but it still doesn't work.</p><p>Just in case it matters somehow:</p><ul><li>I am setting onClickListeners foreach row.</li><li>The row is comprised ofLinearLayouts, TextViews, and asingle ImageView.</li><li>Focusable/clickable is 'true' for each row.  Have not specified values for these on the ListView.</li><li>Trackable does act funny.  I can only move between rows after touching inside the ListView.  If I scroll trackball above the first item, it's impossible for me to scroll back into the list.</li></ul><p>Any thoughts?</p>","158766","","","","","2010-06-20 11:43:08","ListView items won't show focus when touched","<android><listview><views><listviewitem>","1","0","1","",""
"3078376","1","","","2010-06-20 06:05:40","0","844","<p>I'm trying to find a way to store the name of an icon in my database, then use that name to let a user select an icon from an ImageView. I've found various guides on ImageViews and Galleries, but none that show how to get/set the selected image by name. The list of available images won't change, but what's that best way to implement this?</p>","30512","","","","","2011-02-06 20:50:09","Android: Set selected icon in GridView","<java><android><gridview><gallery><imageview>","1","0","","",""
"3078538","1","5666657","","2010-06-20 07:39:52","2","4349","<p>old question: ""Why does creating a Toast crash my application?""   </p><p>My application runs fine if I don't use toasts but if I want to create and show a simple Toast like this:</p><pre><code>   Toast SimpleToast = Toast.makeText(getApplicationContext(), ""Just a toast."",Toast.LENGTH_LONG);   SimpleToast.setGravity(Gravity.TOP, 0, 0);   SimpleToast.show();</code></pre><p>I get these lines in the log and then the app crashes:</p><pre><code>NotificationService   enqueueToast pkg=games.MyAppName callback=android.app.ITransientNotification$Stub$Proxy@49603368 duration=1ResourceType          No package identifier when getting name for resource number 0x00000000AndroidRuntime        Shutting down VMdalvikvm              threadid=3: thread exiting with uncaught exception (group=0x4001b188)AndroidRuntime        Uncaught handler: thread main exiting due to uncaught exceptionAndroidRuntime        java.lang.NullPointerException</code></pre><p>I've checked and double checked the code above is what makes it crash.I'm running on the emulator as I currently don't have an android phone.</p>","360646","","881229","","2014-01-28 09:04:35","2014-01-28 09:04:35","Why does showing a Toast outside of onCreate() crash my application?","<android><android-emulator><toast>","6","0","0","",""
"3078625","1","3078655","","2010-06-20 08:25:14","0","568","<p>Will the data still be there after the user restarts his / her phone or changes SIM / battery?</p>","200145","","","","","2010-06-20 08:38:40","Is using Shared Preferences for storing user data reliable?","<android><data-storage>","2","0","","",""
"3078662","1","","","2010-06-20 08:40:53","1","3791","<p>I have customised the <code>spinner</code> items background into black color.But border around spinner and the separartor between each spinner item is in white color.I want to change separator color and border to dark gray color.</p><ul><li>How can i change these color?</li><li>Is spinner uses list view or some other as parent to populate items in spinner?</li><li>If so can i change the separator background of parent view?</li></ul>","324225","","119895","","2010-06-20 13:55:29","2010-06-20 14:02:57","How to change the border and separator color of spinner widget","<android>","1","1","2","",""
"3078682","1","","","2010-06-20 08:49:36","2","3240","<p>I'd like to develop apps for Android after 2 years of developing iPhone apps. First of all, I'm not a programmer. I'm a UI designer and usability engineer with basic knowledge of app programming. I have a colleague doing the part of the programmer. So my first look into the documents on developer.android.com titled ""UI design"" resultet in surprise. No real design guidelines, just clutter about coding, no concrete hints how apps have to look like what you are expecting when you read ""UI Design"". OK - Android is a very open system for many different hardware types - maybe a little bit hard to give advices that fit for all systems - but not impossible. Let's look at e.g. Symbian - it's relatively open too and they have this: forum.nokia.com/info/sw.nokia.com/id/8299c7a4-d3d8-4c4c-b62e-97a4c831e6a3/User_Experience_Evaluation_Model_v1_1_en.pdf.html<br>Great help, good basics!</p><p>Apple has this: <a href=""http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html"" rel=""nofollow"">http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html</a> Examplary done! </p><p>Now I am searching for the equivalent document for Android UI Devs (again, not the programming part). This one looks great: developer.android.com/guide/practices/ui_guidelines/index.html but it does not cover all scenarios and sooner or later gets lost in advices for coding.</p><p>I'm looking forward to your help.Many thanks and best regards.</p>","371446","","21234","","2010-06-22 14:18:53","2012-01-13 09:42:23","UI design guidelines of Android - where to be found?","<android><user-interface><ui-design>","4","1","3","",""
"3078794","1","3078815","","2010-06-20 09:42:17","3","936","<p>Is there a way to determine in an Android app which area of an ImageView (x,y coordinates, for instance) was clicked by a user? Thanks.</p>","299080","","","","","2010-06-20 09:51:41","Identifying image area clicked in Android?","<android><map><click><imageview>","1","0","","",""
"3078928","1","","","2010-06-20 10:37:27","3","1503","<p>I use the android 2.2 sdk under Windows Vista and I'm trying to get audio from the microphone using plug on my computer. I try example from <a href=""http://www.benmccann.com/blog/android-audio-recording-tutorial/"" rel=""nofollow"">this tutorial</a>, but each time my application is stopped by android emulator.</p><p>Is it possible to use <code>AudioRecord</code> with microphone in the emulator?</p>","342251","","64421","","2013-04-07 05:45:52","2013-04-07 05:45:52","Android emulator and voice recognition","<android><android-emulator><microphone>","0","0","","",""
"3078960","1","3079087","","2010-06-20 10:50:52","1","211","<p>I want an widget that one can sign on it on the tocuh screen its ambivalent to painter so is there a way using the painter in my application?... thanx</p><p>i want it too fit the 2.1 version does it exist ?</p>","368440","","","","","2010-06-20 11:39:28","signature widget (painter) does it exists in android?","<android>","1","0","2","",""
"3078980","1","","","2010-06-20 10:58:17","4","1869","<p>I have a bit of a strange bug with a widget I've coded- after the screen rotates the widget stops responding to onClick events. The code is exactly the same as in the Android Developer Documentation for App Widgets <a href=""http://developer.android.com/guide/topics/appwidgets/index.html#Providers"" rel=""nofollow"">here</a>. I've noticed other widgets from the market don't have this problem- is there a known workaround perhaps? I've tried tapping all over the place after a rotation so I don't think its the onClickPendingIntent not being resized after a rotation; it doesn't seem to be present at all.</p><p>I can't find an onRotation() kind of trigger for the AppWidgetProvider to redo the listening code in the event of a rotation so I'm quite unsure how to proceed...</p><p>Thanks!</p>","371189","","","","","2011-01-14 17:02:28","Auto Screen Rotation Disabling Widget RemoteView onClick event","<android><appwidget>","1","0","","",""
"3079292","1","","","2010-06-20 12:53:26","1","3523","<p>I am very new to android, so I am experimenting with the tutorial code.  In particular, the notepad.</p><p>If you look here: <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html</a>, at <strong>Step 5</strong> they are putting values so that it can be used by NoteEdit.</p><p>I would like to pass a reference of NotesDbAdapter into NoteEdit so that I can actually do some entirely different things.</p><p>It does not seem to invoke a constructor though.  I have tried adding a paramiter to NoteEdit onCreate, but it does not seem to like this? :-(</p><p>I most look forward to hearing your answers, experts! :-D</p>","371522","","","","","2010-06-20 13:26:15","Pass reference to another activity - Android","<java><android><database>","2","1","","",""
"3079365","1","3079443","","2010-06-20 13:23:37","8","15393","<p>I would like to retrieve the name of a contact associated with an incoming telephone number. As I process the incoming number in the broascastreceiver having a String with the name of the incoming caller would help my project greatly.</p><p>I would think this involves a query using the sql WHERE clause as a filter, but do I need to sort the contacts? An example or hint would be of great assistance.</p>","371532","","1041245","","2012-02-09 07:51:40","2013-08-05 18:12:14","Android: Retrieve contact name from phone number","<android><contacts><contactscontract><telephone>","3","0","5","",""
"3079458","1","3079610","","2010-06-20 13:52:50","1","1723","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6068803/how-turn-on-only-camera-flash-light-programmatically-in-android"">How Turn on only Camera flash light programmatically in android?</a>  </p></blockquote><p>I am developing an android application in which i have to work with camera flash.</p><p>The application is something like, when i get let say SMS, the camera flash will flash for 5 times, whn i get an incoming phone it will flash for 7 times, something like that.</p><p>I have searched a lot but i m not getting the exact solution about how to access the camera flash like this.</p><p>so, if anyone can help on this topic, that should be great.</p><p>thank you.</p><p>Regards,Tejas</p>","371542","","","","","2010-06-21 15:42:18","Android - Using Camera Flash","<android>","1","0","","2011-09-28 11:18:55",""
"3079466","1","","","2010-06-20 13:54:33","1","248","<p>I would like to send a notification in a broadcast receiver. the notification should launch the default sms app.</p><p>Ultimately I want to create my own notifications for incoming text messages consistent with what the deault app, Handcent, and Chomp do.</p><p>I have the code to detect the threadId of the incoming sms.</p><p>How can I craft the intent to attach to the pendingIntent of the notification?</p><p>The following shows how to launch the sms app opening a particular thread, but the Intent creates a null pointer when I initialize it. Is it because it is being initialized in a broadcastReceiver, and not an activity?</p><p><a href=""http://stackoverflow.com/questions/1412221/how-to-open-up-a-specify-sms-in-android"">http://stackoverflow.com/questions/1412221/how-to-open-up-a-specify-sms-in-android</a></p>","371532","","371532","","2010-06-20 14:42:16","2010-06-20 14:42:16","Android: Trouble declaring intent to be fired from a pendingIntent in a notification; done in a broadcastReceiver","<android><multithreading><sms><android-intent><broadcastreceiver>","0","4","","",""
"3079548","1","3079644","","2010-06-20 14:22:03","2","4044","<p>I want to disable the recent apps intent that is fired from the icon when you hold the home button. I am currently detecting, in the <code>onCreate()</code>, if the intent is fired from the quick launch dialog, and then I call <code>finish()</code>.</p><p>This entails that when the application goes to the background <code>finish()</code> is called so that when the app is launched it goes through the <code>onCreate()</code>. This requires strategic coding when switching between activities in the application.</p><p>I guess I can fire <code>finish()</code> in the <code>onResume()</code> also after detecting where the intent came from, but a bunch of unnecessary coding can be eliminated if the quick launch intent can simply be disabled.</p><p>Can the quick launch intent be disabled?</p>","371532","","317773","","2011-08-10 06:05:17","2011-08-10 06:05:17","Android: Disable recent apps intent","<android><android-intent><quicklaunch>","1","4","1","",""
"3079585","1","3079609","","2010-06-20 14:31:41","0","191","<p>In Eclipse, I have set my project's target build to 2.0.1 (right click on project folder -> Properties -> Android).<br>In my AVD manager I have a number of emulators - one for 1.5, one for 1.6 and one for 2.0.1.<br>How do I tell Eclipse to run the project (built to 2.0.1) on the 1.5 emulator?<br>The ""Run configurations"" menu gives me only the 2.0.1 emulator...</p><p>Any advice is appreciated.<br>Thanks, Rob</p>","283630","","","","","2010-06-20 14:40:11","Android: run 2.0.1 app on 1.5 emulator in Eclipse","<android><eclipse><emulator>","1","0","","",""
"3079611","1","3079656","","2010-06-20 14:40:32","0","69","<p>I wanna implement a download-and-install mechanism. I have a source link where my app gonna download from, an apk file.</p><p>Ive managed to do it, but i payed attention to the fact, that it first download then when it finish downloading it pop up an installation window and then install.</p><p>now this this can interrupt the user, if he is in the middle of conversation or some anothe opeartion, and all of a sudden the installtaion pop-up window, coming up after download successful.</p><p>In the market it works in a diffrent way: first it's up an installation window, and then downloading, and installing (in the background)</p><p>how can i achive it also the same way as the downloading mechanism of the market?</p><p>thanks,</p><p>ray.</p>","260511","","260511","","2010-06-21 08:50:41","2010-06-21 08:50:41","Installation pop-up perior to the download . how?","<android>","1","0","","",""
"3079652","1","3079708","","2010-06-20 14:54:17","2","1711","<p>I would like to know if there is a way of using the notication bar in order to do some operations (onClick), without having an activity being launched/resumed.</p><p>for example.. let's say i raise a notifcation, and when the user press on it, then instead of take me to some activity, it invoke some regular method in my current activity/service</p><p>Is there any way to implement such a thing?</p><p>for example the current notifcation code do a standart behave onClick. running up an activity.. how will channge the code in order to invoke some method instead of an activity?</p><pre><code>        messagesManager = (NotificationManager)                context.getSystemService(Context.NOTIFICATION_SERVICE);    Notification notification = new Notification(R.drawable.icon, message,            System.currentTimeMillis());    PendingIntent contentIntent = PendingIntent.getActivity(context, 0,            new Intent(context, someActivity.class), 0);    notification.setLatestEventInfo(context, ""notification"", message,            contentIntent);    messagesManager.notify(R.string.noto, notification);</code></pre>","273550","","273550","","2010-06-21 06:59:00","2010-06-21 06:59:00","Custom Notification","<android>","2","0","","",""
"3079707","1","3079751","","2010-06-20 15:11:21","6","1834","<p>I want to have an options menu that is available to all Activities in my app (on pressing the MENU button). I've been doing this by creating it in onCreateOptionsMenu(Menu menu) for each Activity but this seems redundant. </p><p>Is there a way to create it in one place and have it available in all Activities?</p>","200145","","200145","","2010-06-20 15:29:22","2011-10-15 22:59:47","Creating an options menu that is available to all Activities in an application","<android>","3","0","2","",""
"3079740","1","","","2010-06-20 15:19:52","1","221","<p>I would like to create am timer application(with alarm) for android mobile .I can able to make timer with one sound. By storing the .mp3 in Raw folder </p><p>A drop down which contain sound list would be interesting. Bt in android their is no drop down option. I found Spinner is helpful in this. </p><p>Problem:= How can we add different sound to spinner...</p>","371567","","243782","","2010-06-20 15:25:08","2010-06-20 16:10:52","How can we add different sound to spinner (music play)","<java><android><spinner>","1","0","","",""
"3080144","1","3080261","","2010-06-20 17:09:37","1","298","<p>I am trying to create a custom control which does nothing except decorate the text which is displayed.  When I reference this class inside the main.xml like all the examples which I am reading and deploy this to the emulator, the widget just says ""Problem Loading Widget."" </p><p>I am beginning Android development and just trying to understand how to dev custom controls:</p><p>This is the ExtendedTextView control:</p><pre><code>package uk.co.andrewrea.android;import android.content.Context;import android.util.AttributeSet;import android.widget.TextView;public class ExtendedTextView extends TextView {    public ExtendedTextView(Context context) {        super(context);        // TODO Auto-generated constructor stub    }    public ExtendedTextView(Context context, AttributeSet attrs){        super(context,attrs);    }    public ExtendedTextView(Context context, AttributeSet attrs, int defStyle){        super(context, attrs, defStyle);    }    @Override    public CharSequence getText() {        // TODO Auto-generated method stub        return ""***"" + super.getText() + ""***"";    }}</code></pre><p>And this is 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:layout_width=""fill_parent""  android:orientation=""vertical""  android:background=""@drawable/widget_bg_normal""  android:layout_gravity=""center""  android:layout_height=""wrap_content""&gt;&lt;uk.co.andrewrea.android.ExtendedTextView android:id=""@+id/widget_textview""  android:text=""@string/hello""  android:layout_height=""wrap_content""  android:layout_width=""wrap_content""  android:layout_gravity=""center_horizontal|center""  android:layout_marginTop=""5dip""  android:padding=""10dip""  android:textColor=""@android:color/black""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Cheers,</p><p>Andrew</p>","67959","","105224","","2010-06-20 17:14:51","2010-06-20 17:41:09","Cannot get my Custom Android View to display","<java><android>","1","0","","",""
"3080183","1","3080299","","2010-06-20 17:18:47","0","68","<p>i have this code :</p><pre><code>    private void insertValus() {        ContentValues initialValues = new ContentValues();          for (int i = 0 ; i &lt; COUNTRIES.length ; i++){              Character tmp = (Character)COUNTRIES[i].charAt(0);              initialValues.put(VALUE, COUNTRIES[i]);              initialValues.put(TYPE, ""country"");              initialValues.put(LETTER,tmp.toString(tmp));          db.insert(TABLE_NAME, null, initialValues);          }    }public boolean existInDataBase(String userChoice) {        boolean returnval = true;        //gameList[0]        Cursor cursor = db.query(TABLE_NAME, new String[] {VALUE}        ,VALUE+"" like "" + ""'%""+ userChoice +""%'"", null, null, null, null);        if (cursor != null)//i always enter here even if the string is no country            returnval = false;        return returnval;</code></pre><p>and what ever i insert even if the query result should b false(meanning cursor == null)</p><p>and two more question</p><ol><li><p>how can i see the database that i have build in the emulator??</p><p>2.should i run him outside my app and then to append it to my app or in first compiltion at user he will suffer a little overhead in the first time he use this app?</p></li></ol>","368440","","301832","","2010-07-21 09:53:15","2010-07-21 09:53:15","sql android something seems to b wrong how do you deduce from a cursor the query status","<android><sqlite>","1","0","","",""
"3080287","1","3080370","","2010-06-20 17:49:47","3","2772","<p>I am new to developing for android. I have a question regarding some best practices. My app is like a dashboard from which multiple different ""sub-activities"" can be started and done. </p><p>I am wondering what is the best way to structure the app. One way is to have different layouts and load and unload them appropriately. The other is to start new activities using intents. At least this is what i have gathered from what i have read.</p><p>What in your opinion is the best way to go.</p><p>Thanks</p>","146699","","","","","2010-06-20 18:42:11","Android App with multiple views - Best Practices?","<android>","3","1","4","",""
"3080402","1","3080483","","2010-06-20 18:20:53","20","22374","<p>I would like a ScrollView to start all the way at the bottom. Any methods?</p>","371532","","114066","","2012-09-13 14:21:36","2014-02-27 14:59:34","Android: ScrollView force to bottom","<android><android-scrollview>","6","1","3","",""
"3080454","1","3080503","","2010-06-20 18:35:12","1","4598","<p>I'm relatively new to Java, eclipse and android so this could be a completely silly question, but I'm going to ask it none the less. </p><p>I've got a project I'm learning with to test connecting to the flickr api and simply displaying recent images. I'm at the point now where I want to parse the JSON received from flickr. I've downloaded gson 1.4 and added the zip to the java build path through ""add external jars."" It's successfully loaded and I can see google-gson under referenced libraries in the package explorer. My problem is, when I try to use it, I simply get an error. </p><p>Gson gson = new Gson();</p><p>It highlights Gson and says that ""Gson cannot be resolved to a type."" What am I missing here? It worked once and has since stopped. I've tried removing the jars, cleaning the project and re-adding the jars but it still doesn't work. </p><p>Am I just completely noobing this up or is there another problem?</p>","109589","","","","","2011-04-08 04:36:53","Android Eclipse Error: ""Gson cannot be resolved to a type""","<java><android><eclipse><json>","2","0","","",""
"3080516","1","3080568","","2010-06-20 18:50:58","0","1233","<p>Let me start out by saying that I feel like there should be a very simple way to do this, and it's entirely possible I'm missing something very simple. But all the examples I find for transition animations (push left out, push right in, etc.) deal with moving from one view to another. What about an application that only has one view, but dynamically changes the data feeding that view?</p><p>The best common example of this is the base calendar app. It has identical views, but when you swipe forward or backward the date of the view transitions with a swipe animation.</p><p>How do I reproduce this? Surely I don't have to inflate ViewFlippers for the same view? And if so, what is the best way to go about this?</p><p>Thanks in advance.</p>","355016","","","","","2010-06-21 02:08:19","How to transition between data in a single dynamic view in Android","<android>","2","0","","",""
"3080577","1","6783637","","2010-06-20 19:09:17","11","9110","<p>You've got a View defined in a layout file. How do you remove it from you Activity code?</p>","200145","","","","","2011-07-21 22:36:17","Removing a View from an Activity","<android>","1","0","","",""
"3080638","1","3141459","","2010-06-20 19:26:27","0","650","<p>Any idea what's the equivalent of <code>com.google.android.maps.ItemizedOverlay.populate()</code> method in case of <code>OpenSteeMapViewItemizedOverlay</code> ?</p>","306346","","","","","2010-06-29 14:09:13","Equivalent of com.google.android.maps.ItemizedOverlay.populate() for OpenStreeMaps (OSMDroid)","<android><google-maps><populate><openstreetmap><android-maps>","1","0","1","",""
"3080714","1","3081098","","2010-06-20 19:48:18","4","3758","<p>Are there Android app templates, similar to the iPhone SDK templates?</p>","224988","","224988","","2010-06-20 21:14:30","2013-08-08 19:33:49","Android App Templates?","<android><sdk><templates>","2","0","4","2013-08-08 19:56:54",""
"3080794","1","3080989","","2010-06-20 20:15:08","1","326","<p>I have a ListView with hundreds of rows sorted A to Z.  I'd like to create a Composite Widget located on the right with TextViews labeled A to Z.  Touching each TextView will filter the ListView and only display records that start with the letter of the TextView.  For example, touching C will filter all rows and only display items that start with the letter C.</p><p>I could simply create 26 TextViews labeled A to Z, but I'd like to only create TextViews of letters of items in the ListView.  That is, if there are no items that begin with X, then don't create an X TextView and create TextViews of letters of items in the ListView.  If the items in the ListView are apple, banana and grape, then create three TextViews labled A, B and G.</p><p>Can Android support this?  Is this a bad design?  What do you recommend?  Thanks in advance!</p>","291981","","","","","2010-06-20 21:23:21","Android Composite Widget -Static or Dynamic - Comments","<android>","1","0","0","",""
"3080869","1","","","2010-06-20 20:39:47","1","891","<p>I have an ImageView with absolute size and position (in the FrameLayout):</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    layout((int)left, (int)(bottom-width), (int)(left+width), (int)bottom);}</code></pre><p>now when I change my ImageResource with:</p><pre><code>setImageResource(...);</code></pre><p>the position of all Images is set to top left for one second.. and then switches back to normal!</p><p>i also use:</p><pre><code>@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    setMeasuredDimension((int)width, (int)width);}</code></pre>","371691","","371691","","2010-06-21 11:37:21","2010-06-21 11:37:21","Positioning an imageview inside a FrameLayout with layout?! (changing ImageResource)","<android><imageview>","0","2","","",""
"3081147","1","3081747","","2010-06-20 22:14:41","3","1146","<p>So I am working on a new basic 2d game for Android and was setting up my usual implementation of a game thread working with a SurfaceView. While typing away, I realized that, while this seems to work, I would really like to know if there is a better way to achieve the same results. Here are the basics of what I do right now (I apologize for the verbosity, I'm trying to compress as much as possible):</p><p>GameActivity class</p><pre><code>@Overridepublic void onCreate(final Bundle savedInstanceState){    super.onCreate(savedInstanceState);    this.setContentView(R.layout.game);    this.mGameView = (GameView)this.findViewById(R.id.gameview);}</code></pre><p>XML layout</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;com.package.name.GameView    android:id=""@+id/gameview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:focusable=""true""        android:focusableInTouchMode=""true"" /&gt;&lt;/merge&gt;</code></pre><p>GameView</p><pre><code>@Overridepublic void surfaceCreated(final SurfaceHolder holder) { }@Overridepublic void surfaceChanged(final SurfaceHolder holder, final int format,                             final int width, final int height){    this.mGameThread = new GameThread(this.getContext(), holder,                                         width, height);    this.mGameThread.start(); // starts the game}@Overridepublic void surfaceDestroyed(final SurfaceHolder holder){    // flips volatile flag stopping execution    // then calls .join()    this.mGameThread.release(); }</code></pre><p>GameThread class</p><pre><code>@Overridepublic void run(){    // load game state    while (this.mRunFlag) // volatile loop flag    {        // game loop    }    // save game state}</code></pre><p>As you can see, basically I depend on the SurfaceHolder's callbacks to manage the game. This works well as orientations change, etc. but without asking, I may never know if this can be achieved in a better way, which I would be anxious to learn if there is. So that's why I'm asking! Any thoughts?</p><p>(The reason I'm so curious is because I almost entirely ignore the Activity life-cycle events, and feel this may be a problem...)</p>","2053380","","","","","2010-06-21 02:03:15","Android game thread lifecycle implementation","<java><android><multithreading>","1","0","","",""
"3081176","1","3081260","","2010-06-20 22:25:40","1","1779","<p>In one of my Activities I have a ListView that displays a list of locations. For each list item I want a little arrow icon that points in the direction of the corresponding location. I implemented this icon by extending ImageView. This custom View has a listener that reacts to changes of the device's orientation by rotating the icon image accordingly. I register the listener in the onAttachedToWindow() method and unregister it in onDetachedFromWindow(). This kind of works but the problem is that onDetachedFromWindow() sometimes gets called only a long time after the containing Activity has paused. Also, the whole layout overall seems a little hacky. So my question is: Is there a proper way to unregister the listeners or would you implement this in a completely different way to begin with?</p>","213817","","","","","2010-06-20 23:09:48","Android: Detect if a View's parent Activity is paused","<android><view><activity><listener>","1","0","","",""
"3081276","1","3081465","","2010-06-20 23:15:52","12","10632","<p>When the soft keyboard opens I want a scroll view to scroll down to the bottom.</p><p>For this I can use: fullScroll(View.FOCUS_DOWN);</p><p>But how do I fire that command after the soft keyboard opening event triggers?</p>","371532","","","","","2013-04-27 03:04:34","Android: Detect softkeyboard open","<android><view><scroll>","3","0","1","",""
"3081349","1","","","2010-06-20 23:39:35","0","208","<p>Android: I am programming an app that is beginning to use a massive amount of text. I'm putting all of my text in a string file and calling it from there and then placing portions of it into a textview.</p><p>Is there a limit to that or is there a better way to store text (in a file or database?) and then retrieve it to go into a textview and if so...any examples?</p>","237863","","","","","2010-06-21 00:15:55","How much text can fit into a string.xml file?","<android>","1","1","","",""
"3081440","1","3081545","","2010-06-21 00:06:49","5","879","<p>I have a problem with the alertdialog.builder in the following code:</p><pre><code>    public void showSettingsBox(){  final CharSequence[] items = {""Item1"", ""Item2"", ""Item3""};  final boolean checked[] = new boolean[]{false,false,false};  AlertDialog.Builder builder = new AlertDialog.Builder(fLabyrinthGame);   builder.setMessage(fMessage)   .setCancelable(false)   .setMultiChoiceItems(items, checked, new OnMultiChoiceClickListener() {    @Override    public void onClick(DialogInterface dialog, int which, boolean isChecked) {     CharSequence text = ""Item number "" + which;     int duration = Toast.LENGTH_SHORT;     Toast toast = Toast.makeText(fLabyrinthGame, text, duration);     toast.show();    }   })   .setPositiveButton(""Apply"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {     dialog.cancel();    }   });  builder.setTitle(fTitle);   builder.setIcon(R.drawable.icon_exclamation);   AlertDialog alert = builder.create();   alert.show();    }</code></pre><p>The three items and checkboxes are not displayed, there is just one white line between the title bar and the Apply-Button. Does anybody know why this does not work?</p>","371764","","6391","","2010-06-21 00:44:16","2010-06-21 00:44:16","AlertDialog.Builder: No items for checkboxes are shown","<android><alertdialog>","1","0","","",""
"3081600","1","","","2010-06-21 01:04:26","0","318","<p>I have a widget that works great across all phones except the Motorola Backflip.  The problem occurs with my layout in landscape mode where some of my graphics are cut off.  It looks like this is because of the screen size of the backflip is smaller than the normal android phone.</p><p>I do not want to upset all my regular users by shrinking the layout for all phones.  Is there a way I can make a landscape layout that only affects Backflip or users with screens lower than 3.2""?</p><p>Update:I tried making a folder called layout-land-ldpi but it just gives an error about the resource name being invalid.</p><p>Also, this has to be compatible with Android 1.5 devices.  Since 25% of all users are still running 1.5 devices we have to keep them happy since they paid :-)</p><p>Thanks!</p>","242904","","242904","","2010-06-21 02:36:33","2010-06-21 02:36:33","Landscape layout res folder for the Backflip and small screens?","<android>","0","3","","",""
"3081667","1","3082085","","2010-06-21 01:29:49","1","548","<p>I have created a class with 3 sub classes in Java.  The 3 sub classes contain variables to store information from my XML document.  I am able to store in the first two for there are only single instances of the data in the XML.  The third class contains variables that repeat multiple times.  I want to store an object of ""third class"" objects. I also have a SAX parser class.  I am doing this within an Android environment (1.6).</p><p>Does this make enough sense without displaying any code?  </p>","2186261","","126916","","2010-06-21 03:55:36","2010-06-21 04:17:26","How do you store XML data in a java object from a SAX parser?","<java><xml><android>","2","0","","",""
"3081711","1","3082431","","2010-06-21 01:48:00","2","3522","<p>What is the difference of events of onFling() and onScroll() of android.view.GestureDetector.OnGestureListener?<a href=""http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html"" rel=""nofollow"">link text</a></p>","347611","","","","","2012-10-03 14:01:44","android.view.GestureDetector.OnGestureListener onFling() vs onScroll()","<android><event-handling><gesture>","4","0","2","",""
"3081778","1","3082362","","2010-06-21 02:18:46","5","22566","<p>I have a semi-complicated problem and hoping that someone here will be able to help me.</p><p>On a click event I create a thread and start a long-running operation based on <a href=""http://jnb.ociweb.com/jnb/jnbJan2009.html"">this</a> method.  After the long-running task is completed, it does a callback to another method, which does a post to the handler: </p><pre><code>@Overridepublic void contentSearchModelChanged(Model_ContentSearch csm, ArrayList&lt;Class_Reminder&gt; newRemindersList) {    remindersList = newRemindersList;    mHandler.post(mUpdateDisplayRunnable);}</code></pre><p>Which calls a Runnable:</p><pre><code>// post this to the Handler when the background thread completesprivate final Runnable mUpdateDisplayRunnable = new Runnable() {  public void run() {    updateDisplay();  }};</code></pre><p>Finally, here is what my updateDisplay() method is doing:</p><pre><code>private void updateDisplay() {    if (csModel.getState() != Model_ContentSearch.State.RUNNING) {        if(remindersList != null &amp;&amp; remindersList.size() &gt; 0){                r_adapter = new ReminderAdapater(Activity_ContentSearch.this, remindersList, thisListView);                thisListView.setAdapter(r_adapter);                r_adapter.notifyDataSetChanged();        }    }}</code></pre><p>This works beautifully when I do this normally.  However, if I change the orientation while the long-running operation is running, it doesn't work.  It does make the callback properly, and the remindersList does have items in it.  But when it gets to this line: </p><pre><code>r_adapter.notifyDataSetChanged();</code></pre><p>Nothing happens.  The odd thing is, if I do another submit and have it run the whole process again (without changing orientation), it actually updates the view twice, once for the previous submit and again for the next.  So the view updates once with the results of the first submit, then again with the results of the second submit a second later.  So the adapater DID get the data, it just isn't refreshing the view.</p><p>I know this has something to do with the orientation change, but I can't for the life of me figure out why.  Can anyone help?  Or, can anyone suggest an alternative method of handling threads with orientation changes?</p><p>Bara</p>","164312","","164312","","2010-06-21 02:33:23","2011-03-07 07:04:53","Android: notifyDataSetChanged() not updating listview after orientation change","<android><listview><multithreading><orientation><android-arrayadapter>","2","0","1","",""
"3081842","1","","","2010-06-21 02:41:09","1","2950","<p>I want to use onSizeChange to detect the height difference in a LinearLayout when the soft keyboard comes on screen. I want to issue fullScroll(View.FOCUS_DOWN); at that point. An example would be greatly appreciated.</p>","371532","","746010","","2012-01-29 07:02:40","2012-01-29 07:02:40","Android: onSizeChanged, an example?","<android><size>","1","0","","",""
"3081881","1","3084364","","2010-06-21 02:58:12","2","6120","<p>I try to swap expandablelistview group background image when it is collapse or expand. But the background image was not correctly swap. For example when I expand the first group, background of second or third group get swapped.</p><p>I am using RelativeLayout (group layout) and SimpleExpandableListAdapter (adapter). Here is what I did:</p><pre><code>// Create 2 drawable background. One for collapse and one for expandprivate Drawable collapseBG, expandBG;private ExpandableListView myView;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    collapseBG = getResources().getDrawable(R.drawable.box_bg_header_collapse);    expandBG = getResources().getDrawable(R.drawable.box_bg_header_expand);    myView = (ExpandableListView) findViewById(R.id.myView);}myView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {    public void onGroupCollapse(int groupPosition_c) {        myView.getChildAt(groupPosition_c).setBackgroundDrawable(collapseBG);    }});myView.setOnGroupExpandListener (new ExpandableListView.OnGroupExpandListener() {    public void onGroupExpand(int groupPosition_e) {        myView.getChildAt(groupPosition_e).setBackgroundDrawable(expandBG);    }});</code></pre><p>Is anyone know how to make this works?</p>","371801","","","","","2011-08-11 16:50:25","Android expandablelistview group/parent background image change when collapse or expand","<android><expandablelistview>","2","0","1","",""
"3081927","1","","","2010-06-21 03:19:49","2","1744","<p>Is it possible to have a clickable ImageButton on Expandablelistview child item? If yes, how to program its event listener?</p>","371801","","","","","2011-01-29 11:02:11","ImageButton on Expandablelistview child item","<android><expandablelistview>","1","0","","",""
"3081962","1","3340724","","2010-06-21 03:30:13","0","638","<p>I need some help to make a widget that basically when clicked it access the internet and copy text from a single website link and display it in the widget? and guidance on how to do that or even better a simple example? I did finalized the widget so I just need the part where I grab the text from the website.</p><p>Thanks a lot.</p>","308238","","","","","2010-07-27 04:24:22","How to copy plain text from a website and display it in a widget on android?","<android><text><website><copy>","1","1","1","",""
"3081963","1","5330344","","2010-06-21 03:30:34","4","987","<p>Could you please explain me purpose and usage of LauncherActivity? Documentation says that it ""Displays a list of all activities which can be performed for a given intent"". I understood that it should automatically build list of all activities found in application and provide their launching. Am I right?</p><p>And how to use it? I have found no examples in the web.</p>","303212","","","","","2011-03-16 19:09:35","LauncherActivity usage","<android><activity>","1","1","","",""
"3081986","1","3082007","","2010-06-21 03:39:52","0","2459","<p>I would like to open a custom dialog when someone clicks on a listview entry.  That dialog will need to know the text that was clicked on in order to display additional information on that particular entry.  Can anyone point me in the right direction on how to accomplish that? Thanks!</p>","48784","","","","","2010-06-21 03:47:19","Open a Custom Dialog when clicking on a listview entry","<android><listview><dialog>","1","0","","",""
"3082077","1","3084074","","2010-06-21 04:14:12","0","1776","<p>I have 2 apps and both integrate a package containing an activity. My problem is that when I launch any one app, and when it calls the activity inside the package, it shows me a dialog:</p><p>Complete action using:</p><p>App1</p><p>App2</p><p>I want to eliminate this dialog, so it just launches the activity from its own integrated package. </p><p>Currently, my AndroidManifest.xml contains for the package activity:</p><pre><code>        &lt;intent-filter&gt;            &lt;action android:name=""com.example.test.TestActivity"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>ThanksChris</p>","321927","","","","","2012-04-12 20:03:42","Android Eliminate Complete Action Using dialog","<android><action><manifest><using><complete>","1","2","","",""
"3082224","1","","","2010-06-21 05:06:18","-1","457","<p>in my application result displayed in Text view is disappeared when mobile orientation is changed,for this what can i do.i want my application in both modes means portrait and landscape.for this what can i do.Give me some suggestions.Thanks in advance</p>","454808","","","","","2012-12-13 14:23:29","result is disappeared when mobile orientation is changed","<android>","3","1","","",""
"3082235","1","3464032","","2010-06-21 05:09:26","2","722","<p>when i deal with deleting a contact using new google api,i got the problem</p><p><a href=""http://stackoverflow.com/questions/3058622/androidproblem-when-delete-contacts-please-help-me"">here is my problem</a></p><p>Following is the only response :</p><p>You have to run a sync process, so it updates with Google Contacts, than it will be removed permanently. Check for deleted flag</p><p>so what should i do to run a sync process which updates with Google Contacts?</p>","368868","","","","","2012-04-03 00:25:26","[Android]how to run a sync process which updates with Google Contacts?","<android><delete><sync><contact>","2","0","1","",""
"3082251","1","","","2010-06-21 05:14:46","0","172","<p>i'm beginner, i've installed android sdk n eclipse also... i've written code for temperature conversion i.e from Fahrenheit to Celsius but when i run on emulator the calculation part is not working i.e no error in code part n i think its not accepting the input values.... please help me</p>","371861","","184077","","2010-06-21 05:44:42","2011-03-09 15:44:11","How to start programming simple applications?","<android><android-emulator>","1","4","","",""
"3082325","1","","","2010-06-21 05:33:50","1","5418","<p>I'm trying to cache an image obtained from a website. However, CacheManager.getCacheFileBaseDir() always returns null. Do I need to create the cache folder in the android emulator? if yes, how can I do it? In which directory should it be created? </p>","679696","","114066","","2011-06-27 09:04:02","2013-07-04 00:19:36","My cache folder in Android is null. Do I have to create it?","<android><caching>","3","0","1","",""
"3082663","1","","","2010-06-21 07:03:14","0","176","<p>Does someone know of a library that is fairly ""drop in"" and allows you to easily put together multiple authentication options in an Android app to services like Facebook, OpenID, Twitter, etc. much like RPX does?</p>","334993","","","","","2011-02-11 16:22:33","Is there a library like RPX for Android?","<android><facebook><openid><oauth><rpx>","2","0","","",""
"3082694","1","3287371","","2010-06-21 07:10:58","1","761","<p>When I register a GpsStatus.Listener I do not get the event <code>GPS_EVENT_FIRST_FIX</code>. I do get the <code>GPS_EVENT_SATELLITE_STATUS</code> event.  </p><p>Does anybody already noticed this behavior?</p>","281535","","995926","","2012-05-05 13:33:31","2012-05-05 13:33:31","GpsStatus.Listener and GPS_EVENT_FIRST_FIX event","<android><gps><android-2.2-froyo>","1","0","","",""
"3082779","1","","","2010-06-21 07:28:38","2","6011","<p>Since I am newbie in Android, I don't know how to connect Android (2.1 on HTC Desire) with PPPoE using wifi connection.<br>So Please anybody know solution, then kindly help me.</p>","371926","","","","","2012-08-07 02:12:44","Is there a way to connect Wifi using PPPoE on Android?","<android><wifi><htc>","3","1","","",""
"3082780","1","","","2010-06-21 07:28:49","2","6730","<p>I use Instrumentation to test PhoneApp I wrote my test application via Instrumentation </p><p>I created apk and installed it on Nexus One - Android Phone - this passed In my code I am using internal classes that are not a part of standard SDK.I build it not in Eclipse but in my embedded env. I am eng in company that developing for Android so I have and Android tree with all internals libraries. </p><p>I use appropriate permissions in my manifest .</p><p>my apk created probably signed with some signature !! But probably this signature not good enough. </p><p>Now I run test via adb and got this error immediately: </p><pre><code>-------------------------------------------------------------------------------------INSTRUMENTATION_STATUS: id=ActivityManagerServiceINSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have a signature matching the target com.android.phoneINSTRUMENTATION_STATUS_CODE: -1java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have asignature matching the target com.android.phone-------------------------------------------------------------------------------------</code></pre><p>Please help. </p>","371927","","286595","","2010-06-21 07:36:40","2013-10-07 14:54:43","java.lang.SecurityException: Permission Denial:","<android>","7","0","","",""
"3083009","1","","","2010-06-21 08:15:34","2","3394","<p>Iam using a command: adb devices </p><p>and get this:C:>adb devicesList of devices attachedHT9CTP820385    device</p><p>My question is: where this serial number comes from?Does it burned on flash of device one time during a manufectoring or adb drivers assignes it dynamicallyor it comes with release that is burned on device?</p>","371927","","","","","2012-09-29 00:59:11","Serial number of device that presented upon adb devices","<android>","3","0","","",""
"3083041","1","3083106","","2010-06-21 08:21:13","0","294","<p>I'm trying to draw a line on canvas and project it into a map in android. I'm also using tabs for my app. When I'm flipping around tabs back and forward I'm losing the lines I drew. Is there a way to store them somehow so they will stay there all the time? MyLocationOverlay class looks like this:</p><pre><code>class MyLocationOverlay extends Overlay {    @Override    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)     {    super.draw(canvas, mapView, shadow);    Paint paint = new Paint();    paint.setStrokeWidth(2);    paint.setARGB(255, 153, 29, 29);    paint.setStyle(Paint.Style.STROKE);    if(controlPoints&gt;0)    {        Point point1_returned = new Point();                Point point2_returned = new Point();            Point point3_returned = new Point();        mapView.getProjection().toPixels(returned_pin1_geo, point1_returned);        mapView.getProjection().toPixels(returned_pin2_geo, point2_returned);        mapView.getProjection().toPixels(returned_pin3_geo, point3_returned);        canvas.drawLine(point1_returned.x, point1_returned.y, point2_returned.x, point2_returned.y, paint);        canvas.drawLine(point2_returned.x, point2_returned.y, point3_returned.x, point3_returned.y, paint);        canvas.drawLine(point3_returned.x, point3_returned.y, point1_returned.x, point1_returned.y, paint);        return true;    }     else    {        //Point lastPoint = new Point();        Point point = new Point();              // Converts lat/lng-Point to OUR coordinates on the screen.        Point myScreenCoords = new Point();             Point thirdPoint = new Point();        mapView.getProjection().toPixels(pin1_geo, myScreenCoords);        mapView.getProjection().toPixels(pin2_geo, point);        mapView.getProjection().toPixels(pin3_geo, thirdPoint);        canvas.drawLine(myScreenCoords.x, myScreenCoords.y, point.x, point.y, paint);        canvas.drawLine(point.x, point.y, thirdPoint.x, thirdPoint.y, paint);        canvas.drawLine(thirdPoint.x, thirdPoint.y, myScreenCoords.x, myScreenCoords.y, paint);        return true;    }    /*canvas.drawLine(point1.x, point1.y, point2.x, point2.y, paint);    canvas.drawLine(point2.x, point2.y, point3.x, point3.y, paint);    canvas.drawLine(point3.x, point3.y, point1.x, point1.y, paint);*/ } </code></pre><p>}</p><p>Can someone help me with this? I already tried flagging the tab etc. but nothing worked. Help greatly appreciated! </p>","359656","","","","","2010-06-21 08:34:24","How to store canvas line in activity?","<android>","1","0","","",""
"3083079","1","3083104","","2010-06-21 08:28:37","2","1178","<p>Is there any efficient linear algebra library for android? I need to compute matrices of different sizes(also bigger than 4x4) and rectangular too.</p><p>Thanks.</p>","302798","","","","","2010-06-21 08:34:05","Android efficient matrix library","<android><matrix>","1","0","","",""
"3083153","1","","","2010-06-21 08:44:22","3","1596","<p>Is there any way to resize an Android RatingBar.When I specify larger size for the RatingBar in my XML-Layout, it just gets stretched showing more Stars.</p>","371979","","","","","2011-12-01 09:10:24","How to resize (stretch) Android RatingBar without adding more Stars","<java><android>","2","0","","",""
"3083175","1","3953288","","2010-06-21 08:48:11","6","2188","<p>I am looking into using the new Backup API that available since Android 2.2, but need to maintain backwards compatibility (to 1.5 to be exact).</p><p>The docs state:</p><blockquote>  <p>The backup service and the APIs you must use are available only on devices running API Level 8 (Android 2.2) or greater, so you should also set your android:minSdkVersion attribute to ""8"". However, if you implement proper backward compatibility in your application, you can support this feature for devices running API Level 8 or greater, while remaining compatible with older devices.</p></blockquote><p>I indeed build against the level 8 <code>targetSdkVersion</code> with level 3 <code>minSdkVersion</code> and try to use a wrapper class (with reflection) to overcome the problem that the application will not run if you implement a class that extends an nonexisting class.</p><p>Here is the problem: since we don't make actual calls to the <code>BackupHelper</code> class ourselves, we can't check upfront if the class indeed exists. (As is explained in the Android Backwards Compatibility documentation with a <code>checkAvailable()</code> method.) The class will therefore be instantiated and cast to a <code>BackupAgent</code>. But since we use reflection, it doesn't actually override BackupAgent and an exception occurs at runtime when the backup is requested:</p><pre><code>java.lang.RuntimeException: Unable to create BackupAgent org.transdroid.service.BackupAgent: java.lang.ClassCastException: org.transdroid.service.BackupAgent</code></pre><p>Here is my approach to a backwards compatible <code>BackupAgent</code>: <a href=""http://code.google.com/p/transdroid/source/browse/#svn/trunk/src/org/transdroid/service"" rel=""nofollow"">http://code.google.com/p/transdroid/source/browse/#svn/trunk/src/org/transdroid/service</a> where the BackupAgent.java is the 'regular' BackupAgentHelper-extending class and BackupAgentHelperWrapper is the reflection-based wrapper class.</p><p>Anyone successfull in implementing a <code>BackupAgent</code> with backwards compatibility?</p>","243165","","810368","","2012-10-29 08:40:11","2013-10-02 09:24:51","Backwards-compatible BackupAgent","<android><reflection><backwards-compatibility><android-backup-service>","6","1","4","",""
"3083200","1","3088448","","2010-06-21 08:51:39","1","862","<p>I'm trying to cross-compile dropbear for android. The files appear to compile find, but when executed give ""program : not found."" I did a find and the libraries marked NEEDED appear to be located in the cross-compile environment. I have compiled other programs with this toolchain.</p><p>arm-none-linux-gnueabi-readelf -d dropbear</p><pre><code>Dynamic section at offset 0x1c158 contains 27 entries:  Tag        Type                         Name/Value 0x00000001 (NEEDED)                     Shared library: [libutil.so.1] 0x00000001 (NEEDED)                     Shared library: [libcrypt.so.1] 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1] 0x00000001 (NEEDED)                     Shared library: [libc.so.6] 0x0000000c (INIT)                       0x9428 0x0000000d (FINI)                       0x1e1b4 0x00000019 (INIT_ARRAY)                 0x2c14c 0x0000001b (INIT_ARRAYSZ)               4 (bytes) 0x0000001a (FINI_ARRAY)                 0x2c150 0x0000001c (FINI_ARRAYSZ)               4 (bytes) 0x00000004 (HASH)                       0x8168 0x00000005 (STRTAB)                     0x8ba0 0x00000006 (SYMTAB)                     0x84b0 0x0000000a (STRSZ)                      970 (bytes) 0x0000000b (SYMENT)                     16 (bytes) 0x00000015 (DEBUG)                      0x0 0x00000003 (PLTGOT)                     0x2c258 0x00000002 (PLTRELSZ)                   848 (bytes) 0x00000014 (PLTREL)                     REL 0x00000017 (JMPREL)                     0x90d8 0x00000011 (REL)                        0x90c8 0x00000012 (RELSZ)                      16 (bytes) 0x00000013 (RELENT)                     8 (bytes) 0x6ffffffe (VERNEED)                    0x9048 0x6fffffff (VERNEEDNUM)                 4 0x6ffffff0 (VERSYM)                     0x8f6a 0x00000000 (NULL)                       0x0</code></pre>","72793","","","","","2010-06-21 20:54:48","Cross-compiling for Android","<android>","2","0","1","",""
"3083216","1","","","2010-06-21 08:53:23","-1","527","<p>for long i am trying to develop an app which would inform the user of any incoming message via speech, i have three classes, TextSpeaker, Receiver and SpeakerService. When i start the app and click on Start button, i get runtime error:</p><pre><code>06-21 13:54:36.088: ERROR/AndroidRuntime(528): Uncaught handler: thread main exiting due to uncaught exception06-21 13:54:36.119: ERROR/AndroidRuntime(528): java.lang.RuntimeException: Unable to     start service com.example.TextSpeaker.SpeakerService@43bb2ff8 with Intent {  cmp=com.example.TextSpeaker/.SpeakerService }: java.lang.NullPointerException06-21 13:54:36.119: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2882)....06-21 13:54:36.119: ERROR/AndroidRuntime(528): Caused by: java.lang.NullPointerException06-21 13:54:36.119: ERROR/AndroidRuntime(528):     at  com.example.TextSpeaker.SpeakerService.onStart(SpeakerService.java:33)06-21 13:54:36.119: ERROR/AndroidRuntime(528):     at android.app.Service.onStartCommand(Service.java:306)06-21 13:54:36.119: ERROR/AndroidRuntime(528):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2873)06-21 13:54:36.119: ERROR/AndroidRuntime(528):     ... 10 more</code></pre><p>Here are my 3 classes:<strong>TEXTSPEAKER CLASS:</strong></p><pre><code>package com.example.TextSpeaker;import java.util.Locale;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;// the following programme converts the text to speech public class TextSpeaker extends Activity  implements OnInitListener {/** Called when the activity is first created. */int MY_DATA_CHECK_CODE = 0;public TextToSpeech mtts;public Button button,stop_button;//public EditText edittext;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    button = (Button)findViewById(R.id.button);    stop_button=(Button)findViewById(R.id.stop_button);    Intent myintent = new Intent();    myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);    startActivityForResult(myintent, MY_DATA_CHECK_CODE);    //edit text=(EditText)findViewById(R.id.edittext);}    public void buttonClickListener(View src){        switch(src.getId())        {        case(R.id.button):            Toast.makeText(getApplicationContext(), ""The service has been started\n Every new message will now be read out"", Toast.LENGTH_LONG).show();             startService(new Intent(this,SpeakerService.class));             break;        case(R.id.stop_button):            Toast.makeText(getApplicationContext(), ""The service has been stopped\n "", Toast.LENGTH_LONG).show();            stopService(new Intent(this,SpeakerService.class));            break;        }    }    protected void onActivityResult(int requestcode,int resultcode,Intent data)    {        if(requestcode == MY_DATA_CHECK_CODE)        {            if(resultcode==TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)            {                // success so create the TTS engine                mtts = new TextToSpeech(this,this);                mtts.setLanguage(Locale.ENGLISH);            }            else            {                //install the Engine                Intent install = new Intent();                install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                startActivity(install);            }        }    }    public void onDestroy(Bundle savedInstanceStatBundle)    {         mtts.shutdown();    }    //public void onPause()    //{     //  super.onPause();    //  // if our app has no focus    //  if(mtts!=null)    //   mtts.stop();   // }    @Override    public void onInit(int status) {        if(status==TextToSpeech.SUCCESS)            button.setEnabled(true);    }}</code></pre><p><strong>RECEIVER CLASS:</strong></p><pre><code>package com.example.TextSpeaker;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent; import android.os.Bundle;import android.telephony.SmsMessage; // supports both gsm and cdmaimport android.util.Log;import android.widget.Toast;public class Receiver extends BroadcastReceiver{//TextSpeaker tsp=new TextSpeaker();public String str="""";@Overridepublic void onReceive(Context context, Intent intent) {    Bundle bundle = intent.getExtras();    Log.d(""Receiver"",""Message received successfully"");    SmsMessage[] msgs = null;    if(bundle!=null)    {        // retrive the sms received        Object[] pdus = (Object[])bundle.get(""pdus"");        msgs = new SmsMessage[pdus.length];        for(int i=0;i&lt;msgs.length;i++)        {            msgs[i]=SmsMessage.createFromPdu((byte[]) pdus[i]);            str+=""Message From ""+msgs[i].getOriginatingAddress()+""."";            str+=""The message is ""+msgs[i].getMessageBody().toString();        }        Toast.makeText(context,str,Toast.LENGTH_SHORT).show();    }}</code></pre><p>}</p><p><strong>SERVICESPEAKER CLASS:</strong></p><pre><code>package com.example.TextSpeaker;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.speech.tts.TextToSpeech;import android.util.Log;import android.widget.Toast;public class SpeakerService extends Service {Receiver rv = new Receiver();TextSpeaker tspker = new TextSpeaker();//public TextToSpeech mtts;@Overridepublic IBinder onBind(Intent arg0) {    // TODO Auto-generated method stub    return null;}@Overridepublic void onCreate(){    //mtts =new TextToSpeech(getBaseContext(), null);    Log.d(""SpeakerService"",""Service created successfully!"");    //mtts.speak(rv.str, TextToSpeech.QUEUE_FLUSH,null);}@Overridepublic void onStart(Intent intent,int startid){    Log.d(""SpeakerService"",""Service started successfully!"");    tspker.mtts.speak(rv.str, TextToSpeech.QUEUE_FLUSH,null);}@Overridepublic void onDestroy(){    if(tspker.mtts!=null)    {        tspker.mtts.stop();        Toast.makeText(getApplicationContext(),""The service has been destroyed!"", Toast.LENGTH_SHORT).show();    }}</code></pre><p>}</p>","238505","","","","","2010-06-21 08:59:55","can't find the mistake with the app in android","<android>","1","0","0","",""
"3083218","1","","","2010-06-21 08:53:25","1","1459","<p>I'm trying to use a custom function in sqlite3. I found no way in Java to do that so I moved on android-ndk, but now I'm having troubles integrating sqlite3 sources in my project. Compiler give me an error 'sqlite3_api' was note declared in this scope. In my source ""sqlite3ext.h"" is included (sqlite3 amalgamation is also included in project).</p><p>Any suggestion is welcome! </p>","259072","","301832","","2010-06-21 09:01:09","2011-07-08 16:29:21","SQLite android NDK","<sqlite><android><android-ndk>","1","0","","",""
"3083450","1","3083549","","2010-06-21 09:31:18","2","3116","<p>Hallo,</p><p>I cannot compile my project using an ant build script. The error message:</p><pre><code>Ant cannot find symbol...</code></pre><p>I read about creating <code>build.xml</code>, but it seems it is not enough. My project directory has the following layout:</p><p>poject</p><ul><li>src<br><ul><li>gen  </li><li>...</li></ul></li></ul><p>libarie_with_needed_java.file</p><ul><li>src<ul><li>clients</li><li>helper</li></ul></li></ul><p>How do I work with external references? Ant cannot find <code>android jar</code>. The <code>build.xml</code> file looks as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;==================================================================== --&gt;&lt;project name=""test"" default=""main"" basedir="".""&gt;&lt;!-- ====================================================================       Declare global properties for reuse and control of script     ==================================================================== --&gt;&lt;!-- For project source files  --&gt;&lt;property name=""src.dir"" location = ""src/de/test""/&gt; &lt;property name=""common.link"" location = ""../test-common/common""/&gt; &lt;!-- For compiled/output files. --&gt;&lt;property name=""build.dir"" location = ""build/source""/&gt;&lt;!-- For class libraries and dependency files. --&gt;&lt;property name=""lib.dir"" location = ""lib""/&gt;&lt;property name=""sdk.dir"" location = ""../android-sdk-windows/"" /&gt;    &lt;!-- ====================================================================       Einstiegspunnkt - Target main     ==================================================================== --&gt;&lt;target name=""main"" depends=""compile""  description=""getting started""&gt;  &lt;echo message=""start main target""/&gt;   &lt;/target&gt;&lt;!-- ====================================================================       Übersetzen - Target compile     ==================================================================== --&gt;&lt;target name=""compile"" depends=""init""&gt;  &lt;echo message=""start compile target""/&gt;  &lt;javac srcdir=""${src.dir}"" destdir=""${build}"" debug=""on""/&gt;  &lt;classpath refid=""classpath""/&gt; &lt;/target&gt;&lt;!-- ====================================================================       Initialisierungen - Target init     ==================================================================== --&gt;&lt;target name=""init"" description=""create needed directories""&gt;  &lt;echo message=""start init target""/&gt;  &lt;mkdir dir=""${build}""/&gt;&lt;/target&gt;   &lt;/project&gt;</code></pre><p>I created this file using examples from websites and the file that Eclipse generated.</p><p>I have removed the following external properties files (to simplify the problem):</p><pre><code>&lt;property file=""local.properties"" /&gt;&lt;property file=""build.properties"" /&gt;&lt;property file=""default.properties"" /&gt;          </code></pre><p>I need to include the external .java files from a different src location.</p><p>I need to know how to copy the external files in the project and compile everything together.</p><p>Thanks,Marcel</p>","372021","","59087","","2010-06-21 22:15:29","2012-02-16 15:25:09","Ant build script: cannot find android.jar","<android><ant><build>","2","0","","",""
"3083462","1","","","2010-06-21 09:32:45","1","626","<p>My app uses streaming (i think the correct term is progressive download) for videos. To be able to do that, the mp4 file must be hinted and I manage to do that. Now, is there a suggested or advisable settings for the mp4 like the bit rates, resolution, frame rate etc so that the playback is smooth?</p>","235885","","","","","2010-06-21 09:47:44","Suggested video settings for progressive download. (android)","<android>","1","0","1","",""
"3083542","1","","","2010-06-21 09:43:10","1","2594","<p><br>I'm looking for, either open-source or commercially available, Audio and Videl encoder &amp; decoder for Android for an application I want to write for Android. For audio, I want to be able to both encode-decode the AMR/AD-PCM/AAC formats and for Video H.263/H.264 &amp; MPEG4 formats.  </p><p>I can see from Android documentation that encoding &amp; decoding AMR-NB audio format is provided by the Android platform and for Video H.263 is provided. But, for rest of the codecs (both Audio &amp; Video) that I've listed, decoder is there but not encoder (If I got it right).  </p><p>Can anyone please help me in providing me with the pointers/suggestions for how/where can I find these codecs that are optimized/suitable for Android?  </p><p>Thanks &amp; Regards,<br>Harsha</p>","372033","","","","","2010-06-21 11:13:23","Audio/Video codecs for Android platform","<android><codec><video-codecs>","1","0","","",""
"3083621","1","","","2010-06-21 09:54:38","1","407","<p>I created renderer and loader of DirectX8 retained mode on iPhone/iPod/iPad/MacOSX/Windows.DirectX8 retained mode format is scene graph style, and hierarchy so deep.So, only Android NDK OpenGLES was occurred GL error code 0x503,0x0504(command stack over flow or under flow).</p><p>Is stack capacity of android a little?Who tried to check capacity of each devices?(NexusOne, HTC03A, Droid, Xpedia, and so on.)</p>","367144","","44729","","2010-06-21 13:40:35","2010-06-21 20:38:29","Matrix stack capacity is a little in Android NDK","<iphone><android><opengl-es><android-ndk>","1","0","","",""
"3083627","1","","","2010-06-21 09:54:58","5","1920","<p>the Android devGuide <a href=""http://developer.android.com/intl/zh-TW/guide/topics/resources/accessing-resources.html@%29"">explains</a> how it is possible to reference the value of an attribute in the currently-applied theme, using the question-mark (?) instead of at (@).</p><p>Does anyone know how to do this from code, e.g. in a customized component?</p>","333350","","333350","","2010-06-21 10:02:25","2010-09-09 17:32:27","Android - reference the value of an attribute in the currently-applied theme from code","<android>","1","0","3","",""
"3083695","1","3325394","","2010-06-21 10:04:46","2","1361","<p>I'm currently writing a live wallpaper for Android and it has a PreferenceScreen which currently contains only one preference - a DialogPreference to set various properties of animation.</p><p>User workflow to configure it currently looks like this:Settings... => (shows the preferences list with only one title ) Animation speed => MyDialogPreference</p><p>What I want is to make the workflow like this:Settings... => MyDialogPreference</p><p>I.e. I'm looking for a way to skip showing that preferences list with only one item and to show that dialog right away.</p><p>But it seems that PreferenceActivity requests itself to have PreferenceScreen as a root element of preference hierarchy. So... is it even possible to do what i want? :)</p><p>Code references:</p><p>Activity code:</p><pre><code>public class ForestLakePreferences extends PreferenceActivity{    protected void onCreate(Bundle savedState)    {        super.onCreate(savedState);        getPreferenceManager().setSharedPreferencesName(                ForestLakeWallpaper.PREFS_NAME);        addPreferencesFromResource(R.xml.preferences);    }}</code></pre><p>Prefs resource:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen        xmlns:android=""http://schemas.android.com/apk/res/android""        android:key=""lake_preferences""&gt;    &lt;DurationEditDialog            android:title=""@string/prefs_duration_title""            android:dialogTitle=""@string/configure_durations_dlg_title""            android:dialogLayout=""@xml/set_durations_layout"" /&gt;&lt;/PreferenceScreen&gt;</code></pre>","258848","","244296","","2010-07-24 14:11:11","2011-01-28 12:16:28","Is it possible to display a DialogPreference without showing a PreferenceScreen?","<android><dialog><preferences>","2","0","","",""
"3083699","1","","","2010-06-21 10:05:01","0","120","<p>Im trying to make a gane and i need to be able to move an object with the help of the key pad. I tried using the basic event handlers, like onKeyDown bit how do i redraw the screen??</p>","226220","","","","","2012-08-23 00:56:20","Key handling in Android","<android><event-handling>","1","0","","",""
"3083703","1","3083776","","2010-06-21 10:05:19","0","584","<p>is it possible to create the connectivity of android with ftp server. i am going to create  an application where login information about user is placed on ftp server.</p>","304961","","","","","2011-03-22 16:54:40","is it possible to create the connectivity of android with ftp server","<android>","2","2","","",""
"3083796","1","3083898","","2010-06-21 10:20:16","5","9520","<p>i have a problem with double values i need to store in an android homed sqlite database. since these double values represent gps values (lat &amp; lng), i really <code>NEED</code> an absolute precision down to the 9th number after the comma.</p><p>now i have a table like this:</p><pre><code>CREATE TABLE x REAL lng;</code></pre><p>and insert sth (hardcoded) like:</p><pre><code>INSERT INTO x lng = '1.0';</code></pre><p>and when reading lng from this table into some (java) double variable, i get a value like ""0.999956837"" - this renders the values pretty useless to me.</p><p>is there a way to enforce the precision i need other than storing the values as ""text"" fields (what would make expensive casts neccessary) or storing them as integers (meaning i need to multiply/divide at each write/read-op)?</p>","370969","","","","","2010-06-21 11:03:32","storing double values in SQLite: how to ensure precision?","<android><database><sqlite><double><precision>","2","2","1","",""
"3084185","1","","","2010-06-21 11:24:19","24","47875","<p>When I have the following, it shows top layout with four colors has much smaller area than the bottom layout area.</p><p>According to <a href=""http://developer.android.com/guide/topics/ui/layout-objects.html#linearlayout"">http://developer.android.com/guide/topics/ui/layout-objects.html#linearlayout</a>, when you add more to layout_weight, it should increase the area, but it decreases in the code.</p><p>Any help will be appreciated.</p><p>Thanks in advance.</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=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_weight=""4""&gt;      &lt;TextView          android:text=""red""          android:gravity=""center_horizontal""          android:background=""#aa0000""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""3""/&gt;      &lt;TextView          android:text=""green""          android:gravity=""center_horizontal""          android:background=""#00aa00""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""1""/&gt;      &lt;TextView          android:text=""blue""          android:gravity=""center_horizontal""          android:background=""#0000aa""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""1""/&gt;      &lt;TextView          android:text=""yellow""          android:gravity=""center_horizontal""          android:background=""#aaaa00""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_weight=""1""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""&gt;    &lt;TextView        android:text=""row one""        android:textSize=""15pt""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;    &lt;TextView        android:text=""row two""        android:textSize=""15pt""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;    &lt;TextView        android:text=""row three""        android:textSize=""15pt""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;    &lt;TextView        android:text=""row four""        android:textSize=""15pt""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","119198","","","","","2012-06-01 16:41:58","android:layout_weight beginner's question","<android>","5","1","12","",""
"3084191","1","3084454","","2010-06-21 11:24:55","0","101","<p>I've been coded for a kind of integrated map Android app on my Windows. , Then, I've been switched to Ubuntu and tried with Eclipse.. Later, when I start my app, I couldn't see my integrated map on both Emulator and my N1. </p><p>Any helpful idea is appreciated ?</p>","2438460","","","","","2010-06-21 12:08:56","Android Integrated map doesn't work on my Ubuntu","<android>","1","0","","",""
"3084229","1","3084928","","2010-06-21 11:29:34","0","731","<p>Lets say we have a main class with 5 buttons, where when each clicked go to an activity that displays information with 2 textviews.</p><p>The layout for all 5 activities will be the same, so naturally I would want to use one activity and reuse it by changing the text displayed in those 2 textviews for each button pressed.</p><p>How can I do this? Thinking about having a global intent in my main class, which is called by startActivity() for each button together with .putExtra() method to send the extra data in order to know from what button it came from (so that I can change the textviews).</p><p>Any other solutions that are better?</p><p>One more question, how does one change the title of the activity with java code while the app is running? Before the app starts one can use the xml, but how to change it if I'm trying to reuse the activity?</p><pre><code>&lt;activity android:name="".MynewClass""          android:label=""@string/class_text""&gt;&lt;/activity&gt;</code></pre>","62570","","","","","2010-06-21 13:13:10","Reusing an activity by changing elements properties","<android><activity><reusability>","1","0","","",""
"3084352","1","","","2010-06-21 11:50:57","1","200","<p>I need to make a grid whose width and height is the same as the screen. I guess I would somehow use</p><pre><code>DisplayMetrics metrics = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(metrics);</code></pre><p>to do this but I need to scale the images inside so that each ImageView is 1/10th of the width of the screen (with 10 images for example). Similarly for the image heights.</p><p>I have tried</p><pre><code>a = (ImageView) findViewById(R.id.imageID);a.setMaxHeight(metrics.heightPixels/numberOfImages);</code></pre><p>But as you can imagine, this is very tedious with 130 images (and not to mention, it doesn't work!) It wouldn't be a problem if I didn't need to cater for lots of screen sizes!</p><p>Any help is appreciated! (Bit of an Android noob (-: )</p>","106941","","106941","","2010-06-21 16:13:59","2010-06-21 16:13:59","Creating a grid of scaled ImageViews [Android]?","<android><scaling><imageview>","0","1","","",""
"3084439","1","3084923","","2010-06-21 12:06:43","2","3552","<p>I've describef properties of my objects (nevermind what the object is) in styles.xml. I would like to change these properties dynamically in styles.xml. </p><p>Does anybody know how can I do that?</p>","332311","","641067","","2012-02-05 06:23:48","2013-03-08 16:43:17","android change style dynamically","<android><coding-style>","3","0","","",""
"3084492","1","5819522","","2010-06-21 12:13:55","0","2097","<p>I have got a tutorial to add custom objects into a list view <a href=""http://www.josecgomez.com/2010/05/03/android-putting-custom-objects-in-listview/"" rel=""nofollow"">from here</a>... Now i wanted to know how to display an image along with text in the same process...</p>","303155","","","","","2011-04-28 13:39:01","Image from json url into a list view","<json><android>","1","0","","",""
"3084822","1","","","2010-06-21 12:58:11","0","809","<p>How do I call servlet based web service from Android? </p>","304961","","225647","","2012-08-23 00:58:18","2012-08-23 00:58:18","Calling servlet based web service from Android","<android>","0","2","","",""
"3084856","1","3084909","","2010-06-21 13:02:13","0","744","<p>With iPhone, creating your own AppFramework is made impossible by the fact that Apple won't let your apps download binaries. One can understand this as it would potentially mean that people could set up their own App Stores (however unlikely it may sound).</p><p>Is there anyone who knows of any such restrictions for Android?</p><p>Just FYI:What we want to achieve is this: A small app that you run that can act as host for any apps that we want the user of it to be able to download and run. The reason is that we want to be in control of ALL apps our customers run and be able to upgrade them separately while they only need to download and install ONE app from us, that can potentiall host 100s of functions. As stated, this is not possible with iPhone, the question is if it is possible with Android or if there are similar restrictions there i.e. only deploy App from some Android Store, not allowing for binaries to be executed by apps etc? Thanks.</p>","371945","","","","","2010-06-21 13:10:06","Android: Possible to create a small app-plugin-framework?","<android>","1","0","","",""
"3084885","1","","","2010-06-21 13:07:04","0","836","<p>i am getting error that the app has stopped unexpectedly as soon as i lauch the following programme on the emulator :</p><pre><code>package com.example.TextSpeaker2;import java.util.Locale;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.database.Cursor; import android.net.Uri; import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener;import android.widget.Button;import android.widget.Toast;public class TextSpeaker2 extends Activity implements OnInitListener{public static final Uri SMS_CONTENT_URI = Uri.parse(""content://sms"");public static final Uri SMS_INBOX_CONTENT_URI = Uri.withAppendedPath(SMS_CONTENT_URI,  ""inbox"");int MY_DATA_CHECK_CODE = 0;public static TextToSpeech mtts;public static String body="""";Button speak;  /** Called when the activity is first created. */  @Override   public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);   Intent myintent = new Intent();   myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);   startActivityForResult(myintent, MY_DATA_CHECK_CODE);   getSmsDetails(this, 0, false); } public static void getSmsDetails(Context context, long ignoreThreadId, boolean unreadOnly) {String SMS_READ_COLUMN = ""read"";String WHERE_CONDITION = unreadOnly ? SMS_READ_COLUMN + "" = 0"" : null;String SORT_ORDER = ""date DESC"";int count = 0;if (ignoreThreadId &gt; 0) {  WHERE_CONDITION += "" AND thread_id != "" + ignoreThreadId;}Cursor cursor = context.getContentResolver().query(SMS_INBOX_CONTENT_URI,    new String[] { ""_id"", ""thread_id"", ""address"", ""person"", ""date"", ""body"" }, WHERE_CONDITION, null, SORT_ORDER);if (cursor != null) {  count = cursor.getCount();  cursor.moveToFirst();} else {  return;}do {  try {    long messageId = cursor.getLong(0);    long threadId = cursor.getLong(1);    String address = cursor.getString(2);    long contactId = cursor.getLong(3);    String contactId_string = String.valueOf(contactId);    long timestamp = cursor.getLong(4);    body = cursor.getString(5);    StringBuffer smsMessage = new StringBuffer();    smsMessage.append(""MessageID: "" + messageId + ""/"" + count + ""\n"");    smsMessage.append(""ThreadID: "" + threadId + ""\n"");    smsMessage.append(""address: "" + address + ""\n"");    smsMessage.append(""contactID: "" + contactId + ""\n"");    smsMessage.append(""contactID_string: "" + contactId_string + ""\n"");    smsMessage.append(""timestamp: "" + timestamp + ""\n"");    smsMessage.append(""body: "" + body + ""\n"");    Toast.makeText(context, smsMessage.toString(), Toast.LENGTH_LONG).show();  } finally {    cursor.close();  }} while (cursor.moveToNext());}   public void ButtonClickListener(){mtts.speak(body, TextToSpeech.QUEUE_FLUSH, null);  } protected void onActivityResult(int requestcode,int resultcode,Intent data) {if(requestcode == MY_DATA_CHECK_CODE){    if(resultcode==TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)    {        // success so create the TTS engine        mtts = new TextToSpeech(this,this);        mtts.setLanguage(Locale.ENGLISH);    }    else    {        //install the Engine        Intent install = new Intent();        install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);        startActivity(install);    }}}  public void onDestroy(Bundle savedInstanceStatBundle){ mtts.shutdown();} @Override  public void onInit(int status) {// TODO Auto-generated method stubif(status==TextToSpeech.SUCCESS)    speak.setEnabled(true);}</code></pre><p>}</p>","238505","","","","","2010-06-21 17:31:14","getting runtime error","<android>","1","2","0","",""
"3084891","1","4125024","","2010-06-21 13:07:34","7","4362","<p>I need to cover Menu functionality by unit tests, however I'm struggling to obtain Menu object. </p><p>Following test case fails (mMenu is null):</p><pre><code>sendKeys(KeyEvent.KEYCODE_MENU);mMenu = (Menu) mActivity.findViewById(com.###.###.R.id.main_menu);assertNotNull(mMenu);</code></pre><p>Please advice. Thank you.</p>","372175","","41956","","2010-11-08 16:39:53","2013-11-10 15:00:59","How to test Menu","<java><android><unit-testing><junit>","5","0","3","",""
"3085125","1","3085150","","2010-06-21 13:39:51","1","1763","<p>I've got a few questions about edittext.. </p><p>I'm trying to create a login screen on Android. I'm taking in a username and a password and then sending the results to another method. I've just got a few questions about it...</p><p>1) If I have two edittext's and the user enters values in both and then hits a ""login"" button, I want the button to take the values that were entered in the 2 edittext boxes, convert and save them to a string and then pass them to a function. I'm unsure how I'd construct this button. The problem I'm having is making it a string I'm currently doing this.. </p><pre><code>String user = edittext.getText();</code></pre><p>But that doesn't seem to work. Also I'm unsure what way Android saves Edittext inputs.. Will it just automatically save it to the string once the user is no longer working out of the box? e.g will...</p><pre><code> public boolean onKey(View v, int keyCode, KeyEvent event) {            String user = edittext.getText();        } </code></pre><p>work? If not how would I define it?</p><p>Thanks.</p>","358438","","","","","2010-06-21 13:52:37","Android, using Edittext","<java><android>","2","0","1","",""
"3085227","1","","","2010-06-21 13:53:44","2","2416","<p>I have the following code which invokes a .net webservice. The code connects to the service fine, but the paramter(deviceid) does not appear to get passed. The method simply returns the passed deviceid which is always null.</p><p>This is telling me the deviceid parameter is not being passed. I thought I saw someone recommend a packet sniffer to view the outgoing xml, but can't seem to remember what it was. Can someone suggest one that i can use in conjunction with eclipse and windows.</p><p>activity code    </p><pre><code>    String deviceid = tManager.getDeviceId();    SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);    PropertyInfo pi = new PropertyInfo();    pi.setName(""deviceid"");    pi.type = PropertyInfo.STRING_CLASS;    pi.setValue(deviceid.toString());    request.addProperty(pi);    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    soapEnvelope.dotNet = true;    soapEnvelope.setOutputSoapObject(request);    HttpTransportSE ht = new HttpTransportSE(URL);    try{        ht.call(SOAP_ACTION, soapEnvelope);        SoapPrimitive result = (SoapPrimitive ) soapEnvelope.getResponse();         Toast.makeText(ctx, ""result = "" + result.toString(), Toast.LENGTH_SHORT).show();    }catch(Exception e){        e.printStackTrace();        Toast.makeText(ctx, ""error: "" + e.getMessage(), Toast.LENGTH_SHORT).show();    }</code></pre><p>webservice code</p><pre><code>        &lt;WebMethod()&gt; _    Public Function CheckTrial(ByVal deviceid As String) As String        Return deviceid    End Function</code></pre><p>I,ve tried everything and cannot figure out how to resolve this. Does anyone else have any suggestions to try?</p><p>xml sent as spy'ed from wire shark:</p><pre><code>POST /android_service_test.asmx HTTP/1.1 Host: ikonicsoft.com user-agent: kSOAP/2.0 soapaction: http://ikonicsoft.com/CheckTrial content-type: text/xml connection: close content-length: 421  &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;CheckTrial xmlns=""http://ikonicsoft.com"" id=""o0"" c:root=""1""&gt;        &lt;deviceid i:type=""d:string""&gt;000000000000000&lt;/deviceid&gt;    &lt;/CheckTrial&gt;&lt;/v:Body&gt;&lt;/v:Envelope&gt;HTTP/1.1 200 OK Connection: close Date: Mon, 21 Jun 2010 16:35:10 GMT Server: Microsoft-IIS/6.0 X-Powered-By: PleskWin X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: .ASPXANONYMOUS=fnyqjfFHywEkAAAAZGVjYjZmNTEtNWNiYi00YTIwLWEzYzktNzUxZDNjMDA0OGY00; expires=Mon, 30-Aug-2010 03:15:09 GMT; path=/; HttpOnly Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Content-Length: 299  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;&lt;soap:Body&gt;    &lt;CheckTrialResponse xmlns=""http://ikonicsoft.com/"" /&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Thanks</p><p>Patrick</p>","244190","","20382","","2010-07-07 20:00:22","2011-10-04 05:15:57","Problem passing simple string parameter to .net webservice","<.net><android><web-services><ksoap2><ksoap>","3","2","2","",""
"3085242","1","","","2010-06-21 13:56:33","7","2646","<p>I'm trying to use AccountManager to store account information and have implemented an authenticator, but I keep getting exceptions like the below that crash the phone.  Comparing with sample code this seems to be because I don't have (or particularly want) a SyncAdapter and associated service.  Is there a trick to using AccountManager without adding a SyncAdapter?</p><p>Regards</p><p>Phil</p><pre><code>I/AuthenticatorActivity( 8526): onAuthenticationResult(true)I/AuthenticatorActivity( 8526): finishLogin()W/dalvikvm( 8108): threadid=13: thread exiting with uncaught exception (group=0x4001b170)E/AndroidRuntime( 8108): Uncaught handler: thread android.server.ServerThread exiting due to uncaught exceptionE/AndroidRuntime( 8108): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.E/AndroidRuntime( 8108): java.lang.NullPointerExceptionE/AndroidRuntime( 8108):        at com.android.settings.ManageAccountsSettings.onSyncStateUpdated(ManageAccountsSettings.java:187)E/AndroidRuntime( 8108):        at com.android.settings.ManageAccountsSettings.onAccountsUpdated(ManageAccountsSettings.java:244)E/AndroidRuntime( 8108):        at android.accounts.AccountManager$10.run(AccountManager.java:826)E/AndroidRuntime( 8108):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 8108):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 8108):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 8108):        at com.android.server.ServerThread.run(SystemServer.java:435)</code></pre>","29031","","","","","2013-04-25 15:44:39","AccountManager without a SyncAdapter?","<android><accountmanager>","5","1","3","",""
"3085366","1","3086320","","2010-06-21 14:12:14","9","8181","<p>I'm implementing an image cache system for caching downloaded image.</p><p>My strategy is based upon two-level cache:Memory-level and disk-level.</p><p>My class is very similar to the class used in the <a href=""http://github.com/kaeppler/droid-fu/blob/master/src/main/java/com/github/droidfu/imageloader/ImageCache.java"">droidfu project</a></p><p>My downloaded images are put into an hashmap and the Bitmap objet is wrapped inside a SoftRererence object. Also every image is saved permanently to the disk.If a requested image is not found into the <code>Hashmap&lt;String,SoftReference&lt;Bitmap&gt;&gt;</code> it will be searched on the disk, readed, and then pushed back into the hashmap. Otherwise the image will be downloaded from the network.Since I store the images into the phisical device momery, I have added a check for preserve the device space and stay under a 1M of occupied space:</p><pre><code>private void checkCacheUsage() {        long size = 0;        final File[] fileList = new File(mCacheDirPath).listFiles();        Arrays.sort(fileList, new Comparator&lt;File&gt;() {            public int compare(File f1, File f2) {                return Long.valueOf(f2.lastModified()).compareTo(                        f1.lastModified());            }        });        for (File file : fileList) {            size += file.length();            if (size &gt; MAX_DISK_CACHE_SIZE) {                file.delete();                Log.d(ImageCache.class.getSimpleName(),                        ""checkCacheUsage: Size exceeded  "" + size + ""(""                                + MAX_DISK_CACHE_SIZE + "") wiping older file {""+file.toString()+""}"");            }        }    }</code></pre><p>This method is called sometime afte a disk writing:</p><pre><code>Random r = new Random();        int ra = r.nextInt(10);        if (ra % 2 == 0){            checkCacheUsage();        }</code></pre><p>What I'd like to add is the same check on the HashMap size to prevent it will grow too much. Something like this:</p><pre><code>private synchronized void checkMemoryCacheUsage(){            long size = 0;            for (SoftReference&lt;Bitmap&gt; a : cache.values()) {                final Bitmap b = a.get();                if (b != null &amp;&amp; ! b.isRecycled()){                    size += b.getRowBytes() * b.getHeight();                }                if (size &gt; MAX_MEMORY_SIZE){                  //Remove some elements from the cache                }            }            Log.d(ImageCache.class.getSimpleName(),                    ""checkMemoryCacheUsage: "" + size + "" in memory"");    }</code></pre><p>My question is:What could be a right MAX_MEMORY_SIZE value?Also, Is it a good approach?A good answer also could be: ""Don't do it! SoftReference is already enough""</p>","329692","","","","","2013-03-08 15:52:43","Android: Image cache stategy and memory cache size","<android><memory><caching><bitmap>","3","1","4","",""
"3085371","1","3086779","","2010-06-21 14:12:28","6","7431","<p>I have a android application which needs username and password to login. I need to save the username and password locally in phone or somewhere to use them when the user opens the app next time and  logins to the app automatically without showing the login screen</p><pre><code>    EditText input1 = (EditText) findViewById(R.id.usertext);    EditText input2 = (EditText) findViewById(R.id.Passtext);    String username = input1.getText().toString();    String password = input2.getText().toString();</code></pre><p>If the login is successful, it will call the activity through intent.</p>","164850","","1173560","","2013-03-13 12:23:56","2013-08-27 15:36:32","how to save login details of android app?","<android><login>","4","0","2","",""
"3085445","1","","","2010-06-21 14:19:59","1","1259","<p>Is it possible to create and activate an apn programatically on android?Is it also possible to activate more than 1 apn at the same time?thanks!</p>","445548","","65500","","2013-10-11 18:08:48","2013-10-11 18:08:48","Activating multiple APNs on Android","<android><apn><access-point-name>","1","0","","",""
"3085449","1","3085798","","2010-06-21 14:20:27","1","1364","<p>I would like to write an app that will put the current call on hold, then add a new call.  Since this can be done by manually pressing buttons, I would think there is a way to do it programmatically, but I cannot find anything in the sdk.</p><p>TIA</p>","364734","","","","","2010-06-21 15:03:04","Android- put a call on hold and add new call","<android>","1","0","1","",""
"3085522","1","3085844","","2010-06-21 14:31:31","2","1948","<p>I want to live stream video from android device. I found out that ffserver (ffmpeg) can be compiled and run on android. Now i need to get video from camera in android device and get it to the ffserver in real-time. </p><p>Any ideas?</p><p>Regards,MM</p>","314408","","","","","2012-06-06 14:28:16","Video streaming from Android","<android><video-streaming><ffserver>","1","0","1","",""
"3085538","1","3085590","","2010-06-21 14:33:02","1","674","<p>I have a simple preference (not EditText preference or ListPreference). I have a method that deletes all files in a directory. I want to do this when user clicks on a preference, but i don't know how to react to a click on a preference.</p>","324417","","","","","2010-06-21 14:38:12","Reacting to a click on a preference","<java><android><preferences>","2","1","1","",""
"3085630","1","","","2010-06-21 14:42:46","2","1320","<p>I have a WebView widget in my app that displays custom HTML content. This is my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""android:id=""@+id/main_article_view"" &gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""56dp""    android:background=""@drawable/header_background""&gt;&lt;Button     android:id=""@+id/article_next""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:background=""@drawable/right_segment""    android:layout_centerVertical=""true""    android:layout_alignParentRight=""true""    android:layout_marginRight=""2dip""/&gt;&lt;Button     android:id=""@+id/article_previous""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:background=""@drawable/left_segment""    android:layout_centerVertical=""true""    android:layout_alignBaseline=""@id/article_next""    android:layout_toLeftOf=""@id/article_next""/&gt;&lt;ImageView     android:layout_width=""wrap_content""    android:id=""@+id/article_nav_logo""     android:layout_height=""wrap_content""    android:background=""@drawable/app_logo""    android:layout_toLeftOf=""@id/article_previous""    android:layout_centerVertical=""true""    android:layout_marginRight=""15dp""/&gt;&lt;/RelativeLayout&gt;&lt;com.myapp.android.NavBar    android:id=""@+id/vertical_navbar""    android:layout_width=""fill_parent""    android:layout_height=""45dp""/&gt;&lt;WebView        android:id=""@+id/webkit""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The code is really simple - the class that handles the layout also implements the WebViewClient methods. It loads the html data into the WebView. </p><p>The app works well on all OS's except Froyo. On Froyo the WebView doesn't respond to vertical scroll event - it can scroll horizontally though.</p><p>I had a onFling event listener - which has been disabled, but still no luck. Any help/hint is greatly appreciated. Thanks.</p>","372259","","","","","2010-06-22 14:45:14","Android Froyo WebView doesn't scroll vertically","<android><android-widget><android-webview>","1","0","","",""
"3085749","1","3086247","","2010-06-21 14:56:36","6","4637","<p>I have an issues, I want to show 20 items in the list. But there is a catch: if the user scrolls down to the bottom of the list, there will be an item that says: ""Show more items"", and when the users click on it, more items will be added to the list. </p><p>My question is how is poosible to have a last item, that has a different style and looks different: and does different things,(I think this is used in QuickSearchbox)</p>","371301","","","","","2012-04-16 21:30:39","Android: ListView, Last item - Show more","<android><listview><item>","4","0","1","",""
"3085814","1","","","2010-06-21 15:05:41","2","670","<p>Here is my problem:When I click on the map view , the ""setBuiltInZoomControls"" method displays the zoom controlls and then hides it. I want to copy that functionallity so that when I click on the map view I want to display the map, satellite and traffic buttons, but my code doesn't work. </p><p>Can you help me on this? I have included my code below.</p><p>This is my xml code:<pre><code>parent""    android:layout_height=""fill_parent""    android:id=""@+id/mapLayout""    &gt;&lt;com.google.android.maps.MapView    android:id=""@+id/mapview1""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:enabled=""true""    android:clickable=""true""    android:apiKey=""0K5oQk-IVWGzfMbBkOhx5EDXDXhlBO1PJI8mLag"" /&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""48px""        android:background=""#550000ff""        android:padding=""2px""        android:id=""@+id/mapBtnsControlls""        android:visibility=""invisible""&gt;        &lt;Button            android:layout_width=""wrap_content""            android:id=""@+id/btnMap""            android:layout_height=""wrap_content""            android:text=""Map""            android:layout_marginLeft=""53px""            android:layout_marginRight=""10px""&gt;        &lt;/Button&gt;        &lt;Button            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:id=""@+id/btnSatellite""             android:text=""Satellite""            android:layout_toRightOf=""@+id/btnMap""            android:layout_marginRight=""10px""&gt;        &lt;/Button&gt;        &lt;Button            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:id=""@+id/btnTraffic""            android:layout_toRightOf=""@+id/btnSatellite""            android:text=""Traffic""&gt;        &lt;/Button&gt;    &lt;/RelativeLayout&gt;   &lt;/RelativeLayout&gt;</code></pre><p>This is my java code:</p><pre><code>MapView googleMap= (MapView) findViewById(R.id.mapview1);RelativeLayout mapBtnsLayout = (RelativeLayout) findViewById(R.id.mapBtnsControlls);googleMap.setClickable(true);googleMap.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {      mapBtnsLayout.setVisibility(View.VISIBLE);     }}); </code></pre>","372287","","119895","","2010-06-21 16:26:32","2010-12-12 01:34:27","Android - How to copy setBuiltInZoomControls functionallity","<android>","1","0","","",""
"3085886","1","3089460","","2010-06-21 15:14:20","0","277","<p>I wanna run two system activities one after another in specific order.</p><p>now as we know, <code>startActivity</code> is an asynchronous operation, so i cant keep on a specific order.</p><p>so i thought maybe I should try to do it with <code>dialogBox</code> in the middle but also running a <code>dialogBox</code> is an asynchronous.</p><p>now as i said the activities which i try to run are system activities, so i cant even start them with <code>startActivityForResult</code> (or mybe i can, but i cant think how it will help me).</p><p>Any tricks how could i manage with this issue?</p><p>Some code:</p><p>first activity:</p><pre><code>                                         Intent intent = new Intent();                                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                                           intent.setAction(Settings.ACTION_APPLICATION_SETTINGS);                                           startActivity(intent);   second activity:    Intent intent = new Intent(Intent.ACTION_VIEW);    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    intent.setDataAndType(Uri.fromFile(tmpPackageFile            .getAbsoluteFile()),            ""application/vnd.android.package-archive"");    startActivity(intent);</code></pre><p>as you can see, i dont have any access to those activites, i can just run thire intents from an outside class/activity/service.</p>","260511","","260511","","2010-06-22 07:08:56","2010-06-22 07:08:56","Synchronous system activities","<android>","2","3","","",""
"3085916","1","3086116","","2010-06-21 15:18:51","2","151","<p>I would like to create button which contains text on left and checkbox on right (or any other component). How can I do that? </p><p>As I found I can make my own View extends Button, but how should I implement onDraw method if so?</p><p>Thanks</p>","332311","","","","","2010-06-21 15:46:46","android custrom control (button)","<android><widget>","1","2","1","",""
"3086057","1","3086221","","2010-06-21 15:38:36","4","810","<p>I've been searching this site and found some answers related to setting an alarm.  I've successfully been able to set up an alarm.</p><p>What I do is: </p><ul><li>From an activity I set an alarm that at certain time and date will call a receiver</li><li>From the receiver I call a service</li><li>From the service I send a notification (on the notification bar) to the user.</li></ul><p>My questions are:</p><ol><li><p>I set up an alarm 5 minutes from now. Say I turn off the phone and turn it back on (it seems it forgets the alarm).  How can I prevent this from happening?</p></li><li><p>Do I really need to call a service to send the notifications or can I do it from the receiver?</p></li></ol><p>The following is the code referenced on previous section (a):</p><pre><code>Intent intent = new Intent(MyActivity.this,  AlarmReceiver.class);intent.putExtra(""alarm_message"", ""Something"");PendingIntent mAlarmSender;mAlarmSender = PendingIntent.getBroadcast(  MyActivity.this, 0, intent, 0);// We want the alarm to go off 30 seconds from now.long alarmTime = dateMgmt.getTimeForAlarm(pickedDate);                            // Schedule the alarm!AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);am.set(AlarmManager.RTC_WAKEUP, alarmTime + 15000,    mAlarmSender);</code></pre><p>This is the code referenced on previous section (b):</p><pre><code> @Override public void onReceive(Context context, Intent intent) {  try {   Bundle bundle = intent.getExtras();   String message = bundle.getString(""alarm_message"");   Intent newIntent = new Intent(context, MyService.class);   context.startService(newIntent);  } catch (Exception e) {   Toast     .makeText(       context,       ""There was an error somewhere, but we still received an alarm"",       Toast.LENGTH_SHORT).show();   e.printStackTrace();  }</code></pre><p>This the code referenced on previous section (c):</p><pre><code> @Override public void onCreate() {  super.onCreate();  nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);  showNotification(); }</code></pre>","372475","","119895","","2010-06-21 15:47:46","2010-06-21 15:58:23","How to setup an alarm that would go off even if I restart my android phone?","<android><alarm>","1","1","1","",""
"3086706","1","","","2010-06-21 17:00:02","6","428","<p>There is an entry in 1.5 of the SDK for installLocationProvider. That entry is marked: @hide.I would like to provide an alternate location provider, the why is not important, just the how.Does anyone know the ""trick"" for using the ""installLocationProvider"" entry point or where to find details of building a complete or partial solution? The ""Mock"" location provider code is not usable in a finished application.</p>","372379","","15369","","2010-09-03 09:40:20","2010-09-03 21:32:33","Installing a new Location Provider","<android><location><provider>","1","4","1","",""
"3086774","1","3086843","","2010-06-21 17:08:51","8","4541","<p>Is it possible to to launch an application using a URL launched from within the Android messaging app (SMS or MMS)?</p>","372391","","","","","2011-04-28 09:30:14","Launch Android app from within SMS/MMS message?","<android><sms>","2","0","","",""
"3086957","1","3088792","","2010-06-21 17:33:32","2","603","<p>In Android, the TabHost object renders activities in a type of inline way.  I'm wondering if there's any way I can do a similar type of thing, without using the tab-host.  Suppose, i want  to have a toolbar or sliding drawer that allows me to switch between the activities in the same way that the TabHost does this.    In other words, I'd like to render an activity inline inside of another activity, sort of like an iframe for activities...</p>","372405","","372405","","2010-06-21 17:43:00","2010-06-21 21:57:17","Android Inline Activity","<android><activity>","3","0","1","",""
"3087111","1","3087158","","2010-06-21 17:54:41","2","1651","<p>What is the consensus on parsing the Uri of sms messages for use with a cursor. There has to be a cross phone compatible way of getting access to sms messages.</p><p>There's nothing in the sdk for something like this?</p><p>What about this as a Uri string: (""vnd.android-dir/mms-sms"");</p>","371532","","371532","","2010-06-21 18:01:32","2010-06-21 18:02:21","Consensus on Uri.parse(""content://sms"");","<android><parsing><sms><uri>","1","0","1","",""
"3087121","1","","","2010-06-21 17:56:56","3","1692","<p>I am trying to display images dynamically on a home screen widget. As RemoveViews offer a very limited set of methods to interact with the layout, I'm trying to use HTML to get the same effect. Regular HTML displays ok (<code>&lt;u&gt;,&lt;b&gt;</code> etc) however I can't get images to display. Instead I get a little empty square appear in the TextView.</p><p>E.g. </p><pre><code>s = ""&lt;b&gt;Hello&lt;/b&gt; &lt;img src='world'/&gt;"";ImageGetter imgGetter = new ImageGetter(context);RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);views.setTextViewText(R.id.textarea, Html.fromHtml(s, imgGetter, null));</code></pre><p>The image getter looks like the following:</p><pre><code>public class ImageGetter implements Html.ImageGetter{    Context c;    public ImageGetter(Context c)    {        this.c = c;    }    public Drawable getDrawable(String source) {        Drawable d = null;        int resID = c.getResources().getIdentifier(source, ""drawable"", c.getPackageName());        d = c.getApplicationContext().getResources().getDrawable(resID);        d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());        return d;    }}</code></pre><p>The code works fine if I am using a regular Activity. I suspect that this is a bug/undocumented feature of android when used with a AppWidgetProvider. I just want some confirmation.</p>","372425","","","","","2013-01-29 04:23:59","Displaying images on android widgets using html & TextView","<android><android-widget>","1","0","","",""
"3087255","1","3088812","","2010-06-21 18:16:27","3","5050","<p>is there a way to establish a listener on the process of scrolling in a ScrollView or a HorizontalScrollView?</p>","219159","","","","","2010-06-21 22:00:46","Android: how to listen for scrolling events?","<android><scrollview>","1","0","1","",""
"3087271","1","3087718","","2010-06-21 18:18:08","2","5675","<p>hi im trying to develop an android app in xcode. ive downloaded java, java jdk and the android sdk and have loaded a half finished (but working with no errors) app. i also changed the target to:</p><blockquote>  <p>Build Tool: /usr/bin/ant<br>  Arguments: install</p></blockquote><p>but when i try to build it i get</p><blockquote>  <p>Build file build.xml does not exist</p></blockquote><p>i couldn't figure out how to make my own build.xml so downloaded one but still no luck. Id really appreciate some help,</p><p>thanks,</p><p>ng93</p>","364727","","","","","2010-06-21 19:15:19","develop android apps in xcode","<android><xcode><osx>","1","0","","",""
"3087282","1","3088071","","2010-06-21 18:19:04","2","892","<p>I am trying to use a nine patch image as a background in an android game. The image expands well in multiple resolutions but, my game has slowed down by 10 fps. I used to get a consistent 45 to 50 fps now I get 35 fps.</p><p>The question is when we use a nine patch as a drawable and set it as a background in a view does it have any performance implications as opposed to a plain bitmap drawing.</p><p>Thanks in advance.</p>","372446","","","","","2010-06-21 19:59:11","Nine Patch Image in Android Game","<android>","1","0","2","",""
"3087366","1","4233741","","2010-06-21 18:29:19","15","19618","<p>I have a widget which starts an activity when it is clicked. I'd like to have some kind of fancy animation to display this activity, rather than the standard scroll-from-right of Android. I'm having problems setting it, though. This is what I have:</p><p><strong>slide_top_to_bottom.xml</strong></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=""-100%"" android:toXDelta=""0"" android:duration=""100"" /&gt;    &lt;alpha android:fromAlpha=""0.0"" android:toAlpha=""1.0"" android:duration=""50"" /&gt;&lt;/set&gt;</code></pre><p>...which is referenced in <strong>anim.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layoutAnimation xmlns:android=""http://schemas.android.com/apk/res/android""        android:delay=""50%""        android:animation=""@anim/slide_top_to_bottom"" /&gt;</code></pre><p>But then where do I reference it from? I've tried both the base element of the activity I want to slide in, and the activitiy's entry in the manifest, both times with</p><pre><code>android:layoutAnimation=""@+anim/anim""</code></pre><p>I might be doing this all wrong. Any help is much appreciated!</p>","31168","","","","","2013-07-13 05:27:22","Displaying activity with custom animation","<android><animation><android-widget>","3","0","16","",""
"3087693","1","3087800","","2010-06-21 19:12:11","1","818","<p>I thought I have understood the XML layout of Android, but it seems that I haven't.I want to have four ImageViews on one screen, to view four images at the same time.</p><p>It should look like this, where A to D represents the image views:</p><pre><code>DDDAAADDDAAABBBCCCBBBCCC</code></pre><p>How can I do that? I tried it this way, but it's not working. The Eclipse Editor seems not to be very good for this either. Is there a better one to create those layouts ?</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;TableRow&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" &gt;&lt;/ImageView&gt;&lt;ImageView android:id=""@+id/ImageView02"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;&lt;ImageView android:id=""@+id/ImageView03"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;&lt;ImageView android:id=""@+id/ImageView04"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;  &lt;/TableRow&gt;&lt;/RelativeLayout&gt;</code></pre>","331556","","","","","2010-06-21 19:25:26","Android XML Layout - 4 ImageViews on one screen","<xml><android><layout>","2","0","","",""
"3087771","1","3089165","","2010-06-21 19:22:19","1","344","<p>I want to create a EditText and button that looks like this:</p><p><img src=""http://www.geting.se/image.php/249016-Untitled-3.jpg/full"" alt=""http://www.geting.se/image.php/249016-Untitled-3.jpg/full""></p><p>This is almost the same as the quicksearch , but it is custom made, Can someone help me out?</p>","371301","","114066","","2010-06-22 08:44:41","2010-06-22 08:44:41","A textedit with button?","<android><design>","1","0","","",""
"3087772","1","","","2010-06-21 19:22:22","1","1107","<p>How would I go about retrieving a list view's scroll position? I am trying to get it to ""round"" or ""snap"" to items on the list so there isn't one half displayed at the top. I can make it move with setSelectionFromTop, but I can't find anyway to get the ListView's position.</p><p>Also is there a way to use SetSelectionFromTop like smoothScroll? I'd like to not have a sharp change when it adjusts the scroll.</p><p>Thanks</p>","368845","","","","","2011-03-10 16:27:46","Get list view's scroll position","<android>","1","0","1","",""
"3087877","1","3088803","","2010-06-21 19:35:34","11","5038","<p>I want to have a dynamic table, with rows added over time as a result of user interaction, using a TableLayout inside a ScrollView. This works fine, but when I want to scroll to the end of the table using <a href=""http://developer.android.com/reference/android/widget/ScrollView.html#fullScroll%28int%29""><code>fullScroll()</code></a>, it always leaves out the last line; that is, it scrolls so that the one before the last one is visible. The last line is visible when scrolling manually, and the scrollbar is correct too.</p><p>I'm of course open to suggestions as to how to make a better layout out of this; but I'm specifically interested in understanding why <code>fullScroll()</code> behaves that way. Should I give it a different parameter, or use something else altogether? Or does it do that because the newly added line isn't yet visible somehow? (if so, how can I solve that?) Or did I miss some other obvious thing?</p><p>The following code replicates the problem:</p><p>TestActivity.java:</p><pre><code>package com.example.android.tests;import java.util.Random;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ScrollView;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;public class TestActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ((Button) findViewById(R.id.AddRow)).setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Random rnd = new Random();                TableRow nr = new TableRow(v.getContext());                for (int c=0; c&lt;3; c++) {                    TextView nv = new TextView(v.getContext());                    nv.setText(Integer.toString(rnd.nextInt(20)-10));                     nr.addView(nv);                }                ((TableLayout) findViewById(R.id.Table)).addView(nr);                // Scrolls to line before last - why?                ((ScrollView) findViewById(R.id.TableScroller)).fullScroll(View.FOCUS_DOWN);            }        });    }}</code></pre><p>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:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;Button    android:text=""Add Row""    android:id=""@+id/AddRow""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true"" /&gt;  &lt;ScrollView    android:id=""@+id/TableScroller""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_above=""@id/AddRow""    android:layout_alignParentTop=""true"" &gt;    &lt;TableLayout      android:id=""@+id/Table""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:stretchColumns=""0,1,2"" /&gt;  &lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre><hr><p>Edit: for reference, I implemented <a href=""http://stackoverflow.com/users/298575/romain-guy"">Romain Guy</a>'s solution as follows:</p><p>In TestActivity.java, replace:</p><pre><code>            // Scrolls to line before last - why?            ((ScrollView) findViewById(R.id.TableScroller)).fullScroll(View.FOCUS_DOWN);</code></pre><p>with:</p><pre><code>            // Enqueue the scrolling to happen after the new row has been layout            ((ScrollView) findViewById(R.id.TableScroller)).post(new Runnable() {                public void run() {                    ((ScrollView) findViewById(R.id.TableScroller)).fullScroll(View.FOCUS_DOWN);                }            });</code></pre><p>Which works fine.</p>","369428","","369428","","2010-06-22 17:17:38","2012-07-04 13:36:35","Scroll to last line of TableLayout within a ScrollView","<android><scrollview><tablelayout>","2","0","3","",""
"3087929","1","3088197","","2010-06-21 19:40:51","1","711","<p>In the Android SDK, there is a comment that says it's more efficient to retrieve resources by identifier instead of by name.</p><p>Is this the only reason it's discouraged to use getIdentifier()?</p><p>I need to programmatically access one of several hundred resources and so far my design makes it easier to access raw resources by name instead of identifier.</p>","291981","","","","","2010-06-21 20:16:08","Why is it discouraged to use Resources.getIdentifier()","<android>","2","0","0","",""
"3088074","1","3088213","","2010-06-21 20:00:18","1","881","<p>I'm trying to parse a web service response using SAXParser and get certain values, store them into an arraylist, then display them in a listview.</p><p>Example XML being returned from web service:</p><p><code>&lt;ArrayOfStrings&gt;&lt;string&gt;value&lt;/string&gt;&lt;string&gt;value&lt;/string&gt;&lt;string&gt;value&lt;/string&gt;&lt;/ArrayOfStrings&gt;</code></p><p>Here is my SAXHandler class:</p><pre><code>public class SAXHandler extends DefaultHandler { private boolean outertag = false; private boolean mytag = false; ArrayList&lt;String&gt; alist; public ArrayList&lt;String&gt; getList(){  return this.alist; } @Override public void startDocument() throws SAXException {         } @Override public void endDocument() throws SAXException{ } //@Override      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (localName.equals(""ArrayOfString"")){  this.outertag=true; }else if (localName.equals(""string"")){  this.mytag=true; }         } @Override     public void characters(char ch[], int start, int length) {  if (this.mytag){   String s = new String(ch, start, length);   alist.add(s);  }    } @Override      public void endElement(String namespaceURI, String localName, String qName) throws SAXException {  if (localName.equals(""ArrayOfString"")){   this.outertag=false;  }else if (localName.equals(""string"")){   this.mytag=false;  }         }}</code></pre><p>And here's my method calling and returing my web service:</p><pre><code>try{  URL url = new URL(""xxxxxxx"");  SAXParserFactory spf = SAXParserFactory.newInstance();     SAXParser sp = spf.newSAXParser();     XMLReader xr = sp.getXMLReader();     SAXHandler SAXHandler =  new SAXHandler();     xr.setContentHandler(SAXHandler);     xr.parse(new InputSource(url.openStream()));     ArrayList&lt;String&gt; stateList = SAXHandler.getList();     aa = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, stateList);     RESTlist.setAdapter(aa);</code></pre><p>I keep getting an exception and i don't know why. Can anyone give me a hand?</p><p>Logcat:</p><pre><code>06-21 20:10:47.901: ERROR/AndroidRuntime(472): Uncaught handler: thread main exiting due to uncaught exception06-21 20:10:47.950: ERROR/AndroidRuntime(472): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pa.passammain/com.pa.passammain.RESTtest}: java.lang.NullPointerException: println needs a message06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.os.Handler.dispatchMessage(Handler.java:99)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.os.Looper.loop(Looper.java:123)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at java.lang.reflect.Method.invokeNative(Native Method)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at java.lang.reflect.Method.invoke(Method.java:521)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at dalvik.system.NativeStart.main(Native Method)06-21 20:10:47.950: ERROR/AndroidRuntime(472): Caused by: java.lang.NullPointerException: println needs a message06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.util.Log.println(Native Method)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.util.Log.e(Log.java:208)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at com.pa.passammain.RESTtest.onCreate(RESTtest.java:82)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-21 20:10:47.950: ERROR/AndroidRuntime(472):     ... 11 more</code></pre><p>After editing how my error is displayed in my try/catch i'm not longer getting an exception, but just a blank screen. Here is what my logcat is displaying:</p><pre><code>06-21 20:22:00.330: WARN/System.err(542): java.lang.NullPointerException06-21 20:22:00.352: WARN/System.err(542):     at com.pa.passammain.SAXHandler.characters(SAXHandler.java:45)06-21 20:22:00.352: WARN/System.err(542):     at org.apache.harmony.xml.ExpatParser.text(ExpatParser.java:166)06-21 20:22:00.362: WARN/System.err(542):     at org.apache.harmony.xml.ExpatParser.append(Native Method)06-21 20:22:00.371: WARN/System.err(542):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:506)06-21 20:22:00.371: WARN/System.err(542):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467)06-21 20:22:00.371: WARN/System.err(542):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329)06-21 20:22:00.381: WARN/System.err(542):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286)06-21 20:22:00.381: WARN/System.err(542):     at com.pa.passammain.RESTtest.onCreate(RESTtest.java:71)06-21 20:22:00.391: WARN/System.err(542):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)06-21 20:22:00.391: WARN/System.err(542):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-21 20:22:00.401: WARN/System.err(542):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)06-21 20:22:00.401: WARN/System.err(542):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)06-21 20:22:00.410: WARN/System.err(542):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)06-21 20:22:00.410: WARN/System.err(542):     at android.os.Handler.dispatchMessage(Handler.java:99)06-21 20:22:00.420: WARN/System.err(542):     at android.os.Looper.loop(Looper.java:123)06-21 20:22:00.420: WARN/System.err(542):     at android.app.ActivityThread.main(ActivityThread.java:4203)06-21 20:22:00.420: WARN/System.err(542):     at java.lang.reflect.Method.invokeNative(Native Method)06-21 20:22:00.430: WARN/System.err(542):     at java.lang.reflect.Method.invoke(Method.java:521)06-21 20:22:00.430: WARN/System.err(542):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)06-21 20:22:00.442: WARN/System.err(542):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)06-21 20:22:00.442: WARN/System.err(542):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","356615","","356615","","2010-06-21 20:27:41","2010-06-21 20:27:41","Problem using SAXParser to get a list of strings to an arraylist","<xml><android><arraylist><saxparser>","1","2","","",""
"3088111","1","3103143","","2010-06-21 20:05:32","6","6596","<p>I want to have a  elmenent with a 2 color border outline.  I can do a single color outline using the  element, but this only allows me to draw a single line.  I tried using 2  elements within my  but that didnt work either.   Is there a way to either draw a shape within a shape or draw 2 lines around my shape (which has rounded corners btw).</p><p>ThanksBen</p>","372405","","","","","2012-03-19 12:48:52","android Shape within a shape","<android><shape>","2","0","3","",""
"3088248","1","","","2010-06-21 20:23:56","1","2028","<p>I need help/pointer to doc/sample code on how to load multiple audio files from a specific folder on the SD card and have it play a random file back(i think i can figure out the last step if i could just figure out how to load multiple files).  Here is my incredibly poorly written app so far, don't judge too harshly as I'm learning as I go.</p><pre><code>public class zazenbox extends Activity implements OnClickListener{File filecheck;MediaPlayer player;Button playerButton;Integer var1;String path1;AlertDialog.Builder alertbox;public void onClick(View v) {    if (v.getId() == R.id.play) {        playPause();    }}/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    demoLoad();    playerButton = (Button) this.findViewById(R.id.play);    playerButton.setText(R.string.stop);    playerButton.setOnClickListener(this);    demoPlay();}@Overridepublic void onPause() {    super.onPause();    player.pause();}@Overridepublic void onStop() {    super.onStop();    player.stop();}private void demoLoad() {    dirfilecheck();    player = new MediaPlayer();    player.setLooping(true);    try {        player.setDataSource(path1);        player.prepare();    }    catch (IOException e) { e.printStackTrace(); }    catch (IllegalArgumentException e) { e.printStackTrace(); }    catch (IllegalStateException e) { e.printStackTrace(); }}private void dirfilecheck() {    filecheck = new File(Environment.getExternalStorageDirectory() + ""/zazenbox"");    if(filecheck.exists() &amp;&amp; filecheck.isDirectory()) {        // load files.        var1 = 1;        path1 = filecheck + ""/bm10"" + var1 + "".wav"";    } else {        // create folder, dl sample loop, and instruct user how to add music/loops.        filecheck.mkdirs();        alertbox = new AlertDialog.Builder(this);        alertbox.setMessage(""Please put loopable media in zazenbox on your sdcard."");        alertbox.setNeutralButton(""Ok, I will."", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface arg0, int arg1) {                Toast.makeText(getApplicationContext(), ""Please plug in your device now"", Toast.LENGTH_LONG).show();            }        });        alertbox.show();    }}private void demoPause() {    player.pause();    playerButton.setText(R.string.play);}private void demoStop() {    player.stop();    playerButton.setText(R.string.play);}private void demoPlay() {    player.start();    playerButton.setText(R.string.stop);}private void playPause() {    if(player.isPlaying()) {        demoStop();        //demoPause();        //player.release();        var1++;        path1 = filecheck + ""/bm10"" + var1 + "".wav"";        /*try {            player.setDataSource(path1);            player.prepare();        }        catch (IOException e) { e.printStackTrace(); }        catch (IllegalArgumentException e) { e.printStackTrace(); }        catch (IllegalStateException e) { e.printStackTrace(); }*/        //player.start();        //demoPlay();    } else {        //do stuff        demoPlay();    }}</code></pre><p>}</p>","327248","","","","","2011-04-22 16:12:21","Loading Multiple Audio files from SD card","<android><audio><media>","1","0","","",""
"3088722","1","5382752","","2010-06-21 21:45:43","7","1183","<p>I recently upgraded to Android SDK 2.1 and 2.2 but the AVD always displays with Chinese and Japanese characters active. I can go to Settings to uncheck these options but it's becoming a pain. How can I set the Language &amp; Keyboard defaults to avoid this hassle?</p><p>Thanks ...</p>","353616","","","","","2013-05-01 11:22:57","How do I set the defaults (Language & Keyboard) for an Android AVD (SDK 2.1 & 2.2)","<android>","1","1","","",""
"3088779","1","3088798","","2010-06-21 21:56:03","0","931","<p>I'm trying to display an image before the list in a listactivity. </p><p>If I put an ImageView before the ListView, then only the list is displayed... still quite an android n00b so any pointers appreciated :)</p><p>Heres my main.xml which lays out the list activity:</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/header""      android:src=""@drawable/header""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_gravity=""top""      android:scaleType=""fitStart""      /&gt;    &lt;ListView android:id=""@+id/android:list""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:scaleType=""fitEnd""        /&gt;&lt;/LinearLayout&gt;</code></pre>","62709","","","","","2010-06-21 21:58:08","Android - How to display an ImageView as a header in a listactivity?","<android><imageview><listactivity>","1","0","","",""
"3088818","1","3095410","","2010-06-21 22:02:18","3","1312","<p>I want to have an ImageView that is part of a listview row item, but that appears to both in and out of the row.  is this possible? if so, how?  many thanks in advance... <img src=""http://www.freeimagehosting.net/uploads/a7e703a33f.png"" alt=""alt text"">  </p>","372405","","","","","2012-02-09 11:37:02","android image in listview that thinks ""outside"" the box","<android><image><listview><row>","3","2","1","",""
"3089109","1","3089498","","2010-06-21 23:05:59","0","4099","<p>EDIT :</p><p>I am trying to send an xml file as a post request in Android.</p><p>The server accepts text/xml. I tried creating a MultipartEntity, which has a content type of multipart/form-data. </p><pre><code> HttpClient httpClient = new DefaultHttpClient();    /* New Post Request */    HttpPost postRequest = new HttpPost(url);    byte[] data = IOUtils.toByteArray(payload);    /* Body of the Request */     InputStreamBody isb = new InputStreamBody(new ByteArrayInputStream(data), ""uploadedFile"");    MultipartEntity multipartContent = new MultipartEntity();    multipartContent.addPart(""uploadedFile"", isb);    /* Set the Body of the Request */    postRequest.setEntity(multipartContent);    /* Set Authorization Header */    postRequest.setHeader(""Authorization"", authHeader);    HttpResponse response = httpClient.execute(postRequest);    InputStream content = response.getEntity().getContent();    return content;</code></pre><p>However I get an error saying the content type cannot be consumed. </p><pre><code>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method (Cannot consume content type).</code></pre><p><strong>How do I change the content type of the request?</strong></p><p>Edit:</p>","82368","","82368","","2010-06-21 23:56:24","2014-02-13 03:57:05","Using Android to Post XML files","<java><android><apache><httpclient><http-post>","5","7","2","",""
"3089242","1","","","2010-06-21 23:41:14","0","265","<p>I want develop on Android and iPhone...</p><p>How Platform can i use?</p>","372663","","","","","2010-06-21 23:59:17","Platform for develop on multi OS-Phone","<iphone><android>","3","1","","2012-11-14 20:59:50",""
"3089364","1","3089383","","2010-06-22 00:17:52","1","902","<p>I am writing an app that displays fun-facts (and the source they are from). The user can browse through the facts one by one.  </p><p>Here is the design I thought of :<br>Create a table in SQLiteDatabase with a text column that stores the fun-fact and a second column that stores it's source. (not sure if this is the best way to go about doing it, but I want the app available even without the network)</p><p>My question is, when database is initially created on the device, should I manually populate the database from within the code, something like this pseodo-code:-</p><pre><code>    @Overridepublic void onCreate(SQLiteDatabase db) {    //Create the table    //Populate the table        //Insert statement 1        //Insert statement 2        //Insert statement 3                          ...        //Insert statement 500}</code></pre><p>Surely there must be a better method to create the initial database when the app is installed?   </p>","289918","","","","","2010-06-22 07:17:05","Creating initial SQLiteDatabase when app is installed","<android><database><sqlite3>","2","0","","",""
"3089381","1","","","2010-06-22 00:23:40","0","217","<p>I have the mobile page displayed fine in iPhone with the meta element set.</p><p></p><p>It also work fine in HTC G1 and G2 phone without the above meta tag.</p><p>However, it is totally screwed up when displayed on the HTC Droid phone such as Motorola Droid. </p><p>Does anyone know that what parameters I should set to display it properly? I have the background image with 320X480 which is the exact size of device resolution (320X480).</p>","369621","","","","","2010-06-23 22:01:09","Browser Display Problem on Motorola Droid Phone","<android>","1","0","","",""
"3089550","1","3090814","","2010-06-22 01:08:10","1","1050","<p>I am building a custom view and trying to figure out how to integrate it with the gui layout editor in eclipse.  I have added the code below to my constuctor.</p><pre><code> public baseGrid(Context context, AttributeSet attrs) {  super(context, attrs);  if (attrs.getAttributeValue(null, ""bufferTop"") != null)   bufferTop = Integer.parseInt(attrs.getAttributeValue(null, ""bufferTop""));     ...</code></pre><p>and it works to read this xml attribute (... <code>bufferTop=""10""</code> ...) from the xml layout file.  However, is there a way to get bufferTop to show up in the GUI Property Editor as a property that I can set without editting the XML?</p><p>Thanks</p>","336681","","151445","","2010-06-22 01:16:51","2010-06-24 06:39:37","Android ""layout editor"" and ""custom property""","<android>","1","0","","",""
"3089772","1","","","2010-06-22 02:05:45","0","2695","<p>I searched the web but for now I didn't found anything.</p><p>Is it possible to <strong>find</strong> the nearest bus/train/ official <strong>stations of public transportation types</strong>?</p><p>The 'nearest' is a seperate case ;=)</p><p>but is it just possible to find them?this is that i'm searchin :)</p><p><a href=""http://yfrog.com/cbbild2zyp"" rel=""nofollow"">http://img443.imageshack.us/img443/7203/bild2zy.png</a></p><p>They are tagged, but I'm searching how to access /find them.</p><p>Would be glad about any suggestions.</p>","371749","","1101070","","2012-02-08 02:01:58","2012-02-08 02:01:58","Find nearest transit station / stopover (bus, train etc) in google maps","<java><android><google-maps><gtfs>","1","3","","",""
"3089991","1","3090162","","2010-06-22 03:04:23","1","3324","<p>I want to draw a shape(many circles particularly) into a Specific Bitmap.I have never used canvas / 2D graphs etc.Anyone that can point me to the right direction to do what i want.?</p><h2>#</h2><p>As i see it i create a Drawable put the bitmap in it then ""canvas-it"" to the shapes i want etcbut i really need some guideline </p>","348058","","","","","2010-06-23 10:05:32","How to Draw a shape or bitmap into another Bitmap , Java/android","<java><android><canvas>","1","0","3","",""
"3090009","1","4901506","","2010-06-22 03:10:02","6","14442","<p>So I ran into a problem today while working on my Android program. I have a class that turns that an XML string into a Java object (third party) and it works fine in as a regular java project but on Android I get this weird error:</p><pre>06-21 22:44:26.402: DEBUG/App(259): java.lang.ClassNotFoundException: com.package.mycode.Class in loader dalvik.system.PathClassLoader@4001b50006-21 22:44:26.402: DEBUG/App(259):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)</pre><p>I hide my application name and my package for obvious reasons but I was wondering if anyone has ever encountered problems like this. Class is in the correct package, which is a library I have added. Other classes that I reference before are there and those can be made. Are there any other reasons a <code>ClassNotFoundException</code> is thrown?</p><p>Thanks,Jake</p>","399306","","40342","","2011-03-21 06:38:08","2013-08-20 17:23:37","ClassNotFoundException Android","<java><android><dalvik><classnotfoundexception><classnotfound>","6","1","2","",""
"3090041","1","","","2010-06-22 03:16:41","4","10430","<pre><code>package one.two;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.database.Cursor;import android.inputmethodservice.Keyboard.Row;import android.os.Bundle;import android.view.Menu;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class List_View extends ListActivity {    private ListView lv;     private TextView toptext;     private TextView bottomtext;    DBAdapter db = new DBAdapter(this);    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.list_main);        DBAdapter db = new DBAdapter(this);        getData();        toptext = (TextView) findViewById(R.id.toptext);         bottomtext = (TextView) findViewById(R.id.bottomtext);     }    private void getData() {        db.open();        List&lt;String&gt; items = new ArrayList&lt;String&gt;();         Cursor c = db.getAllEntry();         c.moveToFirst();          toptext.setText(""Date: ""+c.getString(4));         bottomtext.setText(""Title: ""+c.getString(1));         ArrayAdapter&lt;String&gt; entries = new ArrayAdapter&lt;String&gt;(this, R.layout.view_list, items);         setListAdapter(entries);         db.close();     }}</code></pre><p>I'm not able to put the data from my database into my <code>ListView</code>. </p><p>Here's my database code: </p><pre><code>package one.two;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;public class DBAdapter {   //values for the login tablepublic static final String KEY_ROWID = ""_id"";public static final String KEY_USER = ""user"";public static final String KEY_PASSWORD = ""pass"";public static final String KEY_NUMBER =""no"";//Values for the entry tablepublic static final String KEY_ROWID2 = ""_id2"";public static final String KEY_TITLE = ""title"";public static final String KEY_ENTRY = ""entry"";public static final String KEY_MOOD = ""mood"";public static final String KEY_DATE = ""date"";public static final String KEY_TIME = ""time"";private static final String TAG = ""DBAdapter"";//declare Database name, tables namesprivate static final String DATABASE_NAME = ""Database3"";private static final String DATABASE_TABLE = ""Login"";private static final String DATABASE_TABLE_2 = ""Entry"";private static final int DATABASE_VERSION = 1;//declares the rules for the database tablesprivate static final String DATABASE_CREATE =    ""create table login (_id integer primary key autoincrement, ""    + ""user text not null, pass text not null,""     + "" no integer not null);"";private static final String DATABASE_CREATE_2 =    ""create table entry (_id2 integer primary key autoincrement, ""    + ""title text,entry text, mood text not null, date text not null, ""    + ""time text not null);"";private final Context context; private DatabaseHelper DBHelper;private SQLiteDatabase db;public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    //Create the tables with the rules we set.    @Override    public void onCreate(SQLiteDatabase db)     {        db.execSQL(DATABASE_CREATE);        db.execSQL(DATABASE_CREATE_2);    }    //OnUpgrade is only for use when u changed the database's version to 2 etc.    @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 titles"");        onCreate(db);    }}    //---opens the database---public DBAdapter open() throws SQLException {    db = DBHelper.getWritableDatabase();    return this;}//---closes the database---    public void close() {    DBHelper.close();}//Method for inserting login details, can be used in other java files when DBAdapter is//declared in the java file. e.g. DBAdapter db = new DBAdapter(this);public long insertLogin(String user, String pass, String no) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_USER, user);    initialValues.put(KEY_PASSWORD, pass);    initialValues.put(KEY_NUMBER, no);    return db.insert(DATABASE_TABLE, null, initialValues);}public long insertEntry(String title, String entry, String mood, String date, String time) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_TITLE, title);    initialValues.put(KEY_ENTRY, entry);    initialValues.put(KEY_MOOD, mood);    initialValues.put(KEY_DATE, date);    initialValues.put(KEY_TIME, time);    return db.insert(DATABASE_TABLE_2, null, initialValues);}//---deletes a particular title---public boolean deleteLogin(long rowId) {    return db.delete(DATABASE_TABLE, KEY_ROWID +             ""="" + rowId, null) &gt; 0;}public boolean deleteEntry(long rowId2) {    return db.delete(DATABASE_TABLE_2, KEY_ROWID2 +             ""="" + rowId2, null) &gt; 0;}//method for retrieving all the inputs from databasepublic Cursor getAllLogin() {    return db.query(DATABASE_TABLE, new String[] {            KEY_ROWID,             KEY_USER,            KEY_PASSWORD,                           KEY_NUMBER,},            null,             null,             null,             null,             null,             null);}   public Cursor getAllEntry() {    return db.query(DATABASE_TABLE_2, new String[] {            KEY_ROWID2,            KEY_TITLE,            KEY_ENTRY,            KEY_MOOD,            KEY_DATE,            KEY_TIME},            null,             null,             null,             null,             null,             null);}//---retrieves a particular title---public Cursor getLogin(long rowId) throws SQLException {    Cursor mCursor =            db.query(true, DATABASE_TABLE, new String[] {                    KEY_ROWID,                    KEY_USER,                     KEY_PASSWORD,                    KEY_NUMBER},                     KEY_ROWID + ""="" + rowId,                     null,                    null,                     null,                     null,                     null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public Cursor getEntry(long rowId2) throws SQLException {    Cursor mCursor =            db.query(true, DATABASE_TABLE_2, new String[] {                    KEY_ROWID2,                    KEY_TITLE,                    KEY_ENTRY,                     KEY_MOOD,                    KEY_DATE,                    KEY_TIME},                     KEY_ROWID2 + ""="" + rowId2,                     null,                    null,                     null,                     null,                     null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}//---updates a title---public boolean updateLogin(long rowId, String user, String pass, String no) {    ContentValues args = new ContentValues();    args.put(KEY_USER, user);    args.put(KEY_PASSWORD, pass);    args.put(KEY_NUMBER, no);    return db.update(DATABASE_TABLE, args,                      KEY_ROWID + ""="" + rowId, null) &gt; 0;}public boolean updateEntry(long rowId,String title, String entry,         String mood, String date, String time)         {            ContentValues args = new ContentValues();            args.put(KEY_TITLE, title);            args.put(KEY_ENTRY, entry);            args.put(KEY_MOOD, mood);            args.put(KEY_DATE, date);            args.put(KEY_TIME, time);            return db.update(DATABASE_TABLE, args,                              KEY_ROWID + ""="" + rowId, null) &gt; 0;        }}</code></pre><p>Wasn't able to show. Hope you guys are able to help me!</p>","372750","","368354","","2013-09-24 15:14:21","2014-03-28 08:37:04","Getting stored data from database into ListView.","<android><listview>","3","4","3","",""
"3090338","1","","","2010-06-22 04:45:42","1","199","<p>i have an app which reads out the messages as it is received. The pgm seems to be working fine when i launch it or even when i press the back button on the emulator, however when i start another app in the same emulator and then if a message is received then i can see the message as Toast but am unable to receive any sound, so how do i correct that?</p><p>*<em>TextSpeaker *</em></p><pre><code>package com.example.TextSpeaker;import java.util.Locale;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener; import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;// the following programme converts the text to speech public class TextSpeaker extends Activity  implements OnInitListener {/** Called when the activity is first created. */int MY_DATA_CHECK_CODE = 0;public static TextToSpeech mtts;public Button button,stop_button;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    button = (Button)findViewById(R.id.button);    stop_button=(Button)findViewById(R.id.stop_button);    Intent myintent = new Intent();    myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);    startActivityForResult(myintent, MY_DATA_CHECK_CODE);    //edit text=(EditText)findViewById(R.id.edittext); }    public void buttonClickListener(View src){     switch(src.getId())     {     case(R.id.button):      Toast.makeText(getApplicationContext(), ""The service has been started\n Every new message will now be read out"", Toast.LENGTH_LONG).show();          //Intent serviceintent = new Intent(this,SpeakerService.class);          //serviceintent.setAction("".SpeakerService"");          //startService(new Intent(this,SpeakerService.class));         // startService(serviceintent);          break;     case(R.id.stop_button):      Toast.makeText(getApplicationContext(), ""The service has been stopped\n "", Toast.LENGTH_LONG).show();         mtts.stop();       //stopService(new Intent(this,SpeakerService.class));      break;     }    }    protected void onActivityResult(int requestcode,int resultcode,Intent data)    {     if(requestcode == MY_DATA_CHECK_CODE)     {      if(resultcode==TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)      {       // success so create the TTS engine       Log.v(""TextSpeaker"",""Pico is installed in the system"");       mtts = new TextToSpeech(this,this);       mtts.setLanguage(Locale.ENGLISH);      }      else      {       //install the Engine       Intent install = new Intent();       install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);       startActivity(install);      }     }    }    public void onDestroy(Bundle savedInstanceStatBundle)    {      //mtts.shutdown();    }    //public void onPause()    //{     // super.onPause();    // // if our app has no focus    // if(mtts!=null)    //  mtts.stop();   // }  @Override  public void onInit(int status) {   if(status==TextToSpeech.SUCCESS)   button.setEnabled(true);      }          }</code></pre><p><strong>Receiver</strong></p><pre><code>package com.example.TextSpeaker;import android.content.BroadcastReceiver;import android.content.Context; import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.telephony.SmsMessage; // supports both gsm and cdmaimport android.util.Log; import android.widget.Toast;public class Receiver extends BroadcastReceiver{public static String str="""";@Overridepublic void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras();Log.d(""Receiver"",""Message received successfully"");SmsMessage[] msgs = null;if(bundle!=null) {// retrive the sms received Object[] pdus = (Object[])bundle.get(""pdus""); msgs = new SmsMessage[pdus.length]; for(int i=0;i&lt;msgs.length;i++)  { str=""""; msgs[i]=SmsMessage.createFromPdu((byte[]) pdus[i]); str+=""Message From ""+msgs[i].getOriginatingAddress()+"".""; str+=""The message is ""+msgs[i].getMessageBody().toString(); TextSpeaker.mtts.speak(Receiver.str, TextToSpeech.QUEUE_FLUSH,null); } Toast.makeText(context,str,Toast.LENGTH_LONG).show();  } } }</code></pre>","238505","","119895","","2010-06-22 11:17:26","2011-08-02 18:55:10","programme not running in background","<android>","1","2","","",""
"3090433","1","3090446","","2010-06-22 05:10:12","0","602","<p>I want to develop an app targeting Android version 2.1 (6) and above so I have started the SDK and AVD Manager. In Available packages, for version 2.1 it shows Update-1 (version code 7) but not versions 5 and 6, which I guess are superseded.</p><p>If I install that version and compile against it, does it mean that handsets on version 6 cannot install my app from the Market? If so, how do I install the version 6 library or any version that is missing from the list, such as the 2.0.1 Eclair build? I'm confused.</p>","81317","","","","","2010-10-05 23:35:36","Android SDK and AVD Manager only shows latest version (not showing versions 5 or 6)?","<android>","1","0","","",""
"3090588","1","","","2010-06-22 05:55:25","0","735","<p>I am using service class to play the mp3 file using media player object on Android platform, problem is, i am not able to handle the alarm interruption.When any previous set alarm clock reach to it's alarm time it starts to play in parallel with mp3.I want that mp3 should become paused and after alarm it again start to play,same thing should happen with snooze.</p><p>Any help would be appreciable and thanks in advance...</p>","302676","","302676","","2010-06-23 04:21:02","2010-06-30 07:27:29","how to handle alarmclock and alarm reciever broadcasting to pause playing mediaplayer object","<android><service><media-player><alarm>","1","0","","",""
"3090650","1","3090802","","2010-06-22 06:09:59","19","26485","<p>How do I replace the following lines of code with an Asynctask ? How do you ""get back"" the Bitmap from the Asynctask ? Thank you.</p><pre><code>ImageView mChart = (ImageView) findViewById(R.id.Chart);String URL = ""http://www...anything ..."";mChart.setImageBitmap(download_Image(URL));public static Bitmap download_Image(String url) {        //---------------------------------------------------        Bitmap bm = null;        try {            URL aURL = new URL(url);            URLConnection conn = aURL.openConnection();            conn.connect();            InputStream is = conn.getInputStream();            BufferedInputStream bis = new BufferedInputStream(is);            bm = BitmapFactory.decodeStream(bis);            bis.close();            is.close();        } catch (IOException e) {            Log.e(""Hub"",""Error getting the image from server : "" + e.getMessage().toString());        }         return bm;        //---------------------------------------------------    }</code></pre><p>I thought about something like this :</p><p>replace :</p><pre><code>mChart.setImageBitmap(download_Image(graph_URL));</code></pre><p>by something like :</p><pre><code>mChart.setImageBitmap(new DownloadImagesTask().execute(graph_URL));</code></pre><p>and </p><pre><code>public class DownloadImagesTask extends AsyncTask&lt;String, Void, Bitmap&gt; {@Overrideprotected Bitmap doInBackground(String... urls) {    return download_Image(urls[0]);}@Overrideprotected void onPostExecute(Bitmap result) {    mChart.setImageBitmap(result);              // how do I pass a reference to mChart here ?}private Bitmap download_Image(String url) {    //---------------------------------------------------    Bitmap bm = null;    try {        URL aURL = new URL(url);        URLConnection conn = aURL.openConnection();        conn.connect();        InputStream is = conn.getInputStream();        BufferedInputStream bis = new BufferedInputStream(is);        bm = BitmapFactory.decodeStream(bis);        bis.close();        is.close();    } catch (IOException e) {        Log.e(""Hub"",""Error getting the image from server : "" + e.getMessage().toString());    }     return bm;    //---------------------------------------------------}}</code></pre><p>but How do I pass a reference to mChart in onPostExecute(Bitmap result) ???Do I need to pass it with the URL in some way ?I would like to replace all my lines of code :</p><pre><code>mChart1.setImageBitmap(download_Image(URL_1));mChart2.setImageBitmap(download_Image(URL_2));</code></pre><p>with something similar ... but in Asynctask way !</p><pre><code>mChart1.setImageBitmap(new DownloadImagesTask().execute(graph_URL_1));mChart2.setImageBitmap(new DownloadImagesTask().execute(graph_URL_2));</code></pre><p>Is there an easy solution for this ?Do I get something wrong here ?</p>","116573","","114066","","2010-06-22 10:49:02","2013-08-20 08:17:53","Android : Loading an image from the Web with Asynctask","<android><android-asynctask>","4","2","11","",""
"3090680","1","3092461","","2010-06-22 06:13:50","-2","1395","<pre><code>public class List_View extends ListActivity {    private TextView toptext;     private TextView bottomtext;    DBAdapter db = new DBAdapter(this);    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.list);        getData();        toptext = (TextView) findViewById(R.id.toptext);         bottomtext = (TextView) findViewById(R.id.bottomtext);     }    private void getData() {                       db.open();           Cursor c = db.getAllEntry();           c.moveToFirst();            ListAdapter adapter = new SimpleCursorAdapter(this,R.layout.view_list, c, new String[] {""date"", ""title""}, new int[] {R.id.toptext, R.id.bottomtext});           bottomtext.setText(c.getString(1));            toptext.setText(c.getString(4));            setListAdapter(adapter);           db.close();     }}</code></pre><p>I would like to show stored data from database into a ListView.  </p><p>Title and Date only.  </p>","372750","","114066","","2010-06-22 06:23:40","2010-06-22 11:04:37","Using a ListAdapter to show database data","<android><database><listview>","1","4","","",""
"3090761","1","3090789","","2010-06-22 06:27:21","16","4979","<p>When using </p><pre><code>file.createNewFile();</code></pre><p>I get the following exception</p><pre><code>java.io.IOException: Parent directory of file does not exist: /.../pkg/databases/mydb</code></pre><p>I am wondering is there a createNewFile that creates the missing parent directories?</p>","243782","","243782","","2010-06-22 06:41:54","2010-06-22 06:41:54","How to create a new file together with missing parent directories?","<java><android>","1","0","4","",""
"3090781","1","3090833","","2010-06-22 06:31:08","0","3057","<p>I want to display a progress bar/wheel, when doing some process, for instance, on a button click I want the screen to freeze and show a progress wheel , till the pressed action for example saving data in database is completed.</p><p>Is it possible, please provide code if applicable.</p>","328518","","54501","","2010-12-19 11:27:47","2010-12-19 11:27:47","How to show progress bar/circle in android","<android><process><progress-bar>","1","0","3","",""
"3090855","1","3093118","","2010-06-22 06:47:13","0","1145","<p>I am using gallery widget i want to change selected image.</p><pre><code>@Override    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {    if(lastSeen != null){       lastSeen.setImageResource(unselected image);    }    (ImageView(view)).setImageResource(selected image)    lastSeen = view;}</code></pre><p>When i run the following code and i use roller ball or arrow keys over device and if i try to scroll left to right or right to left focus goes out of gallery to next item over the screen what is that ?</p>","216431","","","","","2010-06-22 12:36:54","Android gallery onselecteditem","<android><image><gallery>","1","0","","",""
"3090952","1","","","2010-06-22 07:03:46","3","5498","<p>iam facing problem in creating the .apk file using the ant script . The generated .apk named as _unaligned.apk instead of .apk and on installing the _unaligned.apk file to the device i get force-close showing the java.lang.VerifyError exaception , but the same apk generated using IDE works fine . i am struck on this for a long time , is it possible for you to share the build.xml file that generates the .apk file . </p><p>thank you and regards </p><p>Sheik Ahmed.j</p>","143434","","","","","2012-06-25 08:34:56","Building the apk using the ant script ","<android><ant><build><apk>","3","0","2","",""
"3091000","1","","","2010-06-22 07:12:27","0","828","<p>i have a launcher activity which shows up the blank screen at the start up..i want to show up some animation using an animatd.gif...i initialize my layouts viz home etc when the oncreate of launcher is called, but how do i add some animated image until my first layout is shown..i also doubt whether android supports animated gifs or i have to do a workaround.</p>","340353","","","","","2011-07-15 12:21:07","how to show up animation at activity launch","<android>","1","0","0","",""
"3091054","1","","","2010-06-22 07:20:16","4","2417","<p>I'd like to know how to disable the highlighting effect when the user clicks the notification in the status bar and furthermore, I'd like to allow the user to interact directly with the RemoteView I have placed in the notification by means of button pressing.</p><p>I know this can be done as HTC's Sense has an ongoing notification while a call is in progress that has accomplished the above goals.</p><p>Please let me know if you have any ideas, specifically, how do I set an OnClickListener for a view nested within my RemoteView?</p>","372884","","","","","2012-05-09 15:12:20","Implementing an interactive notification in the status bar (Android)","<android><notifications><statusbar>","2","0","1","",""
"3091080","1","3091118","","2010-06-22 07:24:11","2","1880","<p>Ive made mis-leading topic in my last question, so i open this new question to clear what I realy want. sorry for the inconvenience.</p><p>I wanna run two system(Android) activities one after another in specific order from my main activity.</p><p>now as we know, startActivity is an asynchronous operation, so i cant keep on a specific order.</p><p>so i thought maybe I should try to do it with dialogBox in the middle but also running a dialogBox is an asynchronous.</p><p>now as i said the activities which i try to run are Android activities, so i cant even start them with startActivityForResult (or mybe i can, but i dont get any result back to my main(calling) activity)Any tricks how could i manage with this issue?</p><p>Some code:</p><p>first activity:</p><pre><code>      Intent intent = new Intent();       intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);       intent.setAction(Settings.ACTION_APPLICATION_SETTINGS);       startActivity(intent);    </code></pre><p>second activity: </p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setDataAndType(Uri.fromFile(tmpPackageFile         .getAbsoluteFile()),         ""application/vnd.android.package-archive""); startActivity(intent); </code></pre><p>as you can see, i dont have any access to those activites, i can just run thire intents from my main activity. </p>","260511","","","","","2012-07-03 15:12:52","Synchronous Android activities","<android>","2","2","","",""
"3091317","1","3091575","","2010-06-22 08:07:32","0","298","<p>A friend got an error on his HTC Desire trying to install an app. He uses eclipse for installing.</p><p>The error from LogCat:</p><pre><code>E/PackageInstallationReceiver( 244): Remove /data/local/tmp/my.package.apk Fail! W/System.err( 244): java.io.IOException: Error running exec().</code></pre><p>I used adb shell to see whats inside this tmp folder. And there was no such apk. So I renamed another, but the error stays which means, that he never really tries to delete this apk, right?</p><p>The same code runs fine on the emulator and my Nexus One. Some suggestions?</p>","180538","","180538","","2010-06-22 08:14:35","2012-05-30 06:52:18","PackageInstallationReceiver can't remove temporary apk file","<android>","1","0","","",""
"3091623","1","3091775","","2010-06-22 08:56:01","1","1000","<pre><code>try{File f = new File(""/data/cizip.zip""); if(f.exists()){   ZipFile zf = new ZipFile(f); //this always throws an error/*some of my codes here*/}catch(IOException e){   AlertDialog.Builder abd = new AlertDialog.Builder(this);   abd.setMessage(e.getMessage());   abd.show();}</code></pre><p>the line <code>ZipFile zf = new ZipFile(f);</code> always throws an error and I don't know why. And the error message is the file name (""/data/cizip.zip""), therefore I can't know the cause of the error. Can someone please tell me what causes this error? Thanks in advance.</p>","82350","","","","","2011-06-17 13:42:08","android problem in extracting zip file using ZipFile","<android><extract><zipfile>","2","1","1","",""
"3091628","1","3091957","","2010-06-22 08:57:28","0","453","<p>I would like to learn mobile development for fun and as well to enrich my resumé.I'm currently developing in C/C++ at work on Windows (and sometimes with C# that I don't like too much). I have a nice Android phone and an iPod touch, so I wonder what is the best enviroment on which work.</p><p>Sure iPhone/iOS now has huge user base and a lot of attention, but it is used just ion 3 devices from a single vendor (iPhone + iPod touch + iPad), Android instead is used by a lot of vendors, however is not gaining the attention it deserves.I own a MacBook white so I can develop for iOS (I even have installed XCode but it seems a mess to me), but I prefer to work on Windows and I downloaded Android SDK + Eclipse and it seems much more easy given my Visual Studio background. I also know some Java and I'm already resigned to Linux.</p><p>So... which one should I learn, also given my background?</p>","367307","","918414","","2013-03-16 03:11:33","2013-04-04 10:52:36","Android or iOS for mobile development?","<android><ios><mobile>","2","0","1","",""
"3091937","1","","","2010-06-22 09:42:41","3","2482","<p>I'm trying to find a way to check to see if a current EGLContext exists and is ready to use on Android. By specification, I've tried using</p><p>((EGL10)EGLContext.getEGL()).eglGetCurrentContext()</p><p>and then comparing it to EGL10.EGL_NO_CONTEXT (tried .equals() and != ). However, even though through debugging it 'seems' that it is returning an instance of 'EGL_NO_CONTEXT' (seems meaning all the internal values are uninitialized) however no matter what comparison I do I can't get it to work.</p><p>Anyone know of another/proper method to get this done? I don't want to do it by throwing a random GL call and catching the EGLError...</p>","255605","","","","","2013-01-24 20:21:27","Call to check if a current EGLContext exists in Android","<android><opengl-es>","3","0","0","",""
"3092052","1","3092288","","2010-06-22 10:01:09","4","3119","<p>(Question also posted here: <a href=""http://www.google.com/support/forum/p/Android+Market/thread?tid=68dc1f694537c7dc&amp;hl=en"" rel=""nofollow"">http://www.google.com/support/forum/p/Android+Market/thread?tid=68dc1f694537c7dc&amp;hl=en</a> )</p><p><a href=""http://developer.android.com/guide/publishing/publishing.html"" rel=""nofollow"">http://developer.android.com/guide/publishing/publishing.html</a>recommends searching for apps by Developer Name using the URL:market://search?q=pub:</p><p>I can't get this to work for two word names. For instance, if I want to search for all of Google's apps on the Market, I would search for 'Google Inc.' since if you look at Google Earth, Google Sky Map, etc. those are all published by 'Google Inc.'</p><p>I've tried the following:<br>market://search?q=pub:Google%2BInc%2E (equivalent of: Google+Inc.)</p><p>market://search?q=pub:Google%20Inc%2E (equivalent of: Google Inc.)</p><p>market://search?q=pub:Google Inc. (equivalent of: Google Inc.)</p><p>market://search?q=pub:Google+Inc.(equivalent of: Google+Inc.)</p><p>but none work. Any suggestions?</p>","299080","","","","","2013-07-20 04:55:04","How do I search Android Market based on two-word Developer Name?","<android><search><google-play>","2","0","","",""
"3092095","1","3092230","","2010-06-22 10:08:46","3","5436","<p>Can you please tell me how can I make a simple connection with remote db in android app? Basically, I want to save users names, emails etc. in a remote database and retrieve them later on demand. When answering - could you provide me some sample code so I can figure it out myself please? Thanks in advance!</p>","359656","","","","","2012-08-30 13:36:51","How to set up a connection with remote database in android?","<android>","2","1","2","",""
"3092176","1","3093145","","2010-06-22 10:22:32","1","865","<p>Assuming I have a contact saved in my addressbook, called ""TomTasche"" with the mail-address ""stackoverflow@gmail.com"". How can I retrieve the contact's name, if I only know the mail-address?</p><p>I already asked a similar questions about retrieving contact's nickname <a href=""http://stackoverflow.com/questions/3053554/retrieve-contacts-nickname"">here</a>, but if I change that code to query the mail, like that:</p><pre><code>Cursor cur = context.getContentResolver().query(Email.CONTENT_URI, new String[] {Email.DISPLAY_NAME, Email.TYPE, Email.CONTACT_ID}, Email.DATA + "" = "" + ""stackoverflow@gmail.com"", null, null);final int nameIndex = cur.getColumnIndex(Email.DISPLAY_NAME);final int typeIndex = cur.getColumnIndex(Email.TYPE);final int idIndex = cur.getColumnIndex(Email.CONTACT_ID);if (cur.moveToFirst()) {    name = cur.getString(nameIndex);    type = cur.getString(typeIndex);    id = cur.getString(idIndex);} else {    name = UNKNOWN;}</code></pre><p>it forces close and logcat tells me that there's a syntax error near @gmail.</p><pre><code>06-22 09:21:14.260: ERROR/DatabaseUtils(110): Writing exception to parcel06-22 09:21:14.260: ERROR/DatabaseUtils(110): android.database.sqlite.SQLiteException: near ""@gmail"": syntax error: , while compiling: SELECT display_name, data2, contact_id FROM view_data_restricted data WHERE (1 AND mimetype = 'vnd.android.cursor.item/phone_v2') AND (data1 = ""Tom"" &lt;stackoverflow@gmail.com&gt;)</code></pre><p>Interesting is that it seems to query fine. Logcat prints out the contact's name:</p><pre><code>06-22 09:21:14.260: [...] AND (data1 = ""Tom"" &lt;stackoverflow@gmail.com&gt;)</code></pre><p>So, how am I able to retrieve the name?</p><p>Thanks<br />Tom</p><p><strong>edit:</strong></p><p>Syntax Error is caused by missing quotes, <strong>but cursor returns null anyway.</strong></p>","198996","","198996","","2010-06-22 12:20:08","2010-06-23 09:47:33","resolve mail-address to contact's name","<android><contacts>","1","0","0","",""
"3092260","1","3092299","","2010-06-22 10:35:21","0","391","<p>I have android sdk 2.1 and it cannot resolve android.media.MediaFile package.</p><p>Why is it so? How can I solve this problem? To which version does android.media.MediaFile belong? Has it been deprecated?</p>","373049","","","","","2011-09-03 21:04:48","Cannot resolve android.media.MediaFile","<android>","1","0","","",""
"3092291","1","3127156","","2010-06-22 10:41:41","20","19813","<p>I have a web view to override the built-in browser and I want to show a progress indicator on the title bar.</p><p>This is the code:</p><pre><code>    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.browser);    currentURL = BrowserActivity.this.getIntent().getExtras().getString(""currentURL"");    try {        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.setWebViewClient(new browserActivityClient());        setProgressBarIndeterminateVisibility(true);        mWebView.loadUrl(currentURL);        setProgressBarIndeterminateVisibility(false);    } catch (Exception e) {        Log.e(getClass().getSimpleName(), ""Browser: "" + e.getMessage());        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();    } }</code></pre><p>It should work, I think, according to Android docs and other samples I saw on the net. But it doesn't, could you please tell me where am I wrong?</p><p>And another question: if sometimes later I'll choose to declare <code>android:theme=""@android:style/Theme.NoTitleBar""</code> in the application manifest, will the progress bar show anymore or not?</p><p>Thank you.</p>","364420","","","","","2013-02-04 12:17:38","Android: The progress bar in the window's title does not display","<android><progress-bar><titlebar>","5","0","13","",""
"3092424","1","4015962","","2010-06-22 10:59:38","2","8494","<p>I use a ksoap2 lib for communicating from android client with SOAP web service. Great job was done by ksoap team, but the problem is, there is no any good example how to use it correct in different aspects. For instance I get in soap response following data:</p><pre><code>anyType{    StatusSetting=anyType{Id=1; Name=Til afskrivning; LocationId=1; Editable=true; Default=true; Transcribed=false; };     StatusSetting=anyType{Id=2; Name=Afskrevet; LocationId=1; Editable=false; Default=false; Transcribed=true; };     ...}</code></pre><p>It's a complex object, or rather a collection of StatusSetting objects.When I try to get a property of SoapObject it's only 1 property with all that data as a string. It can't be parsed as json too. Unbelievable that nobody met same problem regarding to popularity android is gaining. Would be very cool to know if somebody solved this issue and how. Thanks.</p>","323128","","243782","","2010-06-22 11:27:09","2013-11-14 11:23:41","Parsing ksoap2 response","<java><android><soap><web-services><ksoap2>","4","0","4","",""
"3092673","1","3092757","","2010-06-22 11:36:28","0","2935","<p>We need to enable our customers to update some components in Android application, like icon/logo, dictionary file etc. </p><p>I saw the .APK can be opened like a JAR with 7-zip, and hope files can be edited/replaced there. But it is need to update MANIFEST.MF file in it, containing a digest for each .APK component' like:</p><p>Manifest-Version: 1.0Created-By: 1.0 (Android)</p><p>Name: res/raw/icon.pngSHA1-Digest: 6Un2G/VIkYfIGfMxruadIHtDABc=</p><p>Name: res/raw/logo.pngSHA1-Digest: zsIQqGWSu9w5m7gsl0jQoziy7JA=...</p><p>How to update these digests?</p>","373106","","","","","2011-05-21 17:00:14","How to update digests in Android MANIFEST.MF?","<android><customization><digest><apk><manifest.mf>","1","0","0","",""
"3093006","1","3093042","","2010-06-22 12:23:58","1","425","<p>Does android 1.5 or 1.6 support android.media.MediaFile ?</p>","373049","","","","","2010-06-22 12:58:23","which android version supports android.media.MediaFile?","<android>","2","0","","",""
"3093012","1","3093653","","2010-06-22 12:24:56","1","733","<p>I'm currently doing some debugging and I was wondering is it possible to display the contents of the phones SQLite database via the SDK? I know it's possible to do this via queries phone side. But I was just curious could you do it via the SDK?</p>","358438","","114066","","2010-06-22 13:47:00","2010-06-22 13:53:28","How to display the phones SQLite database via SDK?","<android><database>","1","3","","",""
"3093083","1","3093213","","2010-06-22 12:31:55","0","2588","<p>i have xxx.db (SQLite file) where i want to add him to my android appin my android app under src i open new directory where i add ""test.db""</p><p>then in my app what should i write in order to get the db ?</p><pre><code>String myPath = ""com.countryCityGame/databases/test.db"";SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);</code></pre><p>i am sure mypath is spelled wrong ' what is the current position of the dp file once the app is inside the emulator .should i insert the db into the manifest or somehing else ?thanku </p>","368440","","301832","","2010-07-21 09:46:09","2010-07-21 09:46:09","how to add xxx.db file into my project in android","<android><eclipse><sqlite>","1","0","","",""
"3093099","1","3096349","","2010-06-22 12:33:51","2","5976","<p>I want to do make my check box small than the actual size. How to do it? Any Idea?</p><p>for Example we can set the button as small size using the attribute </p><pre><code>style=""?android:attr/buttonStyleSmall""</code></pre><p>ThanX</p>","267269","","","","","2011-10-03 09:18:52","CheckBox Style in Android?","<android>","1","0","1","",""
"3093247","1","","","2010-06-22 12:50:43","2","10874","<p>I am very new to the Android platform. I need to make a connection with a UDP server by using my Android UDP client. Now, I need to know how to work with UDP in Android. Please guide me to do this.</p>","373172","","1190376","","2012-10-07 22:38:09","2012-10-07 22:38:09","How to work with UDP in Android?","<android><client><udp><client-server>","2","1","4","",""
"3093296","1","3149075","","2010-06-22 12:57:33","3","2110","<p>I have been trying to place a view in an arbitrary location.</p><p><strong>My aim:</strong> To overlay some rectangle of a JPG/PNG, given coordinates <em>that relate to the JPG/PNG</em>, with some other view, say, Gallery, or some video.</p><p>I don't want to use AbsoluteLayout, as it is depricated.</p><p>Therefore, I am using RelativeLayout, defining a dummy textbox as a placeholder, and putting my view RIGHT_TO and BELOW the textbox.</p><pre><code>+--------+|TextView||        | (x,y)+--------+-----------------------+         |                       |         |     My View           |         |                       |         +-----------------------+</code></pre><p><strong>My question is:</strong> Is there a more robust and elegant way to do that?</p><p>The problem with the way suggested above, is that it's very fragile: The coordinates need to be recalculated for every new screen. My view overlays something below. It needs to be accurately placed, which is pretty difficult to do.</p><ul><li>I will need to layout the screen again whenever rotated or zoomed or whatever. <strong>Worse:</strong> <ul><li>On init time, the typical time for placing the images, the coordinates of the screen are not valid. The coordinates are valid after placing the entities on screen. In order to place the entities on screen accurately, we need coordinates. Chicken and egg problem :(</li><li>On rotation, the coordinates include the margins rather than the width of the view itself (example: on a portrait AVD, display a portrait ImageView, then press CTRL+F12 to rotate. The left, right, top and bottom of the ImageView are totally not as expected).</li><li>When Scale-Animating, coordinates are scaled.</li></ul></li></ul><p>So I would like to find a better way to do that.</p><pre><code>Thanks    M.</code></pre>","361169","","102937","","2013-11-13 18:26:40","2013-11-13 18:26:40","Android: Placing a view in an arbitrary location","<android><layout><coordinates>","2","2","1","",""
"3093365","1","3093391","","2010-06-22 13:09:30","110","92380","<p>Does anyone know how can I check the system version (e.g. <code>1.0</code>, <code>2.2</code>, etc.) programatically?</p>","332311","","435093","","2012-10-29 14:20:04","2013-05-01 02:13:52","How can I check the system version of Android?","<android><version><system>","6","0","22","",""
"3093481","1","3337415","","2010-06-22 13:22:55","8","12104","<p>I'm sure that I'm missing something simple to get this implemented, but have run through every known combination I can come up with to get what I'm looking to do working. I'm trying to have a ListView footer sit at the bottom of the screen when the ListView items do not fill the page.</p><p>For example, I have a page with a ListView of three items and a FooterView (using the ListView's addFooterView) I want that footerView to sit at the bottom of the screen. When the ListView contains enough items to scroll the screen, the footerView should sit at the end of the list (not at the bottom of the screen).</p><p>The XML I'm trying to use is listed below. Any and all help is much appreciated!</p><p>Layout.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""android:background=""@+drawable/background""&gt;&lt;ListView    android:id=""@+id/menu""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:listSelector=""@android:color/transparent""    android:divider=""@null""&gt;&lt;/ListView&gt;&lt;/RelativeLayout&gt;</code></pre><p>ListViewRow.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""style=""@style/Nationwide.menu""&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/nav_item""    style=""@style/Nationwide.menu.row""&gt;    &lt;ImageView         android:id=""@+id/image_icon""        style=""@style/Nationwide.menu.leftIcon"" /&gt;    &lt;TextView         android:id=""@+id/nav_text""         style=""@style/Nationwide.menu.text"" /&gt;    &lt;ImageView        android:id=""@+id/chevron_symbol""        style=""@style/Nationwide.menu.rightIcon"" /&gt;&lt;/LinearLayout&gt;&lt;View    android:layout_height=""1dp""    android:background=""@drawable/nav_item_divider_dark"" /&gt;&lt;View    android:layout_height=""1dp""    android:background=""@drawable/nav_item_divider_light"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>ListViewFooter.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/footer""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_alignParentBottom=""true""&gt;&lt;View     android:id=""@+id/footer_image""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Java</p><pre><code>    LayoutInflater inflater = this.getLayoutInflater();    View footerView = inflater.inflate(R.layout.footer, null);    footerView.findViewById(R.id.footer_image).setBackgroundDrawable(resources.getDrawable(R.drawable.cone_footer));    mMenuListView.addFooterView(footerView);</code></pre><p>The things I've tried so far include:</p><ul><li>Adding the footer view as a shown above</li><li>Adding the drawable resource as a background on the ListView (This caused the ListView to not span the entire width of the screen and scroll in an odd manner due to the 9-Patch stretchable regions)</li><li>Adding the cone_footer as a separate view in the Layout</li></ul><p>Thanks in advance!</p>","226709","","","","","2014-01-07 09:59:20","Android ListView Footer View not being placed on the bottom of the screen","<android><listview><footer>","5","1","2","",""
"3093508","1","3094047","","2010-06-22 13:27:03","0","646","<p>Iam running  a service, this service downloading a file, and when it finish it notify the user via the notification bar.</p><p>so when there is a notification the user can see the tickerText, and then it disspear.</p><p>is there anyway of repeating this tickerText every X time on the notification line, until the user pulling the notification bar?</p><p>thanks,</p>","273550","","","","","2010-06-22 14:22:47","repeat tickerText on the notification","<android>","1","3","","",""
"3093531","1","","","2010-06-22 13:29:16","3","1331","<p>I am new to phonegap and android , i wanted to know how to access/make database through javascript. and the second thing i want to ask is how to make Graphs just using html, css and javascript.</p><p>Every information is thankfully accepted. </p>","373213","","","","","2010-09-11 20:13:06","PhoneGap Android","<javascript><html><css><android><phonegap>","1","1","","",""
"3093561","1","","","2010-06-22 13:33:34","7","1643","<p>Are there any UI design guidelines for the upcoming Android tablets? Looks like the Archos 7 will be available sometime this month. My question is not about supporting the screen size but more about providing a more appealing UI interface for a bigger screen device.</p><p>Thanks</p>","373223","","","","","2012-01-19 22:52:41","UI design guidelines for Android Tablets","<android>","2","0","1","",""
"3093562","1","3093636","","2010-06-22 13:33:36","4","9569","<p>I copied song.mp3 to my project's assets directory and wrote this code:</p><pre><code>private MediaPlayer mp;Uri uri = Uri.parse(""file:///android_asset/song.mp3"");mp=MediaPlayer.create(this, uri);</code></pre><p>After running the create statement, the variable mp is null.  What is wrong?</p><p>Thanks.</p>","291981","","552669","","2012-10-02 18:40:01","2012-10-02 18:40:01","Error creating MediaPlayer with Uri or file in assets","<android><media-player>","2","0","","",""
"3093666","1","3094362","","2010-06-22 13:43:43","1","428","<p>I am parsing XML file in my android application, but I like to modify the code, that it only parses the XML file if it is update (I will store the last successful parse date).</p><p>I found out the</p><pre><code>urlConnection.getLastModified();</code></pre><p>but not getting proper idea of how to use it, as it is returning milliseconds as long.is it possible I can check if file is modified or not.</p><p>thanks in advance.</p>","328518","","","","","2010-06-22 14:56:07","how to use getLastModified() in android for XML file creation/modicfication date check","<xml><android><last-modified>","1","0","1","",""
"3093680","1","3094524","","2010-06-22 13:45:17","2","397","<p>I program and test using the Droid Incredible. The other day my friend downloaded my alpha version, which works flawlessy on the Incredible, but crashed on his Moto Droid. I just updated my app to use 2.1 api's instead of 1.6; maybe this will make a difference?</p><p>I upped my min version requirements to 7.</p><p>My question is how can you make sure your app works on all phones and not just the phone your are building and testing on?</p><p>Is there a way to emulate a particular device?</p>","371532","","371532","","2010-06-22 13:51:54","2010-06-22 15:16:51","Android: Device Compatibility","<android>","3","2","","",""
"3093775","1","3093803","","2010-06-22 13:55:29","1","1419","<p>I'm defining an edit text like so...</p><pre><code>&lt;EditTextandroid:id=""@+id/user""android:layout_width=""200px""android:layout_height=""wrap_content""android:text=""Username""android:textSize=""18sp""android:gravity=""center""android:layout_x=""64px""android:layout_y=""140px""&gt;</code></pre><p>I'd like to replace the ""enter"" button that appears on the keypad automatically, with a done button that would just close the keypad when the user hits it. I've seen this done on a couple of apps (e.g the Nexus One twitter app) and would like to implement something similar. does anyone know how?</p><p>Also is it possible to get the text that appears by default to auto erase when the user click to edit the edittext box?Thanks,</p>","358438","","","","","2012-03-22 22:09:00","Android Edittext question, replace keypad enter with done","<xml><android>","3","0","","",""
"3093860","1","3131540","","2010-06-22 14:03:06","0","5603","<p>I'm trying to get ksoap2 working on android. I have spent at least 10 hours now reading forum posts, and documentations.Just querying some methods like getServerTime where I don't have to send any values, works.My goal is to send data, and receive a response. For example: send city name, get city time.</p><p>I'm practicing on this site: <a href=""http://www.nanonull.com/TimeService/TimeService.asmx"" rel=""nofollow"">http://www.nanonull.com/TimeService/TimeService.asmx</a></p><p>this is my code:</p><pre><code>  String METHOD_NAME = ""getCityTime"";  String SOAP_ACTION = ""http://www.Nanonull.com/TimeService/getCityTime"";  String NAMESPACE = ""http://www.nanonull.com/TimeService/"";  String URL = ""http://www.nanonull.com/TimeService/TimeService.asmx"";  SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);  request.addProperty(""city"", ""Chicago"");  SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(    SoapEnvelope.VER11);  envelope.setOutputSoapObject(request);  HttpTransportSE httpTransport = new HttpTransportSE(URL);  try {   httpTransport.call(SOAP_ACTION, envelope);  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (XmlPullParserException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } // This sends a soap  System.out.println(envelope.bodyIn.toString());</code></pre><p>this is the error I get(envelope.bodyIn.toString()):</p><pre><code>SoapFault - faultcode: 'soap:Server'faultstring: 'Server was unable to process request. ---&gt; Object reference not set to aninstance of an object.' faultactor: 'null' detail: org.kxml2.kdom.Node@435b9cf8</code></pre><p>Help would be greatly appreciated.</p>","373248","","","","","2012-12-17 06:07:03","ksoap2 android sending data","<java><android><soap><ksoap2>","4","0","","",""
"3093880","1","","","2010-06-22 14:05:10","1","1067","<p>Can someone tell me if it is possible to put an archive file with a size greater than 1 mb  in res/raw  and at runtime copy it to sdcard and decompress it?</p>","304866","","114066","","2010-06-22 14:15:00","2010-06-22 14:15:00","Is there a raw file size limit for android?","<android>","1","0","","",""
"3093920","1","","","2010-06-22 14:09:49","1","326","<p>How to get each items height in a ListView, as each item in the ListView has different size(as items are wrapped to content)i want to compress all the different item height to same item height on pinch in?</p>","373257","","367698","","2011-02-04 19:55:01","2011-02-04 19:55:01","How to get each items height in a ListView","<android><listitem>","0","2","","",""
"3093968","1","","","2010-06-22 14:14:21","0","1475","<p>Can anyone tell me how to change the Language &amp; Keyboard start-up settings?</p>","353616","","","","","2012-07-18 08:03:36","How do I get rid of the Chinese and Japanese characters on my AVD 2.1/2.2 Keyboard?","<android><android-emulator>","1","1","","",""
"3094056","1","4279696","","2010-06-22 14:23:26","3","771","<p>It seems that the Android resource compiler does not take into account linked folders (in Eclipse sense) in the assets folder. Question - is there a way to forcibly designate a folder of my choice as Android project assets?</p><p>Short of copying or hardlinking into project assets, I mean.</p>","219159","","","","","2010-11-25 17:46:30","Designate an arbitrary folder as Android assets?","<android><eclipse><resources>","2","2","","",""
"3094257","1","3094270","","2010-06-22 14:44:15","8","8595","<p>The following function is giving me an out of bounds exception...</p><pre><code>public void count(){    SQLiteDatabase db = table.getWritableDatabase();    String count = ""SELECT count(*) FROM table"";    Cursor mcursor = db.rawQuery(count, null);    int icount = mcursor.getInt(0);    System.out.println(""NUMBER IN DB: "" + icount);}</code></pre><p>It's meant to return the number of rows in the database. Anybody know whats wrong? am I perhaps doing this task the wrong way?</p>","358438","","243782","","2010-06-22 15:06:56","2013-07-02 07:07:00","Android SQLite Cursor out of bounds exception on SELECT count(*) FROM table","<java><android><sqlite>","3","0","2","",""
"3094344","1","","","2010-06-22 14:54:26","1","399","<p>Hi I want to create a grid of images with text right below the images. </p><p>I created in a xml file a image_text item which basically is a linearlayout with and imageview and a textview right below.</p><p>I created a tablelayout and I want to add my custom image_text.xml to the table row. But I dont know how to reference my xml file inside. If I use the include statament, how do I pass the image id and text to my item_text.xml?</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:shrinkColumns=""1""android:stretchColumns=""1""android:padding=""@dimen/inner_layout_horizontal_padding""android:background=""@drawable/base_bg_section""&gt;&lt;TableRow&gt;&lt;/TableRow&gt;</code></pre><p>Hope that this make sense and you can help me. any help will be greatly appreciated. </p>","355633","","2828","","2010-06-23 13:23:07","2011-05-06 18:26:01","how to include a view created in a xml file on my main layout","<xml><android><include>","1","0","","",""
"3094444","1","3094460","","2010-06-22 15:06:31","3","17424","<p>I'm trying to write a function that will delete every row in a given table but I'm getting a null pointer exception. Could somebody point me in the right direction? Here is the code...</p><pre><code>   public void deleteall(){    SQLiteDatabase db = tweets.getWritableDatabase();    String delete = ""TRUNCATE FROM tweets"";    db.rawQuery(delete, null);      }</code></pre>","358438","","","","","2013-08-18 12:45:04","Delete all rows from a table, throws nullpointer","<android><sqlite>","5","0","4","",""
"3094738","1","","","2010-06-22 15:44:41","4","5591","<p>I am currently trying to authenticate with a server via a http Get call. The code provided below works when compiled in a java project. Returning the correct token to the program. However whenever I try to implement the same code in Android I do not get a token returned via the Get call. </p><p>In Android I am returning inputLine in a function, however inputLine is always an empty string.</p><p>The system.out.println() prints the returned token.</p><pre><code>import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.net.URL;import javax.net.ssl.HttpsURLConnection;public class JavaHttpsExample {public static void main(String[] args){   String inputLine = new String();    try    {    String httpsURL = ""https://the url"";    URL myurl = new URL(httpsURL);    HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();    InputStream ins = con.getInputStream();    InputStreamReader isr=new InputStreamReader(ins);    BufferedReader in =new BufferedReader(isr);    inputLine = in.readLine();    System.out.println(inputLine);    in.close();    }    catch(IOException e)    {        e.printStackTrace();    } }}</code></pre><p>thanks for your help!!!</p>","373362","","1288","","2010-06-22 15:52:50","2011-04-12 10:35:10","Https request, authentication in Android","<java><android><https><get>","2","4","1","",""
"3094845","1","5870792","","2010-06-22 15:57:47","0","1784","<p>I have a ""Dynamic"" ExpandableListView. That is to say child are only load when there is click on there parent.  </p><p>So  I use <code>onGroupExpand</code> to load list. It works but I must expand myself the group with </p><pre><code>expandableList.expandGroup(groupPosition);</code></pre><p>The problem is that, when I click on parent, the group expands but the view go back to the first position. That is to say : I scroll, I click on parent, group expand, view go back to the first parent, so I must scroll again to see the group I click before.  </p><p>I try to use <code>expandableList.scrollTo(x,y);</code> But it doesn't work.  </p>","335500","","","","","2011-05-03 14:12:46","Problem with ExpandableListView position","<android><expandablelistview>","1","3","1","",""
"3095001","1","3611361","","2010-06-22 16:17:53","1","1144","<p>I have two activities that both contain an identical context menu built programmatically using menu.add(int, int, int, CharSequence).  They both use onCreateContextMenu andonContextItemSelected.</p><p>The first Activity contains a ListView, when the user long presses on an item the context menu appears for that item.  The second Activity (a detail screen for each item in Activity 1) contains a button, when the user presses the button the context menu appears.</p><p>I'd like to share the code that creates the context menu between these activities.  The only thing these activities share is the context menu, so it seems like a bit of overkill to create a superclass (e.g., ActivityOne extends ContextMenuActivity) that defines onCreateContextMenu and onContextItemSelected methods. </p><p>Is there a better way of sharing these methods between activities?</p>","233202","","","","","2010-08-31 17:00:30","Sharing a context menu between Activities","<android>","2","1","","",""
"3095080","1","3095105","","2010-06-22 16:25:20","10","3496","<p>Is it possible to create a bitmap image from a view or the screen in Android?</p>","143378","","","","","2011-03-22 13:03:19","Create image from view/screen in Android","<android><bitmap>","1","0","5","",""
"3095207","1","3095284","","2010-06-22 16:41:01","1","2937","<p>in my android app i have an ui-update-thread that keeps all my views up-to-date. </p><pre><code>protected Thread UIUpdateThread = new Thread(){ @Override public void run() {  while(true)  {    query_some_data_from_service(); // gets some ""fresh"" data from a service    UIUpdateHandler.sendEmptyMessage(0); // will update all ui elements with the new values    sleep(1234);  } }};</code></pre><p>i start this thread in onCreate() with </p><pre><code>UIUpdateThread.start();</code></pre><p>and everything works just fine :) when i leave the activity (e.g. because i switch to another activity) i call </p><pre><code>UIUpdateThread.interrupt();</code></pre><p>within onStop() to prevent the thread from running all the time. if i dont do this, it would keep running even if i close the app !?!?!!</p><p>problem is: how do i bring this thread back to life when returning from some other activity to this one? run() doesnt work, calling the initial start() in some other method like onResume() crashes the app.</p><p>i already tried a lot of things, but nothing seems to work :(</p>","370969","","370969","","2010-06-22 17:12:58","2013-06-29 11:37:52","how to restart a thread in android?","<java><android><multithreading>","4","0","","",""
"3095211","1","3106278","","2010-06-22 16:41:52","0","758","<p>I'm trying to catch a login exception thrown by the class that readerAccount belongs to in the code below.</p><pre><code>while(!readerAccount.isAuthenticated()) {    try {        readerAccount.login();    } catch(AuthenticationException e) {        cmDialog.show();        Toast.makeText(this.mCtx, ""login failed"", Toast.LENGTH_SHORT).show();        Log.w(""Google Reader API"",""login failed"");        continue;    }}</code></pre><p>However, the only part of the catch statement that happens is is the Log.w() function.  I was under the impression that during a catch statement, you have the opportunity to recover from errors, but the program blacks out the screen altogether and the dialog is not displayed, nor is the Toast.  What's going on here?</p>","329993","","","","","2010-06-23 23:25:42","Android exception handling, program halts","<java><android><exception><exception-handling>","2","6","","",""
"3095212","1","","","2010-06-22 16:42:11","2","3740","<p>I am new to android.I need to know how to connect (communicate)  with PC’s UDP server  with android client.Can anyone give a simple example ( Guide me to understand)</p>","365616","","","","","2013-05-17 16:30:54","How to connect with udp in android?","<android>","1","0","1","",""
"3095310","1","","","2010-06-22 16:55:18","0","797","<p>This code:</p><pre><code>public void onSurfaceChanged(GL10 gl, int w, int h) {gl.glViewport(0, 0, w, h);// gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();    gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glLoadIdentity();// set camera zoomGLU.gluPerspective(gl, 45.0f,(float) w / h, 0.1f, 100.0f);// point cameraGLU.gluLookAt(gl, 0, 1, 5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);}public void onDrawFrame(GL10 gl) {// clear last framegl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);// set model and projection matrices to identitygl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glLoadIdentity();GLU.gluLookAt(gl, 0, 1, 5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);    square.draw(gl);}</code></pre><p>works as expected on the emulator (on Android 2.1 virtual device) but on phone (HTC Desire Android 2.1) it just clears the screen, can't see anything drawn. If I comment out the </p><pre><code>gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();gl.glMatrixMode(GL10.GL_MODELVIEW);gl.glLoadIdentity();GLU.gluLookAt(gl, 0, 1, 5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);</code></pre><p>it works on the phone, but not if I have the gluLookAt call in onDrawFrame. </p><p>What's the problem with gluLookAt in onDrawFrame?</p>","373417","","","","","2010-06-22 18:16:40","Works on emulator, not on phone","<android><opengl-es>","1","0","","",""
"3095356","1","3095467","","2010-06-22 17:02:14","0","742","<p>i want to display a dialog in my android application where certain TextViews in the layout need to have content set during runtime.</p><p>while showing the dialog itself is no problem at all, accessing the TextViews via TextView.setText(String) crashes the application.</p><p>this is what i got so far:</p><pre><code>dialog = new Dialog(this);dialog.setContentView(R.layout.dialog);dialog.setTitle(""my dialog"");dialog.show();TextView tv;tv = (TextView) findViewById(R.id.title);tv.setText(""bkjadsjbk"");</code></pre><p>while this is working just fine without the last 3 lines, running that code WITH the TextView-stuff crashes my application.</p><p>is there any way to get this right?</p>","370969","","","","","2010-06-22 17:18:53","how to i edit contents of TextViews in Android Dialogs?","<java><android><dialog><textview>","2","0","","",""
"3095361","1","3098872","","2010-06-22 17:02:51","3","1923","<p>I'm trying to use a multiple selectable dialog as the code below. And I want to use a neutral button to deselect all the items in the list. But when clicking a button whichever on the dialog, the dialog disappears immediately, I assume it must be a default action. But I want to remain it since a user doesn't expect that action I think. Is it possible to avoid disappearing a dialog when clicking a button on it, or should I make a custom dialog?</p><pre><code>protected Dialog onCreateDialog( int index) {    return new AlertDialog.Builder(this)            .setTitle( ""title"" )            .setMultiChoiceItems(items, selections, new DialogInterface.OnMultiChoiceClickListener(){                @Override                   public void onClick( DialogInterface dialog, int clicked, boolean selected ) { }                })                  .setPositiveButton( ""OK"", new DialogInterface.OnClickListener()            {                @Override                public void onClick(DialogInterface dialog, int id)                {                    //Do something                }            })            .setNeutralButton( ""Deselect all"", new DialogInterface.OnClickListener()            {                @Override                public void onClick(DialogInterface dialog, int id)                {                    //Do something                }            })            .create();}</code></pre><p>Thanks in advance, yokyo</p>","366049","","","","","2010-12-18 19:18:15","How do I avoid hiding (or dismissing) an AlertDialog when clicking a NeutralButton?","<android>","3","0","1","",""
"3095406","1","3095471","","2010-06-22 17:09:02","0","1397","<p>I have a simple main activity with 3 buttons, and a background service that runs when Wifi connection is detected. My main activity polls the database on onCreate and displays the status. What i want is to force an Activity to redraw that textview every few second. I dont want to use binders or connect to service. Just some simple way to ask database every few second for a status. </p><p>Here is my code. </p><pre><code>mdbHelper.open();Cursor cursor = mdbHelper.fetchAllArticles();first = cursor.getCount();cursor = mdbHelper.fetchAllFeeds();second = cursor.getCount();cursor.close();mdbHelper.close();myTextView.setText(first + "" in articles and ""  + second + "" in feeds."");</code></pre><p>I can't seem to update myTextView from any other method except in onCreate... </p><p>Thanks!</p>","347891","","","","","2010-06-22 17:19:14","Simple way to update an Activity UI in android","<android><user-interface>","1","0","","",""
"3095445","1","5575391","","2010-06-22 17:14:27","26","20309","<p>Does anybody know of a website where I can find Android TabHost icons? (free or paid)</p>","61525","","","","","2013-09-14 09:14:53","Where can I find Android Tab Icons","<android><icons><android-tabhost>","9","2","29","2013-09-14 15:24:03",""
"3095488","1","3095580","","2010-06-22 17:21:06","0","312","<p>I do have an app that should only be visible in the market for Android 1.5 and 1.6 devices. So I thought I compile for SDK version 3 and set</p><pre><code>&lt;uses-sdk minSdkVersion=""3"" maxSdkVersion=""4"" /&gt;</code></pre><p>But it seems not to be so easy. I get an error saying</p><pre><code>error: No resource identifier found for attribute 'maxSdkVersion' in package 'android'</code></pre><p>How am I supposed to achieve that my app is only visible for sdk version 3 and 4 devices?Just to clarify: i have a second version of the app in the market for all devices with android >2.0 because it makes use of the <code>AccountManager</code>. The new version doesn't make use of it since it's not supported in 1.5 and 1.6.</p>","373138","","1288","","2012-08-04 17:33:14","2012-08-04 17:33:14","How to set maxSdkVersion for 1.5 apps","<android><android-manifest>","1","0","","",""
"3095683","1","3095717","","2010-06-22 17:49:57","1","400","<p>I want to create a settings file for my app which I store in the internal memory. I am wondering if this file will be deleted when the user updates the app to a newer version.</p>","229266","","","","","2010-06-22 17:54:59","Will the files be deleted on app update?","<android>","1","0","1","",""
"3095708","1","3102036","","2010-06-22 17:53:37","1","179","<p>I have added 4 activities to a tabhost widget. These work fine. The problem is that i have started a new activity from my of my activity that is present in the TabbedHost. This activity is started on a new screen i.e The tabs are no longer visible. How can i start a new activity and it remains within the tabbed host. I hope u understand what i mean? </p><p>Kind Regards,Mateen</p>","365019","","","","","2010-06-24 04:32:08","Added new Activities to a Tabbed Activity","<android>","1","0","","",""
"3095726","1","3095750","","2010-06-22 17:56:22","8","6268","<p>I was wondering if it was possible to have an android app which is already installed go and download another app and install it? I figure there could be security problems with this, but is it possible for the Android OS to do this?</p>","340","","","","","2012-06-12 07:46:05","Can an Android app install another android app?","<android><install>","4","0","6","",""
"3095879","1","","","2010-06-22 18:15:14","3","5983","<p>I'm trying to detect when a ScrollView has finished scrolling so I can slightly modify its position. Before I was using ACTION_UP to detect when the user lifted their finger, but then I realized this wouldn't allow me to use ""flinging"" as it would modify the scroll before it was finished.</p><p>Is there any way to detect when a ScrollView has finished scrolling? Or detect its scroll state like ListView?</p><p>Any other ideas on how to implement this?</p><p>Thanks.</p>","368845","","","","","2010-11-02 12:18:52","Detecting when scrollView has scrolled","<android><uiscrollview>","2","1","5","",""
"3095961","1","3096986","","2010-06-22 18:24:27","1","2170","<p>I'm very new to android and java both, so hopefully I'm missingsomething easy here.  All I want to do is create a simple PKCS10certificate signing request.  I have some code that will compile andrun on my ubuntu box (java-6-openjdk), but throws a null pointerexception in the android emulator:</p><pre><code>        KeyPair myKeyPair = KeyPairGenerator.getInstance(""RSA"").generateKeyPair();        X500Principal subject = new X500Principal(""CN=Test V3 Certificate"");        PKCS10CertificationRequest csr = new PKCS10CertificationRequest                        ( ""SHA1withRSA"",                           subject,                           myKeyPair.getPublic(),                           null,                           myKeyPair.getPrivate()                );        byte[] outBytes = csr.getEncoded();        return new String(outBytes);</code></pre><p>In the debugger I can see I have apparently constructed aPKCS10CertificationRequest, but I can't do anything with it (likegetEncoded() or even toString()) without error.  When I call getEncoded() it fails on theandroid emulator; this is the stack trace:</p><pre><code>06-22 04:41:06.143: WARN/System.err(337): java.lang.NullPointerException: obj == null06-22 04:41:06.213: WARN/System.err(337):     at org.bouncycastle.asn1.ASN1Collection.addObject(ASN1Collection.java:95)06-22 04:41:06.353: WARN/System.err(337):     at org.bouncycastle.asn1.DERSequence.&lt;init&gt;(DERSequence.java:34)06-22 04:41:06.433: WARN/System.err(337):     at org.bouncycastle.asn1.x509.AlgorithmIdentifier.toASN1Object(AlgorithmIdentifier.java:124)06-22 04:41:06.453: WARN/System.err(337):     at org.bouncycastle.asn1.ASN1Encodable.getDERObject(ASN1Encodable.java:77)06-22 04:41:06.483: WARN/System.err(337):     at org.bouncycastle.asn1.DEROutputStream.writeObject(DEROutputStream.java:74)06-22 04:41:06.523: WARN/System.err(337):     at org.bouncycastle.asn1.DERSequence.encode(DERSequence.java:70)06-22 04:41:06.544: WARN/System.err(337):     at org.bouncycastle.asn1.DEROutputStream.writeObject(DEROutputStream.java:74)06-22 04:41:06.593: WARN/System.err(337):     at org.bouncycastle.jce.PKCS10CertificationRequest.getEncoded(PKCS10CertificationRequest.java:443)</code></pre><p>I've tried this with both the API levels 7 and 8.  I know there's aton of other details I could post about the versions of variouscomponents of my system.  Like I said, I'm new to this, so right nowI'm more looking for a direction to go in than necessarily a finalanswer.</p><p>Thanks very much,</p><p>Adam Mackler </p>","373489","","373489","","2010-06-22 18:30:38","2012-03-16 09:49:38","PKCS10CertificationRequest creation on android","<java><android><bouncycastle><csr>","2","0","1","",""
"3096067","1","3096156","","2010-06-22 18:36:15","0","328","<p>Which is the better option? Develop software for OVI stores (or) Andorid (or) Apple stores? Which is the future of mobile application development? Qt for Meego/Symbian and hosting in OVI store? or Developing application for android or Developing application for iPhone?</p><p>I wish to know the best platform to learn to pursue my career as a individual developer. I mean make a living out of hosting mobile application in any of the above app stores.  </p>","248643","","1039361","","2012-04-18 09:20:01","2012-04-18 09:20:01","Which is the better option? Develop software for OVI stores (or) Android (or) Apple stores?","<android><qt><mobile><apple><smartphone>","2","4","","2010-06-22 20:20:21","2010-06-22 20:19:48"
"3096242","1","","","2010-06-22 18:56:42","0","425","<p>Since I don't know (and I don't think anyone does) when the next version of the Android Developer Phone that will support Android 2.x be available, can I use the following unlocked Android phone available on Amazon</p><p><a href=""http://rads.stackoverflow.com/amzn/click/B0030G6HRQ"" rel=""nofollow"">http://www.amazon.com/Motorola-Milestone-Unlocked-International-Warranty/dp/B0030G6HRQ/ref=sr_1_23?ie=UTF8&amp;s=wireless&amp;qid=1277232350&amp;sr=8-23</a></p><p>to test my Android apps (that is after testing on simulators).  Please share any experience you have on testing on real hardware devices, preferably without having to sign a long term contract.</p>","1244013","","","","","2010-06-22 19:11:18","Can I test Android apps that I develop on this real hardware device?","<android>","1","1","","",""
"3096246","1","3096384","","2010-06-22 18:57:06","2","1129","<p>I have a BroadcastReceiver set up in my Android application that receives SMS receive events. This works fine, but I want to be able to toggle SMS receiving on and off by toggling the BroadcastReceiver on and off. Because if I have a simple boolean inside the onReceive method, even if the SMS receiving is off, my application will start.  </p><p>Is this possible to do?</p><p>Cheers!</p>","253567","","","","","2010-06-22 19:19:05","Set BroadcastReceiver to be inactive","<android><sms><broadcastreceiver>","1","0","1","",""
"3096332","1","3097257","","2010-06-22 19:10:14","4","5384","<p>I'm working on a rich text editor in Android.  Basically it has bold, italics and link buttons that are tied to an EditText to change the style of the content.  I have it working great if you select the text you want to style first, and then select the button using this method: <a href=""http://developer.android.com/guide/appendix/faq/commontasks.html#selectingtext"" rel=""nofollow"">http://developer.android.com/guide/appendix/faq/commontasks.html#selectingtext</a>.</p><p>What I'm trying to do is have it work like a rich text editor, where you can use the buttons as a toggle to style the text for as long as you'd like, then click the toggle again to stop using the style.  So if I wanted to type '<strong>Pay attention to this!</strong>' in bold, I would click the 'B' button, then start typing the text and everything I type would be bold until I click the 'B' button again.  </p><p>Any ideas on how to pull this off?  I hope I've been clear enough :)</p>","309558","","","","","2011-12-15 22:20:34","Style EditText content 'on the fly'?","<android><coding-style><edittext>","4","3","5","",""
"3096378","1","7730921","","2010-06-22 19:18:04","20","6617","<p>I've implemented access to a database using <code>SQLiteOpenHelper</code> from the android.database package within some classes (with pattern DAO).</p><p>I wrote some junit tests for these classes using an <code>AndroidTestCase</code> but this causes the tests to use the same database as the application.</p><p>I read that the <code>ProviderTestCase2</code> or <code>RenamingDelegatingContext</code> can be used to test the database separately. Unluckily I couldn't find any nice tutorial/example that shows how to test a database with ProviderTestCase2/RenamingDelegatingContext.</p><p>Can anyone point me somewhere OR give me some tip OR share some code for database testing?!</p><p>Cheeerrrrsss!!Giorgio</p>","373542","","383414","","2014-03-06 12:52:22","2014-03-06 12:52:22","Testing database on Android: ProviderTestCase2 or RenamingDelegatingContext?","<android><database><testing><android-testing>","4","0","8","",""
"3096818","1","3096864","","2010-06-22 20:20:47","1","737","<p>I'm trying to create a list adapter that pulls in and displays data from a database. From what I can tell, it is pulling in the info, but it fails when I try to create the ListAdapter from the new Simple cursor adapter. Not sure what I'm doing wrong here.</p><pre><code>SQLiteDatabase db = myDbHelper.getReadableDatabase();String select = ""Select StateID, State, Details from States"";            Cursor cursor = db.rawQuery(select, null);startManagingCursor(cursor);ListAdapter adapter = new SimpleCursorAdapter(this,    android.R.layout.simple_list_item_1,    cursor,    new String[]{""State""},    new int[]{android.R.id.text1});setListAdapter(adapter);</code></pre><p>Part two will be figuring out how to assign StateID as a row id in the list so that I can access it when someone clicks on a state, but so that it's not visible.</p>","356438","","","","","2010-06-22 20:29:34","Putting SQLite data into ListActivity","<android><database>","2","0","","",""
"3096961","1","","","2010-06-22 20:39:19","0","130","<p>I'm trying to change the time zone on my Android emulator. I'm using Eclipse on a Windows 7 machine. To do this it says to enter some commands in the command line, but doesn't say how to access the command line!</p><p>So how do I access the command line in Windows 7 using Eclipse?</p>","373611","","","","","2010-06-22 20:42:52","How do I access the emulator control line in Android?","<android><command-line><time><timezone>","2","0","","",""
"3096970","1","3097004","","2010-06-22 20:40:56","1","718","<p>I've got the following layout XML file:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/main_layout"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:orientation=""vertical""&gt;&lt;GridView android:id=""@+id/main_grid_screen""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:numColumns=""auto_fit"" android:verticalSpacing=""30dp""    android:horizontalSpacing=""10dp"" android:columnWidth=""90dp""    android:stretchMode=""columnWidth"" android:gravity=""center"" /&gt;&lt;Button android:id=""@+id/clickable_area"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:text=""@string/view_items_area"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The GridView shows up perfectly fine; however, the Button below it is completely absent. If I place the Button tag above the GridView, it appears. What gives?</p>","213345","","","","","2010-06-22 20:44:01","Why can't I add elements after a GridView?","<android><gridview><layout><button>","1","3","1","",""
"3097148","1","8527465","","2010-06-22 21:05:49","2","1480","<p>I'm building an Android App where users need to be able to edit their own content, including minimal layout. I just want to store the formatted source in the database and pull it out and display it the way I would with something like TinyMCE in a web app.</p><p>Any ideas how users can enter and format their own content in an Android GUI?</p><p>Thanks!</p>","124732","","","","","2012-09-10 20:41:34","Android: How to implement WYSIWYG Editor for user content?","<android><wysiwyg>","2","0","1","",""
"3097190","1","3097250","","2010-06-22 21:13:26","0","718","<p>Dumb question, but I just can't seem to get it to work. I'm passing in parameters and returning string values, but all I receive is: org.apache.http.conn.EofSensorInputStream. Do I need to do something special in my web service to access the parameters being passed?</p>","356615","","","","","2010-06-22 21:23:46","Is it possible to access a .Net Web Service using HttpClient/HttpPost?","<.net><android><web-services><httpwebrequest>","1","0","","",""
"3097227","1","3417718","","2010-06-22 21:20:19","0","2757","<p>I have an ImageView object that I'm setting the android:src=""@drawable/some_xml_file"" instead of a standard png and it seems to not always render the drawable, as you can see in the first row here (it also happens intermittently in other rows as well):<img src=""http://www.freeimagehosting.net/uploads/d09b549a9d.jpg"" alt=""alt text""></p><p>I've tried setting the src &amp; the background property but they both have the same effect. the source code from my list view row item is this:</p><pre><code>&lt;ImageView android:id=""@id/action_button"" android:background=""@drawable/action_box""    android:layout_width=""25dip"" android:layout_height=""25dip""     android:layout_alignParentRight=""true"" android:layout_marginTop=""10dip"" /&gt;</code></pre><p>then my res/drawable/action_box.xml is this:</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=""#81c557""            android:endColor=""#539942""             android:angle=""270""/&gt;        &lt;stroke android:width=""1dip""  android:color=""#a8d78a""  /&gt;</code></pre><p></p>","372405","","","","","2010-08-05 18:05:17","Android ImageView with drawable not always rendering","<android><listview><imageview><drawable>","1","3","","",""
"3097237","1","","","2010-06-22 21:21:39","0","1660","<p>In my application I have recenlty added a home screen widget. Everything works fine except when trying to add a widget for the first time. Instead of opening the config Activity an ANR appears. </p><p>I'm guessing that since it works just fine after the first crash, the crash is probably caused by some undefined value. Or perhaps I have not understood the flow of things regarding an appWidget.</p><p>My Receiver is declared in the manifest with meta-data which points to the Activity used for preferences. This Activity consist of a spinner and a button. When the button is pressed an 'empty' RemoteView is passed to the host and a broadcast is sent to my service which will try to load data from a server. Do i need to pass a RemoteView to the host before user interaction?</p><p>The log entry makes no sense to me. I'm hoping that someone has a better understanding of log output than me:</p><pre><code>I/ActivityManager(   51): Displayed activity com.android.settings/.AppWidgetPickActivity: 1086 ms (total 21908 ms)E/my-appWidgetProvider(  228): BroadcastReciever enabledD/AndroidRuntime(  228): Shutting down VMW/dalvikvm(  228): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)I/ActivityManager(   51): Starting activity: Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=se.oskarnordgren.debaser/.widget.WidgetPrefs (has extras) }W/InputManagerService(   51): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43922578W/WindowManager(   51): Attempted to add window with non-application token WindowToken{43890b08 token=null}.  Aborting.D/dalvikvm(  228): DestroyJavaVM waiting for non-daemon threads to exitW/ActivityManager(   51): Timeout of broadcast BroadcastRecord{438c3308 android.appwidget.action.APPWIDGET_UPDATE} - receiver=android.os.BinderProxy@4393cfe8W/ActivityManager(   51): Receiver during timeout: ResolveInfo{438c3288 se.oskarnordgren.debaser.widget.DebaserWidget p=0 o=0 m=0x0}I/ActivityManager(   51): ANR in process: se.oskarnordgren.debaserI/ActivityManager(   51): Annotation: Broadcast of Intent { act=android.appwidget.action.APPWIDGET_UPDATE cmp=se.oskarnordgren.debaser/.widget.DebaserWidget (has extras) }I/ActivityManager(   51): CPU usage:I/ActivityManager(   51): Load: 0.87 / 0.36 / 0.13I/ActivityManager(   51): CPU usage from 10094ms to 20ms ago:I/ActivityManager(   51):   com.android.settings: 6% = 3% user + 2% kernel / faults: 4014 minor 5 majorI/ActivityManager(   51):   system_server: 3% = 2% user + 1% kernel / faults: 12 minorI/ActivityManager(   51):   logcat: 2% = 0% user + 1% kernel / faults: 108 minorI/ActivityManager(   51):   android.process.acore: 0% = 0% user + 0% kernel / faults: 2 minorI/ActivityManager(   51):   se.oskarnordgren.debaser: 0% = 0% user + 0% kernel / faults: 11 minorI/ActivityManager(   51):   com.android.phone: 0% = 0% user + 0% kernel / faults: 2 minorI/ActivityManager(   51):   adbd: 0% = 0% user + 0% kernelI/ActivityManager(   51):   sh: 0% = 0% user + 0% kernel / faults: 98 minorI/ActivityManager(   51): TOTAL: 5% = 3% user + 1% kernelI/ActivityManager(   51): Removing old ANR trace file from /data/anr/traces.txtI/Process (   51): Sending signal. PID: 228 SIG: 3I/dalvikvm(  228): threadid=7: reacting to signal 3I/dalvikvm(  228): Wrote stack trace to '/data/anr/traces.txt'</code></pre><p>Why do I get an ANR instead of the Activity referenced in <code>android:configure</code>?</p><p>I could paste more code if only I knew which parts are important here.</p>","289979","","289979","","2010-06-23 09:53:37","2010-06-23 09:53:37","Timeout of broadcast when configuring AppWidget","<android><widget>","0","2","","",""
"3097710","1","3097844","","2010-06-22 22:46:44","4","18408","<p>I have this resource file for colors</p><pre><code>&lt;resources&gt;    &lt;color name=""CLR_BLUE""&gt;#00f&lt;/color&gt;    &lt;color name=""CLR_RED""&gt;#f00&lt;/color&gt;    &lt;color name=""CLR_GREEN""&gt;#0f0&lt;/color&gt;    &lt;color name=""CLR_YELLOW""&gt;#ff0&lt;/color&gt;    &lt;color name=""CLR_BLUE_DARK""&gt;#00a&lt;/color&gt;    &lt;color name=""CLR_RED_DARK""&gt;#a00&lt;/color&gt;    &lt;color name=""CLR_GREEN_DARK""&gt;#0a0&lt;/color&gt;    &lt;color name=""CLR_YELLOW_DARK""&gt;#aa0&lt;/color&gt;&lt;/resources&gt;</code></pre><p>And this method that gets called when the user clicks one of four colored <code>Buttons</code></p><pre><code>private void changeBackground(Button pressedBtn){    int oldColor = 0;    int newColor = 0;    if(pressedBtn == greenBtn) {        oldColor = R.color.CLR_GREEN;        newColor = R.color.CLR_GREEN_DARK;    }    else if (pressedBtn == redBtn) {        oldColor = R.color.CLR_RED;        newColor = R.color.CLR_RED_DARK;    }    else if (pressedBtn == yellowBtn) {        oldColor = R.color.CLR_YELLOW;        newColor = R.color.CLR_YELLOW_DARK;    }    else if (pressedBtn == blueBtn) {        oldColor = R.color.CLR_BLUE;        newColor = R.color.CLR_BLUE_DARK;    }    else return;    pressedBtn.setBackgroundResource(newColor);    SystemClock.sleep(500);    pressedBtn.setBackgroundResource(oldColor);}</code></pre><p>The problem is the color of the Button doesn't change when pressed.I stepped with a debugger and it actually reaches the right points in the method, so that's not an issue. I think the problem is in <code>pressedBtn.setBackgroundResource(newColor)</code> but I can't understand why.</p><p>PS: Anyway, if you have a better solution to change a button color when pressed and, after a half second, change back to original color, let me know.</p>","133203","","","","","2012-10-16 08:45:17","Android: change button background programmatically","<android>","3","0","2","",""
"3097909","1","3098021","","2010-06-22 23:31:20","5","12205","<p>I've made a search screen that has one tab for keywords, filters, and a search button, and three optional tabs for the different types of results (each containing a ListView with an ArrayAdapter).  When starting the activity, the developer can optionally pass in the results as an extra Parcelable[] if the search has already been performed.  In the onCreate() method I'm creating each of the three tabs for the Parcelable[] passed through.</p><p>When I call a search from the button on the filter tab, I clear the tabs and recreate them with the new results, which works perfectly.  The problem is that when you rotate the device, it appears that Android's automatic orientation switching support recreates the entire activity, calling onCreate().  This means that my search results are reset to the Parcelable[] passed through when starting the activity.</p><p>The only solution I've had so far is to call finish() then startActivity() to essentially restart the activity with the new results.  I'm sure there must be a much simpler solution and that I've done something extremely noobish.</p><p>Is there a better way to do this?</p>","207389","","","","","2013-10-11 04:43:32","Android orientation change calls onCreate","<android>","2","0","2","",""
"3098097","1","","","2010-06-23 00:13:46","0","1627","<p>I am trying to post on Twitter from Android; first I considered <a href=""http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost"" rel=""nofollow"">http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost</a> but it asks the user to go on site and authorize the application, then to manually input the PIN in order to start posting.Next, starting with <a href=""http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/"" rel=""nofollow"">http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/</a> and following all the suggestions in the discussion threads I struggled to get the callback URL to get me back to my application after Twitter authorization. I did not succeed.</p><p>My question is: in the AndroidManifest.xml, under:</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"" android:host=""twitt"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>what exactly should be the scheme? The exact string ""myapp"", the name of my Android application, the name of my application created on Twitter? And host, is it mandatory?</p><p>Assuming that:</p><ul><li>my app on Twitter is named TwittApp,  with a callback url defined at creation time:<a href=""http://www.twittapp.com"" rel=""nofollow"">http://www.twittapp.com</a> and a callback URL defined at creation time: <a href=""http://www.twittapp.com/callbck"" rel=""nofollow"">http://www.twittapp.com/callbck</a></li><li>my Android app is named AndroidTwittApp</li></ul><p>How should the intent-filter data be defined?The callback url must be a real, browsable url?</p><p>Can somebody, please, show me the intent filter of a working example ?</p><p>I am anxious to receive an answer to help me go further, thank you in advance.</p>","364420","","","","","2010-06-25 01:38:03","Posting on Twitter from Android","<android><twitter>","1","0","","",""
"3098098","1","3098320","","2010-06-23 00:14:13","0","532","<p>I was able to get the animation to work on the emulator -- however my problem is that it animates for a second, but then then goes back to its original posistion right after it finishes animating. How can I stop this for happening. </p><p>This is how I animate my objects:</p><pre><code>    private void doAnimations() {  logo.setVisibility(View.INVISIBLE);  logo.setBackgroundDrawable(null);  logo.setMaxHeight((logo.getHeight()/2));  Animation animation = new TranslateAnimation(0, 0, 0, -200);  usernameEdit.startAnimation(animation); }</code></pre><p>Any help is appreciated. Thanks.</p>","354247","","","","","2010-11-23 09:26:22","TranslationAnimation in Android code","<android><gui><animation>","2","0","","",""
"3098146","1","3103059","","2010-06-23 00:30:13","3","2515","<p>I'm trying to achieve what amounts to effectively 2 strokes on a rectangle in a <code>&lt;shape&gt;</code> element in an android drawable xml.  A dark green outer line and a light green inner line, with a gradient fill in the center of it all.  My code currently looks like this:</p><pre><code>&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item&gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;        &lt;stroke android:width=""3px"" android:color=""#477135"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item &gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;        &lt;gradient android:startColor=""#81c557"" android:endColor=""#539942""            android:angle=""270"" /&gt;        &lt;stroke android:width=""1px"" android:color=""#a8d78a"" /&gt;    &lt;/shape&gt;&lt;/item&gt;</code></pre><p></p><p>I have tried applying android:top=""3px"" android:bottom=""3px"" to the 2nd item element, but when i add the right &amp; left attributes, the entire thing doesn't render.  Note, this is all done within a ListView</p>","372405","","","","","2010-06-23 15:25:53","Android multiple stroke box in drawable xml","<xml><android><shape><drawable><stroke>","1","0","","",""
"3098186","1","","","2010-06-23 00:40:30","1","2606","<p>I am using WebView to present UI. Is there any way that I can trigger custom soft keyboard when input text form field is selected?</p>","373760","","","","","2011-10-08 18:49:05","Android: how to add custom soft keyboard when form field is selected in WebView","<android><keyboard><uiwebview><webview><android-webview>","2","0","1","",""
"3098351","1","3098365","","2010-06-23 01:35:08","4","1417","<p>Here's my two scenarios.</p><p>1 - User opens app for the first time ever from android home screenUser is presented with ""first time"" screen (backed by first time activity, lets call it A)User hits back buttonuser is returned to android home screen</p><p>2 - User opens app for second timeUser is presented with the main list screen of the application (backed by a list activity, let's call it B)User hits back buttonUser is returned to android home screen</p><p>I'm already aware of numerous ways to detect whether it's the first time opening the app or not.</p><p>The problem is in having the back button return to the home screen rather than a routing activity that decides which screen to forward to.</p><p>Currently My app has an activity to decide where to route (lets call it R)  the problem is, My stack either looks like R -> A or R -> B</p><p>I want A or B to replace R on the stack when they open, and if the user hits back, then they go to the android home screen, not back to R.</p><p>Having a collaborator that sets the view for A and B is also not really workable as B extends androids concrete implementation of a list Activity to get most of its functionality.</p><p>Any ideas?</p>","77528","","","","","2010-06-23 01:38:24","How do I manipulate the Android activity stack?","<android><stack><activity><task>","1","0","1","",""
"3098372","1","3098461","","2010-06-23 01:40:57","1","3080","<p>In my app, I'm supporting the backup and restoration of the Sqlite db file.</p><p>I need to close and re-open my database connection after the restore. How can I do this?</p>","97120","","","","","2010-06-24 09:37:20","How to close and re-open Sqlite database?","<android><sqlite>","2","1","","",""
"3098474","1","3121167","","2010-06-23 02:10:23","5","1298","<p>I've been looking around, and I can't seem to find any definitive answer or headway that seems ""up to date"".  I've seen some interesting projects like Mirah (formerly Duby), and am looking into it a bit.  I've seen JRuby unsuccessfully used to compile ruby into .dex.  I've also been looking, independently, into Clojure and have realized that they might all be linked to the same thing.</p><p>Does anyone have any tips on how to get started and make headway?  I ask not only what frameworks could help, but more importantly, a philosophy/direction in which to guide my efforts, just to get started.</p>","292731","","1136063","","2012-01-12 02:41:12","2012-01-12 02:41:12","Getting started programming in dynamic languages in Android ((J)Ruby, Clojure...)","<java><android><clojure><jruby><dynamic-languages>","3","6","1","",""
"3098555","1","","","2010-06-23 02:34:13","1","437","<p>If I popup input method with togglesoftinput,my view's onCreateInputConnection was not called, and i can not communicate with input method.</p><p>And then i try to attach the input method to my view:</p><pre><code>public boolean showSoftInput(View view, int flags,ResultReceiver resultReceiver) {   checkFocus();   synchronized (mH) {      if (mServedView != view &amp;&amp; (mServedView == null || !mServedView.checkInputConnectionProxy(view))) {         return false;      }   }...</code></pre><p>but it returns false</p><p>How can I force onCreateInputConnection to be called?</p><p>or </p><p>How can I make mServedView == view  ?</p>","373819","","114066","","2010-06-23 07:26:18","2010-07-29 07:11:28","Android:Is it possible to communicate with input method without a normal textview like edittext?","<android>","1","0","0","",""
"3098609","1","3101768","","2010-06-23 02:47:53","3","4897","<p>The class which causes error is given below:</p><pre><code>package com.extrasmart;import android.app.Activity;import android.os.Bundle;import android.view.View;//import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;import android.widget.AdapterView.OnItemSelectedListener;public class ActivityImgGrid extends Activity {    ExtraSmartApplication application = (ExtraSmartApplication) getApplication();    GridView mGrid;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activityimg_grid);        mGrid = (GridView) findViewById(R.id.imgGrid);        mGrid.setAdapter(new AppsAdapter());        mGrid.setOnItemSelectedListener(new OnItemSelectedListener()        {            public void onNothingSelected(AdapterView v) {                // TODO Auto-generated method stub            }            public void onItemSelected(AdapterView parent, View v, int position, long id) {                ExtraSmartApplication application = (ExtraSmartApplication) getApplication();                application.setSelCategoryIcon(position);                setResult(RESULT_OK);                        finish();            }        });    }    public class AppsAdapter extends BaseAdapter {        ExtraSmartApplication application = (ExtraSmartApplication) getApplication();        private Integer[] imageIDs = application.getCategoryIcons();        public AppsAdapter() {        }        public View getView(int position, View convertView, ViewGroup parent) {            ImageView i;            if (convertView == null) {                i = new ImageView(ActivityImgGrid.this);                //i.setScaleType(ImageView.ScaleType.FIT_CENTER);                i.setLayoutParams(new GridView.LayoutParams(48, 48));                i.setScaleType(ImageView.ScaleType.CENTER_CROP);                i.setPadding(5, 5, 5, 5);            } else {                i = (ImageView) convertView;            }            i.setImageResource(imageIDs[position]);            return i;       }        public final int getCount() {            return imageIDs.length;        }        public final Object getItem(int position) {            return imageIDs[position];        }        public final long getItemId(int position) {            return position;        }    }}</code></pre><p>The xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/imgGrid""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:numColumns=""auto_fit""    android:columnWidth=""48px""    android:stretchMode=""columnWidth""        android:gravity=""center""    android:minHeight=""48px""    android:minWidth=""48px""    /&gt;</code></pre><p>Class used by ActivityImgGrid class:</p><pre><code>public class ExtraSmartApplication extends Application {    //private static final String APP_CREDENTIALS = null;    private Integer selCategoryImg;    private boolean isCardImageNew = false;    private byte[] cardImage = null;    private Integer[] categoryImgs = {            R.drawable.cricket,            R.drawable.football,            R.drawable.vollyball    };    private boolean isCatCreated = false;    public ExtraSmartApplication() {        super();    }    @Override    public void onTerminate() {        super.onTerminate();    }    public Integer getSelCategoryIcon() {        return this.selCategoryImg;    }    public Integer[] getCategoryIcons() {        return this.categoryImgs;    }    public void setSelCategoryIcon(int position) {        this.selCategoryImg = categoryImgs[position];    }    public void setCatCreated(boolean isCatCreated) {        this.isCatCreated = isCatCreated;    }    public boolean isCatCreated() {        return isCatCreated;    }    public void setCardImageNew(boolean isCardImageNew) {        this.isCardImageNew = isCardImageNew;    }    public boolean isCardImageNew() {        return isCardImageNew;    }    public void setCardImage(byte[] cardImage) {        this.cardImage = cardImage;    }    public byte[] getCardImage() {        return cardImage;    }}</code></pre>","357112","","366234","","2011-03-08 15:12:52","2011-03-08 15:12:52","ClassCastException: android.app.Application","<android><android-contentprovider>","2","3","","",""
"3098844","1","","","2010-06-23 03:56:47","1","184","<p>Well like the title says if you go to the Alarm clock App on droid i am trying to recreate the screen that comes up when you select an alarm. Essentially the ""other"" screen in the app. I am new to this but have spent the past day searching for this but im not to sure i know the correct terminology to find what im looking for. </p><p>I am making a time clock app that keeps track of my hours at work. I want to make a 3 row listview 1st row: a title RightOfthat EditText RightOfthat Button. 2nd row: a title RightOfthat EditText RightOfthat Button. 3rd row a title RightOfthat EditText. But i want it to look just like the screen on the Alarm Clock app. </p><p>i figured out how to format and bound listview using SQLite anyway i want but i am having trouble using listview with out bound data. Any help would be appreciated.</p>","373854","","21234","","2010-06-25 13:18:38","2011-10-07 16:21:03","making an unbound listview i.e. set alarm screen in the alarm clock app","<android><listview>","0","2","","",""
"3098848","1","","","2010-06-23 03:58:30","0","311","<p>I have installed: rhodes 2.0.0 beta 11, ruby 1.8, gem 1.3.7, and OpenSUSE 11.2. The only way i can get the app to compile is by using Android SDK 1.5. when I delete 1.5 and install 2.2 it says: No required platform (API level 3) found, can't proceed. any ideas? I would rather use an updated version of the SDK. </p>","110368","","41688","","2011-05-26 14:47:24","2011-05-26 14:47:24","using Android SDK 2.2 with Rhomobile","<android><compilation><android-2.2-froyo><rhomobile>","1","0","","",""
"3098923","1","","","2010-06-23 04:23:49","0","2619","<p>Android newbie. I am writing up a simple Google Maps application but when I start up my Android Emulator, it displays the ""No Service"" message, and I am unable to see the actual map. A couple of days ago everything was working fine, and I was able to connect. Didn't really make a change that could affect this. </p><p>Any idea about what might be going on?  </p>","98252","","","","","2010-07-01 04:31:40","Get ""No Service"" on Android Emulator","<android>","2","2","","",""
"3099051","1","3099250","","2010-06-23 05:10:22","0","588","<p>1.myJpegFile = new File(""images/jpegImage.jpg"");<br> 2.output = new BufferedOutputStream(new FileOutputStream(myJpegFile));<br> 3.encoder = JPEGCodec.createJPEGEncoder(output);<br> 4.encoder.encode(myJpegImage); </p><p>Please could you give me the equivalent code for line no. 3 and 4 in Android?</p>","373885","","15168","","2010-06-23 05:31:06","2010-06-23 05:59:59","Are there any tutorials on how to create jpeg images or convert images into jpeg on Android?","<android>","1","0","1","",""
"3099097","1","3101410","","2010-06-23 05:22:03","0","446","<p>i have the following pgm which responds with a Toast with an incoming msg and also speaks out the received msg, however there seems to be no speech synthesis in background but i still can see the Toast though, so should i start a service from the onReceive method (don't know if that's possible) here and then in the startService method  , write the speak method??</p><p>here's one of my pgms:</p><p><strong>Receiver</strong></p><pre><code>package com.example.TextSpeaker;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.telephony.SmsMessage;import android.util.Log;import android.widget.Toast;public class Receiver extends BroadcastReceiver{public static String str;@Overridepublic void onReceive(Context context, Intent intent) {    Bundle bundle = intent.getExtras();    Log.d(""Receiver"",""Message received successfully"");    SmsMessage[] msgs = null;    if(bundle!=null)    {        // retrive the sms received        Object[] pdus = (Object[])bundle.get(""pdus"");        msgs = new SmsMessage[pdus.length];        for(int i=0;i&lt;msgs.length;i++)        {            str="""";            msgs[i]=SmsMessage.createFromPdu((byte[]) pdus[i]);            str+=""Message From ""+msgs[i].getOriginatingAddress()+"".   "";            str+=""The message is ""+msgs[i].getMessageBody().toString();            //TextSpeaker.mtts.speak(Receiver.str, TextToSpeech.QUEUE_FLUSH,null);            //str="""";        }        Toast.makeText(context,str,Toast.LENGTH_LONG).show();        TextSpeaker.mtts.speak(Receiver.str, TextToSpeech.QUEUE_FLUSH,null);    }}</code></pre><p>}</p>","238505","","","","","2013-03-14 22:39:45","confused with BroadcastReceiver","<android>","3","0","","",""
"3099124","1","3113850","","2010-06-23 05:27:14","1","1822","<p>I was playing with a karaoke application on iPhone and came up with following questions:</p><ol><li><p>The application allowed its users to control the volume of the artist; even mute it. How is this possible?Does adjusting artist sound/setting equalizer etc. mean performing some transformation of required frequencies? What sort of mathematics is required here(frequency domain transformations)?</p></li><li><p>The application recorded users voice input via a mic. Assuming that the sound is recorded in some format, the application was able to mix the recording with the karaoke track(with artists voice muted). How can this be done?Did they play both the track and voice recording simultaneously? Or maybe they inserted additional frequency(channel?) in the original track, maybe replaced it?</p></li><li><p>What sort of DSP is involved here? Is this possible in Java, Objective C?</p></li></ol><p>I am curious and if you have links to documents or books that can help me understand the mechanism here, please share.</p><p>Thanks.</p>","236128","","","","","2011-10-08 03:29:19","Audio programming, Sound Processing and DSP","<java><iphone><android><audio><audio-processing>","2","0","2","",""
"3099252","1","3100550","","2010-06-23 06:00:45","0","1491","<p>I am using gallery as below</p><pre><code>   &lt;Gallery android:nextFocusUp=""@+id/zoom_out""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/icon_gallery_plate"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:spacing=""10dip""    android:background=""@drawable/browse_slider_bar""    android:unselectedAlpha=""0.5"" android:layout_alignBottom=""@+id/layoutZoom""     /&gt;</code></pre><p>Problem is as i defined nextFocusup zoom out when i press up key while on the gallery it don't focus to zoom out.</p>","216431","","","","","2012-05-31 13:09:38","Android gallery nextfocus not working","<android><focus><gallery>","2","0","0","",""
"3099344","1","12327010","","2010-06-23 06:23:48","17","14521","<p>In some web browsers, huge images are automatically resized to fit the screen.</p><p>Is it possible to do the same in an Android WebView?</p><p>The web page just contains the image, maybe adding some JavaScript could do the trick?<br>Anybody has already done this?</p><p>Note: I don't know the size of the image in advance.</p>","226958","","","","","2013-11-27 09:02:52","Can Android's WebView automatically resize huge images?","<android><image><resize><webview>","7","0","11","",""
"3099504","1","3099819","","2010-06-23 06:54:36","-1","486","<p>Can I modify the height of the status bar? If yes, how?</p>","233618","","321731","","2013-01-14 03:17:09","2013-01-14 03:17:09","How to modify the height of status bar?","<android><android-widget>","1","1","","",""
"3099512","1","3100613","","2010-06-23 06:55:56","0","188","<p>When running an application, when the home key is pressed the mobile home page comes to the front.How can i do the same on click of a button named exit ?</p>","344768","","","","","2010-06-23 09:59:51","Navigating to the home page","<android>","2","0","","",""
"3099533","1","","","2010-06-23 07:00:20","2","2148","<p>I want to make an Tab control on android.But the tab control is displayed on top, wherein i want it to be displayed the bottom line</p><p>Can anybody help with that</p>","373954","","114066","","2010-06-23 07:17:02","2010-06-23 07:19:35","Tabcontrol on android","<android>","1","0","2","",""
"3099655","1","","","2010-06-23 07:19:46","2","5500","<blockquote>  <p>adb install [-l] [-r] [-s]  - push this package file to the device and install it</p><pre><code>                   ('-l' means forward-lock the app)                   ('-r' means reinstall the app, keeping its data)                   ('-s' means install on SD card instead of internal storage)</code></pre></blockquote><p>how to use  the last option that is install apk on sdcard</p>","373897","","1137432","","2013-07-17 23:53:34","2014-04-19 12:52:04","install apk on sdcard","<android>","3","3","","",""
"3099778","1","3101324","","2010-06-23 07:38:16","1","513","<p>Ive set an in a running service a handler which does operation every X time.</p><p>Now after certain time i wanna start an activity from that service, and in onCreate of the activity i wanna access that handler of the service(which started the acitivty) and stop it's schedualed operation </p><pre><code> (mHandler.removeCallbacks(someTask)); </code></pre><p>any idea how will i access the handler which is in the service? </p><p>the service and the called activity are in the same proccess.</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-06-23 11:55:08","Access an handler in service from extern activity","<android>","1","1","1","",""
"3099789","1","3099919","","2010-06-23 07:40:31","0","400","<p>In my Android app I am calling a URL for fetching images and that URL is also fetched dynamically. Sometimes what happened is that the server returns the path of the image but actually there is no image so can we put some kind of validation.</p>","261566","","114066","","2010-06-23 08:03:53","2010-06-23 08:06:43","How to check whether the response returned from server is image or not in Android?","<android><image>","2","0","","",""
"3099877","1","","","2010-06-23 07:58:00","3","1029","<p>I'm trying to rotate an image at a fixed point, but the image is rotating at its top left position. I've tried rotateAnimation and it works fine, but the problem is when I rotate my image again it starts rotating from the original position.</p><pre><code>Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.arw2);int w = bmp.getWidth();int h = bmp.getHeight();float px = 160,py = 215;Matrix mtx = new Matrix();mtx.setRotate(rAngle, px, py);Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);BitmapDrawable bmd = new BitmapDrawable(rotatedBMP);myImageView.setImageDrawable(bmd);</code></pre><p>What am I doing wrong?</p>","351599","","1137432","","2013-07-17 23:51:03","2013-07-17 23:51:03","How can I make my image rotate about a fixed point when using bitmap?","<android>","1","2","1","",""
"3099955","1","3316651","","2010-06-23 08:13:14","0","3292","<p>I am trying to save the date of file parsing, so that when next time user, opens the application, the date can be checked against the last parsing date.</p><p>I am using shared preference to save the data and retrieve it, but getting error. here is the code :</p><pre><code>SharedPreferences settings =  getPreferences(0);String today = new Date(System.currentTimeMillis()).toString();SharedPreferences.Editor edit = settings.edit();System.out.println(""******** Today : "" + today);edit.putString(""lastdate"", today);String fetch = settings.getString(""lastdate"", ""0"");System.out.println(""******** Fetch : "" + fetch);txtTest.setText(fetch);</code></pre><p>but I am getting null pointer error. am I missing something?</p>","328518","","114066","","2010-06-23 09:22:41","2011-10-16 20:42:36","Getting java.lang.nullPointerException using SharedPreferences","<android><data><sharedpreferences>","2","3","1","",""
"3099997","1","","","2010-06-23 08:18:55","0","1467","<p>I am trying to publish my first Android application, and therefore need to sign the app with a keystore.</p><p>At first everything goes well.  I type the following into the command prompt:</p><pre><code>keytool –genkey –v –keystore testKeystore.keystore –alias testKeystore –keyalg RSA –validity 10000</code></pre><p>I answer the several questions that follow, but after the last question, I get the following error</p><p>keytool error: java.io.FileNotFoundException: testKeystore.keystore [Access is denied]</p><p>Maybe I am doing some silly mistake, but I have followed several guides on the internet on how to make a keystore, and I thought that was all there was to it?</p>","374010","","","","","2013-03-29 12:52:21","Having problems generating a keystore (Java)","<java><android><keystore><keytool>","2","1","1","",""
"3100142","1","","","2010-06-23 08:42:52","0","900","<p>I am trying to record a video into sdCard.But everytime I click on the Button to record, it shows ""stopped unexpectedly"" error.Not too sure where went wrong. I am not sure if setOutputFile's path is how I should indicate.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.camera);    cam = new cameraview(this);    ((FrameLayout) findViewById(R.id.preview)).addView(cam);    // Create A Preview View    buttonClick = (Button) findViewById(R.id.buttonClick);    buttonClick.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            if(toogleButtonFlag )            {                startRecording();                toogleButtonFlag = false;            }            else{                stopRecording();                toogleButtonFlag = true;            }        }    });}public void startRecording(){    recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);     recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);     recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);     recorder.setOutputFile(""/sdcard/.3pg"");     try{     recorder.prepare();     }     catch(IOException e)     {         e.printStackTrace();         recorder.reset();            recorder.release();     }     recorder.start();   // Recording is now started}public void stopRecording(){     recorder.stop();     recorder.reset();        recorder.release(); }</code></pre>","254504","","","","","2010-06-23 11:51:22","Android Records a Video into SDCard","<android><video><camera><video-capture>","1","0","1","",""
"3100225","1","3100376","","2010-06-23 08:55:20","3","3898","<p>I have a problem in querying phonebook contacts. What I need to do is get a list of contacts that have both phone and email entered or are of a specific type.</p><p>Basically like this:</p><pre><code>public static final String SELECTION =    ""(""+ContactsContract.Contacts.HAS_PHONE_NUMBER +""='1') OR "" + RawContacts.ACCOUNT_TYPE + ""='"" + Constants.ACCOUNT_TYPE + ""'"";</code></pre><p>Now, the problem is, that RawContacts.ACCOUNT_TYPE does not exist in the ContactsContract.Contacts.CONTENT_URI, which I use with my query. I'm guessing I'd need to join another table, but have no idea how to do so.</p><p>Can anyone help me here, please?</p>","297616","","","","","2010-06-23 10:42:14","Android contact query","<android><types><contacts><phone>","2","0","1","",""
"3100246","1","","","2010-06-23 08:58:22","2","2736","<p>i have a service from where i am trying to start a TextToSpeech engine ,but it seems that it's not working , so is it possible to start tts from a service?</p><p>here's what i've tried:</p><pre><code>package com.example.TextSpeaker;import java.util.Locale;import android.app.Service;import android.content.Intent;import android.os.IBinder; import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener;import android.util.Log;import android.widget.Toast; public class SpeakerService extends Service implements OnInitListener{   public static TextToSpeech mtts;  @Override   public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub  return null;  }@Override public void onCreate(){Log.d(""SpeakerService"",""Service created successfully!"");mtts = new TextToSpeech(this,this);mtts.setLanguage(Locale.ENGLISH);}@Overridepublic void onStart(Intent intent,int startid)  {Log.d(""SpeakerService"",""Service started successfully!""); Log.d(""SpeakerService"",""Service started successfully!"");  Log.d(""SpeakerService"",""tspker.mtts = "" + TextSpeaker.mtts.toString()); mtts = new TextToSpeech(this,this);   mtts.setLanguage(Locale.ENGLISH);   mtts.speak(Receiver.str, TextToSpeech.QUEUE_FLUSH,null);} @Override public void onDestroy(){ if(mtts!=null)  {     mtts.stop();  Toast.makeText(getApplicationContext(),""The service has been destroyed!"", T  oast.LENGTH_SHORT).show();}} @Override  public void onInit(int arg0) {   // TODO Auto-generated method stub }}</code></pre>","238505","","","","","2011-07-28 21:06:52","starting text to speech engine from a service?","<android>","1","0","2","",""
"3100506","1","3100670","","2010-06-23 09:43:26","1","2532","<p>I've I'm faced to a big issue : I can't add datas to an existing contact :(I'm developping an application wich manage contacts, I can add, delete or edit contacts.The creation is ok, because I create all types of datas (even if they are empty) for the contact (this is NOT a good way, I will change this later). So when I want to edit those datas I can find them to the data base (with Datas.CONTENT_URI) 'cause they allready exist !</p><p>But if I create a new contact with the ANDROID contact application only the fill fatas are created for a contact. When I try to add new phone number for example with my application I get a error :(</p><p>Here is my code to try to add phone number : </p><pre><code>ContentValues contentValues = new ContentValues();contentValues.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);contentValues.put(ContactsContract.CommonDataKinds.Phone.NUMBER, pNewPhoneNumber.number);contentValues.put(ContactsContract.CommonDataKinds.Phone.TYPE, pNewPhoneNumber.type);contentValues.put(ContactsContract.Data.CONTACT_ID, pContact.getContactId());ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();ops.add(ContentProviderOperation.newInsert(  ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());try{ pContext.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);} catch (Exception e){        Context ctx = pContext.getApplicationContext();        String txt = ""Exception encoutered while inserting contact: "" + e;        int duration = Toast.LENGTH_SHORT;        Toast toast = Toast.makeText(ctx, txt, duration);        toast.show(); Log.e(TAG, txt);}</code></pre><p>Here is the error : </p><pre><code>06-23 09:21:54.030: ERROR/DatabaseUtils(111): Writing exception to parcel06-23 09:21:54.030: ERROR/DatabaseUtils(111): java.lang.NullPointerException06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.ContactsProvider2.insertData(ContactsProvider2.java:2206)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.ContactsProvider2.insertInTransaction(ContactsProvider2.java:2096)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.SQLiteContentProvider.insert(SQLiteContentProvider.java:101)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.ContactsProvider2.insert(ContactsProvider2.java:1941)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at android.content.ContentProviderOperation.apply(ContentProviderOperation.java:211)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.SQLiteContentProvider.applyBatch(SQLiteContentProvider.java:200)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at com.android.providers.contacts.ContactsProvider2.applyBatch(ContactsProvider2.java:1960)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:169)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:167)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at android.os.Binder.execTransact(Binder.java:287)06-23 09:21:54.030: ERROR/DatabaseUtils(111):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>So I have a database problem, OK. But where am I wrong ?</p><p>If you know how to solve this problem : let me know :)Thank you</p>","374077","","","","","2012-01-25 11:30:24","Add datas (phone number, notes etc...) to an existing contact (ANDROID 2.1)","<android>","2","0","2","",""
"3100526","1","13033067","","2010-06-23 09:46:36","6","5907","<p>it may seem simple but it posses lots of bugs I tried this way: </p><pre><code> String s = gameList[0].toString();s.replaceFirst(String.valueOf(s.charAt(0)),String.valueOf(Character.toUpperCase(s.charAt(0))) );</code></pre><p>and it throws an exception </p><p>another try i had was :</p><pre><code>String s = gameList[0].toString();char c = Character.toUpperCase(gameList[0].charAt(0));gameList[0] = s.subSequence(1, s.length());</code></pre><p>rhis one also throws an Exception</p>","368440","","57611","","2010-09-10 17:14:21","2013-05-31 18:52:33","changing CharSequence first letter to upper case in android","<java><android><string><uppercase>","4","1","","",""
"3100556","1","3204010","","2010-06-23 09:51:06","1","1323","<p>i have problems simulating call or sms since telnet or ddms perspective on eclipse.I'm connected to the device and some commands works (window scale,...)If i try to simulate a gsm call then everything seems ok but i haven't anything on my emulator (nor incoming call nor notification)then if i launch an ""gsm list"" command my inbound call is listed and i can cancel it</p><p>the same thing occurs with sms send everything seems ok (return OK) but there is no notification on the emulator nor sms in inbox :-(</p><p>i'm using the sdk r06 on a windows xp machine. I try with fresh avd on different platform :-(</p><p>Important : it has worked so i know it can work, but i would like to know why it doesn't work now ! Using ddms i don't see any trace on the log view.</p><p>thanks for your help</p>","374089","","","","","2010-07-08 13:22:16","gsm call / sms send doesn't work from emulator/ddms perspective","<android><android-emulator>","1","2","","",""
"3100576","1","3845372","","2010-06-23 09:53:38","2","303","<p>In my application i want soft keyboard when emulator is in landscape mode only.if mobile is in portrait mode i want to use keyboard which was designed by me, give me some suggestions for this.Thanks in advance</p>","254790","","","","","2010-10-02 11:02:08","I want soft key board when mobile is in landscape","<android>","1","0","1","",""
"3100592","1","","","2010-06-23 09:56:56","4","4776","<ol><li><p>Can anyone share some details of devloping new SDK add-on like the one Google map API? I do not find any detials on how to build new sdk add-on?</p></li><li><p>Is that good approach to have sdk add-on for connecting to twitter, facebook, youtube applications? I mean the library would contain the methods to access the developer APIs supported by the social networking apps. I am looking out some ideas for developing new sdk add-on</p></li><li><p>Lets assume I have added new service API in the android core framework. Now can I build an SDK add-on in order to access that service?. (This add-on library would have simpler API calls that would in turn avail the service farm android core service)</p></li></ol>","374097","","","","","2010-06-23 11:44:11","Android SDK add-on","<android><sdk><add-on>","1","0","5","",""
"3100595","1","3106320","","2010-06-23 09:57:29","3","1331","<p>i am using android gallery is there any listener or way i can know which get fired when user start motion, stop motion, slowing down or moving ?</p><p>i see you can overide the following method</p><pre><code>@Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        return super.onFling(e1, e2, velocityX, velocityY);    }</code></pre><p>but how do i know if scrolling is going to stop or started ?</p>","216431","","216431","","2010-06-23 11:48:59","2010-06-23 23:35:56","android image gallery start moving or slowing down and stopped moving","<android><gallery>","1","0","","",""
"3100599","1","3100697","","2010-06-23 09:57:52","1","540","<p>I'm wondering..</p><p>1)is it possible to set an imageview's resource to the URL location of an image?</p><p>2)is there a way of setting the x,y co-ords of where on the screen to draw the imageview?</p><p>3)How would I run a check to see if the space is taken up by another Imageview (must specifically be an imageview)</p><p>4) How would I make the Imageview ""clickable"" e.g if the user clicks the image it'll do something?</p><p>5) How would I dynamically create imageviews? E.g if a condition is true make another imageview</p><p>Perhaps I'm going about this wrong so I'll explain better what I'm looking to do.. basically I want to draw images on the screen which are located at URL's. I want to display N amount of images (There will be conditions which will decide how many images I'm displaying, so it'll have to be dynamically created) each image should take up approx 50x50 screen space. There will be other conditions to where the image should be displayed.. If an image exists at a certain co-ord it shouldn't draw over it, when the user clicks the image something else should happen.</p><p>Hopefully this makes things clearer.</p><p>Thanks.</p>","358438","","358438","","2010-06-23 10:34:33","2010-06-23 10:34:33","Android, Imageview, a few questions","<java><android><imageview>","1","1","1","",""
"3100706","1","","","2010-06-23 10:13:36","7","3769","<p>What audio formats can be played using the html5 'audio' tag in the android browser? Does anyone know where to find official specs on what the android browser supports and not?</p><p>For the record, the <a href=""http://developer.android.com/guide/appendix/media-formats.html"">android media formats page</a> does not seem to cover this - I have soundfiles (3gp) playing fine in a native app, but they won't play in my webapp.</p><p>The webkit docs also do not seem to help. My soundfiles play fine in my webapp on iphone, so that version of webkit handles them fine. Shouldn't the android browser have some official documentation somewhere?</p>","344871","","344871","","2010-06-23 10:41:22","2011-08-19 05:23:22","what audio formats are supported by the android browser?","<android><browser><audio><html5><webkit>","2","0","2","",""
"3100726","1","3100778","","2010-06-23 10:16:54","3","4806","<p>I'm sharing some variables accross activities by using a class like this :</p><pre><code>public class Globals {static Boolean hint1_graph_type_switcher; static Boolean hint2_stockview_valuation;other variables ...    }</code></pre><p>then I'm using these variables anywhere across my multiple activites with ...</p><pre><code>if (Globals.hint2_stockview_valuation == false) {        ....    }</code></pre><p>pretty basic and it was working fine untill ...</p><p>I introduced some webview stuff like this:</p><pre><code>//-----------------------------------------------------------        // open a webview with the NEWS when the more_arrow is clicked :        mNews.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                String news_URL = ""http://us.m.yahoo.com/w/yfinance/symbolheadlines/""+ ticker + ""/?.intl=us&amp;.lang=en"";                Intent news_Webview_intent = new Intent(Chart_View.this, News_Webview.class);                news_Webview_intent.putExtra(""NEWS_URL"", news_URL);                startActivity(news_Webview_intent);            }        });        //-----------------------------------------------------------</code></pre><p>and here's the News_Webview.class:</p><pre><code>public class News_Webview extends Activity {//// http://www.chrisdanielson.com/tag/progressdialog///String news_URL;private WebView webview;private ProgressDialog progressBar;private static final String TAG = ""Hub"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.webview_news);    this.webview = (WebView)findViewById(R.id.webView);    Bundle extras = getIntent().getExtras();    if (this.getIntent().getExtras()!=null){        news_URL = extras.getString(""NEWS_URL"");    }    WebSettings settings = webview.getSettings();    settings.setJavaScriptEnabled(true);    webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);    final AlertDialog alertDialog = new AlertDialog.Builder(this).create();    progressBar = ProgressDialog.show(News_Webview.this, """", ""Loading..."");    webview.setWebViewClient(new WebViewClient() {        public boolean shouldOverrideUrlLoading(WebView view, String url) {            //Log.i(TAG, ""Processing webview url click..."");            Intent viewIntent = new Intent(""android.intent.action.VIEW"", Uri.parse(url));              startActivity(viewIntent);            return true;        }                          public void onPageFinished(WebView view, String url) {            //Log.i(TAG, ""Finished loading URL: "" +url);            if (progressBar.isShowing()) {                progressBar.dismiss();            }        }        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {            Log.e(TAG, ""Error: "" + description);            Toast.makeText(News_Webview.this, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();            alertDialog.setTitle(""Error"");            alertDialog.setMessage(description);            alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                    return;                }            });            alertDialog.show();        }    });    webview.loadUrl(news_URL);    }}</code></pre><p>the problem now is that, when it ""comes back"" from this Activity, it looks like my Globals variables have disappeared ???</p><pre><code>if (Globals.hint2_stockview_valuation == false) {</code></pre><p>fires an error :</p><blockquote>  <p>06-23 12:14:03.443:  ERROR/AndroidRuntime(2611): Caused by:  java.lang.NullPointerException</p></blockquote><p>2 questions then : </p><ul><li><p>Should I use something else than this ""Global"" class to share variables across activities ? Is it just bad practice to do this ?? I know that I can use the preferences but I thought it was quicker to do it this way (no need to ""read"" the preferences everytime I start a new activity ...</p></li><li><p>Any idea on WHY this is happening ? Should I ""get back"" my savedInstanceState in some way when my activity returns from the News_Webview.class ???</p></li></ul><p>As always, thank you for your help.</p><p>H.</p>","116573","","","","","2010-06-23 10:41:52","sharing ""Global"" variables across activities, problem when using a Webview...?","<android><global-variables><webview>","2","0","1","",""
"3100826","1","","","2010-06-23 10:31:27","1","999","<p>i have to access the email database schema like ""mms-sms.db"" can we able to access the database i am unable to find the database can anyone tell the exact <strong>URI</strong> of Default <strong>Email</strong> Program <strong>Database</strong></p><p>Waiting for your <strong>Authentic</strong> answer is Required.</p><p>Thanks in Advance</p>","321373","","","","","2011-03-08 08:41:35","Email database URI","<android><email>","2","0","","",""
"3100850","1","3100907","","2010-06-23 10:35:44","1","236","<p>I am a Java beginner , I want to develop Android app , what all is essential to learn in Java before I start developing ?</p>","224859","","","","","2010-06-23 10:45:49","Android App Development","<java><android>","2","0","1","2012-08-10 14:28:07",""
"3100881","1","","","2010-06-23 10:39:58","8","4151","<p>My android application has two kinds of preferences:</p><p>1) I have <strong>user preferences</strong> defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity.</p><p>2) I'd like to define another file for global <strong>configuration preferences</strong> of my app.</p><p>What is the best way to manage my app config preferences? Should I create another XML file with config values or should I specify those config values in strings.xml? What is the best practice for managing config preferences?</p>","332563","","","","","2010-09-09 11:12:29","User preferences file vs App preferences file","<xml><android><preferences><shared><sharedpreferences>","3","0","4","",""
"3100965","1","","","2010-06-23 10:55:51","3","654","<p>Can we view the database of Emails on Device through DDMS ? How ever i can see and access the database of SMS on Emulator through DDMS.</p><p>Thanks in Advance.</p>","321373","","","","","2010-06-23 11:15:03","DDMS not display program data on Device!","<android><email>","2","0","","",""
"3101059","1","","","2010-06-23 11:13:38","23","1206","<p>I am using <code>Ksoap2-Android</code> for consuming the <code>WCF</code> Services.</p><p>For the <em>dotnet client</em> we keep the <code>allowCookies=""true""</code> in our binding configuration and it sends the same sessionid and keeps my sessions intact in my WCF services (<em>My services areinterdependent and use the sessions</em>).</p><p>Any one know any such setting for <code>ksoap2-android</code>, that will allow me to consume the WCF service keeping my session intact on the server.</p><p>Currently when i make a new call to the service, the <code>sessionid</code> gets changed and all mysession variables clear out and loose their values.</p>","360508","","903469","","2012-05-03 13:18:13","2012-05-06 06:00:13","How to consume Session dependent WCF services using Ksoap2-Android","<android><wcf><session><ksoap2>","1","0","1","",""
"3101258","1","","","2010-06-23 11:45:15","0","956","<p>I have made db using java this way :</p><pre><code>public static void main(String[] args) throws Exception {      String CITIES[] = city.split("","");      Class.forName(""org.sqlite.JDBC"");        Connection conn = DriverManager.getConnection(""jdbc:sqlite:test.db"");       String V[][] = {COUNTRIES,CITIES,occupations};        String []TypeNames = {""country"",""city"",""occupation""};        Statement stat = conn.createStatement();    stat.executeUpdate(""drop table if exists ""+TABLE_NAME+"";"");    //stat.executeUpdate(""create table ""+TABLE_NAME+"" (name, occupation);"");    stat.executeUpdate(""create table ""+TABLE_NAME+"" (""+VALUE+"",""+TYPE+"",""+LETTER+"");"");    PreparedStatement prep = conn.prepareStatement(      ""insert into ""+TABLE_NAME+"" values (?, ?,?);"");    //private void insertToTalble();    for(int j = 0 ;j &lt; V.length; j++)        for (int i = 0 ;i &lt; V[j].length ; i++)        {        Character c = V[j][i].charAt(0);        prep.setString(1, V[j][i]+""\n"");        prep.setString(2, TypeNames[j]);        prep.setString(3, c.toString());        prep.addBatch();        }    conn.setAutoCommit(false);    prep.executeBatch();    conn.setAutoCommit(true);    rs.close();    conn.close();  }}</code></pre><p>when i open it using sqllight data browser it works fine but after adding it to new diractory in my android project called databases/test1.db </p><p>I am having problems using it </p><p>my android class whom works with the data base is :</p><pre><code>     private static final String DB_PATH = ""/data/data/com.countryCityGame/databases/test.db"";    private static final String DATABASE_NAME = ""test1.db"";    private static final int DATABASE_VERSION = 1;    private static final String TABLE_NAME = ""GameTable"";    private static final String VALUE = ""value"";    private static final String TYPE = ""type"";    private static final String LETTER = ""letter"";    public countryCityGameLogic(EditText[] myEditTextArr , Context context){        this.context = context;        openHelper = new OpenHelper(context);        gameList = new CharSequence [myEditTextArr.length];        for (int i = 0 ; i &lt; myEditTextArr.length; i++){            gameList[i] = myEditTextArr[i].getText();        }        this.db = openHelper.getWritableDatabase();        try{            String myPath = DB_PATH ;            SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }catch(SQLiteException e){            //database does't exist yet.            //insertValus(COUNTRIES,0);        }        //insertValus(COUNTRIES,0);    }    public void setGameVar(EditText[] myEditTextArr) {        for (int i = 0 ; i &lt; myEditTextArr.length ;i++)        gameList[i] = myEditTextArr[i].getText();    }    private void insertValus(String []typeInserted , int num) {        ContentValues initialValues = new ContentValues();          for (int i = 0 ; i &lt; typeInserted.length ; i++){              Character tmp = (Character)typeInserted[i].charAt(0);              initialValues.put(VALUE, typeInserted[i]);              initialValues.put(TYPE, TYPESNAMES[num]);              initialValues.put(LETTER,tmp.toString(tmp));          db.insert(TABLE_NAME, null, initialValues);          }    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, DATABASE_NAME, null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {             db.execSQL(""CREATE TABLE IF NOT EXISTS "" + TABLE_NAME + "" ( ""+ VALUE +"" TEXT,""+ TYPE +"" TEXT, ""+ LETTER + "" TEXT)"");          }          @Override          public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {             db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);             onCreate(db);          }       }    public boolean existInDataBase() {        boolean returnval = true;        String s = asUpperCaseFirstChar(gameList[0].toString());        Cursor cursor = db.query(TABLE_NAME, new String[] {VALUE}        ,VALUE+"" like "" + ""'%"" + s +""%'"", null, null, null, null);        if ( cursor.moveToFirst() == false)            returnval = false;        return returnval;    }</code></pre><p>i am not getting any information in the cursor in existInDataBase() function to be more specific I'm  always getting false for cursor.moveToFirst() even when my query is just to select without any thing</p><p>can someone please :1.tell me what he thinks is wrong 2.how can i debug and see what there is in the db (i debug but i cant see anything odd should i had a if saying ""you have no data base"")</p><p>note "" when i builded the app the first time the app was the the one who build the db as you can see in</p><pre><code> private void insertValus(String []typeInserted , int num);</code></pre><p>my problem seems to be the manifest file:</p><p>when one takes a db file and import it to his android project what should he do ?please explain in steps what should i do thanks yoav.</p>","368440","","301832","","2010-07-21 09:54:00","2013-06-17 06:55:22","failing to connect to database (SQLite on android)","<java><android><sqlite>","2","0","1","",""
"3101359","1","3994660","","2010-06-23 12:00:46","4","9397","<p>is there any way to add, delete and update Calendar.and is there any way to add, delete and update Events in Calendar.</p><p>Thanks.</p>","309990","","","","","2011-03-08 07:09:27","how to insert, update and delete Calendar and events","<android><calendar>","4","1","2","",""
"3101538","1","3102524","","2010-06-23 12:26:25","0","1385","<p>I have several files stored in my project /res/values folder, is there any way to open and read these files from my android application? Each file contains text informations about one level of my game.I really appreciate any help. </p>","248190","","","","","2010-06-23 14:30:27","Is there any way to acces file stored in project folder?","<android><file>","2","0","","",""
"3101576","1","","","2010-06-23 12:31:22","3","10463","<p>My objective is to read and write Calendar.</p><p>i am able to read data from the content://calendar/calendars and content://calendar/events</p><pre><code>String uriString = ""content://calendar/calendars"";  Log.i(""INFO"", ""Reading content from "" + uriString);  readContent(uriString);  uriString = ""content://calendar/events"";  Log.i(""INFO"", ""Reading content from "" + uriString);  readContent(uriString);private void readContent(String uriString) {  Uri uri = Uri.parse(uriString);  Cursor cursor = mContext.getContentResolver().query(uri, null, null,    null, null);  if (cursor != null &amp;&amp; cursor.getCount() &gt; 0) {   cursor.moveToFirst();   String columnNames[] = cursor.getColumnNames();   String value = """";   String colNamesString = """";   do {    value = """";    for (String colName : columnNames) {     value += colName + "" = "";     value += cursor.getString(cursor.getColumnIndex(colName))       + "" ||"";    }    Log.e(""INFO : "", value);   } while (cursor.moveToNext());  } }</code></pre><p>i am also inserting new record in the calendar like :</p><pre><code>String calUriString = ""content://calendar/calendars"";   ContentValues values = new ContentValues();   values.put(""name"", ""Code Generate Calendar"");   values.put(""displayName"", ""Code Generate Calendar"");   values.put(""hidden"", 0);   values.put(""color"", ""-7581685"");   values.put(""access_level"", ""700"");   values.put(""selected"", ""1"");   values.put(""timezone"", ""Asia/Karachi"");   Uri calendarUri = context.getContentResolver().insert(   Uri.parse(calUriString), values);</code></pre><p>but it is not appearing in the Calendar.</p><p>when i going to insert new events in Calendar like :</p><pre><code>   ContentValues values = new ContentValues();   values.put(""calendar_id"", 4);   values.put(""dtend"", ""1277337600000"");   values.put(""dtstart"", ""1277251200000"");   // values.put(""title"", ""first TEst event"");   values.put(""transparency"", 1);   values.put(""selected"", 1);   values.put(""color"", ""-16380578"");   // values.put(""lastDate"", ""6/25/2010"");   //values.put(""access_level"", 700);   values.put(""eventStatus"", 1);   values.put(""eventTimezone"", ""UTC"");   values.put(""timezone"", ""Asia/Karachi"");   values.put(""allDay"", 1);   String eventUriString = ""content://calendar/events"";   Uri eventUri = context.getContentResolver().insert(   Uri.parse(eventUriString), values);</code></pre><p>throwing exception that column is invalid.</p><p>how this possible. Thanks</p>","309990","","1448201","","2013-05-03 06:29:52","2013-05-03 06:29:52","Read and write Calendar","<android><calendar>","2","1","2","",""
"3102006","1","","","2010-06-23 13:25:53","0","232","<p>I have a UI with buttons. This thread takes input from the user and does a particular task. Now, I want the background of one button(generated randomly) to change periodically(say, every 30s), but i want the main thread to continue taking input. I m not able to interleave the threads in exactly this way. Any help would be appreciated. Thanks in advance.</p>","374269","","","","","2012-02-23 13:38:32","Android-two threads changing the ui","<android>","1","0","1","",""
"3102048","1","","","2010-06-23 13:31:09","3","10044","<p>I use the following code to receive the data from a particular port. It's not working in Android. But sending data to particular port is working fine.</p><pre><code>public class UDPDemo extends Activity {  private TextView tv;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv = (TextView)findViewById(R.id.recv_message);    try {      DatagramSocket clientsocket=new DatagramSocket(9876);      byte[] receivedata = new byte[1024];      while(true)      {        DatagramPacket recv_packet = new DatagramPacket(receivedata, receivedata.length);        Log.d(""UDP"", ""S: Receiving..."");        clientsocket.receive(recv_packet);        String rec_str = new String(recv_packet.getData());        tv.setText(rec_str);        Log.d("" Received String "",rec_str);        InetAddress ipaddress = recv_packet.getAddress();        int port = recv_packet.getPort();        Log.d(""IPAddress : "",ipaddress.toString());        Log.d("" Port : "",Integer.toString(port));      }    } catch (Exception e) {      Log.e(""UDP"", ""S: Error"", e);    }  }}</code></pre>","373172","","63550","","2010-09-24 13:53:58","2012-05-28 07:42:10","How to receive data using UDP in Android?","<android>","1","2","1","",""
"3102089","1","3819758","","2010-06-23 13:35:36","1","3547","<p>The problem:</p><p>I want to use a WebView to enable dynamic loading of ads in my app. I'm currently running on a HDPI device, and images width a width of 480px are clipped/scrolled. If I use images with a size of 320px, they are zoomed in and rendered at too low a resolution.</p><p>The content of the loaded WebView url is a simple web page with just an image tag wrapped in a link, as well a simple head. I've tried playing with the viewport meta-tag, but without any luck.</p><p>Any suggestions?</p>","184844","","","","","2014-02-27 20:45:28","How to render a full resolution image with WebView in Android?","<android><image><webview><resolution>","4","0","2","",""
"3102203","1","3102253","","2010-06-23 13:49:23","10","2647","<p>I would like to know, once for all..  ive read in many places.. when i wanna do some 'long time operations' i should use a Handler.</p><p>But i dont get why? all my 'long-time-operations' i surround with a regular threads, and it works fine. </p><p>why would I use handler for this?</p><p>the only time i had to use Handler was, when I had to scheduale some task(postDelayed)</p><p>Is there any main idea i miss about handlers(When i should realy use it)? or mybe there isnt realy diffrence?</p><p>realy thanks,</p><p>ray.</p>","260511","","","","","2011-11-17 07:05:44","Handler vs Thread","<android>","2","0","3","",""
"3102251","1","3102377","","2010-06-23 13:56:06","0","2012","<p>I am making an sqlight using eclipse outside the android project</p><p>what should I add into my android manifest in order to make it work?  </p><p>thank you Mathias, lets take this q to another project who generate a SQL file using java assuming this. How can I set the <em><code>SQLiteDatabase.NO_LOCALIZED_COLLATORS</code></em> flag when calling <em><code>SQLiteDatabase.openDatabase()</code></em>?</p><p>my code over there is </p><pre><code>Class.forName(""org.sqlite.JDBC"");            Connection conn = DriverManager.getConnection(""jdbc:sqlite:test.db"");/**some code */   Statement stat = conn.createStatement();    stat.executeUpdate(""drop table if exists ""+TABLE_NAME+"";"");    //stat.executeUpdate(""create table ""+TABLE_NAME+"" (name, occupation);"");    stat.executeUpdate(""create table ""+TABLE_NAME+"" (""+VALUE+"",""+TYPE+"",""+LETTER+"");"");    PreparedStatement prep = conn.prepareStatement(      ""insert into ""+TABLE_NAME+"" values (?, ?,?);"");</code></pre><hr><p>Even when I use:        </p><pre><code>  db = SQLiteDatabase.openDatabase(myPath, null,  SQLiteDatabase.NO_LOCALIZED_COLLATORS);</code></pre><p>when I use the query :</p><pre><code>     String s = ""Israel"";Cursor cursor = db.query(TABLE_NAME, new String[] {VALUE}        ,VALUE + "" like "" + ""'%"" + s +""%'"", null, null, null, null);</code></pre><p>I get an exception .    </p>","368440","","967548","","2012-09-05 09:45:28","2012-09-05 09:45:28","How to import sqlite file into my project?","<android><eclipse><sqlite>","1","2","","",""
"3102443","1","3102523","","2010-06-23 14:18:53","16","19838","<p>Can I run an Android app through the emulator and make it print strings to my computer's console? By console I mean the standard place you would expect to see a System.out.println() in a normal java application. So if you ran the java application from the command prompt then you will see the println()s in the command prompt or if you ran the program in eclipse you will see it in the Console tab at the bottom.</p>","340","","","","","2010-06-23 14:45:16","Is there a way to print to the console in an Android app?","<android><println>","2","3","4","",""
"3103024","1","","","2010-06-23 15:20:39","2","3179","<p>maybe somebody can help me out. i'm trying to add a google maps within my android app. if i want to run my app in emulator, i get the error: ""Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY"". of course i read about what my problem, the reason seems to be that the target device doesn't have the needed libs, but i'm not able to solve my problem :-(</p><p>in my manifest i've set the permissions:</p><p><strong>uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""<br>uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""uses-permission android:name=""android.permission.INTERNET""</strong> </p><p>Additionally i defined the maps lib under my application-tag:</p><p><strong>uses-library android:name=""com.google.android.maps""</strong></p><p>Furthermore i obtained an api maps key for my certificate md5-key and use this in my layout:</p><p></p><pre><code>&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=""07ldFF5M8bvwFSB2DeeUIIvOhyKLNpWkFlTbS6w""/&gt;</code></pre><p></p><p>i don't think that my problem is within my app, could it bee an ""target-problem""?i try to compile vs. Android 2.2i also tried to create a new AVD with Target ""Google APIs (Google Inc)"", but i cannot run my app with this AVD, don't ask me why :-((</p><p>i hope anybody can tell me how to solve this problem, thx in advanceif you want to have a look at my source, you can get it here: </p><p><a href=""http://www.marcusegger.de/examples/QuickPortfolio.zip"" rel=""nofollow"">http://www.marcusegger.de/examples/QuickPortfolio.zip</a></p><p>cheers, michbeck</p>","301496","","","","","2011-11-12 15:56:25","INSTALL_FAILED_MISSING_SHARED_LIBRARY error in Android 2.2 API Level 8","<android><android-emulator>","2","1","","",""
"3103038","1","4959972","","2010-06-23 15:22:58","12","6610","<p>I am reading about setDrawingCacheEnabled and getDrawingCache and I was wondering when is it good to use it or when its not good.</p><p>Basically in my case I have an horizontalScrollView with many things inside it so its scrolls left/right and most of the things are not visible.</p><p>If I use setDrawingCacheEnabled(true) on the views, does it help?  or this is only when I use custom views and I call getDrawingCache()?</p><p>Is there any other 'cache' way to use in a horizontalscrollview?</p><p>Thanks</p>","237115","","","","","2011-02-10 16:41:13","Android - drawing cache - when is it useful?","<android><caching>","2","0","3","",""
"3103062","1","","","2010-06-23 15:26:55","4","9287","<p>I'm trying to create multiple tabs, each with a different Activity. The only downside is i'm using a custom layout file thus my class extends an Activity rather than a TabActivity. While trying to run, it fails and suggests calling TabHost.Setup(ActivityGroupManager agm)</p><p>Anyone have an idea/practical example of how this can be achieved?</p><p>Thanks in advance</p>","357442","","","","","2010-06-24 07:39:41","Android TabHost - Activities within each tab","<android><activity><android-tabhost>","3","2","7","",""
"3103132","1","8678834","","2010-06-23 15:36:00","22","11041","<p>Does anyone know of any documentation on the android:scrollbarStyle?  I'd like to see examples of each of the 4 values w/ screenshots if possible.  I see the difference between outside &amp; inside types, but what are the Inset &amp; Outset parts all about?  I dont seem to see a difference between insideOutset &amp; insideInset for example, likewise, I don't see a difference between outsideOutset &amp; outsideOutset.</p><p>thanks in advance!Ben</p>","372405","","","","","2013-01-24 04:55:23","android ListView scrollbarStyle","<android><listview><scrollbars>","2","0","6","",""
"3103138","1","3103733","","2010-06-23 15:36:54","6","2439","<p>Considering writing a wifi cracking (<a href=""http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy#Encryption_details"" rel=""nofollow"">wep</a>, <a href=""http://www.informit.com/articles/article.aspx?p=369221"" rel=""nofollow"">wpa</a>) auditing tool for the android platform, but I am wondering if it is possible to do without a rooted phone. I had thought it would be impossible to run on an <em>unrooted</em> phone due to the phones wifi chip ignoring packets not addressed to the phone. That is, without the ability to set the wifi chip to <a href=""http://en.wikipedia.org/wiki/Monitor_mode"" rel=""nofollow"">monitor mode</a> many of these attacks wont work.</p><p>I was surprised to learn that android supports <a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html"" rel=""nofollow"">multicast packets</a>. That is, android phones can be set to receive packets not addressed to them.</p><p>My questions are:</p><ul><li><p>Does having a multicast lock mean I can receive all packets broadcast, or does it only apply to packets with a multicast flag (if such a thing exists)?</p></li><li><p>Is there a difference between monitor mode and multicast?</p></li><li><p>Does the android api have a system for switching channels?</p></li></ul><p>More generally I'm curious:</p><ul><li><p>Is anyone familar with other wifi cracking projects running on android (google searches turned up very little)?</p></li><li><p>What difficulties am I likely to run into?</p></li></ul><p>This question is related to SO question <a href=""http://stackoverflow.com/questions/2334244/is-there-anyway-to-put-android-wifi-droid-handset-into-permiscuous-monitoring-m"">Is there anyway to put Android WIFI (droid handset) into permiscuous monitoring mode</a>?</p>","74359","","","","","2011-04-23 16:43:14","Is it possible to write a wifi cracking util for Android phones? Monitor mode vs Multicast?","<android><security><encryption><wifi><android-wifi>","1","0","1","",""
"3103196","1","8056925","","2010-06-23 15:44:19","10","14944","<p>can some owners of Android devices please come forward and publish the data that their phones provide as:</p><ul><li>os.android.Build.BOARD</li><li>os.android.Build.BRAND</li><li>os.android.Build.DEVICE</li><li>os.android.Build.DISPLAY</li><li>os.android.Build.MODEL</li><li>os.android.Build.PRODUCT</li></ul><p>I'm wondering what's the best identifying combination, looking for stats. Thanks in advance.</p>","219159","","","","","2013-07-26 20:30:19","Android.os.Build data examples, please","<android>","3","3","3","2011-11-16 18:13:09",""
"3103384","1","3103680","","2010-06-23 16:08:51","0","5192","<p>How would I draw an image on  canvas and position it based on x/Y co-ords? Also, is it possible to check if an image is drawn at those co-ords?</p><p>Thanks,</p>","358438","","","","","2010-06-23 16:44:45","Android, Canvas, draw image","<java><android>","1","0","","",""
"3103736","1","3103821","","2010-06-23 16:53:00","4","10296","<p>I've been modifying/editing parts of the Android platform, but have run into a problem when trying to test my edits.  After making my changes to the platform source, I was able to successfully compile the source - thus creating system.img, ramdisk.img, and userdata.img.  </p><p>When I go to test this in the emulator, the emulator just hangs on the ""ANDROID_"" screen, with the underscore blinking, but never seems to load.  Any suggestions?</p><p>The command I used to run the emulator is as follows:</p><p><code>./emulator -system $HOME/android/platform/out/target/product/generic/system.img -ramdisk $HOME/android/platform/out/target/product/generic/ramdisk.img -data $HOME/android/platform/out/target/product/generic/userdata.img</code></p><p>Thanks,<br/>Chris</p>","175280","","","","","2013-11-09 04:30:15","Android emulator hanging on startup?","<android><testing><android-emulator>","4","0","1","",""
"3104012","1","3118712","","2010-06-23 17:30:03","2","1275","<p>I've got a canvas drawn (I have to keep the canvas, it's doing other things). I'm drawing N amount of images in this canvas, I'm wondering how would I make them clickable? also does anyone know how I could test if a bitmap is in a certain co-ord? Alternatively how would I create a button which was an image on a canvas? or even, How would I create a Transparent RelativeLayout on top of a Surfaceview?</p><p>edit.. anyone?? I'm thinking Relative Layout on top of Surfaceview would be the best way to go!</p><p>edit2: Setting things to transparent seems to just set the background to black and not actually let me see the Surfaceview I have defined under it.</p><p>Thanks,</p>","358438","","358438","","2010-06-24 13:10:41","2010-06-25 14:17:21","Transparent RelativeLayout which sits ""on top"" of a surfaceview?","<android>","1","0","1","",""
"3104037","1","3104102","","2010-06-23 17:31:50","6","2034","<p>Is there any reason to forward lock a free app?  If the user copies the app from the phone, is it protected in any way from decompilation, etc?</p>","238849","","","","","2010-06-23 17:49:38","Any reason at all to forward lock a free app?","<android>","5","0","","",""
"3104146","1","","","2010-06-23 17:45:46","0","127","<p>I'm making an application in android that has a table; which seemed to be a good idea at first but I've now ran into a couple of problems.</p><p>I want all columns to be of equal width dispite how much content I have put in it (text view).  I thought stretch /shrink column may have handled that issue but it doesnt; I guess I missread something.  Is there any way to clip the text to stop it from making all the columns all different sizes?</p><p>I know I can clip the text myself to something i know will fit, but it would be nice if I could throw any length of type in there and know it's only going to take up 1/7th of the width.</p><p>My other issue is that I want my height to be equal to my width (so i get a square), but the width changes to the orientation of my view (landscape /portait) and is obviously dependant on the actual screen size too.</p><p>I've done everything in xml so far.</p><p>any help much appreciated</p>","374500","","","","","2010-06-23 18:10:47","Android layout using tables","<android>","1","0","","",""
"3104163","1","","","2010-06-23 17:47:46","2","823","<p>I have developed a simple android application, which when started opens a Timer. User is given two buttons, start/ pause. This is working fine.What I want to do is to add a way to support multiple timers when a user swipes his finger on the screen.When he swipes from left to right, a new timer should show up, but the previous timer should not stop. This is a way to add multiple timers.Also, when he swipes from right to left, I want a previous timer to show.</p><p>This is what I have done so for. I have a timer activity. I have added a touch event on it. When, a person swipes his finger, I get the co-ordinates and decide whether its from left to right or right to left. This functionality is working fine, as I can see the appropriate log messages.</p><p>The problem is when I'm trying to load Timer Activity. It just loads the previous Activity and doesn't really create a new one (I figured this from the timer). Is there any way to do it?</p>","374499","","759866","","2014-02-24 00:57:41","2014-02-24 00:57:41","Android: Running multiple activities","<java><android>","1","2","","",""
"3104316","1","3104422","","2010-06-23 18:10:57","1","961","<p>I am trying to understand the difference between phones, and the software on them. I code and test on the Droid Incredible. A content observer of <code>content://sms</code> works fine and I am able to delete threadIds on the Incredible, but my app crashes on the Moto Droid Milestone. I test for the Milestone using Moto Dev Studio using the Milestone emulator package. It works fine in the emulator, but not on the actual device.</p><p>Why would content://sms work fine on the Incredible, but not on the Milestone? Why would it on work on the Milestone emulator and not on the Milestone Device?</p><p>Such a delete method is shown below with the uri being <code>content://sms + threadId</code></p><pre><code>getContentResolver().delete(deleteUri, ""address=? and date=?"", new String[] {msg.getOriginatingAddress(), String.valueOf(msg.getTimestampMillis())});</code></pre><p>Many people say such a content observer is not part of the SDK. Understood. How can I delete an sms for legitimate reasons such as creating an separate application with a password that stores sms messages separate and apart from the main text messaging system?</p>","371532","","125389","","2010-06-23 19:06:10","2010-06-23 19:06:10","Android: Delete SMS at particular threadId location","<android><sms><content><observer-pattern>","1","0","","",""
"3104340","1","3104464","","2010-06-23 18:14:56","1","595","<p>I have a Nexus One and I would like to know if it's possible to add a new language to the system? Or are the languages compiled into the kernel?</p><p>if it's possible where can I find information about creating/developing a language for Android?</p>","167854","","","","","2010-06-23 18:33:35","Is it possible to add a new language to Android devices","<android><nexus-one>","1","3","","",""
"3104346","1","3104459","","2010-06-23 18:16:33","0","330","<p>Am able to play videos from URLs but not able to play from local disc. The file is stored in the C:/users/workspace/test/res/raw/test4.mp4how do I parse this path in Uri.parse??</p>","373566","","","","","2010-06-23 18:32:32","playing video in android from local disc","<android>","1","0","","",""
"3104735","1","3104832","","2010-06-23 19:13:31","0","896","<p>Can I embed Tab Layout into other layout?</p><p>The designed layout is like below:</p><pre><code>Root LinearLayout (vertical oritentation)   A ViewLayout   A TextLayout   A Tab layout   A View Layout   A TextLayout</code></pre><p>I just want to have tabs in my layout but not the root. Is it possible?</p><p>Thanks.</p>","256239","","256239","","2010-06-23 20:44:38","2012-12-12 12:37:04","Can I embed Tab Layout into other layout?","<android>","2","0","","",""
"3105056","1","3105123","","2010-06-23 19:58:55","1","652","<p>I was in the midsts of tinkering in android with the goal of trying to make this small exploration game.  I actually got pretty far so far: a nice sprite system, a title screen with a main menu that is all in game code (no UI buttons or anything) that launch various activities.  An activity that loads this cool map view, that when clicked on will load up another view of a more detailed ""zoomed in"" action part of a map.  It all works pretty well but now I am left wondering how well I am going about this.</p><p>(What happens to a view when you instantiate and then move the set the context to a new view?  I am guessing as long as the activity is alive all the instantiations of various views that an activity uses are still good? And in an activities onPause is when id have to save the data thats changed in these views to persist the state in the event the user quits the game etc.. ?)</p><p>I have three menu options at the start of the game.  The main one is:<br><br><strong>New Game</strong></p><ul><li><p>The new game, I launch my main mapactivity that can launch three views:First two are a loading screen forthe second, a map screen. </p></li><li><p>Third view is a more detailed actionorientated part that uses this spriteengine I developed.</p></li></ul><p>It all works pretty good as in the map view you click on a cell it tells the Calling Activity through a listener to start the detailed action view, and passes in the ID of the cell (so it knows what objects to load in the detailed view based on the cell clicked in second view). (This took me awhile to figure out but someone helped here on another question to get this.) Reference that helped me on this part <a href=""http://stackoverflow.com/questions/1596947/android-application-loading-screen/1599153#1599153""> here.</a>  I also used the various information here on <code>ViewSwitcher</code>.</p><p>I got even a yes no dialog box in the second view that asks if they really wanna goto that cell when they click on it, a yes tells the calling activity to set the new view.  What helped me to get this working was this reference <a href=""http://stackoverflow.com/questions/2257963/android-how-to-show-dialog-to-confirm-user-wishes-to-exit-activity"">here.</a>  I also had to fiddle with the calls to <code>getContext</code> and that, I am still not 100% sure what <code>getResources</code> and <code>getContext</code> do for me.</p><p>So is it bad practice to call and load a dialog from a view?  If it is, then I don't understand how if I have an event in the view that needs to pop up a dialog how I do that?  Call back to the activity and let the activity handle it the dialog response and then call a method on the view for the response? </p><p>So far all this works great, I did have a bit to learn about threads too.  I spawn a different thread for my MenuView (handles the detection of button clicks and responses), my CellMap view which handles the cool big map that users can click on to see the indepth view which is my SystemView view.  </p><p>So basically the activity call list is like this:</p><p>Home.Activity ->  ScrollMap.activity  which listens to CellMap wher ethe Yes/No dialog apperas (in the view of CellMap) and if the answer is yes to the question, then the onTouchEvent starts up the SystemView view using</p><pre><code>    private CellMap.MapClickedListener onTouchEvent=        new CellMap.MapClickedListener() {        @Override        public void onMapClick(int id) {                setContentView(new SolarSystem(theContext,id));                                             }    };</code></pre><p>To help anyone else, that listener had to be defined in my CellMap class. Then in the ScrollMap activity when I am about to start the CellMap I just call a method to CellMap sets the map click listener.  So far this is the only way I have been able to get data from a dialog (in this case a it was clicked so set the new view) back to the calling activity.  Is this proper practice?</p><p>Now my biggest question is, I have a playerObject class I want to initialize on new game event (I know how to detect that push) and that then is available to any view in any activity for the life time of the cycle.  So far the game activity has just two (3 if you count the loading progress bar) views.  I want to get the players name, is that another activity or view?  I cannot find a decent tutorial of just how to make a simple input dialogg box that would return a string.</p><p>How do i go about passing this stuff around?  After I get the players name from wherever that edit box is to be loaded, I want to set the players name in the class and pass that class instance off to another view or activity so they may get at that data.  Everything I have searched on this seemed like overkill or not the right way.  Whats the best way to pass this ""playerClass"" around so that I can access it from other views (to say display the players name in every view).</p><p>I also have my Home Activity that waits for an onClick on 3 buttons, it then launches their activity that shows the view.  I realize a continue game and new game are the same activity and will just change in data loaded off the drive to restore a save game.  When the new game button is clicked I would love to get the players name they want to use and of course set the member of the playerClass to this name so it persists.  </p><p>Where do I call (an edit dialog is it?) the edit dialog from? (more over how do I build one that can take an okay button and input from keyboard etc).  Id also like to make it pretty, maybe I could have a simple view that has one edit box in it and a nice image background (though I haven't figured out how to place the edit boxes to fit nicely matching a background i draw for it.  I guess id like an edit dialog I can skin to look how i want it to and fit the look of the game).</p><p>I am actually kinda happy what I got so far its looking not to bad, just not sure about some specifics like getting user input for a name of the player.  Storing that information and passing it then to other activities and views.</p><p>Is it better to have one GameMain activity, and a ton of views:Map viewCharacter sheet viewinventory view etc etc?</p><p>Or Should there be diff activities in there somewhere as well?</p>","327258","","327258","","2010-06-23 20:36:48","2010-06-23 20:36:48","Activities, Views and Dialogs in Android. Proper application structure for game","<android><view>","1","0","","",""
"3105080","1","3105099","","2010-06-23 20:02:27","4","1653","<p>I'm trying to debug an issue myself.  May post it later if I fail ;-)</p><p>My logcat log states <code>""android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2""</code></p><p>I would like to use <code>log.v(""desc"", cursor)</code> to show what the cursor returns.  Is there a way to specify a value from it like cursor[0] ?</p>","374607","","1108213","","2012-03-10 15:16:43","2014-01-21 10:44:39","Output values found in cursor to logcat? - Android","<android><database><cursor>","5","1","1","",""
"3105132","1","3133743","","2010-06-23 20:09:00","1","757","<p>I wrote application which uses <code>ListActivity</code>. Each item of the list consists of <code>ImageView</code> and <code>TextView</code>. Long click on list entry triggers some menu and color effect because <code>onCreateContextMenu</code> was overridden. Sometimes <code>TextView</code> contains HTML links which I would like to be interactive. I read <a href=""http://stackoverflow.com/questions/1697908/android-how-can-i-add-html-links-inside-a-listview"">#1697908</a> and made links active, so browser/youtube player is started. Everything would be great but color effect on long click disappeared (context menu still appears). </p><p>Could somebody tell me how to connect these two features and get back color effect?</p>","374590","","190309","","2013-03-30 06:54:56","2013-03-30 06:54:56","Android: HTML links inside ListView - problem with highlighting","<android><listview><hyperlink><android-listview><listviewitem>","3","2","1","",""
"3105462","1","3106349","","2010-06-23 20:51:34","4","2933","<p>I'm working on an Android App where the user has different options for sorting the displayed data that comes from the database. Currently my orderBy string that I pass to Androids query() method looks like this:</p><pre><code>""LOWER(""+columnName+"") ASC""</code></pre><p>The problem with this is that if the data type in the column specified by columnName is integer, calling LOWER() on it will cause it to be sorted alphabetically, i.e. based only on the leftmost digit, which of course doesn't make any sense for numeric data. Hence I only want to apply LOWER() if the data type of the column is not integer. What I have in mind is a statement like this:</p><pre><code>""CASE WHEN [data type of columnName is integer] THEN ""+columnName+"" ASC ELSE LOWER(""+columName+"") ASC END""</code></pre><p>The part in the brackets is what I don't know how to do. Does SQLite provide a function to determine a column's data type?</p>","213817","","","","","2010-06-23 23:43:38","Determine data type of a column in SQLite","<android><sqlite><order><case><types>","3","0","2","",""
"3105471","1","","","2010-06-23 20:52:27","0","291","<p>I've developed the app Group to Voicemail for Android and have come across an interesting issue that only occurs on HTC phones:</p><p>When I programatically send a Contact to voicemail (using the SEND_TO_VOICEMAIL field for ContactsContract.Contacts), it works as expected.  However, when I set that field back to '0' (to not send that Contact to voicemail anymore) the check box is unchecked for that Contact to send them to voicemail, but calls that come in still go to voicemail.  The only way to actually put the change into effect is to reboot the phone (obviously not an acceptable solution for users)  :)</p><p>Anyway, I've only seen this happen, and had reports from users that have HTC phones (Incredible and Evo).  It works fine on the Motorola Droid as far as I can tell.</p><p>Any ideas?</p><p>Thanks,</p><p>Matt</p>","374650","","","","","2011-01-31 22:06:39","Bug Sending Contacts to Voicemail on HTC Android Phones","<android><htc>","0","5","","",""
"3105673","1","","","2010-06-23 21:24:46","5","30101","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon"">Quitting an application - is that frowned upon?</a>  </p></blockquote><p>I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in the SharedPreferences as long as the application needs it.</p><p>As soon as the user wants to exit, the password in the SharedPreferences should be wiped and of course all activities of the application should be closed (it makes no sense to run them without the known password - they would crash).</p><p>How can I do that?</p><p><code>System.exit(0)</code> and <code>finish()</code> only exit the current activity - useless. I know there is a taskmanager app. How is that one doing it? It's able to kill the whole application...</p>","331556","","496830","","2011-08-02 14:36:21","2013-11-22 14:29:33","Android: How to kill an application with all its activities?","<android><kill>","6","0","3","2012-10-18 14:16:59",""
"3105929","1","3106621","","2010-06-23 22:07:34","1","293","<p>to start with I've gone through the entire notepad tutorial, I'm a professional game programmer who has some extra time. (though most of my time has been in C++, I did take a year or two of Java classes in college, and remember some of it).  </p><p>I'm not sure the site is a good site to ask questions like this.. If someone has a Forum that might be a good place to ask these newbie questions, please feel free to point me in the direction. </p><p>I've examined a few of the samples, and think I've a grasp of what I want to do.  I've a three to four project plan for some Android releases to sharpen my skills, but since this is my first project and I have never really developed for a mobile phone or the android before, I'd like to make sure I have a solid plan.</p><p>The first project is an example of the license plate game, however I want to do a few things to change it.  Heck maybe when I'm done it'll become a bingo style game, with bluetooth connectivity, you never know. </p><p>The base idea is I want to offer a list of states, with checkboxes next to them.  so to do this, I'll be starting with a Linear List layout similar to the note pad example, and then have a row that is only a Checkbox.  I can use text and call strike through if it's been checked off.   Perhaps offer an option to not show them if they are checked.</p><p>But I want the list to be generated from a set of lists.  Maybe all of America's states, maybe reasonable American states (no Hawaii, no Alaska) maybe a North American list, (add in Mexico and some Canadian provinces), a European list, who knows.  </p><p>I'd probably have to have a pop up window that lists all of the lists I suppose using a radiogroup of some sort. </p><p>So then as far as the data, after weighing options I think best solution is to make a database with two fields, ""checked"" and ""name"".</p><p>I figure I can use the menu for most of the user interaction (aside from clicking on stuff we want to check off) with maybe a few context menu items, I understand how to make all of those already so I should be good. </p><p>The question I have is what is the best way to populate the lists?  Should I create raw data, and have different files for all the lists?   Or is there some other way to do this?  I've seen this done on the searchable dictionary, but I'd like to hear what people who have actually generated the data like this before. </p><p>In addition is there an easy way to look at the sql database these applications create, or do you have to run searches on them and output the data? </p><p>Finally any other suggestion or advice?   I definitely want to try to get something like this on the market so I can see the full life cycle and see if anyone actually likes it.  (luckily there's not a plethora of them already) but I also want a few people to look over my code if they're willing when I'm done to make sure I've done this right or at least not missing any basic mistakes.</p><p>Thank you for your time,</p><p>Frank </p>","511852","","","","","2010-06-24 01:10:17","Looking for advice on a first android application (loading data/populating data)","<java><android><mobile>","2","1","","",""
"3106375","1","","","2010-06-23 23:50:42","0","306","<p>I have one simple WebPage trying to display on Android Phone. The background image is 320 X 480 and two section of centered text paragraphs. But the page renders completely wrong in Motorola Driod Phone. Does anyone know how to fix this display problem? I mean to display it properly on both HTC G1/G2 and HTC Droid Phones.  </p>","374703","","2219831","","2013-04-27 23:52:24","2013-04-27 23:52:24","How to display HTML page independent of different resolution in Droid or Android","<android><css>","0","4","","",""
"3106606","1","3106625","","2010-06-24 01:04:09","5","1029","<p>like the tts engine , is there a way by which speech can be converted to text in android?</p>","238505","","","","","2012-01-02 15:56:21","speech to text in android","<android>","5","1","1","",""
"3106724","1","3108887","","2010-06-24 01:39:28","1","886","<p>here is the error from the logcat of my program.</p><p>06-24 01:35:04.213: INFO/ActivityManager(587): Starting activity: Intent { comp={one.two/one.two.Arrival} }06-24 01:35:04.521: ERROR/DBDroid(1048): android.database.sqlite.SQLiteException: no such table: port: , while compiling: SELECT KEY_STATUS, KEY_ID, KEY_ARRIVAL, KEY_DESTINATION, KEY_FERRY FROM ferry06-24 01:35:05.026: INFO/ActivityManager(587): Displayed activity one.two/.Arrival: 805 ms</p><p>It seems that it is stated that there is no table called port.But i do have a table called port placed into the emulator , under data/data/one.two/databases</p><p>And here is my partial code of DBAdapter:</p><pre><code>    public class DBAdapter extends ListActivity {public static  String KEY_STATUS = ""status"";public static  String KEY_ID = ""id"";public static  String KEY_ARRIVAL = ""arrival"";public static  String KEY_DESTINATION = ""destination"";public static  String KEY_FERRY = ""ferry"";private static final String DATABASE_NAME = ""ferry"";private static final String DATABASE_TABLE = ""port"";private static final int DATABASE_VERSION = 1; private static  Context context; private static DatabaseHelper DBHelper; private static SQLiteDatabase db;</code></pre><p>By the way does anyone here knows what does this method do :</p><pre><code>public DBAdapter(Context ctx){    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper{    DatabaseHelper(Context context)    {        super(context, ""ferry"", null, 1);    }@Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)    {    }    @Override    public void onCreate(SQLiteDatabase db)    {    }}//end DatabaseHelper// ---opens the database---public DBAdapter open() throws SQLException{    db = DBHelper.getWritableDatabase();    return this;}// ---closes the database---public void close(){    DBHelper.close();}</code></pre><p>Thank you.</p>","358218","","358218","","2010-06-24 09:07:42","2010-06-25 05:53:44","Error with android DBAdapter class","<android><database><eclipse><sqlite>","2","3","","",""
"3106733","1","3106750","","2010-06-24 01:41:29","0","691","<p>I'm relatively new to java and android development so sorry if this is a silly question. I'm building simple app, simply to learn the android ropes, that will display a list of the most recent photos uploaded to flickr. The app is constructed but it's crapping out when it tries to deserialize the json that I get back from flickr. Here is my error:</p><pre><code>06-23 21:11:25.560: WARN/System.err(298): com.google.gson.JsonParseException: The JsonDeserializer com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter@43e28168 failed to deserialized json object {""page"":1,""pages"":100,""perpage"":10,""total"":1000,""photo"":[{""id"":""4728507833"",""owner"":""59492791@N00"",""secret"":""496b96968d"",""server"":""1407"",""farm"":2,""title"":""DSCN2733"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1407/4728507833_496b96968d_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4728507883"",""owner"":""30728507@N07"",""secret"":""ab80a5bdf4"",""server"":""1194"",""farm"":2,""title"":""Sultan"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1194/4728507883_ab80a5bdf4_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4728507955"",""owner"":""30311414@N00"",""secret"":""7d6ea1cd08"",""server"":""1377"",""farm"":2,""title"":""DSC04455"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1377/4728507955_7d6ea1cd08_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4728507979"",""owner"":""24737003@N04"",""secret"":""c76cfe4afb"",""server"":""1162"",""farm"":2,""title"":""IMGP1429"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1162/4728507979_c76cfe4afb_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4728508009"",""owner"":""62084706@N00"",""secret"":""76b858efe7"",""server"":""1366"",""farm"":2,""title"":""DSC_2459.JPG"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1366/4728508009_76b858efe7_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4729153856"",""owner"":""50879555@N02"",""secret"":""843d4f56ec"",""server"":""1129"",""farm"":2,""title"":""IMG_1585"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1129/4729153856_843d4f56ec_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4729153942"",""owner"":""43941986@N08"",""secret"":""f7ea2d3037"",""server"":""1257"",""farm"":2,""title"":""IMG_1126"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1257/4729153942_f7ea2d3037_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4729153952"",""owner"":""50634775@N07"",""secret"":""af6d937dcd"",""server"":""1129"",""farm"":2,""title"":""069_69"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1129/4729153952_af6d937dcd_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4729153962"",""owner"":""34771042@N07"",""secret"":""71f6c321eb"",""server"":""1014"",""farm"":2,""title"":""Snapshot_010"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1014/4729153962_71f6c321eb_s.jpg"",""height_sq"":75,""width_sq"":75},{""id"":""4729153964"",""owner"":""14318596@N08"",""secret"":""6ab627b565"",""server"":""1364"",""farm"":2,""title"":""DSC_0679"",""ispublic"":1,""isfriend"":0,""isfamily"":0,""url_sq"":""http://farm2.static.flickr.com/1364/4729153964_6ab627b565_s.jpg"",""height_sq"":75,""width_sq"":75}]} given the type com.google.gson.ParameterizedTypeImpl@3dd03b706-23 21:11:25.580: WARN/System.err(298):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:63)06-23 21:11:25.580: WARN/System.err(298):     at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:88)06-23 21:11:25.600: WARN/System.err(298):     at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)06-23 21:11:25.600: WARN/System.err(298):     at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:150)06-23 21:11:25.610: WARN/System.err(298):     at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:123)...06-23 21:11:25.851: WARN/System.err(298): Caused by: java.lang.IllegalStateException: This is not a JSON Array.06-23 21:11:25.901: WARN/System.err(298):     at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:100)06-23 21:11:25.911: WARN/System.err(298):     at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:468)06-23 21:11:25.921: WARN/System.err(298):     at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:435)06-23 21:11:25.921: WARN/System.err(298):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:50)06-23 21:11:25.931: WARN/System.err(298):     ... 26 more</code></pre><p>From, the error I'm assuming it has something GSON doesn't like about the json that is being returned but I don't know enough about how java converts objects and other types of variables during the whole operation. </p><p>I'm not sure if you will need this but here is some of the code from the project:</p><pre><code>String response = client.getResponse();response = response.replace(""jsonFlickrApi("", """");response = response.substring(0,response.length()-2);Gson gson = new Gson();FlickrPhotos flickrphotos = new FlickrPhotos();try {    flickrphotos = gson.fromJson(response, FlickrPhotos.class);} catch(Exception e) {    e.printStackTrace();}</code></pre><p>Here is FlickrPhotos:</p><pre><code>public class FlickrPhotos {    private String page, pages, perpage, total;    private List&lt;FlickrPhoto&gt; photos;    public List&lt;FlickrPhoto&gt; getPhotos() {        return photos;    }    // More getters}</code></pre><p>Here is FlickrPhoto:</p><pre><code>public class FlickrPhoto {    private String id, owner, secret, server, title, width_sq, url_sq;    // getters}</code></pre><p>Any ideas? Thanks so much for your time and probably patience...(If I'm noobing it up!)</p>","109589","","","","","2010-06-24 01:53:39","GSON and the Flickr API problems: JsonParseException when deserializing json","<java><android><eclipse><json><flickr-api>","1","0","","",""
"3106813","1","","","2010-06-24 02:12:03","2","1831","<p>I have a simple Android app that targets Android 1.5 or above.  I have an activity that is set to use the theme below (set in the manifest).  </p><pre><code>android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""</code></pre><p>Within the activity, I have a WebView (see full XML:)</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;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I believe I have my <code>onCreate</code> code setup to properly handle urlLoading (see below).  In the emulator when I test this code, the status bar does no display at the top.  On my target device which is an Archos 7 home tablet running Android 1.5 with a screen resolution of 800 x 480, the app runs, but the status bar appears at the top.</p><p>Any idea why this might be happening?</p><p>FULL SOURCE OF THE main activity:</p><pre><code>package com.bri.RestaurantLauncher;import android.app.Activity;import android.os.Bundle;import android.view.Window;import android.view.WindowManager;import android.webkit.WebView;import android.webkit.WebViewClient;public class RestaurantLauncherMain extends Activity {    private class RestaurantLauncherMainWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return false;        }    }     WebView webview;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        this.webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new RestaurantLauncherMainWebViewClient());        this.webview.getSettings().setJavaScriptEnabled(true);        this.webview.loadUrl(""http://www.google.com"");    }}</code></pre>","374818","","436938","","2011-12-01 06:28:41","2011-12-01 06:28:41","Fullscreen activity w/Webview still shows status bar at top","<android>","2","1","","",""
"3106837","1","","","2010-06-24 02:20:55","5","2136","<p>I'm playing on my Android Nexus One some videos of a few cisco cameras using a VideoView. While this works fine, I'm unsure if it's possible to save the movie to a file.</p><p>I'm opening an URL like rtsp://192.168.1.22:554/live.sdp</p><p>How can I save it to the SDcard ? Handle it like a file maybe ... Is that possible ?</p>","331556","","","","","2011-09-12 11:57:18","Android VideoView save RTSP stream","<android><save><video-streaming><rtsp>","1","0","2","",""
"3106912","1","3107626","","2010-06-24 02:42:29","20","11948","<p>I see a lot of java code where android prefers to have developers use static inner classes. Particularly for patterns like the <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"">ViewHolder Pattern</a> in custom ListAdapters.</p><p>I'm not sure what the differences are between static and non-static classes. I've read about it but it doesn't seem to make sense when concerned with performance or memory-footprint.</p>","42005","","","","","2010-06-29 02:32:10","Why does Android prefer static classes","<java><android><performance><static-classes>","5","0","12","",""
"3106977","1","","","2010-06-24 03:03:14","3","16797","<p>This appears related to:<a href=""http://stackoverflow.com/questions/3037512/android-application-doesnt-start-from-eclipse/3106897#3106897"">http://stackoverflow.com/questions/3037512/android-application-doesnt-start-from-eclipse/3106897#3106897</a></p><p>Even with the Android 2.2 platform is this still the accepted way to operate the emulator? i.e. 1, 2, 3 start/kill processes as described in the above post?  I am having a similar problem on WinXP with Eclipse w/ ADT plugin. Why would the activity not be able to start on the emulator? The computer has 756MB RAM if that could be the problem. The deployment is going along until Eclipse tries to deploy the activity. The emulator starts with the text ""ANDROID_"" and then eventually just displays the ANDROID logo, though appears to still be running just fine. Any ideas? Thanks. The code was copied from the HelloWorld tutorial. Here is the Eclipse console log including the error messages towards the end:</p><blockquote>  <p>[2010-06-23 15:43:26 - myHelloWorldProject] ------------------------------<br>  [2010-06-23 15:43:26 - myHelloWorldProject] Android Launch!<br>  [2010-06-23 15:43:26 - myHelloWorldProject] adb is running normally.<br>  [2010-06-23 15:43:27 - myHelloWorldProject] Performing net.concentricllc.HelloWorld.HelloAndroid activity launch<br>  [2010-06-23 15:43:27 - myHelloWorldProject] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'myHelloWorldAVD'<br>  [2010-06-23 15:43:27 - myHelloWorldProject] WARNING: Application does not specify an API level requirement!<br>  [2010-06-23 15:43:27 - myHelloWorldProject] Device API version is 8 (Android 2.2)<br>  [2010-06-23 15:43:27 - myHelloWorldProject] Uploading myHelloWorldProject.apk onto device 'emulator-5554'<br>  [2010-06-23 15:43:32 - myHelloWorldProject] Installing myHelloWorldProject.apk...<br>  [2010-06-23 15:48:29 - myHelloWorldProject] Success!<br>  [2010-06-23 15:48:37 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device<br>  [2010-06-23 15:51:35 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.<br>  [2010-06-23 15:51:36 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?<br>  [2010-06-23 15:51:38 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device<br>  [2010-06-23 15:53:36 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.<br>  [2010-06-23 15:53:36 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?<br>  [2010-06-23 15:53:39 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device<br>  [2010-06-23 15:55:41 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.<br>  [2010-06-23 15:55:41 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?<br>  [2010-06-23 15:55:44 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device<br>  [2010-06-23 15:57:15 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.<br>  [2010-06-23 15:57:15 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?<br>  [2010-06-23 15:57:18 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device<br>  [2010-06-23 15:58:51 - myHelloWorldProject] ActivityManager: Error type 2<br>  [2010-06-23 15:58:52 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?</p></blockquote>","374830","","309308","","2010-09-01 15:11:01","2013-10-27 07:50:21","Eclipse can't connect to activity manager on emulator - HelloWorld does not appear","<android><activity><android-emulator><hello-world>","3","0","4","",""
"3107100","1","3107115","","2010-06-24 03:45:16","1","561","<p>I have a listview which has a bunch of selections. I want to keep the focus on the listview in touchmode and get the item selected. What is the best way to do that?</p><p>I found this blog:<a href=""http://bestsiteinthemultiverse.com/2009/12/android-selected-state-listview-example/"" rel=""nofollow"">http://bestsiteinthemultiverse.com/2009/12/android-selected-state-listview-example/</a></p><p>and <a href=""http://developer.android.com/resources/articles/touch-mode.html"" rel=""nofollow"">http://developer.android.com/resources/articles/touch-mode.html</a></p><p>What does the community suggest?</p>","82368","","","","","2010-06-24 11:02:49","What is the best way to get the item selected in the listview?","<java><android><listview><user-interface>","2","0","","",""
"3107194","1","","","2010-06-24 04:12:22","1","871","<p>Here is a snippet of code that i am working with. I am making an app for android and everything is going great except this one problem and google has not been my friend on this. I have highlighted the important parts. The problem is when the TextViews are loaded with data using the updateboxes() method everything works great. When they are loaded with the populateFields(); method the time or date picker doesnt recognize the values since they come straight from the database and not built with stringBuilder like the updateboxes() method.</p><p>Strings are not my strong point and the only thing that i can think of doing is breaking the strings back down into individual mDay mMonth mYear values and then run them back through the updateBoxes() method but i would think there would be an easier way. I wouldnt know how to do that anyway.</p><p>Here is the code:</p><pre><code>package com.example.TimeClockAppreset;import java.util.Calendar;import android.app.Activity;import android.app.DatePickerDialog;import android.app.Dialog;import android.app.TimePickerDialog;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.DatePicker;import android.widget.Spinner;import android.widget.TextView;import android.widget.TimePicker;import android.widget.AdapterView.OnItemSelectedListener;public class TimesEdit extends Activity{    private TimesDbAdapter mDbHelper;    private Long mRowId;    private TextView mDateBox;    private TextView mTimeBox;    private int mYear;    private int mMonth;    private int mDay;    private int mHour;    private int mMinute;    static final int TIME_DIALOG_ID = 0;    static final int DATE_DIALOG_ID = 1;         protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            mDbHelper = new TimesDbAdapter(this);            mDbHelper.open();            setContentView(R.layout.entry_edit);            mDateBox = (TextView) findViewById(R.id.DateBox);            mTimeBox = (TextView) findViewById(R.id.TimeBox);            Button changeTime = (Button) findViewById(R.id.changeTime);            Button changeDate = (Button) findViewById(R.id.changeDate);            Button confirmButton = (Button) findViewById(R.id.confirm);            Spinner spinner = (Spinner) findViewById(R.id.spinner);            ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(                    this, R.array.ClockBox_array, android.R.layout.simple_spinner_item);            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);            spinner.setAdapter(adapter);            spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());            mRowId = (savedInstanceState == null) ? null :                (Long) savedInstanceState.getSerializable(TimesDbAdapter.KEY_ROWID);            if (mRowId == null) {                Bundle extras = getIntent().getExtras();                mRowId = extras != null ? extras.getLong(TimesDbAdapter.KEY_ROWID)                                        : null;            }            //updateBoxes();            populateFields();            changeTime.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    showDialog(TIME_DIALOG_ID);                }            });            changeDate.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    showDialog(DATE_DIALOG_ID);                }            });            confirmButton.setOnClickListener(new View.OnClickListener() {                public void onClick(View view) {                    setResult(RESULT_OK);                    finish();                }            });     }         //THIS GETS THE INFO AND POPULATES THE FIELDS         private void populateFields() {                if (mRowId != null) {                    Cursor time = mDbHelper.fetchTime(mRowId);                    startManagingCursor(time);                    mDateBox.setText(time.getString(                                time.getColumnIndexOrThrow(TimesDbAdapter.KEY_DATE)));                    mTimeBox.setText(time.getString(                            time.getColumnIndexOrThrow(TimesDbAdapter.KEY_TIME)));                }                else                    updateBoxes();            }             private void updateBoxes() {                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);                updateDateDisplay();                updateTimeDisplay();         }         private void updateDateDisplay() {                mDateBox.setText(                        new StringBuilder()                                // Month is 0 based so add 1                                .append(mMonth + 1).append(""-"")                                .append(mDay).append(""-"")                                .append(mYear).append("" ""));    }         private void updateTimeDisplay() {            mTimeBox.setText(                    new StringBuilder()                    .append(pad(mHour)).append("":"")                    .append(pad(mMinute)));        }         private static String pad(int c) {                if (c &gt;= 10)                    return String.valueOf(c);                else                    return ""0"" + String.valueOf(c);            }         public class MyOnItemSelectedListener implements OnItemSelectedListener {                public void onItemSelected(AdapterView&lt;?&gt; parent,                    View view, int pos, long id) {                }                @SuppressWarnings(""unchecked"")                public void onNothingSelected(AdapterView parent) {                  // Do nothing.                }            }         private TimePickerDialog.OnTimeSetListener mTimeSetListener =                new TimePickerDialog.OnTimeSetListener() {                    public void onTimeSet(TimePicker view, int hourOfDay, int minute) {                        mHour = hourOfDay;                        mMinute = minute;                        updateTimeDisplay();                    }                };         private DatePickerDialog.OnDateSetListener mDateSetListener =                    new DatePickerDialog.OnDateSetListener() {                        public void onDateSet(DatePicker view, int year,                                              int monthOfYear, int dayOfMonth) {                            mYear = year;                            mMonth = monthOfYear;                            mDay = dayOfMonth;                            updateDateDisplay();                        }                    };         @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 saveState() {                String date = mDateBox.getText().toString();                String time = mTimeBox.getText().toString();                String inOut = ""NA"";                if (mRowId == null) {                    long id = mDbHelper.createEntry(time, date, inOut);                    if (id &gt; 0) {                        mRowId = id;                    }                } else {                    mDbHelper.updateTimeTest(mRowId, time, date);                }            }         @Override            protected void onSaveInstanceState(Bundle outState) {                super.onSaveInstanceState(outState);                saveState();                outState.putSerializable(TimesDbAdapter.KEY_ROWID, mRowId);            }         @Override         protected void onPause() {                super.onPause();                saveState();            }         @Override         protected void onResume() {                super.onResume();                populateFields();            }}</code></pre><p>Any help would be appreciated. This problem is driving me crazy considering everything else is good to go.</p>","373854","","480199","","2012-07-18 18:03:27","2012-07-18 18:03:27","Time/Date picker not recognizing Strings","<android><datepicker><timepicker>","1","0","1","",""
"3107217","1","3118240","","2010-06-24 04:20:40","1","5256","<p>How to make a file browsing window in Android for accessing, browsing and opening SD card's FAT32 contents?</p>","373049","","","","","2012-11-11 22:41:09","SD Card File Browser in Android","<android>","2","0","3","",""
"3107327","1","","","2010-06-24 04:56:46","3","5078","<p>Ok, so perhaps I'm completely missing something here, but I've just started working with SQL and Android and  from what I can see, updates and inserts back to the database need to be handled individually?</p><p>I can retrieve a Cursor containing multiple records, but if I wanted to apply an update to each record in the cursor, I can only see how to do this individually, using  ContentValues and Update(), and then the cursor requires reloading??</p><p>Same with if I wish to create multiple new records, these appear to be required to be inserted individually? Can I not create a List and bulk insert?</p><p>To me this seems slow and cumbersome, and there has to be something I'm not yet aware of (searching for answers is failing me... likely due to using incorrect terms being new to android/java)</p><p>Here's a very simple example of what I basically what I want to achieve, however there must be a better way to achieve this functionality. (I know there are some other bad practises in here, just creating a quick eample)</p><pre><code>public class HelloSQL extends Activity {    SQLiteDatabase myDB = null;    String TableName = ""myTable"";    ContentValues myVals = new ContentValues();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String Data = """";        // Create a Database.        try {            myDB = this.openOrCreateDatabase(""myTestDB"", MODE_PRIVATE, null);            // Create a Table in the Database.            myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + TableName                    + "" ( id INTEGER PRIMARY KEY AUTOINCREMENT,""
                    + "" Value1 INTEGER, Value2 INTEGER);"");            myDB.execSQL(""DELETE FROM "" + TableName);            // insert value1            for (int i = 0; i &lt; 100; i++) {                myVals.put(""Value1"", i);                myDB.insert(TableName, null, myVals);            }            // retrieve data from database            Cursor c = myDB.rawQuery(""SELECT * FROM "" + TableName, null);            int colId = c.getColumnIndex(""id"");            int col1 = c.getColumnIndex(""Value1"");            int col2 = c.getColumnIndex(""Value2"");            Random generator = new Random();            // Loop through all values and update value2            c.moveToFirst();            if (c != null) {                                do {                                        long id = c.getLong(colId);                    int val1 = c.getInt(col1);                    int randomVal = generator.nextInt(99);                    myVals.put(""Value1"", val1);                    myVals.put(""Value2"", randomVal);                    myDB.insert(TableName, null, myVals);                    myDB.update(TableName, myVals, ""id=?"",new String[] {Long.toString(id)});                } while (c.moveToNext());            }            // requery data            c = myDB.rawQuery(""SELECT * FROM "" + TableName, null);            // display all values            c.moveToFirst();            if (c != null) {                do {                    int val1 = c.getInt(col1);                    int val2 = c.getInt(col2);                    Data = Data + Integer.toString(val1) + "" "" + Integer.toString(val2)  + ""\n"";                } while (c.moveToNext());            }                       TextView tv = new TextView(this);            tv.setText(Data);            setContentView(tv);        } catch (Exception e) {            Log.e(""Error"", ""Error"", e);        } finally {            if (myDB != null)                myDB.close();        }    }</code></pre><p>Thanks in advance, don't expect anyone to re-write everything I've done here, but  apoint in the right direction and links to a sample would be greatly appreciated.</p>","374890","","1209430","","2012-05-03 15:32:06","2012-05-03 15:32:06","Android: Inserting/Updating multiple records to SQL database","<android><sql><sql-update><sql-insert>","1","1","","",""
"3107451","1","","","2010-06-24 05:32:52","2","221","<p>Can <code>ringtonepreference</code> be used to select ringtones from a folder(raw) in Android?</p>","374905","","646382","","2011-08-23 20:12:03","2011-08-23 20:12:03","How to set preferences using Ringtonepreference? ","<android><ringtone>","0","0","","",""
"3107488","1","3107517","","2010-06-24 05:43:16","0","480","<p>I am new to Android development and am facing a slight issue. My first screen is a basic log in screen. There is a LOG IN button on the screen and a OnClickHandler implemented for the button.<br>When the user clicks the log in button i validate the user name and password, shows a ProgressBar dialog start a new Thread. The thread connects to the server and validates the user info. The problem is that the Progress Bar doesn't show until after the thread has finished. I read that all work must be done in a separate thread otherwise the Progress Bar will not see the light of day and i am doing my work in a separate thread.   </p><p>But the problem is that right below the thread code i have a loop while(userinfo==null){} . This is because the userinfo object is been populated by the newly created thread and the userinfo object is required by code below the thread, without the loop a new thread would be created that fills the userinfo object but in the mean time the code that reads the userinfo would get a null object. If any one is willing to review the code i could send the file that has this code. Really need some help in this.</p>","365019","","114066","","2010-08-17 08:13:09","2010-08-17 08:13:09","ProgressBar Dialog not showing","<android>","1","0","","",""
"3107496","1","","","2010-06-24 05:46:33","3","180","<p>With Android platform fragmentation, what changes in different OEM handset attributes force developers to port from one platform to another?</p>","353944","","353944","","2010-06-24 05:52:28","2011-08-19 18:32:09","Effort due to Android fragmentation","<android><porting><fragmentation>","2","0","1","",""
"3107522","1","","","2010-06-24 05:54:35","4","272","<p>A lot of Android apps are open source, but how can we make sure the person who finally uploads to the Google Market does not include some spyware just before uploading?</p><p>Background: Mobile apps security seems to be <a href=""http://news.cnet.com/8301-27080_3-20008518-245.html"" rel=""nofollow"">a growing concern</a>, and I would like to reassure the users of my Open Source Android app. Solutions that require to modify the deployment process or application content are acceptable too.</p><p><b>2012 update:</b> This is going in the right direction: <a href=""http://f-droid.org/"" rel=""nofollow"">http://f-droid.org/</a> They check the apps and compile them into APKs that they distribute. That being said, I would trust them more if they were Mozilla or Apache...</p>","226958","","226958","","2012-01-06 10:12:23","2012-01-06 10:12:23","How to make sure an Android app was really compiled from said source code?","<android><security><open-source><toolchain><spyware>","1","0","1","",""
"3107527","1","3527902","","2010-06-24 05:56:05","27","18923","<p>I would like to write an android app that basically layers an overlay on image on another image and then I would like to save the picture with the overlay as a jpg or png. Basically this will be the whole view that I would like to save. </p><p>Sample code would be very helpful.</p><p>EDIT:</p><p>I tried out your suggestions and am getting a null pointer at the Starred Line.</p><pre><code> import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Bitmap.CompressFormat;import android.os.Bundle;import android.os.Environment;import android.widget.LinearLayout;import android.widget.TextView;    public class EditPhoto extends Activity {        /** Called when the activity is first created. */     LinearLayout ll = null;     TextView tv = null;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            tv = (TextView) findViewById(R.id.text);            ll = (LinearLayout) findViewById(R.id.layout);            ll.setDrawingCacheEnabled(true);            Bitmap b = ll.getDrawingCache();            File sdCard = Environment.getExternalStorageDirectory();            File file = new File(sdCard, ""image.jpg"");            FileOutputStream fos;      try {       fos = new FileOutputStream(file);       *** b.compress(CompressFormat.JPEG, 95,fos);      } catch (FileNotFoundException e) {       // TODO Auto-generated catch block       e.printStackTrace();      }        }    }</code></pre>","282475","","282475","","2010-08-23 21:31:46","2013-03-12 11:19:07","Android save view to jpg or png","<android><camera><image>","2","5","20","",""
"3107542","1","","","2010-06-24 06:01:06","1","596","<p>I am sorting my database depending on date. The date field in SQLite is nothing but a string, stored in the form of dd-mm-yyyy.How do i carry out the sorting.</p><p>My idea is to create a dummy table.Convert the date in a format yyyymmdd. Then sort it simply using sort by date column.Then again drop the table.</p><p>Is there an efficient or a better way ?</p>","344768","","243782","","2010-06-24 06:16:18","2010-06-24 06:27:23","sorting data by date?","<sql><android><sqlite>","2","0","","",""
"3107544","1","","","2010-06-24 06:01:58","1","532","<ol><li>File file = new File(fileName);</li><li>Iterator iter = ImageIO.getImageReadersByFormatName(""Reader""); </li><li>ImageReader reader = (ImageReader) iter.next();</li><li>ImageReadParam param= reader.getDefaultReadParam();</li><li>ImageInputStream iis = ImageIO.createImageInputStream(myFile);</li><li>reader.setInput(iis, false);</li><li>BufferedImage myJpegImage = reader.read(0, param);</li></ol><p>How can i write equivalent codes for above codes on Android? are there any hints how to read pixel data? </p>","373885","","373885","","2010-06-24 06:22:18","2011-01-03 09:03:13","How to read image's compress data (pixel data) from container file on Android? Are there tutorials for these?","<android>","1","0","1","",""
"3107587","1","3113352","","2010-06-24 06:12:18","3","1310","<p>I'd like to debug my Android application on my device (Nexus One - not the emulator) using the command line.</p><p>I'm confused at how to set a breakpoint using jdb in combination with <code>android.os.Debug.waitForDebugger</code>.</p><p>Say I put the following code in my main activity <code>onCreate</code>:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    android.os.Debug.waitForDebugger();    int j = 10;    int r = j;}</code></pre><p>Using <code>ddms</code> I can see that my application is waiting for the debugger (red bug icon) when I start it.</p><p>However, I don't understand how to set a breakpoint after the <code>waitForDebugger()</code> call so that I can start stepping.</p><p>Obviously just attaching <code>jdb</code> is going to immediately continue running the app without stopping.</p><p>e.g.</p><pre><code>jdb -attach localhost:8700</code></pre><p>Is there way to preset breakpoints prior to running <code>jdb</code> or a way to start <code>jdb</code> set breakpoints and then attach? </p>","360911","","648313","","2012-03-08 21:59:40","2012-03-08 21:59:40","Android with jdb confusion using waitForDebugger","<android><debugging><jdb>","3","0","1","",""
"3107703","1","","","2010-06-24 06:35:49","0","824","<p>I have a text input field in my web page that I am using to collect a date (via the jQuery Tools .dateinput). The user does not need to be able to type into the field. A dialog box appears when the field is clicked on. This is a problem on my Motorola Droid, because I don't want the soft-keyboard to appear when the field is clicked.</p><p>I have tried input.blur() on focus and also setting the field to disabled and readonly. Setting the field to disabled has undesired side effects. Setting the field to readonly works in everything but the Android browser. The browser seems to recognized the ""readonly"" attribute (or readOnly via javascript), BUT the field does not actually become readonly. When you click it, the soft keyboard still appears and allows you to change the field.</p><p>I suppose that this is a bug in the Android browser. Can anyone come up with a clever alternative?</p>","48793","","","","","2010-12-15 22:44:24","Read-only input in Android Webkit not working","<javascript><android><keyboard><webkit><readonlyattribute>","1","1","","",""
"3107812","1","3111650","","2010-06-24 06:59:04","2","4876","<p>This doesn't seem to work in jqTouch or iUI. But I know it's possible because it works on my Droid when I go to deviantart.com . Anyone know how to do it?</p><p>Thanks!</p>","48793","","","","","2011-01-07 19:54:17","Hide the URL bar in Android Webkit","<android><webkit><jqtouch><iui>","3","0","1","",""
"3107879","1","","","2010-06-24 07:14:00","3","347","<p>Can LOCAL_STATIC_JAVA_LIBRARIES be used instead of LOCAL_JAVA_LIBRARIES in Android.mk file?Build cook book (http://pdk.android.com/online-pdk/guide/build_cookbook.html#mkVars) doesn't give information about LOCAL_STATIC_JAVA_LIBRARIES. what is the difference between static and regular java libraries.</p>","110024","","","","","2010-06-24 07:14:00","difference between static and normal java libraries in android make file","<android>","0","0","","",""
"3107941","1","3109230","","2010-06-24 07:26:37","0","3381","<p>I'd like to set up Android SDK with Netbeans or Visual Studio 2010. I am coming back to Windows programming after 3 months on Apple iMac (for iPhone programming). </p><p>Would somebody be able to explain how to set up the NetBeans environment so I can compile and test Android Apps directly form NetBeans.</p><p>I will be testing on a simulator, not a real device. My platform is Windows 7 Ultimate.</p><p>Thanks.</p><p>EDIT: </p><p>nbandroid is proving annoying to set up. It requires platforms. How do I install those?It seems I can't use Eclipse even if I wanted to. It can't find the Java VM DLL... Help with that is appreciated.</p>","224988","","224988","","2010-06-24 15:30:01","2013-08-29 02:48:46","Setting up Android SDK with Netbeans or Visual Studio?","<android><ide><sdk><setup>","3","4","","",""
"3108144","1","3109271","","2010-06-24 07:59:55","4","279","<p>I thought this would be an easy one but I was wrong...</p><p>My app won't work on non-touch android devices so I don't want it to show up in market for these. </p><p>I hoped to find a property to set in AndroidManifest.xml but the closest match I can find is this: </p><pre><code>android:reqTouchScreenThe type of touch screen the application requires, if any at all. The value must be one of the following strings: Value   Description""undefined"" The application doesn't require a touch screen. (The touch screen requirement is undefined.) This is the default value.""notouch""   The application doesn't require a touch screen.""stylus""    The application requires a touch screen that's operated with a stylus.""finger""    The application requires a touch screen that can be operated with a finger.</code></pre><p>So what I would like to do is set reqTouchScreen to both stylus and finger, which isn't allowed. Or, a simple reqTouchScreen=yes would be nice :)</p>","375019","","","","","2010-06-24 10:52:16","How to prevent non-touch phones to see application in Android Market","<android>","1","0","1","",""
"3108153","1","3108191","","2010-06-24 08:01:57","0","139","<p>I have some questions about android ui api.</p><p>Give a example, that I want to implement.</p><p>Main_UI_Thread.java :</p><pre><code>public class Main_UI_Thread extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        /*** do something about layout ***/        ...        DisplayClass dc = new DisplayClass();        Thread th = new Thread(dc);        th.start();    }}</code></pre><p>DisplayClass.java :</p><pre><code>public class DisplayClass extends Thread{    @Override    public void run() {        if( something happen ) {             to display Dialog or Toast show             and handle the ui listener        }    }}</code></pre><p>I know the message passing can be do that;</p><p>But I want the ui program is be implemented in DisplayClass.java</p><p>Is it possible??</p><p>My English is  not well.^^"" </p><p>Thanks everybody to give me some suggestions. :P</p>","374981","","","","","2010-06-24 09:03:42","Android - Is it possible to use ui api in the other class and thread expect Activity?","<android>","1","0","","",""
"3108154","1","3109792","","2010-06-24 08:02:07","6","3432","<p><br>I actually have an app that I test with two devices. One LG GW620, and one Samsung Spica.I would like when User touch the screen, the device vibrate. </p><p>In fact, On the LG GW620, the device vibrate when I touch it. But on the spica doesn't...</p><p>I looked for settings on the spica, but Vibrator is check, so I don't understand why it doesn't vibrate.</p><p>In my app I have : <code>&lt;uses-permission android:name=""android.permission.VIBRATE""&gt;&lt;/uses-permission&gt;</code></p><p>and in the code :           </p><pre><code>Vibrator vibrator =(Vibrator)getSystemService(Context.VIBRATOR_SERVICE);            vibrator.vibrate(100);</code></pre><p>But I think it is not the best thing to do that. I wish device vibrate for every click, but I don't know if I have to do a Vibrator for each OnClick ? Or if I could do only one Vibrator for all the application ?<br>And especially why it doesn't work on Spica ?</p>","335500","","297762","","2010-06-24 12:12:56","2010-11-16 09:59:40","Android - Vibrating device doesn't work","<android><vibrate>","1","3","1","",""
"3108264","1","","","2010-06-24 08:21:30","1","206","<p>I'm trying to write an Android application that will use plugins. These plugins will just be other Android applications without a launcher. For instance my application can fire an intent saying ""I want to get a list of images"". Then, the user can pick from which application he/she wishes to find the list of images (typical facebook-plugin, flicker-plugin etc.). The choice the user makes may or may not show an activity, but it will return the list of images to the application. However, this 'list' of images, isn't just a list of URLs to the image itself, because some sites which the user should be able to get the images from needs parsing, and that takes time, rather it's a resource as of how to obtain the list of images, so that later, I can connect to a content-provider that will download the images needed on the fly.</p><p>However, I also have a service running that gives the user the ability to mark a given set of images (like a chapter, or album) for downloading, and then the service will download the images specified, but my application doesn't know how to get images from flicker/facebook/any other plugin, so I was wondering how I can make my service ""talk"" to the plugin to download the images in the background (without having to fire an activity that the user needs to see).</p><p>Any thoughts of how this can be achieved would be appreciated.</p><p>PS. Sorry about bad English, not my native language.</p>","213323","","26428","","2010-07-10 21:51:14","2010-07-10 21:51:14","Android service using components from other applications","<android><android-service>","0","3","","",""
"3108466","1","3108752","","2010-06-24 08:56:29","1","1151","<p>I'm building a list that is sorted alphabetically. The list should show a divider containing the Letter that the following icons belong to. </p><p>I'm using a Cursoradapter that contains the already sorted result from the database.I plan on adding the divider to the list item and set it to visible if the shown letter changes. How do I know that I have a new Letter? Is there a better way then going forward or backward in the cursor and check if the item I show is the end or beginning of a new group?</p>","114066","","114066","","2012-01-27 08:48:39","2012-01-27 08:48:39","How to show dividers after some items in a listview?","<android><android-listview>","1","0","2","",""
"3108494","1","","","2010-06-24 09:01:48","1","816","<p>Is there an Event that is fired when an widget becomes visible on to the homescreen. I didn't mean at install time, I mean if the user changes his homescreen by wiping the surface of the phone.The background of this question is that I setup a timer in a service inside the widget that gets updates from a url but that should stop if the widget is not on the current homescreen.</p><p>Freudi</p>","375066","","","","","2010-10-31 21:48:58","Widget Update when user switches homescreen","<android><android-widget>","3","0","","",""
"3108505","1","","","2010-06-24 09:04:06","1","1626","<p>Im performing certain database operations after which I attach Cursor to the SimpleCursorAdapter for display List on my ListActivity. If I close the cursor in finally block (or anywhere after the code below), nothing is displayed in the list</p><pre><code>SimpleCursorAdapter scAdapter = new SimpleCursorAdapter(this,           R.layout.list_row, cursor,          new String[] { Constants.KEY_TITLE }, new int[] { R.id.text1 });</code></pre><p>If the cursor is not closed, Android throws exception when activity makes request to another activity or is passivated.</p><p>PS I tried closing cursor inside onPause(), but android complains before onPause is called.</p>","345766","","","","","2011-08-05 02:34:22","Impossible to close Cursor when setting to SimpleCursorAdapter","<android>","3","0","","",""
"3108565","1","","","2010-06-24 09:13:31","0","533","<p>I am working with sensor devices that transmit data via bluetooth. I am using HTC desire which runs on android 2.1 platform to pair it with the sensors. I want to find out a few things about the sensor device such as its bluetooth version, what bluetooth profile it supports and its bluetooth class. My question is, is android bt api capable of extracting such information from the sensor devices. If not can you recommend any other way to get such information. </p>","375065","","133203","","2010-06-24 09:16:08","2012-02-09 23:59:26","Android Bluetooth api capabilities","<android>","1","2","","",""
"3108897","1","3108935","","2010-06-24 09:59:07","0","274","<p>it happens that the user click on enter where i dont want to include it as a part of my input the string can end with 3 times \n so just replacing one wont do the job my solution was ;</p><pre><code>String values[] = string_Ends_With_Back_Slash_N.split(""\n""); String String_without_Back_Slash_N =new String (values [0]);//or just to point there without the new but i want later to dump the garbage.</code></pre><p>or at least to dump values to the gc now ....   </p><p>so two q :</p><ol><li>is there more efficent way?..</li><li>who do i call the compiler (java on android ...)</li></ol>","368440","","169277","","2010-06-24 10:03:35","2012-04-09 11:46:41","string ends with '\n' what is the most efficient way to manipulate?","<java><android><string>","5","4","","",""
"3109158","1","3109723","","2010-06-24 10:38:01","61","67244","<p>Can I parse kml file in order to display paths or points in Android? Please could you help me with that?</p><p>This is kml sample code which I would like to display in android google map:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;kml xmlns=""http://www.opengis.net/kml/2.2""&gt;&lt;Document&gt;&lt;name&gt;Paths&lt;/name&gt;&lt;description&gt;Examples of paths. Note that the tessellate tag is by default  set to 0. If you want to create tessellated lines, they must be authored  (or edited) directly in KML.&lt;/description&gt;&lt;Style id=""yellowLineGreenPoly""&gt;  &lt;LineStyle&gt;    &lt;color&gt;7f00ffff&lt;/color&gt;    &lt;width&gt;4&lt;/width&gt;  &lt;/LineStyle&gt;  &lt;PolyStyle&gt;    &lt;color&gt;7f00ff00&lt;/color&gt;  &lt;/PolyStyle&gt;&lt;/Style&gt;&lt;Placemark&gt;  &lt;name&gt;Absolute Extruded&lt;/name&gt;  &lt;description&gt;Transparent green wall with yellow outlines&lt;/description&gt;  &lt;styleUrl&gt;#yellowLineGreenPoly&lt;/styleUrl&gt;  &lt;LineString&gt;    &lt;extrude&gt;1&lt;/extrude&gt;    &lt;tessellate&gt;1&lt;/tessellate&gt;    &lt;altitudeMode&gt;absolute&lt;/altitudeMode&gt;    &lt;coordinates&gt; -112.2550785337791,36.07954952145647,2357      -112.2549277039738,36.08117083492122,2357      -112.2552505069063,36.08260761307279,2357      -112.2564540158376,36.08395660588506,2357      -112.2580238976449,36.08511401044813,2357      -112.2595218489022,36.08584355239394,2357      -112.2608216347552,36.08612634548589,2357      -112.262073428656,36.08626019085147,2357      -112.2633204928495,36.08621519860091,2357      -112.2644963846444,36.08627897945274,2357      -112.2656969554589,36.08649599090644,2357     &lt;/coordinates&gt;    &lt;LineString&gt;    &lt;/Placemark&gt;    &lt;/Document&gt;    &lt;/kml&gt;</code></pre><p>When I'm loading this file to standard web google map it displays it nicely but when I'm trying the same thing with android google map it doesn't do that. It just takes me to some locations and that's it. I was thinking of changing listener class. Currently it looks like that:</p><pre><code>private class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        if (loc != null) {            latitude = (loc.getLatitude() * 1E6);            longitude = (loc.getLongitude() * 1E6);             Toast.makeText(getBaseContext(),                      ""Location changed : Lat: "" + latitude +                      "" Lng: "" + longitude,                      Toast.LENGTH_SHORT).show();             GeoPoint p = new GeoPoint(                     (int) (loc.getLatitude() * 1E6),                      (int) (loc.getLongitude() * 1E6));             mc.animateTo(p);             mapView.invalidate();           }    }//---------------------------------------------------------------    @Override    public void onProviderDisabled(String provider) {        // TODO Auto-generated method stub    }    @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><p>Please can someone tell me what's I'm doing wrong here?</p>","359656","","760489","","2011-09-27 05:53:02","2012-07-03 10:54:04","How to draw a path on a map using kml file?","<android><google-maps><android-mapview><kml>","3","0","76","",""
"3109165","1","3109223","","2010-06-24 10:38:53","-1","312","<p>Suppose i have one simple function in my program. Whenever i call that function does a new thread or process is spawned to execute the function or it is executed under the main thread memory space only. Please help... any pointers will be appreciated.</p><p>Thanks in advance,Rupesh</p>","212688","","","","","2010-06-24 13:14:01","does a java function call spawns new thread for its execution?","<android><java>","4","5","","",""
"3109283","1","","","2010-06-24 10:54:10","9","36859","<p>Hi i'm new to android i'm searching for load photo to facebook by authorization,getting access_token how to do this please give me a sample code in java.its urgent please help me.</p><p>Thanks,</p><p>Sanjana</p>","375154","","1765573","","2013-07-19 13:01:51","2013-08-26 09:43:02","Android - Upload photo to Facebook with Facebook Android SDK","<android><facebook><photo><facebook-android-sdk><facebook-java-sdk>","5","1","14","",""
"3109448","1","3109886","","2010-06-24 11:20:26","0","485","<p>i have an app which shows the received messages as a Toast through a BroadcastReceiver. I am presently using the SmsMessage.getOriginatingAddress() method which gives me the number of the sender, how can modify it to get the corresponding name of the sender if stored in the  contacts?</p>","238505","","","","","2010-06-24 12:26:42","using the contacts manager in android","<android>","1","0","","",""
"3109473","1","3110562","","2010-06-24 11:24:51","27","25065","<p>After installation of Android SDK, there were created .android folder on the E:\ drive. As far as i know this is default folder of Android Virtual Devices for configuration files.</p><p>How can I move .android folder to a different location?</p><p>(eg. from E:\.android to E:\Android\.android)</p>","361832","","361832","","2010-06-24 13:54:22","2013-08-01 07:16:26","Moving default AVD configuration folder (.android)","<windows><android><android-emulator><avd>","3","0","13","",""
"3109516","1","","","2010-06-24 11:33:04","4","1870","<p>I have One AutocompleTextView and I want to  make the virtual keyboard disappear when he hits ""DONE"" at the AutocompleTextView. So far, the buttons ""NEXT""/""DONE"" do nothing at all.... Unfortunately I found no resources addressing this problem.</p><p>Any suggestions? thanks in advance</p>","454808","","","","","2011-09-13 08:51:30","Done is not working in softKeyboard in Autocomplete TextView in android","<android>","2","2","1","",""
"3109710","1","3113268","","2010-06-24 12:02:22","1","3421","<p>For my application i make a bluetooth discovery search to list all available bluetooth device in. If I'm in a room with a lot of computers etc, there is a really long list. So I'd like to filter Android phones from the lists.</p><p>I read the documentation under:<a href=""http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html"" rel=""nofollow"">http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.html</a> and <a href=""http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.Major.html"" rel=""nofollow"">http://developer.android.com/reference/android/bluetooth/BluetoothClass.Device.Major.html</a></p><p>So I'm able to filter some devices like laptops, computers, etc.</p><p>Does anybody know what are the possible constants which android phones can have? I don't want to risk to filter too many devices, but I also want to limit the list to only Android devices.</p><p>Any hints?</p>","","anon","","","","2010-06-24 19:29:10","What are the bluetooth device classes of android phones?","<android><bluetooth>","1","0","3","",""
"3109843","1","","","2010-06-24 12:20:56","2","507","<p>Is it possible to pass custom attributes through a ViewStub to the target layout's root element? Like so:</p><pre><code>&lt;ViewStub        android:layout=""@layout/custom_view""        app:customAttr=""12345""        /&gt;</code></pre><p>Where custom_view.xml is:</p><pre><code>&lt;blah.CustomView ...&gt;    ...&lt;/blah.CustomView&gt;</code></pre><p>When I try to do that, CustomView.java does not get ""app:customAttr"" in the AttributeSet.</p><p>When I use CustomView directly, without ViewStub</p><pre><code>&lt;blah.Custom app:customAttr=""12345""/&gt;</code></pre><p>The attribute gets into the AttributeSet ok.</p><p>But it's not lazy anymore.</p><p>Any solutions?</p><p>Thank you,Yuri.</p>","375225","","","","","2012-04-21 02:56:28","ViewStub with custom View attributes for target layout","<android><custom-attributes><viewstub>","1","0","","",""
"3110024","1","","","2010-06-24 12:47:29","4","1584","<p>I want to use Digital rights management (DRM) in my application.</p><p>Isn't there source that uses DrmStore?</p><p><a href=""http://developer.android.com/reference/android/drm/package-summary.html"" rel=""nofollow"">http://developer.android.com/reference/android/drm/package-summary.html</a></p>","366851","","568613","","2011-05-26 05:05:23","2011-05-26 18:46:08","android: i want to use DRM in Market","<android><drm>","1","2","","",""
"3110102","1","3110871","","2010-06-24 12:58:49","0","563","<p>After I Bind to a service inside the </p><pre><code>onServiceConnected()</code></pre><p>method I start a <code>CountDownTimer</code>. The problem is that the timer does not start counting down.  I have gone through with the debugger and sure enough it is executing the method that starts the Timer.</p><p>If I use a button to start the timer it works!  What could I be doing wrong?</p>","248521","","","","","2010-06-24 14:30:04","CountDownTimer does not run after binding to a service","<android>","1","0","","",""
"3110135","1","3110933","","2010-06-24 13:02:48","1","135","<p>I'd like to be able to compile an Android app on my desktop, upload it to my phone and launch the app without having to plug in my phone via USB. I want this for 1) convenience when developing and 2) SD card access isn't available when plugged in.</p><p>One idea I had was to write an app that would download the app from the computer wirelessly (e.g. or via a website the app was uploaded to) and then launch the app. The APK doesn't need to be installed in this process, but if it did, I wouldn't want there to be any user interaction. Is this possible? I suspect it won't be because of security implications.</p><p>Are there any alternative ways to do this? I essentially want some way to do over the air updates for an application. Perhaps I can upload a single class file for the app that can be launched?</p>","369917","","","","","2010-06-24 14:35:24","I want build+launch new app builds without plugging in my phone. Is there a way to download and launch APK files from within an Android app?","<java><android><mobile>","1","0","","",""
"3110212","1","3110321","","2010-06-24 13:12:49","6","6878","<pre><code>&lt;EditText android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:layout_weight=""1""    android:id=""@+id/name"" android:singleLine=""true""    android:maxLength=""12"" android:capitalize=""none"" android:inputType=""text"" /&gt;&lt;Button android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/search_button""    android:text=""Search"" /&gt;</code></pre><p>I have this at the top of my application. When the application starts, the EditText is orange highlighted and has a cursor in it; when the EditText is tapped, the soft keyboard pops up. The user uses it to type into the EditText.</p><p>However, when they click the Button, my onClick method fires and does everything it's supposed to, however the soft keyboard stays on screen and the EditText is still highlighted with its cursor.</p><p>I also have, at the top of the Button onclick:</p><pre><code>findViewById(R.id.name).clearFocus();</code></pre><p>In spite of this, the EditText does not seem to clear its focus. How do I make the button actually act as if it is submitting the form?</p><p>Also, I do not transition to a different Activity on the click of the Button. I suppose that is the typical case, and probably the reason why they don't bother hiding the keyboard. However I want to keep the search box and button at the top of the screen, so I just dynamically fill and add views to the screen when the Button is pressed.</p><p>How can I achieve my desired behavior?</p>","47493","","","","","2010-06-24 13:25:17","Android: EditText and Button; when click Button, unfocus EditText and hide soft keyboard?","<android>","1","0","3","",""
"3110219","1","","","2010-06-24 13:13:41","0","272","<p>I have a string that contains a xml structure and there are two pieces of data in separate tags that I am after.</p><p>xpath has been added since API level 8, and with me being stuck with API level 3 (old phone for you ;-)) I need a way to get the data.</p><p>Would using a regular expression commit a huge sin? ;-)  The xml isn't that big...</p><p>Looking for some guidance on what to.</p><p>Many thanks!</p>","375288","","20938","","2010-09-20 16:40:32","2010-09-20 16:40:32","Getting values from XML in Android (API Level 3)","<android><xml><regex><xpath>","1","0","","",""
"3110223","1","3110397","","2010-06-24 13:14:03","4","22685","<p>From where i get Android 1.5 and  1.6 Calendar Source code.</p><p>thanks.</p>","309990","","648313","","2011-07-13 21:00:07","2014-01-30 06:45:09","Calendar source code","<android><calendar><android-source>","4","0","2","",""
"3110485","1","3110992","","2010-06-24 13:43:56","6","3491","<p>I need to define the structure of ExpandableListView in xml file manually. Is there any guide or example of doing this?</p><p>Thanks</p>","218783","","","","","2012-01-03 17:07:01","ExpandableListView definition in xml","<android>","1","0","3","",""
"3110689","1","","","2010-06-24 14:07:16","2","881","<p>This will be my first time signing application using Keytool and Jarsigner.</p><p>I run my apk through the market signing process, step by step as it is explained in android official site </p><p><a href=""http://developer.android.com/intl/fr/guide/publishing/app-signing.html"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/publishing/app-signing.html</a> </p><p>Signed process finished with success apk created. Installation of this apk on Nexus One also passed, but when I try to launch it from Nexus One, I got Permission Denial error !! </p><p>Please help </p><p>I add here a complete error: BTW I run my tests from apk because they are written with Instrumentation.</p><p>==================</p><p>INSTRUMENTATION_STATUS: id=ActivityManagerServiceINSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=4598, uid=4598 not allowed because package com.android.phonetests does not have a signature matching the target com.android.phoneINSTRUMENTATION_STATUS_CODE: -1</p><p>Ilana</p>","268121","","102937","","2011-06-14 16:58:05","2011-06-14 16:58:05","Help me to sign my application apk file","<android><permissions><jdk>","1","8","1","",""
"3110868","1","3110924","","2010-06-24 14:29:48","2","8360","<p>I've got a query, (I'm using <code>rawQuery()</code>)</p><pre><code>  SELECT * FROM &lt;table&gt;</code></pre><p>I'm then storing what it returns using a cursor. From their what I want to do is, start at the first row so.. <code>cursor.moveToFirst()</code> then take each column , column by column and store its particular value in a variable. I then want to move onto the next row and do the same. So I guess my question is How would I get cursor to deal with multiple columns?</p><p>Thanks,</p>","358438","","301832","","2010-07-21 10:01:17","2011-09-11 08:44:33","Android SQLite Query and using cursor to deal with multiple rows","<java><android><sqlite><cursor>","1","0","","",""
"3110927","1","3111279","","2010-06-24 14:35:10","3","5630","<p>Is there a way to get the first visible View out of the ListView in Android? </p><p>I can get the data that backs the first View in the Adapter but it seems I can't get the first View in ListView.</p><p>I want to change the first visible view after a scroll action finished. I know that I should not save references to the view.</p>","114066","","114066","","2012-01-27 08:48:58","2012-01-27 08:48:58","How to get the first visible View from an Android ListView","<android><android-listview>","2","2","1","",""
"3110949","1","3279108","","2010-06-24 14:36:44","1","3252","<p>I couldn't find this question already being asked on this forum.I am little short on time to search anymore.</p><p>I have a multi-column ListView with three TextViews.I need to have header for each of the column. I am using Android 1.5 SDK.</p><p>Can somebody help me here. I can't use addHeaderView since it adds just one view which would contain just one title string.</p><p>ThanksNayn</p>","183871","","183871","","2010-06-24 15:10:44","2012-09-04 06:11:10","How to add header to Multicolumn ListView","<android>","2","2","0","",""
"3110972","1","","","2010-06-24 14:38:29","2","1978","<p>I'm new to Android programming.My requirement is to call an HTTP request via HttpClient.Below is the code :</p><p>public class ClientWithResponseHandler {  public final static void main(String[] args) throws Exception {</p><pre><code>     HttpClient httpclient = new DefaultHttpClient();     HttpGet httpget = new HttpGet(""http://www.google.com/"");      System.out.println(""executing request "" + httpget.getURI());     // Create a response handler     ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();     String responseBody = httpclient.execute(httpget, responseHandler);     System.out.println(responseBody);     System.out.println(""----------------------------------------"");     // When HttpClient instance is no longer needed,      // shut down the connection manager to ensure     // immediate deallocation of all system resources     httpclient.getConnectionManager().shutdown();         }</code></pre><p>}</p><p>After executing the above code as a Java Application i get the below error in the console.</p><hr><p>#</p><h1>A fatal error has been detected by the Java Runtime Environment:</h1><p>#</p><h1>Internal Error (classFileParser.cpp:3174), pid=7288, tid=7476</h1><h1>Error: ShouldNotReachHere()</h1><p>#</p><h1>JRE version: 6.0_20-b02</h1><h1>Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )</h1><h1>An error report file with more information is saved as:</h1><h1>C:\Sandeep\eclipse\workspace\HelloWebService\hs_err_pid7288.log</h1><p>#</p><h1>If you would like to submit a bug report, please visit:</h1><h1><a href=""http://java.sun.com/webapps/bugreport/crash.jsp"" rel=""nofollow"">http://java.sun.com/webapps/bugreport/crash.jsp</a></h1><p>#</p><hr><p>Any idea what could be the problem</p><p>RegardsSandeep</p>","165032","","","","","2013-07-25 07:32:52","Internal Error (classFileParser.cpp:3174), pid=7288, tid=7476","<android>","4","1","1","",""
"3111236","1","3118526","","2010-06-24 15:07:30","0","1571","<p>I downloaded a file with an app and stored it inside of its internal storage, but the file is set with <code>-rw-------</code> and I want to change those permissions so is it possible? I know that using external storage is an option but I want to know if I can do it with internal storage too. Thanks for the help.</p><p>Edit:If it turns out that I can't change the permission is there some shared region of internal storage that I could use? I would like to not force the Android device user to have an SD card.</p>","340","","340","","2010-06-24 15:25:13","2010-06-25 13:49:44","Is it possible to change the permission on files in an Android app's internal storage?","<android><file-permissions>","2","0","","",""
"3111354","1","11060114","","2010-06-24 15:20:42","7","8969","<p>I have a list view full of items, after the users selects an item it lights up, and then it goes back to normal. Is there a way to make it so that when the user selects an item in my ListView it stays selected, and highlighted?</p>","242769","","321731","","2013-11-03 00:26:17","2014-02-21 14:53:21","Android ==> ListView stay selected?","<android><listview><highlight>","4","1","1","",""
"3111362","1","","","2010-06-24 15:22:04","9","3229","<p>application (non-wanted) behavior - </p><ol><li>application is started, some text is put into text-box and notification is created through button action. </li><li>user ""clicks"" the home button, application is ""minimized"", notification is available in bar</li><li>user selects the notification and the application is ""maximized""</li></ol><p>BUT - instead of the original instance, new instance is started (e.g. in the newest instance is missing the original text; when the latest instance is closed there is still the original instance with original text ) .</p><p>the code of the notification method</p><pre><code>Context context = getApplicationContext();    CharSequence contentTitle = ""someText1"";    CharSequence contentText = ""someText2"";    Intent notifyIntent = new Intent(Intent.ACTION_MAIN);    notifyIntent.setClass(getApplicationContext(), RadioStream.class);    PendingIntent intent =        PendingIntent.getActivity(RadioStream.this, 0, notifyIntent, 0);    notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);    mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);</code></pre><p>i have also in the manifest xml file following tag</p><pre><code>android:launchMode=""singleTask""</code></pre><p>but it is still the same...The main problem is double/triple initialization of the application, i know that there are other means to preserve the values in resumed applications.Also it is needed that the applications stays running in background as the main functionality is the streaming of internet radio.</p><p>What is missing in the code ? What kind of information from my side is missing for to troubleshoot the issue ?</p><p>Thanks!</p><p>Dav</p>","375418","","13803","","2010-06-24 16:51:28","2013-03-18 11:27:44","Prevent new activity instance after clicking on notification","<android><activity><instance><notifications>","5","1","","",""
"3111580","1","3114444","","2010-06-24 15:47:17","11","2767","<p>We're evaluating Sencha Touch for mobile development. Has anyone used this yet (I realize that it's still in beta), and if so, what are its strengths / weaknesses? How does it compare to alternatives?</p><p>It certainly sounds compelling.</p><p>Thanks!</p>","112194","","112194","","2010-06-24 15:52:29","2011-08-30 07:56:29","Is anyone using Sencha Touch for mobile development?","<iphone><android><sencha-touch><sencha>","4","0","2","","2010-06-24 15:59:47"
"3111632","1","","","2010-06-24 15:53:23","1","729","<p>I have a strange situation:On a screen, I have the following string to click on: ""1 Year Basic License ($15.00)""</p><p>But the following code give me some headache:assertTrue(solo.searchText(""1 Year Basic License ($15.00)""));solo.clickOnText(""1 Year Basic License ($15.00)"");</p><p>The test fails on the clickOnText statements! saying (in the log):1 Year Basic License ($15.00) not found. Have found: 1 Year Basic License ($15.00)</p><p>Can someone give me some hint to understand what's happening...</p><p>Regards,Alban.</p>","306839","","","","","2010-06-24 20:27:18","Robotium: searchText vs clickOnText","<android><unit-testing><robotium>","1","0","","",""
"3111636","1","","","2010-06-24 15:53:55","2","544","<p>Is there any DOM event in Webkit associated to trackball events (movement and pressing)?</p><p>Or is there any other way to handle those events from a webpage?</p>","28855","","","","","2010-06-28 01:35:52","How to handle Android trackball events from a web page?","<android><dom><event-handling><webkit><trackball>","1","0","","",""
"3112008","1","3701965","","2010-06-24 16:41:45","16","7897","<p>I have a service running that updates a notification in the notification bar when it recieves a message saying it has to be changed.</p><p>However I get the following error sometimes when the notification is to be updated</p><pre><code>java.lang.IllegalArgumentException: contentIntent required</code></pre><p>Here is my code:</p><p>Variable setup</p><hr><pre><code>int icon = R.drawable.notification;CharSequence tickerText = ""Test"";long when = System.currentTimeMillis();PendingIntent contentIntent;Notification notification = new Notification(icon, tickerText, when);NotificationManager mNotificationManager;</code></pre><hr><p>NotificationManager Creation</p><hr><pre><code>    String ns = Context.NOTIFICATION_SERVICE;    mNotificationManager = (NotificationManager) getSystemService(ns);</code></pre><hr><p>Notification Creation</p><hr><pre><code>    Intent notificationIntent = new Intent(this, TestsApp.class);    contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    notification.flags |= Notification.FLAG_NO_CLEAR;    notification.icon = R.drawable.notification3;    notification.setLatestEventInfo(this, ""Registering"", ""Test"", contentIntent);    mNotificationManager.notify(1, notification);</code></pre><hr><p>Update of Notification</p><hr><pre><code>    notification.icon = R.drawable.notification2;    notification.setLatestEventInfo(getApplicationContext(), ""Registered"", ""Test"", contentIntent);    mNotificationManager.notify(1, notification);   </code></pre><hr><p>So something is happening my contentIntent somewhere along the line, would that be correct?</p><p>It is declared at the top of my Service class as a member variable and is not used anywhere else in the code apart from shown above, so where could it be getting reset to null? </p>","243999","","","","","2013-06-15 21:26:10","Android - java.lang.IllegalArgumentException: contentIntent required error caused by notification?","<android><notifications><illegalargumentexception>","3","0","1","",""
"3112210","1","","","2010-06-24 17:04:31","5","1554","<p>I don't understand why i need to add WAKE_LOCK permission to the application manifest when I toggle wifi with setWifiEnabled... Any idea ?</p>","164460","","","","","2010-06-24 17:14:24","android wifi permission","<android><wifi>","1","2","","",""
"3112283","1","","","2010-06-24 17:16:50","3","1518","<p>I have an Ant build script for my Android project. I’m using aapt to package various resource files. I want the resources files to be uncompressed. I ‘ve tried the ‘-0' flag but the files still get compressed! But when I build through Eclipse, the resource files are uncompressed. Why doesn’t this flag work?</p><p>Here is my aapt target in Ant:</p><p>  Packaging resources and assets...                                               </p>","375509","","","","","2011-02-22 23:21:11","aapt always compresses resource files","<android><ant><aapt>","2","0","2","",""
"3112284","1","","","2010-06-24 17:16:59","15","6566","<p>I'm writing a graphically intense game for the Nexus One, using the NDK (revision 4) and OpenGL ES 2.0.  We're really pushing the hardware here, and for the most part it works well, except every once in a while I get a serious crash with this log message:</p><p>W/SharedBufferStack(  398): waitForCondition(LockCondition) timed out (identity=9, status=0). CPU may be pegged. trying again.</p><p>The entire system locks up, repeats this message over and over, and will either restart after a couple minutes or we have to reboot it manually.  We're using Android OS 2.1, update 1.</p><p>I know a few other people out there have seen this bug, sometimes in relation to audio.  In my case it's caused by the SharedBufferStack, so I'm guessing it's an OpenGL issue.  Has anyone encountered this, and better yet fixed it?  Or does anyone know what's going on with the SharedBufferStack to help me narrow things down?</p><p>Thanks in advance!</p><p>~ Kim</p>","375511","","","","","2012-12-18 05:43:54","Nexus One / Android ""CPU may be pegged"" bug","<android><android-ndk><nexus-one>","4","6","6","",""
"3112295","1","","","2010-06-24 17:19:51","5","8641","<p>I have simple list to be filled in from the database along with a checkbox. I need a handle to all the checkboxes selected. Whn the CLEAR button is pressed at that point I need the row ids of all the selected check boxes to delete them. To do this : My list.xml file 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:id=""@id/android:list""      android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_weight=""1""          /&gt;&lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/clearselected""        android:text=""CLEAR""        android:clickable =""false""/&gt; &lt;/LinearLayout&gt;</code></pre><p>and my data_entry.xml 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""&gt;          &lt;CheckBox           android:id=""@+id/CheckBox""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""          android:layout_x=""50px""           android:layout_y=""22px""&gt;&lt;/CheckBox&gt;&lt;TextView android:text=""@+id/EntryText""          android:id=""@+id/EntryText""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:textAppearance=""?android:attr/textAppearanceLarge""          android:textColor=""@color/blue""/&gt; &lt;/LinearLayout&gt;</code></pre><p>Now: I have  list.java file where I am populating the list as follows: </p><pre><code>private void populateList() {     Cursor c = db1.getAllList();      String[] fields = new String[]{db1.get_data()};       SimpleCursorAdapter cursorAdapter = new      ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.data_entry, c,          fields, new int[] {R.id.EntryText});     setListAdapter(adapter);}</code></pre><p>Now where do i give the handle to the heckbox cause anywhere else it would give me a null exception as the data_entry contains the checkboxes. Plus I need a listener to handle the checkbox status? I am just stuck at this point with no clue.. </p>","375504","","","","","2011-02-19 20:36:32","Android list and checkbox","<android>","1","0","2","",""
"3112340","1","","","2010-06-24 17:25:42","0","2353","<p>I have a tabhost with icon, when a tab is selected X, the icon does not appear because the icon is the same color as the selected tab. The question is:</p><p>How do I change the icon, when a tab is selected X?</p>","361352","","","","","2010-06-24 17:41:02","How do I change the icon, when a tab is selected X?","<android><android-tabhost>","2","0","","",""
"3112360","1","","","2010-06-24 17:27:47","1","1468","<p>I have a problem in the manifest when i try to use this library (com.google.android.maps) </p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.hellogooglemaps""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;uses-library android:name=""com.google.android.maps"" /&gt;        &lt;activity android:name="".HelloGoogleMaps"" android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar""&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-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt; </code></pre>","360037","","12707","","2010-06-24 18:36:33","2012-04-05 12:27:35","Error in AndroidManifest.xml","<xml><android><manifest><android-manifest>","2","5","1","",""
"3112644","1","","","2010-06-24 18:00:06","2","1176","<p>Specifically, how do I get it to pop up as the numbers entry screen but still be able to switch to letters? What I'd really like, ideally, is to have it act the same as if we had the xml property </p><pre><code>&lt;EditText    ...    android:inputType=""textShortMessage""/&gt;</code></pre><p>but come up on the number entry screen (the one you get by clicking ""?123"") on first showing, rather than the usual qwerty one. I've tried doing eg </p><pre><code>&lt;EditText    ...    android:inputType=""textShortMessage|number""/&gt;</code></pre><p>but all that does is default it to the phone-number-entry screen with no option to enter letters. Any ideas?</p>","367836","","","","","2013-01-18 03:14:15","How to force the Android Mobile keyboard to numbers?","<android><keyboard>","2","0","2","",""
"3112671","1","3112829","","2010-06-24 18:04:34","39","34218","<p>I need to check my application for memory leaks, i also need to see the memory allocation of my application.I downloaded and installed eclipse memory analyzer, and it looks like the first step is to open a heap dump.But what is a heap dump, how can i create a heap dump.And how exactly am i going to use this software, I did some googling but i couldn't find any useful information thanks</p>","242769","","","","","2011-11-05 10:46:41","Android ==> Memory Analysing ==> Eclipse memory analyzer?","<android><eclipse><heap-dump><memoryanalyzer>","4","1","21","",""
"3112705","1","3113076","","2010-06-24 18:10:36","0","382","<p>I am new in android in windows so where do i start learn and work with android?</p><p>what are all the things i need to do?</p><p>how start work with android, i need proper guide ?</p><p>Thanks in advance.</p>","334369","","","","","2010-06-24 19:00:44","I am new in android in windows so where do i start work with?","<android>","3","0","","",""
"3112944","1","3113000","","2010-06-24 18:41:24","1","585","<p>To be able to write ""nice"" code between my application/activies and a local service I need to understand some basic Android concepts:</p><p>What I'm wondering is if my application (as in my activities) and my local service is sharing one thread. I.e. when the activities and the local service executes tasks queued are these tasks interleaved in ONE thread thus sharing the thread or does the service has a thread of its own?</p><p>Also if the local service shares the thread with the activities and the local service makes a direct call (via a callback) to one of the activities (i.e. no post message) is the activity thread ""halted"" or is the execution of that specific function queued to be executed later anyway?</p><p>/ Henrik</p>","226342","","","","","2010-06-24 18:49:10","Does my local service spawn another thread?","<android><multithreading><service>","1","0","","",""
"3113106","1","3113110","","2010-06-24 19:06:32","21","3168","<p>Is there any code that gives an example about how to implement the Quick Actions and Popdown menu that is displayed in the Twitter for Android app? </p>","6391","","6391","","2013-08-08 19:28:38","2013-08-08 19:28:38","How to make Twitter app style Quick Actions on Android","<android><user-controls><android-view><popupwindow>","1","0","7","",""
"3113227","1","","","2010-06-24 19:22:20","0","465","<p>How can I play a sound in an activity without requiring the press of a button? I already know how to play the sound, but need to bypass the onClickListener. Thanks for any advice.</p>","276503","","","","","2010-06-24 19:26:17","Play sound without onClickListener","<android>","1","0","","",""
"3113463","1","3113530","","2010-06-24 20:01:53","3","81","<p>Is the android:id=""@+id/somevalue"" specific to the xml file in which it is defined, or the whole android project?</p><p>If it is project-wide, it seems like I have a lot of id's to come up for text fields. For example I have to name my ""title"" field like ""title1"" and ""title2"" etc...</p>","74865","","","","","2010-06-24 20:12:25","Is android:id specific to xml file or the whole project?","<android>","1","0","2","",""
"3113465","1","14684249","","2010-06-24 20:01:57","3","1308","<p>I've got this odd problem which is happening on 1.6, 2.2, and a MyTouch 3G Slide (which is API #7, and listed as ""2.1-Update1"" in the Android Device Chooser).  If anyone can explain what I'm doing wrong &amp; how to fix it (or possibly confirm that this is an Android bug), I'd greatly appreciate it!</p><p>The basic idea for my app is to make a stopwatch-sort of thing, in that the user can tap a button to start a timer, then tap it again to stop (pause) the timer; further taps alternate between resuming the timer and pausing the timer.</p><p>I've got a top-level ScrollView which contains a RelativelLayout, which contains a bunch of widgets.  The first widget is a HUGE button (so that it's easy to press), which pushes all my other widgets below the bottom of the screen.  This is intentional, as I want to rely on the ScrollView (and an on-screen reminder to the user) to make the rest of the input options available.</p><p>I've got a simple state-machine type setup, where mState is the current mode (STATE_TIMER_NOT_STARTED before the user presses any buttons, ...RUNNING after the first press, and then ...PAUSED after the second, back to ...RUNNING after the third, etc, etc).  </p><p>All this works great EXCEPT that when the timer is running, and the user presses the start/stop/resume button again, the ScrollView will scroll down a ways.  I am NOT issuing this command (I don't even have a reference to ScrollView object), and I'm not sure why it's doing this.</p><p>REPRO:Compile + run the below samples.  When the app starts, press the 'Start Timing' button.  Use your thumb (or the mouse) to touch-drag the screen upwards (so you can see the RatingBar), then drag it back downwards (so the button is again completely on-screen).  Tap the button (which now reads 'PauseTiming') again, and it'll jump down a bit.  It should NOT be jumping/scrolling down, since there's no statement (that I can see) that tells it to scroll down.  As near as I can tell, it's the setText that causes the scrolling ( when I comment those lines out, no scrolling occurs).</p><p>WHAT I'M ASKING FOR:If I'm doing something dumb &amp; you could point out what it is, I'd really appreciate it! :)<em>*</em>    I wonder if 'touch mode' might have something to do with this, since it does NOT appear to happen (in the emulator) when I use the mouse's scroll wheel to move the panel upwards (i.e.,instead of the simulated finger-dragging).  I can't find a whole lot on touch-mode, and nothing specific on focus/selection in touch mode within a ScrollView</p><p>If you can confirm that this error occurs for you too, that would be ok, too (since misery loves company.<em>AHEM</em> I mean, since it might help confirm that it's not just me :)   ).</p><p><b>MyTestApp.java</b></p><pre><code>package bug.android.scrollview;import android.app.Activity;import android.os.Bundle;import android.text.format.Time;import android.view.Display;import android.view.View;import android.view.WindowManager;import android.widget.Button;import android.widget.TextView;public class MyTestApp extends Activity {    public final static int STATE_TIMER_NOT_STARTED = 1;    public final static int STATE_TIMER_RUNNING = 2;    public final static int STATE_TIMER_PAUSED = 3;    private int mState;    Time t = new Time();    private Time data = new Time();    private Button btnStartStopResume;    private TextView lblSpacer;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.new_time_entry);        btnStartStopResume = (Button) findViewById(R.id.btnStartStopResume);        // Set the button's size so that the other info will also be visible        Display display = ((WindowManager) getSystemService(WINDOW_SERVICE))                .getDefaultDisplay();        // This is such a hack, but the windowScroller doesn't appear to        // have a height at this point in the lifecycle (nor in 'onResume' :( )        btnStartStopResume.setHeight(display.getHeight() - 200);        lblSpacer = (TextView) findViewById(R.id.lblSpacer);        reset();    }    public void doStartStopResume(View v) {        if (mState == MyTestApp.STATE_TIMER_NOT_STARTED) {            mState = MyTestApp.STATE_TIMER_RUNNING;            data.setToNow();        } else if (mState == MyTestApp.STATE_TIMER_RUNNING) {            mState = MyTestApp.STATE_TIMER_PAUSED;            String s = getString(R.string.add_scroll_down_to_add);            lblSpacer.setText(s);        } else if (mState == MyTestApp.STATE_TIMER_PAUSED) {            mState = MyTestApp.STATE_TIMER_RUNNING;        }    }    public void doReset(View v) {    }    public void doNewRunClick(View v) {    }    public void doAddTiming(View v) {    }    public void reset() {        mState = STATE_TIMER_NOT_STARTED;    }}</code></pre><p><b>new_time_entry.xml</b></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/windowScroller""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    &gt;        &lt;Button            android:id=""@+id/btnStartStopResume""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginBottom=""5dip""            android:text=""Start Timing""            android:textSize=""40dp""            android:height=""290dp""            android:onClick=""doStartStopResume"" /&gt;        &lt;TextView            android:id=""@+id/lblSpacer""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/btnStartStopResume""            android:layout_centerHorizontal=""true""            android:text=""@string/add_scroll_down_for_more"" /&gt;        &lt;TextView            android:id=""@+id/lblTimeStartLabel""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblSpacer""            android:layout_alignParentLeft=""true""            android:clickable=""true""            android:onClick=""adjustStartTime""            android:text=""Start of this run:""            android:textSize=""8dp"" /&gt;        &lt;TextView            android:id=""@+id/lblTimeStart""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblTimeStartLabel""            android:layout_alignParentLeft=""true""            android:clickable=""true""            android:onClick=""adjustStartTime""            android:text=""--:--:-- --""            android:textColor=""#FFFFFF""            android:textSize=""26dp"" /&gt;        &lt;TextView            android:id=""@+id/lblElapsedLabel""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblSpacer""            android:layout_alignRight=""@id/lblSpacer""            android:layout_marginRight=""5dp""            android:text=""Elapsed Time:""            android:textSize=""8dp"" /&gt;        &lt;TextView            android:id=""@+id/lblTimeElapsed""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblElapsedLabel""            android:layout_alignRight=""@id/lblSpacer""            android:layout_marginRight=""5dp""            android:textColor=""#99ff66""            android:text=""-- m -- sec""            android:textSize=""26dp""             android:layout_marginBottom=""10dip""/&gt;        &lt;CheckBox            android:id=""@+id/chkNewRun""            android:onClick=""doNewRunClick""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblTimeElapsed""            android:text=""This is a new run of timings""            android:layout_marginBottom=""10dip"" /&gt;        &lt;TextView            android:id=""@+id/lblIntensity""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Intensity (1 = none 5 = max)""            android:layout_below=""@id/chkNewRun"" /&gt;        &lt;RatingBar            android:id=""@+id/rbIntensity""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/lblIntensity""            android:numStars=""5""            android:rating=""2""            android:layout_marginBottom=""5dip"" /&gt;        &lt;TextView            android:id=""@+id/lblNotes""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Notes:""            android:layout_below=""@id/rbIntensity"" /&gt;        &lt;EditText            android:id=""@+id/txtNotes""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""@android:drawable/editbox_background""            android:layout_below=""@id/lblNotes""            android:layout_marginBottom=""10dip"" /&gt;        &lt;Button            android:id=""@+id/btnReset""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/txtNotes""            android:layout_alignParentLeft=""true""            android:layout_marginLeft=""10dip""            android:layout_marginRight=""10dip""            android:text=""Reset""            android:onClick=""doReset"" /&gt;        &lt;Button            android:id=""@+id/btnOk""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@id/txtNotes""            android:layout_toRightOf=""@id/btnReset""            android:layout_alignParentRight=""true""            android:layout_marginLeft=""10dip""            android:layout_marginRight=""10dip""            android:text=""Add Timing To List""            android:onClick=""doAddTiming"" /&gt;    &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre><p><b>strings.xml</b></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""app_name""&gt;Timer&lt;/string&gt;    &lt;string name=""dlg_edit_timing_title""&gt;Edit A Timing&lt;/string&gt;    &lt;string name=""add_scroll_down_for_more""&gt;&amp;lt; Scroll down for more options! &amp;gt;&lt;/string&gt;    &lt;string name=""add_scroll_down_to_add""&gt;&amp;lt; Scroll down to save this timing! &amp;gt;&lt;/string&gt;    &lt;string name=""start_timing""&gt;Start Timing\n\n&lt;/string&gt;    &lt;string name=""stop_timing""&gt;Pause Timing\n\n&lt;/string&gt;    &lt;string name=""resume_timing""&gt;Resume Timing\n\n&lt;/string&gt;&lt;/resources&gt;</code></pre><p><b>AndroidManifest.xml</b></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""bug.android.scrollview""    android:versionCode=""1""    android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".MyTestApp""        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=""5"" /&gt;&lt;/manifest&gt;</code></pre><p>UPDATE 1: Adding </p><pre><code>        if(  btnStartStopResume.isInTouchMode() )            Toast.makeText(this, ""TOUCH MODE"", 2000);        else            Toast.makeText(this, ""NOT touch mode"", 2000);</code></pre><p>then setting breakpoints in the debugger confirms that the button is always in touch mode (regardless of whether I finger-drag the panel up/down, or mouse-wheel it up/down).  So it's a combination of being in touch-mode AND finger-dragging the panel after the 2nd button-press (i.e, when the app is in 'stopped/paused timing' mode) that's causing the odd extra-timing in subsequent pauses.</p><p>UPDATE 2:I just noticed that it's scrolling down to the EditText, and no further.  It looks like when you move the panel down the EditText gets the selection, and after the click event the ScrollView scrolls back to the thing that has the selection.  Seems to explain why the mouse-wheel approach doesn't have this problem (it moves the selection/focus back up to the button).</p>","250610","","250610","","2010-06-26 00:25:12","2014-01-02 10:52:24","Why does TextView.setText cause the enclosing ScrollView to scroll?","<android>","2","1","1","",""
"3113532","1","3113635","","2010-06-24 20:12:38","1","1696","<p>In this code I request location updates from GPS</p><pre><code>locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER,20000, 1, gpsListener);</code></pre><p>But how can I make sure it listens for Wifi or Cell ID updates too?</p>","243782","","","","","2011-07-22 23:04:17","How to listen for location updates from multiple providers?","<android><locationlistener>","2","0","","",""
"3113586","1","","","2010-06-24 20:20:27","1","1296","<p>I'm trying to test a date picker scenario on android. I have the date picker which comes up when I click a text view(with id say v) which has a label on it along with a hint ""Enter Date"".</p><p>The problem is that I'm trying to simulate this clicking of the text view and then selecting of the date from the date picker dialog. I cannot find an method call/option in Solo to get hold of the text view (ex:with id say x).I've been trying to figure it out for the past three days.</p><p>Can anyone suggest me a way to go about it?.</p><p>Thanks </p><p>Prasanna</p>","375669","","21234","","2010-07-05 18:02:02","2014-03-05 04:33:44","Android Robotium - How to simulate a date picker with robotium Solo class","<android><robotium>","2","0","1","",""
"3113620","1","","","2010-06-24 20:26:59","0","129","<p>I'm trying to design a type of view but unsure what is possible and the best approach. I'm trying to create a timetable type view with the following properties:</p><ol><li>Time 'row' across top vertically static and scrollable horizontally </li><li>Student(or day) 'column' on left side, horizontally static and scrollable vertically </li><li>'rows' for each student/day indicating classes at specific times, therefore not all uniform, but total will be = 1 day's worth of classes. </li><li>each row is split visibly into classes, width indicating duration, title shown in text. </li><li>Must be able to detect any given class 'touched' </li><li>'Rows' must be scrollable (all-way) by touch/fling with time row and left column remaining on screen but scrolling in line with the class data </li><li>Number of rows is known when the activity is invoked </li><li>Data for classes is retrieved using a webservice </li></ol><p>I hope that's given an idea of what I'm trying to achieve. However I'm not sure where to start with this? I know I can't create anything directly out-of-the-box, so will need to create/override. (I do currently have all this done for a single student/day with single listview, each item a class, but obviously can't see all timetable in one go and scroll around.)</p><p>Do I try and create an all-way scrolling listview? Use a webview and build the timetable in html/js? Use a canvas and draw everything? </p><p>I've looked around and seen tutorials by you fabulous people for all those above but then I come to the point of how do I add 'freeze panes' for the row and column I need present at all times? Does anyone have any ideas that could help me? Any pointers would be very much appreciated. </p><p>Thanks.</p><p>Aus. </p>","375673","","","","","2011-06-22 07:53:42","Scrolling Views with static rows/cols","<android>","1","2","","",""
"3113676","1","","","2010-06-24 20:37:20","0","399","<p>Django <code>@login_required</code> views for JSON data API's used from iPad/iPhone/Android?</p><p>In my Django webserver, I have built JSON data API's that I want to access from mobile devices: iPad/iPhone/Android.  I'm using the iPad/iPhone ASIHttp Library.  How do I login users from an iPad/iPhone so my data API's can use the @login_required decorator?</p>","36680","","147019","","2011-06-30 04:55:06","2011-06-30 04:55:35","Django @login_required views for JSON data API's used from iPad/iPhone/Android?","<iphone><android><django><ipad><asihttprequest>","1","0","2","",""
"3113696","1","3113852","","2010-06-24 20:39:40","5","11032","<p>I have a problem with ArrayList. I'm using ArrayList like this:</p><pre><code>private ArrayList&lt;Playlist&gt; mPlaylists;</code></pre><p>where Playlist is a class inherited from another ArrayList.I do the following:</p><pre><code>p = new Playlist(...some parameters...);mPlaylists.add(p);</code></pre><p>Later, when I use 'p' to get the index in the list:</p><pre><code>int index = mPlaylists.indexOf(p);</code></pre><p>an index of '1' is returned, even though inspection of the list clearly shows that it's index '4'.</p><p>Does anybody know why this fails?Thanks.</p><p>B.R.Morten</p><p><strong>Edit:</strong>Same problem without indexOf(), using equals():</p><pre><code>private int GetIndex(Playlist playlist) {    for (int i = 0; i &lt; mPlaylists.size(); i++) {        if (mPlaylists.get(i).equals(playlist)) {            return i;        }    }    return -1;}</code></pre><p><strong>New edit:</strong>This WORKS!:</p><pre><code>private int getIndex(Playlist playlist) {    for (int i = 0; i &lt; mPlaylists.size(); i++) {        if (mPlaylists.get(i) == playlist) {            return i;        }    }    return -1;}</code></pre><p><strong>Solution:</strong>As suggested, I changed the Playlist class to not enherit from ArrayList, but rather keeping an instance privately. It turned out that I only had to implement 4 ArrayList methods.</p><p>This does the trick; Now indexOf() returns the correct object!</p><p>Thanks to all contributors!</p>","375693","","375693","","2010-06-24 21:55:48","2010-06-24 21:55:48","ArrayList indexOf() returns wrong index?","<java><android><arraylist>","4","7","1","",""
"3113812","1","3114466","","2010-06-24 20:57:11","13","7771","<p>I have this nice dialog view I set my UserInputDialog class to:</p><pre><code>    &lt;LinearLayout android:id=""@+id/LinearLayout01""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""vertical""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;TextView        android:id=""@+id/nameMessage""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""What is your name Captain?""        &gt;        &lt;/TextView&gt;        &lt;EditText        android:id=""@+id/nameEditText""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""18sp""        &gt;        &lt;/EditText&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""         android:layout_gravity=""center_horizontal""&gt;    &lt;Button        android:id=""@+id/okButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""OK""&gt;        &lt;/Button&gt;        &lt;Button android:id=""@+id/cancelButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Cancel""&gt;        &lt;/Button&gt;                   &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I want my dialog to show up but for the background to not fade out.  Is this possible?  Cause the view that calls this dialog has a neato background I would like to be shown as a backdrop to the dialog.</p><p>I found this online:</p><pre><code>&lt;style name=""doNotDim"" parent=""@android:style/Theme.Dialog""&gt;    &lt;item name=""android:backgroundDimAmount""&gt;0&lt;/item&gt;&lt;/style &gt;</code></pre><p>but not sure how to apply that to my dialog?  I have a class called <code>public class UserInputDialog extends Dialog implements OnClickListener</code>.  It sets its content view to the layout described above.</p><p>I think I am doing this all right, just not sure how to add that style so I can NOT fade the background.  </p><p>Secondary question:  Can you get new looks on your dialog (by say having an image or icon display with your text there) by using Themes?</p>","327258","","105971","","2011-11-24 14:08:04","2012-11-22 00:29:29","Calling android dialog without it fading the background","<android><dialog><views>","3","0","7","",""
"3113813","1","3114014","","2010-06-24 20:57:14","1","752","<p>i am quite new to android and i was wondering how i could go about adding a listview with different images and text. What i am trying to achieve is a listview with four rows which have a different Icon? I don't know how to set that up using the xml layout provided. should i build this using different multiple linear layout or is there a better way to go about it?.. All the examples i have seen all seem to be using one particular Icon and no much detail of the xml layout. Any help will be greatly appreciated. Thank you</p>","316843","","","","","2010-06-24 21:28:17","Hello adding different images to rows in a ListView","<android>","1","1","","",""
"3114154","1","3134086","","2010-06-24 21:49:49","3","2407","<p>Hello I've already read quite a bit about the CheckBox/ListView problems in Android.  So I've tried a number of issues.</p><p>To start my layout for a row 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""&gt;        &lt;CheckBox             android:id=""@+id/check""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:focusable=""false""            android:focusableInTouchMode=""false""             android:text="""" /&gt;    &lt;/LinearLayout&gt;</code></pre><p>So then I tried adding this to my ListActivity</p><pre><code> ListView listview = getListView(); listview.setItemsCanFocus(false);</code></pre><p>And then attempted to run it with a breakpoint on onListItemClick, still no hit (running debugging of course).</p><p>This is my onListItemClick in case you want to see.</p><pre><code>@Override    protected void onListItemClick(ListView l, View v, int position, long id) {        // let's find the checkbox we're on.        CheckBox targetCheckBox = (CheckBox) l.findViewById(R.id.check);        // ok update the database with the new data.         mDbHelper.updateNote(id, !targetCheckBox.isChecked());        // update the list now.        showList();    }</code></pre><p>If I then change the Checkbox to CheckTextView, it does work, however I've never done that before, and I'd rather figure out exactly what's wrong here when other people have solved this.  Any Thoughts?</p>","511852","","","","","2010-06-28 16:10:14","Using a checkbox with a false focusable, still prevents listview clicks","<java><android><listview><checkbox>","1","2","1","",""
"3114179","1","4080693","","2010-06-24 21:53:19","1","6383","<p>I have a TableLayout with three columns that represents a form with </p><p>requiredSymbol | label | inputfield.</p><p>I want the input field to fill the remaining width of the screen right to the label. So far the only solution I found is this</p><pre><code>&lt;TableLayout android:layout_height=""wrap_content""       android:layout_width=""fill_parent""        android:stretchColumns=""2""&gt;    &lt;TableRow&gt;                    &lt;TextView android:text=""@string/requiredSymbol""                              /&gt;     &lt;TextView android:text=""@string/Name""                              android:textColor=""@color/orange""                              android:gravity=""left|center_vertical""         /&gt;     &lt;EditText android:id=""@+id/contactName""         android:inputType=""text|textPersonName""                              android:ellipsize=""end""                            android:singleLine=""true""                            android:scrollHorizontally=""true""                            android:maxWidth=""1sp""                            /&gt;    &lt;/TableRow&gt;</code></pre><p>The maxWidth needs to be there are some value, which is actually ignored. Then the stretchColumns value does its thing nicely. Note that this also works if the content of the EditText would otherwise make the table span beyond the screen border (imho a bug..). </p><p>This works nicely now but seems a little bit of a hack to me. Is there a better way?</p>","136445","","","","","2012-03-31 10:06:58","TableLayout column sizing","<android>","4","0","","",""
"3114211","1","3168254","","2010-06-24 22:00:35","4","1087","<p>I'm just trying to display an icon of a man with a circle under his feet in the center of the MapView. Here's my Overlay code:</p><pre><code>public class CenterOverlay extends Overlay{    private Drawable    d;    public CenterOverlay(Drawable drawable)    {        final int w = drawable.getIntrinsicWidth();        final int h = drawable.getIntrinsicHeight();        drawable.setBounds(0, 0, w, h);        this.d = drawable;    }    @Override    public void draw(Canvas canvas, MapView mapView, boolean shadow)    {        final int mapCenterX = mapView.getWidth() / 2;        final int mapCenterY = mapView.getHeight() / 2;        final int x = mapCenterX - d.getIntrinsicWidth() / 2;        final int y = mapCenterY - d.getIntrinsicHeight();        drawAt(canvas, d, x, y, shadow);    }}</code></pre><p>The code to add the Overlay to the MapView is working fine (I can see the icon right where it's supposed to be). The problem is that the automagically generated shadow is in the wrong spot (about the icon's width to the left, and about halfway up the icon).</p><p>Thanks in advance for your help!</p>","375735","","","","","2010-07-02 18:33:09","Why is the shadow of my MapView Overlay in the wrong place?","<android>","1","0","2","",""
"3114351","1","3544527","","2010-06-24 22:22:46","1","483","<p>Mac OSX 10.6.4Nexus One Android 2.2The command adb devices will list my emulators and also my Droid Eris (Android 2.2) but nothing shows for the Nexus One</p><p>I have searched extensively and failed to find any answer or suggestions, any help most welcome</p>","375754","","","","","2010-08-23 20:10:18","I cannot get ADB to see my Nexus One device","<android>","1","0","","",""
"3114381","1","3114470","","2010-06-24 22:30:11","5","1253","<p>It's good to have consistency in file names.</p><p>MyActivity.java contains the public class MyActivity</p><p>I would like the xml file with its layout to be called res/layout/MyActivity.xml</p><p>But I get an error message saying ""Invalid file name: must contain only [a-z0-9_.]""</p><p>So two questions:</p><ol><li><p>Why is the character set so limited (not even upper case?  Come on!)  - Ah - this restriction is probably in place so you will never be screwed by filesystems that don't make a distinction between upper and lower case, like Apple's HFS+ (although see Wikipedia for the gory story <a href=""http://en.wikipedia.org/wiki/Comparison_of_file_systems#cite_note-note-35-77"">http://en.wikipedia.org/wiki/Comparison_of_file_systems#cite_note-note-35-77</a> )</p></li><li><p>Which filenames are restricted - all of res?  just res/layout?   res/layout plus some other folders?</p></li></ol><p>Can anyone confirm 1, and give details on 2?</p><p>Thanks,</p><p>Peter</p>","253661","","10311","","2010-06-25 01:34:30","2012-12-27 07:04:15","Why are Android layout file names so limited?","<android><file><names>","2","0","","",""
"3114471","1","3367231","","2010-06-24 22:50:05","16","15618","<p>Is it possible to open the music app from my app in android, or is it best to write a whole new music app inside of mine. I would rather use theirs since the user will already be comfortable with it.</p>","282475","","282475","","2010-07-29 21:50:26","2011-05-28 18:31:41","Android launching music player using intent","<android><music>","3","0","7","",""
"3114492","1","","","2010-06-24 22:54:58","3","1069","<p>I apologize if this is a stupid question, nevertheless I need to ask.  I am new to Android development and have gone through every single tutorial and reference provided.  I have been doing great, with the exception of one stupid problem; I cannot find where the databases for some apps are stored.</p><p>For example I would like to build my own app that includes thousands of pre-made records from an established SQLite Database.  As a reference I tried to use the ""Searchable Dictionary"" app from the provided programs in the Android SDK, but cannot find it.  </p><p>I read that all databases are stored in /data/data//databases on the device, but I cannot find this location.  So how would I access the database in Eclipse or anywhere else for that matter to set up my pre-configured database?</p><p>Thanks so much!</p>","375764","","","","","2010-06-25 03:45:14","Where I can access Databases in Eclipse for Android development?","<android><database><sqlite>","2","0","","",""
"3114523","1","3114557","","2010-06-24 23:01:44","1","1595","<p>I am working on creating an Action Bar like the one from the new Android UI Patterns and I am running into a bit of trouble.  I have a <code>ViewSwitcher</code> with two layouts in it.  When the user taps the search button I animate between the two layouts.  The problem is that the layouts are different sizes and I can't figure out how to make them take up the same amount of space.  Here's what I mean.  p.s. forgive the bad art, they are just place holders ;)</p><p>The red box is right up against the <code>ViewSwitcher</code> and there is a gap between that and the action bar for this layout:</p><p><img src=""http://i18.photobucket.com/albums/b141/CasetB/one.png"" alt=""Gap""></p><p>but not this one:</p><p><img src=""http://i18.photobucket.com/albums/b141/CasetB/2.png"" alt=""No Gap""></p><p>What I want is to tell the layouts in the <code>ViewSwitcher</code> to be the same size.  How can I do this?</p>","236136","","","","","2010-06-26 03:31:34","Implementing Android Action Bar","<android><layout>","1","0","1","",""
"3114586","1","","","2010-06-24 23:16:08","0","866","<p>Thanks Google released 2.2 source code.</p><p>In this code-InstalledAppDetails.java </p><p>It shows how android 2.2 does the ""force close"" function.</p><pre><code>private void forceStopPackage(String pkgName) {    ActivityManager am = (ActivityManager)getSystemService(            Context.ACTIVITY_SERVICE);    am.forceStopPackage(pkgName);    checkForceStop();}</code></pre><p>However ""forceStopPackage"" method is not in ActivityManager class. <a href=""http://developer.android.com/reference/android/app/ActivityManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/ActivityManager.html</a></p><p>Is it a interneal API? Thanks.</p>","375771","","995926","","2012-05-05 13:33:54","2012-05-05 13:33:54","How does forceStopPackage work in Android 2.2 (Froyo)?","<android><android-2.2-froyo>","1","0","","",""
"3114606","1","","","2010-06-24 23:19:37","4","20930","<p>I need to create a random character generator that return a single character. The character should range within the letters of the alphabet, numbers 0 through 9, and some characters like ,.?/-. Any example would be appreciated.</p>","276503","","14357","","2010-06-25 12:51:49","2014-04-06 09:38:15","Random character generator with a range of (A..Z, 0..9) and punctuation","<java><android><random>","6","5","1","",""
"3114611","1","3118103","","2010-06-24 23:21:07","1","499","<p>As per the android developer docs for <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">creating tab UI</a> you need to have a TabHost and TabWidget and the TabHost must be the root node for the layout.</p><p>All perfect, I tried the example and everything's fine.</p><p>Just while looking at the API Samples of tabs, I came across tabs1.java (http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/Tabs1.html) which was not using any tab elements in the layout.</p><p>Here is the sample working code that creates a tab, without using any layout at all.</p><pre><code>public class HelloAndroid extends TabActivity implements TabHost.TabContentFactory  {  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TabHost tabHost = getTabHost();    tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""tab1"").setContent(this));  }  public View createTabContent(String tag) {    TextView text = new TextView(this);    text.setText(""tab1"");    return text;  }}</code></pre><p>Can anyone explain that how this is working ? And how this is different that using the Layout based approach as explained in the tutorial.</p><p>Thanks.</p>","109603","","","","","2010-06-25 12:50:03","Creating a tabbed UI without using Layout","<android><layout><tabs><android-tabhost>","1","0","1","",""
"3114669","1","3115040","","2010-06-24 23:34:20","1","1439","<p>In <a href=""http://code.google.com/intl/sv-SE/events/io/2010/sessions/developing-RESTful-android-apps.html"" rel=""nofollow"">Virgil Dobjanschi talk</a> during Google I/O he mentioned using <code>Services</code> for doing the fetching and then using a callback to notify the <code>Activity</code> when this was completed. He never went into specifics on how to implement this callback and I can't seem to find anything helpful on this topic anywhere.</p><p>I think he said that you didn't need to implement binding at all?</p><p>Any clues?</p>","253583","","","","","2010-06-25 01:41:25","Android and RESTful services","<android>","3","0","5","",""
"3114675","1","3115042","","2010-06-24 23:35:55","6","12709","<p>How can i make the background 50% transparent?<br>Let's say the background of an AbsoluteLayout so it's dark but you can still see through it?</p>","242769","","12707","","2010-06-25 00:17:24","2010-06-25 01:43:31","Transparent Background","<android><transparency><transparent>","1","2","4","",""
"3114713","1","3114757","","2010-06-24 23:48:25","0","624","<p>I have some preoblems when it comes to designing a view, As you can see I have open my xml file with a view-tag, and it gives me error. why is that? if I change it to LinearLayout than it works.</p><pre><code>&lt;View xmlns:android=""http://schemas.android.com/apk/res/android""class=""android.app.SearchDialog$SearchBar""android:id=""@+id/search_bar""android:layout_width=""match_parent""android:layout_height=""wrap_content""android:orientation=""vertical""android:focusable=""true""android:descendantFocusability=""afterDescendants""&gt;&lt;!-- Outer layout defines the entire search bar at the top of the screen --&gt;&lt;TextView     android:id=""@+id/search_badge""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginBottom=""2dip""    android:drawablePadding=""0dip""    android:textAppearance=""?android:attr/textAppearanceSmall""    android:textColor=""?android:attr/textColorPrimaryInverse"" /&gt;&lt;!-- Inner layout contains the app icon, button(s) and EditText --&gt;&lt;LinearLayout</code></pre>","371301","","","","","2010-06-25 00:04:16","View-tag dosen't work","<android><android-sdk-2.2>","1","0","","",""
"3114745","1","","","2010-06-25 00:02:42","10","6801","<p>I am trying to use R.layout.simple_list_item_multiple_choice with ListView.  CheckedTextView is used in simple_list_item_multiple_choice.xml, but how can I make the checkbox be left aligned instead of right aligned?  </p>","375791","","","","","2013-09-08 18:48:27","How do I make the Checkbox in Android CheckedTextView be left aligned instead of right aligned?","<android>","6","0","1","",""
"3114882","1","","","2010-06-25 00:42:59","3","777","<p>I have been trying to reset the tabs in a Tabhost of Android platform and every time I try to do I get some issue or other. </p><p>Below is  the code which I use:</p><pre><code>  if(reset)  {     tabHost.setCurrentTab(0);     //tabHost.clearAllTabs();     tabHost.getTabWidget().removeAllViews();  }</code></pre><p>I get the following exception: </p><blockquote>  <p>e01-06 07:31:48.287: WARN/System.err(1581): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.ViewRoot.checkThread(ViewRoot.java:2683)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.ViewRoot.requestLayout(ViewRoot.java:557)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.View.requestLayout(View.java:7918)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.View.requestLayout(View.java:7918)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.View.requestLayout(View.java:7918)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.View.requestLayout(View.java:7918)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.View.requestLayout(View.java:7918)  01-06 07:31:48.287: WARN/System.err(1581):     at android.view.ViewGroup.removeAllViews(ViewGroup.java:2146)  01-06 07:31:48.287: WARN/System.err(1581):     at com.t.android.m.setupTabs(CAndroidUI.java:97)  01-06 07:31:48.287: WARN/System.err(1581):     at com.t.android.m.DoRegistrationNotification(CAndroidUI.java:175)  01-06 07:31:48.287: WARN/System.err(1581):     at com.t.android.m.Handler$2.handleQchatServiceEvent(QServiceHandler.java:236)  01-06 07:31:48.287: WARN/System.err(1581):     at com.t.android.m.LStub.onTransact(ServiceCallback.java:62)  01-06 07:31:48.287: WARN/System.err(1581):     at android.os.Binder.execTransact(Binder.java:287)  01-06 07:31:48.287: WARN/System.err(1581):     at dalvik.system.NativeStart.run(Native Method)</p></blockquote><p>Could some one give me a clue on what's happening?</p>","227660","","1288","","2011-05-16 15:40:32","2011-05-16 15:58:35","How to clear the Tabs in a TabHost of Android?","<java><android>","1","1","","",""
"3114985","1","","","2010-06-25 01:23:20","0","1509","<p>I am doing some android application. I just wonder what will case the managedQuery method return a null value?</p><pre><code>  if (getIntent().getData() == null) {        getIntent().setData(Notepad.Notes.CONTENT_URI);    }    uri = getIntent().getData();    c = managedQuery(uri, PROJECTION, null, null, null);// return null value. </code></pre>","360257","","","","","2012-03-24 05:49:20","what case the managedQuery method return null if uri is provided?","<android><sqlite>","1","0","","",""
"3115085","1","3115094","","2010-06-25 01:56:30","4","1514","<p>Is there any way that a webpage can make a request for the users location from the android / iphone device ?</p><p>Since all I need is the users location, I am trying to figure out if there is anyway I can bypass developing a <b>native app</b> and use some nifty html5 call to just get the users location so all a user would need to do is visit my webpage and provide permission to access his/her location? </p>","59842","","","","","2010-06-25 01:59:41","can a webpage on a mobile browser ask/get users location from the phone?","<iphone><android><browser><html5>","2","1","1","",""
"3115299","1","","","2010-06-25 03:11:17","1","1802","<p>hi is there a way by which one can change the default voice (female) in the android tts? like if i want some other voice (male)?</p>","238505","","","","","2011-03-01 03:29:15","changing the default voice in android tts?","<android>","1","0","1","",""
"3115312","1","3250107","","2010-06-25 03:15:08","3","217","<p>I am developing a study project using the mosembro (mobile semantic browser) project inside my Android project.  I am using Eclipse and I created my project, downloaded / imported mosembro and included in my project's build path.</p><p>So now my code needs to refer to a resource in the mosembro's project.  I want to do something like this:</p><pre><code>String commonJS = getScript(R.raw.common);</code></pre><p>In this snippet, I want to load a javascript file from mosembro's project: <code>res -&gt; raw -&gt; common.js</code> so I need the java syntax to get ""R"" (precompiled resource-class) of Mosembro from my HelloGoogle project.</p><p>What is the syntax to replace the <code>R-class</code> of <code>this</code> with the included project's <code>R-class</code>.</p><p>Is that clear?</p>","157804","","157804","","2010-06-28 23:54:43","2010-07-14 20:17:13","How do I reference adk resource in a different Android project?","<java><android><resources><adk>","1","0","3","",""
"3115357","1","","","2010-06-25 03:28:09","2","1287","<p>I'm looking to make an android app that is basically a custom view of a text based gaming website. I know how to do HttpPosting and such, so sending login information is relatively simple. But my question is, how would I go about then navigating the site? I've never really worked with sessions and cookies on the client side. Is a cookie the right way to implement this? How do I pass the info back to the server when accessing subsequent pages?</p><p>I hope that makes sense</p>","375874","","","","","2011-02-24 09:39:59","Android app remain logged into website, cookies? Session?","<android><authentication><session><cookies>","1","0","3","",""
"3115419","1","","","2010-06-25 03:46:58","2","1253","<p>I can clear data or uninstall the app, but it never again asks for permission. I'm having trouble tracking down a bug because I can only test the bug conditions once per phone. :(</p>","92259","","","","","2010-06-25 12:26:06","How to clear an Android App's permission to use the authentication credentials of your account?","<android>","1","0","","",""
"3115493","1","3115504","","2010-06-25 04:13:33","0","895","<p>I am writing a count down timer, using .postdelayed(), that speaks each second as the timer goes down to zero. I have trouble understanding the consequences of the user hitting the back or home button.   The countdown continues when hitting either button.  When home is pressed and you reclick the app, it goes back to the same count(this is what i always want) and continues to count down.  When you hit the back key and then reclick the app, you get a new clock that has not started but I still here the sounds from the original timer.  How can I code an app so it only can have one instance and chicking the app icon will always go to the active version if it is running?</p>","293565","","","","","2010-06-25 04:17:45","a count down android timer back button vs home","<android><background><timer>","1","0","","",""
"3115509","1","3115518","","2010-06-25 04:18:58","12","17893","<p>I'm searching for a better Android XML layout editor than the one in eclipse. Preferable placing items by drag and drop to the correct X/Y position. With the current editor I have to try out figures to place it at the exact position ... is there an easier way ? (RelativeLayout is used)</p>","331556","","","","","2013-02-25 23:10:24","better Android XML Layout Editor than the one in Eclipse","<xml><android><eclipse><layout>","3","0","6","",""
"3115652","1","3117269","","2010-06-25 04:53:32","0","521","<p>I want o be able to add items to my layout, and set the exact position of these items.x,y,width,height.I am currently using AbsoluteLaout which is deprecated, is there any other layout that allows me to locate objects on the screen, by specifying their x,y?I also need to be able to read the x,y of all these objects on the screen.I already use getLeft(), and getTop().</p>","242769","","","","","2010-06-25 10:31:26","Android ==> Which layout should i use?","<android><layout>","1","5","","",""
"3115655","1","3732146","","2010-06-25 04:53:41","2","4555","<p>I am mostly a business programmer and I've not done anything in audio programming since the ZX Spectrum so I'm not sure how to even ask this question correctly.</p><p>I just need some pointers in the right direction with regards to writing (Android in this case, but it is really a general question) applications which deal with audio such as a Tone Matrix.</p><p>Are they based on generating lots of samples or are the tones generated on the fly?</p><p>Thanks</p>","316957","","","","","2013-01-28 10:54:06","Audio programming and tone synthesis","<android><audio><signal-processing>","3","0","","2013-07-08 19:54:16",""
"3115711","1","3116984","","2010-06-25 05:10:44","3","4317","<p>I am having gallery widget contains 1-10 images to slide. I know that when I stripe the screen , the images scroll from left to right. I want automatic circular gallery after 10 automatically start by first image, is there any automatic circular adapter or way ???</p><pre><code>         final Gallery g = (Gallery) findViewById(R.id.gallery);         g.setAdapter(new ImageAdapter(this));         Animation animation = AnimationUtils.loadAnimation(this,        R.anim.rotate_indefinitely);        animation.getInterpolator();        animation.setDuration(1000);        animation.setStartOffset(200);        animation.setRepeatMode(2);        animation.setFillAfter(false);        animation.setFillEnabled(true);        g.setAnimation(animation);        g.startAnimation(animation);</code></pre><p>but I only see the first image is animated ..</p><p>Take a look at my <a href=""http://vimeo.com/12817335"" rel=""nofollow"">Video</a> ...</p>","2438460","","2438460","","2010-06-25 07:05:13","2011-11-14 12:47:23","Android Automatic Circular Gallery","<android><android-animation><android-gallery>","2","0","4","",""
"3115724","1","3115738","","2010-06-25 05:14:50","1","158","<p>1-  I am an iphone application developer, all iphones have very similar Operating systems, and the size and everything is the same, so I don't need to create applications specific for each iphone.But with android there are different phones, different sizes, So How can i possibly know that my app works, and looks fine on all these devices</p><p>2-  I don't already own an android but i completed my first application using the simulator. Which android phone do u suggest for testing? I am an AT&amp;T user and i use an iphone. Can i simply insert my sim-card in the new android to be able to test my app on the device?</p>","242769","","","","","2010-06-25 09:26:57","Android ==> Aplication development?","<android><device><devices>","3","0","","",""
"3115732","1","","","2010-06-25 05:17:06","4","225","<p>there is any possible to implement php applications in android phone without using the web browser.if there then help me.thanks in advance.</p>","366916","","366916","","2010-06-25 05:47:32","2010-07-12 08:33:22","Android and php","<php><android>","4","1","1","",""
"3115758","1","3116554","","2010-06-25 05:26:41","0","1420","<p>I'm using the following code to populate listview</p><p>Oncreate method:</p><pre><code>SimpleAdapter adapter = new SimpleAdapter(this, list, R.layout.more_custom_row_view, new String[] {""title"",""desc""}, new int[] {R.id.text1,R.id.text2});populateList();setListAdapter(adapter);static final ArrayList&lt;HashMap&lt;String,String&gt;&gt; list = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;(); private void populateList() {   HashMap&lt;String,String&gt; temp = new HashMap&lt;String,String&gt;();   temp.put(""title"",""Previous Searches"");   temp.put(""desc"", ""View your search history"");   list.add(temp);   HashMap&lt;String,String&gt; temp1 = new HashMap&lt;String,String&gt;();   temp1.put(""title"",""Settings"");   temp1.put(""desc"", ""Update your account settings"");   list.add(temp1);}</code></pre><p>when i go to another activity and come back to this acitivity it duplicate list itemseach time any one guide me what mistake am i doing?</p>","249991","","114066","","2012-01-27 08:49:52","2012-01-27 08:49:52","Why do I get duplicate Items in my ListView?","<android><android-listview>","2","0","","",""
"3115817","1","3115828","","2010-06-25 05:44:32","2","6172","<p>I am writing to file in android and read from the same file using the below code:</p><pre><code>//Write data on fileFileOutputStream fOut = null;    OutputStreamWriter osw = null;    try {        fOut = openFileOutput(""gasettings.dat"", MODE_PRIVATE);        osw = new OutputStreamWriter(fOut);        osw.write(data);        osw.flush();        Toast.makeText(context, ""Settings saved"", Toast.LENGTH_SHORT)        .show();    }    catch (Exception e) {        e.printStackTrace();    }</code></pre><p>and the code for reading from file is:</p><pre><code>        InputStreamReader isr = null;fileInputStream fIn = null;    char[] inputBuffer = new char[255];    String data = null;    try {        fIn = openFileInput(""gasettings.dat"");        isr = new InputStreamReader(fIn);        isr.read(inputBuffer);        data = new String(inputBuffer);    }    catch (Exception e) {        e.printStackTrace();    }</code></pre><p>as per now I am only able to save a string to this file.I like to write a DATE array to it and also want to read back the data as array.I know that the return type of read method will be changed, but I am not getting the idea of how to read and write the DATE array or any other array to the file.</p><p>Thanks</p>","328518","","","","","2010-06-25 05:46:53","How to write/read array to file in android","<android><arrays><file>","1","0","","",""
"3115826","1","","","2010-06-25 05:46:04","0","756","<p>I am trying to produce a java front end, via some sort of Android ""view"" that will allow me to show the console output from a native C/C++ application binary.</p><p>I followed the steps from various google searches and I have a tool chain that produces native binarys that I can then ""adb push"" onto the android device.  I can either use the adb shell or a console application like ConnectBot to native to the pushed path and run the binary like so: ./someApplication.</p><p>However as I stated in my opening sentence I would like to wrap this binary with a font end producing an apk that can be loaded onto the phone and when it runs it opens up and directs the stdio output from the native binary to the screen.</p>","375936","","","","","2010-06-25 12:37:33","Native Android Application Java Front End","<android>","1","1","","",""
"3115856","1","","","2010-06-25 05:52:17","1","186","<p>This is the code that I use for my Listview which I got reference for some website. It shows a whole list of image. Which area do I have to place in my database to set the text for toptext and bottom text? </p><p>public class List_View extends ListActivity {</p><p>private DBAdapter db; </p><p>private TextView toptext;   private TextView bottomtext;  private ListView lv; </p><p>public void onCreate(Bundle savedInstanceState)     {   try{ </p><pre><code>super.onCreate(savedInstanceState); setContentView(R.layout.list); db = new DBAdapter(this); toptext = (TextView) findViewById (R.id.toptext); bottomtext = (TextView) findViewById (R.id.bottomtext); ArrayList&lt;HashMap&lt;String, String&gt;&gt; list = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();HashMap&lt;String, String&gt; item;for (int i = 0; i &lt; 31; i++) {        item = new HashMap&lt;String, String&gt;();        item.put(""Date:"", ""Saved Date"" );        item.put(""Title:"", ""Saved Title"" );        list.add(item);}SimpleAdapter notes = new SimpleAdapter(this, list, R.layout.view_list,                        new String[] { ""date"", ""title"" },                         new int[] {R.id.toptext, R.id.bottomtext });setListAdapter(notes);</code></pre><p>} catch(Throwable e){ </p><pre><code>        Log.e(""DBAdapter"",e.toString()); </code></pre><p>}      } </p><p>and this is the database part. </p><pre><code>public Cursor getAllEntry() {    return db.query(DATABASE_TABLE_2, new String[] {            KEY_ROWID2,            KEY_TITLE,            KEY_ENTRY,            KEY_MOOD,            KEY_DATE,            KEY_TIME},            null,             null,             null,             null,             null,             null);}</code></pre>","372750","","372750","","2010-06-25 06:26:29","2011-07-16 12:31:05","Database not shown in ListView, only the image","<android><listview>","1","2","","",""
"3115862","1","","","2010-06-25 05:53:22","0","298","<p>there is any possible to implement .net applications in android phone.Can u please give me link to learn it.</p>","334369","","","","","2010-06-25 06:00:23","Android and .net","<android>","3","1","","2012-06-25 15:41:27",""
"3115886","1","3170399","","2010-06-25 05:59:54","2","1917","<p>A couple of weeks ago i uploaded one of App which happens to be a widget. But from the time i uploaded it i have seen lots of cancellation. The only reason google gives me is this:</p><pre><code>You cancelled this order. Reason: Other (describe below) Message sent to customer: Cancellation requested from phone.</code></pre><p>I cant get heads or tail of it... Wat should i understand from this??? There are no feedback, neither any ratings... who is ""YOU"" here?? I suppose this is not a programming question but this has arised after a lot of programming... Did anyone else also get something like this from Google and know wat it exactly means?</p>","238071","","238071","","2010-06-25 09:33:14","2010-07-03 05:16:59","Android Market, Order Cancellation Reason - You cancelled this order","<android><order><google-play><cancellation>","1","2","","",""
"3115918","1","","","2010-06-25 06:07:38","4","19415","<p>How do I get an unique ID from an Android phone?</p><p>Whenever I try to get the unique ID from the phone as a string italways shows <em>android id</em> and no other unique hex values.</p><p>How do Iget that one?</p><p>This is the code I use to get the ID until now:</p><pre><code>String id=Settings.Secure.getString(contentResolver,Settings.Secure.ANDROID_ID);Log.i(""Android is is:"",id);</code></pre><p>the output which I get looks like this:</p><pre><code>Android id is: android id</code></pre><p>I am using a Nexus One for testing.</p>","336004","","418183","","2012-04-24 08:35:31","2012-04-24 08:55:22","Android unique id","<android>","5","2","8","",""
"3115956","1","","","2010-06-25 06:16:50","8","3607","<p>I use a TextView with links by this:</p><pre><code>TextView tv ... tv.setText( Html.fromHtml(somehtml)) </code></pre><p>It is ok to control the link color by setting attribute android:textColorLink, but can I remove the underline of it?</p>","361010","","241475","","2011-05-20 08:48:40","2011-08-08 00:37:01","Android TextView link without underline?","<android>","3","2","0","",""
"3115958","1","","","2010-06-25 06:17:23","0","108","<p>My droid works fine. The other two droids I've tried are never recognized by adb and don't debug. Debugging is turned on with all 3 of them.</p><p>What's the problem?</p>","92259","","","","","2010-06-25 09:36:18","Use multiple phones when developing for Android in Eclipse","<android>","3","1","","",""
"3116101","1","3117342","","2010-06-25 06:51:13","1","654","<p>I have two activities or ""screens"". </p><p>The second activity has an AlertDialogBox with radiobuttons for selecting a single option.</p><p>I want that after an option has been selected from the second activity's DialogBox, it should be displayed on the first activity screen in a text-view.</p><p>That is, suppose the user chooses ""Green"" from the dialogbox in the second activity, then ""Green"" should be displayed on the first activity screen.</p><p>Whats the way to pass a radiobuttonvalue to the textview?</p>","373049","","","","","2010-06-25 10:43:47","Passing a radiobutton value to the textview in android","<android>","1","0","","",""
"3116106","1","3116135","","2010-06-25 06:52:25","2","393","<p>What is the efficient way of blocking on the socket for data after opening it.The method i used is to call read on input stream (this is a blocking call that waits till some data written to this socket).</p><pre><code>//Socket creationSocketForCommunication = new Socket();InetSocketAddress sAddr = new InetSocketAddress(""hostName"", 8800);SocketForCommunication.connect(sAddr,10000);is = new DataInputStream(SocketForCommunication.getInputStream());os = new DataOutputStream(SocketForCommunication.getOutputStream());//Waiting on socket using read method for datawhile(true){    int data = is.read();    if(data == HEADER_START)    {        processPackage(is);    }}</code></pre><p>Here problem is read can timeout.Is there a way to register a callback that gets called when data available to read on socket.?</p>","110024","","","","","2010-06-25 07:00:01","Best way to block on a socket for data","<java><android>","2","0","","",""
"3116147","1","3122836","","2010-06-25 07:00:57","3","1712","<p>Is there an Intent URI that sends you to your phones favorite contacts?</p><p>Just like <em>content://contacts/people/</em> sends you to all your contacts and <em>tel:</em> sends you to your dialer.</p><p>EDIT</p><p>And is there also a way to go to your call log?</p>","355651","","114066","","2010-06-25 09:16:58","2012-01-11 02:07:39","Intent URI to go to favorite contacts","<android><android-intent>","1","0","2","",""
"3116152","1","3116185","","2010-06-25 07:01:40","1","1187","<p>While disconnectiong to the selected wifi AP, my WiFi is turned off.I want to keep my WiFi always turn on while disconnecting to the the selected AccessPoint and in the meantime WiFi is n't trying to connect to other AP also.Iam using Android 1.5.Is there any solution for this?</p><p>Regards,Rajendar</p>","362544","","","","","2012-02-27 23:00:58","How to keep my wifi always turn on?","<android><android-wifi>","1","0","2","",""
"3116171","1","","","2010-06-25 07:04:38","1","3652","<p>I am new to Android. I need to view one text on the screen. After thread sleep time I need to add another text on the screen. I have to show the text adding but my code display after all the append operation. How to show adding text one by one?</p><pre><code>public class dynamictextview extends Activity {    /** Called when the activity is first created. */    private TextView tv ;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tv = new TextView(this);        tv.setText(""Dynamic Text View Test\n"");        setContentView(tv);        for(int i=0;i&lt;10;i++)        {            tv.setDrawingCacheBackgroundColor(MODE_APPEND);            tv.append(""\nAttempt ""+i);            try {                Thread.sleep(500);            }            catch (InterruptedException e) {                e.printStackTrace();            }        }    }</code></pre>","373172","","63550","","2010-09-24 23:59:08","2013-09-06 06:48:44","Dynamic text view in Android?","<android>","3","0","","",""
"3116216","1","3117214","","2010-06-25 07:15:57","9","707","<p>I tried using actors in a small scala (2.8) app on android (2.1) today and I keep getting a really weird error referencing sun.misc.Unsafe.throwException.</p><p>I'm thinking that maybe the dalvik VM doesn't include this so Actors basically can't be used on android but I hope I'm wrong.</p><p>Did anyone manage to get actors working on android?</p>","353526","","","","","2012-05-19 15:41:21","Scala actors on android","<android><scala>","2","0","1","",""
"3116220","1","","","2010-06-25 07:17:08","2","739","<p>I am currently working on a java program that inserts excel data into android database(sqlite).</p><p>when i place the TestDB(sqlilte db) into c:drive it works.</p><pre><code>Connection con = DriverManager.getConnection(""jdbc:sqlite:C:\\TestDB"");</code></pre><p>But it won't work on android(emulator) database.The database have been created in android.</p><pre><code>Connection con = DriverManager.getConnection(""jdbc:sqlite://127.0.0.1:5554:/data/data/com.app.das/databases/TestDB"");</code></pre><p>i am guessing that the tcp is wrong.how do i go about fixing it?</p>","375977","","105224","","2010-06-25 07:21:39","2010-06-25 08:11:54","input data into android database","<java><android><tcp><database-connection><android-emulator>","1","0","","",""
"3116307","1","3141909","","2010-06-25 07:36:15","2","642","<p>I have a problem on going back (clicking the Back button) from sub-activity to main activity: from my main activity I launch a new one (with passing some extras):</p><pre><code>Intent i = new Intent(getApplicationContext(), SearchResults.class);i.putExtra(SearchResults.RESULTS_EXTRA_KEY, searchResult);i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(i);</code></pre><p>In the started activity I am getting data from extras and showing, etc. So everything works very well until I click Back button to return back to main activity. Then main activity appears but directly after - grays-out. I can't do anything there anymore... This ""grayed-out"" style looks something like there should be a dialog displayed, but there is no dialog shown, just the whole activity is pushed down/disabled instead...</p><p>One another interesting thing I noticed - that activity is still alive in background, because if I click ""Search"" button the Quick Search Box appears on top of my activity and if I click Back button then (to cancel it) - it disappears and my activity then becomes fully functional again (gray-out effect simply disappears...)</p><p>Tried watching <code>logcat</code>, but it shows nothing useful, no exceptions thrown, just this text always comes up:</p><pre><code>W/KeyCharacterMap(  564): No keyboard for id 0W/KeyCharacterMap(  564): Using default keymap: /system/usr/keychars/qwerty.kcm.bin</code></pre><p>What could cause this problem?</p>","283037","","","","","2010-06-29 14:56:43","Main activity grayed-out/disabled on Back button","<android><activity><subactivity>","1","1","","",""
"3116308","1","","","2010-06-25 07:36:16","0","856","<p>i am new to android. i connected my server to my application. I can connect to server. but i couldn't login into server. last week i can access my server in my application.</p><p>host is 66.203.93.247<br>post is 5222<br>service is sayagle</p><pre><code>ConnectionConfiguration connConfig = new ConnectionConfiguration(host,Integer.parseInt(port), service);XmppConn = new XMPPConnection(connConfig);</code></pre><p>when i login into server <code>XmppConn.login(username+""@""+service, password);</code></p><p>I got this error</p><hr><pre><code>java.io.IOException: Read error: Failure in SSL library, usually a protocol error[10:51:28 AM] saravanan: W/System.err( 2499): java.io.IOException: Read error: Failure in SSL library, usually a protocol errorW/System.err( 2499):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeread(Native Method)W/System.err( 2499):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$300(OpenSSLSocketImpl.java:55)W/System.err( 2499):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:524)W/System.err( 2499):    at java.io.InputStreamReader.read(InputStreamReader.java:438)W/System.err( 2499):    at java.io.BufferedReader.read(BufferedReader.java:311)W/System.err( 2499):    at org.kxml2.io.KXmlParser.peek(KXmlParser.java:876)W/System.err( 2499):    at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:557)W/System.err( 2499):    at org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:305)W/System.err( 2499):    at org.kxml2.io.KXmlParser.next(KXmlParser.java:1330)W/System.err( 2499):    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:368)W/System.err( 2499):    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)W/System.err( 2499):    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)</code></pre><hr><p>I got IllegalStateException also.</p><p>could you please anyone help to me?</p>","302314","","349909","","2010-06-25 07:46:58","2011-03-30 18:59:30","Android xmpp ssl library problem","<java><android><xmpp>","1","1","","",""
"3116342","1","","","2010-06-25 07:42:21","1","758","<p><em><strong>[Note that I can only reproduce the issue on the Android mobile web browser (used via emulator).]</em></strong></p><p><strong>Summary</strong></p><p>After clicking an anchor to go to the bottom of the page, and another anchor to get to the top of the page - and typing within a textbox at the top, you will be scrolled back down to the anchor at the bottom of the page.</p><p><strong>Initial Investigation</strong></p><p>It seems this behavior is somehow the result of having a viewport meta tag. I surmise, the browser on Android gets confused with anchor links and where the user dragged within the view, when the user begins to type. I realize this is a bit of complex scenario, but anyone have tips / advice on getting around this issue?</p><p><strong>Steps to reproduce:</strong></p><p>A. Create a new webpage, test.html, with the following markup:</p><pre><code>&lt;html xmlns=""http://www.w3.org/1999/xhtml""&gt; &lt;head&gt;    &lt;meta name=""viewport"" content=""width = device-width; initial-scale=1.0; "" /&gt; &lt;/head&gt; &lt;body&gt;    &lt;a name=""top""&gt;&lt;/a&gt;    &lt;input type=""text"" /&gt;    &lt;a href=""#bottom""&gt;Bottom&lt;/a&gt;    [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]  [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text] [Dummy Text]     &lt;a name=""bottom""&gt;&lt;/a&gt;    &lt;a href=""#top""&gt;Top&lt;/a&gt; &lt;/body&gt; &lt;/html&gt;</code></pre><p>B. On your Android mobile browser, visit test.html</p><p>C. Click the link ""bottom""</p><p>D. Click the link ""top""</p><p>E. Click in the textbox</p><p><strong>Actual Results:</strong></p><p>The browser scrolls down to the bottom of the page. Users can't see what they type now.</p><p><strong>Expected Results:</strong></p><p>The browser doesn't scroll anywhere after E. The user can input text without distraction.</p><p><strong>Notes:</strong></p><p>If the user drags the screen to get to the top, then they can type in the textbox without getting scrolled down. The problem seems isolated to anchor links, textbox, and the viewport tag. If anyone of those variables are removed, the bug doesn't exist.</p>","375986","","","","","2012-03-26 01:28:08","Unexpected scrolling when typing in a textbox after anchor top (Android-friendly mobile webpage development)","<html><android><anchor><viewport>","1","1","1","",""
"3116394","1","3116433","","2010-06-25 07:54:12","1","522","<p>i'm writing some stuff in java and i ran into some problems lately. cut short, i need to compare an object i created to another instance of this very class i instantiazed before with different data.</p><p>looks like this:</p><pre><code>a newA = null;a oldA = null;while(someBreakCondition) {    newA = new a();    newA.x = getSomeValue();    // now i want to compare the two objects    if(oldA != null) {        if(newA.time != oldA.time) {            // ...        }    }    // now my newA gets to be my oldA, since in the next iteration, a new newA is created    oldA = newA;}</code></pre><p>with a class a:</p><pre><code>class a {    public long time;    public int x;    public a() {        time = System.currentTimeMillis;    }}</code></pre><p>the problem is, that i end up finding out that the values from newA are always equal to those from oldA. so i guess sth went wrong with passing the references of the objects in the last line of the loop...i thought java always passes references of objects unless an explicit copy() is called?</p><p>if this does matter: this code is running on android - don't know if the dalvik vm messes aroung with this...</p>","370969","","","","","2010-12-07 17:41:59","Problem with passing around Object references in Java","<java><android><object><copy><reference>","5","2","0","",""
"3116474","1","3370556","","2010-06-25 08:09:25","1","1205","<p>I'd like to include a feature in my application that would include a running background service that would disable SMS, if certain conditions were met (location for instance).Is there a way I can intercept the user wanting to open any SMS app and block it? Would a Broadcast Receiver be able to do the trick?</p><p>Maybe a different way to go about this?Thanks for all the help.</p>","297616","","","","","2010-11-02 07:09:53","Disable SMS in Android","<android><sms>","1","2","","",""
"3116478","1","3117576","","2010-06-25 08:10:07","4","344","<p>I have to do a small android application. It should connect with facebook and have to post feeds into wall and retrieve feeds to display in timeline format. I am new to android and fb. Could any one help?</p>","376035","","","","","2010-10-23 09:07:06","How to List out feeds from face book in timeline format","<android><facebook>","1","2","","",""
"3116618","1","3117355","","2010-06-25 08:37:46","2","2613","<p>In emulator, size of edittext and button looks nice but in motorola milestones, both of them are so small. I think there are different types of screen layout. Is it possible to adjust the size automatically? My xml is below :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;EditText android:id=""@+id/txtToText_e""  android:layout_width=""270px""  android:layout_height=""wrap_content""  android:textSize=""18sp""  android:hint=""Type To Compose""  android:layout_alignParentBottom = ""true"" android:layout_alignParentLeft=""true""/&gt;   &lt;Button android:text=""Send""  android:id=""@+id/btnDone_e""  android:layout_width=""85px""  android:layout_height=""wrap_content""       android:layout_alignParentBottom = ""true"" android:layout_alignParentRight=""true""/&gt;                                 </code></pre><p></p><p>To get the auto re-sized edittext while turning the phone from portrait to landscape, i add these xml code in AndroidManifest.xml</p><pre><code>    &lt;supports-screens android:smallScreens=""true""              android:normalScreens=""true""              android:largeScreens=""true""              android:anyDensity=""true"" /&gt;</code></pre><p>But nothing change =[. how to fix it?</p><p>Thank you.</p>","305732","","305732","","2010-06-28 02:34:08","2010-06-28 02:34:08","auto adjust the size and position of edittext and button","<android><button><edittext><screen-orientation>","1","0","","",""
"3116719","1","3116857","","2010-06-25 08:53:22","1","793","<p>I'm trying to do some dynamic code and I load a new class that's supposed to be an Activity and I want to start it, but using the regular startActivity(Intent) wants the Activity to be ""Declared"" in the AndroidManifest.xml file.</p><p>Any clue?</p>","196313","","","","","2010-06-25 09:15:27","Can I start a new activity that's not specified in the AndroidManifst.xml file","<android>","1","0","0","",""
"3116744","1","3116869","","2010-06-25 08:58:21","2","2223","<p>I currently have a Service and an Activity in my application.</p><p>I currently bind the Service to the activity without using AIDL as the Service and the Activity are in the same application.</p><p>This allows me to call the methods from the Service within my Activity when I require them, however it doesn't let me call the methods of the Activity from within my Service when I want to.</p><p>Can anyone comment on what would be the best way to achieve this?</p><p>I could use Intents but is there an alternative option?</p><p>I want to have tight communication between the Service and the Activity, I want to be able to call an Activity method from my Service when an event happens.</p><p>Thanks to ognian for the excellent advice.</p><p><strong>EDIT 2:</strong></p><p>I now have it working the way I want, however I have come across a problem.</p><p>My service gets status updates and my Activity is then supposed to react to the update sent on from the Service.</p><p>The problem is that when I start my activity I get the Dialling Status and then Connected status before the onBind is called and I get the instance of iCallDialogActivity.</p><p>The following output from the logcat might make things clearer.</p><pre><code>06-28 10:56:48.702: DEBUG/TestPhone(3498): Status: EStatusDialling06-28 10:56:48.751: DEBUG/TestPhone(3498): Status: EStatusConnected06-28 10:56:49.122: DEBUG/TestPhone(3498): Status: onBind Called    &lt;------------- 06-28 10:56:49.141: DEBUG/TestPhone(3498): Status: iCallDialogActivity instance  &lt;------------- 06-28 10:56:51.641: DEBUG/TestPhone(3498): Status: EStatusDisconnecting06-28 10:56:51.651: DEBUG/TestPhone(3498): Status: EStatusIdle</code></pre><p>I need to be able to use my iCallDialogActivity when I get the Dialling and Connected Status notifications.</p><p>But this gives me a NullPointer Exception due to it not being created in time when my Activity starts, binding is the first thing I do in my Activities onCreate().</p><p>Is there a way to make it bind straight away?</p>","243999","","243999","","2010-06-28 10:06:22","2010-06-28 10:06:22","Android getting a Service to communicate with an Activity?","<android><service><activity><communication>","1","2","2","",""
"3116918","1","","","2010-06-25 09:25:54","2","717","<p>I have realize different tests extending the ""ActivityInstrumentationTestCase2"".<br/>Now, I want to structure my tests: group them and be able to run a subset.<br/></p><p>How to do this?<br/>Can I use the TestSuite class?<br/></p><p>Any idea?<br/></p><p>Regards, <br/>Alban.</p>","306839","","","","","2011-10-17 05:16:40","Android: test suite","<android><unit-testing>","2","1","2","",""
"3116937","1","3117682","","2010-06-25 09:29:18","2","4291","<p>How to decode a base64 encoded string to byte array on Android API level 7? </p><p>Can it be done using any standard packages of Java?  </p><p>Should i copy the source code from google search results?  </p><p>Should i re-implement encoder and decoder according to RFC?  </p><p>PS: API level 8 has util package android.util.Base64 that does this, but i have to do development based on API level 7.</p>","110024","","213269","","2012-06-11 09:47:15","2013-08-14 15:38:23","base64 decoder in android in API level 7","<java><android><base64>","2","1","0","",""
"3116950","1","","","2010-06-25 09:30:25","1","126","<p>I can't open my application window on top when I receive a call on android</p><p>My code:</p><pre><code>Intent intent = new Intent( Intent.ACTION_VIEW);intent.addCategory(Intent.CATEGORY_LAUNCHER);intent.setClassName(getPackageName(), getPackageName()+"".""+getLocalClassName());intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT  );startActivity(intent); </code></pre><p>Am I missing something?</p>","376108","","3800","","2011-08-31 16:33:11","2011-08-31 16:33:11","Can't open my application when I receive a call on android","<android>","0","0","","",""
"3117015","1","3117798","","2010-06-25 09:44:22","1","645","<p>I have taken note of some recent (and not so recent) blog posts on developer.android.com and have been adding in things like uses-feature and supports-screen elements to my manifest.</p><p>The problem is I don't really under stand the resizeable and any density tags in supports-screen.</p><p>I am supplying HDPI (drawable-hdpi) images for a few items as needed, though the majority are using a default image in drawable.</p><p>How do I need to set the resizeable and density tags, as I am struggling to understand their intent from the documentation.</p>","238174","","","","","2010-06-25 12:03:55","Android supports-screen is it resizeable or any density?","<android><manifest><android-manifest>","1","0","2","",""
"3117043","1","3117814","","2010-06-25 09:50:16","2","1313","<p>HiI want to delete an item from a ListView, to which have attached a GestureListener. I have overridden the method onFling for that GestureListener to return true of false based on my criteria.</p><p>But I don't know how to fetch the last selected item in the ListView. Fling does not select an item in ListItem.</p><p>I am short on time, Could somebody please help.ThanksNayn</p>","183871","","","","","2010-06-25 12:05:51","Delete an item from ListView on OnFling event","<android>","1","0","2","",""
"3117095","1","3117310","","2010-06-25 10:00:40","54","29175","<p>Is it possible to stop an Android app from the console? Something like:</p><pre><code>adb stop com.my.app.package</code></pre><p>It would speed up our testing process so much. Right now we uninstall/install the app each time to make sure the manual test cases start with a clean state.</p>","143378","","","","","2013-11-25 23:21:37","Stopping an Android app from console","<android><testing><adb>","6","0","24","",""
"3117307","1","","","2010-06-25 10:38:32","2","584","<p>I get this error when trying to get new packages on the SDK manager:</p><p>""Some packages were found but are not compatible updates."" </p><p>I've had a look around and the only thing I can find is to do with an older version of java, but I have the latest version, java 6 update 20.</p><p>So, does anyone have any ideas of what I can do? </p><p>I'm using Win 7 32.</p>","376164","","","","","2010-06-25 10:38:32","""Some packages were found but are not compatible updates. "" error on android","<android>","0","2","","",""
"3117350","1","3117635","","2010-06-25 10:44:52","9","13567","<p><strong>BACKGROUND INFO:</strong></p><p>I need to update some data from the web, about every hour or so, even when my app is closed. The update of the data itself takes about 40 seconds to 1 minute. It is then saved as a Serializable to a file. This file is read when my app starts.</p><p><strong>THIS IS THE APPROACH I TOOK FOR THE MOMENT (not using a Service)</strong></p><p>use the AlarmManager and BroadcastReceiver like this :</p><pre><code>private void set_REFRESH_DATA_Alarm(){    mContext = Main.this;    alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    broadcast_intent = new Intent(mContext,             RepeatingAlarmReceiver_REFRESH_DATA.class);    pendingIntent = PendingIntent.getBroadcast(mContext, 0,  broadcast_intent, 0);    // do a REFRESH every hour, starting for the first time in 30 minutes from now ...    Calendar now = Calendar.getInstance();    long triggerAtTime = now.getTimeInMillis()+ (1 * 30 * 60 * 1000); // starts in 30 minutes    long repeat_alarm_every = (1 * 60 * 60 * 1000); // repeat every 60 minutes    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, triggerAtTime,             repeat_alarm_every, pendingIntent);}</code></pre><p>My <strong>RepeatingAlarmReceiver_REFRESH_DATA.class</strong> takes care of updating the Data from the Web:</p><pre><code>public class RepeatingAlarmReceiver_REFRESH_DATA extends BroadcastReceiver {    public static Context mContext;    ConnectivityManager mConnectivity;    @Override    public void onReceive(Context context, Intent intent) {        mContext = context;        // if Network connection is OK (Wifi or Mobile) then Load data ...        mConnectivity = (ConnectivityManager) context                .getSystemService(Context.CONNECTIVITY_SERVICE);        Log.i(""Hub"",                ""mConnectivity.getNetworkInfo(0)=""                        + mConnectivity.getNetworkInfo(0));        Log.i(""Hub"",                ""mConnectivity.getNetworkInfo(1)=""                        + mConnectivity.getNetworkInfo(1));        if ((mConnectivity.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)                || (mConnectivity.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED)) {            Log.i(""Hub"", ""Connectivity OK ..."");            Refresh_HIST_DATA();        } else {            // else Show Dialog ""No network connection"" ...            Log.i(""Hub"",                    ""No network connection for the moment... will try again later!"");        }    }    // =========================================================================    private void Refresh_HIST_DATA() {        Log.i(""Hub"", ""Refresh_HIST_DATA()... Starting ..."");        // etc...    }}</code></pre><p>In the Manifest I have :</p><pre><code>&lt;receiver android:name=""com.cousinHub.myapp.RepeatingAlarmReceiver_REFRESH_DATA"" android:process="":remote"" /&gt;</code></pre><p><strong>PROBLEM :</strong></p><p>The alarm gets fired on time and the update starts but then after about 10 seconds it stops (Timeout):</p><blockquote>  <p>06-25 11:55:05.278:  WARN/ActivityManager(76): Timeout of  broadcast BroadcastRecord{44bb4348  null} -  receiver=android.os.BinderProxy@44bcc670</p>    <p>06-25 11:55:05.278:  WARN/ActivityManager(76): Receiver  during timeout: ResolveInfo{44bb42c0  com.cousinHub.myapp.RepeatingAlarmReceiver_REFRESH_DATA  p=0 o=0 m=0x0}</p>    <p>06-25 11:55:05.278: INFO/Process(76):  Sending signal. PID: 819 SIG: 9</p>    <p>06-25 11:55:05.298:  INFO/ActivityManager(76): Process  com.cousinHub.myapp:remote (pid 819)  has died.</p></blockquote><p><em>ps: strangely enough, this ""Timeout"" does not happen after about 10 seconds on my HTC Hero (still on Android 1.5 - API Level 4) but well on my Nexus One (2.1-update1)</em></p><p><strong>Questions :</strong></p><ol><li>Why this timeout ? Any easy way to avoid this ? </li><li>Did I set up my BroadcastReceiver correctly in the manifest ? Do I need to add something (to avoid this timeout) ?</li><li>Should I absolutely go for a Service for this kind of ""Refresh from Web"" functionality ? (considering this article : <a href=""http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/"" rel=""nofollow"">http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/</a>) If YES (I should switch to a service): Any good snippets of code/tutorial for this ...</li></ol><p>As allways, thanks for your help.</p><p>H.</p>","116573","","281545","","2013-04-01 13:09:12","2013-04-01 13:09:12","AlarmManager and BroadcastReceiver instead of Service - is that bad ? (Timeout)","<android><service><broadcastreceiver><alarmmanager>","3","0","5","",""
"3117429","1","4415244","","2010-06-25 10:57:57","39","34828","<p>I've seem many Android answers that suggest calling the garbage collector in some situations.</p><p>Is it a good practice to request the garbage collector in Android before doing a memory-hungry operation? If not, should I only call it if I get an <code>OutOfMemory</code> error?</p><p>Are there other things I should use before resorting to the garbage collector?</p>","143378","","143378","","2010-06-25 11:13:21","2013-04-09 04:07:47","Garbage collector in Android","<java><android><garbage-collection>","6","0","16","",""
"3117437","1","","","2010-06-25 11:00:11","2","2232","<p>Although the DDMS plugin is installed (verified by checking the installed plugins) in Eclipse, it is not showing up in the Perspective (which is showing only JAVA &amp; DEBUG). Any help with this would be great. Thanks, animesh</p>","376175","","","","","2010-06-25 11:10:04","Android Plugin DDMS not showing up on Eclipse Perspective","<android>","1","0","","",""
"3117770","1","3117832","","2010-06-25 11:59:24","9","736","<p>I'm writing for Android (Java).</p><p>I'm declaring int's and float's as part of an ongoing loop.</p><p>Some of them don't need to be changed after declaration.</p><p>If I set them all to final when declaring, will things run quicker?</p><p>[Edit]</p><p>Thanks everyone. I didn't actually expect it to make any improvements, I just noticed, after browsing the source of various large projects, it was fairly common. Cheers</p>","310455","","310455","","2010-06-25 19:03:37","2010-06-25 19:03:37","Will things run quicker if I make my variables final?","<java><android>","5","4","","",""
"3117812","1","","","2010-06-25 12:05:36","1","51","<ol><li>according to the DDMS the android just stop generate the sqlight file in  17,111 where outside of the DDMS if I import a file with the same values + the gap to my db it works just fine , is it my bug on the file who makes the db on the fly (onto the device in run time)?</li><li>how can i impot a  db file without using the DDMS(i add files manually how can i import one and insert db file to my sdk meanning complation time )?</li></ol>","368440","","","","","2010-06-26 22:27:42","android bug ? database stop generated suddenly in 17,111","<android><android-emulator><android-ndk>","1","0","","",""
"3117890","1","","","2010-06-25 12:17:56","2","4360","<p>I put a background color in a ImageButton? How?</p>","361352","","","","","2010-06-25 12:20:35","background color in a ImageButton","<android><imagebutton>","1","0","1","",""
"3117896","1","3135702","","2010-06-25 12:19:02","1","1146","<p>I am sure this has been discussed in this group, but I couldn't find that thread, so bear with it, or if possible merge it with the original.</p><p>I am using httpclient for my android app and I have a local site which has a few https pages. Since default httpclient doesnot allow self-signed certificates I am using  ""EasySSLFactory"" and ""EasyX509TrustManager"", which are mentioned in httpclientdocumentation.</p><p><code>client = new DefaultHttpClient();client.getConnectionManager().getSchemeRegistry().register(new Scheme(""https"", new EasySSLSocketFactory(), 443));</code></p><p>The problem is if I use this SSLFactory in my android app, I am getting correct response from my site's https pages, but I get ""SSL handshake failure: I/O error during system call, Unknown error: 0"" for sites such as ""gmail.com"", ""ymail.com"". If I don't use""EasySSLSocketFactory"" I get response from these sites but get exception for my site.</p><p>The funny thing is that this page fetch code works fine as a standalone java application.</p><p>What could be the problem. Please help me with this.</p><p>Thanks and Regards</p>","170068","","","","","2010-06-28 19:58:01","Problems with httpclient and selfsigned certificates","<android><https><emulator><httpclient>","1","0","","",""
"3117903","1","","","2010-06-25 12:20:19","11","2672","<p>I have a TabHost with three tabs. The first tab's content is the Intent of a custom activity who's contentview is a relative layout containing two EditTexts and two CheckBoxes (and a button). </p><p>Each checbox, when checked, enables/disables one EditText and the other checkbox. and I went about that like this:</p><pre><code>chkPolaziste.setOnCheckedChangeListener(new OnCheckedChangeListener()    {        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)        {            if ( isChecked )            {                entryPolaziste.setFocusable(false);                entryPolaziste.setEnabled(false);                chkOdrediste.setFocusable(false);                chkOdrediste.setEnabled(false);            }            else            {                entryPolaziste.setEnabled(true);                entryPolaziste.setFocusable(true);                chkOdrediste.setEnabled(true);                chkOdrediste.setFocusable(true);            }        }    });</code></pre><p>And that works. When one checkbox is checked, it disables the other checkbox and his EditText, and when I uncheck it, EditText and the other checkbox are enabled. But, after it's enabled, I can't type anything into the EditText. It just flicks for a moment when I click on it, and switches focus to another view. It looks to me as though the control is not fully enabled.</p><p>I've also tried to force the focus on the re-enabled EditText with requestFocus(), and tried to setFocusableInTouchMode(), but neither had worked.</p><p>I don't have an android device, so I only test this in the emulator (Min SDK is 1.6).</p>","189668","","","","","2011-01-22 18:56:32","Android: EditText cannot gain focus after being re-enabled","<android><focus><android-widget><edittext>","1","1","2","",""
"3118006","1","3118077","","2010-06-25 12:35:42","0","408","<p>I have created a custom Button class and I want to be able to change its width/height depending on some factors in addition to the content width/height. How can I do this?</p><ul><li>I have tried doing a setWidth/setHeight, but that had no effect.</li><li>I have set the layout_width/height to wrap_content and tried to override the function that calculates the content size, but I can't find it either.</li></ul><p>I am new to Android so I bet I am missing something really obvious, so please enlighten me.</p>","3610","","","","","2010-06-25 12:46:13","Buttons that can change size dynamically","<android>","1","0","","",""
"3118108","1","","","2010-06-25 12:51:30","6","8202","<p>wanted to leave a ImageButton is disabled (not clickable), but have used android: enabled = ""false"" but does not work</p><p>Does anyone know how to disable an ImageButton?</p>","361352","","","","","2011-07-19 16:19:45","disable an ImageButton?","<android><imagebutton>","2","0","","",""
"3118234","1","5560634","","2010-06-25 13:12:32","32","51119","<p>Is there any API by which we can get CPU or Memory usage of android?</p><p>I have tried one code as below:</p><p>Please look into it and let me know if this is the correct way?</p><pre><code>package com.infostretch.mainactivity;import java.io.BufferedReader;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStreamReader;public class CPULoad {    long total = 0;    long idle = 0;float usage = 0;public CPULoad( ){    readUsage( );}public float getUsage( ){    readUsage( );    return usage;}private void readUsage( ){    try    {        BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream( ""/proc/stat"" ) ), 1000 );        String load = reader.readLine();        reader.close();             String[] toks = load.split("" "");        long currTotal = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4]);        long currIdle = Long.parseLong(toks[5]);        this.usage = (currTotal - total) * 100.0f / (currTotal - total + currIdle - idle);        this.total = currTotal;        this.idle = currIdle;    }    catch( IOException ex )    {        ex.printStackTrace();               }}}</code></pre><p>I will be very thankful for your anykind of help.</p>","376287","","","","","2014-02-23 14:20:13","How to get Memory usage and CPU usage in android?","<android>","6","2","42","",""
"3118253","1","","","2010-06-25 13:14:08","0","461","<p>I have to show the received data of a UDP server. When data is coming from the server at that time I have to show that on the screen one by one. How to update the screen (Textview (or) EditText)?</p><p>I need to add (rec_str) value to the screen.</p><pre><code>public void run() {    try {        DatagramSocket clientsocket = new DatagramSocket(9876);        byte[] receivedata = new byte[1024];        while(true)        {            DatagramPacket recv_packet = new DatagramPacket(receivedata, receivedata.length);            Log.d(""UDP"", ""S: Receiving..."");            clientsocket.receive(recv_packet);            String rec_str = new String(recv_packet.getData());            Log.d("" Received String "",rec_str);            InetAddress ipaddress = recv_packet.getAddress();            int port=recv_packet.getPort();            Log.d(""IPAddress : "",ipaddress.toString());            Log.d("" Port : ""    ,Integer.toString(port));        }    } catch (Exception e) {        Log.e(""UDP"", ""S: Error"", e);    }}</code></pre><p>When I use <code>settext</code> it displays the last text only. How can I see all the incomming data?(Data will come one by one. When the data is comming I need to display the current data with the existing data also.)</p>","373172","","63550","","2010-10-08 11:29:02","2010-10-08 11:35:59","How to update the screen in Android?","<android>","1","1","0","",""
"3118269","1","","","2010-06-25 13:16:25","0","903","<p>In my app i'm setting background to each child views in listview.So that listview default focus ( orange color ) is not focusing.</p><p>Is there any way to set both ( listview focus &amp; child view background ) ?..</p><p><strong>Edit:</strong>This is my code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""schemas.android.com/apk/res/android""&gt;;    &lt;item android:state_focused=""true""     android:state_pressed=""false""     android:drawable=""@drawable/img_focused"" /&gt;     &lt;item android:state_focused=""true""     android:state_pressed=""true""     android:drawable=""@drawable/img_selected"" /&gt;     &lt;item android:state_focused=""false""     android:state_pressed=""true""     android:drawable=""@drawable/img_selected"" /&gt;    &lt;item android:drawable=""@drawable/img_default"" /&gt;&lt;/selector&gt;</code></pre>","366300","","414581","","2012-02-04 01:29:04","2012-10-08 13:28:33","Android Listview Focus with child view as background","<android><listview>","2","0","","",""
"3118291","1","3119097","","2010-06-25 13:19:24","0","856","<p>I made an icon and saved it in res/drawable directory as <code>icon.png</code> and edited the line <code>&lt;application android:label=""@string/app_name""&gt;</code> in <code>AndroidManifest.xml</code> to <code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;</code>.</p><p>But on restarting the emulator, the icon doesn't get displayed. There are no other <code>icon.png</code> files in the project.</p><p>AndroidMainifest.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=""android.com.machineInfo""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".machineInfo""                  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=""8"" /&gt;&lt;/manifest&gt; </code></pre>","172543","","23234","","2010-06-25 13:36:07","2010-06-25 15:06:44","Icon of android application is not getting displayed","<xml><android>","1","3","","",""
"3118328","1","","","2010-06-25 13:24:57","2","883","<p>I'm trying to keep a boolean preference in sync with a value in a content provider, and succeeding nicely except for this issue.  When I set the preference in my <code>PreferenceActivity</code>'s <code>onResume()</code> method (because the value may have been changed in the content provider), the checkbox in the view still reflects the pre-<code>onResume</code> value.</p><p>As far as I'm concerned, this preference could be entirely virtual and not persistent, but if it needs to persist for the wheels to turn that's fine, too.  The end goal is a check box in my app's preferences that reflects and updates the value in the content provider.</p>","339257","","","","","2010-06-25 13:39:05","update view when preference changed in PreferenceActivity.onResume (Android)","<android><model-view-controller><preferences>","1","0","","",""
"3118601","1","3119581","","2010-06-25 14:01:12","14","22750","<p>I use the AlertDialog class in my application. By default, these alert dialogs have a transparent background. I'm trying to use an opaque background instead, very unsuccessfully. These are my styles:</p><pre><code>&lt;style name=""MyOpaqueActivity"" parent=""@android:style/Theme.Dialog""&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/my_background&lt;/item&gt;    &lt;item name=""android:alertDialogStyle""&gt;@style/MyOpaqueAlertDialog&lt;/item&gt;&lt;/style&gt;&lt;style name=""MyOpaqueAlertDialog"" parent=""@android:style/Theme.Dialog.Alert""&gt;    &lt;item name=""android:background""&gt;#454545&lt;/item&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/my_background&lt;/item&gt;    &lt;item name=""android:popupBackground""&gt;@drawable/my_background&lt;/item&gt;&lt;/style&gt;</code></pre><p>I applied the ""MyOpaqueActivity"" style successfully for whole activities (the window background is changed to ""my_background""), but it doesn't work for alert dialogs within those activities. The ""alertDialogStyle"" attribute and my ""MyOpaqueAlertDialog"" style don't seem to have any effect.</p><p>So how can I change the background of these alert dialogs?</p>","249893","","","","","2012-12-07 12:29:17","How can I change the background of Android alert dialogs?","<android><dialog><background>","3","0","5","",""
"3118691","1","3118966","","2010-06-25 14:15:25","35","26162","<p>I'm wondering how would I make an image that is located at a specific URL equal to an ImageView's image?</p>","358438","","114066","","2010-06-25 15:17:31","2014-02-14 18:19:38","Android, Make an image at a URL equal to ImageView's image","<android>","4","1","34","",""
"3118693","1","3118896","","2010-06-25 14:15:31","1","2671","<p>I've created a custom view by extending View, it draws fine but When i try and refer to the object in the xml so I can say add a touch listener if reports a null pointer exception. My xml file is extremely simple</p><p></p><pre><code>&lt;com.projector.interaction.layout.MapMouseView2    xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/mouse""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/com.projector.interaction.layout.MapMouseView2&gt;</code></pre><p>I then try and referene the View by </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    try {        setContentView(R.layout.testlayout);        MapMouseView2 view = (MapMouseView2)findViewById(R.id.mouse);        view.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                Log.d(""Debug"",""Touch Not Working"");                return true;            }        });     } catch (Exception e) {        Log.e(""Error"",""Error in TestActivity"",e);    }}</code></pre><p>But it gives me a null pointer exception. Then only fix I can find is to wrap my view in the xml file inside a LinearLayout and reference the view by</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    try {        setContentView(R.layout.testlayout);        LinearLayout lay = (LinearLayout)findViewById(R.id.lin);        MapMouseView2 mouseView = (MapMouseView2)lay.getChildAt(0);        mouseView.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                Log.d(""Debug"",""Touch Not Working"");                return true;            }        });     } catch (Exception e) {        Log.e(""Error"",""Error in TestActivity"",e);    }}</code></pre><p>Can anybody please tell me what I am doing wrong???</p><p>The View class is here</p><pre><code>public class MapMouseView2 extends View{WindowManager mWinMgr;Rect zoom;Rect panLeftRight;Rect panUpDown;public MapMouseView2(Context context,AttributeSet attrs){    super(context);    Log.d(""Debug"",""Context,AttribyteSet"");    try {        mWinMgr = (WindowManager) context        .getSystemService(Context.WINDOW_SERVICE);        zoom = new Rect(0, 0, 45, mWinMgr.getDefaultDisplay().getHeight());        panLeftRight = new Rect(0, 458, mWinMgr.getDefaultDisplay().getWidth(),                mWinMgr.getDefaultDisplay().getHeight());        panUpDown = new Rect(mWinMgr.getDefaultDisplay().getWidth() - 45, 0,                mWinMgr.getDefaultDisplay().getWidth(), mWinMgr                .getDefaultDisplay().getHeight());        Log.d(""Debug"",""Leaving Constructor"");    } catch (Exception e) {        Log.e(""Error"",""Error in MapMouseView"",e);    }}protected void onDraw(Canvas canvas) {    super.onDraw(canvas);    try {        Paint paint = new Paint();        paint.setStyle(Paint.Style.FILL);        // make the entire canvas white        paint.setColor(Color.BLACK);        canvas.drawPaint(paint);        paint.setColor(Color.BLUE);        canvas.drawRect(zoom, paint);        paint.setColor(Color.RED);        canvas.drawRect(panLeftRight, paint);        paint.setColor(Color.RED);        canvas.drawRect(panUpDown, paint);        //canvas.drawCircle(x,y,30,threadPaint);    } catch (Exception e) {        Log.e(""Error"",""Exception in OnDraw"",e);    }}</code></pre><p>}</p>","376338","","","","","2010-06-25 14:46:13","Android Extending View and creating from XML Null pointer exception","<xml><android><view>","1","2","","",""
"3118894","1","3118903","","2010-06-25 14:40:22","1","240","<p>I was recently hired to work on mobile Ajax applications. This is the first time I do this, as I always worked on usual Ajax sites on common web browsers. I'd need a framework and possibly a toolkit that works both on IPhone and Android... capable of abstracting the mobile browser the same way jQuery does with desktop browsers. </p><p>I've seen JQTOUCH, but it seems very much IPhone oriented. I'd like something more cross platform and lighter. Do you have any idea?</p>","138606","","","","","2011-03-01 00:53:46","Good javascript frameworks toolkits compatible with mobile OSes?","<jquery><iphone><android><ajax><mobile>","2","0","","",""
"3119145","1","","","2010-06-25 15:12:40","0","3185","<p>Unlike Contacts, there is no currently public API available in the SDK to allow access to Gmail, SMS, and MMS.  The Gmail content provider does not appear to be publicly supported.  Does anyone have any information on using this content provider with Android 2.x, and/or the status of making Gmail, SMS and/or MMS access officially supported via the SDK or official documentation?</p>","376383","","","","","2010-06-25 16:12:20","Gmail content provider for message access","<android><sms><gmail>","1","0","","",""
"3119208","1","3119278","","2010-06-25 15:21:34","1","954","<p>I want to refresh a list when the user goes back to the main Activity from a child Activity. I Overrode <code>onActivityResult</code> and the function is called when I press the back button on the child Activity. However, there are other ways to get back to the main Activity from the child Activity and all ways should trigger the refresh. However when I call <code>finish</code> from the child, <code>onActivityResult</code> is never called.</p><p>I use <code>startActivityForResult</code> to start the child activity</p><pre><code>Intent i = new Intent(ConfGroupActivity.this, ConfGroupDetailsActivity.class);ConfGroupActivity.this.startActivityForResult(i, 0);</code></pre><p>And I finish the child activity like this</p><pre><code>setResult(0);finish();</code></pre>","370556","","","","","2010-06-25 15:29:00","finish() not triggering onActivityResult","<android>","1","0","","",""
"3119322","1","","","2010-06-25 15:33:46","1","462","<p>I'm looking for an Android device suitable for presentation of Android applications.</p><p>I seen that some devices are starting to include support for HDMI TV out, which is great but they all seem to only allow usage for video and sideshow playing purposes.</p><p>Do anybody know if there is a way (or device) that allows you to have the Android screen mirrored on its HDMI out?</p><p>Thanks!</p>","366386","","","","","2011-10-25 09:50:04","Android & HDMI: Other use than videos/slideshows","<android><presentation>","2","1","0","2012-08-21 06:44:52",""
"3119323","1","","","2010-06-25 15:33:50","0","1444","<p>I am trying to execute an event mouse press within my android application.  When the user enters a CARRIAGE RETURN when entering text into a text field.  I would like to execute a mouse button press on an ADD button when that character is detected in my OnClickListener for that EditText ui.</p>","99863","","","","","2012-04-29 16:18:36","Android simulate button press","<android><mouseevent>","1","0","","",""
"3119416","1","3151792","","2010-06-25 15:45:20","0","7055","<p>I found some good resources for rotating a bitmap in android here and elsewher eon the net.  I am close to getting my code to work but apparently I don't fully understand how the Matrix Translations work.  The following is three main functions from my sprite class.  THey worked great before I added things to facilitate the matrix rotation (namely in the onDraw I called the draw with just x,y and no matrix). I wrote some test code to add a sprite, and rotate it from 0 to 360 and back to 0 again repeatedly.  It results it in rotating about like its orbiting some odd point.  In reality I want it to just sit there and spin:</p><pre><code>public void Rotate_Sprite(int transform, int deg)    {        int spriteCenterX = x+(width/2);                int spriteCenterY = y+(height/2);        mMatrix.setRotate(deg, spriteCenterX, spriteCenterY);        }public void Draw_Sprite(Canvas c) { //c.drawBitmap(images[curr_frame], x, y, null); //this worked great esp in move sprite    c.drawBitmap(images[curr_frame], mMatrix, null);}public void Create_Sprite(blah blah) {    ...    ...    mMatrix = new Matrix();    mMatrix.reset();}public int Move_Sprite() {    //with the matrix stuff, I assume I need a translate.  But it does't work right     //for me at all.    int lastx=this.x;    int lasty=this.y;    this.x+=this.vx;    this.y+=this.vy;    mMatrix.postTranslate(lastX-x,lastY-y); //doesn't work at all}</code></pre><p>I did find this <a href=""http://stackoverflow.com/questions/1478849/j2me-like-sprite-on-android""> J2me like reference here.</a>  Though it seems to have all my sprites I call rotate on in orbit around one point.</p>","327258","","327258","","2010-06-25 15:57:07","2011-02-10 19:40:39","Rotate a bitmap in android about a point without animation of view","<android><bitmap><rotation>","3","0","","",""
"3119467","1","","","2010-06-25 15:51:42","2","1824","<p>I have an activitygroup managing a number of child activities.   Iwould like to pause/resume child activities when they go off/on thescreen just like they were top-level activities.  How can I do this?From the documentation it seems as if moving focus from Activity A toActivity B should pause Activity A, but I am not seeing thisbehavior.  The LocalActivityManager source uses ActivityThread, butthis appears not to be exposed for developer usage.</p><p>How can I programatically pause/resume an ActivityGroup's childactivity? </p>","376428","","","","","2010-11-11 11:04:03","Pause/Resume ActivityGroup's Child Activities?","<android>","1","0","1","",""
"3119558","1","","","2010-06-25 16:04:07","1","1821","<p>i am trying to store the user preference of whether the checkbox is clicked or not in an Activity , but when i shutdown and restart the app, i don't get the desired result . i.e if the user had checked the checkbox then on restarting i am not getting it as checked.</p><p>here's what i have tried:</p><pre><code>public void onCreate(){  ....  checkbox=(CheckBox)findViewById(R.id.checkbox); // storing the user preference    SharedPreferences sharedpref = getSharedPreferences(MYPREF,Activity.MODE_PRIVATE); //here MYPREF is the name of the file storing the preference    SharedPreferences.Editor e = sharedpref.edit();    e.putBoolean(""checkboxvalue"", checkbox.isChecked());    e.commit();  //retrieving the preference set    SharedPreferences mysharedpref = getSharedPreferences(TextSpeaker.MYPREF,Activity.MODE_PRIVATE);    checked=mysharedpref.getBoolean(""checkboxvalue"", false);    if(checked)checkbox.setChecked(true);</code></pre>","238505","","238505","","2010-06-25 16:59:06","2010-07-23 08:46:51","not getting the result using SharedPreferences in android","<android><android-preferences>","3","0","","",""
"3119607","1","","","2010-06-25 16:11:23","4","8428","<p>I am writing an app that connects to a telnet server via wifi.  I have a service that manages the socket connection.  It all works fine, but when the phone sleeps it disconnects the wifi radio, which causes the socket connection to break (and throws a SocketException).</p><p>I feel like I should be able to set up a a broadcast receiver whose onResume() method is called when the wifi network connection is lost, and that would allow me to gracefully shut down the socket, and re-open it if the network is immediately re-connected.  But I can't find anything like that in the doc or via searching.</p><p>Service code is here if you want it, thanks for the help, I really appreciate it!</p><pre><code>package com.wingedvictorydesign.LightfactoryRemote;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream;import java.net.InetSocketAddress;import java.net.Socket;import java.net.SocketException;import java.net.SocketTimeoutException;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.os.RemoteCallbackList;import android.os.RemoteException;import android.text.Editable;import android.util.Log;import android.widget.Toast;import android.os.Debug;/** * @author Max */public class TelnetService extends Service {    private final int DISCONNECTED = 0;    private final int CONNECTED = 1;    // place notifications in the notification bar    NotificationManager mNM;    protected InputStream in;    protected OutputStream out;    protected Socket socket;    // the socket timeout, to prevent blocking if the server connection is lost.    protected final int SO_TIMEOUT = 250;    // holds the incoming stream from socket until it is ready to be read.    BufferedReader inputBuffer;    final RemoteCallbackList&lt;TelnetServiceCallback&gt; mCallbacks =            new RemoteCallbackList&lt;TelnetServiceCallback&gt;();    @Override    public void onCreate() {        super.onCreate();        Log.d(""LightfactoryRemote"", ""TelnetService onCreate()"");        mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);    }// end onCreate()    @Override    public void onDestroy() {        super.onDestroy();        Log.d(""LightfactoryRemote"", ""TelnetService onDestroy()"");        // Cancel the persistent notification, if it hasn't been already.        mNM.cancel(R.string.telnet_service_connected);    }// end onDestroy()    @Override    public IBinder onBind(Intent intent) {        Log.d(""LightfactoryRemote"", ""TelnetService onBind()"");        return mBinder;    }    @Override    public boolean onUnbind(Intent intent) {        super.onUnbind(intent);        Log.d(""LightfactoryRemote"", ""TelnetService onUnBind()"");        return true;    }    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);        Log.d(""TelnetService"", ""TelnetService onStart()"");    }    private final TelnetServiceInterface.Stub mBinder =            new TelnetServiceInterface.Stub() {        public void registerCallback(TelnetServiceCallback cb) {            if (cb != null) mCallbacks.register(cb);        }        public void unregisterCallback(TelnetServiceCallback cb) {            if (cb != null) mCallbacks.unregister(cb);        }        public String connectToTelnet(String Host, int Port)                throws RemoteException {            // android.os.Debug.waitForDebugger();            String hostInfo = null;            try {                socket = new java.net.Socket();                socket.setSoTimeout(SO_TIMEOUT);                socket.connect(new InetSocketAddress(Host, Port), 10000); //setup                // the port with a timeout of 10sec.                out = socket.getOutputStream();                /*                 * in is wrapped in a reader, then in a Buffered reader. This is                 * supposedly better for performance, and allows us to read a                 * line at a time using the readLine() method.                 */                inputBuffer = new BufferedReader(new InputStreamReader(                    socket.getInputStream()));            } catch (java.io.IOException e) {                Log.d(""TelnetService.java"", ""Connection failed! "" + e);                /*                 * if the connection fails, return null for serverResponse,                 * which will be handled appropriately on the client side.                 */                return hostInfo;            }            // now that the command has been sent, read the response.            hostInfo = readBuffer();            Log.d(""TelnetService.java"", hostInfo);            // notify the user that we are connected            showNotification(CONNECTED, Host, Port);            return hostInfo;        }// end connectToTelnet        /**         * Tests for a currently active connection. Three cases must be         * distinguished. 1. A connection attempt has not been made. Return         * false. 2. A connection attempt has been made, and socket is         * initialized, but no connection is active. isConnected() returns         * false. 3. A connection is active. isConnected() returns true.         */        public boolean areYouThere() {            if (socket != null) {                boolean connectStatus = socket.isConnected();                return connectStatus;            } else {                return false;            }        }// end areYouThere        public void disconnect() {            try {                if (inputBuffer != null) {                    inputBuffer.close();                }                if (socket != null) {                    socket.close();                }            } catch (IOException e) {}            // Cancel the persistent notification.            mNM.cancel(R.string.telnet_service_connected);        }// end disconnect()        /**         * send the string to the telnet server, and return the response from         * server If the connection is lost, an IOException results, so return         * null to be handled appropriately on the client-side.         *          * @throws RemoteException         */        public String sendToTelnet(String toTelnet) throws RemoteException {            if (out == null) {                /*                 * if out is still null, no connection has been made. Throw                 * RemoteException to be handled on the client side.                 */                throw new RemoteException();            } else {                byte arr[];                arr = (toTelnet + ""\r"" + ""\n"").getBytes();                try {                    out.write(arr);                    // now that the command has been sent, read the response.                    String serverResponse = readBuffer();                    return serverResponse;                } catch (IOException e) {                    /*                     * if a connection was made, but then lost, we end up here.                     * throw a Remoteexception for handling by the client.                     */                    Log.d(""TelnetService"", ""IO exception"" + e);                    disconnect();                    throw new RemoteException();                }            }// end else        }// end sendToTelnet    };// end ConnectService.Stub class    public String readBuffer() {        StringBuilder serverResponse = new StringBuilder();        int character;        try {            // keep reading new lines into line until there are none left.            while (inputBuffer.ready()) {                /*                 * as each character is read, append it to serverResponse,                 * throwing away the carriage returns (which read as glyphs),                 * and the ""&gt;"" prompt symbols.                 */                character = inputBuffer.read();                if ((character != 13) &amp;&amp; (character != 62)) {                    serverResponse.append((char) character);                }            }        }// end try        catch (SocketTimeoutException e) {            Log.d(""TelnetService read()"", ""SocketTimeoutException"");        } catch (IOException e) {            Log.d(""TelnetService read()"", ""read() IO exception"" + e);        }        return serverResponse.toString();    }    /**     * Show a notification while this service is running.     */    private void showNotification(int event, String Host, int Port) {        // In this sample, we'll use the same text for the ticker and the        // expanded notification        CharSequence notificationText = ""Connected to "" + Host + "" : "" + Port;        // Set the icon, scrolling text and timestamp        Notification notification = new Notification(            R.drawable.notbar_connected, notificationText,            System.currentTimeMillis());        // set the notification not to clear when the user hits        // ""Clear All Notifications""        notification.flags |= Notification.FLAG_NO_CLEAR;        // The PendingIntent to launch our activity if the user selects this        // notification        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,            new Intent(this, LightfactoryRemote.class), 0);        // Set the info for the views that show in the notification panel.        notification.setLatestEventInfo(this,            getText(R.string.telnet_service_connected), notificationText,            contentIntent);        // Send the notification.        // We use a string id because it is a unique number. We use it later to        // cancel.        mNM.notify(R.string.telnet_service_connected, notification);    }// end showNotification()} // end TelnetConnection</code></pre>","242390","","281545","","2013-11-13 21:38:33","2013-11-13 21:38:33","How to be notified on wifi network status change?","<android>","4","0","10","",""
"3119629","1","3120081","","2010-06-25 16:16:02","2","1436","<p>Can some one help me explain how to read and display the data stored in the Internal Storage-private data on the device memory.</p><pre><code>String input=(inputBox.getText().toString());String FILENAME = ""hello_file""; //this is my file nameFileOutputStream fos;try {    fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);    fos.write(input.getBytes()); //input is got from on click button    fos.close();} catch (FileNotFoundException e) {    e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}try {    fos1=  openFileInput (FILENAME);} catch (FileNotFoundException e) {}outputView.setText(fos1./*I don't know what goes here*/);</code></pre>","357349","","340","","2010-06-25 17:41:14","2010-06-25 19:35:54","Internal Storage android -Device memory","<java><android>","2","0","1","",""
"3119676","1","3119953","","2010-06-25 16:23:42","8","13460","<p>This seems to be an Android-wide problem, which you can see in API demos under Views -> Progress Bar -> Dialogs.</p><p>Basically, if you show a progress dialog, it works as expected the first time around. If you dismiss it and show it again (without destroying the activity or anything like that), the spinning image stops spinning. In the API Demo you can see this by clicking ""Show Indeterminate"", pressing back to dismiss the dialog, and clicking the button again.</p><p>I've tried constructing my own progress dialog, however it shows the same problem, as the problem is with the ""ProgressBar"" spinning image.</p><p>I am wondering if anyone has a workaround for this problem.</p>","109482","","","","","2011-12-16 20:05:22","Android: Progress Dialog spinner not spinning","<android><dialog><progress-bar><progress>","5","1","2","",""
"3119728","1","3119754","","2010-06-25 16:31:22","3","5053","<p>I just Installed android 2.2 as a NetBeans 6.8 plugin, it works but I'm missing some tools like the layout ui manager, ïs this a ide specific tool or tis available for all of them?</p>","1312906","","111331","","2010-07-01 15:29:03","2011-02-24 19:15:01","Android layout manager available for Netbeans 6.8","<android><netbeans><layout>","1","0","1","",""
"3119730","1","3119783","","2010-06-25 16:31:39","1","2976","<p>I'm writing an app and I want one of my activities to have a background,</p><p>I've read the android docs about supporting multiple resolutions etc,but my designer is asking me what size the wallpapers should be and I do not want a lot of images for low,normal,high dpi in all the screen sizes.</p><p>What would be the most space efficient way to get a nice screen filling graphic background on all those screens?</p><p>Android is great and all, but I do not want to end up with a huge app since I need all sizes of images for everything.</p>","360646","","","","","2010-06-25 16:40:45","Size of background images to support all medium and large android screens","<android><background><dpi><resolutions>","1","0","4","",""
"3119884","1","3119904","","2010-06-25 16:59:46","0","1130","<p>All pages of my application use the AbsoluteLayout which is deprecated.I was told that the reason i should not use absolutelayout is that it's not flexible in different screen sizes.</p><p>I tested my app with every simulator comes with android sdk, and I had no problem.But all screens on all simulators seem to have the same size.am i safe to go with absolute layout as long as it works on all simulators?1.1, 1.5, 1.6, 2.0, 2.0.1, 2.2, 2.2</p>","242769","","20261","","2010-06-25 17:05:04","2010-06-25 17:05:04","Using AbsoluteLayout on Android?","<android><simulator><absolutelayout><screen-size>","2","0","","",""
"3120077","1","3120104","","2010-06-25 17:29:33","4","2588","<p>I know you can <a href=""http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/"" rel=""nofollow"">start a service on Boot</a>, but how do I start the service after the app has been installed or reinstalled?</p><p>I would like to start the service once the app is put on device by Debug/Run of Eclipse.</p>","243782","","","","","2010-06-25 17:34:50","Start service at boot and after app has been installed","<android><service>","1","0","1","",""
"3120124","1","3120312","","2010-06-25 17:38:59","0","1642","<p>How can I add touch capabilities to a simple <b>bitmap</b>?  </p><p>I've tried to create a wrapper class for a <b>bitmap</b>,<br>which implemented <b><code>OnGestureListener</code></b>,<br>but it didn't work.  </p><p>I want to avoid extending View class to achieve this.  </p><p>Thanks!</p>","243376","","26428","","2010-07-10 18:44:15","2010-07-10 18:46:11","Make Bitmaps listen to touch events","<android><bitmap><touch>","2","0","","",""
"3120133","1","3120708","","2010-06-25 17:40:23","1","78","<p>Here is a video of my app:<br>It's currently using absoluteLayout, and since absoluteLayout is deprecated i decided to change my layout.</p><p>So what Layout do u suggest using for this app?<br>Please see the part of the video, that the game has started, that's the only part with absolutelayout.<br>Thanks</p>","242769","","242769","","2010-06-25 18:59:07","2010-06-25 18:59:34","Which layout do you suggest","<android><layout>","2","0","","",""
"3120191","1","3120560","","2010-06-25 17:47:18","1","190","<p>I have a service that will monitor location changes daily. What I know so far that to <a href=""http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/"" rel=""nofollow"">start a service at boot</a>, I have to follow the linked tutorial. This way I can get the service started at boot, but to save battery I need it only between 9am-9pm.</p><p>Question is pretty simple, so I will repeat:</p><p>How can I ensure a service is started at 9am and stopped 9pm every day?</p>","243782","","","","","2010-06-28 07:13:34","How can I ensure a service is started at 9am and stopped 9pm every day?","<android><service><repeater>","2","0","","",""
"3120256","1","3122536","","2010-06-25 17:57:03","8","4595","<p>My app checks at a specific time whether a user is at a given location. I use the alarm manager to start a service that makes this call:</p><pre><code>locationManager.requestLocationUpdates(bestProvider, 0, 0, listener);</code></pre><p>And also checks:</p><pre><code> locationManager.getLastKnownLocation(bestProvider);</code></pre><p>But I'm having problems when running on a real device. For one thing, <code>getLastKnownLocation</code> is most likely the last place the GPS was on, which could be anywhere (i.e., it could be miles from the user's current location).  So I'll just wait for <code>requestLocationUpdates</code> callbacks, and if they aren't there within two minutes, remove the listener and give up, right? </p><p>Wrong, because if the user's location is already stable (i.e., they've used GPS recently and haven't moved) then my listener will never be called because the location doesn't change. But the GPS will run until my listener is removed, draining the battery...</p><p>What is the right way to get the current location without mistaking an old location for the current location? I don't mind waiting a few minutes.</p><p>EDIT: It's possible that I'm wrong about the listener not being called, it may just take a little longer than I thought... Hard to say. I'd appreciate a definitive answer still.</p>","12034","","12034","","2010-06-25 18:51:27","2013-07-09 17:02:04","Android - Reliably getting the current location","<android><geolocation><gps>","2","0","10","",""
"3120385","1","3120654","","2010-06-25 18:16:38","2","964","<p>Perhaps I'm misunderstanding how <code>Intent</code>s and <code>intent-filter</code>s work, but it seems to me that this should be a straight-forward case. However, it's not working.</p><p>Here is the Intent I'm sending:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);i.setType(""vnd.android.cursor.item/vnd.connectsy.event"");startActivity(i);</code></pre><p>And here is the intent-filter:</p><pre><code>&lt;activity android:name="".events.EventView""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.VIEW"" /&gt;        &lt;data android:mimeType=""vnd.android.cursor.item/vnd.connectsy.event"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>And finally, the error I'm recieving:</p><pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW typ=vnd.android.cursor.item/vnd.connectsy.event }</code></pre>","6007","","844882","","2012-03-21 05:17:23","2012-03-21 05:17:23","Intent object not triggering intent-filter","<android><android-intent>","1","0","1","",""
"3120404","1","3120540","","2010-06-25 18:19:05","2","1347","<p>im trying to make an android application that whenever a user conncects to  a wifi, application sends an http request to my server, later on by using push notification server sends some msgs to the user. but in here i have a problems:  how to make this application running in background and also it understand if phone is connected to a wifi, means even if applcation is closed it still be aware and whenever the phone is connected to a wifi it sends the http request. Thanks  </p>","376552","","376552","","2010-06-25 18:30:21","2010-06-25 18:37:43","Android : whenever the phone is connected to wifi send an http request","<android><background>","1","0","5","",""
"3120544","1","3120581","","2010-06-25 18:38:24","2","5322","<p>Is there a way to have 1 onClick Lister for many buttons where I can toss a case statement to do things based on what buttons were clicked.</p><p>I know I can make 100 different listeners for 100 buttons but I have to think I can create some nifty variables to do it in less lines of code.</p>","282475","","","","","2010-06-25 18:57:58","Variable OnClick Listener Android","<android><onclick>","4","0","","",""
"3120593","1","3120751","","2010-06-25 18:44:23","0","392","<p>What are the things that an android developer does to achieve it. So I need to know the basic functionality difference of IPad and other E-readers. I heard about Nook which runs an Android operating system. How do I test my app on that nook, i.e. is there any emulator configuration to test the application of nook?  (Because I don't have nook now.) Can you post your suggestions to efficiently develop the application for nook e-reader?</p><p>Edit:</p><p>I need to know the following:</p><ul><li>What SDK to use for the nook Androidplatform.</li><li>Configuration needs of An Emulator onAVD.</li><li>Special key functionalities, likeprevious/next page.</li><li>Specs and Functionality of Nook.</li></ul>","267269","","1228","","2013-08-01 13:59:26","2013-08-01 13:59:26","Specs and Functionalities of Nook E reader(Developer Thoughts)?","<android><ipad><nook>","5","1","","2013-08-02 15:36:13",""
"3120643","1","3122176","","2010-06-25 18:49:33","0","416","<p>Let's say my current simulator has 480px width.<br>I add a button to the screen in position 460dp<br>What will happen if the user's device has 400px width?<br>Does the button go out of the screen?</p>","242769","","12707","","2010-06-25 20:19:12","2010-06-26 00:05:30","RelativeLayout margins","<android><relativelayout>","1","1","","",""
"3120747","1","3121223","","2010-06-25 19:06:27","5","1712","<p>I have a 4x4 widget and i want to update a little piece of it every 15-20 seconds. Clearly i don't want it to be updated when the phone is in standby. The widget needs also to respond to some system events other than my timer. So, which is the best option?</p><ul><li>An AlarmManager: nice but probably cpu intensive if it needs to be run every 20 seconds</li><li>An Handler: light but i dont know how to stop it when phone sleeps</li><li>A service: also here i need to understand how to stop it when phone sleeps</li></ul><p>I will also need to update a little part of my widget without updating all its screen area, is this possible??</p><p>Thanks everybody.</p>","376579","","","","","2010-06-25 20:29:22","Best way to update an Android widget every 20-30 secs: Handler, Service or Alarm?","<java><android><service><widget><handler>","1","0","3","",""
"3120754","1","","","2010-06-25 19:07:57","2","1044","<p>Hi I have a list with simple_list_item_multiple_choice layout. The list is all in white and my background is also white and hence it is not visible. How do I change the color for that?? </p><p>Thanks,Prerna</p>","375504","","","","","2010-06-28 18:28:49","How do I change the color in List simple_list_item_multiple_choice","<android>","1","1","1","",""
"3120850","1","","","2010-06-25 19:28:03","2","117","<p>I have a listActivity and wanted to create a list with the second layout (attached). What has any idea how to build this layout in xml?!</p><p><a href=""http://www.freeimagehosting.net/uploads/1b4470d49f.png"" rel=""nofollow"">show imageAttached</a></p>","361352","","","","","2010-06-25 21:30:21","build this layout in xml?","<android><listactivity>","3","0","0","",""
"3121063","1","3121103","","2010-06-25 19:59:57","1","643","<p>I have a ListView which its contents could change at any time (eg. a list of cities within a state; a new city could be added to the state in our database at anytime). How do I implement, if possible, the onListItemClick event to work with this? For example, if a user selects a certain city in the ListView, i should be able to pass a value that independently identifies what city was clicked onto my next activity. I can't listen for positions because they could change with an addition or removal of a city. Any suggestions?</p>","356615","","","","","2010-06-25 20:06:06","Using onListItemClick with data driven ListView","<android><listview>","1","0","","",""
"3121153","1","3121249","","2010-06-25 20:16:12","5","4223","<p>I'm having problems with some BaseAdapter code that I adapted from a book. I've been using variations of this code all over the place in my application, but only just realized when scrolling a long list the items in the ListView become jumbled and not all of the elements are displayed.</p><p>It's very hard to describe the exact behavior, but it's easy to see if you take a sorted list of 50 items and start scrolling up and down.</p><pre><code>class ContactAdapter extends BaseAdapter {    ArrayList&lt;Contact&gt; mContacts;    public ContactAdapter(ArrayList&lt;Contact&gt; contacts) {        mContacts = contacts;    }    @Override    public int getCount() {        return mContacts.size();    }    @Override    public Object getItem(int position) {        return mContacts.get(position);    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View view;        if(convertView == null){            LayoutInflater li = getLayoutInflater();            view = li.inflate(R.layout.groups_item, null);            TextView label = (TextView)view.findViewById(R.id.groups_item_title);            label.setText(mContacts.get(position).getName());            label = (TextView)view.findViewById(R.id.groups_item_subtitle);            label.setText(mContacts.get(position).getNumber());        }        else        {            view = convertView;        }        return view;    }}</code></pre>","370556","","","","","2012-01-10 19:06:26","BaseAdapter causing ListView to go out of order when scrolled","<android><listview>","2","0","5","",""
"3121232","1","3122696","","2010-06-25 20:30:33","40","28537","<p>I have a popup window displaying when I click an item in my list activity. The problem is that the back key doesn't close it. I tried catching the back key in my list activity but it doesn't register it...then I tried registering a onkeylistener to the view I'm passing to my popup window. Like this:</p><pre><code>pop.setOnKeyListener(new View.OnKeyListener() {        @Override        public boolean onKey(View v, int keyCode, KeyEvent event) {            // TODO Auto-generated method stub            boolean res=false;            if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {                // do something on back.                Log.e(""keydown"",""back"");                if (pw.isShowing()) {                    Log.e(""keydown"",""pw showing"");                    pw.dismiss();                    res = true;                }            } else {                res = false;            }            return res;        }    });</code></pre><p>which is passed to a popup like this: </p><pre><code>pw = new PopupWindow(       pop,        240,        70,        true);</code></pre><p>But that listener doesn't fire neither. Can you help me? I'm out of ideas :)</p>","297616","","6391","","2010-06-26 12:55:23","2013-08-22 02:48:19","Android popup window dismissal","<android><popupwindow>","5","2","29","",""
"3121265","1","","","2010-06-25 20:35:42","2","556","<p>I head Android 2.2 supports Flash, but I'm not sure what that means for the SDK user.  </p><p>I'm using Android 2.2 platform (emulator and eclipse). In the emulator, I launched 'browser' app, and browser to the URL which has flash swf embedded, but I couldn't see it.</p><p>Am I missing something?</p>","376626","","881229","","2014-01-29 23:13:46","2014-01-29 23:13:46","Playing a Flash File in Android SDK","<android><flash>","1","1","","",""
"3121413","1","3125603","","2010-06-25 21:00:22","1","571","<p>I have a button in my FrameLayout.When the user selects the button i need to bring the button a little bit higher, so decrease it's y.How can i do this in code?</p>","242769","","246246","","2013-07-15 21:00:51","2013-07-15 21:00:51","Button In FrameLayout ==> Change y? Android","<android><android-layout>","1","1","","",""
"3121428","1","3121585","","2010-06-25 21:02:09","6","2477","<p>I'm trying to make a simple <code>ProgressDialog</code> appear while my <code>AsyncTask</code> is fetching data. In my <code>onPreExecute()</code> method I have this:</p><pre><code>pd = ProgressDialog.show(c, ""Loading..."", ""Please wait"");</code></pre><p><code>c</code> is the context passed into the constructor of my <code>AsyncTask</code> from <code>this.getApplicationContext()</code>. Unfortunately, I keep getting an exception with this message:</p><blockquote>  <p>Unable to add window -- Token null is not for an application</p></blockquote><p>What am I doing wrong?</p><p><strong>Update:</strong> Using <code>this</code> instead of <code>this.getApplicationContext()</code> has revealed another problem. When I call <code>ProgressDialog.show(...</code>, a ProgressDialog is displayed, but not until after the <code>AsyncTask</code> has completed. In other words, the data loads and then the dialog is displayed. If I include <code>pd.dismiss()</code> in my <code>onPostExecute()</code> then I never even see the dialog (presumable because it is closed before it ever gets opened).</p><p><strong>Final solution:</strong> It turns out that <code>fetch.get()</code> was hogging the UI thread and not letting the ProgressDialog display.</p>","118391","","118391","","2010-06-30 05:16:23","2010-06-30 05:16:23","ProgressDialog in AsyncTask throws an exception","<android><android-asynctask><progressdialog>","2","2","1","",""
"3121515","1","3448384","","2010-06-25 21:17:09","7","831","<p>Do Android have any way to instantiate objects without calling any of its constructors? </p><p>In Java, Sun have <strong>sun.reflect.ReflectionFactory.getReflectionFactory().newConstructorForSerialization()</strong>, in .Net we have <strong><a href=""http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatterservices.getuninitializedobject.aspx"">System.Runtime.Serialization.FormatterServices.GetUninitializedObject()</a></strong> but I was not able to find anything like that in the Android platform.</p>","157321","","","","","2010-08-10 11:52:42","Is it possible to bypass constructors when instantiating objects in Android","<android><constructor><objectinstantiation>","3","5","2","",""
"3121557","1","3121914","","2010-06-25 21:25:45","3","1247","<p>you can subscribe to requestLocationUpdates via two ways</p><ul><li>one by specifing a PendingIntent</li><li>the other is by using a LocationListener</li></ul><p>When is advised the one and when the other?</p>","243782","","","","","2010-06-25 22:46:13","When is advised PendingIntent vs. LocationListener on requestLocationUpdates?","<android><geolocation><android-pendingintent>","1","0","2","",""
"3121600","1","","","2010-06-25 21:34:57","6","1246","<p>I have a TabActivity, which contains 4 activities. My code sets the second tab as the current tab:</p><pre><code>public class MyTabActivity extends TabActivity {    TabHost tabHost = getTabHost();    TabHost.TabSpec spec; // Resusable TabSpec for each tab    Intent intent; // Reusable Intent for each tab    TextView tabView;    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, Activity1.class);    spec = tabHost.newTabSpec(""Tab 1"");    spec.setContent(intent);    tabView = (TextView) inflater.inflate(R.layout.ff_tab_indicator, null);    tabView.setText(""Tab 1"");    spec.setIndicator(tabView);    tabHost.addTab(spec);    intent = new Intent().setClass(this, Activity2.class);    spec = tabHost.newTabSpec(""Tab 2"");    spec.setContent(intent);    tabView = (TextView) inflater.inflate(R.layout.ff_tab_indicator, null);    tabView.setText(""Tab 2"");    spec.setIndicator(tabView);    tabHost.addTab(spec);    intent = new Intent().setClass(this, Activity3.class);    spec = tabHost.newTabSpec(""Tab 3"");    spec.setContent(intent);    tabView = (TextView) inflater.inflate(R.layout.ff_tab_indicator, null);    tabView.setText(""Tab 3"");    spec.setIndicator(tabView);    tabHost.addTab(spec);    intent = new Intent().setClass(this, Activity4.class);    spec = tabHost.newTabSpec(""Tab 4"");    spec.setContent(intent);    tabView = (TextView) inflater.inflate(R.layout.ff_tab_indicator, null);    tabView.setText(""Tab 4"");    spec.setIndicator(tabView);    tabHost.addTab(spec);    tabHost.setCurrentTab(1);}</code></pre><p>The problem is, when the MyTabActivity starts, it starts both activity in the first tab and the activity in the second tab. I just want it to start the activity in the second tab, since it is set to be the current tab. What should I do?</p><p>Thanks.</p>","256239","","80425","","2011-03-03 20:44:00","2011-07-14 13:57:40","How to prevent starting the activity at the first tab in a TabActivity?","<android>","2","5","2","",""
"3121661","1","3121907","","2010-06-25 21:47:17","4","1746","<p>I am following a tutorial to <a href=""http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/"" rel=""nofollow"">setup a service to start on boot</a> where the last piece of the code is:</p><p>Make an entry of this service in AndroidManifest.xml as</p><pre><code>&lt;service android:name=""MyService""&gt;&lt;intent-filter&gt;&lt;actionandroid:name=""com.wissen.startatboot.MyService"" /&gt;&lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>Now start this service in the BroadcastReceiver MyStartupIntentReceiver’s onReceive method as</p><pre><code>public void onReceive(Context context, Intent intent) {    Intent serviceIntent = new Intent();    serviceIntent.setAction(""com.wissen.startatboot.MyService"");    context.startService(serviceIntent);}</code></pre><p>As you see it uses intent-filters and when starts the service adds action.Can I just use </p><pre><code>startService(new Intent(this, MyService.class));</code></pre><p>What's the advantage of one compared to the other?</p>","243782","","","","","2013-10-18 10:58:40","Do I need to add an intent-filter when starting a service?","<android><service><intentfilter>","2","0","1","",""
"3121664","1","3121711","","2010-06-25 21:47:34","4","4505","<p>if the text is longer than the the width the textview, after the second line, it cuts it and adds ""..."" to the end of it. It doesnt matter the orientation, it will just display more text until the end of the second line, here is the textview XML:</p><pre><code>&lt;TextView android:id=""@+id/ContentViewerDescription""                android:layout_width=""wrap_content""                 android:layout_height=""match_parent""                android:layout_weight=""1""                 android:ellipsize=""end""                android:maxLines=""20""                android:textColor=""#999999""                android:layout_marginTop=""10px""                android:layout_marginLeft=""10px""/&gt;</code></pre>","204263","","","","","2010-06-25 22:08:01","TextView on android only shows two lines worth of text in either orientation","<java><android><textview>","1","0","0","",""
"3121769","1","3121783","","2010-06-25 22:09:20","2","871","<p>I know how to functionally do each of the following scenarios, my main question is which is the better design decision? Based on app size/speed and battery life and such.</p><p>So I will have several activities that will display different lists. They're all lists of the same object, but the objects' states will be different in each of the lists. It will be lists of games, and the games can either be active, finished, or waiting to start. Should I create new activity classes for each of those? Or create one ListActivity class that will just display the different one depending on the intent that was passed? Is there a significant benefit to doing one or the other? Using a different class for each one will be easier to read, but what's the overhead on java for compiling more classes vs having all the same information in 1 class?</p>","375874","","","","","2010-06-25 22:11:48","Android, activity for each view mode? Or switch statements inside fewer Activity classes?","<android><class><activity><listactivity>","1","0","","",""
"3122042","1","","","2010-06-25 23:19:27","0","1585","<p>I'm just about to submit an application to the Android Marketplace.<br>There is this message when I try to upload the app:<br>Remember to change the public key in updates for this application to match your new public key on the Edit Profile page </p><p>Where can I find the public key?<br>I went to <a href=""http://market.android.com/publish/Home"" rel=""nofollow"">http://market.android.com/publish/Home</a> and click on ""edit profile"" but I don't see any public key there.</p><p>Thanks,<br>Tee</p>","166940","","","","","2010-06-26 03:51:23","Android marketplace - public key","<android><google-play>","1","0","1","",""
"3122076","1","3195644","","2010-06-25 23:32:24","2","8313","<p>I have been slowing learning and building my first android app. I'm VERY new to java but have already done a couple of projects in C#, VB.NET (back in the day), Objective-C (have 6 apps in the store) and Fortran (waaaaaaaaaaaaaaaaaaaay back in the day ;)  </p><p>So I just received from overseas a htc legend (I'm not in the US), which i bought in order to have a decent mid-level device for development (it's running non-rooted adnroid 2.1)</p><p>The application I have been developing is target level 4 (android 1.6). It uses a 5 Mb sqlite3 database with a .mp3 extension to avoid compression within the apk and proper copying from assets to system folder.</p><p>It all works fine on the emulator, and on the device I see that the file size of the app after copying the database matches exactly what I see on the emulator.</p><p>now, on my main activity with a list view and a spinner, I bind some data through two array adapters. when running on the device all does smoothly. but when trying to run on the device this part of the code:</p><pre><code>public class mainAct extends Activity implements OnItemSelectedListener, TextWatcher, OnItemClickListener{           /** members */        //private EditText searchtext;        private ListView designations;        private ArrayAdapter&lt;String&gt; adapterShapes;        private ArrayAdapter&lt;String&gt; adapterTypes;        private Spinner types;      .        .        .        public void onCreate(Bundle savedInstanceState)       {        .        .        .            // DESIGNATIONS          //         adapterShapes = new ArrayAdapter&lt;String&gt;(this,R.layout.list_item,shapes);       // custom TextView Adapter          designations=(ListView)findViewById(R.id.designations);        Log.e(""MAIN.ACCT"", ""ok to 172"");        designations.setAdapter(adapterShapes);        Log.e(""MAIN.ACCT"", ""ok to 174"");        designations.setOnItemClickListener(this);        // TYPES        //        adapterTypes=new ArrayAdapter&lt;String&gt;(this,R.layout.spinner_item,DT.get().typesInLibrary);        types=(Spinner)findViewById(R.id.types);        types.setAdapter(adapterTypes);        types.setOnItemSelectedListener(this);      .        .        .      }}</code></pre><p>Both designations.setAdapter(adapterShapes);<br>&amp;  types.setAdapter(adapterTypes);  </p><p>give me a Null Pointer exception.  </p><p>I'm using eclipse under  mac, the LogCat window throws:</p><blockquote>  <p>06-25 18:41:37.842:  ERROR/AndroidRuntime(9523): Uncaught  handler: thread main exiting due to  uncaught exception  </p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):  java.lang.RuntimeException: Unable to  start activity  ComponentInfo{com.davidhomes.steel/com.davidhomes.steel.mainAct}:  java.lang.NullPointerException  </p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at </p>    <p>android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.ActivityThread.access$2200(ActivityThread.java:126)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.os.Handler.dispatchMessage(Handler.java:99)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.os.Looper.loop(Looper.java:123)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.ActivityThread.main(ActivityThread.java:4595)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  java.lang.reflect.Method.invokeNative(Native  Method)  </p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  java.lang.reflect.Method.invoke(Method.java:521)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  dalvik.system.NativeStart.main(Native  Method)  </p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523): Caused by:  java.lang.NullPointerException</p>    <p><strong><br>  --------------------------------------------------------------   06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  com.davidhomes.steel.mainAct.onCreate(mainAct.java:183)</p>    <p>--------------------------------------------------------------       </strong>  </p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)</p>    <p>06-25 18:41:37.891:  ERROR/AndroidRuntime(9523):     ... 11  more</p>    <p>06-25 18:46:38.252:  ERROR/ActivityManager(99): fail to set  top app changed!</p></blockquote><p>Line 183 is the first setAdapter call (designations.setAdapter(adapterShapes);), when I comment it out the second setAdapter is the one breaking code    </p><p>I'm a little lost here, the adapters show the proper number of items on the log window  when running from the simulator and the device.  </p><p>I admit to being a noob to both java and android, so any help is highly appreciated.</p><p>regards<br>david</p>","98907","","12183","","2010-06-25 23:37:40","2013-12-10 16:48:30","android newbie question null pointer on ArrayAdapter.setAdapter","<java><android><nullpointerexception><android-arrayadapter><oncreate>","4","0","","",""
"3122083","1","3124495","","2010-06-25 23:35:19","2","1053","<p>I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.        But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?</p><p>Any suggestions would be appreciated?Thanks</p>","376726","","","","","2010-06-26 15:59:43","Mapping Multiple Textures to a Cube's faces in Android","<android><opengl-es>","1","0","2","",""
"3122322","1","3122447","","2010-06-26 01:07:57","20","8073","<p>My android app is not in the app store yet.Is it possible to send my app to someone, and they install it on their device.Something like iphone AdHoc?</p>","242769","","189511","","2010-07-07 07:45:29","2014-01-15 10:04:42","How to Deploy Android Application to Beta Tester Devices","<android><installation><device>","8","1","8","",""
"3122434","1","","","2010-06-26 02:10:40","1","749","<p>I am a rookie Android Application Developer.  I wanted to start fooling around with the Android SDK tool: layoutopt.  When I ran layoutopt from the command prompt on my Windows 7 machine, I received the following warning and error messages:</p><p>WARNING: Java not found in your path.Checking it it's installed in C:\Program Files\Java instead.</p><p>ERROR: No suitable Java found. In order to properly use the Android DeveloperTools, you need a suitable version of Java installed on your system.</p><p>This is very frustrating because I know I have downloaded the most recent version of Java, which I double checked after I received this message.  Has anyone else had this issue?  Is it a matter of where I have my Java folder and android-sdk-windows/tools folders relative to each other.  I have experimented with moving the android-sdk-windows directory into the Java directory with no success.</p><p>If anyone can help me with what feels like a very silly problem, it would be greatly appreciated.</p>","376769","","","","","2011-06-01 12:34:37","Android Tool: layoutopt","<android>","2","0","","",""
"3122465","1","3122512","","2010-06-26 02:19:57","1","2676","<p>In ""onCreate"" I'm downloading data from web.The duration of downloading data is 10 sec. I wan't to have ProgressDialog while the data is downloading. Here is my code , but the ProgressDialog doesn't appear:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ProgressDialog dialog = ProgressDialog.show(Test.this, """",         ""Loading. Please wait..."", true);     try {         URL myURL = new URL(""http://www.sample.com/"");         URLConnection ucon = myURL.openConnection();         InputStream is = ucon.getInputStream();         BufferedInputStream bis = new BufferedInputStream(is);         ByteArrayBuffer baf = new ByteArrayBuffer(50);         int current = 0;          while((current = bis.read()) != -1){                  baf.append((byte)current);          }          content= new String(baf.toByteArray());     }     catch (Exception e) {}     dialog.dismiss();}</code></pre>","346665","","244296","","2010-06-26 02:23:46","2011-09-23 18:54:01","ProgressDialog onCreate","<android><progressdialog><oncreate>","1","0","","",""
"3122564","1","3122643","","2010-06-26 03:06:57","12","5823","<p>I have an activity, it needs to response to a broadcast event.Since an activity can not be a broadcast receiver at the same time,I made a broadcast receiver.</p><p>My question is: how can I notify the activity from the broadcast receiver?I believe this is a common situation, so is there a design pattern for this?</p>","316435","","842697","","2013-01-13 13:02:26","2013-01-13 13:02:26","how can I notify a running activity from a broadcast receiver?","<android><ipc><broadcastreceiver>","1","0","12","",""
"3122635","1","3122640","","2010-06-26 03:51:50","56","61275","<p>Are the users able to convert the apk file of my application back to the actual code?If they do - is there any way to prevent this?</p>","242769","","3205","","2011-05-23 15:26:59","2013-04-12 13:26:46","Is it possible to decompile an Android .apk file?","<android><obfuscation><apk><decompiling><dex>","6","4","37","",""
"3122828","1","","","2010-06-26 05:32:27","0","917","<p>I receive data from udp server from my application.when i receive data i have to show that on the screen.I just use the Textview to display the incoming data(textview.setText(""data"")).But it displays the last incoming data only.I need to show the previous data also.how to solve this? </p><pre><code>DatagramSocket clientsocket=new DatagramSocket(6363);byte[] receivedata=new byte[1024];while(true){  DatagramPacket recv_packet=new DatagramPacket(receivedata, receivedata.length);  textview.setText(""UDP S: Receiving..."");  clientsocket.receive(recv_packet);  String rec_str=new String(recv_packet.getData());             textview.setText("" Received String ""+rec_str); }       </code></pre><p>when i use append method it display's after all the incoming finished. I need to view when the data is coming at that time i have to show that.</p>","324223","","228489","","2011-07-15 19:45:24","2011-07-15 19:45:24","Update Textview at runtime?","<android>","3","0","","",""
"3122851","1","","","2010-06-26 05:40:59","1","2344","<p>In developer.android.com I read central feature of android is you can make use of elements of other applications in your own application.Iam interested in this line.1)How can we use the .apk downloaded suppose from android market in to our application ?2)How can we use our own created applicaton into newly created application?</p><p>please give me guidance on this and if possible sample snippet?</p><p>Regards,Rajendar</p>","376816","","","","","2010-06-26 08:38:10","how can i use .apk file into my own application android?","<android>","2","0","2","",""
"3122931","1","3122991","","2010-06-26 06:14:49","3","3822","<p>Is there a way to highlight an <code>ImageButton</code> when it's pressed?</p>","321927","","244296","","2010-09-27 18:19:07","2013-10-05 06:01:03","Android highlight ImageButton onclick","<android><onclick><highlight><imagebutton>","2","0","3","",""
"3123032","1","3123885","","2010-06-26 07:13:29","1","343","<p>I'm trying to create an app that offers the user 3 different kinds of layouts.The only common portion for all 3 would be the TextView (located at the top) that would display information specific to the currently displayed layout and 3 buttons to select the required layouts.</p><p>Is there some way we can create this UI in XML to keep only one constant part(the upper TextView) and dynamically display any one of the 3 layouts below it?Would it be better to create separate XML's for each of the layouts (each including the upper TextView in them)?OR would doing this via code be better?</p><p>Fast switching between the 3 layouts is important.</p><p>Appreciate any insights on this.</p><p>TIA</p><p>[EDIT 1]Actually they are 3 different layouts, with several ""child"" layouts and views within each of them.Could a ViewFlipper be used for switching between these? I was thinking that a ViewFlipper was only for switching between View elements?</p><p>I do have them in individual XML's right now but am looking for some way to load and unload them fast. Not sure how to do the hiding thing, will try reading up on that.[/EDIT 1]</p>","365681","","365681","","2010-06-26 17:52:06","2010-06-26 17:52:06","UI design suggestions for Display and Switching between Multiple Layouts","<java><android>","2","1","","",""
"3123156","1","","","2010-06-26 07:55:55","6","1125","<p>When I insert a row into a full-text search database declared like:</p><pre><code>CREATE VIRTUAL TABLE foo USING fts3 (bar);</code></pre><p>the SQLiteDatabase.insert() method returns an incorrect rowid. If the table is declared like:</p><pre><code>CREATE TABLE foo (bar VARCHAR(10));</code></pre><p>it returns the correct rowid value. The problem is when I query the database soon after the insert using the rowid returned from the method, the returned Cursor has no records. It works correctly for the first insert into the database only. For subsequent inserts, an incorrect rowid is returned.</p><p>Is there anything I need to do to get the correct rowid from the SQLiteDatabase.insert() method?</p><p>I'm using Android SDK version 2.1update1.</p><p>Thanks,Dan</p><p>Update:I ended up using a hack to get the last row id using the following code:</p><pre><code>private int getLastRowId(SQLiteDatabase db, String table) {    Cursor cursor = null;    try {        cursor = db                .rawQuery(String.format(Locale.US, ""SELECT MAX(rowid) FROM %s"", table), null);        if (cursor.moveToFirst()) {            return cursor.getInt(0);        } else {            return 0;        }    } finally {        if (cursor != null) {            cursor.close();        }    }}</code></pre><p>In my case, it's safe because only a single user has access to the app. For service apps, this may not work depending on how it is implemented/used.</p><p>I believe we have this problem because when performing an insert in fts3 tables, more than one row is inserted. A row is inserted in the subject table and in the fts3 management tables as well.</p>","376859","","376859","","2011-02-23 07:00:08","2011-02-23 07:00:08","SQLiteDatabase.insert() returns incorrect rowid for virtual tables","<android><sqlite3>","1","1","2","",""
"3123193","1","3127347","","2010-06-26 08:10:59","6","10191","<p>I have a dynamic <code>ListView</code> which uses an <code>ArrayAdapter</code>. When a name is selected from a spinner, the name together with an icon showing whether they are male or female gets added to the <code>ListView</code>.</p><p>Mostly everything is good (the name gets added to the list correctly, together with an icon). But the icon showing the sex gets added to the wrong item in the <code>ListView</code>. The name gets added to the bottom of the list, but the icon gets placed at the name at the top of the list. I don't know if it's the way I'm using <code>ViewHolder</code> but there is zero documentation on it in the <a href=""http://developer.android.com"" rel=""nofollow"">Android website</a>.</p><pre><code>// Listview inflaterinflater = (LayoutInflater) (this).getSystemService(LAYOUT_INFLATER_SERVICE);// List Array.mAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.player_simple_list,                                                  R.id.label, mStrings) {    @Override    public View getView(int position, View convertView, ViewGroup parent) {        Log.i(""ANDY"",""View getView Called"");        // A ViewHolder keeps references to children views to         // avoid unneccessary calls to findViewById() on each row.        ViewHolder holder;        if (null == convertView) {            Log.i(""ANDY"",""Position not previously used, so inflating"");            convertView = inflater.inflate(R.layout.player_simple_list, 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.label);            holder.icon = (ImageView) convertView.findViewById(R.id.icon);            if (sexmale == true) {                holder.icon.setImageBitmap(maleicon);            }            else {                holder.icon.setImageBitmap(femaleicon);            }            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(getItem(position));        // Change icon depending is the sexmale variable is true or false.        Log.i(""ANDY"",""getCount = ""+mAdapter.getCount());        return convertView;    }};setListAdapter(mAdapter);</code></pre>","330770","","356895","","2013-10-10 17:06:04","2013-10-10 17:10:36","ListView with ArrayAdapter and ViewHolder adding icons to the wrong item","<android><android-listview><icons><android-arrayadapter>","3","0","2","",""
"3123210","1","3123345","","2010-06-26 08:17:36","2","1201","<p>I'm getting null pointer exceptions when I try to initialize Button and EditText objects in global scope, can't figure it out.  I've commented out everything but the bare minimum for the app to display my layout, but this still causes a crash:</p><pre><code>private EditText addmoney = (EditText)findViewById(R.id.addmoney);</code></pre><p>R.id.addmoney definitely, definitely exists.  So what the heck?  Is it impossible to declare EditText in global scope?  I need to be able to call it from both onCreate and onPause in a class extending Activity, is there maybe another way I should be doing this?</p><p>EDIT:</p><p>I tried using shade's method of inflating the layout first but it causes errors, apparently your not allowed to use system services before onCreate() has been called and inflating a view requires one.</p>","376844","","41956","","2010-06-29 13:28:11","2010-06-29 13:28:11","Setting global Button and EditText objects","<android><global-variables>","2","2","","",""
