Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more indepth information for app development/API usage. #125

Open
MagneFire opened this issue Nov 3, 2021 · 10 comments
Open

Add more indepth information for app development/API usage. #125

MagneFire opened this issue Nov 3, 2021 · 10 comments

Comments

@MagneFire
Copy link
Member

Currently we have a wiki for creating an app for AsteroidOS: https://asteroidos.org/wiki/creating-an-asteroid-app/
While sufficient for simply building and creating a new app, it does not show what APIs are available for everyone to use.
Generally people have to search through this GitHub organization, which is not desirable.

Instead we should provide a new wiki page that provides this information.

Things that this page should have (more to be added/suggestions welcome 😉 ):

  • Information on all qml components: These are also available here: https://doc.qt.io/qt-5/qtqml-index.html but we should provide a list of commonly used modules.
    • General modules:
      • Item
      • Rectangle
    • Watchface specific
      • Wallclock
      • Canvas
  • Provide information on how to use our custom QtSensors API (https://github.com/AsteroidOS/qtsensors).
  • Provide information on how to interact with the DBUS MCE API
  • Provide information around the generally used modules like: Nemo KeepAlive
  • Provide information on how to interact with Asteroid Launcher: How to catch display on/off events, ambient mode events.
@beroset
Copy link
Member

beroset commented Nov 4, 2021

I love this idea. Another thing that would be useful is to document what SailfishOS refers to as "callchains" for example:

Sensors: sensorfw-qt5 <> sensorfw-qt5-hybris <> libgbinder <> Android BSP HAL: android.hardware.sensors

Could such mapping be automated? Automating documentation from the code is a good way to make sure that they stay in synchronization. Doxygen uses this approach.

@MagneFire
Copy link
Member Author

For reference on your comment that information is provided by https://sailfishos.org/wiki/Architecture.

Doxygen is an awesome tool to get documentation from the code. However, I'm not familiar with a method that would allow doing the same for all different source codes (QtSensors, General Qt modules, MCE APIs, etc)

@lepras
Copy link
Contributor

lepras commented Jan 9, 2023

Also we need simple logging and linux commands one can use for debugging (like journalctl). It maybe redundant but it would be helpful for people coming from other dev environments cough (flutter + windows) cough. And running and setting up command line things not GUI coz qtcreator breaks a lot. (aos docs are not clear on that)

Some developing tips like setting up qmltester on watch and reduction of testing cycles by separating logic and design.

Again it may be redundant but seeing how easy it is for developers to pick up something like flutter and make up a simple app, we should be inspired by that. I know it isn't fair to compare two projects that have vastly different amounts of resources and organizations backing them up, but atleast we can take inspiration and move in the right direction.

If nobody is writing this, can I?, I will try and make up a PR. and then somebody more experienced and nuanced than me can review it.

I am exploring setting up the environment in vscode (the IDE noobs like me use :P), if I got things working I will mention that also!

@lepras
Copy link
Contributor

lepras commented Jan 13, 2023

have 2 terminals

  1. do ssh and journalctl in one
  2. other build app or vim

Useful Vs Code Extensions:

  1. ms-vscode.cpptools
  2. twxs.cmake
  3. tonka3000.qtvsctools
  4. felgo.felgo or bbenoist.QML
  5. Gruntfuggly.todo-tree: for project management

not related to qml/qt but Codeium.codeium is the only thing that works well for qml autocomplete

@lepras
Copy link
Contributor

lepras commented Jan 13, 2023

here is a shell script to quickly install an app:

#!/bin/sh

source /usr/local/oecore-x86_64/environment-setup-armv7vehf-neon-oe-linux-gnueabi
export CMAKE_PROGRAM_PATH=/usr/local/oecore-x86_64/sysroots/armv7vehf-neon-oe-linux-gnueabi/usr/bin/
cmake -B build
cmake --build build
cmake --build build -t package

file="$(ls ./build/*.ipk | sort -V | tail -n1)"
filename="$(basename $file)"
sshpass -p "<password>" scp $file ceres@192.168.2.15:/home/ceres/
sshpass -p "<password>" ssh root@192.168.2.15 << EOF
  cd /home/ceres/
  opkg install --force-overwrite $filename
EOF

@lepras
Copy link
Contributor

lepras commented Jan 13, 2023

Add these lines at the end of CMakeLists.txt for package automation:

set(CPACK_GENERATOR "DEB")
string(TOLOWER "${CMAKE_PROJECT_NAME}" lcproject_name)
set(CPACK_DEBIAN_FILE_NAME "${lcproject_name}-${CMAKE_PROJECT_VERSION}.ipk")
set(CPACK_STRIP_FILES TRUE)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armv7vehf-neon)
if (NOT CPACK_PACKAGE_CONTACT) 
    set(CPACK_PACKAGE_CONTACT bogus@example.org)
    message(WARNING "No package contact specified: using ${CPACK_PACKAGE_CONTACT}")
endif()
include(CPack)

@lepras
Copy link
Contributor

lepras commented Jan 14, 2023

Main docs: https://doc.qt.io/ (AOS uses qt5)
AOS specific component/API: https://github.com/AsteroidOS/qml-asteroid
Examples of use of most of those can be found by searching the AsteroidOS codebase: https://github.com/search?q=org%3AAsteroidOS+StatusPage&type=code

@lepras
Copy link
Contributor

lepras commented Jan 14, 2023

Dump logs by

sshpass -p "<password>" ssh root@192.168.2.15 << EOF
   journalctl -e --no-pager > /home/ceres/log.txt
EOF
sshpass -p "<password>" scp ceres@192.168.2.15:/home/ceres/log.txt ./build/

Follow Along by

journalctl -f

@lepras
Copy link
Contributor

lepras commented Jan 14, 2023

Using QML tester for small testing cycles:

opkg install qmltester

Edit qmls by vim and scp

vim scp://user@myserver[:port]//path/to/file.txt

Follow along by

journalctl -f

@FlorentRevest
Copy link
Member

Useful Vs Code Extensions:

  1. ms-vscode.cpptools
  2. twxs.cmake
  3. tonka3000.qtvsctools
  4. felgo.felgo or bbenoist.QML
  5. Gruntfuggly.todo-tree: for project management

We could add a .vscode/extensions.json and useful tasks.json to our helloworld repo (and more if people find that useful)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants