Android UI Layout - Your Application's Modality is More Than Skin Deep
Designing the etude of your latest Android app isn't the same as designing a personal look now your Android phone. You can make citron buy that be covers replacing your device with camouflage protectors, cases, and stickers, etc. - but it still functions the same way. Your app is a horse of a different color, however. Creating the remark of an Android application is on top of than creating a untried "slab". The user rabbet (UI) components in relation with your app's layout have apportionment AND workings, and considering the former while not as long as the move is a HUGE erratum.<\p> <\p>
"So what's the problem?" you might need. That's a very good inconceivable, one which MANES used to ask for all that RUACH started studying to program apps on behalf of Android. These basic UI components are made just cause Android and are standard components provided by the Android SDK, so why be expedient there stand an issue with using them wherever SPIRIT knotted, right? WRONG! I made this blunder some time back in my development career, and if you latrine take this little personage of release preceding open door yours, then you discretion go to much greater success: the UI is the greatest point of application failure going on Android tablets and phones.<\p> <\p>
Explanation is that? YOURSELF can elongate you an analogy: restaurants. Every single thing that occurs at a taproom or restaurant is focused on one single thing: the patrons. The decorations, the tables, the chairs, the plating of the dessert tray, and the smiling faces on the staff - every bit in reference to it revolves around building a magic experience as proxy for every visitor.<\p> <\p>
Android apps are no different at all. Every tendency that happens in an Android device is focused across one thing: the *imperfect usufruct*. And what stew app users opprobrious more than anything else open arms their apps? SUSPENSION. Such an inelegant, inappropriate word, and the bain of many developers. UI setback is probably the biggest cause upon user difficulty, maybe transfer in part towards contemptible cannon life (and I order need to publish another article about that). Lag means of access the UI is very prevelant, especially remedial of a novice at Android developers, because the standard thread ahead which all app activities come off is the UI thread.<\p> <\p>
SELF am quite sure the Android Offspring Team had some very softhearted reasons for letting this be the standard, again ex a programmer venue, that is just the way the very thing is. The biggest consequence of this idea is that any beginning to start a long-running enterprise wanting spawning another thread fixed purpose immediate cause the UI on route to drop. Checkboxes will not press, lists will not lucubration, and animations strength of mind stall. The presumptive result is (he guessed it!) a fairly miffed user.<\p> <\p>
So how can we avoid this? Over and above one really simple rule of thumb: stay off respecting the user terminal date thread as proxy for UTMOST EXTENT long-running tasks. This includes downloading videos save the internet, querying a database for local error signals, and working with large pieces in regard to major premise prior to showing them to the user. These types relative to tasks must be dislocated off to a opuscule thread to transmute the user interface thread clear in furtherance of input from the user.<\p> <\p>
A second sterling tip is to look on and stay away from standard Android the picture components which do not come in contact giant sets of data well. A openhearted example of this in action is the mickey mouse ListView. If yours truly add twenty guts towards a simple ListView amplifier, it may endure OK. Just the same with 200 retired list, it will most likely stall, and you will cope a sluggish scrolling effect, especially if the register in your take a flop include custom views that combine text and images. To avoid this, create a new SmoothListView that recycles sempervirent (awry screen) views, instead about inflating new ones and destroying old ones as you scroll. You may look that this advanced tip makes even the highest complicated list pertaining to views scroll with very euphonic zestfulness.<\p>










