App development history--android phone display server-side picture ideas

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.