android

Android application usage

How to get application usage statistics on android? What I want is to access the time (in milliseconds) that each aplication is used. Thanks ...

How to define and use a system property in Android Instrumentation test?

I am trying to use some arguments for an Instrumentation test. I noticed that I can read system properties with System.getProperty() function. So I use setprop command to set a system property. For example: adb shell setprop AP 123. Inside my Test code I try to read this AP property with : tmp = System.getProperty("AP"); Log.d("MyTes...

TabActivity and onKeyDown

I have created games with 3 tabs and one of the tab is the game using the onKeyDown (KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT) to control the game. It is working fine if there is no tab. But now with the tab, the KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT are actually controlling the tab movement instead of the game. May I know how to let...

Alarm in android

Hi all, I am using the following code for alarm, it will alert after 10 secs. Its works fine in emulator but in real device its forcely closing..can you guide me in correct way.. this is my actvity.. public class Alarm1 extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle s...

get a small bitmap image from a big bitmap in android.

Hello guys, Can anybody have any idea about how to get a small bitmap image from a big bitmap which is the combination of many bitmaps. Any help will be appreciative. Thanks a lot. ...

Passing Headers while using Broswer Intent

Hi, I want to pass some headers while opening a web page. Right now, I'm doing something like : browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(data.link)); startActivity(browserIntent); Now I'm stuck as I dont know how to pass headers using browserIntent. I've tried using browserIntent.putExtra() but it doesn't work. Can any...

Android ListView with delete button

I am trying to bind a list view to a List. This works ok when I create an activity that extends ListActivity and I have a text view in my layout file (i.e. the activity is binding to the default listview in the activity). However, what I would like to do is have a ListView that contains an image button (to further perform the deeltion ...

how can i get real path in image gallery?

Hi Friends, I got all images from device's gallery,but i got images path is like content://media/external/image/media/102,so i want to get real image path for each images and send email,how can i get path?given below code i used,anybody knows,please give some sample code for me..i have email code.i want to only get real image path.How c...

Android SDK emulator (AVD) for tablet size

Hi guys i was wondering how to create an emulator environment for a tablet sized device, i know there are quite a few devices being released soon, but how do start sizing up my layout? thanks ...

how to stream Audio and video in android using rtp.

how to stream Audio and video in android using Rtp. i want to build a server which can stream Audio and Video to multiple client... ...

Service and activity communication

I am making a IM client for android and i want to know how to do the communication between a Service and Activity. I have a Service that establish the connection to gtalk, gets the contacts, listens for the incoming messages... , and i have the activity that is the UI of my application. In the activity i create the service and bind th...

facing problem using smack on android

I have a button in Android Application. When the button is clicked following code is invoked: TestSmack a = new TestSmack(); a.login("[email protected]","password"); I have a TestSmack class.....in the constructor of this class i wrote public TestSmack () { ConnectionConfiguration connConfig = new ConnectionConfiguration("t...

How can I use arguments inside an Android Test application?

I use command line adb shell am instrument -w -e class com.jayway.test.NotePadTest#test_function com.jayway.test/android.test.InstrumentationTestRunner to execute a JUnit test case. How can I pass command line arguments for this Test? ...

Develop list within List in Android

Hi, I am getting a response from xml which is dynamic in nature . After parsing the xml , I able to generate a tree view. Now , I want to convert the tree view structure to a List view which will have multiple List(list within list & so on) depending on the depth of the xml. I am aware of the ExpandableListActivity which provide a two...

android:Handler from a Runnable throws Null Pointer Exception

I have a Thread that downloads data from internet public class Bp implements Runnable { Handler myHandler; public void setHandler(Handler myHandler) { this.myHandler=myHandler; } .... myHandler.sendEmptyMessage (0); } There is an activity that needs to be updated according to downloaded data. public class Hp extends Activity impleme...

Linking menus together

Hi, I am really struggling with linking menus together. The app I want to create is a collection of menus that leads to url links to various sites I plan to open within the application. I have created a list activity menu with 8 options and I have eight classes with further options. My problem is how to link the menus together. I ask th...

Android; How can I initialise state in one activity, then have another refresh that?

I have two activities The first one gets some data from a content provider, and displays it The second activity has a button, and when clicked it should call the first activity to "refresh", in other words to reload data from the content provider This is my first activity ... @Override public void onCreate(Bundle savedInstanceSta...

Why is not populating the listView ?

Hello! Im trying to do a very simple thing (showing a populated listView) but im not able. My code is not working and i cant find what's wrong, so i hope someone else can help me :) My XML where i have the listView defined: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android...

SQLite to ListActivity

Hello. I have this code in my DataBase Helper: public ArrayList<ArrayList<Object>> getAllRowsAsArrays() { // create an ArrayList that will hold all of the data collected from // the database. ArrayList<ArrayList<Object>> dataArrays = new ArrayList<ArrayList<Object>>(); // this is a database call that creates a "cursor" ...

Is Android's SQLiteStatement (prepared statement) thread-safe? I.e. is "bind*, bind*... execute" atomic?

I'm wondering whether prepared statements in Android (instances of SQLiteStatement) are thread-safe. In particular I'm asking with regard to the following scenario: In a ContentProvider you create a pre-compiled insert statement during onCreate. Then, in the overriden insert method you make use of this statement by binding a set of para...