Android loading large data to horizontal view - android

This is not a question on how to load the data. I have already loaded the data and it works fine. The issue that I am trying to solve is when ever i go to that page / view it seems to show a black screen before showing the data on the screen. which I can solve by putting a spinner on the screen. But my question is how does app like gmail loads all its information on the listview so quickly. I tried using the CursorAdapters but it still takes few second before the screen is populated with the data. The screen only has images and text. at most it loads like 20 data in the list. Can some one please help.
Thanks in advance.
Here is a screen shot of what is displayed on the screen.

Well you are loading heavy data(images not just raw strings). I know its not answer you wanted but im not sure what could you do. Putting it on some background service might help. Again not sure about solution.

Related

Android Lazy loading without ListView

I am looking to implement lazy loading in my app and I cannot seem to get it done. I've looked everywhere and nothing seems to be working.
My app is a news app making a SQL query to my wordpress website and getting the image URL and the article title associated to the image. The thing is I cannot use list views for this app because I want the first article to be a way bigger image that takes a third of the screen and the title placed on the image (the same way it is done in this image : http://iphone-apple.fr/wp-content/uploads/2010/06/lequipe2-iphone.jpg).
To create the design I have used RelativeLayout. Each article is a RelativeLayout composed of an ImageView and a TextView.
My problem is that all of the tutorials I found on lazy loading for ImageViews on the internet are for ListViews.
I have tried AsyncTask but it did not work. It actually worked but it showed all of the images at the end of the load so I had a black screen for about 5-10 secs before showing the main activity.
Does anyone have any idea how I could proceed ?
Thanks a lot for all of your answers ! :)
May be you are working with Native Emulator that work in slow environment.Install bluestack emulator or try to work on some android device

Navigate dynamic content horizontaly (ListViews)

sorry for the confusing title. I will try to explain my problem.
My app displays some content day-wise in a ListView. The user is able to switch days back and forth (e.g. by swiping his finger to the left/right). Now I want to implement some nice transition effect (like the new Android market has).
The problem is, that the content is generated dynamically and it can take a while to load. Also you can move (theoretically) infinite days to to past or to the future.
How can I implement a nice looking transition that is responsive and also tells the user, that some work is done in the background.
Just to clarify, I'm not asking how a ListView or an AsyncTask works, but rather for design concepts for my idea.
Thanks in advance.
If I understand correctly what you mean, I think you should try and preload in background the previous and following page, and keep them in memory ready to come in with the swipe.
Every time you change day you would recycle one page of data to load a new one (in one direction or another).
Obviously the user can still swipe too fast and you won't have time to preload things, but in that case I don't think you can do anything better than transitioning in the page with a nice spinner in it (not a blocking dialog).

Android Full Screen Video - Fragments

I have a layout which consists of a listview and a fragment. Listview lists all channels and fragment is used to play video channels. So far so good. All that works. But problem is i want the video to be full screen instead of occupying only fragment and still showing listview on left. I am not looking for code, but i want any clues on how to do it.
One way would be to get hold of cureent activity's view(listview and fragment) and swap it with a new fragment and put a surfaceview on that ? Just a guess, any insight or clue is much appreciated. I'd try what i think by tomorrow morning, till then if i'm lucky ,i'll have some clues here ;-)
Oh and last but not least, i am using surfaceview not a videoview
I'm not sure if this is what you are looking for, but I have a similar app using Fragments where the user can optionally "hide" the side ListView so that a photo takes up nearly the entire screen.
I ended up following this HoneycombGallery example in the Android SDK Samples which hides a "side view" via animation of the side view's width to a target width of 0 so that the photo can take up as much screen space as possible :
http://developer.android.com/resources/samples/HoneycombGallery/index.html
Not sure if you will run into any issues with SurfaceView, but this might be useful.

Getting blank screen when switching between activities

I am working on an app , where I am switching between two activities. When control is inside onStart of second activity , there is screen drawing and processing logic being handled.Because of this , when switching between the two activities happens, there is a blank screen that comes up.
Along with this , i also need to render a live video feed in background of my activities/app
What could be the best way to deal with this?
TIA
If you're getting a blank screen it could be because your activity is setting a new contentview but it hasn't been processed properly. Does it ever load completely? If it's just that it's black at the beginning and then renders. Try setting the contentview at the end of your switching in onCreate. This will make it remain on the first activity and avoiding switching views on till everything is loaded.
With regards your second question. Is the live video feed from the Camera?
If it is, set the camera view in the background, make a transparent LinearLayout (or whatever your layout is) over it and then put your various views there.
Your question doesn't have enough specific information to get an accurate idea as to what you're talking about, if my answer doesn't address your problem please respond with elaboration and some code! :-)

How to avoid the occurence of blank screen between two Activities in Android

I am working on the Android web base Application. In my application, I am call the web services, parse it and show the parsed data on my view. The data contain text and images. My problem is when i am moving first screen to second screen(in second screen there is a xml data which is display the images and text and it has large number of data, near about 100). But when i am clicking on move button there is a blank screen appear till that xml data is loaded on view and then display the second screen.
I want to show the progress dialog on that screen till load all the data. So please help me....
A key word for you: ASyncTask
I recommend to do the XML parsing in an ASyncTask and while doing that displaying a spinner/progress bar. A tutorial can be found here: http://developer.android.com/reference/android/os/AsyncTask.html

Categories

Resources