[ask] responsiveness getting data from web service

by Handita Okviyanto » Tue, 05 Apr 2011 00:14:06 GMT


Sponsored Links
 Hey guys
 I wanna ask something about getting data through the web. About
consuming data from webservice. I just newbie in android. I want to
connect my application to json data on the web. I successfully made it
and running it. But the problem is about responsiveness. I using
thread to get data from the server. But when I test using my device it
takes so long and then android automatically show a dialog that my
application is not responding and providing user to close it. It maybe
takes more than 5 seconds to fetch data from the server. I am not
understand intent service yet. Maybe somebody can help me to find out
the problem. Or I make mistake in designing my application..? Please
help me

-- 



[ask] responsiveness getting data from web service

by Handita Okviyanto » Tue, 05 Apr 2011 00:14:20 GMT


 Hey guys
 I wanna ask something about getting data through the web. About
consuming data from webservice. I just newbie in android. I want to
connect my application to json data on the web. I successfully made it
and running it. But the problem is about responsiveness. I using
thread to get data from the server. But when I test using my device it
takes so long and then android automatically show a dialog that my
application is not responding and providing user to close it. It maybe
takes more than 5 seconds to fetch data from the server. I am not
understand intent service yet. Maybe somebody can help me to find out
the problem. Or I make mistake in designing my application..? Please
help me

-- 


Sponsored Links


Re: [ask] responsiveness getting data from web service

by Kostya Vasilyev » Tue, 05 Apr 2011 00:19:28 GMT


 Based on this:

But the problem is about responsiveness. I using
thread to get data from the server. But when I test using my device it
takes so long and then android automatically show a dialog that my
application is not responding and providing user to close it. It maybe
takes more than 5 seconds to fetch data from the server.
<<

you are not using a thread, or not using it correctly. One frequent mistake
is to treat Thread as a Runnable and call "myThread.run()" - this does not
start the thread, but rather executes the thread's worker function right
there. Use myThread.start() to start a thread.

Take a look as Androd's AsyncTask class that makes this type of thing
easier, including updating the UI with progress information, and showing the
data fetched from the net in your UI.

-- Kostya

2011/4/4 Handita Okviyanto <viyanatm...@gmail.com>


-- 



Re: [ask] responsiveness getting data from web service

by Handita Okviyanto » Tue, 05 Apr 2011 00:43:30 GMT


 Oke. I will try it.
Thanks for the response




-- 



Other Threads

1. Position/Size of AlertDialog with no Title

I have an AlertDialog that I create with AlertDialog.Builder.  I add a
positive and negative button and set a view using setView.  I am not
setting a title, because it would take up too much space.  It looks
good when I'm in vertical orientation, but when I go to horizontal it
is positioned and sized as though it had a title.  The window is not
filling the screen vertically.

I tried doing:

this.myAlertDialog.getWindow().setGravity
(android.view.Gravity.FILL_VERTICAL);

and

this.myAlertDialog.getWindow().setGravity(android.view.Gravity.FILL);

with no luck.

Does anyone know how I can make this AlertDialog fill the whole screen?

-- 

2. How to secure a paid app

Responding to a post from Android Dev, but this is more of a discuss
answer.

Is it legal for both Apple and Android's rules to make a Wap app
first, charge that as Paypal or google Checkout, then offer a free
client for Android and iPhone client that mainly repeats the same
functionality, but with some native integration and better assets?

That way you will have always charged over the browser, but you are on
both market places, without violating terms?

Like I pay Pandora $10 a year, but I enjoy both Android and iPod touch
clients?

If so I think I recommend this method.  I don't want to advice
anything that will lead to Apple rejection, or Google takedown.  Of
course I'm not aware of any significant Google takedown.  It'd be cool
to be be the first :-)

What helps is you can quickly deliver the iPhone and Android apps,
since both can run javascript and html.

Also on Android, it's easy to mimic the native browser from in your
app, or to hide that it's a browser at all.  Although it'd be great if
it was even easier.

Go web apps!




--

3. Reverse "Location.distanceBetween"

4. EditText won't accept first keys typed

5. singleTask and alwaysRetainTaskState

6. Ada yg bermasalah dengan si "Biru"??

7. Securing a paid app