Re: [android-developers] AppWidgets Disappearing from list in ICS

2012-01-05 Thread Ash McConnell
Hi Kostya,

Sorry for the late reply, it has been a hectic holiday period.

I couldn't get it to cause any problems in the emulator or any warnings on 
my Android 2.2 device (Motorola Defy)

I got the user to send me a log file using a logfile capture app.  There 
was one exception of interest: -


12-21 12:24:46.919 E/AndroidRuntime(21552): FATAL EXCEPTION: main
12-21 12:24:46.919 E/AndroidRuntime(21552): java.lang.RuntimeException: 
Failure delivering result ResultInfo{who=null, request=5, result=-1, 
data=Intent { (has extras) }} to activity 
{com.android.launcher/com.android.launcher2.Launcher}: 
java.lang.NullPointerException
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread.
deliverResults(ActivityThread.java:2976)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread.
handleSendResult(ActivityThread.java:3019)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread.
access$1100(ActivityThread.java:122)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread$H.
handleMessage(ActivityThread.java:1176)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.os.Handler.
dispatchMessage(Handler.java:99)
12-21 12:24:46.919 E/AndroidRuntime(21552): at 
android.os.Looper.loop(Looper.java:137)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread.
main(ActivityThread.java:4340)
12-21 12:24:46.919 E/AndroidRuntime(21552): at 
java.lang.reflect.Method.invokeNative(Native 
Method)
12-21 12:24:46.919 E/AndroidRuntime(21552): at java.lang.reflect.Method.
invoke(Method.java:511)
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.internal.os.
ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.internal.os.
ZygoteInit.main(ZygoteInit.java:551)
12-21 12:24:46.919 E/AndroidRuntime(21552): at 
dalvik.system.NativeStart.main(Native 
Method)
12-21 12:24:46.919 E/AndroidRuntime(21552): Caused by: 
java.lang.NullPointerException
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.launcher2.
Launcher.getSpanForWidget(Launcher.java:941)
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.launcher2.
Launcher.completeAddAppWidget(Launcher.java:964)
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.launcher2.
Launcher.completeAdd(Launcher.java:492)
12-21 12:24:46.919 E/AndroidRuntime(21552): at com.android.launcher2.
Launcher.onActivityResult(Launcher.java:528)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.Activity.
dispatchActivityResult(Activity.java:4649)
12-21 12:24:46.919 E/AndroidRuntime(21552): at android.app.ActivityThread.
deliverResults(ActivityThread.java:2972)
12-21 12:24:46.919 E/AndroidRuntime(21552): ... 11 more
12-21 12:24:46.919 W/ActivityManager(  176):   Force finishing activity 
com.android.launcher/com.android.launcher2.Launcher


Here is the relevant file 
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.1_r1/com/android/launcher2/Launcher.java?av=f
 

It seems like it can't get the appWidgetInfo object on line 959.  I have 
checked my AppWidgetProviderInfo XML and it seems to comply to the 
guidelines/rules.  I'm not sure what I've done wrong here

Any suggestions would be welcome.
All the best,
Ash




-- 
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

Re: [android-developers] AppWidgets Disappearing from list in ICS

2011-12-15 Thread Ash McConnell
Yep, the user has just replied that he has a Galaxy Nexus and it doesn't 
have an SD card of course :(

Can anyone think of another reason why the Widgets are being removed from 
the list when deleted from the homescreen?  He says that the application 
still appears in the list of apps, so he isn't accidentally uninstalling.

I'm a bit stuck on this one.
Thanks!
Ash

-- 
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

Re: [android-developers] AppWidgets Disappearing from list in ICS

2011-12-15 Thread Ash McConnell
Hi Kostya,

Yep, it was a good suggestion, I just had forgotten that he had a Nexus and 
it didn't have external storage.

I've asked him to try a reboot, hopefully that will help.

Thanks again!
Ash

-- 
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

Re: [android-developers] AppWidgets Disappearing from list in ICS

2011-12-15 Thread Ash McConnell
Ok, the user has responded to me with: - 

Ok I got the update then I did this
added a clock
removed that clock
went back to widgets, icon for clock still there
got as far as tapping add widget
got Unfortunately, Launcher has stopped.
clock widget now missing from widget list

So then i tried rebooting the phone, clock widget still missing
So I went through the same process with the bar widget but at the point 
where it
stops I remembered to click Report

So for some reason my widgets are causing the Launcher to crash (or the 
launcher is bugged), has anyone ever caused the launcher to crash when 
adding widgets?

I've asked him which launcher he is using, but I suspect its the default 
Nexus launcher.

I'll do some more googling armed with this extra info, but if it rings any 
bells with anyone please let me know :)

All the best,
Ash

-- 
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

Re: [android-developers] AppWidgets Disappearing from list in ICS

2011-12-15 Thread Ash McConnell
He is using the default ICS (Galaxy Nexus) Launcher.

-Ash

-- 
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] AppWidgets Disappearing from list in ICS

2011-12-14 Thread Ash McConnell
Hi Folks,

A user is reporting a problem with my AppWidgets disappearing from the list 
of widgets in ICS.  I only have a Froyo (2.2) device to test on.  I'm not 
sure whether this is a problem with ICS only or other versions of the O/S.

Does anyone know what might cause this issue?  I've been googling, but 
haven't found anything similar.  Any help appreciated!

All the best,
Ash

-- 
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

Re: [android-developers] AppWidgets Disappearing from list in ICS

2011-12-14 Thread Ash McConnell
Ahhaaa, now that's a question to ask.

Thanks Kostya, That sounds plausible!  I'll ask now

All the best,
Ash

-- 
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] Possible to get AppWidget Height?

2011-10-23 Thread Ash McConnell
Hi Folks,

I've found that for some Launchers my 
AppWidgethttps://market.android.com/details?id=sirocco.widgets doesn't 
format quite correctly as they squash the AppWidgets by 10 or so pixels (to 
add a page indicator) - e.g. Samsung Galaxy 2 and Sony Experia Arc.  

They must not provide the same amount of space (even if you consider device 
independent pixels) as all units use dp.  Therefore I need a way to 
determine the height of an AppWidget.  Is there a way?

Thanks for your help
All the best,
Ash

-- 
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: Android setImageUri not working with asset Uri

2011-10-05 Thread Ash McConnell
Hi pskink,

Just getting round to trying this now due to family illness.  It works great 
:).  Thanks for taking the time!

Do you know if it could be used to load 9 patch files using Uri's by any 
chance?  It would be great if I could skin my widgets with 9 patch bitmaps.

Thanks again,
All the best,
Ash

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ash McConnell
Hi Folks,

I'm still having problems with this, does anyone know if it's possible?

Thanks!
Ash

-- 
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

Re: [android-developers] Android Widget update problem

2011-09-26 Thread Ash McConnell
You need to create a pending intent which will send an event to your widget, 
then handle that event in your widget

Intent intent = new Intent(context, MightyToggleWidget.class);
intent.setAction(MY_HANDLE_BUTTON_EVENT_NAME);

PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 
0);
views.setOnClickPendingIntent(button, pendingIntent);

This will make the MY_HANDLE_BUTTON_EVENT_NAME event to be broadcast.   

Now you need to handle this event in your AppWidgetProvider implementation

...To do this you need to tell Android O/S that your AppWidgetProvider will 
handle the event, you do this by adding an entry in the intent-filter 
section like so:-

action android:name=MY_HANDLE_BUTTON_EVENT_NAME /

Now you need to actually handle the event.  You need to override 
AppWidgetProvider's onReceive like so: -

@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);

 if 
(intent.getAction().equals(MY_HANDLE_BUTTON_EVENT_NAME){
doSomething();
 }
}

I hope this helps!
All the best,
Ash

-- 
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] Android setImageUri not working with asset Uri

2011-09-23 Thread Ash McConnell
Hi Folks,

I am using the following code to set an image from the assets folder.

Uri numBgUri = 
Uri.parse(file:///android_asset/background_numbers.png);
numBgImage.setImageURI(numBgUri);

The background_numbers.png file definitely exists in the assets root 
directory.  I am getting a FileNotFoundException in the log: -


09-23 17:05:23.803: WARN/ImageView(23713): Unable to open content: 
file:///android_asset/background_numbers.png

Any ideas what I could be doing wrong?

Thanks!
Ash

-- 
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 Reset the ColorFilter of a RemoteView in an AppWidget

2011-08-30 Thread Ash McConnell
Hi Folks,

I am setting a ColorFilter on one of my ImageViews with the following code: 
-

views.setInt(myView, setColorFilter, myColour);

Is there any way to remove this filter to return the colours to normal?  I 
have tried using: -

views.setInt(iconResource, setColorFilter, -1);

Any ideas what I could do to reset this?

Thanks!
All the best,
Ash


-- 
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: How to Reset the ColorFilter of a RemoteView in an AppWidget

2011-08-30 Thread Ash McConnell
Aha, figured it out: -

Setting the ColorFilter to 0 will clear the filter:- 

views.setInt(iconResource, setColorFilter, 0);

Hope this helps
All the best,
Ash

-- 
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] Setting Auto-sync ( setMasterSyncAutomatically )

2011-08-18 Thread Ash McConnell
Hi Folks,

I am developing a group of widgets that allow the quick changing of various 
settings.  I was hoping to set AutoSync, which I thought would stop 
background services from syncing their data, but this appears to be the 
Secure Setting BACKGROUND_DATA.

My question is, what this function achieve?
public static void setMasterSyncAutomatically (boolean sync)Is it useful to 
be able to set / unset this?

Thanks for your help!
All the best,
Ash

-- 
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] Offsetting position of a View in a AppWidget

2011-08-16 Thread Ash McConnell
I am creating an AppWidget that allows users to skin the widget and download 
from a list of widgets online. I would like to allow skinners to offset the 
position of the icons vertically.

I initally tried calling offsetTopAndBottom on the LinearLayout that holds 
the icons, this is not allowed as its not supported with RemoteViews.

I then had an idea of using 2 Views inside a LinearLayout (on top and below 
the icon Layout) to squash the icons towards the bottom (if the height of 
the top layout was set to  0).

When I tried to set the height of these views: -

 views.setInt(R.id.iconMarginTop, setMinimumHeight, offset);

it also complained that it wasn't supported with RemoteViews

Any ideas what I could do to acheive this offset?

Thanks for your help!
All the best,
Ash

-- 
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: App Widget stops responding to input after all instances are removed and another added

2011-08-03 Thread Ash McConnell
I'm not sure if I made a mistake when I posted this, but it's currently only 
receiving .BATTERY_CHANGED events despite being registered for these events: 
-

action android:name=android.appwidget.action.APPWIDGET_UPDATE /
action android:name=android.bluetooth.adapter.action.STATE_CHANGED /
action android:name=android.intent.action.AIRPLANE_MODE /
action android:name=android.net.wifi.WIFI_STATE_CHANGED /
action android:name=android.media.RINGER_MODE_CHANGED /
action android:name=sirocco.widget.NEW_WIDGET_INSTANCE_ADDED /
action android:name=android.intent.action.BATTERY_CHANGED /

I normally send broadcast message (sirocco.widget.NEW_WIDGET_INSTANCE_ADDED) 
from the configuration activity when adding a new widget, but this is not 
received after APPWIDGET_DISABLED is received

I don't understand why only 1 type of broadcast message is received after 
all instances are removed (APPWIDGET_DISABLED then received) and a new 
instance is added.  I have double checked and the matchButtonToAction code 
is definitely called.

Could it be something to do with the context that is passed in?

Any pointers would be appreciated.
Thanks for your help
All the best,
Ash

-- 
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: App Widget stops responding to input after all instances are removed and another added

2011-08-03 Thread Ash McConnell


I have found the problem. The onEnabled event gets triggered at the start 
when the first widget is added. The onDisabled event gets triggered when the 
last widget is removed, but the onEnabled event does not get triggered when 
you try to add another first widget.

I had code that was similar to the examples in those events. This resulted 
in the packagemanager unregistering my AppWidgetProvider from receiving 
these events

For more explanation: -

http://stackoverflow.com/questions/6917415/app-widget-stops-responding-to-input-after-all-instances-are-removed-and-another

Hope this helps some googlers!
All the best,
Ash

-- 
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

Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-02 Thread Ash McConnell
Odd that File.setReadable doesn't seem to be available on my JDK 
installation (the latest version of 1.6)

-- 
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

Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-02 Thread Ash McConnell
It's because Android implemented Java.io.File and didn't include 
File.setReadable until API 9 (I am using API 8)

-- 
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] App Widget stops responding to input after all instances are removed and another added

2011-08-02 Thread Ash McConnell
I am having trouble when I add a one or more instances of my widget to the 
home screen, remove them all, then add another.

Here is the code I use to set the onClick intent for each button (button 
is a resource)

protected void matchButtonToAction(Context context, RemoteViews views, 
String action, int button) {
Intent intent = new Intent(context, MightyToggleWidget.class);
intent.setAction(action);

PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, 
intent, 0);
views.setOnClickPendingIntent(button, pendingIntent);
}

This only happens when I remove *ALL* instances and add one. If I add 2, 
remove 1 and add 1 it still works.

It is still receiving and reacting to events (such as wifi status changing 
or battery events).

Any ideas what could be causing this?
Thanks!
Ash

-- 
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] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Ash McConnell
Hi Folks,

I am coming across an error when I am updating my RemoteViews in my
AppWidget.

!!! FAILED BINDER TRANSACTION !!!

This is caused because all the changes to the RemoteViews are
serialised (e.g. setInt and setImageViewBitmap ). The bitmaps are also
serialised into an internal bundle. Unfortunately this bundle has a
very small size limit.

I cannot use setImageResource as I am hoping to allow the user to
download skins for the widget.

Can anyone recommend a workaround for this problem? I am already using
a new RemoteViews object for each instance of the widget, but a
single instance contains too many updates.

All the best,
Ash

-- 
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


Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Ash McConnell
Hi Kostya,

It's not that the single bitmap is too large, it's that I'm updating quite a 
few bitmaps.  The biggest bitmap in PNG form (a lot smaller I know) is only 
4KB. I am updating 14 ImageViews in each update.  Is there any way to split 
the update for each widget instance somehow?

What are the other methods to push a bitmap into a widget?  Anything I could 
search for?

Thanks for your help!
All the best,
Ash

-- 
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

Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Ash McConnell
Hi Kostya / Dianne,

Thanks for the replies.  As Dianne suggested, removing half the bitmaps does 
indeed make it work.

I can't really reduce the amount of bitmaps, so I am trying to use the 
setImageURI on ImageView.  Unfortunately I am getting permission denied 
errors.

Here is the test code I used: -

File file = new File(context.getFilesDir().getAbsolutePath() 
+ /skins/Minimal/flight_on.png);
if (file.exists()){
Uri uri = Uri.fromFile(file);
Log.i(LOGTAG, uri.toString());
views.setUri(R.id.buttonSound, setImageURI, uri);
}


The file *does* exist and I get the following log message: -

08-01 17:19:20.304: INFO/WidgetTest(4563): 
file:///data/data/sirocco.widgets/files/skins/Minimal/flight_on.png

I didn't think I would have permission problems with the widget's own files. 
 Is there a problem with accessing these files from a widget (actually a 
private service class within the widget)?

Thanks again for your help
All the best,
Ash

-- 
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

Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Ash McConnell
Ah ok, I copy the files over into the skins directory in my configuration 
activity.  I currently use normal java.io.FileOutputStream objects, should I 
be using context.openFileOutput with 
MODE_WORLD_READABLEhttp://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE
 set?

-- 
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

Re: [android-developers] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Ash McConnell
Thanks Kostya and Dianne, setUri works as expected.  I had to create the 
files using context.openFileOutput.  Unfortunately that means I loose the 
ability to use directories.  I can't see a Java way to set permission on 
files, it can be done with native methods, but that seems like overkill. 
 I'll do some more googling.

Thanks again for the help, I was worried that this problem might have been a 
show-stopper.
Ash

-- 
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: Possible to use OpenGL in both C++ and Java?

2011-05-16 Thread Ash McConnell
Thanks guys for the replies.  I didn't see the message for a couple of
days so I thought it had got lost in moderation.

I managed to get it working, I just needed to call the native
rendering code from onDrawFrame and the texture loading code from
onSurfaceCreated.

Sorry I didn't reply earlier, but thanks for your help
All the best,
Ash

On Apr 26, 4:51 am, Nightwolf mikh...@gmail.com wrote:
 Calling native functions for rendering from
 GLSurfaceView.onDrawFrame() works.
 Texture loading goes to onSurfaceCreated().

 On Apr 23, 4:54 pm, AshMcConnellash.mcconn...@gmail.com wrote:







  Hi Folks,

  I am new to Android coding.  I am trying to convert an iPhone app and
  would like to keep the core c++ code in tact if possible (so that bugs
  can be fixed in a cross platform way).

  I am currently using an extended GLSurfaceView to do rendering, I
  believe this uses a separate thread and therefore doing OpenGL stuff
  in C++ doesn't work.  I tried to load a texture in C++ and pass the id
  back to java, but it didn't work - the texture was blank.

  Should I be using an alternative to GLSurfaceView?  Is there a
  normal way of achieving what I am trying?

  Thanks for your help
  All the best,
  Ash

-- 
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] Possible to use OpenGL in both C++ and Java?

2011-04-25 Thread Ash McConnell
Hi Folks,

I am new to Android coding.  I am trying to convert an iPhone app and
would like to keep the core c++ code in tact if possible (so that bugs
can be fixed in a cross platform way).

I am currently using an extended GLSurfaceView to do rendering, I
believe this uses a separate thread and therefore doing OpenGL stuff
in C++ doesn't work.  I tried to load a texture in C++ and pass the id
back to java, but it didn't work - the texture was blank.

Should I be using an alternative to GLSurfaceView?  Is there a
normal way of achieving what I am trying?

Thanks for your help
All the best,
Ash

-- 
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