Bluetooth scanning with app - java

I am making an app and was wondering does my app need to scan for Bluetooth devices? Because the phone itself already scans for devices.
Do I need to setup a scanner in my app to be able to use Bluetooth efficiently?
Or can i utilize the "scanner" from my phone?

The short answer is no, you do not need to write your own. Android has it's own discovery functionality built into the BluetoothAdapter class that you can utilize.
Check out this tutorial: http://code.tutsplus.com/tutorials/create-a-bluetooth-scanner-with-androids-bluetooth-api--cms-24084

Related

Android Studio - Multiple Bluetooth Connection

I'm making a project where I need to connect via my Android Studio App two devices and continously send and recieve information.
How can I make this in terms of code in the Android Studio Java language?
Thanks
You can find this library useful. Here is a tutorial on how to use it.

WP10 Detected Bluetooth device functions

As all users of Windows Phone 10 know, the Bluetooth connectivity on this system is cutted to the simplest for end-user, which ends for programmers as a horror to create anything. When connecting to a device, system automatically looks for a "functions" that device has, for ex. audio. The questions are as following:1. How to define a function like that on external Android device? The main goal is, to control all types of music playback from it (ex. Groove music playing)2. Where can i find a list of things like this, for future app functions?
And to get ahead of answers, I already tried the easier ways, which came to nothing due to UWP limits of controlling other apps playback.
Main target of project is to make a xamarin c# (or java, I can "translate" from one to another with ease) android app for a smartwatch and in c# uwp for windows phone to do most common tasks, like - as mentioned before - music playback control and notifications reciever.
Based on your description, you want to develop an Android app to send Bluetooth command to control the music player of a windows phone device, then it depends on your Bluetooth of your android device.
But control music player by Bluetooth need the profile Avrcp I have check the google Bluetooth API I did not find the profile of Avrcp, I think it is may be hard to send the Avrcp command at the android application level.
And Android is source opened, many device factories prefer to customize their own Android system, it is possible that the device uses a Bluetooth module as a serial device, then the official Bluetooth APIs are not suitable for this scenario, the develop protocol of this Bluetooth module is in need.

Can you access the SMS messages on an Android phone from an app?

I am working on an app that scans your messages and presents interesting statistics about your contacts. Right now I have it running on my laptop scanning an iPhone SMS database. I want to create an app that will allow people to scan their own messages from their phone. I know this is not possible on iPhone so I am focussing on Android. Here are the kinds of stats we are calculating:
http://cl.ly/460S3y3Q3F200o1W2X0Y
I have read this answer:
How can I read SMS messages from the device programmatically in Android?
But just wanted to double-check that it is still possible to access the messages on Android phones from within an Android app.
Is that possible?
Thanks!
There is no publicly available API on Android SDK that allows you to read the user's SMS messages from within an app.
As you've found, there are ways in which you can obtain the information using unofficial / undocumented calls. Google themselves do not recommend you do this, because it's not guaranteed to work across all phones, or all versions of Android.
So to answer your question: yes, it's technically possible, but probably ill-advised if you're looking to publish your app and have it work successfully across all devices.

Is it possible to set pin programmatically for bluetooth pairing?

I have an application (however I'm testing using the sample bluetooth chat from the SDK) where two android devices connects each other, and exchange data.
I already have part of the pairing process hardcoded using the BT address, problem is: the dialog it appears to confirm the pin. Is there a way to make that work programmatically? The only thing that "appeared" to solve my problem was in this question, but that API is completely abandoned, has no documentation and many issues.
As fair as I know the problem is that if the device is not the device database with paired devices, without root access the standard API is always going to prompt the user, but I'm still wondering if there's a way.
Bluetooth autopairing is defined only for some devices. To change this you should rewrite Android framework. So, from the application, it seems to me, this is impossible to do.

How to check existing of application on device?

I have just made application which requires BarCode scanner on device. How can I programatically check existing of this application into device? I know package name for BC scanner.
It is all documented on the zxing website.
http://code.google.com/p/zxing/wiki/ScanningViaIntent
I would suggest instead adding the scan functionality within your app, your app should never depend on other Apps to work.

Categories