Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Architecting Qt Mobile Applications: Frameworks, Code Generators and Beyond

300 views

Published on

Talk presented at Akademy 2017 - Almería - Spain

Published in: Software
  • Be the first to comment

  • Be the first to like this

Architecting Qt Mobile Applications: Frameworks, Code Generators and Beyond

  1. 1. sandroandrade@kde.org @andradesandro Sandro Andrade Architecting Qt Mobile Applications Frameworks, Code Generators and Beyond Akademy 2017
  2. 2. whoami whoami
  3. 3. whoami whoami
  4. 4. What is this talk about?
  5. 5. What is this talk about?
  6. 6. What is this talk about? ● Qt offers a stable UI framework for cross- platform mobile applications development ● Large and complex Qt mobile applications still lack some architectural-level support ● A lot of functionalities are recurrent and amenable to automatic code generation
  7. 7. What is this talk about? ● Some Qt disabilities in mobile development: – Lack of high-level frameworks delivering modular and reusable architectural solutions for mobile apps – KDE Frameworks 5 is likely to be cumbersome and/or introduce unwanted dependencies – Lack of high-level reusable UI components (KDE Kirigami to the rescue)
  8. 8. What is this talk about? ● Some Qt disabilities in mobile development: – No built-in support for JSON-based RESTful communication (lack of a JSONListModel) – No built-in support for disconnected operations (with automatic sync upon reconnected) – No built-in cross-platform support for receiving push notifications – Issues with deployment of read-write files across platforms
  9. 9. What is this talk about? ● We’ve been working on some mobile Qt development projects at IFBA over the last 1.5 years ● Such Qt disabilities has motivated us to investigate to which extent such problems can be alleviated with the use of well- thought architectures and effective tooling
  10. 10. Introducing Meg = + Meg A lean dynamic QML-based architecture for Qt cross-platform mobile applications A code generator which Enables the productive creation of modular RESTful servers and Qt mobile applications
  11. 11. Introducing Meg ● Implemented as a Ruby Thor-based CLI ● Templates are specified in Embedded RuBy (ERB) ● Generators are modular (Thor with modules) ● Provides a JSONListModel QML object ● Automatic download of Google Material Icons
  12. 12. Introducing Meg ● Currently available templates: ● Sinatra RESTful server with modular architecture (sinatra-server) ● Ruby Sinatra RESTful service plug-in (sinatra-service- plugin) ● Simple Qt mobile app with plugin-based architecture (simple-app) ● Qt mobile RESTful app with plugin-based architecture (restful-app) ● Qt mobile RESTful client plug-in (restful-client-plugin)
  13. 13. Meg – quick demo ● Installing meg: – git clone https://github.com/sandroandrade/meg.git – install ruby – run ‘gem install bundler’ – Run ‘bundle install’ – CLI is in ‘./bin/meg’
  14. 14. Meg – quick demo ● Creating a simple Qt plugin-based mobile app: – ./bin/meg new SimpleApp -t simple-app ● Creating some plug-ins: – ./bin/meg generate plugin students -t basic-plugin -a simpleapp/ – ./bin/meg generate plugin teachers -t basic-plugin -a simpleapp/
  15. 15. Meg – quick demo ● Creating a modular Sinatra RESTful server: – ./bin/meg new myserver -t sinatra-server ● Creating some plug-ins: – ./bin/meg generate plugin Conference -t sinatra-service- plugin -a myserver/ acronym:string name:string city:string country:string venue:string start_date:datetime end_date:datetime – ./bin/meg generate plugin Speaker -t sinatra-service- plugin -a myserver/ name:string affiliation:string shortbio:string
  16. 16. Meg – quick demo ● Running the server: – run ‘rake db:migrate’ – populate database with some data – start the server: ‘ruby myserver.rb’ ● Checking the services: – curl http://localhost:4567/conferences | python -m json.tool – curl http://localhost:4567/speakers | python -m json.tool
  17. 17. Meg – quick demo ● Creating a mobile Qt RESTful client: – ./bin/meg new MyApp -t restful-app ● Creating the RESTful client plug-ins: – ./bin/meg generate plugin conferences -t restful-client- plugin -a myapp -i name -c action/ic_speaker_notes acronym:string name:string city:string venue:string start_date:datetime end_date:datetime – ./bin/meg generate plugin speakers -t restful-client-plugin -a myapp -i name -c action/ic_record_voice_over name:string affiliation:string shortbio:string
  18. 18. Meg – quick demo ● Qt RESTful client:
  19. 19. Meg – quick demo ● Future work: – Add templates for full CRUD support – Add template for kirigami-based UI workflows – Support relationships between models – Support push notification ● Try it! Contributions welcome!
  20. 20. Questions?

×