UDP DatagramSocket Usage?
Sep 16, 2013
I am trying to port an application from Windows to Android that uses datagramsockets for communication. (C# to Java)
In the windows world, I created a messagereceived event listener that is automatically called when a UDP packet is received. The program continues to process data while it is waiting for a message to arrive.
In Android, there does not appear to be a corresponding event listener. All of the samples that I have found use loops to poll for the data and call the blocking datagramsocket.receive method to fetch the packet.
My program can't sit idle as it waits for the UDP packet, it needs to work even if the other end of the UDP system is down.how to replicate this process in java on the Android?
View 2 Replies
Aug 7, 2009
So how can you get a FileDescriptor from a DatagramSocket (or even a Socket for that matter)? I notice there is a DatagramSocketImpl function which has a protected class for getFileDescriptor() but how do I extend the standard one to expose that somehow? Is there another way?
View 2 Replies
View Related
Dec 28, 2009
I have a thread that constantly polls a UDP connection and posts the received data to another thread. It uses a connected DatagramSocket, reads a packet (which is always the same side), gets the data and posts it to a message queue (not the android one, my implementation). The problem happens mainly over 3G connection, not wifi.
Code looks like:
CODE:...............
View 2 Replies
View Related
Dec 1, 2009
I don't know if it's my phone or what but when I look up the Other Usage on my phone, it shows it "Running" more than 2/3 of the time.And on Network Usage, "Android System" and "Media" use a great deal of the phone as well.I think this might have to do with my "android.process.acore" crashing every once in a while when it's asleep. Based on everyone's feedback I might have to return the Moment for a third time.
View 1 Replies
View Related
Aug 2, 2010
public void Connect() throws Exception
{
InetAddress dest;
dest = InetAddress.getByName("192.168.1.100");
DatagramSocket socket = new DatagramSocket();
socket.connect(new InetSocketAddress(15900));
byte[] message = "Oh Hai!".getBytes();
DatagramPacket packet = new DatagramPacket(message, message.length,dest,15900);
socket.send(packet);
}
Using the above code on Android SDK 1.5, when attaching the debugger to the android emulation, I step through the above sample (obtained from a tutorial), and the debugger returns control to the user when it reaches the DatagramSocket line... as soon as I hit F8 (Eclipse Galileo) to continue, I immediately have control again.. basically it never reaches socket.connect.... What is going wrong here? If I surround it in a try/catch block, nothing is caught so it's not an exception.
View 1 Replies
View Related
Jul 5, 2010
I love Sprint's true unlimited data.Switched from Att and the iphone after they changed the data plans. I was leaning towards the EVO anyway, but the new data plan was the nail in the coffin.I work night shift half the time and abuse tethering on my laptop while working nights.I pay for the hotspot app (i know i could root and do it for free but don't mind the fee considering how much i use).My first month (4 days left in the billing cycle) 21 gigs and change. And to just think, my city is getting 4G later this year and it will only be faster.
View 12 Replies
View Related
Jun 22, 2010
I downloaded the app "network" from market, now I would like to restrict my phone, but I don't know which category suits or meets what I am expecting the result to be. Sprint voice and 3g.
My options are:
WCDMA Preferred
GSM Only
WCDMA Only
GSM Auto (PRL)
CDMA Auto (PRL)
CDMA Only
EvDo Only
GSM/CDMA Auto (PRL)
Unknown
I am really wondering is should I use cdma only or cdma auto (PRL)? And what the heck is WCDMA?
View 7 Replies
View Related
Jun 15, 2010
i was looking is spare parts and i noticed that the usage for "0" was higher than any of the other programs i have used. what is it and can i possibly reduce it so that my battery will last longer? i also noticed every time i wake up my phone the 3g arrows light up and stay on for a few seconds. im wondering if that is related. anyone else having the same usage or know what it is??
View 10 Replies
View Related
Jun 17, 2010
I get around 5 to 7 hours use with mine, and i've only owned it for about a week, and this is after a couple of complete discharges aswell.So how much 'awake' time do you get?Another thing, does anyone else find it stupid how the awake time and up time don't reset after a full charge?!
View 11 Replies
View Related
Nov 20, 2009
I've never had a smartphone before and I was wondering if 500mb 'net usage is more than enough (per month) to use it reasonably. Also, any ideas what I could get up to without breaking this limit? (how much browsing e.t.c.)
View 20 Replies
View Related
Jun 26, 2010
Just wondering, how much space does an Android 1.5 and 2.1 OS roughly take from the device's ROM?
View 2 Replies
View Related
Nov 23, 2010
there an app that monitors data usage?
View 5 Replies
View Related
Jul 18, 2010
Thinking about getting the new Samsung Galaxy S (Vibrant) when it comes out in Canada and the end of month... With the GPS turn by turn I understand it uses data... anyone know how much data it uses for the GPS? Is it a ton?
View 8 Replies
View Related
Apr 3, 2009
I encounter an ANR in Album. I saw from the report that the CPU usage is nearly 100%, in which mediaserver occupied 80+%. It looks like it was decoding thumbnails. My questions are: 1. Is it possible for ANRs to happen because the CPU is really busy? 2. Do we have plan for Album to have a more efficient way to decode thumbnails?
View 2 Replies
View Related
Jun 21, 2010
I have been disturbed by how much battery it seems to use while it's sleeping. After much poking around and reading and using various system/battery/monitor apps in a non-methodical manner, I think I found it. I noticed that a process called 'compass' at /system/bin/akmd was persistent in utilization on my phone. While it only ever showed like 1-6% cpu utilization, it seemed to be showing it constantly. I uninstalled a 'compass' app I had DL'd from the market, but that had no effect.
With some searching, I found some threads over at XDA that discussed this process misbehaving in some recent builds, although the conversations didn't seem to be about the EVO. Nonetheless, I decided to disable the auto screen orientation (Menu -> Settings -> Sound & Display -> Display Settings/Orientation = unchecked) and lo and behold, I'm not sure the phone even uses battery in standby now! (exageration for effect...)
Now, this will require more testing, but it seems to be at the root of *my* battery issues. And I'm thinking after reading at XDA that this could be a broad problem. I'm also hopeful though, that this could be a relatively easy software fix for HTC/Google. Especially because I don't particularly find disabling the screen rotating an acceptable long term solution... but one I can live with for now, if it makes the HUGE battery gains it seems like it might.
View 5 Replies
View Related
Jul 5, 2010
well the last couple days, my phone has been using data almost every second. i dont have the facebook widget, flickr or friendstream, only the weather one. my mail is set for every 5 minutes. i checked spare parts, it didnt show any apps using a large amount of data. i havent installed any new apps this week, so it shouldnt be a new app, though it could be an existing one.
View 7 Replies
View Related
Jun 17, 2010
How much battery percentage do they both use? Like in a minute of Internet browsing I'll get 1% down.
View 2 Replies
View Related
Aug 21, 2009
Many times (not all the times), my emulator is running 100% of one of my two CPUs on the machine. Can anyone tell me why it is so, and how can I reduce the cpu usage?
View 13 Replies
View Related
May 30, 2010
Was going through the homescreens thread and getting some ideas, picked up the battery usage widget. Thanks for that. Is there an app (widget) out there that tracks the phone minutes, sms, mms and data usage? That would be great, as i have a light contract. At a glance it would be nice to see what i've used. I noticed there was a data widget, what was that called?
View 5 Replies
View Related
Jun 25, 2010
Is there any API by which we can get CPU or Memory usage of android? I have tried one code as below: Please look into it and let me know if this is the correct way?
package com.infostretch.mainactivity;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;..............
View 1 Replies
View Related
Jun 30, 2010
1 I want to see the usage of memory in the android through the procrank command,but throw a error error: creating kernel interface. Why/ 2 if use the top command, but the info of the %MEM is not correct. Because all the pid's info's sum will >100% ,so Why?
View 3 Replies
View Related
Feb 18, 2009
I wrote an app that acts as a Google Reader client. It downloads an XML from Google, parses it and afterward analyzes web pages with regular expressions to find image and stylesheet tags to make the pages available offline. So far so good. The problem is the above mentioned tasks are pretty CPU intensive and I also use gesture to mark items as read etc. The gesture detection gets really bad when done during the synchronization phase (see above).Those tasks from the synchronization phase are not time critical. I would like to tell the OS that the UI thread is far more important than my background thread. I just don't know how to do that efficiently.In an ideal world the OS would take care of that for me, so I started out with "Thread.currentThread().setPriority(Thread.MIN_PRIORITY);". That didn't have any obvious effect. Then I sprinkled "Thread.yield()" in all major areas, in particular in the loops. But that also didn't seem to have much of an effect. Before I know start to to all kind of silly stuff, I'd like to pick your brains on how this is done properly? I am absolutely willing to use Thread.sleep(20) in some of the places I use Thread.yield. A little bit of a pause might be a good thing for the battery heat and power consumption, but I can't let the pause get really long, e.g. 250ms, because I wouldn't get any work done and would keep the phone awake unnecessarily (I am holding a partial wake lock). On the other hand I am not sure if a small pause now and then, like a 20ms pause, then 50ms work, won't take too much a toll on the CPU for switching tasks and in the end burn the battery too fast. Also, what seems like a good pause for the G1 might be not so much of a good idea on different hardware, like a Netbook.
View 20 Replies
View Related
Oct 22, 2009
whenever any (non-android) java project in my eclipse ide is built, a "Loading Android Sdk Content" Job is started although no android project is open. Furthermore adb is started in the background, causing 100% CPU usage. When killing adb DDMS prints: Code...
View 2 Replies
View Related
Sep 30, 2009
How to see CPU usage on device?
View 2 Replies
View Related
Jul 7, 2010
I could swear I've never seen my memory usage this high but maybe I'm just imagining things today. 63% used, is that high?
View 6 Replies
View Related
Oct 15, 2010
I see that a lot of folks recommend "Spare Parts" as a app to monitor system usage. Are there any other apps out there that do the same thing? The main reason i ask is because Spare Parts doesn't seem to have the greatest reviews so i have been debating on installing it.
I main thing i want to be able to do is see what is using my battery power.
View 1 Replies
View Related
Feb 10, 2013
app that show me ram usage of each app
View 2 Replies
View Related
Feb 3, 2013
how do I check if apt-x codec is currently in use ?
I have a galaxy s3 and samsung HS3000.
Can't hear any difference atm (comparing with galaxy note playing the same songs) and I don't have very good ears, but I'd like to know.
View 2 Replies
View Related
Feb 13, 2012
I'm curious, the "Show CPU Usage" in Android 4 Dev Tools has three numbers at the top.
View 6 Replies
View Related
Apr 21, 2010
I was wondering how many of you actually use the green answer key. Since I usually don't. When you dial a number, it's much closer and faster to tap the shown name, or to tap the on-screen "call" (if you don't have the number in people app) then to go all the way to a physical button. When you're answering a call, you mostly swipe the on-screen lock bar to answer. At least I do. So, the only usage of "the green key" for me, is when I'm sending MMI codes (checking data plan). What about you?
View 13 Replies
View Related