porting ogre on Android

by Geetha » Fri, 05 Feb 2010 01:05:09 GMT


Sponsored Links
 Hi Folks,
 I am new to developing 3D graphics rendering on Android. I need help
to port OGRE on Android.

Thanks,
Geetha

--



Other Threads

1. ImageButton caching images when using Uri

I'm seeing some caching problems when using an ImageButton with a Uri
and I'm not sure if there's a flag that needs set somewhere or not.

I'm using the button to add an icon to an item in one of my
applications, exactly like it's being used for the Contact application
(which I don't think the source is available for).  I'm using the CROP
trick seen in this application:
http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/ViewPhotoActivity.java

Specifically, I'm calling the image picker and then the crop like so:

protected OnClickListener cmdIconListener = new OnClickListener() {
    // @Override
        public void onClick(View arg0) {
            Intent i = new
Intent("android.intent.action.GET_CONTENT");
            i.setType("image/*");
            startActivityForResult(i, AddTea.ADD_ICON);
        }
};

protected void onActivityResult(int requestCode, int resultCode,
Intent data){
    // See which child activity is calling us back.
    switch (requestCode) {
    case AddTea.ADD_ICON:
        // This is the standard resultCode that is sent back if the
        // activity crashed or didn't doesn't supply an explicit
result.
        if (resultCode != RESULT_CANCELED){
             Intent i = new Intent("com.android.camera.action.CROP");
             i.setClassName("com.android.camera",
"com.android.camera.CropImage");
             i.setData(data.getData());
             Log.d(TAG, "path: " + data.getData().getPath());
             i.putExtra("noFaceDetection", true);
             i.putExtra("outputX", iconWidth);
             i.putExtra("outputY", iconHeight);
             i.putExtra("aspectX", iconWidth);
             i.putExtra("aspectY", iconHeight);
             i.putExtra("scale", true);

             if(iconUri == null){
                 ContentValues values = new ContentValues();
 
values.put(android.provider.MediaStore.Images.Media.TITLE, name + "
Icon");
 
values.put(android.provider.MediaStore.Images.Media.BUCKET_ID,
"STeaP_Tea_Timer_Icons");
 
values.put(android.provider.MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
"STeaP Tea Timer Icons");
                 iconUri =
getContentResolver().insert(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
values).toString();
              }
              i.putExtra("output", Uri.parse(iconUri));
              startActivityForResult(i, CROP_ICON);
        }
        break;
    case AddTea.CROP_ICON:
        if (resultCode != RESULT_CANCELED){
        Log.d(TAG, "Data String: " + iconUri);
        showIconButton(iconUri);
    }
    default:
        break;
    }
}

protected void showIconButton(String iconUri){
    if(iconUri != null){
        ImageButton iconField = (ImageButton)
findViewById(R.id.iconButton);
        Log.d(TAG, "iconUri: " + iconUri);
        iconField.setImageURI(Uri.parse(iconUri));
        iconField.invalidate();
    }
}


So if the item doesn't have an icon, set one in the ContentProvider
and save the iconUri.  If it does, just overwrite it with the new
cropped image.

This works fine if the item never had an icon.  It shows in the
ImageButton when the Activity returns.  However, if the item already
had an icon, my Activity still shows the old icon, even though it was
overwritten.  It seems that if the ImageButton gets the same Uri back,
even if I wrote a new image to it, it doesn't redraw, even if I tell
it to invalidate().  If I relaunch my Activity, the new image shows up
just like I expected.  Funny enough, the Pictures application doesn't
see any images I created until I restart the emulator, which also
doesn't seem ideal!

So, is there anyway to handle this caching of the Uri?  I seems like
the ContentProvider should be doing this when I write a new image to
it, but it doesn't seem to be.  Also, before anyone suggests, I tried
deleteing the entry in the ContentProvider and making a new one and
that seems to partially work.  It partilly works because, if the Uri
we get back it new, the view does refresh with this new Uri.  However,
if the icon was the last picture to be saved to the ContentProvider,
say item 10, then the ContentProvider will delete item 10 and the
reuses 10 as the next id!  So I'm back where I started and the
ImageButton shows the old icon.

Any help in kicking the ContentProvider of ImageButton into shape
would be appreciated.
--~--~---------~--~----~------------~-------~--~----~

2. Algorithm writen in C

Hello buddies!!
I'm involved in a biometric project. I need to write an app for
Android that must use an algorithm writen in C language. This C code
is very complex and for this reason translating this code into java is
not an option. The idea is to develop the main application in java
code and this would "call" to the algorithm somehow, so the algorithm
could return a value for the main app. I know there are some libs
writen in C/C++ and I'm wondering if I could do so for my project,
write my own lib and call it from the main app. But I don't know if it
is possible, how to do it, how to compile my C code for Android and so
on.
To help the algorithm is writen in C and is compiled for Linux.
Could anyone lead me through the darkness?
Thanks mates.

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

3. Porting iPhone application to Google Phone using Android

4. Connect to an online SQL database

5. Important Announcement: Handango Android Catalog

6. Application for turning off mobile ?

7. Android Emulator and the Tilt Sensors