Steps for Bluetooth File Transfer implementation for Android - android

With BluetoothChat sample from Google sources as the base, what are the steps in implementing a file transfer function using that base code? I am trying to send a pdf or an image file (jpeg, jpg, png) to the other devices.
The chat functionality already works and I'm trying to implement a file transfer.
I can get the Uri and real file path (using PickIt library, ex path: storage/0/emulated/etc/etc) of the file that the user picked from the ACTION_GET_DOCUMENT intent. For the image file, I have found sources. They first convert it to a bitmap then to bytes and vice versa on the receiving device but haven't tried to do that yet. As for the pdf file, how would I implement it? I'm confused and questions similar to mine are mostly 7-10 years ago. Any help is appreciated. TIA!
P.S. I'm still new to Android development and I'm using Java.

Related

displaying pdf in xamarin android

I am trying to create an app that will be able to display a pdf file in the app itself. I'm currently using the Xamarin.Bindings.PDFView-Android by SIDOVSKY which works really nicely. I can open a file easily from the assets... what I'm struggling to do is open a file from the internet.
Just a single line of code:
FindViewById<PDFView>(Resource.Id.pdf_view).FromAsset("report.pdf").Show();
Is enough to display a PDF that can be pinched to zoom which is great. However, I now want to access a file stored on the local network. Either using a SMB share, or through the intranet. Whichever way I try I can't figure it out.
There is a .FromFile setting, but I can't get it to work by putting a smb path in here. Is there a way to convert this? Or must I download the file to the local device first?
Thanks
Andrew

Sqlite File Upload in WebView Without filechooser

May be like Duplicate, but I cant find most suitable answer for me. Many examples have explain about img files. like this, Android Java Upload File via WebView without FileChooser I want to upload .db file into my web server from my android application using Webview. but I cant understand what I want to do. Is that possible (upload .db file)? And if yes, what I want to do? Im new for android.

phoneGap: select audio file from device and upload

I am new to phoneGap. I am creating a dummy app to upload an audio file from iOS/android device on local server. So I was wondering if there is a way to open the audio gallery and select the required audio file to upload. Similar to an image gallery.
Is it possible to open audio list and select necessary audio file? If not, what is the alternative?
As far as I remember, you cannot reach the pictures and audio files stored in the media gallery. Therefore, you may need to implement your own native plugin and call the appropriate methods from your JavaScript code.
You can capture audio/image by using Capture plugin of Phonegap. Check this out Capture Plugin
You can perform basic File operations as well. Check this out File Plugin
For your situation, you have to implement native interface which can be accessed by your JavaScript code. This would be an alternative way for it. If you desire to create your own plugin, please have a look at Plugin Development Guide. This might be helpful.
Well I have implemented code using file plugin which will iterate through all the folders recursively to find all the image (created this as I needed multi selection approach which is not directly provided by cordova) . You can modify the extension of image (search) i.e png,jpeg etc with audio extension.
With this code you will get the path of audio files and you can make use of filetransfer to upload it on server
Hope it helps you

Open a PDf file in android [duplicate]

This question already has an answer here:
Best way to include pdfs in an app
(1 answer)
Closed 9 years ago.
I am going to write an android app, which will contain a PDF file (included with in the application). My task is, when i click a button , pdf file should open . PDf file is placed in assets/raw (not sure where to place ).
Can any one help on this...
Thanks in advance
You can open pdf via webview and google docs.
You should use
WebView.loadUrl("http://docs.google.com/gview?embedded=true&url=www.site.com/file.pdf");
I would use a PDF Renderer to convert the file to a Bitmap. Otherwise, you would have to use another application to open the file, or the option that Walter gave you. Here is an example using a different library for rendering a PDF using Java.

Creating PDF File on Android [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to create pdf files on android
I have a program that asks the user for information, then I need to put this information on a document/contract. I think I would like to create a pdf file with that information using itext (other alternate ways would also be appreciated). Although, I found that the itext version is not built (at least the free version) for android. My only solution is to create a server, send this information to a server that creates the pdf and then sends the pdf back to my phone. I have no idea how to do this. Or if anyone knows how to make an itext version for android.
Welcome to stackoverflow. Search your problem well before reaching out.
If you want to do this on the server you can create a simple PHP script that generates the PDF for you.
Just Google for PHP generate PDF and it will give you a lot of links.
If you want to do the pdf generation on the device you can leverage a java library that does it for you. try this stackoverflow link create pdf files on Android

Categories

Resources