Monday, July 15, 2024

What do BlueStacks, Genymotion, Nox and LDPlayer have in common?

 Bluestacks 10 (https://www.bluestacks.com/download.html)app player allows you to play mobile apps, both Cloud Gaming and Android Emulator) from the Google Play Store on your Windows or Mac computer. 

Genymotion (https://www.genymotion.com/product-desktop/download/)is a cross platform Android emulator for testing apps. It can do scalable testing that are done on virtual devices.It is available for windows (x64), Linux(x64) and macOS(x86-64, arm64) platforms as well as Genymotion SaaS and Genymotion Device Image.


Nox (https://www.bignox.com/) is yet another Android Emulator for playing mobile games.


 LDPlayer (https://www.ldplayer.net/) featured as the fastest Emulator for Android games PC.' 





Motivation:

Actually, I wanted the raw data on a commercial, low cost, smartwatch from a Chinese company that called upon an Android app called HBand. H Band is available on Google Play, but if you want to run it on your windows PC (Windows 11) you need an Android Emulator. All of the above apps are indicated for the use of H Band.

The Mobile app, H Band on a Android Phone works OK. But, what if you want to look at raw data of  (body temperature, step counts, blood pressure, blood glucose, blood oxygen, Heart rate,and body temperature) collected by the app.It is supposed to be a safe app as far as data safety is considered including transit time encryption). 


BlueStack:


I contacted BlueStack to find that it does not yet support Bluetooth.


I tried Nox to connect to the watch. It works sometimes and sometimes it does not open. All these apps run very slow, intolerable in this 5G era.

GenyMotion requires a virtualBox. I wanted something that would work with no additional software.

LDPlayer is another option and it takes a lot of memory. It's Bluetooth connection is also not good.





I looked up the space requirements for some of these and they do take up a lot of space and send non-stop notifications.

This is what one of the ChatGPT came up with:

1. **BlueStacks 5**:

   - RAM: Requires at least 4GB of RAM¹.

   - Storage: Approximately 5GB of free disk space².

   - CPU Consumption: Consumes about 10% CPU, making it efficient¹.

   - RAM Usage: Consumes the least amount of RAM compared to other emulators¹.


2. **LDPlayer**:

   - CPU Consumption: Registered a massive 145% higher CPU usage compared to BlueStacks¹.

   - RAM Usage: Consumes more RAM than BlueStacks¹.


3. **Nox**:

   - CPU Consumption: Consumes 37% more CPU resources with noticeable lag in-app performance¹.

   - Storage: Unfortunately, I couldn't find specific storage requirements for Nox, but it seems to take up significant space³.


4. **Genymotion**:

   - Genymotion is another popular emulator, but its resource usage can vary based on the specific configuration and usage.


I DECIDED TO DUMP THEM ALL AND USE THE ANDROID EMULATOR IN ANDROID STUDIO. WHAT IS MORE, I HAD USED IT YEARS AGO.

NOT BEING A GAMER, I DO NOT NEED THE PROGRAMS. WHen I FIND SOME TIME, I WILL GET RID OF THEM





 







Sunday, July 14, 2024

What is a UTM in relation to Uniform Resource Locators?

UTMs  are a subset of URL parameters that are key-value pairs. The key-value pairs adds information and instructions to the URL.

UTM parameters are a specific format appended to a URL that track marketing campaign data in media sites like eCommerce sites or promotional media sites. They typically consist of five parts and all may not be present and even if present are not easily identified:

utm_source: Identifies the source of the traffic (e.g., google, email)

utm_medium: Identifies the advertising medium (e.g., cpc, organic)

utm_campaign: Identifies the specific marketing campaign

utm_term: Identifies the paid search term used (if applicable)

utm_content: Identifies the specific ad creative used (if applicable)

About URLs and UTMs

Hodentek.blogspot.com is my blog which brings up this:


One of the links at the bottom takes me, or directs me to

https://hodentekmobile.blogspot.com/2021/09/installing-android-studio-arctic-fox.html#google_vignette

So far we have had no URL parameters. The link just took us to another post in the blog.

In the following, the webpage brings https://www.amazon.com 

Searching for an author (myself) brings this page:


https://www.amazon.com/s?k=Jayaram+Krishnaswamy&crid=2BWW0UDS2F3NK&sprefix=jayaram+krishnaswamy%2Caps%2C195&ref=nb_sb_noss

There are URL parameters but are not UTMs. There are no UTM related key/value pairs. It is just a search page.

Here is an example of looking for a UTM page. Google places ads on the web pages and when it is clicked, the page author gets a click credit.

This is a blog page of mine with a coupon:


Click the Coupon code on this page to bring this one up:


Hitting CONTINUE will bring up this page with its URL shown below the image.


https://capitaloneshopping.com/lp/shoppingsavingscouponsm?utm_source=Unicorn&atnid=EAIaIQobChMIlaGV3P-nhwMVPlwIBB32wAB1EAEYASAAEgI3uPD_BwE

As shown in the highlighted key-value pairs you can recognize the UTM. The source 'UNICORN' is perhaps custom marketing campaign internal to the company. Media sites like Google, Facebook, etc are some examples of sources.

Another example:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164414688&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=2161889362&click_id=63224_dde31108-431b-11ef-8da6-453632a452f2&zpbid=63224_dde31108-431b-11ef-8da6-453632a452f2

One more example from a Gold site:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164415377&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=1812271808&click_id=63224_caa131d1-44ce-11ef-894b-844a229bc158&zpbid=63224_caa131d1-44ce-11ef-894b-844a229bc158

Benefits of UTMs:

  • Tracking campaign effectiveness, effectiveness of advertising spend and improving user experience

  • Drawbacks of UTMs; Hard to manage and needs steep learning to put them effectively which result in miss-implementation.

  • Other forms of tracking also possible like referal codes, coupons and analytics.


Monday, June 24, 2024

What is the latest version of Android Studio and how do you install it?

The latest version of Android Studio is called Koalas(2024.1.1)

Please visit this site for details: https://bit.ly/4eAwThe

For Windows download go here: https://bit.ly/3VToH4h

I had problems installing an older version named Arctic Fox here;

https://hodentekmobile.blogspot.com/2021/09/installing-android-studio-arctic-fox.html#google_vignette

Instructions:

If you downloaded an .exe file (recommended), double-click to launch it.

If you downloaded a .zip file:

Unpack the .zip.

Copy the android-studio folder into your Program Files folder.

Open the android-studio > bin folder.

Launch studio64.exe (for 64-bit machines) or studio.exe (for 32-bit machines).

Follow the Setup Wizard in Android Studio and install any recommended SDK packages.

Herein I describe the installation of Android Studio Koalas on a Windows x64 laptop Surface Pro 5. I downloaded this file:  android-studio-2024.1.1.11-windows.exe

The installation screens are shown here:










Although all the screens have successfully traversed, you do not see the Finish button enabled. The trick is go to each item in the list and accept the license terms. If all of them are accepted the Finish button gets enabled.


It will start downloading all the components and the program successfully ends.


This problem has been faced by any and even made it to the StackOverflow forum.


https://stackoverflow.com/questions/67062999/unable-to-install-the-sdk-tools-finish-button-is-disabled

Sunday, June 23, 2024

What is the latest version of Android Studio and what are its features?

 The latest version of Android Studio (2024.1.1) is called Koalas.

Android Studio is used for building high-quality, modern Android Applications. The following features make it extremely well suited for building modern Android applications. These are in no way new but essential in all modern design environments:

  •  Develop Native Android Apps:  The basic function is used to build Android applications using KOTLIN, or Java. KOTLIN is Google's preferred language for Android app development. It provides an development environment with all the necessary tools for writing, editing, testing, debugging, and deploying your application. It's Android device monitor can explore various aspects of a connected Android app.

  • Build app's UI with Jetpack Compose :  Without UI you can not think of an application and Android can do UIs. It uses 'Jetpack Compose' to create UIs. Jetpack Compose is a declarative UI framework that allows you to build modern, customizable, and efficient user interfaces with a more composable and reactive approach.

  •  Utilize Robust Development Tools: Android Studio has a rich set of tools to do almost anything such as:

  1.  Code editing: Syntax highlighting, code completion, refactoring tools, and code navigation for efficient coding.
  2.  Debugging: Step through your code, set breakpoints, inspect variables, and identify and fix bugs effectively. Debugging can also be used look at data flows in the app.
  3. Testing: Write unit tests, integration tests, and UI tests to ensure code quality and prevent regressions.
  • Emulation and Testing on Different Devices:  Every app developer wants to see how is app works on a physical device and the look and feel on other device sizes. Without needing a physical device for every configuration, you can use the built-in Android Emulator to test your app on virtual devices simulating various screen sizes, operating systems, and device capabilities. Additionally, you can connect real Android devices for testing and development. You can test on external devices using WiFi or USB. 
  • Integrate with Firebase and Other Services:  You can use Google Firebase for authentication, databases, cloud storage, analytics, and more. Android Studio also supports integrating with other third-party libraries and services to enhance app features such as Networking, Image loading, UI animations, databases, etc.

Here is a link to installing Android Studio on Windows 10: 

Also, couple of more articles on the same HodentekMobile blog.

Friday, June 21, 2024

Are there AI models that can help deal with diabetes?

There are pretrained AI models for diabetes.

GlucoNet Model: Deep learning model that can predict Glucose levels based on carbohydrate intake.

Deep Gluco Model: Not only takes carbo intake into consideration but also insulin dosage, physical activity, etc.

GlucoNet is adequate for diabetes type II. I will be homing in on type II.

These are used to improve the MIT control loop for adjusting optimal carbo intake.

There is company (Alertgy) in Melbourne, Australia involved in the development of diabetes monitored by a wearable device.

Right now, I have one with questionable activity, but qualitatively measuring (Zero, when not connected and 3 peaks to coincide in time with break fast, lunch and dinner).


Wednesday, June 19, 2024

How to discover Bluetooth connections with PowerShell?

 

About PowerShell:


Powershell is one of Microsoft's extremely useful and powerful tool. It is installed on most of the Microsoft computers and laptops.

Just open type in PowerShell in Windows Search as shown.

The Search brings up the following screen:

There are two versions of PowerShell for x86 and x64 architectures and there is also an Integrated Scripting Environment(ISE), a very useful option that can do a lot more than the command line tool.

I will be using this to discover Bluetooth devices on my laptop that are discoverable.

Let me open the x64 bit version with Administrator rights (also known as elevated permissions). I do this because, the program may not allow you to do certain things otherwise.


The red arrows are Running the code, or running a section of the code that you choose to run. Since, we are not using the ISE, these are greyed out.

Working with Bluetooth:

Bluetooth is a Pnp device and it is called Bluetooth. Run the following code as shown:


PS C:\WINDOWS\system32> Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"}

After typing the code click Enter key. The following is displayed,

=====================

PS C:\WINDOWS\system32> Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"}


Status     Class           FriendlyName                                                                     InstanceId     

------     -----           ------------                                                                     ----------     

OK         Bluetooth       Object Push Service                                                              BTHENUM\{000...

OK         Bluetooth       Bluetooth LE Generic Attribute Service                                           BTHLEDEVICE\...

OK         Bluetooth       Generic Attribute Profile                                                        BTHLEDEVICE\...

Unknown    Bluetooth       Jayaram's S23+ Avrcp Transport                                                   BTHENUM\{000...

OK         Bluetooth       Microsoft Bluetooth Enumerator                                                   BTH\MS_BTHBR...

OK         Bluetooth       Generic Access Profile                                                           BTHLEDEVICE\...

OK         Bluetooth       Intel(R) Wireless Bluetooth(R)                                                   USB\VID_8087...

OK         Bluetooth       Jayaram's S23+ Avrcp Transport                                                   BTHENUM\{000...

OK         Bluetooth       Microsoft Bluetooth LE Enumerator                                                BTH\MS_BTHLE...

OK         Bluetooth       Phonebook Access Pse Service                                                     BTHENUM\{000...

OK         Bluetooth       Personal Area Network Service                                                    BTHENUM\{000...

OK         Bluetooth       Bluetooth Device (RFCOMM Protocol TDI)                                           BTH\MS_RFCOM...

OK         Bluetooth       Jayaram's S23+                                                                   BTHLE\DEV_6A...

OK         Bluetooth       Jayaram's S23+                                                                   BTHENUM\DEV_...

OK         Bluetooth       Bluetooth LE Generic Attribute Service                                           BTHLEDEVICE\...

Unknown    Bluetooth       Jayaram's S23+ Avrcp Transport                                                   BTHENUM\{000...

OK         Bluetooth       Personal Area Network NAP Service                                                BTHENUM\{000...

OK         Bluetooth       Bluetooth LE Generic Attribute Service                                           BTHLEDEVICE\...

OK         Bluetooth       Jayaram's S23+ Avrcp Transport                                                   BTHENUM\{000...

===========================================

The InstanceID cannot be fully seen.

You need to format the output. The best way is to run the following:

PS C:\WINDOWS\system32>  Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"} | Export-Csv -Path "C:\Users\Me\Desktop\listing.csv" -NoTypeInformation

This will provide a more complete output in the exported listing.csv file at the indicated location.

The CSV file has much more information in tabulated columns.


Although this gives some idea of connected devices, there are repetitions and somewhat difficult to look for specific information.

I not only want Bluetooth devices discovered but I would also like to get the ones that are ready for pairing with the laptop's Bluetooth.

This next code and the response makes it little more clear.

================================

PS C:\WINDOWS\system32> $devices = Get-ChildItem -Path HKLM:\\SYSTEM\\ControlSet001\\Services\\BTHPORT\\Parameters\\Devices

foreach ($device in $devices) {

    $address = $device.pschildname.ToUpper()

    $name = $device.GetValue("Name")

    if ($name -ne $null) {

        $printableName = ($name -notmatch 0 | ForEach-Object {[char]$_}) -join ""

        echo "Address: $address, Name: $printableName"

    }

}

Here is the response:

Address: 6A185BABF058, Name: Jayara's S3+

Address: 9C73B16CBD32, Name: Jayara's S3+

Address: FB621134FEF9, Name: KS01


PS C:\WINDOWS\system32> 

========================

In the above, I see my paired Samsung S23+ Smartphone and a Smartwatch, KS01. However, I do not see the paired Samsung Smart TV. That's something I need to troubleshoot.

In this post, discovering devices connected by Bluetooth was correctly identified using the PowerShell.


More on PowerShell here: Just search for PowerShell in this blog and You can get dozens of posts that deal with all aspects of Powershell.



Monday, June 17, 2024

Can you call Python libraries from Python Scratch files?

 I see no reason why Python libraries can not be called from Scratch files.  

Let me try using my existing Scratch.py (https://hodentekhelp.blogspot.com/2024/06/what-is-scratch-file-in-pycharm.html) to call the PIL library.


You see you can do it. 


However, you see an indent error. This is not a serious error. It just says there is an unexpected indent.  You can get rid of this error by moving the line "from PIL import Image" back one step, by removing the white space before "from".

This brings another weak warning (Yellow upright triangle with a ! inside). This is a weak warning and not an error. The call statement should be the first statement.

Now remove the print("Scratchy". This clears the weak warning.


Now that the calling of Image is successful, let us explore Image a little bit.

Using Image

The PyCharm provides a drop-down for facilitating code and you should watch out.

Let me see if I can Open an image on my desktop (C:\Users\hoden\OneDrive\Desktop\Beware.jpg).


To open an image you would use the open() method. You should use the image path as an argument in open().

The image we are using Beware.jpg is on the desktop and its location is

 "C:\Users\hoden\OneDrive\Desktop\Beware.jpg"


You get a bunch of errors for each "/" in the path. This needs to be corrected. The next image file specification removes the bunch of indent errors.


Each indent is replaced by // as shown above.

The code runs without errors. To see the image, we need to call another library. For now, since we have image, let me get the width and height of the image by the following code (you need not display the image to get its properties):

=========================================================

from PIL import Image

image_path = "C://Users//hoden//OneDrive//Desktop//Beware.jpg"

image=Image.open(image_path)

width, height = image.size

print(f"Image dimensions: Width = {width}, Height = {height}")

==========================================================

This code runs as well and you get the Height and width as,

Height= 259  Width=  259

The units are in pixels.

The height and width of the image from its properties using Windows explorer is shown here.


Important thing to note:

File references may sometime gets tricky as the file may be on the desktop, or some other location. It is best to catch an error, if the file is not at the expected location.