android

code errors copying from a book

The code comes from "Hello Android" Page47. I am using 1.6 since that is what the book is written for. import android.app.Activity; import android.os.Bundle; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; /** Called when the activity is first created. */ e1 @Override e2 publ...

how to calculate the most used apps-android

So I'm developing an app for android, and before I get too much into it, I want to conceptually get my arms around what I am trying to do. Is it very difficult to calculate or track the most frequently accessed apps? Any ideas or insights about how I might go about getting this done would be greatly appreciated! I'm used to iphone develo...

Why cant I override onConfigurationChanged?

Hey, im trying to override the method onConfigurationChanged and I get the error: The method onConfigurationChanged(Configuration) of type BaseActivity must override or implement a supertype method Here is my BaseActivity.java: import android.app.Activity; import android.content.Intent; import android.view.View; import android.view.Vi...

ADT installation Error

hi am using Eclipse 3.5 (Galileo) am trying to install ADT plugin frmo remote as well local archive it is not installing am getting error like for both remote as well local Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404) Missing requirement: Android Developm...

How to clip and fill a canvas using an alpha mask

I'm relatively new to Android development. I have some .png icons that are alpha masks. I need to render them as an drawable image using the Android SDK. On the iPhone, I use the following to get this result, converting the "image" alpha mask to the 'imageMasked' image using black as a fill: CGColorSpaceRef colorSpace = CGColorSpaceCr...

configuration changed (orientation change) and destroying Activities - is this the way its supposed to work?

Ok, so I read up on how Android handles "configuration changes" - by destroying the active Activity. The first question I really want to know from Android Team - why? I would appreciate an explanation on how the reasoning went, cause I dont get it =) In any case, the fact that it acts in that way puts us all, as I see it, in a world of...

Android coding question - contextMenuResource

I can not get the ContextMenuResource to return the correct information that I am looking for. At times it returns what I want, other times not so much so. public class montypython extends Activity implements OnClickListener { private static final int SAVE_SOUND = 0; // Tag to easily locate errors in the log file. private static ...

Android ImageView Animation

I've created a layout with an image view and a web view. The web view is set to have a default visibility of gone. When the activity fires up it displays the image view first and when the web view has finished loading its url, it marks itself as visible and the imageview is marked as hidden. When the imageview is shown, I would like it ...

launchModes, singleTask: how to switch between "screens"? Is Intents the only way, and if so I think I have a problem...

In a number of questions (like this one) I have been looking into how to "change screens" in my app. I have a "header" on top, with 4 buttons. Each button is meant to replace the "content" (ie change screen): +--------------------+ | menu with buttons | +--------------------+ | | | | | C O N T E N...

Android - Activity vs. ListActivity - Which one should my activity class extend?

Hello everyone, I've been learning to develop in Android and had more of a general question: If I have a layout that uses a list and some other views, should I be using Activity or ListActivity for my activity class? I know that ListActivity will probably make things easier to override list-specific events, but is there any other advan...

Show a list of Files in android?

I'd like to create a very simple android activity that takes a file path on the sd card and displays the contents of that directory in a listview. I know how to get a list of the files via File.listFiles() which returns an Array of File objects. What I want to know is how I can adapt that array to a ListView. Would an ArrayAdapter be ...

what is the alternative of HTML's TextArea in Android

what is the view element which gives effect like a HTML's TextArea? I want to create a form to send Email and for the body field I want to create a textarea type of UI element in the form. Can someone suggest what is the way to go for it? ...

Thread stopping in synchronized block

Hi, I am facing a problem with a stopping thread which is in a synchronized block. I am using TCP socket. The problem is that I am waiting on a DataInputStream object and I want to create a new socket again but it doesn't allow me to do because of the synchronized block. I have tried with Thread.interrupted(). I cannot avoid the synchr...

android map view is not working

[2010-01-09 15:47:19 - HelloMapView]------------------------------ [2010-01-09 15:47:19 - HelloMapView]Android Launch! [2010-01-09 15:47:19 - HelloMapView]adb is running normally. [2010-01-09 15:47:19 - HelloMapView]Performing org.example.hellomapview.HelloMapView activity launch [2010-01-09 15:47:19 - HelloMapView]Failed to find an AVD ...

What is the best practices on Android to keep data between activities deathes/restarts for the whole application session?

We're designing an Android app that has several activities which are working in a wizard like way - user should pass from the activity #1 to activity #5 to get to the final activity (#6). Since we know an activity can be suddenly terminated by OS on low memory we used Application class as a static storage for keeping the data the user i...

Java: How to check if object is null?

Hi, I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used. While trying to execute the following lines: Drawable drawable = Common.getDrawableFromUrl(this, product.getMapPath()); if(drawable.equals(null)){ drawable ...

how can avoid the background image for an application while it run in emulator/device in android?

hi, i run my applictaion in an emulator/device automatically one drawable image other than default image i used my image coming for my application as background.how can avoid it? ...

Android: ScrollView Problem

I have had a number of problems with ScrollViews. Recently I tried to create a LinearView which content exceeds the screen size so I created the new layout with parent element ScrollView and set its width and height to custom values (the layout has to appear as dialog - not filling the whole screen). When the element is selected the re...

add TouchListener to Drawable

I want to make a Drawable touchable for a component I am creating, does anyone know how to do that? final Drawable selected = backgroundSelected; selected.setBounds(0, 0, 20, 90); selected.draw(canvas); canvas.save(); ...

How to send/open email attachments from android app?

I would like to somehow send a file from my app on one android device to my app on another device. This can be done any which way, and I'm open to suggestions if you can tell me how to send over network or something like that. Currently, I'm looking at sending the file as an email attachment, but I haven't found any good documentatio...