android

Can't use ServerSocket on Android

I'm trying to listen on a port using ServerSocket on an Android device. I want to be able to connect to this port over WiFi using a computer on the same network. I get no exception when binding it to a port, however when I check netstat it says: Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 ...

Java - (android) Reuse a process after flushing its OutputStream

Hi, im trying to do this on Android: Process p = Runtime.getRuntime().exec("sh"); DataOutputStream out = new DataOutputStream(p.getOutputStream()); out.writeBytes("something useful\n"); out.close(); p.waitFor(); out = new DataOutputStream(p.getOutputStream()); out.writeBytes("something useful\n"); out.close()...

Opening an outside activity in TabView (Android)

I have a working TabView in Android, and would like to have a few more items available by pushing the menu button. I currently have a menu there, and can start new activities, but the content makes the TabView disapear rather than putting the content in the TabView. Is there any way for me to force / allow new Activities to open in the t...

Setting focus programatically in ExpandableListView. Emulating D-pad clicks in code?

I have subclassed ExpandableListActivity to create an activity that presents a simple tree view of the 'world at large' and allows the user to select one for further use by the app. I am having trouble setting focus programatically. One thing that baffles me is that I can use the D-pad to set focus on any of the child or group items in m...

WebView Inside TabView fail.

I have been trying to add a WebView inside one of the tabs in TabView but it isn't working. When I go to the other tabs i just have TextViews and they work fine, but as soon as I click the tab with the web in it, error it closes unexpectedly. here is my search_result.java that has the tabview package supa.mack.doppler; import android.a...

Null Pointer Exception during PerformFiltering on an AutoCompleteTextView

Hi, I have successfully implemented a custom SimpleCursorAdapter for an AutoCompleteTextView, which suggests entries from the database according to what has been entered into the box. However, I am getting the following non-fatal errors: An exception occured during performFiltering()! java.lang.NullPointerException at com.stev.LondonTa...

Android Compass Reading Different Values On Different Phones?

Hello :) I am working on an application that uses the compass and location to draw an arrow at the direction of a location. My problem is when I run my code on the emulator, all the arrows point the correct directions, and when I change the orientation of the emulator to landscape, all the arrows are still correct. But when I run the sam...

On Android, how do you switch Activity's programatically?

It seems like every example I can find of switching between Activity's involves creating an Intent and passing in the context of a View via an OnClickListener associated with a button. But what if you just decide you need to switch Activity's? In my case, a Preference value is causing an Activity switch. How do you create an Intent that...

Writing to internal SD card on Android

Is there any way of accessing the internal SD card on Android devices that have internal flash, internal SD and external SD cards? ...

How to make two slideable sections on android device screen?

How to create custom view with two independent sections, each slideable? Example would be iPad Zillow -> http://www.zillow.com/ipad/ I was wondering if this can also be done on the home screen and not only in new app... ...

Adding items to Android Maps Overlay does not immediately show on map. How do I fix?

Hello, I can't figure out how to tell my Map to redraw its overlays once I've updated them. Can someone enlighten me? Currently the user has to touch the screen before the map is redrawn. Thanks! ...

unable to connect to internet from android when laptop is using wifi network

Hi, I am using laptop and connected to wifi network. I have started the android emulator and open the browser to browse. But it is not working. thrown error saying network connection not available. But I am able to browse in my laptop. How I can enable emulator to use wifi network for internet? Please help me. ~JP ...

Android get width returns 0

I creating all of the elements in my android project dynamically. I am trying to get the width and height of the button so that I can rotate the button around. Just trying to learn how to work with the android language. However, it is returning 0. I did some research and I keep seeing that it needs to be done somewhere other than in the ...

Send data via bluetooth from android

Hi, I need to send a package via bluetooth from android device to desktop. example: package.data="$85"; package.command="go"; How can I do it? I establish a connection with desktop by default resourses on android. Thanks! ...

How to do opposite of of preference attribute android:dependency?

Is there XML attribute that does the exact opposite of android:dependency? What I would like the dependent preference to be enabled when the other is NOT checked and disabled when it IS checked. edit: maybe the issue isn't with android:dependency maybe there is an xml attribute that I can add to make the default for that preference di...

Looking for help with 2 errors when compiling the application.

Good evening everyone! I am working on learning some java and I have made it to the notepad tutorial and when I go to run it on the emulator, I am getting a few errors, and I'm hoping someone here may be able to help. package com.a8a.todolist; import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import a...

Background image with moving foreground graphics

Hi, I would like to know what the best way would be to draw a background image (this would be pretty much static) and a foreground object which would move depending on user input in Android? Sort of like a side-scroller game (when the foregroudn object needs to animate and change a lot more than the background). TIA ...

How do I convert eclipse App for phone?

I have downloaded eclipse and the Android sdk and I have now used eclipse to design an android app which runs fine on the emulator. I have also downloaded and installed Kies for file transfer between PC and Samsung phone. I used Kies to download a free app from Android market and checked the format of the downloaded files, one is an ‘app...

Camera force close when returning from sleep. Android

In my app I'm capturing an image. Everything is working fine unless the phone goes to sleep while the preview is running. Not really sure how to handle it, I'm thinking that it may be best just to prevent the phone from automatically going to sleep while this process is in action. Which i do not know how to do. and if i do that will it p...

Showing GPS location on a JPG map?

Hi, I have a georeferenced image that's really an image of a map. I know the latitude and longitude of several points on the image and I'm trying to figure out how to display my location on the image. Similar to how Google Maps works, but instead of using Google Maps I'd like to use the map I have a JPG of. Any ideas on where to star...