android

How to tell which thread(s) are producing all the garbage?

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). When I start my ...

How to specify a LinearLayout to either wrap_content if it exceeds certain width

Hi, I have want to layout an ImageView and then follow by a LinearLayout (to the right of it). <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/icon" android:layout_width="20px" android:layout_height="20px" /> <RelativeLayout android:id="@+id/sid...

IllegalStateException when adapter.notifyDataSetChanged() is called.

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. ...

Fix buttons at the bottom of the screen.

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. When more items are added to the list view, the list view should scroll without increasing the overall length of the list view. ...

Android 2.0+ account duplication

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. 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...

Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. What am I doing wrong?

I'm just playing around with some code. I create an Activity and simply do something like this: long lo = currentTimeMillis(); System.out.println(lo); lo *= 3; System.out.println(lo); SystemClock.setCurrentTimeMillis(lo); System.out.println( currentTimeMillis() ); Yes, in my AndroidManifest.xml, I've added: <uses-permission android...

having trouble with zooming in android webview

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() & 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 appea...

[android]how can i create customize profile like meeting etc

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 ...

Can I handle incomeing call in Android SDK 2.0?

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? ...

Decode HTML entities in android

Hi there. I need to decode HTML entities, e.g. from &#246; to ö, and &amp; to &. URLEncoder.decode(str) does not do the job (convert from % notations). TextUtils has a HTMLencode, but not a HTMLdecode. Are there any function for decoding HTML entities? Regards, Johan ...

how to set android default title bar at Bottom with image on it ?

how to set android default title bar at Bottom with image on it ? ...

how to install apk file to emulator>

hi i am new to android.I have fileexplorer.apk file.how to install / use the application in the android emulator? ...

odd response after INVITE request, SIP

After sending an invite request i receive a trying answer, and immidietly after that i receive error 407 proxy authentication required. After sending ack & another invite with the proxy header i receive session progress about 1/4 of the time!! other times it just sends 407 error again & again. Any ideas? ...

android get location from best provider available

Hi, I have this code to get the best available provider 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 mostRecentLocati...

Get Network type

hello, ive been trying to retrive the current network type, but no success when i say network type: i refer to know this info: if the type is: NETWORK_TYPE_IDEN or NETWORK_TYPE_UMTS.. and so on.. i tried to use: NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); or NetworkInfo mobNetInfo = connectivityManager....

Using database in Android

Does anyone know a good step by step tutorial for using sqlite on Android? I've found this: http://developer.android.com/guide/topics/data/data-storage.html#db and it ok to start with, but then it wants me to jump into other source code then its difficult to follow. I've tried others on the web, one from screaming penguin and that just...

Why do apps from Android 2.1 stop working with 2.2?

Hi guys, 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. 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. Yester...

Update ListView in the main thread from another thread

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. ...

Elegant solution to retrieve custom date and time?

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. I am using the following code: new DatePickerDialog(newlog3.this, d, calDT.get(Calendar.YEAR), calDT.get(Calendar.MONTH), calDT.get(Calendar.DAY_OF_MONTH)).show(); new TimePickerDialog...

is it binary compatible for emdebian and android?

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? ...