You need to set some of the below secret keys in local.properties
- Google Authentication:
- Keys to define:
- LOGGER_GOOGLE_OAUTH_CLIENT_ID
- NAVIGATOR_GOOGLE_OAUTH_CLIENT_ID
- SMAS_GOOGLE_OAUTH_CLIENT_ID
- if you are not using google auth (at least in some of the apps), then define empty strings..
- will be ignored anyway. if you are, follow official docs on how to create one for google sign in in apps
- Keys to define:
- Google Maps API Key:
- MAPS_API_KEY
- SMAS_API_KEY: this is used by SMAS and Navigator (see [ModuleSmasNW])
- failing to set any of those will cause the Google Map not to render..
This repo uses separate git repositories (called submodules) for lib-core
,
and lib
(android-lib).
If you haven't pulled those with thegit clone
, you can do now using:
git submodule update --init --recursive
This is required for including Activitylocally the subprojects anyplace-lib-core
, anyplace-lib-android
.
If you checkout different branches, make sure to checkout the relevant commit for:
lib-core
, andlib
- open the folder:
android-new
as a project - this will have the following components:
lib-android
,lib-core
,smas
,navigator
andlogger
- these are detailed below in the guide (in Structure)
If the DBG.USE_ASSETS
option is set, then you need to provide some assets for the TFlite models
There might be optionally some further json
files that are used in assets also
(you may find traces of those in code().
AssetReader
has some examples of how thejson
files are usedDetectionModel
enum class contains the paths for the model files- NOTE:
CvModelFilesGetNW
downloads the models remotely, so
- NOTE:
- at
lib-android
module:- right click -> new directory ->
src/main/assets
- right click -> new directory ->
- Place in there any assets:
- models
- demo.spaces (optionally, some
json
files)- you can use
AssetReader
to load from these
- you can use
.
├── demo
│ └── spaces
│ ├── building
│ └── vessel
│ └── flavia
│ ├── floors.json
│ └── space.json
└── models
├── coco
│ ├── model.tflite
│ └── obj.names
└── ucyco
├── model.tflite
└── obj.names
When you run the app, it is suggested to filter the logs (select debuggable process
).
You may additionally import this filtering in .idea/workspace.xml,
as a direct child of the project tag:
<component name="AndroidConfiguredLogFilters">
<filters>
<filter>
<option name="logLevel" value="verbose" />
<option name="logMessagePattern" value="" />
<option name="logTagPattern" value="^(anyplace|anyplace/.*|ap_*)$" />
<option name="name" value="log-anyplace" />
<option name="packageNamePattern" value="cy.ac.ucy.cs.anyplace.*" />
</filter>
</filters>
</component>
- contains the retrofit code and all interactions with the relevant APIs
- for Anyplace and for SMAS
- it has nothing that is bounded to Android
- It is a pure java/kotlin library module, that is included by android-lib
- almost all of the code is here
- the remaining modules are mostly "clean"
- originally it was supposed to have only Anyplace-related code
- due to the addition of CV localization methods in SMAS, it also contains all of the SMAS logic
- smart alert system
- it's the SMAS code base with the following functionality removed:
- chat and alerts
- not up to date..
- Learn the shortcuts, see tutorials how to make the most of the IDE.
See tutorials and understand the basics of kotlin
- including:
- by lazy init, lateinit, and initialization in general
- Flows
- Extension Functions
- Coroutines
- Application, Activity, Fragments
- logcat, how to filter logcat, how to debug
- gradle, ConstraintLayouts
- MVVM Pattern
- View Models
- DataStores
- how to use AppInspection to ispect DBs
- how to inspect files of app:
- eg Cache stores in: /data/data//
- Dependency Injection (Hilt/Dagger)
- and in general: what it is, what it does, why it's needed
- UI:
-data binding, view binding
- jetpack compose (used in SmasChatActivity)
- BindingAdapter
- RecyclerView
- NavController: SpaceListFragment (SpaceSelectorActivity)
- DataStore, and how it is connected to activities and XML files
- e.g. [SettingsCvActivity] is connected to [CvMapDataStore]
- study helper methods in there, e.g., setPercentageInput
- Retrofit: for Http requests
- Room: for an SQLite interface (also learn how to use properly the db-related features of the IDE)
- SomethingWrapper: (e.g. GmapWrapper, or LevelWrapper)
- an object (probably a data class) is wrapped to provide additional functionality
- this leaves the original object clean (a data class), so it can be better in many scenarios
- serialized/deserialized, used by Retrofit, etc
- CvMapActivity
- child: CVLog, CvSMAS
- loads a Space and all Floors json objects, that are fetched from anyplace
- These must be loaded before anything else can happen..
- [app.bar] is a [Snackbar]. Try to use that, if you can bind it to activity (using [setMainView])
- If it cannot be binded to activity, use [app.showToast]
- There is a [GmapWraapper] on top of [GoogleMap]
- the wrapper is in CvViewModel object: VM.ui.map
- the object: VM.ui.map.obj
- See tutorials and official guide
- Must create a key at https://console.cloud.google.com/apis/
- Assuming there was a successful SMAS & anyplace login, and no building was elected yet
- [SpaceAdaptor] will select a building (or SMAS pick one hardcoded)
- Then [AnyplaceApp.loadSpace] will load some necessary json files
- when from SMAS/logger: GmapWrapper setup -> loadSpace will do this
- otherwise: the last building will be used (stored in DataStore), and the last activity will open (also stored in DataStore)
- View are here: cy/ac/ucy/cs/anyplace/lib/android/data/smas/db/Views.kt
- Queries here: cy/ac/ucy/cs/anyplace/lib/android/data/smas/db/smasQueries.kt
- It may be controlled with this parameter:
USE_SPACE_SELECTOR
- further implementation might be needed
- The Space Selector (
SelectSpaceActivity
), and all activities that it depends upon), it's a bit complex..