I have to design an android application using android studio sdk version 3.1.4 and developing on API 15: Android 4.0.3 (IceCreamSandwich) that is capable to receive csv data from arduino using HM 10 BLE module similar to BLE terminal app on playstore. BLE terminal App is used for scanning nearby BLE device and also use for serial communication. Control any Micro-controller that uses any BLE Module (based on Texas Instruments CC254x) through your smart phone. This app can send and receive commands via BLE so you can debug your hardware problems easily. Monitoring receiving data as ASCII or HEX. Sending Data as ASCII or HEX. At present I have imported BluetoothLEGATT sample code on android studio and installed the app, in which I am getting data but the data is not coming in stream I want it to be displayed on stream. I want to receive it on csv format. The data should come in stream format. At arduino side I am sending in csv format.

<?xml version="1.0" encoding="UTF-8"?>

<!--Copyright 2013 The Android Open Source ProjectLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. -->

-<manifest android:versionName="1.0" android:versionCode="1" package="com.example.android.bluetoothlegatt" xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->


<!-- Declare this required feature if you want to make the app available to BLE-capabledevices only. If you want to make your app available to devices that don't support BLE,you should omit this in the manifest. Instead, determine BLE capability by usingPackageManager.hasSystemFeature(FEATURE_BLUETOOTH_LE) -->


<uses-feature android:required="true" android:name="android.hardware.bluetooth_le"/>

<uses-permission android:name="android.permission.BLUETOOTH"/>

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>


-<application android:theme="@android:style/Theme.Holo.Light" android:icon="@drawable/ic_launcher" android:label="@string/app_name">


-<activity android:name=".DeviceScanActivity" android:label="@string/app_name">


-<intent-filter>

<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>

</intent-filter>

</activity>

<activity android:name=".DeviceControlActivity"/>

<service android:name=".BluetoothLeService" android:enabled="true"/>

</application>

</manifest>
1

There are 1 answers

7
Mahendra Gunawardena On

Bluetooth Low Energy (BLE) was introduced to Android with 4.3 release. So one of your problems might be API 15: Android 4.0.3 (IceCreamSandwich). Try changing the minimum API to 18. Until API level 21, Lollipop android used the BlueZ software stack. Although BlueZ worked it still had some stability issues with BLE on Android 4.3 particularly scanning in maintaining connectivity. With Android API 21 release Bluedroid software stack was used which was more stable and had improved API's for BLE.