I am throwing HTML to a webview to render. In the HTML I need to load an image that I have in /res/drawable.
I have /res/drawable/my_image.png and code such as this:
final WebView browser = (WebView) findViewById(R.id.my_webview);
String html = new MyHelper(myObject).getHtml();
browser.loadDataWithBaseURL("", html, "text/html", "UTF-8"...
I just started testing my app on android 1.5, and it doesn't want to run at all. I have a breakpoint in onCreate on my main activity, but I get a ClassNotFound exception even before reaching that. The class not found appears to be the class of my main activity. The exception happens in:
ActivityThread.performLaunchActivity
It runs f...
Hi
I have written two test cases in a package com.app.myapp.test
When I try to run them both of them are not getting executed, only one test case gets executed and stops.
I have written the following testsuite in the same package
AllTests.java
public class AllTests extends TestSuite {
public static Test suite() {
return new ...
I dont want to hardcode the name of the package or where it lives when building an Android project with ant. Im using the build file generated by Android. What properties contain the output folder (bin) and package name (e.g. package.apk) ?
...
Hi,
I'm planning to use my website to provide updates for my android application whenever the user decides to perform an update( in case there is one available) . I'm thinking to use http requests for the communication between the user and the server, so whenever there is a new update the server sents back to the user the link to downlo...
Android comes with lots of system resources (android.R) that can be used to save you time and make your application lighter.
For example, I recently discovered that Android provides localized strings for Yes (android.R.strings.yes), No (android.R.strings.no), Cancel (android.R.strings.cancel) and Ok (android.R.strings.ok), among other s...
Hi,
Could someone provide the basic code to use if I want to perform a http request on android to the address "address" with the string "message" ? Also I'd like to check the server response and perform some actions if the right conditions meet , but I ' m unsure of how and when the server send back the response . My guess is that the r...
i wonder how you can make an advanced Android User interface where you can add for example a drag drop and more graphics options? is that by using OpenGl ?!
this is example of UI in iPhone Apps.
example 1
example 2
Thanks
...
I would like to handle pinch events in my Android application to zoom in and out.
I believe Android 2.0 has multi-touch functionality, and heard that Android 1.6 might or might not support it depending of the device.
What's the best way to detect pinch events, while degrading gracefully for devices that don't support it? I'm targeting ...
I am unable to override attributes when using <include> in my Android layout files. When I searched for bugs, I found Declined Issue 2863:
"include tag is broken (overriding layout params never works)"
Since Romain indicates this works in the test suites and his examples, I must be doing something wrong.
My project is organized like t...
Hi All,
I am having a weird issue with serialization of a Hashtable. I have made a Server, Client app. Where server(PC/MAC) is serializing a Hashtable and sending it to Client(Android) through UDP. The data is sent/read correctly but I get a bunch of these messages below on LogCat.
04-12 11:19:43.059: DEBUG/dalvikvm(407): GetFieldID:...
I just bought a Google Nexus One smartphone, and I want to write a small Android application for fun. Suppose I can get my current GPS coordinates, so then how can I programmatically find nearby landmarks or points-of-interest within some radius? Is there an API to get GPS geo-tagged landmarks, like in Google Earth's database?
For examp...
can we add the interactive ui to the instrumentation test case and get the the values dynamically and put assertions based on them.
...
I was wondering if there was a way to switch the side that text appears on a radio button in android?
...
I'm trying to change the ringer mode of the phone to RINGER_MODE_SILENT when a call is incoming by using the following lines of code.
AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
am.setRingerMode(AudioManager.RINGER_MODE_SILENT);
While the phone stops ringing it continue to vibrate although the docume...
If got some issues with a notification I want to show in the notification bar. Although I set the notification flag to Notification.DEFAULT_LIGHTS & Notification.FLAG_AUTO_CANCEL the notification doesn't disappear after clicking it. Any ideas what I'm doing wrong?
NotificationManager mNotificationManager = (NotificationManager) getSyste...
I've read the Android documentation:
http://developer.android.com/guide/practices/screens_support.html
but still have some questions.
I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit al...
Hi,
My app offers a "share/tell-a-friend" function. When the "share" button is pressed the following method is being called to open a list of apps, which can perform the action (Eg. Gmail, Twittroid, Facebook...):
public void share() {
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/...
I am trying to receive an image from the Android Gallery via an ACTION_SEND intent. I have set the proper intent filters and the Gallery opens my app. Now I want to know how to get at the image data. I can't find any examples on the internet of how this is done. I figure the path is somewhere in intent.getData() but how exactly do I pull...
Hi, I'm trying to get my Android app to play a .wav file recording of the word "Spinach Salad" whenever it sees that phrase being spoken by TTS. Here's the relevant code:
spinach_salad.wav is located in /res/raw
prodName = "Spinach Salad"
mTts.addSpeech(prodName, "com.example.textextractor", R.raw.spinach_salad);
...and later in the...