android

android softkeyboard onTouch()

What is best way to implement custom SoftKeyboard, so it recognize where user push, and where user release, and then use both coordinates to determine character? E.g. if i push Q, then move finger to E, then release. Application should get 2 coordinates. Basically simple line. One way is to make it trough buttons and using onTouch(View...

How to use SharedPreferences

Hi, I'm new to android development - using a book called Sams Teach Yourself Android Application Development in 24 hours. Followed it so far but got stuck trying to use SharedPreferences. In the folder src/com.androidbook.triviaquiz I've got a file called QuizActivity, in it I've got the following: package com.androidbook.triviaquiz; ...

Can I develop for Android Tablets without an actual tablet device?

I bought the Augen Gentouch78 to start dabbing in development for Android tablets, but this device is gravely excruciating to use (and I'm returning it). Is there a way to configure the emulator to tablet specs (namely Samsung Galaxy Tab)?? ...

Android: How to create a directory on the SD Card and copy files from /res/raw to it??

I am trying to create a folder and several subdirectory within it on the SD Card... I then want to transfer files that I have stored in /res/raw to that folder... I addition, I want this to only happen once, the first time the program is ever run. I realize that this is ridiculously open-ended, and that I am asking a lot... but any help ...

Android: Add event listeners to every item in a ListView

I have an Android app with a ListView, and each row in the list has a TextView and a Button. What I want to do is add an OnClickListener to each Button in the ListView, but I can't figure out how to get some sort of reference to every Button... Can anyone please give me a hint? Here's my XML that's bound to the ListAdapter: <RelativeLa...

Android UI Layout Question

I am new to Android programming and have done a lot of searching for the answer to this question however I can not find an answer. Maybe I am using the wrong search terms because it seems like a pretty basic request. I my design (as an example), I would have two text fields defined in my relative layout followed by an image and I would ...

Android camera unexplainable rotation on capture for some devices (not in EXIF)

What I'm doing seems like it should be simple, but I'm still lost after I've read every possible Stackoverflow answer I can find and Googled every article I can find. I'm using a preview SurfaceView and capturing an image from an activity that is set for screenOrientation="landscape" in my AndroidManifest.xml. I followed the sample Cam...

Trouble Creating a Directory on the SD Card

I am trying to have my app create a directory on the root of the SD Card, if that directory does not already exist. When I run the app, the "Creating Home Directory..." toast notification displays, but the directory is not created... What am i doing wrong?? (P.S. permissions are set for writing to external storage) public class Main ext...

In a WebView is there a way for shouldOverrideUrlLoading to determine if it is catching a redirect vs. a user clicking a link?

I would like to allow redirects to happen naturally in the WebView and only catch a new url if it is a happening because a user clicked something. ...

updating a device without cellular contract to froyo2.2

Since I already have a mobile phone (and contract), I bought a droid X without a contract so I could write apps for it. I am confused about how to update this device to 2.2 Froyo so I can get started with developing. Is there a guide or guidelines for the upgrade/installation process? It looks like the code is here, but I need help un...

Added permission WAKE_LOCK, now problems on Droids

I have an existing app that was working just fine on all phones. I added the permission WAKE_LOCK so I could control when the app goes to sleep. It worked fine on my HTC Hero, so I published the new update. I immediately started getting emails from Droid users that the app would not launch anymore on their phones after they udpated. They...

want to copy from one canvas to another

I want to copy the image drawn in one canvas (details) into another canvas. The commonly discussed solution of using bitmaps will not work because the Bitmap class does not have many of the important methods belonging to the Canvas class. Are there any other solutions? ...

Android Market - Error While Uploading APK file

Just now i have developed an application and now i am ready to upload it on Android market, but when i am trying to upload, it showing the following error messages: Market does not accept apk signed with the debug certificate. Create a new certificate that is valid for atleast 50 years. Market requires that the certificated used to sign...

Android webview crashing

Hello, Need some help/direction with this. In my Android game I am loading websites in WebView by calling webViewRowA.loadUrl(www.website.com) and after some time (random) the device crashes with the following traceback. java.lang.NullPointerException at android.webkit.BrowserFrame.getRequestInterceptor(BrowserFrame.java:1108) at andro...

Android: Problem with overriding onKeyListener for a Button

Hi, I want a certain functionality when Enter key is pressed on a Button. When I override onKey(), I write the code to be executed for KEY_ENTER. This works fine. setupButton.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { if (KeyEvent.KEYCODE_ENTER == keyC...

sample code to implement rtmp in android

I want to play online radio in android application? It can be done RTMP. But i am not aware how to move ahead. Can some one throw light on this? ...

Problem download images from https link and update imageview image.

I am able to download images from normal http but not from https link ,dont know whats the problem with that... I used two way to download images from normal http link I. Using URL to HttpUrlConnection public void downloadFile(String fileUrl){ URL url =null; try { url= new URL(fileUr...

how to create a directory in sdcard

hello guyz i have been trying to create a directory in sdcard programatically but it always showing me directory not created. my code is this. boolean success = (new File("/sdcard/map")).mkdir(); if (!success) { // Directory creation failed } Log.i("directory not created", "directory not created"); ...

Retrieve android:versionName from Library Project

Hi, I have created a Library Project which I import into another project. In that Library Project at some point I retrieve it's android:versionName To do that you need to supply the package name. The problem arises when that code is executed when the Library Project is included within another project, then it seems that that code throws...

Two misplaced lines in UI for Android activity

Hello, I have a problem with designing an UI Android activity. There are two blocks of misplaced graphics on the left and right of the activity - they are two lines just bellow the titlebar with 1px height and about 5-10px width. They cause buttons to break at their left and right parts. I cannot figure out what the problem is. I am usi...