android

Android Show image by path

i want to show image in imageview without using id. i will place all images in raw folder and open try { String ss = "res/raw/images/inrax/3150-MCM.jpg"; in = new FileInputStream(ss); buf = new BufferedInputStream(in); Bitmap bMap = BitmapFactory.decodeStream(buf); image.setImageBi...

Android: How to start an Activity from an alert dialog

I need to start an activity when the user chooses an item in an alert dialog. How do I get the context to pass to the intent constructor in the following code... builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Intent i = new Intent(<WHAT DO...

Using Camera in Portrait Orientation

Hello all, I'm trying to develop an app which uses the Camera. So far it's been working well, except that I'm unable to force the orientation to be "portrait". It seems to work well if I force all activities to "landscape", because the camera preview seems to fit in landscape. Is there anyway to use the Camera in portrait mode? ...

getting battery level at android widget

Hi, I wrote a widget for Android and I'm trying to get the battery level. I've tried using Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); but I get the error: "IntentReceiver components are not allowed to register to receive intents" Why? the ACTION_BATTERY_CHANGED is a sticky...

Android Camera : get multiple images from 1 click of the user or extract frames from a video

Hello everyone, What i'm trying to do is simple. The user opens the app, click a button named 'Take a Picture'. A new activity is started, with the camera preview. What I want to do is when the user clicks on the screen, the camera would take several pictures or a video. In the case of pictures, these several pictures would be put in a...

Problem with Animated gif on Android

Hi, I need some advice about animation. I have an animated GIF, but how to put in Android app to be animation. When I put it doesn't move at all. I read something about animation in Android and I need to have pictures for animation. Is there any solution for this ? ...

How to create working menu's

Hi, I have managed to create a menu with four options. I want to create four sub menus of same style for each option. In my infinite nooby-ness I have created four classes for the sub menus but I cannot figure out how to move between the menus(Classes). For instance I have four options Prem, Champ, L1, L2, I have created the Prem sub...

How to create a layer menu?

How to create a layer menu? I want to create a custom menu,but I do not know how to create a layer,For example, a Imagebutton is pressed to display a list of menu.like this: http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&amp;690 ...

Layout for Android ListView item like Twitter

As you already know, in Twiiter application, twitt content stays in the right hand side of the Username, and in second line, the twitt content stays back to the left of the parent layout. (which is similar to the Listview item's layout of Facebook Application) My problem is the username and twitt content belong to 2 different columns :...

Android sqlite opening database crashes

I have two classes, my main class and another for handling sqlite. The problem I have is that it crashes when it gets to db.open() in the main class and I have no idea why. main class: public class RingerSchedule extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...

ANDROID: How do I download a video file to SD card?

I have a video file on a website in .MP4 format and I want to allow the user to be able to download the video to their SD card by clicking a link. Is there an easy way to do this. I currently have this code but its not working...not sure what I am doing wrong. THanks for any help! import java.io.BufferedInputStream; import java.io.Fi...

Android RelativeView - button disappears

Been trying to create a layout similar to the Android Facebook app (top bar with app name and 2 buttons aligned right). Tried everything :( the closest I got made one of the buttons disappear... Here is the code: (using relatives on top to create sticky header and footer) the "Add" button disappears while the "Search" button aligns to...

Android AVD not showing anything. only "ANDROID" in the middle of the screen.

I am an Android Newbie! please help. I have been following googles introduction tutorial and managed to install everything with no problems. but whenever i try to run the HelloAndroid example the avd launches but doesnt show anything. cone somebody help please? ...

Android app using Google Maps library, installable everywhere

Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on phones without Google Maps? On phones without Google Maps, the maps feature would be disabled. ...

Android & Eclispe - Export Signed application no longer works

All of a sudden I cannot export a signed application in eclipse Right Click -> Android Tools -> Export Signed Application Package Nothing happens, I can still install it on the emulator and export an Unsigned package What is going wrong? I get the following in the error log when I press the "Export Signed Application Package" menu it...

Override click in android preferenceactivity

Hi everyone, In my app I'd like to show a warning when using a certain preference in my application. I've tried using the PreferenceActivity.onPreferenceTreeClick and the onPreferenceClickListener, but neither seems to work. I've got the latter example below. Could anyone shed some light on this please? @Override protected void onCreat...

HTTP authentication and sessions

Hi, I've been trying to figure out how to do a HTTP authentication and then use the session to display pages in a webview in my android app. Could someone please provide som guidance (I would very much appretiate some sample code if possible). I use Zend ACL on the server side. Thanks in advance. ...

How does one remove a MediaPlayer?

I have too many MediaPlayers. What is the accepted method to remove them from memory so that I can create more? Changing the filesource doesn't seem to work, I need rid of them. ...

Multiple APK's Interacting with each other

Recently I came across a few apps (such as Clockworkmod's Rom Manager) where in order to get the pro version you had to download another APK. However once this APK was downloaded Rom Manager automatically knew this APK existed and added new functionality's. For example another app is the Astro app in which you can extend it by downloadin...

Modifying styles programmatically

In an Android application I am writing, the styling for my various TextView elements is defined in an xml resource. I would like enable the user to change certain styles such as android:typeface using a PreferenceActivity. Is there a way to modify a style resource programmatically such that all associated widgets will update correctly? ...