Search This Blog

Showing posts with label Discussion. Show all posts
Showing posts with label Discussion. Show all posts

Monday, 28 October 2013

ViewPager android Fact and constraint about offscreen page limit

ViewPager inbuilt swipe animation is very good. ViewPager exist for a reason with HorizontalScrollView(Which scroll the content in same manner but different methodologies). ViewPager used for swiping content on the base of keep ready next content to be swipe. And its whole limitation and strength, which developer feels some times, lie in that.

How many (i.e Minimum and Maximum) page of ViewPager may be preloaded?

setOffscreenPageLimit(1); decide how many page to be preloaded. As i am not sure about what is the maximum limit for it but minimum is 1. setting off screen page limit to 0 does nothing except throwing  warning in LogCat Requested offscreen page limit 0 too small; defaulting to 1Its because ViewPager is based on concept of keep ready next page to be loaded. ViewPager can not the page which not exist still. Android documentation of ViewPager clearly. But most developer feels its not what they required. Then you have option with some work around there but you can not change ViewPager behavior.

Some people argue that they want to load empty instance of fragment as part of child of ViewPager then later on full content. You are free to do  but you will be solely responsible to handle its complications.

onPageListner gives you a way but its bit of tricky to handle.


I absolutely agree with ViewPager's documentation. There must be some content exist before swiping it down. You can use an in out animation if you do not want to customize ViewPager. But being with Adapter, ViewPager allow you to recyling of View

Monday, 2 September 2013

Effective User experience Technique : Perfecting of data from online in android


Its just normal but effective technique based on a simple concept. While User listening song one, start fetching song two from server so that use do not need to for buffering of song two. It increase the data availability and application seems very fast.

Dev byte publish a video talk about this concept. Let have an example of NewsReader.
Developer can download news text, title etc to show to the user on instant base and shows to user. The sooner you provide the content to user, the more he will feel .


See this video and get the depth of Pre fetching technique, find out where it works best.




Android News and source code