android

NetBeans and Android image

New to Android development and have decided to use NetBeans 6.9.1 as my IDE. So far the process has been somewhat painful, but I'm getting things rolling. However, I am creating an ImageView subclass for my first custom View and I can't figure out how to add my Box.png file to the project. Drag and Drop doesn't work, there are no righ...

How to use AsyncTask to show a ProgressDialog while doing background work in Android?

Hi, I am developing my first Android App and I need a ProgressDialog to be showed while a background task, in this case just a http call on the server, happens. I did a bit of studying on this and also have already checked other threads related to this subject. http://developer.android.com/reference/android/os/AsyncTask.html http://...

Returning to SurfaceView after another Acitivity has taken focus

I'm working on an RPG for Android, using the LunarLander API demo. I've already made a game using this demo (Porcupine Assassin, check it out!) so I've got a good grasp of the Canvas class and things of that nature. My problem is, in RPGs you need a way to access inventory, stats, etc. So I've set the BACK button to start the class Inve...

How many ViewStubs is too many for a single layout XML file?

I have a layout defined in an XML file(base_layout.xml) which may contain 20+ ViewStub definitions in addition to 3-5 other views such an ImageView and a LinearLayout containing 3-5 ImageButton views. Should i be concerned about how many ViewStub views i place in this layout file? I read on the developer.android site: A ViewStub i...

How to handle the 'back button' on android when I have a progress dialog pops up

Hi, When my android activity pops up a progress dialog, what is the right way to handle when user clicks the back button? Thank you. ...

Android: How do I reset/clear application preferences during unit testing?

I want to start with a consistent test environment so I need to reset/clear my preferences. Here's the SetUp for test I have so far. It's not reporting any errors, and my tests pass, but the preferences are not being cleared. I'm testing the "MainMenu" activity, but I temporarily switch to the OptionScreen activity (which extends Andr...

Cross platform Java? Android and desktop

We have a desktop/web java application and also getting into Android development. Ideally we would like one app that runs both on desktop and android. From what we can tell, it's not much possible to run normal java apps on android. But wondering if it can do it the other way? That is, run android apps easily on the desktop (without ...

how to Pan one image over another using a seekbar to control it?

Hi All, I would like to know how I can pan one image over another. I have tried using matrix.postTranslate (below) but it seems to have no effect. Can anyone suggest a method that would work. private void drawMatrix(){ Matrix matrix = new Matrix(); //matrix.postSkew(curSkewX, curSkewY); // matrix.postScale(curScale, curScale); ...

Streaming video to Android via RTSP

Hi All I'm trying to stream video to an android phone via rtsp. I think my SDP isn't quite right and there's something in it that the phone doesn't like. Below is the trace from the phone. Any idea what's wrong with the SDP that causes the player to give up? 10-08 14:11:22.657 I/RTSPEngine( 5031): RTSP Server response: 10-08 14:11:...

Any AppWidgetHost-tutorials out there?

I'm writing an application that should both have the ability to place widgets on the home screen, and to show these widgets in the application itself. I figure that the best way to do this is through the use of an AppWidgetHost for the application part. I've been looking around, but I cannot find any good examples on how to write AppWid...

How to draw or make a calendar?

Hey, I am trying to make/draw a calendar. I am currently using canvas to draw it but I was wondering if anyone knew of a better way? I just want to display a month view of a calendar. I have .ics files on an SD card. The only difficulty I am having is how to draw the actual calendar. I also am trying to to make it so when the user click...

Android: how to change part of image limited with Path?

Hi, I had two images. Initial state - image1 is shown. What I need: at some point change part of image1 with equal part of image2. Or, in other words - cut part of image2 and place it on image1. Part need to be changed is triangle or quadrangle I tried to use Path to make a form, clipPath on canvas and then draw image2. This follows (d...

can Android produce 2d image effects similar to those possible with Flash's DisplacementMapFilter class?

Hi all, I'm interested in reproducing the image effect seen in the iPhone app Wobble (where users could define circular regions on 2d images which would then have a displacement-like warp applied when the phone was tilted) for a game I am planning to deploy to Android. Does the Android API include 2d effects that could pull this off? ...

Saving/loading document state quickly and robustly for image editor

I'm looking for some critique on my approach for storing the state of a bitmap editor for Android and iPhone mobile phones. Even a "Looks fine to me!" response would be great! In the application, the current user document contains several bitmap layers (each maybe 1024 by 768 pixels) that can each be painted on. The basic requirements ...

Why does my android openGL ES test renderer crash

Hi Once again I'm trying to get into openGL, but as usual I choke when passing around vertices/vertixes/whatever and every little detail can lead to disaster (wrong format, initialization not properly set up, where memory are saved, etc.). My main goal is to use openGL for 2D graphics to speed up performance compared to regular cpu dra...

Regex for port numbers in Android?

Consider a regex for testing port numbers. (6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}) This is not valid in Android. Any idea what a port number regex should look like in Android? ...

What's the deal with Android web browser resolution?

Here are two images of the same android phone, once in Portrait mode, once in Landscape mode. Shouldn't one resolution be the opposite of the other? I.e. if one is 800x1360, the other should be 1360x800? What's going on here? If I try the same thing on my ipod touch, it reports the same resolution regardless of orientation. Also, on ...

How many times, and within what time interval, before Android stops restarting appWidget?

I have a problem in the field where my app widget stops working (display does not update on its AlarmManager timer-pop). I don't have logs for the occurrence, so I am trying to test for the condition that the process dies, but restarts. I then found out that if I die too frequently, then Dalvik does a force stop which is exactly the be...

Huawei U8100 connection error to Blocks Editor in AppInventor

I continue getting connection errors when I try to connect my Huawei U8100 to the Blocks Editor in AppInventor. My phone shows usb debugging as well as usb connected when plugged into my pc. I'm running Windows 7. Any help on this question is greatly appreciated. ...

How Do I Add A Push Pin

Hi, I have created a map to a location following this tutorial Here But no matter what I do I cannot add the push pin, when I get to here "To add a marker to the map, you first need to define a class that extends the Overlay class:" I get stuck, I have tried to add a MapOverlay following the HelloGoogleMaps tutorial on android develop...