Displaying Images

by JavaAndroid » Wed, 15 Oct 2008 14:40:45 GMT


Sponsored Links
 Hi All,
Can anyone direct me to some links / tutorials that will help me to
start experimenting on displaying images in Android . Is there any way
to add Servlet/JSP API in Android Application. Can i refer image that
is residing in a web server.

Thanks in Advance

Thanks
JavaAndroid
--~--~---------~--~----~------------~-------~--~----~



Displaying Images

by shailesh prakash » Wed, 15 Oct 2008 14:45:52 GMT


 Hi,
you may like to try this :
 http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/?r=73 




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Displaying Images

by JavaAndroid » Wed, 15 Oct 2008 14:55:57 GMT


 Hi Shailesh,
Thanks a lot for ur Help. Let me try that...Thanks again.




--~--~---------~--~----~------------~-------~--~----~



Displaying Images

by JavaAndroid » Fri, 17 Oct 2008 19:57:01 GMT


 i All,
I tried displaying a small image in ContentView. But when i run the
application It says ImageApplication closed unexpectedly....

This is my Activity Class...

public class ImageApplication extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
((Gallery) findViewById(R.id.gallery))
.setAdapter(new ImageAdapter(this));
}
}

And my Image Adapter class is this
public class ImageAdapter extends BaseAdapter {
/** The parent context */
private Context myContext;

/** All images to be displayed.
* Put some images to project-folder:
* '/res/drawable/uvw.xyz' .*/
private int[] myImageIds = {
R.drawable.image1


};
/** Simple Constructor saving the 'parent' context. */
public ImageAdapter(Context c) { this.myContext = c; }

/** Returns the amount of images we have defined. */
public int getCount() { return this.myImageIds.length; }

/* Use the array-Positions as unique IDs */
public Object getItem(int position) { return position; }
public long getItemId(int position) { return position; }

/** Returns a new ImageView to
* be displayed, depending on
* the position passed. */
public View getView(int position, View convertView, ViewGroup
parent) {
ImageView i = new ImageView(this.myContext);

i.setImageResource(this.myImageIds[position]);
/* Image should be scaled as width/height are set. */
i.setScaleType(ImageView.ScaleType.FIT_XY);
/* Set the Width/Height of the ImageView. */
i.setLayoutParams(new Gallery.LayoutParams(150, 150));
return i;
}

/** Returns the size (0.0f to 1.0f) of the views
* depending on the 'offset' to the center. */
public float getScale(boolean focused, int offset) {
/* Formula: 1 / (2 ^ offset) */
return Math.max(0, 1.0f / (float)Math.pow(2,
Math.abs(offset)));
}

}

When i run the appliction i m getting this Exception in console...
10-17 17:14:09.864: ERROR/AndroidRuntime(203):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.dreamapp.imageapplication.activity/
com.dreamapp.imageapplication.activity.ImageApplication}:
java.lang.NullPointerException
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2140)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2156)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.os.Handler.dispatchMessage(Handler.java:88)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.os.Looper.loop(Looper.java:123)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
android.app.ActivityThread.main(ActivityThread.java:3742)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
java.lang.reflect.Method.invokeNative(Native Method)
10-17 17:14:09.864: ERROR/AndroidRuntime(203): at
java.lang.refl



Displaying Images

by JavaAndroid » Sun, 19 Oct 2008 02:32:20 GMT


 i All,
I figured out the problem....the problem is with main.xml....
Earlier it was
<Gallery d="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
/>
i changed it to
this
<Gallery android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
/>
this resolved the error...
Thanks
JavaAndroid

On Oct 17, 4:56pm, JavaAndroid <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Eclipse stuck at 19%

Hello
        on Linux I've got a strange problem. When I try to run my project in 
Eclipse, 
it starts fine the emulator, but after that, when launching an application, 
eclipse remain at 19% of "Launching Delegate", and nothing is shown on the 
emulator.

Any idea?

TIA
        Bedo

--~--~---------~--~----~------------~-------~--~----~

2. Error when Accessing webservice -

Hi

I am getting a SOAP error when accessing a web service.
The web service is setup on my local machine using Tomcat/Axis.

When I use the Android Web Service API I get a SOAP error
"ns1:Client.NoSOAPAction"

I am using the SOAP monitor GUI -  "TCPMonitor".

Below is part of the SOAP fault message
<soapenv:Fault>
   <faultcode xmlns:ns1="http://xml.apache.org/
axis/">ns1:Client.NoSOAPAction</faultcode>
   <faultstring>no SOAPAction header!</faultstring>
   <detail>
    <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">mariof</
ns2:hostname>
   </detail>
  </soapenv:Fault>

The Android Code is as follows

  WebServiceClient service = new WebServiceClient(this);
                Vector res = service.ping("222.168.154.1:8080/axis/
HelloWorldService.jws",                                 "getMessage");


The SOAP message sent as a result of this code is as follows

POST /axis/HelloWorldService.jws HTTP/1.1
Host: 127.0.0.1:8880
Accept-Encoding: gzip
Content-Type: text/xml
Content-Length: 60

<methodCall>
      <methodName>
          getMessage
     </methodName>
</methodCall>



When i access the web service using a java program trhat uses the Axis
apis the web service call works and I get a message from the
webservice . Below is the SOAP message from the program.

The message header below  contains the following text -->>
SOAPAction: ""
. This seems to be the reason for the error  "no SOAPAction
header!"  .
Does anyone know how to fix this error??

POST /axis/HelloWorldService.jws HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.4
Host: 127.0.0.1:8880
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 380

<?xml version="1.0" encoding="UTF-8"?>
        <soapenv:Envelope
             xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                     <soapenv:Body>
                             <ns1:getMessage
                           oapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/"
                           xmlns:ns1="http://DefaultNamespace"/>
                     </soapenv:Body>
        </soapenv:Envelope>



many thanks in advance

Regards

mario




--~--~---------~--~----~------------~-------~--~----~

3. Listview non-clickable row - possible bug?

4. anyone know how to integrate the Wimax drvier, GSM driver, CDMA2000 modem driver

5. deploy android application

6. SQLite db issue : no such column

7. about spinners