- Sharing Content between Android apps
- Sharing text
- Sharing HTML text
- Receiving text
- Sharing files and images
- Receiving files
- The Support Library is your friend
- 5 best Android apps to transfer files from Android to PC and other ways too!
- AirDroid and Pushbullet
- Cloud Storage
- Feem v4
- Resilio Sync
- Xender
- Non-app ways to transfer files
- 8 essential Android to iOS file-transfer tips
- Here are eight ways Android and iPhone/iOS users can share files with each other, including online and off-line services, apps, and storage products.
- 1. Use email
- 2. Use an app to share locally
- SHAREit
- Feem
- Instashare
- FileTransfer
- Zapya
- 3. Use an app to share semi-locally
- 4. Use an online storage service
- 5. Use an online file-transfer service
- 6. Use a wireless storage solution
- 7. Use a Mac
- 8. Use a personal private cloud
Sharing Content between Android apps
Sharing is caring, as they say, but sharing on Android means something perhaps slightly different. ‘Sharing’ is really shorthand for sending content such as text, formatted text, files, or images between apps.
So if ‘sharing’ == sending content, it makes slightly more sense that it is implemented using ACTION_SEND (or ACTION_SEND_MULTIPLE) Intents and its dozen extras.
While that approach is perfectly valid, I prefer to use ShareCompat, a set of classes in the v4 Support Library designed to make it easy to build intents for sharing content.
Sharing text
Sharing plain text is, as you might imagine, a good place to start. In fact, there’s not a whole lot to it:
ShareCompat.IntentBuilder uses a fluent API where you can chain together multiple method calls, using only the ones you need. For sharing, one of the most important parts is picking the right mime type — this is how apps filter what type of content they can receive. By using text/plain, we signify that our Intent will only contain plain text. Then, of course, setText() is how we actually add the CharSequence to the Intent to send. And while you can certainly send styled text using setText(), there’s no guarantee that the receiving app will honor that styling, so you should ensure that the text is legible with or without styling.
You’ll note we then use resolveActivity() before calling startActivity(). As mentioned in Protecting Implicit Intents with Runtime Checks, this is critical to prevent an ActivityNotFoundException when there is no Activity available to handle the mime type you have selected. While probably not as much of a concern with text/plain, it may be much more common with other types.
Note: when you use startActivity(shareIntent), that respects any default apps the user has set (i.e., if they’ve previously selected sharing all “text/plain” items to a certain app). If you’d like to instead always show a disambiguation chooser, use the intent generated from IntentBuilder.createChooserIntent() as explained in the ACTION_CHOOSER documentation.
Sharing HTML text
Some apps, most notably email clients, also support formatting with HTML. The changes, compared to plain text, are fairly minor:
The differences here are that we use of setHtmlText() in place of setText() and a mime type of text/html replacing text/plain. Here ShareCompat actually does a little bit extra: setHtmlText() also uses Html.fromHtml() to create a fallback formatted text to pass along to the receiving app if you haven’t previously called setText() yourself.
Given that many of the apps that can receive HTML text are email clients, there’s a number of helper methods to set the subject, to:, cc:, and bcc: email addresses as well — consider adding at least a subject to any share intent for best compatibility with email apps.
Of course, you’ll still want to call resolveActivity() just as before — nothing changes there.
Receiving text
While the focus so far has been on the sending side, it is helpful to know exactly what is happening on the other side (if not just to build a simple receiving app to install on your emulator for testing purposes). Receiving Activities add an intent filter to the Activity:
The action is obviously the more critical part — without that there’s nothing that would denote this as an ACTION_SEND (the action behind sharing). The mime type, same as with our sending code, is also present here. What isn’t as obvious are the two categories. From the element documentation:
Note: In order to receive implicit intents, you must include the CATEGORY_DEFAULT category in the intent filter. The methods startActivity() and startActivityForResult() treat all intents as if they declared the CATEGORY_DEFAULT category. If you do not declare it in your intent filter, no implicit intents will resolve to your activity.
So CATEGORY_DEFAULT is required for our use case. Then, CATEGORY_BROWSABLE allows web pages to natively share into apps without any extra effort required on the receiving side.
And to actually extract the information from the Intent, the useful ShareCompat.IntentReader can be used:
Similar to IntentBuilder, IntentReader is just a simple wrapper that make it easy to extract information.
Sharing files and images
While sending and receiving text is straightforward enough (create text, include it in Intent), sending files (and particularly images — the most common type by far) has an additional wrinkle: file permissions.
The simplest code you might try might look like
And that almost works — the tricky part is in getting a Uri to the File that other apps can actually read, particularly when it comes to Android 6.0 Marshmallow devices and runtime permissions (which include the now dangerous READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions).
My plea: don’t use Uri.fromFile(). It forces receiving apps to have the READ_EXTERNAL_STORAGE permission, won’t work at all if you are trying to share across users, and prior to KitKat, would require your app to have WRITE_EXTERNAL_STORAGE. And really important share targets, like Gmail, won’t have the READ_EXTERNAL_STORAGE permission — so it’ll just fail.
Instead, you can use URI permissions to grant other apps access to specific Uris. While URI permissions don’t work on file:// URIs as is generated by Uri.fromFile(), they do work on Uris associated with Content Providers. Rather than implement your own just for this, you can and should use FileProvider as explained in the File Sharing Training.
Once you have it set up, our code becomes:
Using FileProvider.getUriForFile(), you’ll get a Uri actually suitable for sending to another app — they’ll be able to read it without any storage permissions — instead, you are specifically granting them read permission with FLAG_GRANT_READ_URI_PERMISSION.
Note: we don’t call setType() anywhere when building our ShareCompat (even though in the video I did set it). As explained in the setDataAndType() Javadoc, the type is automatically inferred from the data URI using getContentResolver().getType(uriToImage). Since FileProvider returns the correct mime type automatically, we don’t need to manually specify a mime type at all.
If you’re interested in learning more about avoiding the storage permission, consider watching my Forget the Storage Permission talk or at least go through the slides, which covers this topic in depth at 14:55 (slide 11).
Receiving files
Receiving files isn’t too different from text because you’re still going to use ShareCompat.IntentReader. For example, to make a Bitmap out of an incoming file, it would look like:
Of course, you’re free to do whatever you want with the InputStream — watch out for images that are so large you hit an OutOfMemoryException. All of the things you know about loading Bitmaps still apply.
The Support Library is your friend
With both ShareCompat (and its IntentBuilder and IntentReader) and FileProvider in the v4 Support Library, you’ll be able to include sharing text, HTML text, and files in your app with the best practices by default.
Источник
5 best Android apps to transfer files from Android to PC and other ways too!
We’d also like to give an honorable mention to Syncthing-Fork (Google Play link). It’s a bit more power-user friendly than regular user friendly, but it worked perfectly in our testing.
Read more:
AirDroid and Pushbullet
Price: Free / $1.99 per month / $19.99 per year / $38.99 per two years
AirDroid is one of the more popular apps to transfer files from Android to PC. It can do other stuff too. The features include sending and receiving SMS/MMS from your PC, see your device notifications, and much more. It can even find a lost phone, control the camera, and use apps. You’ll also be able to transfer files to your computer from your phone. You get the basic stuff for free. You’ll have to subscribe to the service to get everything. Pushbullet works very much the same way in terms of transferring files to PC from your Android device, even if it costs a little more. You can go with either of these options. They are the two most popular options.
Cloud Storage
Price: Free / Varies by app
Cloud Storage is an excellent method to transfer files from Android to PC and back again. There are a variety of services to choose from, including Dropbox, Google Drive, OneDrive, Box.com, and others. Transferring files is easy enough. You upload the file to cloud storage on one device. You then download it on another device. Most cloud storage apps have their own dedicated apps and it makes the process easier. We have our best cloud storage apps list linked up toward the top of this article.
Feem v4
Price: Free
Feem is a simple app that does one thing very right. It transfers things from devices connected to the same WiFi network. That includes mobile phones, tablets, computers, laptops, or whatever else. Each device simply downloads Feem and runs it. From there, you can transfer whatever you want to and from those devices. The WiFi doesn’t need to be connected to the actual internet. A local network is all you really need. It’s simple, effective, cheap, and the Material Design looks nice. ShareIt is another app in this same style that does well.
Resilio Sync
Price: Free / Up to $75
Resilio Sync (formerly BitTorrent Sync) is kind of a wildcard. It works a lot like cloud storage. However, the cloud storage server is your own desktop or laptop. You can sync as much data as you’d like, transfer files back and forth at will, and a lot more. It should support Mac, Linux, and Windows as well. It’s definitely among the more secure options. Your stuff is never on a cloud server. It’s just your phone and your device talking to each other. The app is free for limited use and you can unlock all the features for a single, albiet somewhat expensive payment if you want to. This can easily replace cloud storage entirely if you want it to.
Xender
Price: Free
Xender is one of the most popular apps in this space. It lets you connect your phone to another device and transfer over WiFi. It works with other Android or iOS phones, Macs, PCs, and even Tizen. The app does its job as intended most of the time and it worked okay in our testing. However, this is one of those apps that either works perfectly or it doesn’t work at all. It also has a few other features, like the ability to convert video to audio and you can apparently use it to download Facebook, Whatsapp, and Instagram videos. Another strong (albeit less popular) competitor here is Feem (Play Store link).
See more app lists:
Non-app ways to transfer files
- Use Bluetooth – If your laptop has a Bluetooth module or if you have a Bluetooth dongle for your desktop or laptop, you can pair your device with your computer using Bluetooth and send files that way. The transfer rates are very slow so only use this method for smaller files.
- USB On-The-Go – USB OTG cables allow you to connect your device to USB devices such as external hard drives or flash drives. You use the cable to transfer documents to your flash drive or external hard drive or vice versa. They are relatively inexpensive.
- Share to email – This only works with small files like photos or documents, but you can send most types of files over email. Most emails have a limit of around 25MB for attachments.
- Share to chat – This works for a number of file types, especially if you use something like Discord, Slack, or Skype. You send yourself the file in a chat on one device and retrieve it on another. This should work for smaller files like photos, documents, or similar things. Skype and Slack have support for things like PDF files, archived (zipped) files, and other document types as well.
- Use your data/charging cable – This one is fairly obvious. Just plug your phone into your computer using the USB cable that comes with your charger. This is the most common and reliable method of transferring files to PC from Android devices.
- Your micro SD card – Devices with micro SD card support can transfer files much like flash drives. You use a file manager app to move the files to the SD card, pop it out of your phone (after turning it off, of course), and then use an adapter to put it into your card reader on your laptop or a different adapter to connect it to your computer’s USB drive.
- Android’s Nearby Share feature – Android’s Nearby Share utility works a lot like Apple AirDrop, but for Android. You can quickly share small or large files with devices right next to you. This only works from one Android device to another Android device, but it’s still a method to move files around.
Thank you for reading! Try these out too:
If we missed any of the best methods or apps to transfer files from Android to PC, tell us about them in the comments! You can also click here to check out our latest Android app and game lists!
Источник
8 essential Android to iOS file-transfer tips
Here are eight ways Android and iPhone/iOS users can share files with each other, including online and off-line services, apps, and storage products.
When it comes to using the Android or iOS platform, everybody seems to have chosen sides — but living in a multi-platform world means we need to share files occasionally. Here are eight ways Android and iPhone/iOS users can share files with each other.
1. Use email
Sending files using email remains the easiest way to share items with others; however, this isn’t always the most effective choice if:
- You don’t know a person’s email address
- You can’t get online
- You are sharing very large files
- You are sharing sensitive data, such as client records.
Fortunately, there are lots of other ways to share data between the two platforms.
2. Use an app to share locally
There are numerous cross-platform apps you can use to share files between iOS and Android devices. Here are some apps to try:
SHAREit
SHAREit lets you share files offline between Android and iOS devices, so long as both devices are on the same Wi-Fi network. Open the app, select the item you wish to share, and look for the device you want to send a file to, which must have receive mode switched on in the app. This useful solution is also available for Mac and Windows.
Feem
Feem creates a local Wi-Fi network. Both the iPhone and Android device must install and run Feem for it to work, as well as create a user name. To share files, you must manually write the other person’s user name and you can begin to share files between the platforms. It supports Mac, iOS, Android, Windows, and Linux.
Instashare
Instashare: Another solution that works over a local Wi-Fi network, Instashare apps are available for both iOS and Android. The way it works will seem familiar to most iOS users, as it’s very like AirDrop. It is also available for Mac and Windows.
FileTransfer
From Delite Studio, File Transfer for iOS ($1.99) and File Transfer for Android: These two apps work together to share. You don’t need to do anything to set the systems up, and the user interface is very simple to use, though a local Wi-Fi network is once again used to share files. Mac and Windows are also supported.
Zapya
Another good app that lets you share files over a local Wi-Fi hotspot between Android, iOS and other platforms, Zapya is also laden with other handy features such as QR code sharing, a feature that lets you use a remote camera to take images and more.
3. Use an app to share semi-locally
ShareDrop lets you share files between platforms through an AirDrop-like user interface. It is a little compromised in that while file transfers take place locally, they do require an internet connection to work. That’s because you need to access the service website and select the avatar of the person you wish to share files with. After that, the app kicks in on your device. Your data is never actively uploaded to the web unless you wish to use the service to share with a device that is not on your local Wi-Fi network.
Send Anywhere is a flexible, simple, and free service that lets you share items using a link by uploading and downloading them, as well as locally between two devices in an AirDrop-like manner, using a 6-digit code to secure the exchange.
4. Use an online storage service
Apple has made iCloud Drive a more effective file-sharing service, but for an easier life when working cross-platform, you will probably choose to use Dropbox, Box, OneDrive, or Google Drive. (Others may include Egnyte and SugarSync.) Once you create an account, each service lets you upload files to your file storage service and you can then share those items with others and other platforms by sending a link to that item.
5. Use an online file-transfer service
If you don’t mind uploading your data to services you have little control of, there are many online services that let you share files with others. These let you upload items temporarily to their service (encrypted during the transfer), and when they finally are uploaded, the person you wish to share the item with receives a link to download it. Some of the ones I use most include Mailbigfile, WeTransfer, TransferNow, and WeSendit. In most cases, these services will allow you to send/share a file up to 2GB-4GB in size. Links created will be kept available only for limited time.
6. Use a wireless storage solution
I like the SanDisk Connect USB stick (capacity up to 256G). It’s like any other USB memory stick, but includes a built-in Wi-Fi receiver that works with an app on your iPhone or Android device to transfer files. See it as a kind of middle manager for file transfers — upload to the stick from one platform and download content from the device on another platform. It’s quite good for groups, as it can share items with multiple devices simultaneously. You can also use it to automatically back up things such as photos and videos. If you have your own NAS system, you may also want to use that, though some Android users may also need to use software such as qnap to access the volume.
7. Use a Mac
The least elegant and most cumbersome way to share data, Android File Transfer and a Mac to swap files between iOS (iCloud Drive/iTunes) and an Android device. When installed, Android File Transfer lets you take a look at the files on a connected Android device. You can then add and extract those files to your iOS device using drag & drop and iCloud. Another option is to use Handshaker, which has a nicer user interface.
8. Use a personal private cloud
You can purchase off-the-shelf solutions that will back up your Mac and allow you to share files with others online, without using a third-party service at all. Mac users will want to take a look at the PROMISE Apollo Personal Cloud Storage device. You plug this into your home router, and the system then lets you store files locally on the device and will also let up to 40 people access those files over the internet (using apps for Android and iOS). You can also create time-limited links to share with others, so they can download files compatible with Apple’s Files app. The system also auto-syncs from Dropbox and Google Drive.
Do you have any more useful tips to help people share files between iPhones, iPads and Android devices? Please let us know and I’ll introduce your information in the next update to this story.
Google+? If you use social media and happen to be a Google+ user, why not join AppleHolic’s Kool Aid Corner community and get involved with the conversation as we pursue the spirit of the New Model Apple?
Got a story? Please drop me a line via Twitter and let me know. I’d like it if you chose to follow me there so I can let you know about new articles I publish and reports I find.
Jonny is a freelance writer who has been writing (mainly about Apple and technology) since 1999.
Источник