I didn't know how to display the server side of the picture, fortunately in the Apkbus forum to find a particularly simple example. Although the day is busy, but the heart actually has a want to escape in the heart, maybe someday will come out.
1, first server-side picture
Here's the Imageservlet.java, not doing the related treatment
Here to launch Tomcat, enter http://localhost:8080/ReadImage1/image/a.jpg in the browser
This picture should be visible at this time.
2. Android Program
Layout file:
1<?xml version= "1.0" encoding= "Utf-8"?>2<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"3Android:layout_width= "Fill_parent"4android:layout_height= "Fill_parent"5android:orientation= "Vertical" >6 7 8<TextView9Android:layout_width= "Wrap_content"Tenandroid:layout_height= "Wrap_content" Oneandroid:text= "Network image Address"/> A -<EditText -Android:id= "@+id/edittext" theAndroid:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" - -android:text= "http://192.168.0.121:8081/ReadImage1/image/"/> + -<Button +Android:id= "@+id/button1" AAndroid:layout_width= "Wrap_content" atandroid:layout_height= "Wrap_content" -android:text= "Display"/> - - -<WebView -Android:id= "@+id/webview" inAndroid:layout_width= "Wrap_content" -android:layout_height= "Wrap_content"/> to +</LinearLayout>
Related background code
PackageCom.haofs.demo;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.view.View;ImportAndroid.view.View.OnClickListener;ImportAndroid.webkit.WebView;ImportAndroid.widget.Button;ImportAndroid.widget.EditText; Public classImageclientactivityextendsActivityImplementsOnclicklistener {Privatebutton button; PrivateEditText EditText; PrivateWebView WebView; @Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.main); Button=(Button) Findviewbyid (R.id.button1); EditText=(EditText) Findviewbyid (R.id.edittext); WebView=(WebView) Findviewbyid (R.id.webview); Button.setonclicklistener ( This); } @Override Public voidOnClick (View arg0) {//TODO auto-generated Method StubWebview.loadurl (Edittext.gettext (). toString ()); }}
This article comes from:
Load the server-side picture from the Android client
http://www.apkbus.com/forum.php?mod=viewthread&tid=97293
(Source: Android Development Forum-Android Development Forum-Android Development-Android forum-Mobile internet portal)
One step of life, one inch of thought, every moment ...
App development history--android phone display server-side picture ideas