android

setting layout parameters

So Im trying to add an imageview to my current xml design - and its working decently. Now my main problem is that I cant seem to find a way to set the attributes for the image like where it needs to be displayed etc. RelativeLayout mRelativeLayout = (RelativeLayout) findViewById(R.id.board); ImageView i = new ImageView(this); i.setImag...

Date picker in Android

Hai, Can any one post sample code for a simple date picker in Android. If date picker is not possible in Android, an option to choose a date is needed. Thanks in Advance.. ...

search function advise

Hello, I have a folder with pictures and I'd like to make a search function to be able to find pictures that correspond to their key words. I'd like to know how you'd do this ? I thought making a *.txt file with the name of the pictures and their corresponding key words, and then search in this text file the key words asked. Is there a...

How to position item of ListView?

Hello, I have a ListView with number of items. I'd like to place the item being clicked in the top of the screen. i am trying to use requestChildRectangleOnScreen of ListView that seems to do the job, however I cannot figure out how to properly specify the rectangle param. Any suggestion and/or code sample will be really helpful Thanks...

How to remove tab from TabHost

In a TabHost widget, I can create a new tab with its content (Intent) using TabHost.addTab(TabHost.TabSpec tabSpec). We can remove all tabs we created by calling clearAllTabs(), but I can't figure out how to remove the tab or just replace the content (Intent) inside the tab with new Intent. so what I need something like removeTab(int i...

Is it possible to remotely call methods on another computer through AIDL (Android Interface Definition Language)?

I am curious whether the AIDL only serves for inter-process communication between several Android apps on the same device, or AIDL provides much wider functionality. Let's say I have a Java application running on some server, is it possible to remotely call methods on that server through AIDL from an Android phone? If yes, do I need som...

How can I refresh MediaStore on Android?

This started out as a general user question on Android forums. However it's become, by necessity, a programming question. Here's my problem. Android has a service - MediaScanner - which runs in the background any time (I believe) the SD card is un-mounted and re-mounted. This service collects data on all the media files on the card, a...

How to add TabBar In Android

Respected All I have to add TabBar in my application, but i don't know how to add tab bar to application or activity. Can you help me for that. Thank You Vikram Kadam ...

Android correct location for hierarchical file list

I have a simple app which needs to display 1 of many text files (DB is no an option currently) Where is the best place to put this collection of text files? I am guessing "Assets", but am unsure. ...

Change a specific row in a ArrayAdapter ListView Android

Hi. I am trying to change the color on a specific row depending on different states. This is the code i have at the moment. public View getView(int position, View convertView, ViewGroup parent) { View row=convertView; if (row==null) { LayoutInflater inflater=getLayou...

Sharing data between tabs

Hi all, Been a newbie , to anroid development, i am getting some glitches while making a tab enabled application. I want to share data, between two tabs of mine application. How can i achieve the same Rgds Robert ...

How do you handle internationalization for "Your input 'xyz' is excellent!"

I would like to know what is the right way to handle internationalization for statements with runtime data added to it. For example 1) Your input "xyz" is excellent! 2) You were "4 years" old when you switched from "Barney and Freinds" to "Spongebob" shows. The double quoted values are user data obtained or calculated at run time. My ...

Ways that Android can connect with a remote service

I am trying to write an Android app to connect to an existing web service. I'm pretty new to web services in general, other than what I've done with this first web services (written with JSPs, Struts 1.x, and JAVA). This web service is connected to a document storage database. The user would first login to the service, then using search...

Android : can AsyncTask return in another thread than UI thread ?

Android documentation says that AsyncTask postExecute() is called on the UI thread. I was under the impression that postExecute() was called from the Thread where execute() was called : I have been using an AsyncTask in a background Service with its own thread, and postExecute() was called in the service thread, not the main thread. Howe...

Looper behavior after destroying an activity

What happens to pending Runnables that were posted to the looper using handler.post() 1) after the activity is finished? 2) What about after it's destroyed but not finished (eg. destroyed to free up memory while paused)? ...

Crop Bitmap without reading entire Bitmap first

I have a very large image and I only want to display a section the size of the display (no scaling), and the section should just be the center of the image. Because the image is very large I cannot read the entire image into memory and then crop it. This is what I have so far but it will give OutOfMemory for large images. Also I don't th...

Differences between Bitmaps and BufferedImages

I am trying to port some code from a regular java program into the android platform. Unfortunately, a significant part of the program involves manipulating images, and java's awt was taken away from me. I am trying to replace awt.BufferedImage with a Bitmap, and was hoping that the only differences between the two classes would be their ...

Detect if currently scrolling a web page on Android

I am trying to detect when a user has finished scrolling a web page using javascript on Android. The script I have is working on iPhone and seems correct to me that it should work on Android. Anyway, a snippet: previous = pageYOffset; interval = setInterval(function() { //Has scrolling stopped? if(previous == pageYOffset) { ...

How to manually update android browser with latest (nightly) webkit?

Hello! Is it possible to update WebKit behind the Android 1.5/1.6/etc (prior to 2.2) browser? I know latest nightly WebKit builds has great HTML5 support. So, my intention is to provide html5 video streaming (and other features) support on all those droids. Previously I was able to update WebKit engine on different devices with older Saf...

Which activity will on the front if the process was re-started?

Suppose my application P started Activity A, and A started Activity B, then the activity stack contained A and B, with B at the top. After that, I opened other apps by pressing Home button. Suppose after a while, the process of application P is killed by the OS. Then, I press Home button to select application P. At this time, which acti...