[android-developers] MulticastLock Example?
Can anyone point me to a good example of how one would use a MulticastLock to receive multicast packets? Do I just have to acquire the lock and then I can receive all the packets I want or should I only use the lock right when I'm receiving multicast packets? Thanks in advance for any replies! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Service restarting for no reason?
While debugging one of my apps (one that sits in the background and logs accelerometer data), I noticed that it would randomly and without any prompt reset itself. It would be running it's normal timer task and suddenly it would stop, the create function would be called and any running task would halt. Here's the trace: 03-11 07:50:34.574: VERBOSE/AccelerLogService(29277): 0.088633,1.253072,1.103248,9.629586 03-11 07:50:34.584: VERBOSE/AccelerLogService(29277): History Size: 0.08336 03-11 07:50:35.064: VERBOSE/AccelerLogService(29277): 0.096283,1.253072,1.035146,9.629586 03-11 07:50:35.084: VERBOSE/AccelerLogService(29277): History Size: 0.1 03-11 07:50:35.544: VERBOSE/AccelerLogService(29277): 0.104550,1.253072,1.007906,9.575105 03-11 07:50:36.044: VERBOSE/AccelerLogService(29277): History Size: 0.1167 03-11 07:50:36.484: VERBOSE/AccelerLogService(29277): 0.120600,1.239452,1.035146,9.615966 03-11 07:50:37.024: VERBOSE/AccelerLogService(29277): History Size: 0.1334 03-11 07:50:38.994: VERBOSE/AccelerLogService(29277): 0.136867,1.293933,1.035146,9.615966 03-11 07:50:39.014: VERBOSE/AccelerLogService(29277): History Size: 0.15 03-11 07:51:03.984: VERBOSE/AccelerLogService(29395): CREATED 03-11 07:52:41.624: VERBOSE/AccelerLogService(29502): CREATED And here's the service code: public class AccelerLogService extends Service implements SensorEventListener { private static final String LOG_TAG = AccelerLogService.class .getSimpleName(); private static final String base_dir = "/sdcard/"; private static WakeLock wl; private long startTime; private volatile float[] lastData; private static Queue lastFiveMinutes; private static BufferedWriter br; private static Timer timer; private static TimerTask tt; float threshold = 0.0f; int interval; private boolean getAccelerometer() { SensorManager sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE); List sensorList = sensorMgr .getSensorList(Sensor.TYPE_ACCELEROMETER); boolean addedListener = sensorMgr.registerListener( (SensorEventListener) this, sensorList.get(0), SensorManager.SENSOR_DELAY_UI); if (addedListener) Log.v(LOG_TAG, "Listener Added"); else Log.v(LOG_TAG, "Listener Not Added"); return addedListener; } @Override public void onCreate() { super.onCreate(); if (timer == null) timer = new Timer(); if (lastFiveMinutes == null) lastFiveMinutes = new LinkedList(); Log.v(LOG_TAG, "CREATED"); } @Override public void onStart(Intent intent, int startid) { super.onStart(intent, startid); Log.v(LOG_TAG, "STARTED"); if (intent.getExtras().containsKey("ms")) { interval = intent.getExtras().getInt("ms"); } else { interval = 5000; } startNewLog(); } private String getFileName() { return base_dir + getHardwareID() + "_" + String.valueOf(System.currentTimeMillis()) + ".csv"; } public String getHardwareID() { TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); return tm.getDeviceId(); } private void startNewLog() { try { if (getAccelerometer()) { // acquire a partial wake lock wl = ((PowerManager) getSystemService(Context.POWER_SERVICE)) .newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, AccelerLogService.class.getPackage().getName()); wl.acquire(); br = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(getFileName(; br .write("time(mins),X,Y,Z,varX(last 5 minutes),varY(last 5 minutes),varZ(last 5 minutes),magVar(last 5 minutes)\n"); startTime = System.currentTimeMillis(); tt = new TimerTask() { @Override public void run() { float x = lastData[SensorManager.DATA_X]; float y = last
[android-developers] Restart LogCat without restarting eclipse?
I was wondering if anyone knew how to restart LogCat without rebooting eclipse? Every once in a while LogCat will just die while I'm working and it seems like there should be a to get it working again. I've tried restarting the adb task, but that was just a haphazard guess at a solution. Any help? Any sentiment towards this annoying issue? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Problems with local network broadcast.
I'm trying to write a simple game-room api and am having trouble broadcasting to the local network's broadcast ip. I got the code for getting the broadcast address and how to send stuff to it here: http://code.google.com/p/boxeeremote/wiki/AndroidUDP and used it like this: int PORT = 5; int DISCOVERY_PORT = 6; public void broadcast(String message) throws Exception { InetAddress ina = mContext.getBroadcastAddress(); // this is working Log.v("ADDRESS", ina.getCanonicalHostName()); DatagramSocket socket = new DatagramSocket(PORT); // here's where the error occurs socket.setBroadcast(true); socket.setReuseAddress(true); DatagramPacket packet = new DatagramPacket(message.getBytes(), message .length(), ina, DISCOVERY_PORT); socket.send(packet); } I get an error "java.net.BindException: The address is already in use". I thought at first this was because my local network was blocking ports, but once I got onto my home network which blocks nothing it still had the same issue. Is there something extra I have to include to get it to send a packets to the broadcast ip? Thanks in advance for any replies. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Point to point RPC for ad-hoc/local network communication between two or more clients?
I've seen android-xmlrpc, but it looks to be a server-centralized rpc api. Is there a project or RPC protocol built into android that allows me to do RPC between 2 or more android phones without a central server? I'm trying to avoid implementing a generic message passing system as I think RPC would make my code easier to work with. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
That would be it. Is there any practical reason I should implement that copy protection? On Dec 31, 3:44 pm, Mark Murphy wrote: > DCheeseman wrote: > >> I am confused by "G1 Dev Phone" -- do you mean a G1, or an ADP1? > > > A G1 Dev phone is a phone that is rooted and unlocked so you can use > > it on any network and run debug code on it. Here's where you can buy > > them: > >http://android.brightstarcorp.com/index.htm > > That is not a "G1 Dev Phone". It is an Android Dev Phone 1™ (or ADP1 for > short). > > Next question: did you elect to turn on copy protection in the Market? > If so, that's why you can't see it -- the ADP1 does not have access to > apps covered under the Market's copy protection system: > > http://android-developers.blogspot.com/2009/03/software-update-availa... > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android Consulting/App Development:http://commonsware.com/consulting -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
> I am confused by "G1 Dev Phone" -- do you mean a G1, or an ADP1? A G1 Dev phone is a phone that is rooted and unlocked so you can use it on any network and run debug code on it. Here's where you can buy them: http://android.brightstarcorp.com/index.htm -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
> Did you sign it? or use the export thing in eclipse? It won't work > with debug certificate I don't think. Actually I just added my first > game to the market. It comes up ok when I look for it on phone market > app. But the web site only seems to show top or featured apps. Plus > I got two of the same screen shots by accident, then updated the > second one, but it has stayed the same on the market. I signed it properly, the Marketplace won't let you upload a Debug Cert-signed app or an unsigned app. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
> Is it possible you're using a small screened device? Or a device that > doesn't allow a permission it requires? (I'm thinking of the camera issue) I'm using a G1 Dev Phone w/1.5, the same phone I developed the application on. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
Damn :/ I can't see either app and I've cleared the cache on my marketplace app about a hundred times over the course of thise morning looking for it. Guess it's out there now. On Dec 31, 8:53 am, Dan Sherman wrote: > I see both, free, and 0.99. > > - Dan -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
For the record I can't see my free or pay versions of my app. On Dec 31, 8:48 am, DCheeseman wrote: > Can anyone see the 'BPolite Lite' and 'BPolite Standard' applications > in the Marketplace? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How long does it take for an application to get indexed to the Marketplace?
Can anyone see the 'BPolite Lite' and 'BPolite Standard' applications in the Marketplace? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Avoiding garbage collection for smooth 2d animations
There are a lot of things that could trigger a slow down that wouldn't necessarily involve garbage collection. My guess is that your drawing function was kicked out of the cache when a background process tried to access the network or somethign like that. If you want really fast drawing you'll want to go with hard-core openGL 2d graphics commands and not the software rendered systems in the Canvas class. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How long does it take for an application to get indexed to the Marketplace?
I wrote two apps and submitted them to the marketplace last night (been roughly 12 hours now). One was a LITE version of my app and the next was a Standard version. Neither shows up in a search on the Marketplace even though the LITE version of my app has been installed 25 times already. Is there a lengthy approval process that goes on before an app is approved? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Multiple Binds to Single Service?
Is there anything preventing more than one activity from binding to the same running service? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Service that doubles as a BroadcastReceiver?
Is there a way to make a service act as a broadcast receiver? If so how would that look in terms of the class structure and the manifest? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en