android

android onWindowFocusChanged

i want to override the method onWindowFocusChanged, but everytimei write it elcipse gives me a error message saying @override annotation is wrong, which means that i am not overriding the method but creating a new one. maybe i havnt included the package necessary ??? ...

dirty rectangle in SurfaceView

How to define dirty rectangle in for lockCanvas(Rect dirty) method of SurfaveView class any example ? whats its basic propose and how it preserves bitmap ? ...

android widget ListView: how do I wait until it's loaded up?

I'm using a ListView with an ArrayAdapter, and code executing after ListView.setAdapter(ArrayAdapter,...) is seeing ListView.getChildCount()==0. Is there a way t wait for the UI thread to finish filling the ListView before continuing? Thanks in advance, Lenny ...

Programmatically resize of view depends on android version ?

Hello everyone. I am facing a weird behavior regarding the subject. I have a very simple layout containing only an empty RelativeLayout. Once I have input form the user this relative layout is filled with square tiles to achieve a mosaic-like effect. Each tile is made by a FrameLayout containing two images (only one is drawn at any gi...

How to utilise Sense UI widgets?

Hi All, I was looking at my application (designed for 1.6) that uses the DatePicker controls on a HTC Desire the other day, and the owner of the phone showed me the native calendar program which uses much much nicer controls, i.e. the datepicker you can touch and scroll rather than having to repeatedly press the buttons to adjust days/m...

Detect clicked application inside Manage Application

Is there any way I can detect which application icon is being clicked inside the Settings>Manage Application. I would like to identify my application when it is clicked. Can I do that in android? ...

Android service client code

Greetings I am creating a service client and the following lines give me error. I was wondering how to fix these... // I have put in the service client stuff below... private CheckZone mBoundService; private ServiceConnection mConnection = new ServiceConnection() { public void onServi...

Incorrect signature while accessing Twitter api on android

Hi In my android app I can make calls to Twitter api immediately after I login. I am using same instance of OAuthConsumer. But when I create OAuthconsumer for subsequent call and use setTokenWithSecret I get Incorrect signature error. I spent few hours trying to debug but no luck... any help is appreciated. Following is code ...in on...

Android raw resource can't be found

Hi, I'm using a raw resource by creating a folder res/raw/myfile and then using the code InputStream is = Resources.getSystem().openRawResource(R.raw.myfile); This code throws a resource not found exception and in the logs it says "resources don't contain package for resource number 0x7f04000" The code I used above is by my guess the ...

Video Streaming in Android

Hi, I have made an Application in Java that transmits video (JMF= "JAVA MEDIA FRAMEWORK"). Now i want an android client for receiving video.What steps do i follow to make such client. I have seen that JMF doesnt work on Android. I want to know best way of doing it in Android platform . Regards, vs ...

Android TabView How-To SetVisibility of tab, or replace a specific tab?

Basically I want to dynamically change the tabs from an Activity. At first I thought I would delete a tab and create a new one ... Nope, not without completely removing / recreating all tabs. My second thought was to have all the possible tabs created and set their visibility as needed. Hummm...can't seem to do that either. Does anyone ...

Custom ArrayAdapter setBackground in getView

I'm working on a ListActivity which will display a bunch of numbers (weights). I would like to change the background of a specific row in the ListView. To do this I have created a custom implementation of the ArrayAdapter class and have overridden the getView method. The adapter accepts a list of numbers and sets the background of the ro...

How to put an AVD (emulator) into OFFLINE mode ?

Hi, I would like to test the behavior of my application when the user is in a no-signal zone or when his phone is in flight mode. -> How do I put an Android Virtual Device into offline mode (where no connection to the internet is possible) ? I have tried the following: Activating flight mode via the AVD settings: surprisingly, this ...

Can't Configure Android SDK in Eclipse in Ubuntu After Upgraded to 10.10

I have installed eclipse 5.2 in ubuntu 10.10. In the 'Install New Software', it show Android Developments Installed. And when i goto preferences window, Android is not listed in the left panel. Already i was running Android SDK in ubuntu 10.04, after i upgraded ubuntu OS, eclipse is not showing the Android. ...

Lazy loading from SQLite.

I have some 4500 entries in my database. What is the best way to show them in a ListView. Should I load them all in one stretch when the application initializes or should I use lazy loading? The list will also be searchable and filterable. Could you also point me to some nice articles that would gimme a better idea. Please do give me sug...

how to use the camera class in android to view what is in front of the camera ..and not click photos

i wnat to make an andoir app in which i want to use the camera ... only to view what is in front of the camera and not to click an image ...what is the code for it..? ...

How can I validate a radiobuttongroup in Android?

Hi! I have a radiobuttongroup in a game app in Android. Before the user can go on to the actual game he has to choose a level, which are three radiobuttons. Now, if the user clicks "play" the app crashes. How can I use a validation to see if a button was chosen? I have an edittext also, which I simply use a: if ((editText.getText().toSt...

Android: How do I assign each of my ListView list items an individual icon?

Hi, I'm very new to Android delelopment, searching and reading various tutorials and using different parts of code from around the internet, trying to make sense of it as I go. Forgive me if my explanation isn't too great. Currently I have a list created with 4 list items, what I'd like to do is assign a different icon to each of these...

ImageButton in home screen widget does not refresh image

Hi guys, I'm developing an home screen widget with an ImageButton in it. When I click the button I try to change image, but the image is not refreshed. I think it's just a view refreshing problem. Do you know how to refresh the view? Thank you. My code is this: @Override public void onReceive(Context context, Intent intent) { if (inte...

android listview refresh problem

im getting a weird problem when refreshing my listview it works fine until the device is rotated and then when refreshing it again it goes completely blank. can only be fixed by rotating the device again (as it is also refreshed in onCreate()) but then whenever its refreshed again it goes blank. problem persists until app is restarted. ...