Ways to swap local files between mobiles - android

I have the next problem:
To my graduation work my teacher told me to implement a system that allows me to transfer any type of file from a phone (Android, IOS...) to another phone (Android, IOS...) using a server that keeps the files until the target phone downloads it.
Could anyone give me some advice about the best way to do it?
Thanks in advance.

You can use Firebase Storage, it has a free plan (so it's nice), and it gives you a nice API in Android and IOS, it allows you to upload and download files easily.
read more here: https://firebase.google.com/docs/storage/

Related

Firebase Storage downloads much too slow. Alternatives?

I have an android app which I want to keep light so I thought I'd store its many mp3 audio clips in Firebase Storage, and about a dozen of these (total size around 200kb) are downloaded the first time a user opens any new recyclerview list before they are playable. It works as intended, problem is the download is incredibly slow and the user waits 20-30s before they can play the files - not acceptable. I've seen other posts complaining of this download speed issue with FB Storage, and one of the few suggestions was to use FB Hosting instead as this is apparently faster. As a newbie I'm struggling with the documentation for this but it seems to be designed to use with web apps, and mine is a mobile app. The other suggestion I saw was to make the files publicly available in FB Storage. I don't particularly want to do this, but would consider it if was my best solution. Is it?
Can FB Hosting be used to store media files for mobile apps? Or should I use another cloud storage service such as Dropbox, whose free 1GB storage would be plenty for me? Could it handle heavy traffic / simultaneous downloads the way I guess FB is designed to? Or should I use a CDN? The app will, hopefully, have users spread globally. I want to use FB anyway for the other tools it provides, but where / how should I store my audio files so they will download quickly? Thanks for advice.
I had the same issue around 2 years ago, I've moved to Amazon Storage S3, which was much faster than Firebase Storage.
I made the files publicly available in FB Storage and now I have very fast downloads, so this seems to be the solution. Instructions are here making data public

How to put file from android app to pc in LAN network

I have a little problem with my android app. I'm developing an android app that should read .txt file from PC, and path is "E:/Sharing/hello.txt". I already shared that folder on PC. How can I get that file and read it on my android app. Is there any solution, or someone have example how to do that?
It can do in many ways here:
You need to write 2 app, one in android [as client], another on in desktop [as server]
this way, you need to connect your android to server app, and let server app handle all about find files and transfer to your android app
Easier way, you just need to use some Data's storage service, such as Google Drive, Dropbox, Microsoft OneDrive, etc.
to let them auto sync all your file and put it in their site, then, you just need to (install their app in your android or) download your file directly from their site.
Easiest way, from your desktop, just send file to your android's register email. after that just download it from Google Gmail
I suggested, 2 and 3 (even if it doesn't relate to programming) because it is easier than 1 alot, and many
people also accepted to used it in real-life

Create "virtual files" in android. Possible?

I want to add a functionality to my app to treat a user's uploaded images online as if they were files on their phone, so all their existing apps can find their images without needing to download them all. Basically tricking the phone into thinking its local instead of online. Any thoughts and how to go about this?

how can i keep a folder in my mobile storage and a folder in my dropbox space in Sync?

i have developed a android app for farmers. it is a informative app for indian farmer.The users will be sending me the images and video files to me through my app. here i used (integrated) dropbox to receive those files directly to my dropbox space. whatever the image or video taken by the user, it will be stored on a folder in my mobile storage. Here what i want is, i want the folder in my mobile storage to be in sync with the folder in my dropbox.
How can i do this?
there is a app in market called Foldersync which exactly fulfil my requirement. how they are doing it? How can i keep a folder in my mobile storage and a folder in my dropbox to be in Sync?
Note :
i have gone through drop-box api and created a simple app to send files directly to my dropbox space and i know how to download a entire folder from dropbox.
But here my question is unique from that... pls don't answer the above points which i already know..
Please help!
Thank You
You can use the Dropbox API to keep a local client in sync with Dropbox. There are two main pieces to this:
1) Metadata:
Assuming you're using the Core API, the best way to get information about all of the file and folders in an account (or optionally under a specific path) is to use /delta:
https://www.dropbox.com/developers/core/docs#delta
With this, you can get information about everything your app can see, and then easily stay up to date with changes. There are some useful blog posts on using /delta here:
https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/
https://blogs.dropbox.com/developers/2013/12/filtering-dropbox-delta-results-by-path/
2) File content:
Using the metadata retrieved from #1, you can download any files you need access to locally using /files (GET):
https://www.dropbox.com/developers/core/docs#files-GET
You can upload locally changed files using /files_put:
https://www.dropbox.com/developers/core/docs#files_put
Or, for larger files, use chunked uploading:
https://www.dropbox.com/developers/core/docs#chunked-upload
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
The main work here will involve programming the logic in your app to correctly receive changes from the server as well as upload local changes, in order to keep everything in sync.
Also, be aware that on mobile devices, bandwidth can be limited and/or expensive, so be careful to not accidentally automatically download a lot of data the user doesn't want or need.

Where can i store data(text and image) in android

i'm writing an application that needs to store some data,and picture. For example place's information. this information don't need to change very often. and
I have seen that databases are
stored under /data/data/package_name/databases
I decided to store my data under /data/data/package_name/files.
With the emulator i can see all these files (databases)
under the proposed directories but moving the application on a real
device and installing a file system browser i cannot see any file
under /data. i know that there are some security constrain in (not-rooted) device. However, are there any suggestion about the solution.. where can i store these data and how? because i'm quite new to android. Thanks so much for your help.
The reason you can't see it on the device is basically just as you said; the device isn't rooted, so other apps don't have access to the /data folder.
This is okay though, because you can still store your files there. Your app has access to anything under /data/data/package_name/, you just won't be able to see it in a file browser unless you root. This is normally a good thing, to keep average users from mucking around with your databases/files.
Read up more on storage methods here.

Categories

Resources