android

play audio from a stream in android

Hi All, How to play audio from a stream in android??? I will get input stream from an online link( like continuous FM). I need to cache the stream and play it. I searched a lot in sites,,,but didnt get.They show option of playing from a stored file. There is no option to play from a stream. Can anyone help me please,,Itz very urge...

Android: AVD manager won't detect my HTC Hero phone as Virtual Device

I need to use my phone as emulator/target/virtual device when I run my application. I have installed HTC Sync and the USB driver is in order. I have enabled the USB Debugging in Settings. What more do I need to do to make Eclipse AVD Manager to detect my phone? I made it work on anohher coumputer, following the exact same steps I have d...

How to solve this overlay problem in android?

Hi Friends, I am new to Android GPS application development.I have to show multiple location in the map and if user touches any one of the location then it should display the information about that place.Now my problem is i could not able to get the exact location in the touch event.Is there any way to get the exact pointed location of ...

Buttons to fill width when using TableLayout

Hello, <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TableLayout android:id="@+id/TableLayout01" android:layout_height="wrap_content" android:layout_width="fill_parent"> <Tab...

Copying a byte buffer with JNI

I've found plenty of tutorials / questions on Stackoverflow that deal with copying char arrays from C/JNI side into something like a byte[] in Java, but not the other way around. I am using a native C library which expects a byte array. I simply want to get data from a byte[] in java, into preferably an unsigned char[] in C. Long stor...

android emulator copy files in system partition

I need to copy files to the system partition of the emulator. As it is read only by default, I use the command "adb remount" to have write permissions and I can then copy the files. My problem is that when I close the emulator and that I restart it, the copied files were missing. It's very annoying because I must write file permissions t...

How do I set the selected state of an image button with xml

I have an image button as defined below. <ImageButton android:text="Play" android:src="@drawable/playpause" android:background="@drawable/opaque" android:gravity="center_horizontal" android:id="@+id/player_ctrl_btn" android:layout_width="fill_parent" android:padding="0px" android:layout_height="wrap_...

Is there a way to pass parameters to the marketplace installer for an app

when providing a user on a mobile, a link to an android application via a web page, it is possible for params from the url to be passed to the app being installed. I'm guessing the answer is no - but it doesn't help to ask. The reasoning being that it would be handy for some situations to have a generic app that pulls config informatio...

Anyway to Authenticate a user using Google Apps in an Android application?

Hi, I was wondering if anyone knows of a way I can Authenticate a Google Apps User in a Android Application? One approach I know of is to take could take their username and password in a android view, and use the clientLogin interface (http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html). However I was wondering if th...

OnPreferenceChangeListener for every setting

I know that I can do something like this: Preference pref = findPreference(getString(R.string.pref_vibrate_on_key)); pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { LogUtil.d("Working!"...

Android - Can I do this with MediaRecord/MediaPlayer instead of AudioRecord/Track?

I currently use AudioRecord to record audio in from the mic of an Android device and then pipe that straight to an AudioTrack that plays it out the Earpiece of an Android device. I'm wondering can I do the same but with the MediaPlayer and MediaRecorder classes instead as I need to use the AMR-NB encoding that is available on the Media ...

Android cooliris gallery developer documentation

Does anyone know how to integrate with the new Gallery3D app (cooliris android gallery)? I want to launch that app so it shows the thumbnails for only a specific folder. For example, say my app downloads images from my server and stores them in a folder on the sd-card (/sdcard/myapp/image-cache/someid/*). I'd like to be able to do somet...

What is the correct way to specify dimensions in DIP from Java code ?

I found that it is possible to set dimensions of my interface elements in XML layouts using DIPs as in following fragment : "android:layout_width="10dip" But all Java interface takes integer as arguments and there is no way to specify dimensions in DIPs. What is the correct way to calculate this? I figured that I have to use property...

How to Programmatically Scroll Android WebView

I'm trying to programmatically scroll a WebView to the location of a particular element in the DOM tree. But so far I haven't been able to get the WebView to respond to scroll requests. I've tried calling JavaScript that uses window.scrollTo(...), but the WebView doesn't respond. On the Java side, I've tried calling the WebView.flingS...

Layout Question. How can I layout 1 image view on top, 1 image on bottom

Hi, I have a vertical LinearLayout. I would like to layout 1 ImageView on top and 1 ImageView at the bottom of that LinearLayout. I tried putting 'android:gravity="top"' and 'android:gravity="bottom"' in each of the ImageView, but both ImageView appears at the top of the LinearLayout. Is there a way to fix it? Thank you. <LinearLa...

Are Icon design UI guidelines still valid ?

Found UI guidelines of Launcher icon design http://d.android.com/guide/practices/ui_guidelines/icon_design.html but System Icons in recent Android releases doesn't seem to follow these guidelines (icons are flat instead simplified 3D perspective, as described in document). Are they already obsolete and what are the current guidelines ?...

How to increase storage for Android Emulator? (INSTALL_FAILED_INSUFFICIENT_STORAGE)

I get this sometimes(not often) for one of my projects, couple of classes only Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE How do I increase emulator's storage? ...

Is there a way of retrieving a TextView's visible line count or range?

I have a full-screen TextView holding a long Spanned that requires scrolling. The TextView's getLineCount() gives me the total number of lines used for the entire block of text but I'd like to know how many lines of text are currently visible on the screen. Or, better yet, is there a way to figure out the range of lines currently vis...

Android: Pro grammatically adjusting margins

I am trying to create a menu that slides up from the bottom. It starts with the menu's view just visible at the bottom of the screen, and then clicking it causes it to slide up. I tried using a TranslateAnimation, but although the pixels move, the hit areas of the menu are in the same position as before. So I think that if I can adjus...

Android: Crash on rotation, horizontal to vertical

I'm playing around with android, and I'm creating a simple twitter app to test what I've learned so far. But I've run into a problem that I don't understand. I created a thread to fetch the tweets, no problems there, but then added a ProgressDialog to show when that thread was running. Doing so caused a very unusual behavior. If the ...