Android :: Best Practice To Pull Content From Web?

Sep 29, 2010

I'm new to developing Android applications, and have only a little experience with Java in school. I was redirected to StackOverflow from the Google groups page when I was looking for the Android Beginners group. I have a question about what is best practice to pull content from a web source and parse it. Firstly, I would eventually like to have my application threaded (by use of Handler?), however, my issue now is that the class I have created (Server) to connect and fetch content often fails to retrieve the content, which causes my JSON parser class (JSONParser) to fail, and my View to display nothing. After navigating to the previous Activity, and attempting to call the connect(), fetch(), and parse() methods on the same remote URI, it will work. Why does this (sometimes retrieve the remote data) happen sometimes, but not always? What is the best practice, including the use of ProgressDialog and the internal Handler class, to make my application seemless to the user. Is this the best place to ask this question?

Android :: Best practice to pull content from web?


Android :: Best Practice For Additional Content Delivery And Addons

Sep 13, 2010

I have a design question I was hoping someone could answer or offer guidance. I am designing a game that will initially have 100 levels but the user will have the ability to purchase additional levels. For instance when the game is released the free version will have 100 levels and then the user can buy and additional 100 levels while in the game. Does the Android SDK have any built-in methods to deliver additional content? Does and third party provider offer any such service to deliver content? If this is something that you must custom create yourself, what is the best practice for creating?

View 10 Replies View Related

Android :: Pull Webpage Or Content From Web Into Widget On Home Screen?

Apr 3, 2010

I have a php web page that will randomize an image that is 158x154. I was able to get the android application to work, but would also like to get it to work as a widget. How the heck can I get a widget to pull information from the net? I got the widget to work and layout correctly with a black sample image. I have tried to look at the wiki sample, but it is a bit too complicated for my little brain to grasp. The data that gets pulled looks something like:

<html><body bgcolor="#000000">center>
<a href="http://www.website.com" target="_blank">
<img border="0" src="http://www.webiste.com//0.gif"></a>
<img src="http://www.webiste.com" style="border:none;" />
</center></body></html>

View 2 Replies View Related

Android :: Switching Content Providers For Same Content URI

Aug 12, 2009

This may seem like a stupid question but I need to be sure. I was wondering if it was possible to pro-grammatically change the Content Provider used when making a query given a Content URI. The reason being I need to know if it's possible to force the Calendar/Contacts applications to read from a different database via a different Content Provider temporarily while my application is running, so that I can reuse those applications to display my own data. Since the Content URI s are hard coded in each of these applications the only way it might be possible is if we could somehow temporarily change the Content Provider used for a given URI. I know this probably isn't possible, I just need to show it isn't. Could someone confirm this can't be done?

View 2 Replies View Related

Android :: Best Practice For Changing Min SDK Version?

Aug 2, 2010

I have a sizable install base already on some apps with Android 1.5 set as the minimum version. I want to update the apps to take advantage of some of the newer features offered in Android 2.0 and greater. What is the best way forward so I don't break things for my current 1.5 and 1.6 users?

If I simply update the application with a new min SDK version, will 1.5 and 1.6 users be prompted to uninstall? Or will they just not see the update? What about future development that I want to apply for everyone, say a bugfix. Will I have painted myself into a corner? Another solution would be to fork and create a new app for 2.0 users, but that is undesirable for several reasons.

View 3 Replies View Related

Android :: Uninstalling Apps Best Practice

Jun 23, 2010

I have had my Desire no for almost 2 months, and like most I have tried installing and uninstalling many apps, to see what I like.Due to doing a factory reset on my phone yesterday I have layered back all the apps I was using and have noticed that I have used considerably less memory than before, making me very suspicious of the uninstall method used within the market place.Does it leave behind pieces of the app, and if so what's the cleanest method of uninstalling apps.

View 7 Replies View Related

Android :: Best Practice For P2P Handset Networking

Dec 4, 2009

I've been scouring the web looking for information on setting up a peer-to-peer connection between Android handsets and so far have drawn a blank. The only thing I can definitively seem to work out is that it was made a whole lot more difficult when XMPP was removed from 1.0. Apart from that, I find a couple of threads on an OpenIntents board about porting an XMPP implementation to Android that were last posted nearly 2 years ago. Has anybody solved this problem effectively? What's the best way of doing it (from a games point of view)?

View 7 Replies View Related

Android :: Best Practice For Implementing Watchdog

Sep 17, 2009

I'm writing an application where real-time knowledge of the GPS state is critical to convey to the user. I request GPS updates at 1000 ms intervals -- when I haven't received another update 1500 ms past the most recent update, I want to display a yellow icon, and 5000 ms after the most recent update I want to display a red icon. Currently, I'm doing it like this: private CountDownTimer gpstimeout; public void onLocationChanged(Location location) { if (gpstimeout != null) gpstimeout.cancel(); gpstimeout = new CountDownTimer(5000, 1500) { public void onTick(long m) { setYellow(); } public void onFinish() { setRed(); } }; gpstimeout.start(); }

View 3 Replies View Related

Android :: Best Practice With SQLite And Phone

Mar 22, 2010

What is considered "best practice" when executing queries on a SQLite db within an Android app? Is it safe to run inserts, deletes and select queries from an AsyncTask's doInBackground ? Or should I use the UI Thread? I suppose that db queries can be "heavy" and should not use the UI thread as it can lock up the app - resulting in an ANR. If I have several AsyncTasks, should they share a connection or should they open a connection each?

View 3 Replies View Related

Android :: Best Practice - Passing Id To New Intent?

Sep 22, 2009

I am creating a database driven app for managing people. I am showing a list of people with each name in a TextView. When a TextView is clicked, I launch a new intent to show the detail for the person. My question: What's the best practices for passing the id of the person to the new intent? The TextView is displaying the name of the person, so how do I know the id of the person? Once I know the id, I know how to pass it to the new intent, but I don't know what the best way to associate the id of the person to the TextView. Is there a best practice for this?

View 2 Replies View Related

Android :: Best Practice For Specifying Pronunciation For TTS Engine?

Aug 16, 2010

In general, I'm very impressed with Android's default text to speech engine (i.e., com.svox.pico). As expected, it mispronounces some words (as do I) and it therefore occasionally needs some pronunciation guidance. So I'm wondering about best practices for phonetically spelling out those words that the pico TTS engine mispronounces. For example, the correct pronunciation of the bird Chachalaca is CHAH-chah-LAH-kah. Here is what the TTS engine produces: mTts.speak("Chachalaca", TextToSpeech.QUEUE_ADD, null); // output: chuh-KAL-uh-KUH mTts.speak("CHAH-chah-LAH-kah", TextToSpeech.QUEUE_ADD, null); // output: CHAH-chah-EL-AY-AYCH-dash-kuh mTts.speak("CHAHchahLAHkah", TextToSpeech.QUEUE_ADD, null); // output: CHA-chah-LAH-ka mTts.speak("CHAH chah LOCKah", TextToSpeech.QUEUE_ADD, null); // output: CHAH-chah-LAH-kah Here are my questions. Is there a standard phonetic spelling recognized by the Android TTS engine? If not, are there some general rules for making custom pronunciation spellings that will make the spellings more likely to be correct in future TTS engines/versions? It appears that the Android TTS engine ignores text case. What is the best way to specify emphasis?

View 2 Replies View Related

Android :: Best Practice For Storing Application - Configuration

Apr 8, 2010

I am still learning bu find Android the cool platform for allot of useful applications. I have written a Service for doing GPS tracking and it consists of a Service and a Control activity to manage, monitor and configure the service. I am looking for the preferred way for the Control Activity to define settings for the Service, things like IP address and Update interval. I envision something like a Registry on windows where these settings can be shares and updated.

View 9 Replies View Related

Android :: Best Practice For Responsive User Interfaces

Jun 16, 2009

I am quite new to Android and Java. Before I was working with C++ where the events where dispatched with messages. Now I would like to create the same user experience for Android platform and I would appreciate any of your suggestions or comments on what is the best way to bind events to user controls.

Here is an example from C++:

ON_MESSAGE(WM_RECORD_START, &CMainFrame::OnRecordStart)//Method OnRecordStarts() executes on WM_RECORD_START_MESSAGE...................

View 2 Replies View Related

Android :: Preferences Use Explanation - Recommended Best Practice?

Oct 6, 2010

Some of my app's preferences could use some more explanation than the scarce space available for the summary. Sadly, there doesn't seem to be support from the system, like an optional help button that shows a longer text. How do you solve this problem? The first thing that comes to mind is an additional custom "preference" like "more information to above entry" that opens an AlertDialog with the help text, but that's not really nice for both user (two entries for the same preference) and the developer (manual work to do in Preference Activity). A bit nicer for the user, but way more work for the developer would be custom dialogs for each preference with more text and/or a help button. Is there a better solution or even an officially recommended best practice?

View 7 Replies View Related

Android :: Building Two Versions Of Application - Best Practice?

Apr 19, 2009

What is the best way to release two versions of an application? E.g. a free version with limited features, and a paid version with the full feature set. #ifdef would be the ideal way to do this, but Java doesn't support it. Could I do something like: try {import com.foo.myapplication.ExtraFeatures; } catch (Exception e) { // ignore it, this must be the free version}? I could manage with this kind of construct, although #ifdef really would be ideal.

View 10 Replies View Related

Android :: Garbage Collector Conservation - Best Practice

Jul 29, 2009

I didn't use much Java before Android so my knowledge concerning the gc is marginal. Now I'm developing a highly physics-based game and therefore I need to do many calculations each time step and many (25) time steps per second. At the moment I'm almost only using local objects (float) in my methods, so I guess they are allocated every time the method is called (which might be, for example, 25*100 = 2500 times a second , for 100 objects with calculations on them). This causes massive activity of the garbage collector like freeing ~10000 objects every 1-2 seconds (taking ~200ms on a real device). Now I really want to optimize that because even there's no noticeable delay due to the GC (and the frame rate is constant), this seems just not well. But I read on many documentations concerning Java optimization, that there is not much to optimize in modern versions of (desktop) Java, because the GC is fast enough. Does this apply to Android, too? Does the compiler optimize anything like frequently, steady allocated objects (like floats)? What would be best practice: keep all local objects and allocate and free them all the time or use class-global objects, even if they are only used inside one particular method (which is bad programming style but conserves GC?

View 5 Replies View Related

Android :: OpenGL ES - Best Practice For Huge Maps?

Jan 13, 2010

If I want to render just a huge map, what is the best practice when using OpenGL ES with a mobile device (Android or iPhone based)? What is the best structure to contain all the vertices, normales and texture coordinates? I guess using a interleaved structure may give you some performance benefits caused by memory caching. Ok? Should I use drawArrays or drawElements to push my data to OpenGL ES? Well, I did no testing at all but I might think, that drawElements might be faster if the GFX does not use shared memory since you do not have to push that much data. Since this is really close to metall, what do you think? (the iPhone is ARM based while the Android platform is Qualcomm based (also an ARM?)

View 2 Replies View Related

Android :: Best Practice For Viewflipper Containing 10 Linear Layouts?

May 23, 2010

I'm embarking on a GUI Activity composed of a viewflipper, which I would like to contain 10 linearlayout layouts. Is it advisable to put all of my layouts into the same XML resource/layout file? If not, is there a more organized approach to coding a viewflipper with many layouts? Will having everything in the same file come at a significant performance cost?

View 2 Replies View Related

Android :: Best Practice - Testing Application Kill

Mar 9, 2010

I'm having troubles with users that report that if they leave the application opened and after a few hours when they return to it the app crashes. I'm pretty sure it is because I'm not storing/restoring the status correctly when my process is killed by the system, but I would like to be able to test it in a repeatable way. Which is the best way to simulate the same behavior that happens when Android kills my process on low memory conditions?

View 4 Replies View Related

Android :: Best Practice For Static Headers And Footers

Apr 11, 2009

I am trying to display a high score table in my application and wanted to know the Best Practice for displaying static headers or footers. The data for the High Score tableis a REST web service returing up to 100 JSON records. I have looked at some of the previous posts http://groups.google.com/group/android-developers/browse_thread/threa. that talk about addHeaderView() & addFooterView() but they all seem to indicate that the footer or header will scroll off the screen. My 1st question is has someone been able to implement this in a clean way to allow a basic static header or footer. My second question is is their another way I could accomplish my goal of displaying my high score table besides a List View. I will be displaying 6 columns of data which will need to scroll vertically.

View 2 Replies View Related

Android :: Best Practice On Updating UI From BroadcastReceiver To A Certain Activity?

Jul 18, 2010

When i have a broadcastReceiver say android.intent.action.MEDIA_BUTTON and i want to update the current activity's UI without creating a new activity, is there any good practice on this one?

What i know (might not be correct)

1) I can put the BroadcastReceiver in the same class as the activity and call the updateUI function after certain activity

2) Create a ContentObserver?

3) Communicate to a service created by the activity, use aidl. (I dont know how to get the current service if its registered from an activity)

4) Create a custom filter on the broadcastReceiver located on the same class as the activity, and use context.sendBroadcast(msg of custom filter) and in the custom filter call updateUI (same as one but more generic?)

The final flow is it would come from a BroadcastReceiver and ends up updating the UI without renewing the activity (unless the activity is dead?)

Kindly provide links/source code on your how you tackle this kind of problem.

View 1 Replies View Related

Android :: Update Activity From BroadcastReceiver / Practice For It?

Mar 3, 2010

Does anyone know how I might go about accessing an Activity in an application from a BroadcastReceiver (in the same application)?

(I have some state information in the Activity I'd like to update)

I'm not sure if there is a best practice for it.

View 2 Replies View Related

Android :: Practice For Obtaining Compass Reading?

Aug 18, 2010

Now that SENSOR_ORIENTATION is deprecated, what's the best practice for obtaining compass reading? The old way was so simple.

View 1 Replies View Related

Android : Content Provider - No Link Between Content Provider And Its CONTENT_URI Declared In Another Class

Mar 1, 2010

I am having a hard time understanding content providers. In the notepad example and others, the content provider never even declares its CONTENT_URI anywhere inside itself, yet the docs say to publicly declare this. It's declared in a different class. So when an activity queries a content provider with a CONTENT_URI, how does Android know which one I want. I see no link between a content provider and its CONTENT_URI declared in another class.

I also don't how to think about intents and content providers. I know that you don't call an intent on a content provider. But an activity queries a content provider without an intent, and an activity has a mimetype attribute in the manifest that would seem to tie it to a content provider.

View 2 Replies View Related

Android :: Best Reasonable Practice For Locally Storing Password?

Nov 3, 2010

I am considering adding a means by which my app can perform functions over Google Voice, and the functionality would make little sense if I required the user to type in a password.I'd like a reasonable plan for storing the password locally and sending it (through google-voice-java) when demanded by Google Voice.Clearly, I'd like to properly represent the risks of the chosen scheme honestly to the user. I'd like the storage to be based atop writing it into a SharedPreferences created with flags.What form of obfuscation is suitable, and with what available salting ingredients and such should I customize it?

View 4 Replies View Related

Android :: Application With Multiple Views - Best Practice For Structure?

Jun 20, 2010

I am new to developing for android. I have a question regarding some best practices. My app is like a dashboard from which multiple different "sub-activities" can be started and done. I am wondering what is the best way to structure the app. One way is to have different layouts and load and unload them appropriately. The other is to start new activities using intents. At least this is what I have gathered from what I have read.

View 3 Replies View Related

Android :: Best Practice Design Pattern For 2D HUD Screen Navigation?

Aug 23, 2010

I fight with me for some days about asking this question.

Its pretty plain and simple:

If you have an application with a GUI totally working on 2D drawing, what should be the best practice to handle what to draw and where to touch?!

Some example for better understanding:
I have a game with a map. On this map I can build houses and stuff.
I also have a information bar which can be extended. On the extended bar I draw some information about the game and also enables to change different values. If a touch occurs, I have to check, if the information bar is extended or not to determine if I want to change something on the map or something on the bar.

Thats done by the State Pattern, but I have some doubt if thats the right one because I think it can be a bit complex because of possible "sub-states".

So basically the question: Is the State Pattern (from GoF) the best practice to handle a pure graphical GUI?

View 1 Replies View Related

Android :: Best Practice For Selling App In Non-Market Approved Countries?

Sep 20, 2010

The title more or less says it all.

Google Checkout, as you may be acutely aware, only supports ~9 countries. Some apps use PayPal to receive payment, then send out an "activation code" to the user. How can this be done to ensure that a single user receives a single activation code? Once the app verifies the code, how could the app more or less "verify itself" that it's been paid for? Storing such data in a preference file or a database on the Android device can surely be easily extracted and exploited.

How are other developers handling app sales in other countries--or do they just not care?

View 5 Replies View Related

Android :: ActivityList - Loading Data From Network Best Practice

Sep 29, 2010

I have multiple ListActivity(s) with a custom ArrayAdapter. I have to load an XML file from the Web, and the user moves to a new activity by selecting a list item.

What is best practice for:

Displaying a loading indication to the user.
Threading the networking stuff so that the user can cancel the loading of the data if need be / move to the previous activity.

Example/source code would be greatly appreciated - I've used http://www.helloandroid.com/tutorials/newsdroid-rss-reader as an introduction, however it doesn't display a loading indication.

View 1 Replies View Related

Android : Is It A Good Practice To Create A Reference To App Context?

Jun 7, 2010

I have to use context in many places of my code such as database operations, preference operations, etc. I don't want to pass in context for every method. Is it a good practice to create a reference to application context at the main Activity and use it anywhere such as database operations? So, I don't need some many context in method parameters, and the code can avoid position memory leak due to use of Activity Context.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved