android

TabActivity and Activity event Handling

Hi, I followed the tutorial "Tab Layout" and i created my TabActivity with some tab, in particular i have a tab called "newTab" with a button and i want to add a new tab when i press it. If i implement the OnClickListener in the newTab Activity i don't know how to call the tabHost.addTab() method because it is a TabActivity method, and ...

Android, Quick question on service binding

Is there a way to find out if an activity is bound to a service? Something like boolean isBoundToService(ServiceConnection sc)? Sometimes when I play around with my app I get an exception when it tries to unbind a service which is not bound. ...

android: getting rid of "warning: unmappable character for encoding ascii"

I'm compiling using android tools without eclipse. I compile launching "ant debug" from command line. I have found many many instructions around the web about how to remove with annoying warning, but I haven't been able to make any of them work. I've tried -D option, I've tried randomly tweaking build.* files, I've tried exporting an ...

Android problem with opening a second activity and fails to launch

Hi there, Bear with me as i'm just learning about Android. What i'm trying to do is to open an Activity when i click on a button. This is my code in my main activity public class MainPage extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(sa...

How to place a drawing inside a layout element in android

I'm just starting with android programming. I have a canvas which I've drawn on, and now I'd like it to appear inside a container in a layout. How do I do that? I've tried making a class that extends a View object and I can get it to draw on the entire screen, but I don't know how to get it to draw just inside the ImageView container in ...

How do you create a Google Maps-esque drop down dialog?

In the Google Maps application, when you open the menu and click on "Directions", it pops up a dialog that is unique to Google Maps. It keeps the MapView in the background, but displays the search dialog from the top (or bottom, if you're on an old version of Android). I was curious if anyone knew how they achieved this effect. I'm wi...

What can I access in Androids Native libraries? And How?

I am completely new to the NDK. I have done a couple of the tutorials including the hello from jni one and another one that calculates the sum of two numbers. They involved using cygwin and the ndk to create the library so file and I have a bit of a grasp on how to insert my own libraries into the libraries layer of Android. I have no...

Synchronizing the sqlite database on Android to a Sybase database on server

I'm currently developing a Field-Service application that stores data in the local sqlite database on an android device. At some point, usually after completing the data collection rounds, the local sqlite db is to be synchronized to a remote sybase db on the server. Any suggestions as to how this could be achieved or engineered as a so...

android camera preview / photo problem

I can't found any solution to my problem: I've a camera preview with some width and height (example: 720x480), then I overlay an image on the camera preview, when I take a shoot I add this image to the camera photo but the picture size (2048x1536) aren't the same width and height of camera preview, then X and Y of this image overlayed ...

Cannot write to SD card -- canWrite is returning false

Sorry for the ambiguous title but I'm doing the following to write a simple string to a file: try { File root = Environment.getExternalStorageDirectory(); if (root.canWrite()){ System.out.println("Can write."); File def_file = new File(root, "default.txt"); FileWriter fw = new FileWrit...

Masking a Drawable/Bitmap on Android

I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android. I'm curious as to what the best way to do this is. I certainly have a couple of ideas for how to do this, but they are not optimal. I need to be able to apply a new mask to the image every so often (the b...

What's the most "death-resistant" component on Android?

I'm looking for the most suitable class to be a dispatcher for AsyncTasks invoked from my Activities. I think it could be one of these: subclass of Application; subclass of Service; my own static stuff. As for me - it's simlier to implement the 3rd choice. But the question is will it be more "death-resistant" than Service or Ap...

What developer conferences/code camps would one go for mobile development?

I maintain and develop on the Windows Mobile platform. I know the market is changing rapidly with iPhone and Android gaining market shares. There are also app development platforms like rhomobile/titanium. Are there any platform/non platform specific mobile conferences this year? What would be some of the important/useful conference...

autoLink for map not working

I have the following TextView in my XML layout file:- <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/autolink_test" android:autoLink="all" /> The string autolink_test contains a phone number, an email address, a website address and a physical geograph...

Simple Android File Output Problem

Hi everyone, I'm kinda stuck with something which must be appalingly simple. I'm trying to write a few variables to a file, each on it's own line so that I'll be able to use readLine in another method to read the variables back in. Here's the code: package com.example.files2; import java.io.BufferedWriter; import java.io.File; import...

Android: how to change the time in emulator?

Hey guys, Ive noticed that the time in my emulator for android projects is wrong. Its one hour behind. How do I go about changing the time and can I do it in eclipse? Thanks ...

Update existing Preference-item in a PreferenceActivity upon returning from a (sub)PreferenceScreen

I have a PreferenceActivity with a bunch of (Sub)PreferenceScreens. Each such (Sub)PreferenceScreen represents an account and has the account-username as its title. PreferenceScreen root = mgr.createPreferenceScreen(this); for (MyAccountClass account : myAccounts) { final PreferenceScreen accScreen = mgr.createPreferenceScreen(this)...

Android Button events doesn't work with touch events

I use example with zoom and scrool big image, which use GestureDetector code here . When I place button on it, I cannot handle any button events - both onClickListener, OnTouchListener doesn't fired. public class ScrollableView extends AbsoluteLayout implements OnGestureListener, OnDoubleTapListener { private GestureDetector mGestu...

Dynamic Midi generation and playback on Android: Possible?

Strangely I find no support for Midi in Android. The only thing that comes close is the Jetplayer, but this only takes a existing .jet file. I want to dynamically generate a midi file with some intervals and play it. I even thought about just manually creating a .jet file with a tone and then transposing it with the jet player, but it ...

Check if directory exist on android's sdcard

How do I check if a directory exist on the sdcard in android? ...