Add Images to Jar files

by RamaMohan » Fri, 13 Aug 2010 21:43:25 GMT

Sponsored Links
 HI all,

I am creating a jar file which will return  a view to any application
in which jar file is added.
I am creating all the coding without any resources files.But my
problem is i want to add images to the jar file like i want to add my
logo .

I want to add some image files to the jar and i have to use that in my

How to perform this thing,I goggled for a while but i didn't find a
solution for this.
If anyone knows ,please let me know.



Add Images to Jar files

by DanH » Sat, 14 Aug 2010 01:04:46 GMT

 What do you want to know, how to put the image into the jar or how to
get it out?

To get it out you have to use one of 2-3 different techniques --
either get in bed with JAR terminology and use the
java.util.jar interfaces, or use the openStream
interface.  The latter is probably simpler.  Note that neither of
these approaches will work with image tools that expect a simple file


Sponsored Links

Other Threads

1. baffling alert dialog listener behavior: how come local variables dont keep their data

Consider the following listener class, where I want to remember a
promptValue and return. But after invoking it from a dialog I get the
value as null when I expect it to be "hello"

public class PromptListener
implements android.content.DialogInterface.OnClickListener
   public String promptValue = null;
   public void onClick(DialogInterface v, int buttonId)

Here is how I use this call back with a dialog

public static String Prompt(String message, Context ctx)
   //load some kind of a view
   LayoutInflater li = LayoutInflater.from(ctx);
   View view = li.inflate(R.layout.promptdialog, null);

   //get a builder and set the view
   AlertDialog.Builder builder = new AlertDialog.Builder(ctx);

   //add buttons and listener
   PromptListener pl = new PromptListener(view,ctx);
   builder.setPositiveButton("OK", pl);
   builder.setNegativeButton("Cancel", pl);

   //get the dialog
   AlertDialog ad = builder.create();


   //How come the following is "null" ???
   //when it shoudl be "hello" on a button click
   return pl.prompt;

The last return I should have a "hello".

DOes the builder copy or cache the listener and its local variables??

Appreciate your help



2. Clearing Touch Mode?

Is there a way in code to switch an application from Touch Mode to
Keyboard mode, or is this handled only via pressed on the screen or

3. write_sms and send_sms permissions

4. How to get Android local IP( not

5. Logging URL typed in the browser

6. prepareAsync called in state 1 error

7. Is Theme.Light supported in 1.0?