Can I try Web Bluetooth on Chrome for Android Lollipop? - android

The experimental Web Bluetooth API works quite well in the Dev version of Chrome for Android Marshmallow. I can simply enable the experimental flag at chrome://flags/#enable-web-bluetooth and I'm good to go.
Sadly the Web Bluetooth API doesn't work on my Android Lollipop device. Why?

UPDATE: As of April 17th, 2017, Web Bluetooth on Android now requires Android Marshmallow: http://crbug.com/694332
First of all, thanks for asking. You're not the only one for sure...
As mentioned in https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md#notes,
Tip of tree Chromium builds work on Android Lollipop or later for ease of developers
- but Chrome versions will only ever support Marshmallow or later.
So here's how to play with Web Bluetooth on Chrome for Android Lollipop:
Open the Android Settings app
Make sure "Developer Options" are unlocked and available - help
Select "Developer" and enable "USB Debugging"
Plug your Android device to your computer
Accept "USB Debugging" session on your Android Device
Download the latest Chromium build for Android at https://download-chromium.appspot.com/?platform=Android on your computer
Extract the downloaded chrome-android.zip file in your ~/Downloads folder for instance
Install ADB on your computer if it's not already there yet
Install Chromium by typing adb install -r ~/Downloads/chrome-android/apks/ChromePublic.apk in your shell
Open the new Chromium App on your Android device
Accept a Chromium Location prompt by going to https://www.google.com for instance - Location permission is needed to access Bluetooth in Chrome for Android Lollipop.
Finally enable the experimental flag at chrome://flags/#enable-web-bluetooth and/or request an Origin Trial token so that your website can use the Web Bluetooth API without any flag.
Play with some Web Bluetooth samples at https://googlechrome.github.io/samples/web-bluetooth/
Notes:
When using Web Bluetooth, make sure Android Bluetooth and Location in the drop down Quick Settings are turned on.
You may want to toggle Android Bluetooth off and on sometimes... Just saying ;)
Report bugs to the chromium team at https://bugs.chromium.org/p/chromium/issues/entry?components=Blink%3EBluetooth
Warning! The Chromium build for Android won't auto-update like Google Chrome. If you want a new build of Chromium to test new features, you'll have to re-download one and re-install it on your Android device.

Related

Is there a way in Ionic to debug directly on Android or iOS devices?

I'm working on an Ionic/Cordova cross-platform application and I'm struggling a little bit with the debugging.
Debug can of course be done directly from the browser by running ionic serve and then using the browser developer tools, but some behaviors happen only on real devices.
Adding a detailed guide to do this..
Make sure your android device has Developer mode on, and USB debugging is enabled in the developer settings on your device. You can google to activate this.
Device connected via USB, both system and mobile device connected to same wifi network..Use command
ionic cordova run android -l --external
After app has installed and started up on device, open this link in your chrome browser
chrome://inspect/#devices
If all was done correctly, you will see your device name and app name there with an option to inspect. This will open the chrome developer console exactly similar to the web one.
Now you can debug the app right on the device. Add breakpoints, edit html and see the logs as well.
Reference
Yes, you can use Chrome and Safari DevTools to connect to your device and debug the HTML/JS/CSS, as long as you don't build a release version (cordova build android ---release). It does take some initial setup since it's disabled by default.
Or you can use Android Studio or XCode to debug the plugins etc.
Note that you can only debug iOS apps with a Mac (or using Google's iOS WebKit Debug Proxy). Android apps can be debugged from any OS with Chrome (for HTML/JS/CSS) or Android Studio installed.
Official Cordova debugging guide
A simple way could be using logcat, take a look to this answer Debugging a WebView (Ionic) app on Android via logcat.

How to profile Android application without USB connection to device?

I want to profile an Android application on a physical Android device without using a USB connection from the device to my computer. The device's USB port is being used by a peripheral that is essential to my application.
I'm using the Android Wifi ADB Android Studio plugin and have successfully connected the device to utilise the bridge to Android Studio 3.2.1
When I attempt to begin a new profiling session using the Android Profiler my connected device appears to have "no debuggable processes."
How can I profile my application without a USB connection to my Android device?
You need to enable adb integration,
Go to Tools-->Android-->Check Enable ADB Integration
It was a default feature a few versions ago but now it has been disabled by default.
I've found a solution thanks to Unity's list of Android profilers.
At this time on Android Studio version 3.2.1 ADB and the Android Profiler do not work together over WiFi.
For my case I've found simpleperf to be acceptable, a tool which includes functionality to generate CPU flame graphs. I used run_simpleperf_without_usb_connection.py specifically, as documented in the simpleperf README available here.

Android VS Emulator not recognizing work Network

I am trying to set up a selenium/appium framework to test an application on a range of different android devices. As the application is still in the build phase, we are require to be connected to my work network to be able to log into the application itself.
The issue I am having is that if i am using the android VS emulators, I am not able to log into the application.
Whereas if i use BlueStacks to install and run the application, I am able to access the application.
My question is, is here any settings I need to change to make the Android VS emulators to recognize that I am on the work network. Or could you point me in a direction I can investigate?
I am using Appium and the server address is 127.0.0.1:4723.
Why are you using VS Emulator? On this page they state:
Note: After we released the Visual Studio Emulator for Android, Google updated their Android emulator to use hardware acceleration.
We recommend you use Google’s emulator when you can, as it offers access to the latest Android OS images and Google Play services. If you have enabled Hyper-V, try out our Hyper-V Android emulator compatibility preview to run Google’s emulator on Hyper-V directly.
You should use the official Android Studio emulator which lets you control network connectivity:
https://developer.android.com/studio/run/emulator#wi-fi
https://developer.android.com/studio/run/emulator-networking

How to develop android apps with xamarin without hyper v and emulator

I am using windows 10 home and visual studio 2017. I want to develop android apps with xamarin. Hyper-V feature is not available on windows 10 home and I can not afford pro version, So emulator is not installing without hyper-v.
What should I do to develop android app?
Have anybody idea to deploy android app without using emulator and hyper-v?
Thank you in advance!
It's possible to develop Xamarin app without using the emulators. But in that case you'll need to have an Android device to deploy your app on.
Setup Android SDK Manager on your system. Although Xamarin includes a
SDK Manager, you can download it from the following link. Android SDK Manager download
Setup the ADB (Android Debug Bridge) on your system (install Google USB Drivers)
Connect your Android device to the system after you enable USB Debugging(Developer options) on it. Once the device is connected it will give you a prompt to enable debugging. Tap yes and you'll see the option to build to your device as shown in image.
You can try to use any avaliable on windows android emulator. I like to use Bluestack (https://www.bluestacks.com), the steps for use it below:
Install Bluestacks emulator
Launch emulator and wait for load finished
It's your wellcome screen, your application and apps from store will be here
Go to settings > Preferences and check "Enable android debug bridge (ADB)" + "Enable Android input debugging"
One time Setup finished
"Open android adb command promt" and type
adb connect 127.0.0.1:5555
If you have done everything good you will be connected to emulator and ready to debug your application
Good luck!
UPDATE:
As of visual studio 2019, non-hyper v emulation has been stopped.
Old Answer
I am very positive that at the time of VS installation the Visual studio emulators for Android are readily available for download and use, there you can find a good amount of android emulators also it provides you with Android SDK which again can be used to create Android emulators without using Hyper-V
The below link contains all you need to know about Visual studio emulators including on how to install :
https://msdn.microsoft.com/en-us/library/mt228279.aspx
Hope this Answers your question.
Goodluck!

Chrome Dev Tools and Genymotion Android Emulator

Reference: Genymotion how to debug with Chrome Dev Tools
I'm also trying to get chrome developer tools to work with a genymotion emulator. However, when I follow all of the steps recommended (including at the above link), I don't get the "inspect" link. See: http://neu14.com/demos/screenshot.png
Note: I found out that the default browser on the android devices, at least on most of the prior os versions is not Chrome. Finding an apk to download for Chrome android compatible versions, without an actual google play account, is quite challenging?
It took me ages to get the remote debugging working on Genymotion as I couldn't install Chrome on it without the Google play store which isn't installed by default.
Finally found this video so thought I'd share. It explains how to install this virtual device which has the play store ready installed. Once that was set up and I could install Chrome and set up remote debugging.
Won't work with the default android browser though as you said, but its a step forward!
Hope that helps
I know my answer is little late, but I thought it may be helpful for someone
1) In the device, go to dev settings/ dev tools and enable USB debugging.
2) Start your app on genymotion (for instance if you are using ionic framework, then launch the app using "ionic run android"
3)Go to you chrome and try running "chrome://inspect"
4) Also , please ensure that you have android 4.4 or above version. Else it wont work. I spent quite a lot of time because i was using android 4.3 version.
Hope this helps
I found it far simpler to use a product like Ghostlab (https://www.vanamco.com/ghostlab/) (paid product).
It will let you connect to the site running on your host machine, from the Genymotion emulator. You can then launch chrome dev tools from your host machine.

Categories

Resources