android

Take photo using key or motion event by any method in Android?

Hi, My aim is to take a photo using the native android camera by using the Key or motion events. But it is not possible. I tried with junit testing. Code for invoking camera **package com.two.camera; import android.app.Activity; import android.content.Intent; import android.os.Bundle; public class CameraTwo extends Activity { /** Calle...

How can I replicate the home screen dots?

On Android, the home screen has dots to indicate which screen you are on. I want to do something similar in my app. Is there a control that contains dots and lights up? ...

Android: How to allow third-party developers to skin my app?

What's the recommended approach for letting third parties skin my app without resorting to me packaging their themes in before hand? aiMinesweeper offers an interesting approach- it let developers create a "skin app". How is the host app then able to load skins from the skin app? ...

How does an activity in a tab knows it switch to another tab

Hi, In android, I have a TabActivity with 2 tabs and each tab has it own activity (say ActivityA and ActivityB). When I am on ActivityA, and I click on ActivityB's tab, how does the ActivityA knows it is no longer the active Tab? ...

Handling of Multitouch

Hello, So all I'm trying to do is draw circles around two points that are being touched, and as the fingers drag along on the screen, have these circles follow each finger. However, I'm getting some weird behavior that I can't figure out. So when I place two fingers on the screen I get my circles no problem. When I drag around with the...

Get row position in onCreateContextMenu

Hi, I'm trying to create a context menu that changes the available options depending on which row was clicked. But I can't figure out how to get the row position in the listview for row that was clicked, until after the menu is created. ...

A project with that name already exists in the workspace eclipse

I'm new to Eclipse/Java/Android I have already created this project, but I wanted to start over. deleted the HelloAndroid folder from my workspace folder restarted Eclipse now I can't create a project with the same name, because Finish is greyed out, and it gives me the following message: A project with that name already exists in the...

Recommend me some good Java for Beginners books

I've been looking into Android development, and while I understand the concepts, all of the Java stuff goes right over my head. XML is easy to pick up on, but I quickly found out that advanced Android development is simply not possible without a good understanding of Java. I looked at this book and it seems pretty good: http://www.amazon...

Android rooted phone screenshots

I'd like to take screenshots on my android phone. I'm an app developer and have a pretty good understanding of the regular API, and I know this steps out of the "regular" thing quite a bit. I would have root access. I've seen a few apps that do this. I'm just wondering how one goes about doing it. Anybody know the general direction ...

Java - input first name middle initial and last name?

I am trying to create a java program that takes the firstname mi last name input and outputs "FI MI lastname" thank you. this is for a friend and i've not programed in ...... 15 years. ...

Can you turn off the cell radio with the public sdk?

Is it possible to turn off only the cell radio using the public sdk? I know you can enable airplane mode, and I have even used airplane mode while leaving wifi enabled. The problem with airplane mode is that no matter what you do, bluetooth is disabled along with the cell radio. I would like to disable the cell radio and not touch wif...

Notepad Tutorial Android - menu problems

Hi! I am working on the Notepad Tutorial on the Android dev site, part 1. I have done all the code as in the tutorial, also tried with the code form the downloaded solution. When i launch the app I don't see a button "Add note", and therefore I cannot continue with the tutorial. It seems like the methods aren't firing? All i see is t...

My app frequently throws android.view.WindowLeaked exception --

My app frequently throws exception like below: E/WindowManager( 6282): android.view.WindowLeaked: Activity com.myActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4479b710 that was originally added here The app shows a progress dialog when the main activity starts and starts a task. When the task is done...

Using Parcel to clone an object?

Hi, I have a class which has implemented Parcelable. Can I do something like the following to create a new instance of a class?: Foo foo = new Foo("a", "b", "c"); Parcel parcel = Parcel.obtain(); foo.writeToParcel(parcel, 0); Foo foo2 = Foo.CREATOR.createFromParcel(parcel); I'd like foo2 to be a clone of foo. ---------------------...

Improving upload speed by sending chunk of bytes

I'm developing an android video uploading app and uploading large amounts of video is a problem, I get different type of exception sometimes (host not resolved, pipe broken), I do a multipart POST but I have a feeling if I upload chunk of bytes one at at time that'll increase upload speed as well as solve connection timeout and these typ...

Log.d and impact on performance

I'm not entirely sure about what I'm reading in the documentation. Is it ok to leave a bunch of log.d pieces of code scattered about, or should I comment them out so that they don't impact my app's performance. Thanks, I'm a little confused because if you read about the log object (http://developer.android.com/reference/android/util/Lo...

MediaPlayer cant play audio files from program data folder ?

Hi all! When i record my audio from MIC and store file in /data/data/..... why MediaPlayer can't play this file ? If i change destination to / sdcard/..... - all works great. I do something wrong ? I not found limitation for MediaPlayer. Device - Samsung T959 (Galaxy S) Thanks, i hope anybody know solution.... ...

HttpDelete with body

I'm attempting to use an HttpDelete object to invoke a web service's delete method. The web service's code parses JSON from the message's body. However, I'm failing to understand how to add a body to an HttpDelete object. Is there a way to do this? With HttpPut and HttpPost, I call the setEntity method and pass in my JSON. There doe...

[Android]Find out which browsers are installed?

Hello, I'm looking for a way to find out which browsers are installed on the Android Smartphone and their package names. Why do I need it? Well basically, my App reacts on certain URLs, i.e. http://bit.ly, so when the click such an he will get an choice in which App to open it. So far everything is working as intended. If the user...

Android - How to get compass direction

I want to show the direction on the screen that phone is facing. For example: 0 |- [] |_ South --- North In the above diagram the phone would display "North". Since the user (the stick with 0 for his head) is holding out the phone (the [] in the diagram) pointing north. I found this example. I understand what it's doing...