Chrome Apps Mobile - fileSystem cannot create file to save

32 views
Skip to first unread message

Ofer Kulka

unread,
Aug 6, 2015, 5:49:52 AM8/6/15
to Chromium Apps
Dear community

I've been developing an app using Chrome Apps API and have observed a difference in the behaviour of the app on the desktop and on my android phone. One of the main features in the app is to allow the user to save the information retrieved to a local physical file. On the desktop that works fine but on my android (Nexus 5, Android 4.4 and 5.1.1 ) when I click the save button the 'file manager' opens but there is no option of creating a new file . However, if the phone directory has a txt file for instance, I can save the information to that file no problem. I can't understand why the behaviour on the mobile is so different. Is this the expected behaviour or am I missing  something? Manifest.json file below: permissions

{
  "name": "Coord",
  "description": "Coordinate",
  "version": "0.1",
  "manifest_version": 2,
  "permissions": ["geolocation", "storage", "unlimitedStorage", "syncFileSystem", {"fileSystem": ["write"]}
          ],
  "app": {
    "background": {
      "scripts": ["background.js"]
        }
      },
  "sockets": {
        "tcp": {
            "connect": "localhost:80"
        },
        "udp": {
             "send": "localhost:80"
        }
      },
  "icons": {
    "16": "assets/icons/Server-16.png",
    "128": "assets/icons/Server-128.png"
    },

  "minimum_chrome_version":"28"

}

Any ideas why this is happening

Thanks

Ofer

iSh0w

unread,
Aug 6, 2015, 7:54:07 AM8/6/15
to Chromium Apps
I believe this is normal behavior for android, have not heard of or used any application that creates a file, writing into an existing file may not be the best way(know you don't want that anyway), what might be worth looking into is creating a google doc file within google drive and saving the data in the google doc. Not only would that make the data accessible on the cloud but also work cross-platform. 

/iSh0w 

Ofer Kulka

unread,
Aug 6, 2015, 10:00:24 AM8/6/15
to Chromium Apps
Thanks for your answer.
I see what you mean but I am in a bit of a jam. The purpose of this app was to enable the user to save gps cords when a network/wifi connection is not available and 
have it for them to use later. Thus, the google drive solution will not suffice. I hope there is a way to work around this
Is it possible to have a file be created automatically upon installation of the app? 

Ofer
בתאריך יום חמישי, 6 באוגוסט 2015 בשעה 13:54:07 UTC+2, מאת iSh0w:

iSh0w .

unread,
Aug 6, 2015, 10:14:01 AM8/6/15
to Ofer Kulka, Chromium Apps
Sorry I cannot be of more help, it would be possible but there would be so many variations, if the user installs the app on the internal storage or external storage, how to access that text file later. Suggest to copy it to clipboard and let the user know so they can paste/save it in any note taking app like google keep or even maybe compose an email (not send because no internet, just compose) as a draft.
Writing it to a file would also require the native or an app like ES FIle Explorer increasing the dependencies of your app. 

/iSh0w

--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Paul Canning

unread,
Aug 6, 2015, 5:06:24 PM8/6/15
to Chromium Apps
Why not have the app create the file itself? Surely you don't need the user to create the file to write to?

Ofer Kulka

unread,
Aug 11, 2015, 5:55:30 AM8/11/15
to Chromium Apps
I have not thought about that as I only explored the APIs Chrome Apps provide and thought they would be sufficient.
I thought having the user create the file through a file manager would make it easier for them to find the file ..that was the benefit.
I guess I can try that.
I will update you if that works, honestly not sure how to go about it

בתאריך יום חמישי, 6 באוגוסט 2015 בשעה 23:06:24 UTC+2, מאת Paul Canning:

Ofer Kulka

unread,
Aug 27, 2015, 5:30:33 AM8/27/15
to Chromium Apps


בתאריך יום שישי, 7 באוגוסט 2015 בשעה 00:06:24 UTC+3, מאת Paul Canning:
Why not have the app create the file itself? Surely you don't need the user to create the file to write to?

How would I go about doing that? It would help if you could refer me to how to go about doing that

Another option would be to connect to the e-mail client on the phone or paste the information to text app on the mobile, is that something that is possible using Chrome Apps or is not because of the sandbox framework
Basically I am trying to find a way of using the information gathered by the app (gps coordinates) and sending that information through e-mail, to a database etc

Thanks in advance
Ofer

Pablo

unread,
Aug 27, 2015, 7:58:39 AM8/27/15
to Ofer Kulka, Chromium Apps

Use the file system API to create a new file and write your data to it? Have you tried searching for how to write a file in javascript?


--
You received this message because you are subscribed to a topic in the Google Groups "Chromium Apps" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-apps/2StIUQNRMmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-app...@chromium.org.

Ofer Kulka

unread,
Sep 25, 2015, 4:00:30 AM9/25/15
to Chromium Apps, kulka...@gmail.com
Everything I try on the chrome extension environment works completely different on mobile (after pushing that app to mobile).
I've gone ahead with using chrome.SyncFileSystem API to create the text file and sync the data to it with Google Drive but the API does not seem to work on mobile.
I get a message when pushing the app that the permission SyncFileSystem is not recognised and is ignored.
Reply all
Reply to author
Forward
0 new messages