android

Read mobile provider from the phone

Using my new Android phone established a small problem: I'm living in country A but my mobile provider is from country B, because it's just cheaper. Concerning mobile phone tarifs my country isn't a foreign country for country B. However I have to enable data roaming in my Android phone. The problem is, I'm also quite often in country C ...

Perceptual similarity between two audio sequences

Hi, I would like to get some sort of distance measure between two pieces of audio. For example, I want to compare the sound of an animal to the sound of a human mimicking that animal, and then return a score of how similar the sounds were. It seems like a difficult problem. What would be the best way to approach it? I was thinking to e...

How do I sort this JSON object by the languages on the right of each entry?

I am creating an Android app using PhoneGap and jqTouch, and I have a JSON object containing a word along with a language which that word is in. How can I sort this alphabetically, by the column on the right (the language), using Javascript? The end result should be Afrikaans as the first entry and Zulu as the last. var languages = { ...

How to get an EditText field prefilled after hitting the back button.

I have a setup view where the user can enter their name and email and click done when they are finished which navigates them to another activity1. When they are in activity1, and they hit the soft back button on the phone, it takes them screen where they entered their name and email. However, the name and email EditText fields are blan...

SpannableString with Image example

hello, i am looking for an example of how to build and display SpannableString with Image spans. Something like inline display of smileys. Thanks a lot ...

Android VideoView LinearLayout LayoutParams

My app plays a video using VideoView. I am using a LinearLayout to add some text, the video and then some buttons. My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones? Basically, when in portrait mode, I want the complete width to be used, and video height to be used. When in l...

Eclipse: How to ignore .git subdir when adding one project to another project's build path?

Hi, I'm developing an application that is supposed to run on both Android as well as regular Java SE. I have an eclipse project called foobar-core which contains code that is used both by the Android and the SE version. I have another project called foobar-android, which contains all android-specific code. I need to reference some of ...

Android - capture screen of phone as a movie

Hello, for the documentation of a project I would like to record the screen of my Nexus One as a movie or at least in form of a lot of images, which I can convert into a movie. Is that possible? Is there an app for it? For the moment I only know about this screen capture functions in the SDK's tool directory. ...

Problem searching my SQLite database which contains cyrillic data

Hi, I have a problem searching my SQLite database, which contains data written with cyrillic characters. If the key word is also cyrillic, then everything is ok, but if not, then I can`t get the result in my Android application. Does anyone have an idea how can I implement searching the cyrilic data no matter the charset of the keywor...

Displaying UTF-8 characters in a TextView

Do I have to do anything special to display UTF-8 characters in a TextView? I'm trying to display the following characters: זוג, למטרות רומנטיות, מיניות או אחרות, בהתאם להעדפותיהם. אתרי היכרויות מכילים מאגר מידע הכולל פרופיל אישי של מנויים. כל אדם המעוניין להצטרף לשירות, ממלא טופס הרשמה באתר ויוצר לעצמו פרופיל. If I use Log.d(TAG, tex...

How Can Get the actual Pre Shared Key to Application instead of "*" in Android

Hi All, I am building application related to WiFi using my Samsung Android Phone. Am trying to access the pre shered key to my application using WifiConfiguration class provided by Android. The getPreSharedKey() method returns only "*" if key is present and null if the key is absent.I need the actual the pre shared key. How do i obtain...

loading MapView from Main Activity slow animation almost hangs for a moment

i have the following code in a TabHost/TabWdiget for an activity in a Tab that has a ListView that calls my MapView if(_list.get(position).enabled) { convertView.setOnClickListener( new OnClickListener() { public void onClick(View v) { _context.startActivity(i); } }); } When the animatio...

Problem while opening Asset File with the help of Content Provider

Hi All, My requirement is to open one app's Asset file from another app via content provider.(I am exposing that file with ContentProvider implementation) I am able to open few files and read, but while opening some files I am getting exception. Please find the implementation for opening Asset File. @Override public AssetFileDescriptor...

Notification number does not display on all phones

I'm having issues with using the number property of the notificationmanager. It works on the emulator and other phone I've used. However, it does not seem to display on my Droid Incredible. ...

At the time of closing an application: How to stop a thread?

I use the following code to receive the data using UDP. When I click the back button my screen visual is closed and it shows the home screen. But a thread is working in the background (it receives the data from the UDP server). When I close the application I also need to stop the thread. How to stop a thread? public void onClick(View vi...

Search creates new activites in TabActivity

Hi, I want to develop a tabbed application on Android. At the same time, I want the search functionality to be present on some tabs. For this reason, I declared some activites in manifest file and added them to TabHost. But the problem is that when I make a search, it calls onCreate() method of the current activity which resided in tab c...

How to reset notificationmanager number on notification clear

What's the best way to clear the notification number when the user clicks on the notification? I say the best way, but really I haven't found ANY way. I'm launching a built in activity when the user clicks on the notification, not something I wrote so I can't clear it that way. I've got the notification manager's flag set to clear ...

Need example how to recover opengl in native code after new onSurfaceCreated

I am almost done creating a game for android using a port of irrlicht 3d engine to android. All code except a minimal frame work to make the native calls and play sounds is written in C++. Even the opengles display is created in c++ code using eglGetDisplay and eglCreateWindowSurface The problem I need to solve is that when home is pres...

Java.lang.SecurityException:SECURE PERMISSION in android?

Hi, Iam getting this error on my log 07-06 06:22:07.419: ERROR/AndroidRuntime(2618): java.lang.SecurityException: SECURE PERMISSION: Neither user 10070 nor current process has android.permission.WRITE_SECURE_SETTINGS. I used like this in activity file private static final String SECURE_SETTINGS = android.Manifest.permission.WRITE_S...

Turning a color bmp to grayscale:

I've seen this code on the web: Bitmap grayscaleBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); Canvas c = new Canvas(grayscaleBitmap); Paint p = new Paint(); ColorMatrix cm = new ColorMatrix(); cm.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(cm); p.setColorFilter(filter); c....