Using DNS Lookup

by Breno » Thu, 30 Apr 2009 04:13:59 GMT


Sponsored Links
 Hi,

             Is there any API to use dns lookup in android? my app
connect to a server, and to final user, we don't want that user need
to enter the ip, but a hostname. I found dnsjava, a lib to handle
that, but if Android would have this, it becomes better.

Thanks a lot

Breno
--~--~---------~--~----~------------~-------~--~----~



Using DNS Lookup

by alan » Thu, 30 Apr 2009 16:29:10 GMT


 If you really need to you can use InetAddress but most of the network
apis will accept a host name and do the dns lookup for you



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. ANR Tutorial

Hi ,

I am interested to know the nitty gritty of ANR dialogs and How to analyse
ANRs with the info I get , A typical ANR looks like this( see below) but I
cant figure out much Info from this .
Also I want to know what info should I look for in /data/anr/traces.txt to
compliment my analysis of such a log and pin point the root cause .
I want to know what these the parameters in RED mean



01-01 01:43:05.313: WARN/WindowManager(1834): Key dispatching timed out
sending to
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
01-01 01:43:05.318: WARN/WindowManager(1834): *Dispatch state*:
{{KeyEvent{action=1
code=4 repeat=0 meta=0 scancode=212 mFlags=8} to Window{435c7df8
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false} @ 1104543391080 lw=Window{435c7df8
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false} lb=android.os.binderpr...@43502ae0 fin=false gfw=true ed=true
tts=0 wf=false fp=false mcf=Window{4355bf08
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false}}}
01-01 01:43:05.323: WARN/WindowManager(1834):* Current state*:  {{null to
Window{4355bf08
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false} @ 1104543785321 lw=Window{4355bf08
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false} lb=android.os.binderpr...@43539ea8 fin=false gfw=true ed=true
tts=0 wf=false fp=false mcf=Window{4355bf08
com.android.settings/com.android.settings.bluetooth.BluetoothSettings
paused=false}}}
01-01 01:43:05.438: INFO/ActivityManager(1834): ANR (application not
responding) in process: com.android.settings
01-01 01:43:05.438: INFO/ActivityManager(1834): Annotation:
keyDispatchingTimedOut
01-01 01:43:05.438: INFO/ActivityManager(1834): CPU usage:
01-01 01:43:05.438: INFO/ActivityManager(1834): Load: 0.46 / 1.05 / 1.26
01-01 01:43:05.438: INFO/ActivityManager(1834): CPU usage from 5421ms to
94ms ago:
01-01 01:43:05.438: INFO/ActivityManager(1834):   system_server: 5% = 3%
user + 2% kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   qt5480_work_que: 1% = 0%
user + 1% kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   events/0: 0% = 0% user +
0% kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   akmd2: 0% = 0% user + 0%
kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   btld: 0% = 0% user + 0%
kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   com.android.phone: 0% = 0%
user + 0% kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   drexe: 0% = 0% user + 0%
kernel
01-01 01:43:05.438: INFO/ActivityManager(1834):   com.wssyncmlnps: 0% = 0%
user + 0% kernel
01-01 01:43:05.438: INFO/ActivityManager(1834): TOTAL: 7% = 3% user + 3%
kernel
01-01 01:43:05.443: INFO/ActivityManager(1834): Removing old ANR trace file
from /data/anr/traces


I did go through the *
http://developer.android.com/guide/practices/design/responsiveness.html*
but that gives a very good head start , I request if  anybody has documented
more on the ANR analysis / case studies , please share the link/blog .

I wanted to know what causes the WindowManager/ActivityManager to trigger an
ANR. I want to understand from a Design/Code perspective as how ANR dilaog
is formed.

Thanks
AndUzer

--~--~---------~--~----~------------~-------~--~----~

2. on resuming an activity along with retaining the data

Hi Vinu,

Can you try setting the clear top flag?

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

Cheers,
James




--~--~---------~--~----~------------~-------~--~----~

3. System.setProperty() cannot change system property in Android

4. language changed automatically after upgrade

5. Memory leak or feature

6. Android 1.6 update issue

7. 1.6. update and Gps recieve