Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

App fails on Nexus One

Trying out the new 1.0 SDK.

Wrote the following simple application:

Titanium.UI.setBackgroundColor('#AAFFCC');

var win = Titanium.UI.createWindow({
top:0,
left:0,
width:320,
height:480,
borderRadius:0,
touchEnabled:false
});

var imageView = Titanium.UI.createImageView({
top:00,
left:00,
width:320,
height:380,
backgroundColor:'#999'
});

var lbl = Titanium.UI.createLabel({
text:'Test',
top:390,
width:320,
color:'#999',
height:'auto',
textAlign:'left'
});

win.add(imageView);
win.add(lbl);
win.open();

Titanium.Media.openPhotoGallery({

success:function(event)
{
    var image = event.media;
        var cropRect = event.cropRect;
    var thumbnail = event.thumbnail;

    // set image view
    //imageView.image = event.media;
    lbl.text = 'w: ' + image.width + '  h:' + image.height;

},
cancel:function()
{

},
error:function(error)
{
},
allowImageEditing:true,

});

After I run and choose any photo from the gallery, app hangs with unexpected error. If I comment the assign statement and printing out the image dimensions, width and height are always equals zero.

Contacts API also not working at all on Android. Application just crashes without of any actions on the following line:

contacts = Titanium.Contacts.getAllContacts();

This code fails both on device and on Emulator.

As I can see, the Kitchen Sink 0.9.3 was redesigned and many features was disabled when app running on Android.
Does this means that these APIs working incorrectly and will be improved in the future, or this is problem of my Google Nexus One phone?

— asked March 9th 2010 by Azat A
  • 1.0
  • androd
  • contacts
  • gallery
0 Comments

3 Answers

  • Contacts have not been ported yet for Android. We have disabled tests on KS for Android to those that are working at the level we feel ok to show. We are filling in the gaps as quickly as we can.

    — answered March 9th 2010 by Don Thorp
    permalink
    0 Comments
  • Thanks a lot for quick response, Don.

    If I understand properly, openPhotoGallery support also not ported yet, right?

    — answered March 9th 2010 by Azat A
    permalink
    0 Comments
  • openPhotoGallery should be working :) Would you mind pasting the full log from developer with the log level set to TRACE ?
    http://pastie.org

    — answered March 9th 2010 by Marshall Culpepper
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.