builde sample code have a error

by yui » Fri, 22 May 2009 01:56:54 GMT


Sponsored Links
 Dear all
If i clean the project and select build progect, will have some worng.
and can't generate .APK file
message as follows

[2009-05-21 11:39:31 - HelloListView] no classfiles specified
[2009-05-21 11:39:31 - HelloListView] Conversion to Dalvik format
failed with error 1

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



Other Threads

1. decode image

Hi, all I am developing one application in that I want to decode
image, I have one .txt file which contains encoded format of image
(image is encoded using Base64 format). I have Base64 class in that I
have decode(String base64) method which accept String and return byte
array. I have one txt file of size more than 6MB which contains
encoded image now I want to decode that image to .jpg format . I had
tried it but when I open decoded image it is not open.and size is also
very less (18KB and expected size is 5MB)   Here is my code


 public void decodeImage()
    {
        System.out.println ("Now decoding image");

        try
                {
                image.createNewFile();
                         byte[] byteArray = new byte[102400];
                         FileInputStream fstream = new 
FileInputStream(imageFile);
                         int bytesRead = 0;
                         while((bytesRead = fstream.read(byteArray)) != -1)
                         {
                                str = new String(byteArray,0,bytesRead);
                                byte[] im = Base64.decode(str);
                                out1 = new FileOutputStream(image);
                         try
                         {
                             out1.write(im);
                             out1.flush();
                         }
                         catch (Exception e)
                         {
                                 e.printStackTrace();
                         }
                         }


                         out1.close();

                }
        catch (Exception e)
        {
                e.printStackTrace();
        }
    }

What is fault? Please help me . Thanks in advance

-- 

2. About getting wrong sizes with drawables objects.

Hi, I am using some drawable objects, when I instance them and paint
in my canvas they doesn't get the original PNG image file size,
instead they get a bigger size, so they does't paint in my canvas as I
expected since I wanted them in their original sizes, why this
happens???

(original file is 96x96 pixels)

--------------------------------------------------------------------------------------------------------------------------------------
mSprite = mRes.getDrawable(R.drawable.my_sprite);

mSpriteWidth = mSprite.getIntrinsicWidth(); // It returns 114, not 96
mSpriteHeight = mSprite.getIntrinsicHeight(); // It returns 114, not
96

mSprite.setBounds(coordX, coordY, coordX + mSpriteWidth, coordY +
mSpriteHeight);
mSprite_PipeRect.draw(canvas); //It paints at 114x114 size, it shows
bigger in the screen then original size

--------------------------------------------------------------------------------------------------------------------------------------

Something similar happens with the background but it is fixed in the
"setSurfaceSize" event this way:

public void setSurfaceSize(int width, int height) {
           mBackgroundImage =
Bitmap.createScaledBitmap(mBackgroundImage, width, height,
true);
}


In this case height and widht is properly provided in the event
parameters

--------------------------------------------------------------------------------------------------------------------------------------


Why are not loaded in their original size, and how to get original
size for my drawables???

Thanks in advance.

-- 

3. Converting Bitmap to ASCII

4. SurfaceHolder changed : Stops Video playback

5. More AsyncTask - Simultaneous Downloads

6. Application-wide resources.. how to achieve?

7. Mechanism to ensure request comes from my app