{"id":56,"date":"2021-03-13T14:06:29","date_gmt":"2021-03-13T14:06:29","guid":{"rendered":"https:\/\/www.bleuio.com\/blog\/?p=56"},"modified":"2022-04-14T08:49:29","modified_gmt":"2022-04-14T08:49:29","slug":"create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio","status":"publish","type":"post","link":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/","title":{"rendered":"Create simple android app and transfer data between pc and mobile using JavaScript"},"content":{"rendered":"\n<p>This project will demonstrate how to easily create an android app and transfer data between PC and mobile phone.\u00a0<\/p>\n\n\n\n<p>At first, we will connect BleuIO dongle to our pc.\u00a0This dongle will help us connect our pc to mobile app and also the data transfer between them.<\/p>\n\n\n\n<p>We already created a simple android app for this project. All you need to clone this project and run the app on your mobile phone. You can make changes if you need to.\u00a0<\/p>\n\n\n\n<p><strong>Requirements<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.bleuio.com\/\" target=\"_blank\">BleuIO<\/a>&nbsp;connected to a pc with ionic framework installed.&nbsp;<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/ionicframework.com\/docs\/\" target=\"_blank\">Ionic framework<\/a>&nbsp;<\/li><li>Mobile phone.&nbsp;<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/developer.android.com\/studio\" target=\"_blank\">Android studio.<\/a>&nbsp;<\/li><\/ul>\n\n\n\n<p>We will set BleuIO dongle as peripheral, and our mobile app will connect to this dongle. Then we can start sending data back and forth.<\/p>\n\n\n\n<p>Connect your BleuIO dongle to the computer.<\/p>\n\n\n\n<p>Connect to dongle using comport and start advertising by AT+ADVSTART.<\/p>\n\n\n\n<p>Clone this&nbsp;git repo.<br><strong>git clone https:\/\/github.com\/smart-sensor-devices-ab\/bleuio_sps_example_mobileapp.git<\/strong><\/p>\n\n\n\n<p>go inside the folder and run\u00a0<strong>npm install<\/strong> on terminal<\/p>\n\n\n\n<p>The most important file of this script is <strong>Home.tsx<\/strong> , which is inside src\/pages folder. This script has the service UUID information to communicate with the dongle which is connected to our computer. <\/p>\n\n\n\n<p>It also helps the mobile app to connects to the computer and send messages using SPS.<\/p>\n\n\n\n<p>This file also works as front end of the mobile app and takes input from user to send message to computer or receive and display message on mobile screen.<\/p>\n\n\n\n<p>Here is the full code for Home.tsx<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import {\r\n  IonButton,\r\n  IonContent,\r\n  IonHeader,\r\n  IonInput,\r\n  IonPage,\r\n  IonTitle,\r\n  IonToolbar,\r\n} from \"@ionic\/react\";\r\nimport {\r\n  BluetoothLE,\r\n  DescriptorParams,\r\n  WriteCharacteristicParams,\r\n  CharacteristicParams,\r\n  OperationResult,\r\n} from \"@ionic-native\/bluetooth-le\";\r\nimport \".\/Home.css\";\r\nimport { AndroidPermissions } from \"@ionic-native\/android-permissions\";\r\nimport React, { useState } from \"react\";\r\nlet notiMsg: string;\r\n\/\/BleuIO dongle info\r\nconst DONGLE_SERVICE_UUID = \"0783B03E-8535-B5A0-7140-A304D2495CB7\";\r\nconst DONGLE_CHAR_TX_UUID = \"0783B03E-8535-B5A0-7140-A304D2495CB8\";\r\nconst DONGLE_CHAR_RX_UUID = \"0783B03E-8535-B5A0-7140-A304D2495CBA\";\r\nconst DONGLE_FLOW_CONTROL_UUID = \"0783B03E-8535-B5A0-7140-A304D2495CB9\";\r\nconst ccc_on = new Uint8Array(&#91;0x01]);\r\nlet devices: { address: string; name: string }&#91;] = &#91;];\r\nconst Home: React.FC = () => {\r\n  const &#91;deviceList, setDeviceList] = useState&lt;any>(&#91;]);\r\n  const &#91;dongleID, setDongleID] = useState&lt;string>();\r\n  const &#91;response, setResponse] = useState&lt;string>();\r\n  const &#91;text, setText] = useState&lt;string>();\r\n  const &#91;loading, setLoading] = useState&lt;string>();\r\n  const &#91;deviceConnectionStatus, setDeviceConnectionStatus] = useState&lt;string>(\r\n    \"Not Connected\"\r\n  );\r\n  \/\/Scan for BleuIO Dongle\r\n  const scanDongle = () => {\r\n    setLoading(\"Scanning...\");\r\n    BluetoothLE.initialize().subscribe((ble) => {\r\n      \/\/console.log(\"ble stastus\", ble.status); \/\/ logs 'enabled'\r\n    });\r\n    let scanParam = {\r\n      services: &#91;],\r\n      allowDuplicates: true,\r\n      scanMode: BluetoothLE.SCAN_MODE_LOW_LATENCY,\r\n      matchMode: BluetoothLE.MATCH_MODE_AGGRESSIVE,\r\n      matchNum: BluetoothLE.MATCH_NUM_MAX_ADVERTISEMENT,\r\n      callbackType: BluetoothLE.CALLBACK_TYPE_ALL_MATCHES,\r\n    };\r\n    AndroidPermissions.checkPermission(\r\n      AndroidPermissions.PERMISSION.ACCESS_FINE_LOCATION\r\n    ).then(\r\n      (result) => {\r\n        if (result.hasPermission) {\r\n          \/\/console.log(\"Has permission?\", result.hasPermission);\r\n          BluetoothLE.startScan(scanParam).subscribe((device) => {\r\n            devices.push({ address: device.address, name: device.name });\r\n            \/\/console.log(\"the devices\", JSON.stringify(devices));\r\n          });\r\n        } else {\r\n          AndroidPermissions.requestPermission(\r\n            AndroidPermissions.PERMISSION.ACCESS_FINE_LOCATION\r\n          );\r\n        }\r\n      },\r\n      (err) => console.log(\"Has permission?\", err)\r\n    );\r\n\r\n    setTimeout(() => {\r\n      BluetoothLE.stopScan().then(() => {\r\n        \/\/console.log(\"scan stopped\");\r\n        let bleuIOdev = devices.filter((d) => {\r\n          return d.name === \"BleuIO\";\r\n        });\r\n        \/\/console.log(\"the devices\", JSON.stringify(bleuIOdev));\r\n        setDeviceList(bleuIOdev);\r\n        setLoading(\"\");\r\n      });\r\n    }, 3000);\r\n  };\r\n\r\n  const connectToDongle = (e: string) => {\r\n    setDongleID(e);\r\n\r\n    BluetoothLE.connect({ address: e, autoConnect: false }).subscribe(\r\n      (peripheralData) => {\r\n        \/\/console.log(\"peripheral data\", JSON.stringify(peripheralData));\r\n        setDeviceConnectionStatus(peripheralData.status);\r\n        \/\/BLE services\r\n        BluetoothLE.discover({ address: e }).then(\r\n          (services) => {\r\n            \/\/console.log(\"Services: \" + JSON.stringify(services));\r\n          },\r\n          (error) => {\r\n            \/\/console.log(\"Service error: \" + JSON.stringify(error));\r\n            BluetoothLE.services({ address: e });\r\n          }\r\n        );\r\n      }\r\n    );\r\n  };\r\n\r\n  const sendMessage = () => {\r\n    if (deviceConnectionStatus === \"connected\") {\r\n      \/\/console.log(\"Going into settingNotification!\");\r\n      let notiService = setupNotification(dongleID!);\r\n      if (notiService !== false) {\r\n        notiService.subscribe(onNotificationSuccess, onNotificationFailure);\r\n        setTimeout(() => {\r\n          let wQwRmsg: WriteCharacteristicParams = {\r\n            address: dongleID!,\r\n            service: DONGLE_SERVICE_UUID,\r\n            characteristic: DONGLE_FLOW_CONTROL_UUID,\r\n            value: BluetoothLE.bytesToEncodedString(ccc_on),\r\n            type: \"noResponse\",\r\n          };\r\n          BluetoothLE.write(wQwRmsg);\r\n          writeBleData(text!, null);\r\n        }, 1500);\r\n      } else {\r\n        \/\/console.log(\"setting notification failed!\");\r\n      }\r\n    } \/\/end inotificatio set\r\n  };\r\n\r\n  function stringToBytes(string: string) {\r\n    var array = new Uint8Array(string.length);\r\n    for (var i = 0, l = string.length; i &lt; l; i++) {\r\n      array&#91;i] = string.charCodeAt(i);\r\n    }\r\n    return array.buffer;\r\n  }\r\n\r\n  async function writeBleData(cmd: string, value: string | null) {\r\n    \/\/let ourMsg: string = value ? cmd + value + \"    \" : cmd + \"    \";\r\n    let ourMsg: string = cmd;\r\n    let msgToSend = new Uint8Array(stringToBytes(ourMsg));\r\n    let writeParam: WriteCharacteristicParams = {\r\n      address: dongleID!,\r\n      service: DONGLE_SERVICE_UUID,\r\n      characteristic: DONGLE_CHAR_RX_UUID,\r\n      value: BluetoothLE.bytesToEncodedString(msgToSend),\r\n      type: \"noResponse\",\r\n    };\r\n    BluetoothLE.write(writeParam);\r\n    \/\/console.log(\"Send Write Request= \" + ourMsg);\r\n  }\r\n  function setupNotification(dongleID: string) {\r\n    let isServiceOK: any = false;\r\n    let isCharacOK: any = false;\r\n    let counter = 0;\r\n    let notiParams: DescriptorParams = {\r\n      address: dongleID,\r\n      service: DONGLE_SERVICE_UUID,\r\n      characteristic: DONGLE_CHAR_TX_UUID,\r\n    };\r\n\r\n    while (!isCharacOK &amp;&amp; !isServiceOK) {\r\n      counter++;\r\n      if (!isServiceOK) {\r\n        isServiceOK = setupBleServices(dongleID);\r\n      }\r\n      if (!isCharacOK) {\r\n        isCharacOK = setupCharacteristics(dongleID);\r\n      }\r\n      if (counter > 100) {\r\n        return false;\r\n      }\r\n    }\r\n\r\n    return BluetoothLE.subscribe(notiParams);\r\n  }\r\n\r\n  async function setupBleServices(dongleID: string) {\r\n    let success = false;\r\n    await BluetoothLE.services({ address: dongleID! }).then(\r\n      (services) => {\r\n        \/\/console.log(\"Services: \" + JSON.stringify(services));\r\n        success = true;\r\n      },\r\n      (error) => {\r\n        \/\/console.log(\"Service error: \" + JSON.stringify(error));\r\n        success = false;\r\n      }\r\n    );\r\n\r\n    return success;\r\n  }\r\n\r\n  async function setupCharacteristics(dongleID: string) {\r\n    let success = false;\r\n    let charParam: CharacteristicParams = {\r\n      address: dongleID!,\r\n      service: DONGLE_SERVICE_UUID,\r\n    };\r\n\r\n    await BluetoothLE.characteristics(charParam).then(\r\n      (characteristics) => {\r\n        \/\/console.log(\"Services: \" + JSON.stringify(characteristics));\r\n        success = true;\r\n      },\r\n      (error) => {\r\n        \/\/console.log(\"Service error: \" + JSON.stringify(error));\r\n        success = false;\r\n      }\r\n    );\r\n\r\n    return success;\r\n  }\r\n\r\n  function onNotificationSuccess(buffer: OperationResult) {\r\n    if (buffer.status === \"subscribed\") {\r\n      \/\/isNotificationSet = true;\r\n      \/\/setIsNotificationSet((isNotificationSet) => (isNotificationSet = true));\r\n    }\r\n    if (buffer.value) {\r\n      var byteString = BluetoothLE.encodedStringToBytes(buffer.value);\r\n      notiMsg = BluetoothLE.bytesToString(byteString);\r\n      \/\/console.log(\"Value: \" + buffer.value);\r\n      \/\/console.log(\"Value parsed: \" + notiMsg);\r\n      \/\/console.log(\"Notification msg: \" + notiMsg);\r\n      setResponse(notiMsg);\r\n    }\r\n  }\r\n  function retrySubscribe() {\r\n    let notiParams: DescriptorParams = {\r\n      address: dongleID!,\r\n      service: DONGLE_SERVICE_UUID,\r\n      characteristic: DONGLE_CHAR_TX_UUID,\r\n    };\r\n    BluetoothLE.subscribe(notiParams).subscribe(\r\n      onNotificationSuccess,\r\n      onNotificationFailure\r\n    );\r\n  }\r\n\r\n  function onNotificationFailure(error: any) {\r\n    if (error.message !== \"Already subscribed\") {\r\n      \/\/isNotificationSet = false;\r\n      \/\/setIsNotificationSet((isNotificationSet) => (isNotificationSet = false));\r\n      \/\/console.log(\"Failed to get Notification: \" + JSON.stringify(error));\r\n      if (error.error !== \"neverConnected\") {\r\n        retrySubscribe();\r\n      }\r\n    }\r\n    if (error.message === \"Device isn't connected\") {\r\n      BluetoothLE.close({\r\n        address: dongleID!,\r\n      });\r\n    }\r\n    if (error.error === \"isDisconnected\") {\r\n      \/\/console.log(\"Disconnected...\");\r\n    }\r\n  }\r\n  return (\r\n    &lt;IonPage>\r\n      &lt;IonHeader>\r\n        &lt;IonToolbar>\r\n          &lt;IonTitle slot=\"start\">BleuIO SPS&lt;\/IonTitle>\r\n          &lt;IonTitle size=\"small\" slot=\"end\">\r\n            {deviceConnectionStatus}\r\n          &lt;\/IonTitle>\r\n        &lt;\/IonToolbar>\r\n      &lt;\/IonHeader>\r\n      &lt;IonContent className=\"container ion-padding\">\r\n        &lt;IonHeader collapse=\"condense\">\r\n          &lt;IonToolbar>\r\n            &lt;IonTitle slot=\"start\">BleuIO SPS&lt;\/IonTitle>\r\n            &lt;IonTitle size=\"small\" slot=\"end\">\r\n              {deviceConnectionStatus}\r\n            &lt;\/IonTitle>\r\n          &lt;\/IonToolbar>\r\n        &lt;\/IonHeader>\r\n        &lt;br \/>\r\n        &lt;br \/>\r\n        &lt;IonButton color=\"primary\" onClick={scanDongle}>\r\n          Scan for BleuIO devices\r\n        &lt;\/IonButton>\r\n        &lt;br \/>\r\n        {loading}\r\n        &lt;ul>\r\n          {deviceList &amp;&amp;\r\n            deviceList.length > 0 &amp;&amp;\r\n            deviceList.map((d: any) => (\r\n              &lt;IonButton\r\n                color=\"success\"\r\n                onClick={() => connectToDongle(d.address)}\r\n              >\r\n                Connect to {d.name} &lt;br \/> Address: {d.address}\r\n              &lt;\/IonButton>\r\n            ))}\r\n        &lt;\/ul>\r\n        &lt;br \/>\r\n        &lt;IonInput\r\n          value={text}\r\n          placeholder=\"Write message\"\r\n          onIonChange={(e) => setText(e.detail.value!)}\r\n        >&lt;\/IonInput>\r\n        &lt;IonButton\r\n          disabled={deviceConnectionStatus !== \"connected\" &amp;&amp; !text}\r\n          color=\"warning\"\r\n          onClick={sendMessage}\r\n        >\r\n          Write Message\r\n        &lt;\/IonButton>\r\n        {response &amp;&amp; (\r\n          &lt;>\r\n            Response : {response} &lt;br \/>\r\n          &lt;\/>\r\n        )}\r\n        &lt;br \/>\r\n        &lt;br \/>\r\n        &lt;br \/>\r\n        &lt;div\r\n          style={{\r\n            display: \"flex\",\r\n            justifyContent: \"center\",\r\n            alignItems: \"center\",\r\n          }}\r\n        >\r\n          Learn more about BleuIO https:\/\/www.bleuio.com\/\r\n        &lt;\/div>\r\n      &lt;\/IonContent>\r\n    &lt;\/IonPage>\r\n  );\r\n};\r\n\r\nexport default Home;<\/code><\/pre>\n\n\n\n<p>if you run\u00a0<strong>ionic serve<\/strong> on terminal, you will be able to see the layout on the browser. But for this app, we need mobile phones native feature because we need Bluetooth connection. Therefore <strong>connect your android phone to your computer<\/strong> and run\u00a0<strong>ionic cap run android<\/strong> on terminal.<\/p>\n\n\n\n<p>If you get an error regarding gradle, Type&nbsp;<strong>ionic capacitor update&nbsp;<\/strong>and run&nbsp;&nbsp;<strong>ionic cap run android&nbsp;<\/strong>again.<\/p>\n\n\n\n<p>Your app will install and open up on your mobile phone.<\/p>\n\n\n\n<p>Make sure the dongle is on peripheral mode and advertising.&nbsp;<\/p>\n\n\n\n<p><strong>Click scan for BleuIO devices<\/strong>.<\/p>\n\n\n\n<p>On the scan result, select one of your dongles to connect.<\/p>\n\n\n\n<p>After a successful connection, you can send data back and forth, and you will be able to see your messages on both the mobile app and the terminal.<\/p>\n\n\n\n<p>For better understanding, watch the video.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"BLE sps mobile app tutorial with BleuIO\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/9GwYnEmdCHI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This project will demonstrate how to easily create an android app and transfer data between PC and mobile phone.\u00a0 At first, we will connect BleuIO dongle to our pc.\u00a0This dongle will help us connect our pc to mobile app and also the data transfer between them. We already created a simple android app for this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":57,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bleuio","category-bleuio-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"og:description\" content=\"This project will demonstrate how to easily create an android app and transfer data between PC and mobile phone.\u00a0 At first, we will connect BleuIO dongle to our pc.\u00a0This dongle will help us connect our pc to mobile app and also the data transfer between them. We already created a simple android app for this [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/\" \/>\n<meta property=\"og:site_name\" content=\"BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-13T14:06:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-14T08:49:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"BleuIO\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/\"},\"author\":{\"name\":\"BleuIO\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"headline\":\"Create simple android app and transfer data between pc and mobile using JavaScript\",\"datePublished\":\"2021-03-13T14:06:29+00:00\",\"dateModified\":\"2022-04-14T08:49:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/\"},\"wordCount\":421,\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/ble-send-message-sps.jpg\",\"articleSection\":[\"BleuIO\",\"BleuIO tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/\",\"name\":\"Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/ble-send-message-sps.jpg\",\"datePublished\":\"2021-03-13T14:06:29+00:00\",\"dateModified\":\"2022-04-14T08:49:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/ble-send-message-sps.jpg\",\"contentUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/ble-send-message-sps.jpg\",\"width\":872,\"height\":512,\"caption\":\"Create simple mobile ble app\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create simple android app and transfer data between pc and mobile using JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\",\"name\":\"BleuIO - Create Bluetooth Low Energy application\",\"description\":\"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\",\"name\":\"BleuIO\",\"sameAs\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/author\\\/biadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/","og_locale":"en_US","og_type":"article","og_title":"Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application","og_description":"This project will demonstrate how to easily create an android app and transfer data between PC and mobile phone.\u00a0 At first, we will connect BleuIO dongle to our pc.\u00a0This dongle will help us connect our pc to mobile app and also the data transfer between them. We already created a simple android app for this [&hellip;]","og_url":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/","og_site_name":"BleuIO - Create Bluetooth Low Energy application","article_published_time":"2021-03-13T14:06:29+00:00","article_modified_time":"2022-04-14T08:49:29+00:00","og_image":[{"width":872,"height":512,"url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg","type":"image\/jpeg"}],"author":"BleuIO","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#article","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/"},"author":{"name":"BleuIO","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"headline":"Create simple android app and transfer data between pc and mobile using JavaScript","datePublished":"2021-03-13T14:06:29+00:00","dateModified":"2022-04-14T08:49:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/"},"wordCount":421,"image":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg","articleSection":["BleuIO","BleuIO tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/","url":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/","name":"Create simple android app and transfer data between pc and mobile using JavaScript - BleuIO - Create Bluetooth Low Energy application","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#primaryimage"},"image":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg","datePublished":"2021-03-13T14:06:29+00:00","dateModified":"2022-04-14T08:49:29+00:00","author":{"@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"breadcrumb":{"@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#primaryimage","url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg","contentUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/ble-send-message-sps.jpg","width":872,"height":512,"caption":"Create simple mobile ble app"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bleuio.com\/blog\/create-simple-mobile-app-and-transfer-data-between-pc-and-mobile-using-bleuio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bleuio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create simple android app and transfer data between pc and mobile using JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.bleuio.com\/blog\/#website","url":"https:\/\/www.bleuio.com\/blog\/","name":"BleuIO - Create Bluetooth Low Energy application","description":"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bleuio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80","name":"BleuIO","sameAs":["https:\/\/www.bleuio.com\/blog"],"url":"https:\/\/www.bleuio.com\/blog\/author\/biadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":4,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":255,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions\/255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}