Display some part of HTML file in WebView

by mansur Android » Wed, 21 Apr 2010 21:49:34 GMT


Sponsored Links
 Hi All,

We have a large HTML which contents 1000's of lines. But we want to
show content of the HTML file that fits a
single screen.  We want provide a '>'  kind of to show the next
contents of the same HTML file.

Our objective is to only display the HTML contents that fits the
screen.Similar to reader application  For user, it seems there are
several pages.

Is there any way in which we can achieve this functionality. Whether
WebView has any function related to full fill the requirement.

Thanks and Regards,
*Mansur*

--



Display some part of HTML file in WebView

by Sean Hodges » Wed, 21 Apr 2010 22:02:06 GMT


 Why must all the content be on a single HTML page?

If you really can't split it out, you could use some Javascript
actions to hide/display sections of the HTML page when the user clicks
the '>' button. However, the browser will still need to download and
render the entire page when it loads, which may take a long time. The
best solution would be to split the content into a number of pages.

On Wed, Apr 21, 2010 at 2:49 PM, mansur Android


>


Sponsored Links


Other Threads

1. addProximityAlert & lifecycle

Hi I understand the documentation about activity and service lifecycle. 
Generally speaking, what's the approach if you want to have an application 
which gets unlimited proximity alerts, basically a service that doesn't die? 
I've tried startService with requestLocationUpdate etc. but after a while the 
service seems to get killed by the OS. That's basically question 1) :-) 

Now to problem 2) I've tried to do addProximityAlert but it doesn't really seem 
to work. I am basically doing something like

Intent updateIntent = new Intent(this, LocManIntentReceiver.class);
updateIntent.addCategory(Intent.CATEGORY_INFO);
updateIntent.setAction(Intent.ACTION_LOCALE_CHANGED);
// Put the information into the Intent


updateIntent.putExtra[..]
// Create a pending broadcast intent for the proximity alertPendingIntent 
pendingIntent = PendingIntent.getBroadcast(this, -1, updateIntent, 
PendingIntent.FLAG_UPDATE_CURRENT);
// Add a new proximity alert, update the old one
locationManager.addProximityAlert((double)latitude/1E6, (double)longitude/1E6, 
(float)1, 1000000, pendingIntent);

But if I set a breakpoint or do a Toast.makeText in the onReceive function of 
the BroadcastReceiver, I never get anything.

Now to problem 3) :-) I've tried to set up a mock location provider by starting 
a "Timer" which periodically spits out a new location, and I set up a 
LocationListener. The timer does something like this

LocationManager locationManager = 
(LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE);
locationManager.setTestProviderLocation(LocManager.MOCK_LOCMAN_PROVIDER, 
fakedLocation);

I am passing the context in the constructor of the Timer object when 
instantiating it. The location listener in the main activity never received an 
update but the very first one. Any take on that?

- Thanks!

-- 

2. Buggy sample code for an interview

I think too many interviews are of the "write new code" variety and
not enough of the "analyze this code" variety.  I would like to ask a
candidate to analyze some android code.  I am looking for a good
example with some bugs or potential optimizations in it that can be
improved.  Does anyone have something like this sitting around that I
could use?  Any suggestions?

Thanks,


-- 

3. Android ServiceTestCase, two Service instances running?

4. how to present the renderbuffer on the screen?

5. AV sync and Audio HAL latency question

6. DEPOK

7. Energizer xpal xp200