Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with sd-card API in Geeksphone Peak with Firefox OS 1.1

71 views
Skip to first unread message

Igor Leturia

unread,
Sep 13, 2013, 2:23:51 PM9/13/13
to
Hello,

I recently flashed my Geeksphone Peak with a Firefox OS 1.1 downloaded from they website, and an app I made that was working all right with Firefox OS 1.0 (it is in the marketplace, https://marketplace.firefox.com/app/hiking-guide) stopped working.

The problem is that the sd-card API does not find any files in the card... And other apps seem to be having the same problem: for example, EPUBReader (https://marketplace.firefox.com/app/epubreader) seems to be having the same problem (it does not find any files in the SD card, although there are some epubs there.

However, preinstalled apps (like Gallery, Videos...) find those files in the SD card all right. So could there be a problem with privileged apps that try to have access to the SD card? Maybe some change in the API? Or is there any known general issue regarding this? Or is it an issue of the Peak only?

Any help will be appreciated. Thansk in advance,

Igor Leturia

Marco Chen

unread,
Sep 13, 2013, 5:13:38 PM9/13/13
to Igor Leturia, dev...@lists.mozilla.org
Hi,

In V1.1, there are some changes on the DeviceStorage API and that is in order to support internal/external storage.
V1.1 introduced a new "navigator.getDeviceStorages(...)" which will return an array of device storages.
And old one "navigator.getDeviceStorage()" will return a preferred storage or the first storage in volume list.

I think your problem is related to this change.

Sincerely yours.
_______________________________________________
dev-b2g mailing list
dev...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Igor Leturia

unread,
Sep 13, 2013, 5:51:08 PM9/13/13
to
On Friday, September 13, 2013 11:13:38 PM UTC+2, Marco Chen wrote:
> Hi,
> In V1.1, there are some changes on the DeviceStorage API and that is in order to support internal/external storage.
> V1.1 introduced a new "navigator.getDeviceStorages(...)" which will return an array of device storages.
> And old one "navigator.getDeviceStorage()" will return a preferred storage or the first storage in volume list.
> I think your problem is related to this change.
> Sincerely yours.

Yes, seems very probable, thank you very much!

Now, my problem is how to make the app compatible with both 1.0 and 1.1. If I change the code to make it work in 1.1, it will no more work in 1.0. I guess this is a general problem and that there is a solution to it, isn't there?

Another problem I have is how to test an app for 1.1, as the simulator is still in 1.0, as far as I know. Or is there some way to make the simulator behave like 1.1?

Thanks in advance,

Igor Leturia

>
>
> ----- Original Message -----
>
> From: "Igor Leturia"
>

Julien Wajsberg

unread,
Sep 15, 2013, 5:00:22 PM9/15/13
to Igor Leturia, dev...@lists.mozilla.org
Le 13/09/2013 23:51, Igor Leturia a écrit :
> On Friday, September 13, 2013 11:13:38 PM UTC+2, Marco Chen wrote:
>> Hi,
>> In V1.1, there are some changes on the DeviceStorage API and that is in order to support internal/external storage.
>> V1.1 introduced a new "navigator.getDeviceStorages(...)" which will return an array of device storages.
>> And old one "navigator.getDeviceStorage()" will return a preferred storage or the first storage in volume list.
>> I think your problem is related to this change.
>> Sincerely yours.
> Yes, seems very probable, thank you very much!
>
> Now, my problem is how to make the app compatible with both 1.0 and 1.1. If I change the code to make it work in 1.1, it will no more work in 1.0. I guess this is a general problem and that there is a solution to it, isn't there?

Like on the web :)

if (navigator.getDeviceStorages) {
// new code
} else {
// old code
}

(of course you can make it less spaghetti but you get the point)

> Another problem I have is how to test an app for 1.1, as the simulator is still in 1.0, as far as I know. Or is there some way to make the simulator behave like 1.1?

maybe B2G Desktop could work for you :
http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/

This is what the simulator is based on.

Based on what's written on MDN [1] the Firefox OS simulator should be
able to connect to a separate instance of B2G Desktop. Maybe Alexandre,
Myk or Paul could help more.

[1]
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up#Enabling_debugging_on_the_Firefox_OS_Simulator

signature.asc

Igor Leturia

unread,
Sep 16, 2013, 3:23:29 AM9/16/13
to
On Sunday, September 15, 2013 11:00:22 PM UTC+2, Julien Wajsberg wrote:
> Le 13/09/2013 23:51, Igor Leturia a écrit :
> > On Friday, September 13, 2013 11:13:38 PM UTC+2, Marco Chen wrote:
> > > In V1.1, there are some changes on the DeviceStorage API and that is in order to support internal/external storage.
> > > V1.1 introduced a new "navigator.getDeviceStorages(...)" which will return an array of device storages.
> > > And old one "navigator.getDeviceStorage()" will return a preferred storage or the first storage in volume list.
> > > I think your problem is related to this change.
> > Yes, seems very probable, thank you very much!
> > Now, my problem is how to make the app compatible with both 1.0 and 1.1. If I change the code to make it work in 1.1, it will no more work in 1.0. I guess this is a general problem and that there is a solution to it, isn't there?
> Like on the web :)
> if (navigator.getDeviceStorages) {
> // new code
> } else {
> // old code
> }

Right, it was obvious, should have thought it over a bit before asking... Thank you anyway.

> > Another problem I have is how to test an app for 1.1, as the simulator is still in 1.0, as far as I know. Or is there some way to make the simulator behave like 1.1?
> maybe B2G Desktop could work for you :
> http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/
> This is what the simulator is based on.
> Based on what's written on MDN [1] the Firefox OS simulator should be
> able to connect to a separate instance of B2G Desktop. Maybe Alexandre,
> Myk or Paul could help more.

OK, I'll give it a try, thanks!

Best,

Igor Leturia

>
>
>
> [1]
>
> https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up#Enabling_debugging_on_the_Firefox_OS_Simulator

Igor Leturia

unread,
Feb 4, 2014, 2:57:05 AM2/4/14
to
I solved this. The problem was mine: after I installed Firefox OS 1.1, I did not enable the media storage in the settings; after doing that, everything worked fine both in both apps mentioned.

Igor Leturia
0 new messages