android

Accessing private members inside an AlertDialog's onClick event.

Hello. I'm very new on Android development. I have this: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.message_user_registered) .setCancelable(false) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, in...

Google Map API, with my own created Map figure

In android, is it possible that I would create my own Map figure, and then use this Map with the gps location from Google Map API Example, I draw a map for my own house, then apply Google Map API to be able to make the location of each point in the map ...

Android Bitmap is black

Hello, I'm trying to draw a map from a textfile onto a Bitmap, but the Bitmap is all black First i load a textfile that looks like this (shortened): 0000000000 (200 width) 0111111110 0111100010 0000111110 0000111000 0000000000 (120 height) Where "1" is ground and "0" is a wall, 1 should be white and 0 should be black. Code: public M...

How to upgrade sqlite database file

Hi all, Im doing an app which uses sqlite db file in assets folder, There is a screen in my app having a button 'check for update'. Client has given me an URL link to update db file(which gives a sqlite file). When user clicks on the button i need to upgrade the old db file with new db file from URL. Please suggest me how i can do t...

iPhone similar tabbar

Hello people, i'd like to have iPhone similar tabbar in my Android-Applications or to write my own tabbar. I found already, how to place tabs at screen's bottom. It's really easy. I found this tutorial as well, which looks very nice, but it works (is it true?!) only on SDK 1.6 and later, because of setIndicator(View v) But maybe anyb...

Need efficient data mappings example for a ListView drill down in Android/Java

I'm pretty new to java programming and am looking to do basic data mappings. I have a ListView object with a simple data array setup like this: setListAdapter(new ArrayAdapter<String>(this, R.layout.my_list_xml, MY_DATA)); What I want to happen is when you click an item it goes to it's subcategory. I'm not worried about switching th...

Authentication Error

I am trying to view a web page, fron an Android app, that requires authentication and get the following message: ----- Android webView error start -------- "You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending WWW.Authenticate header field that the Web se...

Android. How to make view clickable when mediaplayer stops playback

I have Acvtivity that creates view and mediaplayer. I want to use OnCompletion event to make that view clickable. But it throws exception, I don't know why. Probably, mediaplayer runs in another thread and cannot access elements from main ui thread? Thank you for any information ...

Bluetooth creates socket but blocks at connect() ANDROID

I am using code from the Google Bluetooth Chat Example to set up a bluetooth listening server. I want the app to listen always for an incoming connection. When the app sees a connection request it will accept the connection, read in the string that the remote device will send, and then respond by sending a file. The problem is that th...

Android: change tab colors, tabwidget

Hi All, I was wondering... how can I change the tab colors when selected and when deselected. Here's a picture of how it looks now: http:// i.imgur.com/FOT4Q.jpg I would like my tabinterface will look like this: http:// www.technobuzz.net/wp-content/uploads/2010/02/seesmic-android-260-208.png So i can't change my colors of the tab...

How can I keep the MediaRecorder keeps recording after an orientation change

Hi, Can you please tell me how can I keep the MediaRecorder keeps recording after an orientation change? I try looking into source code of packages/apps/SoundRecorder/src/com/android/soundrecorder/Recorder.java, I don't see it handles that cases. Thank you. ...

how to change font color in selected/focused ListView items?

Hi, I am struggling with this which apparently is a very simple effect but incredibly haven't found any intutitive way for doing it in Android. I have a ListView and I managed to customize the background images so the selected item gets highlighted by getting a new background drawable. This I do creating a new style where I set the and...

Android 1.6 SDK - Internal File Path Issue

I am trying to read a csv file from assets/file.csv, but the log keeps spitting out that it doesn't exist. Is my path correct for internal file storage? This is the class file: package com.xxx.view; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.StringTokeni...

Ecoding raw audio to mp3/ogg

I have a buffer of raw audio coming from AudioRecord and I want to convert it to mp3 or any other format for emailing it. any ideas? ...

ListActivity/ListView content is "disappearing"

I'm having a problem with my ListView in a ListActivity with a Custom ArrayAdapter. When the ListActivity becomes hidden (paused, whatever), the data that was present in the ArrayAdpater seems to go away. Rotation works fine, but I am only assigning the array in the ArrayAdapter in the onCreate(), nowhere else. The array is stored in ...

Android custom title bar, does not work with android:label from manifest.

I have a custom title bar that I would like to apply to all my activities. I have searched online and found a few ways of doing that however I have ran into a problem. It seems that despite the fact I have a TextView in my titlebar with id @android:/title, Android will not use the value defined in the manifest in android:label for each ...

Android app activity always restarts

Hello, Often when I open my Android app from either my Home screen shortcut or from the apps menu it restarts the main activity. How can I prevent this behavior and make it bring the existing instance to the foreground if there is one running? I've searched quite a bit to no avail. It would seem as though most others are not having th...

Video stream (MPEG4 video) not showing on android using MediaPlayer?

There is an online stream that is 512Kb MPEG4 and total size of 312mb online and if I'm correct after looking over docs in order to play the movie I just simply put: MediaPlayer mp = new MediaPlayer(); Try{ mp.setDataSource("http://site.com/movie.mp4"); } Try { mp.prepare(); } mp.start(); It is triggered to play after a button pre...

Android: save sound as ringtone / SQLiteConstraintException

Hi, I'm trying to save a sound as a ringtone in Android using this code. It works like a charm but will fail if I try to save a ringtone that has already been inserted. A "SQLiteConstraintException" occurs while saving but I'm not able to catch the exception, in fact, I can't catch any execption. Here's the part of my code: Uri uri =...

What exactly is a Context in Java?

I Googled this and read the Java documentation, but I'm a bit confused. Can somebody please explain what a Context is in plain English? ...