android

Android's version of C#'s Console.WriteLine?

In Android, what is the best way to write to the console. In C# I'd use either Log4Net or just Console.Write ...

Android Multicast Socket Performance

I seem to be having some trouble transmitting files to an android phone using multicast sockets. The files vary in size, but none are more than 1MB. The algorithm that I am using is structured to handle for lost packets (by asking for those packets again) and out of order packets --- but sometimes it just doesn't work on android. Sometim...

Android Loud speaker and call interception

Hi, I would like to know how to intercept incoming calls and activate loud speaker automatically. I read this class is used com.android.internal.telephony but I could not find propre documentation. Thanks for your help. ...

Should one use an Activity or a Service when using a button in a Widget?

I'm been trying to figure this out for a while now, and have just become more and more confused. I have made a Android Widget which displays two articles (title + image). In addition to this, I have buttons for flipping backward and forward through the articles. What I don't understand is how I can change the Widgets RemoteViews when th...

Display gif on imagebutton android

Hi, I was wondering if it is possible to display a gif animation on an image button. I followed the example on Android API BitmapDecode sample and can now display animated gifs on the canvas. Is it possible to display this same gif on an imagebutton. I tried using the setBackgroundDrawable() and setImageDrawable() but it gives me an e...

How to set image from database.

Friend's, I have a problem in fetching image from database,when i store the image url in database has Blob data type in sqlite, where the code for inserting is DefaultHttpClient mHttpClient = new DefaultHttpClient(); HttpGet mHttpGet = new HttpGet("http://www.dashfire.com/jackrobie/media/catalog/product/cache/1/i...

Webview not working?

Hey Guys, I've got the following method... public class Image extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu); /* Using WebView to display the full-screen image */ WebView full = (WebView)findViewById(R.id.webview); /* Set up the Zoom cont...

Internal compiler error when compiling native Android code.

Hello, Currently I am trying to compile native code for Android. The code is from the OpenCV port for Android. I pasted all the code correctly in my project and edited my make files accordingly. When I set android:debuggable to false everything works fine and I get my native library. When I try while android:debuggable is set to true I ...

GridView and a central column

What I want is a central column using GridView, but everything I try does not work. It always aligns to the left. I have tried messing around with layout_gravity and gravity to no avail. I have a GridView in a LinearLayout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" an...

Android: What is best layout to use when trying to get 2x2 image buttons, and more?

I am trying to make my layout look like so. I have tried gridviews, table layouts, and more but cant get it to look right. I want something like this. ImageButton ImageButton2 ImageButton3 ImageButton4 ImageView1 ImageButton5 ImageButton6 ImageButton6 ImageButton7 ImageButton8 (these are smaller icons) ImageButton9 (sma...

[Android] Defining custom attrs

Hi I need to implement my own attributes like in com.android.R.attr Found nothing in official documentation so I need information about how to define these attrs and how to use them from my code. Thanks ...

Android: Change absolute position of a view programmatically

If you use an AbsoluteLayout (I know that it is deprecated, but it was the only way to solve my problem ) you can give the childViews the tag "android:layout_x" and "android:layout_y" to set their absolute position within the AbsoluteLayout. However I dont want to set these informationen in the xml, because I only know them at runtime....

can not install apk from email attachment to phone getting parsing error

I have built a test android app and signed it successfully and then sent it to someone to test via email. They click on the attachment in the email on their android phone and get a parsing error. They have 2.1 android the test app was built using 2.2 would that cause an issue? can email attachments of apk files not be installed ...

Exception Handling

I read somewhere not to exception handle when developing in Android, is that true? If one does need to exception handle are there any logging tools for 2.1 and above? If shouldn't exception handle, why is it not recommended to at least use the below? try { body-code } catch (exception-classname variable-name) { handler-code } ...

How to set android wallpaper

Hello I am wondering if someone can help. I would like to create a simple wallpaper test app. I have tried a few things with no success. Eventually, I started playing with gallery codes and have a few achievements. But ... I am not sure how to attach a wallpaper function to the gallery. I am new to all this (I am only a few months into ...

Custom Hardware

I am in the process of redesigning my EE seniro design project (Digital Car Instrument Cluster) and would like to port the system from a custom light weight ubuntu to a android based system. I was wondering can we install android onto a small atom based motherboard and if so does anyone know how we can writer driver to communicate with ...

Timer do its work just one time

Hello togehter I need a regular method in my app. The problem is: the following timer in the code do its action just one time. And the timer do it only(the one time) if i do an action( touch the display) after the time(2000) is over. U know what i mean? Maybe it have sth to do with the "OnTouchListener"? public class DrawView extends V...

Choose Contact from a Dialog window

I have a Dialog window created via the onCreateDialog() callback of my Actvity. In the Dialog I would like to allow the user to enter an email address or to select a contact from their contact list and have the email address populated based on their choice. This can be accomplished using: Intent intent = new Intent(Intent.ACTION_PICK, ...

Class instance sizes in Android

Hi guys, I'm currently implementing some image processing code for Android. I'm aware of the memory limits and am happy to code within them. However, I cannot find any documentation that lets me work out how many bytes are used for each instance of a given class that I might want to instantiate (on the heap). I'm an experienced C++ pro...

Draw view on Image within xml

Hello all, can you help me by sharing your knowledge on how to draw a small rectangle on top of image in android. I have main.xml and there are some widgets. right at top, there is a image and I would like to draw a rectangle on that Image and display both while app is running. Here is how my xml file looks like: <?xml version="1...