← Back to team overview

ubuntu-phone team mailing list archive

Re: Questions about debugging

 

On Mon, Sep 16, 2013 at 7:38 AM, Jamie Strandboge <jamie@xxxxxxxxxxxxx>wrote:

> On 09/15/2013 05:09 AM, Michel Renon wrote:
> > Hi,
> >
> > I'm trying to debug my app for the Showdown !
> > (I done all coding on my desktop, and could just start testing it
> yesterday.)
> >
> > Here are my questions :
> >
> > - how do i read the results of "console.debug()" when executed on device
> ?
> >
> >
> >
> >
> > - I use U1db to store 2 values in one document. On the device, it seems
> nothing
> > is written. Here is the document definition :
> >
> >     U1db.Document {
> >         id: dbContext
> >         database: utranslateDB
> >         docId: 'context'
> >         create: true
> >         defaults: { 'lgsrc': 'eng', 'lgdest': 'deu'}
> >     }
> >
> > and the code :
> >     function saveDb() {
> >         var temp = {};
> >         temp['lgsrc'] = searchContext['lgsrc'];
> >         temp['lgdest'] = searchContext['lgdest']
> >         dbContext.contents = temp;
> >     }
> > Is there anything special to be done for mobile devices ?
> > Or is it related to the special way of "quitting" an app on uTouch ?
> >
> >
>
> I'm just passing this along. ubuntu-tasks was not saving any of its data on
> Ubuntu Touch, so I alerted the developer (in CC). He responded back with:
>
> "I just figured out that this is due to a bug in the SDK preventing
> Component.onDestruction from being called when the app is stopped."
>
> I don't know what bug that is or how he solved it though...
>
> --
> Jamie Strandboge                 http://www.ubuntu.com/
>

I solved this partially by using a Timer that would fire every 5 seconds
and save the app's data.

The code I used was:

    Timer {
        interval: 5000 // 5 seconds
        repeat: true
        running: true
        onTriggered: saveProjects()
    }

-- 
Michael Spencer | sonrisesoftware.wordpress.com

Trust in the Lord with all thine heart; and lean not unto thine own
understanding. In all thy ways acknowledge him, and he shall direct thy
paths.
- Proverbs 3:5-6

Follow ups

References