I want the easiest way to see some temperature/humidity/pressure chart on those SensorTag + phone, instead of keeping them unused in a drawer.
Keeping it simple, and not using the Android Studio would have been nice, but I don't know enough Android development to swim against the current, so I give up to that idea. I've installed yesterday the current Android Studio Giraffe (2022.3.1 Patch 1) with the extension for Marshmallow (API23) and KVM (on Kubuntu 22.04).
Found the sources of an app that does exactly that, plots some reads from a BLE sensor:
http://mylifewithandroid.blogspot.com/2016/03/android-phone-as-weather-station.htmlThe problem is that I couldn't compile that for Android Marshmallow (API 23). The author has a zip with only the necessary files, not the entire project. It is supposed to create a default project, then replace the 'main' directory with the files from the zip. Then to manually modify the buil.gradle file.
Never developed anything for Android before, so I have no idea what options to choose when creating the blank 'No activity' project, what/where to change from default to the old API23, and so on.
At some point the author wrote "update app/build.gradle like this:"
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.jjoe64:graphview:4.0.1'
}
The file created by the new project wizard already has an
app/build.gradle file with its own section of dependencies. Even more, Gradle has changed since 2016 when that blog post was made, so now the Android Studio editor strikeout the words "compile" and invites me to run a syntax updater, about which I have no idea what it is, and so on.
A few blogposts before the one I want to use, the author tells how to deploy the zip into a 'No activity" empty projected created with Android Studio:
Update: I was asked by e-mail, how to import the project (in blescan.zip) into Android Studio. Here is a simple process.
Create a new project in Android Studio under any name. Make sure that your project supports at least API level 18. Choose the "create no Activity" option.
Once your project is created, go and find it on the disk. On my Ubuntu system, the project files go under ~/StudioProjects/<ProjectName> where <ProjectName> is the name you gave to your project. We will call this directory <ProjectDir>.
Go into <ProjectDir>/app/src and delete everything there. Copy blescan.zip into <ProjectDir>/app/src and unzip it. It will create a single directory called "main" and the sources below.
In Android Studio, do File/Synchronize. After that is completed, you can open your project files, build APK, etc.
quote from
http://mylifewithandroid.blogspot.com/2014/12/ever-since-i-created-gas-sensor-demo.htmlThough that quote was 2 years before what I try to compile, not sure if that procedure was still valid 2 years later.
TL;DR the sources are just what I need, but they are not given as a complete project, and can't build an .apk with them.
- Don't know if I'm creating the empty template with the proper choices,
- or if I'm editing the gradle.build properly,
- or if those sources can still be compiled with the today Android Studio,
- or if some other extra settings are needed in the current Android Studio in order to build an .apk for Marshmallow
- or maybe something else entirely
Errors are many and various depending of what I'm doing, so that's why not posting any error messages yet, still diggin'.