android

how to use mutiple alarm clock in android

In my application i use alarm clock manager but i have problem with creating multiple alarm clock.Their is problem of time instance of repeating of an alarm instance. how to manage repeating time to set or repeat alarm. if i have two event to fire alarm service (just as memo,note) on same time. ...

Disabling the TextListener on List View in Android

My issue is simple, I am modifying the Contacts app source and I have put a text search box wherein user can enter the name and search for the name, and want to disable the key listener thats on ListView which appears whenever the key is pressed and filters text with a black rectangle. I'd also like to know how to get rid of that black...

How to run a Runnable thread in Android?

Hi I developed one small application to display some text at defined intervals in the android emulator screen.I am using Handler class, small snippet from my code handler=new Handler(); Runnable r=new Runnable() { public void run() { tv.append("Hello World"); } }; handler.postDelayed(r, 1000); When i run th...

Java sync games: synchronized && wait && notify

I'm coming from .NET world, and unfortunately looking Java source with .NET's eyes. Following code is from Android Apps (though not Android specific at all): private class Worker implements Runnable { private final Object mLock = new Object(); private Looper mLooper; Worker(String name) { Thread...

Contacts App crashes when switching between Dialer to Call log

I've altered the contact app so that in Dialer the soft keypad always stays and it hides when other tab activity resumes, We've given different look for the contacts app, but when using the same, a crash occurs when we rapidly change from dialer to call log. And the App crashes without the standard crash dialog. I have copied the log an...

Not understanding how to use different density images for 1.6+

Hi, I'm trying to understand how the res/drawables images should work with different screen densities. Right now I've got a 1.5 app, and for example I have an image that is 100x100 pixels. When used on the Droid, it scales this image so it appears to be the same size relatively on that device (all other layout scaling is handled by me, ...

How to draw a border at top of the linear layout

Hi, I have followed the example in for the gradient dividers: http://www.connorgarvey.com/blog/?p=34 I have tried to draw a horizontal line at the BOTTOM of my linear layout. Here is my linear layout file: <LinearLayout android:id="@+id/test" android:layout_width="fill_parent" android:layout_height="wrap_content>...

Expanding the size of an Android Virtual Device (emulator) instance?

On a relatively new emulator image (AVD) I have about 40mb of free space. How can I expand this? UPDATE: Just to be clear... I'm talking about the "Internal phone storage" size, not the SD Card size. ...

Use string format arguments in Android layout xml file

I have a string defined in my String.xml file that uses format arguments, i.e.: <string name="myString">Hello %1$s.</string> Is there a way to assign a value to the format argument in a layout xml file? I have something like: <TextView android:text="@string/myString"/> I know I can do it in java, but is there a way to do it here? ...

Android Dropdown Effect - Spinner or not?

Achieving a true "dropdown" effect (as seen in Adobe's Photoshop Mobile app for Android, image below) has proven challenging using Androids built-in methods. As others on Stackoverflow have told me, editing the style of a dropdown list view of an Android spinner is limiting. How is this dropdown effect done? (I can't seem to get an ...

How to speed up Android Emulation?

I'm trying to get started with Android development. I'm using eclipse on Linux and using a Pentium IV @3.2Gh with 1GB of ram. I've just followed the "hello android" howto, with just one sad result: the virtualization is too slow. It seems that launching the virtual machine has to be slow, and it will be slow even if I'll use a bett...

Android: When the keyboard pops up, the layout is invisible. How do I solve this?

In my layout, there is a TextView at the bottom of the screen. The problem is that when I click inside the text box to type something, the keyboard covers the text box as a result of which I am not able to see what's happening... Is there any solution for this? Here's my layout... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xml...

Android: Storing username and password?

If I want to store the username and password to be used inside an Android application, what is the best way to do it? Is it through the preferences screen (but what if the user misses this?), or pop up a dialog box and ask the user for the credentials? If so, I do have to maintain state for the application. How would I do this? ...

Android Gallery (view) video (also thumbnail issues)

Currently we have a Gallery view to which we need to add thumbnails for images/video. How do we get the already generated thumbnails (the ones that the native Gallery app shows) if we already have the image's/video's content:// URI? (We are using Android 1.6, Video.Thumbnails does not exist) ...

Android: startActivityForResult always gets a resultCode of 0?

For some reason, when I use the call, the result is always returned as 0. All I am doing is popup the selection box and then once the selection is made, the user hits the back button. Does anyone know what mistake I could be doing? CALLING ACTIVITY: Intent i = new Intent(this, Selection.class); Log.d("Front-End", "Launching Activity");...

Android activity inside dialog

I want to start activity inside popup screen suggest any quick change ?? new AlertDialog.Builder(SearchResults.this) .setTitle("Refine") .setItems(/*catNames*/, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { /* User clicked so do some stuff */ Str...

Getting orientation of the device?

Hi, I have a camera preview activity, which is forced to stay in landscape mode. Is there a way I can tell the current orientation of the phone (not the screen orientation). Basically I want to know if the user is holding the phone in portrait mode, or in landscape mode, so I can rotate the output captured bitmap correctly (right now ...

Android tableview behaving as a listview

I am using table layout to display data, but i want it to behave like list items (ability to select, when select change background, when click, having hover effect, click able) for that purpose i am using following listeners OnClickListener(to perform action) OnFocusChangeListener(To change background color) OnTouchListener(to focus sp...

Android: Uploading a text file periodically?

If I want to upload a text file containing some game stats to a web server for testing purpose, which approach is the best? Do I write a service along with my application and then upload the log file once it reaches a specific size? Or do I embed the logic into my application and then do it during idle times? ...

How to get Android 2 project types available in Eclipse?

I just upgraded to the Android 2 SDK. (I was at v1.5) I believe I followed all the instructions correctly, I installed the new SDK and then went into Eclipse and ran a software update from dl-ssl.google.com/android/eclipse. But when I then went to create a new project (after restarting Eclipse) all I had to choose from were 1.5 Android...