[android-developers] Problems creating a "Custom Dialog"

2009-05-07 Thread L'\tty

Hi guys,

I tried to create a custom about dialog using the source code of

http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

with the result that I get a BadTokenException and the message that
the view cannot be null. If I understood it correctly, the
custom_dialog.xml is a new layout file containing just the information
for the dialog and the layout_root id is not needed for the first
solution.

The code from step 2 should be in the class where I want to display
the dialog right? At least I put it in the onCreateDialog(int id)
method.

I also tried to implement a custom alert dialog that actually lead to
the same problem. However, the system did not know the
LAYOUT_INFLATER, is this a self defined variable or where do I get
this attribute from?

Anyhow it seems that the dialogs have problems setting a view. Does
anybody know this error and how to avoid it?

Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Weird bug when saving picture to file system!?

2009-05-07 Thread L'\tty

I see, thx for the help! :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Weird bug when saving picture to file system!?

2009-05-06 Thread L'\tty

Thanx for the hint! Could you possibly be so kind to post me the code
for scanning a file manually. I tried it but anyhow, I get an
exception because it seems that I am not connected to the Media
Scanner service although I called the connect() method.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Weird bug when saving picture to file system!?

2009-05-01 Thread L'\tty

Okay, thank you so much. I am glad to hear that this is a bug which
going to be fixed :-)

On 1 Mai, 15:43, "admin.androidsl...@googlemail.com"
 wrote:
> A few people have come across this. It is a known bug and will be
> fixed in Cupcake.
>
> On May 1, 2:33 pm, "L'\\tty"  wrote:
>
> > I was also wondering how the insertImage() mehtod works. Is there
> > source code for this method available, so I can write my own method?
>
> > Best regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to avoid out of memery exception

2009-05-01 Thread L'\tty

Hi all!

As mentioned in an earlier post, I am working on a image processing
application for android. I encountered an issue regarding the memory
contingent of the VMware.

In other posts I read that it is not possible to import pictures in
full size, they are automatically scaled to the display dimensions,
right?

If I am applying filters to a picture and I repeat this procedure for
more than one pictures the VMware runs out of memory. Is there a
chance of avoiding this problem? Can I free some ressources manually
or can I change something in architecture to avoid my application from
crashing?

Regards, Florian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Weird bug when saving picture to file system!?

2009-05-01 Thread L'\tty

I was also wondering how the insertImage() mehtod works. Is there
source code for this method available, so I can write my own method?

Best regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Weird bug when saving picture to file system!?

2009-04-30 Thread L'\tty

I am developing a photoshop application for the G1 where you can apply
different filters to your pictures stored in the pictures folder. So I
use a gallery and a cursor to select the picture I want to manipulate,
copy the picture to a bitmap so I can perform some filter operations
and afterwards save the new bitmap as a new file to the phone. So I
figured out that there are basically two options I have to save the
image. One is to use the MediaStore.Images.Media.insertImage()
methode, which generally would work, but I don't want a thumbnail to
be created. The second option, which I actually use, is to use an
OutputStrem.

import android.provider.MediaStore.Images.Media;
import android.content.ContentValues;
import java.io.OutputStream;

// Save the name and description of an image in a ContentValues map.
ContentValues values = new ContentValues(3);
values.put(Media.DISPLAY_NAME, "road_trip_1");
values.put(Media.DESCRIPTION, "Day 1, trip to Los Angeles");
values.put(Media.MIME_TYPE, "image/jpeg");

// Add a new record without the bitmap, but with the values just set.
// insert() returns the URI of the new record.
Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI,
values);

// Now get a handle to the file for that record, and save the data
into it.
// Here, sourceBitmap is a Bitmap object representing the file to save
to the database.
try {
OutputStream outStream = getContentResolver().openOutputStream
(uri);
sourceBitmap.compress(Bitmap.CompressFormat.JPEG, 50, outStream);
outStream.close();
} catch (Exception e) {
Log.e(TAG, "exception while writing image", e);
}

This snippet can also be found in the devguide (http://
developer.android.com/guide/topics/providers/content-providers.html)
and it saves the image to the phone's photo album. However, after the
image is stored on the phone, I cannot open the picture gallery in the
main menu again. An unknown exception is thrown. I'm still able to
access the gallery using the camera menu and it also works fine within
my application, but anyhow I have to reboot the phone to access the
gallery using the pictures shortcut in the main menu.

Using the insertImage() method I don't have this problem. The image
subsequently appears in the gallery after saving it and I can open the
gallery from the main menu but using the OutputStream, the gallery
crashes when I try to open it and it is not displayed immediatly in
the gallery of my application.

Does anybody know what I am doing wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Weired bug when saving picture to file system!?

2009-04-30 Thread L'\tty

Hi!
I am developing a photoshop application for the G1 where you can apply
different filters to your pictures stored in the pictures folder. So I
use a gallery and a cursor to select the picture I want to manipulate,
copy the picture to a bitmap so I can perform some filter operations
and afterwards save the new bitmap as a new file to the phone. So I
figured out that there are basically two options I have to save the
image. One is to use the MediaStore.Images.Media.insertImage()
methode, which generally would work, but I don't want a thumbnail to
be created. The second option, which I actually use, is to use an
OutputStrem.

import android.provider.MediaStore.Images.Media;
import android.content.ContentValues;
import java.io.OutputStream;

// Save the name and description of an image in a ContentValues map.
ContentValues values = new ContentValues(3);
values.put(Media.DISPLAY_NAME, "road_trip_1");
values.put(Media.DESCRIPTION, "Day 1, trip to Los Angeles");
values.put(Media.MIME_TYPE, "image/jpeg");

// Add a new record without the bitmap, but with the values just set.
// insert() returns the URI of the new record.
Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI,
values);

// Now get a handle to the file for that record, and save the data
into it.
// Here, sourceBitmap is a Bitmap object representing the file to save
to the database.
try {
OutputStream outStream = getContentResolver().openOutputStream
(uri);
sourceBitmap.compress(Bitmap.CompressFormat.JPEG, 50, outStream);
outStream.close();
} catch (Exception e) {
Log.e(TAG, "exception while writing image", e);
}

This snippet can also be found in the devguide (http://
developer.android.com/guide/topics/providers/content-providers.html)
and it saves the image to the phone's photo album. However, after the
image is stored on the phone, I cannot open the picture gallery in the
main menu again. An unknown exception is thrown. I'm still able to
access the gallery using the camera menu and it also works fine within
my application, but anyhow I have to reboot the phone to access the
gallery using the pictures shortcut in the main menu.

Using the insertImage() method I don't have this problem. The image
subsequently appears in the gallery after saving it and I can open the
gallery from the main menu but using the OutputStream, the gallery
crashes when I try to open it and it is not displayed immediatly in
the gallery of my application.

Has anybody experienced similar issues or does anybody know if I'm
doing something wrong? Because there is no clear exception message and
moreover the exception comes from the system and not from my
application I'm more and more convinced that this could be a bug?!

Regards, Florian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---