Android App : Sending files to the server using the app - android

I intend to build a simple app to send files from a mobile phone to a remote server.
File size can vary from 500kb to 10 MB.
Is there any service available from Amazon or Google or any other company that will help with the server end side. I did some research about Google Cloud messenger, Pushbullet but they support only short messages.

Best way is to upload files from Android (or iOS with similar APIs) to respective cloud storage directly (not streaming through your server process, but direct to the storage)
Google Cloud Storage Java Client Library to upload to Google-Cloud-Storage by using
GscService.createOrReplace(GcsFilename, GcsFileOptions)
Amazon S3 Android TransferManager to upload to Amazon-S3 by using
TransferManager.upload(bucketNmae, fileName, file)
Both these services are meant for uploading files from a android app to respective cloud directly, without any server code. Then you can do either of
Make the file available to download with a web URL (as CMS).
Use the file inside the cloud in your application (as File System).

Related

How to get the file's URL before uploading it to Google Cloud Storage

I want to upload files in the background without depending on Firebase RTDB updates. I would like to generate a file's URL independent of the Google Cloud Storage upload progress.
Is this possible? If so, what would be the better approach for Mobile clients (Android and iOS)?

Android - How to transfer file between server and client

i want to create client-server apps, where client using Android and Server using Web Apps.
the question is, How to transfer video file from Server to all client ?
at the server, we're doing upload video files and client receive update (files). i assume this, client can download using cloud help, but i dont know what technology can be used at this.
This looks like a use case for Google's Cloud Storage for Firebase:
https://firebase.google.com/products/storage/

IoT API for uploading images/videos and viewing them via smartphone app

I have setup a raspberry pi to capture images periodically. Currently I am syncing these images to my personal Google Drive account. This way I can watch the latest picture on my smartphone.
I am wondering if there is a ready-to-use web service (provided by some company) that allows me to upload images/videos and to see them using a ready-to-use app for my smartphone without using the more generic Google Drive app. Can you recommend a service? Thanks in advance.
Am not sure about any web services to upload images into google drive.I think,you may go with cron job to upload the images.
Writing a auto script and execute it continuously.
Refer here : https://cron-job.org/en/

How to transfer file from Linux to Android using Google Drive

ENVIRONMENT:
I have a system consisting of Android clients and Linux server. Files (jpeg images) are transferred from Android client to Linux server via Google drive OK.
The client uses Drive API to upload the file into the ServerUploads folder on Google Drive
Client informs the server of the file via GCM (Google Cloud Messaging)
ServiceAccount on Server reads the file via REST API
I have this transfer working well.
Later the server needs to send the file (jpeg) to other clients based on search criteria, location, the view area, etc. So I try to reverse the flow to transfer the jpeg file to clients.
Service Account on Linux server uploads the file to ClientDownload folder on Google Drive
The server notifies client(s) of the file via GCM
The client tries to download the file via Drive API but fails due to protection
The app and ServiceAccount are both associated with the application in the developer's console.
The email associated with the App and ServiceAccount are different domains. (This is not Google Apps for Work.)
PROBLEM:
Since the newer Android Drive API with Google Play Services only supports Drive.SCOPE_FILE the app does not have access to files created by Service Account on Linux.
Is it possible on the server using REST API to add/change ownership of the file so the client can read the file with Drive?SCOPE_FILE? My attempts on this path so far have failed. Trying to insert new ownership fails with a status saying it's not yet implemented. Updating permissions to provide the app with ownership reports insufficient permissions for this file. Trying to patch the permissions give similar failure message. However, I am new to this API and may be doing it wrong.
Is it possible to access the contents of the file using Android DownloadManager service? The best I have done with this path, trying multiple variations of links, is an HTML file which looks appropriate for browser parsing and display: not the contents of the jpeg file. Again, this is a new area for me and I may not be doing it right.
From my research, it appears I can do what I need to do by using the REST API on the Android client, but I really don't want to incur that overhead if there's another path.
At a high level, the documentation (as sparse as it is) implies what I want to do possible. Does anyone have experience with this data flow pattern? If so, what's the appropriate way for the client to read the file created by the Service Account on the Server?
Thanks in advance!
After a few more days of exploring various rabbit holes I was able to download the file using Android DownloadManger. The trick was composing the correct query parameters in the HTTP request URI:
https://drive.google.com/uc?export=download&id=[resourceId]
Also the google drive file resource security needs to be 'public' or 'anyone with link' for this to work.

Can a android app using dropbox sync API use the cache, filesystem, files of the locally installed dropbox official app?

I have integrated the dropbox sync api with my native android app. My question is regarding the offline usage of cache, filesystem and files from the official dropbox app.
Setup:-
Device is android phone
Official dropbox app is installed
API used is the sync API
Scenario 1
If my android device is in aeroplane mode and my app is also running in background as a service. A new file is added to the dropbox app. This new file cannot be synced to the dropbox server because there is no network connection. Although my service has registered DbxFileSystem.SyncStatusListener I do not get a callback. Is it because my app does not share the filesystem of the locally installed dropbox app and my app and the dropbox app are treated as two separate clients?
Scenario 2
A new file is uploaded to the dropbox server, and it is immediately downloaded on the locally installed dropbox app by marking it as favorite. Then I put the android device in aeroplane mode. Then I launch the app. On this newly added DbxFile I call the getReadStream(). I observe that the DbxFile is not cached and attempts to connect to the network. Does it mean that I cannot use the downloaded file present in the filesystem used by the official dropbox app installed locally?
If the answer is "No the cache, filesystem and files used by my app and the official dropbox app are different and we are two separate clients for the dropbox server" then what API should I be using to achieve the behavior I want?
No, there's no way to access the Dropbox app's file storage/cache.

Categories

Resources