Compare commits
No commits in common. "master" and "v0.3.4" have entirely different histories.
3
.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
CMakeLists.txt.user*
|
|
||||||
friendiqa.pro.user*
|
|
||||||
IJPSvd.json
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- src/common/alarmlinux.cpp
|
|
||||||
+++ src/common/alarmlinux.cpp
|
|
||||||
@@ -67,7 +67,7 @@
|
|
||||||
stream << "Description=Run friendiqa background sync" << Qt::endl << Qt::endl;
|
|
||||||
stream << "[Service]" << Qt::endl;
|
|
||||||
stream << "Type=oneshot" << Qt::endl;
|
|
||||||
- stream << "ExecStart=/usr/bin/friendiqa -service" << Qt::endl;
|
|
||||||
+ stream << "ExecStart=flatpak run de.manic.friendiqa -service" << Qt::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString nameTimer ="friendiqa-sync.timer";
|
|
251
CHANGELOG.md
|
@ -1,141 +1,72 @@
|
||||||
## v0.6.9
|
## v0.1##
|
||||||
|
|
||||||
* Separate window for new messages with more formatting options
|
|
||||||
* Replaced all Fontawesome icons with system icons
|
|
||||||
* Switch between OAuth2 and Basic Auth
|
|
||||||
* Background sync with systemd-timer and removal of system tray
|
|
||||||
|
|
||||||
## v0.6.8
|
# News #
|
||||||
|
|
||||||
* OAuth2 as signup method
|
* Native Android image selector for new message
|
||||||
* New translation: Dutch
|
* Click on contacts shows contact details on news page
|
||||||
|
* Fix problem with news list after deletion of item
|
||||||
|
|
||||||
## v0.6.7
|
# Contacts #
|
||||||
|
* Clean contacts with no news
|
||||||
|
|
||||||
* Upload multiple images for post and add image descriptions
|
# Images #
|
||||||
* Block user
|
* Upload pictures with description to album (permissions cannot be set due to API problems)
|
||||||
* Report user
|
* Delete pictures or albums from client and server (long press on picture in overview)
|
||||||
* Create Calendar entry from post text
|
* Fix problem when enlarging photo
|
||||||
|
|
||||||
## v0.6.6
|
# Translations #
|
||||||
|
* German, Spanish
|
||||||
|
|
||||||
* Create event
|
|
||||||
* Delete event
|
|
||||||
* New sorting of conversations
|
|
||||||
|
|
||||||
## v0.6.5
|
|
||||||
|
|
||||||
* Fix reply in Friendica 3/2022 version due to API bug
|
## v0.1.1##
|
||||||
* Image downloads work again
|
* FIX: Spanish translation
|
||||||
* Some additional emojis
|
* FIX: Empty Newsview after deletion of first newsitem
|
||||||
|
|
||||||
## v0.6.4
|
|
||||||
|
|
||||||
* Search for new contacts (hashtags, names)
|
|
||||||
* Filter contacts
|
|
||||||
* many new emojis
|
|
||||||
* Replaced Favorite button with Reply button due to buggy Favourite API
|
|
||||||
* Rebuild contacts handling due to buggy Contacts API
|
|
||||||
* Removed permissions for new messages due to buggy Contacts API
|
|
||||||
* Sync all accounts in background (not only active)
|
|
||||||
|
|
||||||
## v0.6.3
|
## v0.1.2#
|
||||||
|
* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
|
||||||
|
|
||||||
* Dark theme
|
|
||||||
* Account Page: list of largest servers for server field
|
|
||||||
* Settings page: Tabs for different settings
|
|
||||||
* Conversation opens on short click on news item
|
|
||||||
* Linux: Option to Autostart on System start
|
|
||||||
|
|
||||||
## v0.6.2
|
## v0.2 ##
|
||||||
|
# News #
|
||||||
|
* Profile image download completely reworked, resulting in speed improvement
|
||||||
|
|
||||||
* Follow and Unfollow contacts (Friendica 2021.07 required)
|
# Contacts #
|
||||||
* Linux: App stays in systemtray after close, syncs in background
|
* New profile tab, data of public and private profiles shown
|
||||||
* bugfix for bulk image upload and download of public images
|
* Change profile picture
|
||||||
* bugfix for conversations in timeline
|
* For friends image button shows private images thanks to new remoteAuth API (Friendica 3.6 server required) --> private holiday pictures have finally arrived!
|
||||||
|
* For friends calendar button shows private events thanks to new remoteAuth API (Friendica 3.6 server required)
|
||||||
|
* News button for forum accounts shows news published via that forum
|
||||||
|
|
||||||
## v0.6.1
|
# Images #
|
||||||
|
* Complete rework of image download, fixes bug with private images
|
||||||
|
* Download all or only new images
|
||||||
|
|
||||||
* Add requestLegacyExternalStorage in AndroidManifest for attachment permissions
|
# Config #
|
||||||
* Refresh timeline on start for Linux
|
* Check if nickname exist on server
|
||||||
* DropArea bugfix for Flatpak
|
* Check if password is correct
|
||||||
|
* Account deletion now also removes news, image data and events from local db
|
||||||
|
|
||||||
## v0.6
|
# Translations #
|
||||||
|
* Italian thanks to Davide de Prisco
|
||||||
|
|
||||||
* New language: Hungarian thank to urbalazs (https://www.urbalazs.hu)
|
## v0.2.1 ##
|
||||||
* Multiple photos in post open in separate slideshow
|
* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
|
||||||
* Layout redesign
|
* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
|
||||||
* Adaptive sidebar
|
* Long posts are automatically truncated
|
||||||
* Sync Friendship Requests, approve/deny/ignore requests
|
* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
|
||||||
* Events: show upcoming events below calendar
|
|
||||||
* Linux: Drag&Drop for new messages and photo upload
|
|
||||||
* Linux: Remember app size
|
|
||||||
|
|
||||||
## v0.5.3
|
## v0.2.2 ##
|
||||||
|
* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
|
||||||
|
* Link to list of public server on Config Tab
|
||||||
|
* Small redesign of SendMessage page
|
||||||
|
* Intents for texts/urls (Send text or url from everywhere to create message)
|
||||||
|
|
||||||
* Implementation of new events API (incl. sync and notification) for Friendica version >= 20.03
|
|
||||||
* Indentation to see replied to newsitem for conversation view
|
|
||||||
* News view type config moved from account page to config page
|
|
||||||
* Simplification of account page on first start
|
|
||||||
* Bugfixes
|
|
||||||
|
|
||||||
## v0.5.2
|
|
||||||
|
|
||||||
* Redesign of news item
|
|
||||||
* Background sync for Android >8.0
|
|
||||||
* Bugfixes
|
|
||||||
|
|
||||||
## v0.5.1
|
|
||||||
|
|
||||||
* Videos open in full screen
|
|
||||||
* Youtube videos open in app
|
|
||||||
* Option to minimize #nsfw post
|
|
||||||
* Rotate image in messageSend component
|
|
||||||
|
|
||||||
## v0.5
|
|
||||||
|
|
||||||
* Redesign due to QML Components 1 being deprecated in Qt 5.12: Slideview for News, left Drawer for Settings, message creation in listview header
|
|
||||||
* Android Notifications for News, DMs, Replies
|
|
||||||
* Global app config separated from account config
|
|
||||||
|
|
||||||
## v0.4
|
|
||||||
|
|
||||||
* Background sync for friends timeline (interval on config page must be > 0) for Android > 5
|
|
||||||
* Replies timeline
|
|
||||||
* Bugfix: App asks for storage permission on first start
|
|
||||||
|
|
||||||
## v0.3.4
|
|
||||||
|
|
||||||
* Direct message creation from profile page works again
|
|
||||||
* Profile image upload works again
|
|
||||||
* Viewing private album pictures of contacts works again
|
|
||||||
* On first start servername from https://dir.friendica.social/servers/surprise selected
|
|
||||||
* Register button opens webview of registration page on server
|
|
||||||
|
|
||||||
## v0.3.3
|
|
||||||
|
|
||||||
* Update for OpenSSL and At
|
|
||||||
* Experimental support for Peertube (links are expanded to video widget)
|
|
||||||
* Some Unicode emojis
|
|
||||||
* Redesign of contact details (click on contact opens in new stack and shows last news)
|
|
||||||
|
|
||||||
## v0.3.2
|
|
||||||
|
|
||||||
* For news containing url ending with mp3, mp4, avi, webm, ogg: media can be played in app
|
|
||||||
* Pictures can be renamed or moved to another album
|
|
||||||
* Bugfix: random crashes for conversations
|
|
||||||
* Bugfix: attach image to message works again
|
|
||||||
* Bugfix: check for nickname on Server has been removed due to API change
|
|
||||||
|
|
||||||
## v0.3.1
|
|
||||||
|
|
||||||
* By popular demand: Conversations open in a new stack, like in Twidere
|
|
||||||
* Conversations open after (long) press on news, like in Twidere
|
|
||||||
* Image attachments are shown below text and can be enlarged, like in Twidere (solves issue #8)
|
|
||||||
* New messages are html, line breaks work (solves issue #7)
|
|
||||||
|
|
||||||
## v0.3
|
|
||||||
|
|
||||||
|
## v0.3 ##
|
||||||
* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
|
* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
|
||||||
* Refactoring of news part
|
* Refactoring of news part
|
||||||
* Search button for news
|
* Search button for news
|
||||||
|
@ -144,76 +75,32 @@
|
||||||
* Timeline for selected group
|
* Timeline for selected group
|
||||||
* Small redesign of SendMessage page
|
* Small redesign of SendMessage page
|
||||||
|
|
||||||
## v0.2.2
|
## v0.3.1 ##
|
||||||
|
* By popular demand: Conversations open in a new stack, like in Twidere
|
||||||
|
* Conversations open after (long) press on news, like in Twidere
|
||||||
|
* Image attachments are shown below text and can be enlarged, like in Twidere (solves issue #8)
|
||||||
|
* New messages are html, line breaks work (solves issue #7)
|
||||||
|
|
||||||
* Fix for [issue 5](https://github.com/LubuWest/Friendiqa/issues/5)
|
|
||||||
* Link to list of public server on Config Tab
|
|
||||||
* Small redesign of SendMessage page
|
|
||||||
* Intents for texts/urls (Send text or url from everywhere to create message)
|
|
||||||
|
|
||||||
## v0.2.1
|
## v0.3.2 ##
|
||||||
|
* For news containing url ending with mp3, mp4, avi, webm, ogg: media can be played in app
|
||||||
|
* Pictures can be renamed or moved to another album
|
||||||
|
* Bugfix: random crashes for conversations
|
||||||
|
* Bugfix: attach image to message works again
|
||||||
|
* Bugfix: check for nickname on Server has been removed due to API change
|
||||||
|
|
||||||
* Fix for [issue 4](https://github.com/LubuWest/Friendiqa/issues/4)
|
|
||||||
* Fix for Friendica [issue 4689](https://github.com/friendica/friendica/issues/4689)
|
|
||||||
* Long posts are automatically truncated
|
|
||||||
* Intents for pictures (Send one image from gallery: attach to message, send multiple images: upload to album)
|
|
||||||
|
|
||||||
## v0.2
|
## v0.3.3 ##
|
||||||
|
* Update for OpenSSL and At
|
||||||
|
* Experimental support for Peertube (links are expanded to video widget)
|
||||||
|
* Some Unicode emojis
|
||||||
|
* Redesign of contact details (click on contact opens in new stack and shows last news)
|
||||||
|
|
||||||
# News
|
|
||||||
|
|
||||||
* Profile image download completely reworked, resulting in speed improvement
|
## v0.3.4 ##
|
||||||
|
* Direct message creation from profile page works again
|
||||||
|
* Profile image upload works again
|
||||||
|
* Viewing private album pictures of contacts works again
|
||||||
|
* On first start servername from https://dir.friendica.social/servers/surprise selected
|
||||||
|
* Register button opens webview of registration page on server
|
||||||
|
|
||||||
# Contacts
|
|
||||||
|
|
||||||
* New profile tab, data of public and private profiles shown
|
|
||||||
* Change profile picture
|
|
||||||
* For friends image button shows private images thanks to new remoteAuth API (Friendica 3.6 server required) --> private holiday pictures have finally arrived!
|
|
||||||
* For friends calendar button shows private events thanks to new remoteAuth API (Friendica 3.6 server required)
|
|
||||||
* News button for forum accounts shows news published via that forum
|
|
||||||
|
|
||||||
# Images
|
|
||||||
|
|
||||||
* Complete rework of image download, fixes bug with private images
|
|
||||||
* Download all or only new images
|
|
||||||
|
|
||||||
# Config
|
|
||||||
|
|
||||||
* Check if nickname exist on server
|
|
||||||
* Check if password is correct
|
|
||||||
* Account deletion now also removes news, image data and events from local db
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
|
|
||||||
* Italian thanks to Davide de Prisco
|
|
||||||
|
|
||||||
## v0.1.2##
|
|
||||||
|
|
||||||
* FIX: Include openssl v1.0.2m for SSL connections in Android v7 and above
|
|
||||||
|
|
||||||
## v0.1.1##
|
|
||||||
|
|
||||||
* FIX: Spanish translation
|
|
||||||
* FIX: Empty Newsview after deletion of first newsitem
|
|
||||||
|
|
||||||
## v0.1##
|
|
||||||
|
|
||||||
# News
|
|
||||||
|
|
||||||
* Native Android image selector for new message
|
|
||||||
* Click on contacts shows contact details on news page
|
|
||||||
* Fix problem with news list after deletion of item
|
|
||||||
|
|
||||||
# Contacts
|
|
||||||
|
|
||||||
* Clean contacts with no news
|
|
||||||
|
|
||||||
# Images
|
|
||||||
|
|
||||||
* Upload pictures with description to album (permissions cannot be set due to API problems)
|
|
||||||
* Delete pictures or albums from client and server (long press on picture in overview)
|
|
||||||
* Fix problem when enlarging photo
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
|
|
||||||
* German, Spanish
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- source-linux/common/filesystem.cpp
|
|
||||||
+++ source-linux/common/filesystem.cpp
|
|
||||||
@@ -165,7 +165,7 @@
|
|
||||||
QTextStream stream(&file);
|
|
||||||
stream << "[Desktop Entry]" << Qt::endl;
|
|
||||||
stream << "Name=Friendiqa" << Qt::endl;
|
|
||||||
- stream << "Exec=friendiqa -background %u" << Qt::endl;
|
|
||||||
+ stream << "Exec=flatpak run de.manic.friendiqa -background %u" << Qt::endl;
|
|
||||||
stream << "Terminal=false" << Qt::endl;
|
|
||||||
stream << "Icon=Friendiqa.svg" << Qt::endl;
|
|
||||||
stream << "Type=Application" << Qt::endl;
|
|
||||||
|
|
|
@ -5,4 +5,5 @@ You have probably selected Friendica as your preferred social network because yo
|
||||||
|
|
||||||
Storing some pieces of user data on the device is necessary for some app features, other apps on your device may not access this data (keeping app’s own database storage protected from other apps is guaranteed by Android). The app has been programmed so that stored information contain any personal data (only login data and id number of last seen post will be transferred to servers). Photos from the albums and contact images are stored in a public directory on the device. Other apps may access these files and the Friendiqa needs access to this directory.
|
Storing some pieces of user data on the device is necessary for some app features, other apps on your device may not access this data (keeping app’s own database storage protected from other apps is guaranteed by Android). The app has been programmed so that stored information contain any personal data (only login data and id number of last seen post will be transferred to servers). Photos from the albums and contact images are stored in a public directory on the device. Other apps may access these files and the Friendiqa needs access to this directory.
|
||||||
To send images from the Android gallery the app needs access to picture databases on the device.
|
To send images from the Android gallery the app needs access to picture databases on the device.
|
||||||
This app doesn’t collect any usage statistics. In addition, no information is sent from your smartphone to me as a developer or to a website associated with me.
|
This app don’t collect any usage statistics. In addition, no information is sent from your Smartphone to me as a developer or to a website associated with me.
|
||||||
|
On first start, the website https://dir.friendica.social/servers/surprise is contacted and the selected server shown in the app.
|
||||||
|
|
117
README.md
|
@ -1,134 +1,121 @@
|
||||||
## Friendiqa
|
## Friendiqa ##
|
||||||
|
|
||||||
QML based client for the Friendica Social Network. Tabs for news (incl. Direct Messages), friends, photos and events. OS: currently Linux and Android (4.3 Jelly Bean, 5.1 for background sync). Source code is a QtCreator project.
|
QML based client for the Friendica Social Network.
|
||||||
|
Tabs for news (incl. Direct Messages), friends, photos and events.
|
||||||
|
OS: currently Linux and Android (4.3 Jelly Bean).
|
||||||
|
Source code is a QtCreator project.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots ##
|
||||||
|
|
||||||
![Newstab](Screenshots/NewsTab.jpg) ![Friendstab](Screenshots/FriendsTab.jpg) ![Photostab](Screenshots/PhotoTab.jpg) ![Eventstab](Screenshots/EventsTab.jpg) ![Configtab](Screenshots/ConfigTab.jpg)
|
![Newstab](Screenshots/NewsTab.jpg)
|
||||||
|
![Friendstab](Screenshots/FriendsTab.jpg)
|
||||||
|
![Photostab](Screenshots/PhotoTab.jpg)
|
||||||
|
![Eventstab](Screenshots/EventsTab.jpg)
|
||||||
|
![Configtab](Screenshots/ConfigTab.jpg)
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
# News
|
## Features ##
|
||||||
|
|
||||||
|
# News #
|
||||||
Currently supported:
|
Currently supported:
|
||||||
|
* Shows Posts from friends, selected group, favorited messages, public timeline, Direct Messages and notifications
|
||||||
* Shows Posts from friends, replies, Direct Messages and notifications (in swipe view), selected group, replies, favorited messages, public timeline
|
* Search button for news
|
||||||
* Background sync with configurable interval of 15 min to 2h for active user for friends timeline, replies and DMs (Android 5.1 required)
|
|
||||||
* Android notifications or Dbus notification (Linux) for new items in friends timeline, replies and DMs
|
|
||||||
* Search for news
|
|
||||||
* Click on hashtag in newsitem starts search for news with that word
|
* Click on hashtag in newsitem starts search for news with that word
|
||||||
* Only first photo attachment in post is shown, click for more images and fullscreen image
|
* Click on image shows image fullscreen
|
||||||
* Click on video shows video fullscreen
|
|
||||||
* For news containing urls ending with mp3, mp4, avi, webm, ogg or to a Peertube instance: media can be played in the app
|
* For news containing urls ending with mp3, mp4, avi, webm, ogg or to a Peertube instance: media can be played in the app
|
||||||
* Open links in external browser
|
* Open links in external browser
|
||||||
* Click on contact photo for contact details and last news
|
* Click on contact photo for contact details and last news
|
||||||
* Click on like text for additional contact info
|
* Click on like text for additional contact info
|
||||||
* Click on post text opens conversation
|
|
||||||
* Deletion, Reposting, Answering of Posts
|
* Deletion, Reposting, Answering of Posts
|
||||||
* Expand truncated news items
|
* Expand truncated news items
|
||||||
* Liking, disliking
|
* Liking, disliking, favoriting
|
||||||
* Attending for event posts
|
* Attending for event posts
|
||||||
* Update fetches new posts (up to last 50) since last in local DB
|
* Update fetches new posts (up to last 50) since last in local DB
|
||||||
* More shows older posts from local DB
|
* More shows older posts from local DB
|
||||||
* Create new Message with images or direct messages, smileys in new window
|
* Create new Message with images or direct messages, Contact/Group access rights (can be stored), smileys
|
||||||
* Send image(s) from Android gallery
|
* Send image from Android gallery
|
||||||
* Send text or urls from other apps to Friendiqa
|
* Send text or urls from other apps to Friendiqa
|
||||||
* Native Android image dialog
|
* Native Android image dialog
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
|
|
||||||
* Videos and other binary data as attachment (sending, not supported in API)
|
* Videos and other binary data as attachment (sending)
|
||||||
|
* More than one attachment (currently not supported in API)
|
||||||
* Attachments for Direct messages (currently not supported in API)
|
* Attachments for Direct messages (currently not supported in API)
|
||||||
|
|
||||||
# Friends
|
|
||||||
|
|
||||||
|
# Friends #
|
||||||
Currently supported:
|
Currently supported:
|
||||||
|
|
||||||
* Tabs for own profiles, friends, other contacts and groups
|
* Tabs for own profiles, friends, other contacts and groups
|
||||||
* Show profile(s) of user and change profile picture
|
* Show profile(s) of user and change profile picture
|
||||||
* List of all known contacts with locally downloaded pictures
|
* List of all known contacts with locally downloaded pictures
|
||||||
* Follow/unfollow or block/unblock contacts
|
|
||||||
* Search for new contacts according to topic
|
|
||||||
* Show follow requests; approve, deny, ignore requests
|
|
||||||
* Additional information, last messages and other functionality shown in news tab
|
* Additional information, last messages and other functionality shown in news tab
|
||||||
* Show public and private pictures of contact (screenscraping of contact's website, works only with certain theme)
|
* Send direct message, if contact is following
|
||||||
* Show public and private events of contact
|
* Show public and private (Friendica 3.6 required) pictures of contact (screenscraping of contact's website, works only with certain theme)
|
||||||
|
* Show public and private (Friendica 3.6 required) events of contact
|
||||||
* Show members of groups
|
* Show members of groups
|
||||||
* Open website of contact
|
* Open website of contact or connect page (for other contacts)
|
||||||
* Clean other contacts with no news
|
* Clean other contacts with no news
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
|
* More information for contact from description page, possibly private information for friends
|
||||||
|
(needs API change)
|
||||||
|
* Groups: create, change, delete
|
||||||
|
(needs API change)
|
||||||
|
|
||||||
* More information for contact from description page, possibly private information for friends (needs API change)
|
|
||||||
* Groups: create, change, delete (needs API change)
|
|
||||||
|
|
||||||
# Images
|
|
||||||
|
|
||||||
|
# Images #
|
||||||
Currently supported:
|
Currently supported:
|
||||||
|
* Download public and private own images to local directory
|
||||||
* Download public own images to local directory (API is currently broken)
|
* Upload picture to album with descriptions(public), send from gallery
|
||||||
* Upload public picture to album with descriptions, send from gallery (API is currently broken)
|
|
||||||
* Delete own pictures and albums on client and server
|
* Delete own pictures and albums on client and server
|
||||||
* Change name or album of existing picture
|
* Change name or album of existing picture
|
||||||
* Show albums in grid, show images in album in grid and fullscreen
|
* Show albums in grid, show images in album in grid and fullscreen
|
||||||
* Show public albums and images of contacts
|
* Show public and private (Friendica 3.6 server required) albums and images of contacts
|
||||||
* Pinch to zoom, swipe to scroll
|
* Pinch to zoom, swipe to scroll
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
|
|
||||||
* Upload private images
|
* Upload private images
|
||||||
|
|
||||||
# Events
|
|
||||||
|
|
||||||
Currently supported:
|
# Events #
|
||||||
|
* Download own public events
|
||||||
* Show own events
|
* Show public and private events of Friendica contacts (Friendica 3.6 server required)
|
||||||
* Show public events of Friendica contacts
|
|
||||||
* List view of events of selected date
|
* List view of events of selected date
|
||||||
* Click on event to show details
|
* Click on event to show details
|
||||||
* Create event
|
|
||||||
* Delete event
|
|
||||||
|
|
||||||
ToDo
|
ToDo
|
||||||
|
* Show own private events (needs API)
|
||||||
|
* Create events (needs API)
|
||||||
|
|
||||||
* Show more details and attendance of events (needs API)
|
|
||||||
|
|
||||||
# Config/Accounts
|
|
||||||
|
|
||||||
|
# Config #
|
||||||
Currently supported:
|
Currently supported:
|
||||||
|
|
||||||
* Multiple accounts
|
* Multiple accounts
|
||||||
* Dark Mode
|
|
||||||
* View mode for news (conversation tree or timeline)
|
|
||||||
* Maximum news (deleted after use of Quit button)
|
* Maximum news (deleted after use of Quit button)
|
||||||
* Set default news tabs
|
* View mode for news (tree or timeline)
|
||||||
* Sync home timeline, replies, DM, Events, friend requests; Notify yes/no
|
|
||||||
* Hide #nsfw
|
|
||||||
* OAuth2 as authorization method
|
|
||||||
|
|
||||||
# Other
|
|
||||||
|
|
||||||
* on Linux: syncs in background via systemd-timer
|
|
||||||
|
|
||||||
ToDo
|
ToDo
|
||||||
|
* OAuth?
|
||||||
|
|
||||||
|
|
||||||
|
# Other #
|
||||||
|
ToDo
|
||||||
* Video tab
|
* Video tab
|
||||||
* Translation
|
* Translation
|
||||||
* Blingbling
|
* Blingbling
|
||||||
|
|
||||||
# Translations
|
|
||||||
|
|
||||||
* German, Spanish, Italian, Hungarian, Dutch
|
# Translations #
|
||||||
* To contribute translations: <https://translate.codeberg.org/projects/friendiqa/friendiqa/>
|
* German, Spanish, Italian
|
||||||
|
* To contribute translations: Have a look at linux-sources/translations/friendiqa-de.ts and open it with an editor. It's an xml file. Change values and send me the file/do pull request.
|
||||||
|
|
||||||
# Install
|
# Install #
|
||||||
|
* F-Droid binary repository: [https://www.ma-nic.de/fdroid/repo](https://www.ma-nic.de/fdroid/repo) or for those who get the "error getting index file" from F-Droid client due to outdated crypto libraries the url without encryption: [http://www.ma-nic.de/fdroid/repo](http://www.ma-nic.de/fdroid/repo) To include repo in Fdroid: Open config --> package sources --> plus symbol --> paste url
|
||||||
* F-Droid binary repository: <https://www.ma-nic.de/fdroid/repo> or for those who get the "error getting index file" from F-Droid client due to outdated crypto libraries the url without encryption: <http://www.ma-nic.de/fdroid/repo> To include repo in Fdroid: Open config --> package sources --> plus symbol --> paste url
|
|
||||||
* [Google Playstore](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa)
|
* [Google Playstore](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa)
|
||||||
* Arch User Repository: <https://aur.archlinux.org/packages/friendiqa/>
|
|
||||||
* Flatpak: <https://friendiqa.ma-nic.de/friendiqa.flatpakref>
|
|
||||||
* Flatpak for Mobile Linux: <https://friendiqa.ma-nic.de/friendiqaMobile.flatpakref>
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
|
## License ##
|
||||||
Pubished under the [GPL v3](http://gplv3.fsf.org) with the exception of the Openssl library, which is published under OpenSSL License.
|
Pubished under the [GPL v3](http://gplv3.fsf.org) with the exception of the Openssl library, which is published under OpenSSL License.
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
@ -1,96 +0,0 @@
|
||||||
# TEMPLATE = app
|
|
||||||
# TARGET = friendiqa
|
|
||||||
# CONFIG += release
|
|
||||||
# QT += qml quick gui widgets sql webview dbus webengine
|
|
||||||
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(friendiqa VERSION 0.6 LANGUAGES CXX)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_AUTORCC ON)
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.7.0")
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Widgets Quick Sql DBus WebView REQUIRED)
|
|
||||||
|
|
||||||
#Webview Webengine
|
|
||||||
|
|
||||||
set(MOC_SOURCES common/uploadableimage.h
|
|
||||||
common/xhr.h
|
|
||||||
common/filesystem.h
|
|
||||||
common/remoteauthasyncimageprovider.h
|
|
||||||
common/updatenews.h
|
|
||||||
common/alarm.h)
|
|
||||||
|
|
||||||
set(SOURCES common/friendiqa.cpp
|
|
||||||
common/uploadableimage.cpp
|
|
||||||
common/xhr.cpp
|
|
||||||
common/filesystem.cpp
|
|
||||||
common/remoteauthasyncimageprovider.cpp
|
|
||||||
common/updatenews.cpp
|
|
||||||
common/alarmandroid.cpp)
|
|
||||||
|
|
||||||
include_directories(common)
|
|
||||||
|
|
||||||
add_executable(friendiqa ${SOURCES} ${MOC_SOURCES} application.qrc)
|
|
||||||
|
|
||||||
target_link_libraries(friendiqa Qt::Core)
|
|
||||||
target_link_libraries(friendiqa Qt::Widgets)
|
|
||||||
target_link_libraries(friendiqa Qt::Quick)
|
|
||||||
target_link_libraries(friendiqa Qt::Sql)
|
|
||||||
target_link_libraries(friendiqa Qt::WebView)
|
|
||||||
target_link_libraries(friendiqa Qt::DBus)
|
|
||||||
# target_link_libraries(friendiqa Qt::Webengine)
|
|
||||||
|
|
||||||
# qt5_use_modules(friendiqa Core Widgets Quick Sql DBus)
|
|
||||||
|
|
||||||
install(TARGETS friendiqa DESTINATION bin)
|
|
||||||
|
|
||||||
#RESOURCES = application.qrc
|
|
||||||
|
|
||||||
# OTHER_FILES += qml/friendiqa.qml \
|
|
||||||
# translations/*.ts \
|
|
||||||
# qml/*.qml
|
|
||||||
# qml/newsqml/*.qml
|
|
||||||
# qml/contactqml/*.qml
|
|
||||||
# qml/photoqml/*.qml
|
|
||||||
# qml/configqml/*.qml
|
|
||||||
# js/*.js
|
|
||||||
|
|
||||||
#TRANSLATIONS += translations/friendiqa-de.ts \
|
|
||||||
# translations/friendiqa-es.ts \
|
|
||||||
# translations/friendiqa-it.ts
|
|
||||||
# HEADERS += \
|
|
||||||
# common/uploadableimage.h \
|
|
||||||
# common/xhr.h \
|
|
||||||
# common/filesystem.h \
|
|
||||||
# common/remoteauthasyncimageprovider.h \
|
|
||||||
# common/updatenews.h \
|
|
||||||
# common/alarm.h
|
|
||||||
|
|
||||||
#DISTFILES += \
|
|
||||||
# qml/calendarqml/*.qml \
|
|
||||||
# translations/*.ts \
|
|
||||||
# translations/*.qm \
|
|
||||||
# qml/*.qml \
|
|
||||||
# qml/newsqml/*.qml \
|
|
||||||
# qml/contactqml/*.qml \
|
|
||||||
# qml/photoqml/*.qml \
|
|
||||||
# qml/configqml/*.qml \
|
|
||||||
# js/*.js \
|
|
||||||
|
|
||||||
|
|
||||||
# target.path=/usr/bin
|
|
||||||
# desktop.path = /usr/share/applications
|
|
||||||
# desktop.files = images/de.ma-nic.Friendiqa.desktop
|
|
||||||
# icon.path = /usr/share/icons/hicolor/scalable/apps
|
|
||||||
# icon.files = images/Friendiqa.svg
|
|
||||||
# INSTALLS+=target desktop icon
|
|
|
@ -1,20 +1,7 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.8" android:versionCode="34" android:installLocation="auto">
|
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3.4" android:versionCode="11" android:installLocation="auto">
|
||||||
<!--<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="33"/> -->
|
<application android:hardwareAccelerated="true" android:vmSafeMode="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Friendiqa" android:icon="@drawable/friendiqa" android:logo="@drawable/friendiqa" android:theme="@android:style/Theme.Holo.Light">
|
||||||
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
|
||||||
|
|
||||||
<application android:hardwareAccelerated="true"
|
|
||||||
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
|
||||||
android:label="Friendiqa"
|
|
||||||
android:extractNativeLibs="true"
|
|
||||||
android:requestLegacyExternalStorage="true"
|
|
||||||
android:icon="@drawable/friendiqa"
|
|
||||||
android:theme="@android:style/Theme.Holo.Light"
|
|
||||||
android:logo="@drawable/friendiqa">
|
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
|
|
||||||
android:name="androidnative.friendiqa.FriendiqaActivity"
|
|
||||||
android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleTask" android:taskAffinity="" android:exported="true">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
@ -30,10 +17,6 @@
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
<data android:mimeType="text/*"/>
|
<data android:mimeType="text/*"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<!-- Application arguments -->
|
|
||||||
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
|
|
||||||
<!-- Application arguments -->
|
|
||||||
|
|
||||||
<meta-data android:name="android.app.lib_name" android:value="friendiqa"/>
|
<meta-data android:name="android.app.lib_name" android:value="friendiqa"/>
|
||||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||||
|
@ -41,33 +24,22 @@
|
||||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||||
<!-- Deploy Qt libs as part of package -->
|
<!-- Deploy Qt libs as part of package -->
|
||||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||||
<!-- Run with local libs -->
|
<!-- Run with local libs -->
|
||||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||||
<meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
|
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||||
<!-- Used to specify custom system library path to run with local system libs -->
|
|
||||||
<!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
|
|
||||||
<!-- Messages maps -->
|
<!-- Messages maps -->
|
||||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||||
<meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
|
|
||||||
<!-- Messages maps -->
|
<!-- Messages maps -->
|
||||||
|
|
||||||
<!-- Splash screen -->
|
|
||||||
<!-- Orientation-specific (portrait/landscape) data is checked first. If not available for current orientation,
|
|
||||||
then android.app.splash_screen_drawable. For best results, use together with splash_screen_sticky and
|
|
||||||
use hideSplashScreen() with a fade-out animation from Qt Android Extras to hide the splash screen when you
|
|
||||||
are done populating your window with content. -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/logo_portrait" / -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/logo_landscape" / -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
|
|
||||||
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
|
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
|
||||||
<!-- Splash screen -->
|
|
||||||
|
|
||||||
<!-- Background running -->
|
<!-- Background running -->
|
||||||
<!-- Warning: changing this value to true may cause unexpected crashes if the
|
<!-- Warning: changing this value to true may cause unexpected crashes if the
|
||||||
|
@ -76,65 +48,18 @@
|
||||||
signal is sent! -->
|
signal is sent! -->
|
||||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
<meta-data android:name="android.app.background_running" android:value="false"/>
|
||||||
<!-- Background running -->
|
<!-- Background running -->
|
||||||
|
|
||||||
<!-- auto screen scale factor -->
|
|
||||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
|
||||||
<!-- auto screen scale factor -->
|
|
||||||
|
|
||||||
<!-- extract android style -->
|
|
||||||
<!-- available android:values :
|
|
||||||
* default - In most cases this will be the same as "full", but it can also be something else if needed, e.g., for compatibility reasons
|
|
||||||
* full - useful QWidget & Quick Controls 1 apps
|
|
||||||
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
|
|
||||||
* none - useful for apps that don't use any of the above Qt modules
|
|
||||||
-->
|
|
||||||
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/>
|
|
||||||
<!-- extract android style -->
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
|
||||||
<service android:name="androidnative.friendiqa.FriendiqaService" android:permission="android.permission.BIND_JOB_SERVICE">
|
|
||||||
<meta-data android:name="android.app.background_running" android:value="true"/>
|
|
||||||
</service>
|
|
||||||
<service android:process=":qt" android:name="androidnative.AndroidNativeService">
|
|
||||||
<meta-data android:name="android.app.background_running" android:value="true"/>
|
|
||||||
<meta-data android:name="android.app.arguments" android:value="-service"/>
|
|
||||||
<meta-data android:name="android.app.lib_name" android:value="friendiqa"/>
|
|
||||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
|
||||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
|
||||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
|
||||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
|
||||||
|
|
||||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
|
||||||
<!--
|
|
||||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
|
||||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
|
||||||
-->
|
|
||||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
|
||||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
|
||||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
|
||||||
<meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
|
|
||||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
|
||||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
|
||||||
|
|
||||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
|
||||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
|
||||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
|
||||||
|
|
||||||
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
|
|
||||||
</service>
|
|
||||||
|
|
||||||
<service android:process=":qt" android:name="androidnative.friendiqa.FriendiqaStopService" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true">
|
|
||||||
<meta-data android:name="android.app.background_running" android:value="true"/>
|
|
||||||
</service>
|
|
||||||
</application>
|
</application>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="26"/>
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
Remove the comment if you do not require these default permissions. -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<!-- %%INSERT_PERMISSIONS -->
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||||
|
Remove the comment if you do not require these default features. -->
|
||||||
|
<!-- %%INSERT_FEATURES -->
|
||||||
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,31 +1,23 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:4.1.0"
|
classpath 'com.android.tools.build:gradle:1.1.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
|
||||||
jcenter()
|
jcenter()
|
||||||
maven {
|
|
||||||
url "https://maven.google.com"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'androidx.appcompat:appcompat:1.4.2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -44,21 +36,15 @@ android {
|
||||||
|
|
||||||
compileSdkVersion androidCompileSdkVersion.toInteger()
|
compileSdkVersion androidCompileSdkVersion.toInteger()
|
||||||
|
|
||||||
buildToolsVersion '31.0.0'
|
buildToolsVersion androidBuildToolsVersion
|
||||||
compileSdkVersion 33
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdkVersion 26
|
|
||||||
targetSdkVersion 31
|
|
||||||
resConfigs "en"
|
|
||||||
}
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
|
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
|
||||||
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
|
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
|
||||||
res.srcDirs = [qt5AndroidDir + '/res', 'res']
|
res.srcDirs = [qt5AndroidDir + '/res', 'res']
|
||||||
resources.srcDirs = ['resources']
|
resources.srcDirs = ['src']
|
||||||
renderscript.srcDirs = ['src']
|
renderscript.srcDirs = ['src']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
jniLibs.srcDirs = ['libs']
|
jniLibs.srcDirs = ['libs']
|
||||||
|
@ -68,11 +54,6 @@ android {
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not compress Qt binary resources file
|
|
||||||
aaptOptions {
|
|
||||||
noCompress 'rcc'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
apply from: "androidnative.gradle"
|
apply from: "androidnative.gradle"
|
||||||
setAndroidNativePath("/../androidnative.pri");
|
setAndroidNativePath("/../androidnative.pri");
|
|
@ -1,4 +0,0 @@
|
||||||
buildDir=.build
|
|
||||||
android.useAndroidX=true
|
|
||||||
android.enableJetifier=true
|
|
||||||
android.enforceUniquePackageName=false
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
#Wed Apr 10 15:27:10 PDT 2013
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
||||||
|
|
74
source-android/android/gradlew
vendored
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
|
@ -6,30 +6,12 @@
|
||||||
##
|
##
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# Resolve links: $0 may be a link
|
DEFAULT_JVM_OPTS=""
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
@ -48,7 +30,6 @@ die () {
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
|
||||||
case "`uname`" in
|
case "`uname`" in
|
||||||
CYGWIN* )
|
CYGWIN* )
|
||||||
cygwin=true
|
cygwin=true
|
||||||
|
@ -59,11 +40,31 @@ case "`uname`" in
|
||||||
MINGW* )
|
MINGW* )
|
||||||
msys=true
|
msys=true
|
||||||
;;
|
;;
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >&-
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >&-
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
|
@ -89,7 +90,7 @@ location of your Java installation."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
@ -113,7 +114,6 @@ fi
|
||||||
if $cygwin ; then
|
if $cygwin ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
@ -154,19 +154,11 @@ if $cygwin ; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
save () {
|
function splitJvmOpts() {
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
JVM_OPTS=("$@")
|
||||||
echo " "
|
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
||||||
|
|
14
source-android/android/gradlew.bat
vendored
|
@ -8,14 +8,14 @@
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS=
|
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
@ -46,9 +46,10 @@ echo location of your Java installation.
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
:init
|
||||||
@rem Get command-line arguments, handling Windows variants
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
:win9xME_args
|
:win9xME_args
|
||||||
@rem Slurp the command line arguments.
|
@rem Slurp the command line arguments.
|
||||||
|
@ -59,6 +60,11 @@ set _SKIP=2
|
||||||
if "x%~1" == "x" goto execute
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
BIN
source-android/android/libcrypto.so
Executable file
BIN
source-android/android/libssl.so
Executable file
Before Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 718 B |
Before Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 892 B |
|
@ -1,7 +1,7 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<resources>
|
<resources>
|
||||||
<array name="qt_sources">
|
<array name="qt_sources">
|
||||||
<item>https://download.qt.io/ministro/android/qt5/qt-5.14</item>
|
<item>https://download.qt.io/ministro/android/qt5/qt-5.8</item>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<!-- The following is handled automatically by the deployment tool. It should
|
<!-- The following is handled automatically by the deployment tool. It should
|
||||||
|
@ -15,8 +15,11 @@
|
||||||
<!-- %%INSERT_QT_LIBS%% -->
|
<!-- %%INSERT_QT_LIBS%% -->
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<array name="load_local_libs">
|
<array name="bundled_in_lib">
|
||||||
<!-- %%INSERT_LOCAL_LIBS%% -->
|
<!-- %%INSERT_BUNDLED_IN_LIB%% -->
|
||||||
|
</array>
|
||||||
|
<array name="bundled_in_assets">
|
||||||
|
<!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package androidnative.friendiqa;
|
package androidnative.example;
|
||||||
import androidnative.SystemDispatcher;
|
import androidnative.SystemDispatcher;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
|
@ -10,7 +10,7 @@ import android.content.Context;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.qtproject.qt5.android.QtNative;
|
import org.qtproject.qt5.android.QtNative;
|
||||||
|
|
||||||
public class FriendiqaNotifierService {
|
public class ExampleService {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -2,6 +2,10 @@ package androidnative.friendiqa;
|
||||||
|
|
||||||
import androidnative.AndroidNativeActivity;
|
import androidnative.AndroidNativeActivity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class FriendiqaActivity extends AndroidNativeActivity {
|
public class FriendiqaActivity extends AndroidNativeActivity {
|
||||||
public FriendiqaActivity() {
|
public FriendiqaActivity() {
|
||||||
super();
|
super();
|
||||||
|
@ -9,4 +13,8 @@ public class FriendiqaActivity extends AndroidNativeActivity {
|
||||||
QT_ANDROID_THEMES = new String[] {""};
|
QT_ANDROID_THEMES = new String[] {""};
|
||||||
QT_ANDROID_DEFAULT_THEME = "";
|
QT_ANDROID_DEFAULT_THEME = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
package androidnative.friendiqa;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.app.job.JobService;
|
|
||||||
import android.app.job.JobParameters;
|
|
||||||
import androidnative.AndroidNativeService;
|
|
||||||
import org.qtproject.qt5.android.bindings.QtService;
|
|
||||||
import org.qtproject.qt5.android.QtNative;
|
|
||||||
//import androidnative.friendiqa.FriendiqaQtService;
|
|
||||||
|
|
||||||
public class FriendiqaService extends JobService{
|
|
||||||
private static String TAG = "FriendiqaService";
|
|
||||||
//Log.e(TAG,"Service");
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onStartJob(JobParameters params) {
|
|
||||||
Log.d(TAG,"Friendiqa JobService");
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
AndroidNativeService fs = new AndroidNativeService();
|
|
||||||
fs.startQtService(context);
|
|
||||||
jobFinished(params,false);
|
|
||||||
//Intent serviceIntent = new Intent(this, AndroidNativeService.class);
|
|
||||||
//startService(serviceIntent);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onStopJob(JobParameters params) {
|
|
||||||
// whether or not you would like JobScheduler to automatically retry your failed job.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
package androidnative.friendiqa;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.app.job.JobService;
|
|
||||||
import android.app.job.JobParameters;
|
|
||||||
import androidnative.AndroidNativeService;
|
|
||||||
import org.qtproject.qt5.android.bindings.QtService;
|
|
||||||
import org.qtproject.qt5.android.QtNative;
|
|
||||||
//import androidnative.friendiqa.FriendiqaQtService;
|
|
||||||
|
|
||||||
public class FriendiqaStopService extends JobService{
|
|
||||||
private static String TAG = "AndroidNative";
|
|
||||||
//Log.e(TAG,"Service");
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onStartJob(JobParameters params) {
|
|
||||||
Log.d(TAG,"Friendiqa JobServiceStop");
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
AndroidNativeService fs = new AndroidNativeService();
|
|
||||||
fs.stopQtService(context);
|
|
||||||
jobFinished(params,false);
|
|
||||||
//Intent serviceIntent = new Intent(this, AndroidNativeService.class);
|
|
||||||
//startService(serviceIntent);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onStopJob(JobParameters params) {
|
|
||||||
// whether or not you would like JobScheduler to automatically retry your failed job.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean onUnbind(Intent intent) {
|
|
||||||
stopSelf();
|
|
||||||
return super.onUnbind(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import "./theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
objectName: "ComponentPage";
|
||||||
|
|
||||||
|
property var pages: [
|
||||||
|
{
|
||||||
|
name: "Image Picker",
|
||||||
|
demo: "imagePicker/ImagePickerDemo.qml",
|
||||||
|
description: "Pick photo via Java language binding"
|
||||||
|
},{
|
||||||
|
name: "Toast",
|
||||||
|
demo: "toast/ToastDemo.qml",
|
||||||
|
description: "Toast Demonstration"
|
||||||
|
},{
|
||||||
|
name: "Notification",
|
||||||
|
demo: "notification/NotificationDemo.qml",
|
||||||
|
description: "Demonstrate how to use SystemDispatcher to send notification"
|
||||||
|
},{
|
||||||
|
name: "Information",
|
||||||
|
demo: "info/InfoDemo.qml",
|
||||||
|
description: "Android System Information"
|
||||||
|
},{
|
||||||
|
name: "Status Bar",
|
||||||
|
demo: "statusbar/StatusBarDemo.qml",
|
||||||
|
description: "Config Status Bar"
|
||||||
|
}
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id : actionBar
|
||||||
|
iconSource: A.drawable("ic_menu",Constants.black87)
|
||||||
|
title: "AndroidNative Component List"
|
||||||
|
showIcon: false
|
||||||
|
actionButtonEnabled: false
|
||||||
|
}
|
||||||
|
|
||||||
|
VisualDataModel {
|
||||||
|
id: visualDataModel
|
||||||
|
delegate: ListItem {
|
||||||
|
title: modelData.name
|
||||||
|
subtitle: modelData.description
|
||||||
|
onClicked: {
|
||||||
|
present(Qt.resolvedUrl(modelData.demo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
model: pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
model : visualDataModel
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
AndroidNative Example Program
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Prerequisites
|
||||||
|
-------------
|
||||||
|
|
||||||
|
* Qt Android SDK >= 5.6
|
||||||
|
* Android SDK
|
||||||
|
|
||||||
|
Check this article for how to setup Qt and Android SDK:
|
||||||
|
|
||||||
|
[Getting Started with Qt for Android](http://qt-project.org/doc/qt-5/androidgs.html)
|
||||||
|
|
||||||
|
Build Instruction
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
1. Run `qpm install` to get required packages
|
||||||
|
1. Open androidnativeexample.pro by Qt Creator
|
||||||
|
1. Press the "Projects" tab. Make sure the "Android for xxx" kit has been selected
|
||||||
|
1. Plug a Android device to your computer
|
||||||
|
1. Press "Build" -> "Run"
|
||||||
|
1. The program will be deployed to your device. It is so easy!
|
||||||
|
|
||||||
|
![Screenshot](https://raw.githubusercontent.com/benlau/androidnative.pri/master/docs/screenshots/example1.png)
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<manifest package="androidnative.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
|
||||||
|
<application android:hardwareAccelerated="true"
|
||||||
|
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
|
android:label="Android Native Example" android:icon="@drawable/icon">
|
||||||
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||||
|
android:name="androidnative.example.ExampleActivity"
|
||||||
|
android:label="Android Native Example"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
|
android:launchMode="singleTop">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="androidnativeexample"/>
|
||||||
|
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||||
|
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||||
|
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||||
|
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||||
|
<!-- Deploy Qt libs as part of package -->
|
||||||
|
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="1"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||||
|
<!-- Run with local libs -->
|
||||||
|
<meta-data android:name="android.app.use_local_qt_libs" android:value="1"/>
|
||||||
|
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||||
|
<meta-data android:name="android.app.load_local_libs" android:value="plugins/platforms/android/libqtforandroid.so:lib/libQt5QuickParticles.so"/>
|
||||||
|
<meta-data android:name="android.app.load_local_jars" android:value="jar/QtAndroid.jar:jar/QtAndroidAccessibility.jar:jar/QtAndroid-bundled.jar:jar/QtAndroidAccessibility-bundled.jar"/>
|
||||||
|
<meta-data android:name="android.app.static_init_classes" android:value=""/>
|
||||||
|
<!-- Messages maps -->
|
||||||
|
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||||
|
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||||
|
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||||
|
<!-- Messages maps -->
|
||||||
|
|
||||||
|
<!-- Splash screen -->
|
||||||
|
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
|
||||||
|
<!-- Splash screen -->
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="21"/>
|
||||||
|
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||||
|
|
||||||
|
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||||
|
Remove the comment if you do not require these default permissions. -->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||||
|
Remove the comment if you do not require these default features. -->
|
||||||
|
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
|
||||||
|
|
||||||
|
</manifest>
|
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
// Obtain androidPackageSourceDir
|
||||||
|
// androidPackageSourceDir is the absolute path of the folder containing build.gradle and AndroidManifests.xml
|
||||||
|
// This code also works with androiddeployqt.
|
||||||
|
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
|
String getAndroidPackageSourceDir() {
|
||||||
|
String res = System.getProperty("user.dir");
|
||||||
|
|
||||||
|
FileTree tree = fileTree(dir: res + "/..").include("android*deployment-settings.json");
|
||||||
|
|
||||||
|
if (tree.getFiles().size() > 0) {
|
||||||
|
def inputFile = tree.getFiles().toArray()[0];
|
||||||
|
def InputJSON = new JsonSlurper().parseText(inputFile.text);
|
||||||
|
res = InputJSON["android-package-source-directory"]
|
||||||
|
} else {
|
||||||
|
println("android*deployment-settings.json not found. Set androidPackageSourceDir to user.dir");
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
String setAndroidNativePath(String path) {
|
||||||
|
String androidPackageSourceDir = getAndroidPackageSourceDir();
|
||||||
|
String androidNativePath = androidPackageSourceDir + path + "/java/src";
|
||||||
|
LinkedHashSet hash = android.sourceSets.main.java.srcDirs;
|
||||||
|
hash.add(androidNativePath);
|
||||||
|
android.sourceSets.main.java.srcDirs = hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
setAndroidNativePath = this.&setAndroidNativePath;
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:1.3.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
/*******************************************************
|
||||||
|
* The following variables:
|
||||||
|
* - androidBuildToolsVersion,
|
||||||
|
* - androidCompileSdkVersion
|
||||||
|
* - qt5AndroidDir - holds the path to qt android files
|
||||||
|
* needed to build any Qt application
|
||||||
|
* on Android.
|
||||||
|
*
|
||||||
|
* are defined in gradle.properties file. This file is
|
||||||
|
* updated by QtCreator and androiddeployqt tools.
|
||||||
|
* Changing them manually might break the compilation!
|
||||||
|
*******************************************************/
|
||||||
|
|
||||||
|
compileSdkVersion androidCompileSdkVersion.toInteger()
|
||||||
|
|
||||||
|
buildToolsVersion androidBuildToolsVersion
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
|
||||||
|
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
|
||||||
|
res.srcDirs = [qt5AndroidDir + '/res', 'res']
|
||||||
|
resources.srcDirs = ['src']
|
||||||
|
renderscript.srcDirs = ['src']
|
||||||
|
assets.srcDirs = ['assets']
|
||||||
|
jniLibs.srcDirs = ['libs']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lintOptions {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "androidnative.gradle"
|
||||||
|
setAndroidNativePath("/../../..");
|
|
@ -0,0 +1,9 @@
|
||||||
|
## This file is automatically generated by QtCreator.
|
||||||
|
#
|
||||||
|
# This file must *NOT* be checked into Version Control Systems,
|
||||||
|
# as it contains information specific to your local configuration.
|
||||||
|
|
||||||
|
androidBuildToolsVersion=25.0.3
|
||||||
|
androidCompileSdkVersion=25
|
||||||
|
buildDir=.build
|
||||||
|
qt5AndroidDir=/home/pankraz/Qt/5.9.1/android_armv7/src/android/java
|
|
@ -0,0 +1,6 @@
|
||||||
|
#Thu Feb 16 01:04:18 HKT 2017
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
|
160
source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew
vendored
Normal file
|
@ -0,0 +1,160 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
90
source-android/androidnative.pri/examples/androidnativeexample/android-sources/gradlew.bat
vendored
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
|
@ -0,0 +1,6 @@
|
||||||
|
## This file is automatically generated by QtCreator.
|
||||||
|
#
|
||||||
|
# This file must *NOT* be checked into Version Control Systems,
|
||||||
|
# as it contains information specific to your local configuration.
|
||||||
|
|
||||||
|
sdk.dir=/home/pankraz/android-sdk_alt
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<solid android:color="#FFFFFFFF"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<bitmap android:src="@drawable/icon"
|
||||||
|
android:gravity="center" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
|
||||||
|
<item name="android:windowBackground">@drawable/splash</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<resources>
|
||||||
|
<array name="qt_sources">
|
||||||
|
<item>https://download.qt-project.org/ministro/android/qt5/qt-5.4</item>
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<!-- The following is handled automatically by the deployment tool. It should
|
||||||
|
not be edited manually. -->
|
||||||
|
|
||||||
|
<array name="bundled_libs">
|
||||||
|
<!-- %%INSERT_EXTRA_LIBS%% -->
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<array name="qt_libs">
|
||||||
|
<!-- %%INSERT_QT_LIBS%% -->
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<array name="bundled_in_lib">
|
||||||
|
<!-- %%INSERT_BUNDLED_IN_LIB%% -->
|
||||||
|
</array>
|
||||||
|
<array name="bundled_in_assets">
|
||||||
|
<!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
|
||||||
|
</array>
|
||||||
|
|
||||||
|
</resources>
|
|
@ -0,0 +1,16 @@
|
||||||
|
package androidnative.example;
|
||||||
|
|
||||||
|
import androidnative.AndroidNativeActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by benlau on 8/3/2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ExampleActivity extends AndroidNativeActivity {
|
||||||
|
public ExampleActivity() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
QT_ANDROID_THEMES = new String[] {""};
|
||||||
|
QT_ANDROID_DEFAULT_THEME = "";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package androidnative.example;
|
||||||
|
import androidnative.SystemDispatcher;
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.content.Context;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.qtproject.qt5.android.QtNative;
|
||||||
|
|
||||||
|
public class ExampleService {
|
||||||
|
|
||||||
|
static {
|
||||||
|
|
||||||
|
SystemDispatcher.addListener(new SystemDispatcher.Listener() {
|
||||||
|
|
||||||
|
NotificationManager m_notificationManager;
|
||||||
|
Notification.Builder m_builder;
|
||||||
|
|
||||||
|
private void notificationManagerNotify(Map data) {
|
||||||
|
|
||||||
|
final Activity activity = QtNative.activity();
|
||||||
|
final Map messageData = data;
|
||||||
|
|
||||||
|
Runnable runnable = new Runnable () {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String title = (String) messageData.get("title");
|
||||||
|
|
||||||
|
String message = (String) messageData.get("message");
|
||||||
|
|
||||||
|
if (m_notificationManager == null) {
|
||||||
|
m_notificationManager = (NotificationManager) activity.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
m_builder = new Notification.Builder(activity);
|
||||||
|
|
||||||
|
// Small Icon is a must to make notification works.
|
||||||
|
// And that is why you need to inherit QtActivity
|
||||||
|
m_builder.setSmallIcon(R.drawable.icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_builder.setContentTitle(title);
|
||||||
|
m_builder.setContentText(message);
|
||||||
|
m_notificationManager.notify(1, m_builder.build());
|
||||||
|
|
||||||
|
// Test function. Remove it later.
|
||||||
|
SystemDispatcher.dispatch("Notifier.notifyFinished");
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("",e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
activity.runOnUiThread(runnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hapticFeedbackPerform(Map data) {
|
||||||
|
|
||||||
|
final Activity activity = QtNative.activity();
|
||||||
|
final Map messageData = data;
|
||||||
|
Runnable runnable = new Runnable () {
|
||||||
|
public void run() {
|
||||||
|
int feedbackConstant = (Integer) messageData.get("feedbackConstant");
|
||||||
|
int flags = (Integer) messageData.get("flags");
|
||||||
|
|
||||||
|
Log.d("",String.format("hapticFeedbackPerform(%d,%d)",feedbackConstant,flags));
|
||||||
|
|
||||||
|
View rootView = activity.getWindow().getDecorView().getRootView();
|
||||||
|
rootView.performHapticFeedback(feedbackConstant, flags);
|
||||||
|
|
||||||
|
// Test function. Remove it later.
|
||||||
|
SystemDispatcher.dispatch("hapticFeedbackPerformFinished");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
activity.runOnUiThread(runnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDispatched(String name , Map data) {
|
||||||
|
|
||||||
|
if (name.equals("Notifier.notify")) {
|
||||||
|
notificationManagerNotify(data);
|
||||||
|
return;
|
||||||
|
} else if (name.equals("hapticFeedbackPerform")) {
|
||||||
|
hapticFeedbackPerform(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
TEMPLATE = app
|
||||||
|
|
||||||
|
QT += qml quick
|
||||||
|
|
||||||
|
SOURCES += main.cpp \
|
||||||
|
debugwrapper.cpp
|
||||||
|
|
||||||
|
RESOURCES += qml.qrc
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
|
QML_IMPORT_PATH += ../..
|
||||||
|
|
||||||
|
android {
|
||||||
|
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
|
||||||
|
}
|
||||||
|
|
||||||
|
# include(vendor/vendor.pri)
|
||||||
|
# Default rules for deployment.
|
||||||
|
include(deployment.pri)
|
||||||
|
include(../../androidnative.pri)
|
||||||
|
include(../../../../../../quickandroid/quickandroid.pri)
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
android-sources/AndroidManifest.xml \
|
||||||
|
android-sources/src/quickandroid/example/ExampleService.java \
|
||||||
|
README.md \
|
||||||
|
android-sources/gradle/wrapper/gradle-wrapper.jar \
|
||||||
|
android-sources/gradlew \
|
||||||
|
android-sources/res/values/libs.xml \
|
||||||
|
android-sources/build.gradle \
|
||||||
|
android-sources/gradle/wrapper/gradle-wrapper.properties \
|
||||||
|
android-sources/gradlew.bat \
|
||||||
|
android-sources/settings.gradle \
|
||||||
|
android-sources/src/androidnative/example/ExampleService.java
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
../../README.md \
|
||||||
|
debugwrapper.h
|
|
@ -0,0 +1,392 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE QtCreatorProject>
|
||||||
|
<!-- Written by QtCreator 4.4.0, 2017-10-23T22:04:08. -->
|
||||||
|
<qtcreator>
|
||||||
|
<data>
|
||||||
|
<variable>EnvironmentId</variable>
|
||||||
|
<value type="QByteArray">{8825bc46-5cad-4a59-be78-bf9eeaa7217a}</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
<value type="int">0</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||||
|
<value type="QString" key="language">Cpp</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||||
|
<value type="QString" key="language">QmlJS</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||||
|
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||||
|
<valuemap type="QVariantMap"/>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Android</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{8e3757e7-5698-4d0f-9f13-55359b1a832e}</value>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/pankraz/build/debug</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||||
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Anwendungsdaten kopieren</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidPackageInstallationStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.3">
|
||||||
|
<value type="QString" key="BuildTargetSdk">android-25</value>
|
||||||
|
<value type="QString" key="KeystoreLocation"></value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android-APK erstellen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.AndroidBuildApkStep</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction">2</value>
|
||||||
|
<value type="bool" key="UseGradle">true</value>
|
||||||
|
<value type="bool" key="VerboseOutput">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">4</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/build-androidnativeexample-Android-Release</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
||||||
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Anwendungsdaten kopieren</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidPackageInstallationStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.3">
|
||||||
|
<value type="QString" key="BuildTargetSdk">android-25</value>
|
||||||
|
<value type="QString" key="KeystoreLocation"></value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android-APK erstellen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.AndroidBuildApkStep</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction">2</value>
|
||||||
|
<value type="bool" key="UseGradle">true</value>
|
||||||
|
<value type="bool" key="VerboseOutput">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">4</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/build-androidnativeexample-Android-Profile</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||||
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Anwendungsdaten kopieren</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidPackageInstallationStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.3">
|
||||||
|
<value type="QString" key="BuildTargetSdk">android-25</value>
|
||||||
|
<value type="QString" key="KeystoreLocation"></value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android-APK erstellen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.AndroidBuildApkStep</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction">2</value>
|
||||||
|
<value type="bool" key="UseGradle">true</value>
|
||||||
|
<value type="bool" key="VerboseOutput">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">4</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment auf Android-Gerät</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployQtStep</value>
|
||||||
|
<value type="bool" key="UninstallPreviousPackage">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment auf Android-Gerät</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deployment auf Android-Gerät</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployConfiguration2</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings">
|
||||||
|
<value type="QString" key="AndroidDeviceSerialNumber">CB5A22HSB9</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||||
|
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||||
|
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||||
|
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||||
|
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||||
|
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||||
|
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||||
|
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||||
|
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||||
|
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||||
|
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||||
|
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||||
|
<value type="int">0</value>
|
||||||
|
<value type="int">1</value>
|
||||||
|
<value type="int">2</value>
|
||||||
|
<value type="int">3</value>
|
||||||
|
<value type="int">4</value>
|
||||||
|
<value type="int">5</value>
|
||||||
|
<value type="int">6</value>
|
||||||
|
<value type="int">7</value>
|
||||||
|
<value type="int">8</value>
|
||||||
|
<value type="int">9</value>
|
||||||
|
<value type="int">10</value>
|
||||||
|
<value type="int">11</value>
|
||||||
|
<value type="int">12</value>
|
||||||
|
<value type="int">13</value>
|
||||||
|
<value type="int">14</value>
|
||||||
|
</valuelist>
|
||||||
|
<valuelist type="QVariantList" key="Android.AmStartArgsKey"/>
|
||||||
|
<valuelist type="QVariantList" key="Android.PostFinishShellCmdListKey"/>
|
||||||
|
<valuelist type="QVariantList" key="Android.PreStartShellCmdListKey"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">androidnativeexample</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidRunConfiguration:/home/pankraz/ownCloud/clientsync/Friendiqa/v0.005/source-android/androidnative.pri/examples/androidnativeexample/androidnativeexample.pro</value>
|
||||||
|
<value type="QString" key="QMakeProjectManager.QmakeAndroidRunConfiguration.ProFile">androidnativeexample.pro</value>
|
||||||
|
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||||
|
<value type="int">1</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||||
|
<value type="int">18</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>Version</variable>
|
||||||
|
<value type="int">18</value>
|
||||||
|
</data>
|
||||||
|
</qtcreator>
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include "debugwrapper.h"
|
||||||
|
#include "AndroidNative/debug.h"
|
||||||
|
|
||||||
|
DebugWrapper::DebugWrapper(QObject *parent) : QObject(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
long DebugWrapper::getNativeHeapSize() const
|
||||||
|
{
|
||||||
|
return AndroidNative::Debug::getNativeHeapSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
long DebugWrapper::getNativeHeapAllocatedSize() const
|
||||||
|
{
|
||||||
|
return AndroidNative::Debug::getNativeHeapAllocatedSize();
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef DEBUGWRAPPER_H
|
||||||
|
#define DEBUGWRAPPER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class DebugWrapper : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit DebugWrapper(QObject *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
long getNativeHeapSize() const;
|
||||||
|
|
||||||
|
long getNativeHeapAllocatedSize() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DEBUGWRAPPER_H
|
|
@ -0,0 +1,27 @@
|
||||||
|
android-no-sdk {
|
||||||
|
target.path = /data/user/qt
|
||||||
|
export(target.path)
|
||||||
|
INSTALLS += target
|
||||||
|
} else:android {
|
||||||
|
x86 {
|
||||||
|
target.path = /libs/x86
|
||||||
|
} else: armeabi-v7a {
|
||||||
|
target.path = /libs/armeabi-v7a
|
||||||
|
} else {
|
||||||
|
target.path = /libs/armeabi
|
||||||
|
}
|
||||||
|
export(target.path)
|
||||||
|
INSTALLS += target
|
||||||
|
} else:unix {
|
||||||
|
isEmpty(target.path) {
|
||||||
|
qnx {
|
||||||
|
target.path = /tmp/$${TARGET}/bin
|
||||||
|
} else {
|
||||||
|
target.path = /opt/$${TARGET}/bin
|
||||||
|
}
|
||||||
|
export(target.path)
|
||||||
|
}
|
||||||
|
INSTALLS += target
|
||||||
|
}
|
||||||
|
|
||||||
|
export(INSTALLS)
|
|
@ -0,0 +1,38 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id: actionBar
|
||||||
|
upEnabled: true
|
||||||
|
title: qsTr("Dialog Demo")
|
||||||
|
showTitle: true
|
||||||
|
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
z: 10
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: label
|
||||||
|
text : "Press to launch dialog"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
onClicked: {
|
||||||
|
dialog.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: dialog
|
||||||
|
anchors.centerIn: parent
|
||||||
|
title: "Dialog"
|
||||||
|
Text {
|
||||||
|
text: "Demo"
|
||||||
|
}
|
||||||
|
z: 20
|
||||||
|
|
||||||
|
acceptButtonText: "OK"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import AndroidNative 1.0 as AN
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
id: demo
|
||||||
|
actionBar: ActionBar {
|
||||||
|
title: "Image Picker Demo"
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
}
|
||||||
|
|
||||||
|
AN.ImagePicker {
|
||||||
|
id: imagePicker;
|
||||||
|
multiple : true
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Constants.black100
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: image
|
||||||
|
anchors.fill: parent
|
||||||
|
source: imagePicker.imageUrl
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
visible: imagePicker.imageUrls.length <= 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Grid {
|
||||||
|
columns: 3
|
||||||
|
spacing: 0
|
||||||
|
visible: !image.visible
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: imagePicker.imageUrls
|
||||||
|
delegate: Image {
|
||||||
|
width: demo.width / 3
|
||||||
|
height: width / 4 * 3
|
||||||
|
source: modelData
|
||||||
|
asynchronous: true
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 16 * A.dp
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 32 * A.dp
|
||||||
|
|
||||||
|
spacing: 16 * A.dp
|
||||||
|
|
||||||
|
FloatingActionButton {
|
||||||
|
iconSource: A.drawable("ic_camera",Constants.black87);
|
||||||
|
size: Constants.small
|
||||||
|
backgroundColor: Constants.white100
|
||||||
|
onClicked: {
|
||||||
|
imagePicker.takePhoto();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FloatingActionButton {
|
||||||
|
iconSource: A.drawable("ic_image",Constants.black87);
|
||||||
|
size: Constants.small
|
||||||
|
backgroundColor: Constants.white100
|
||||||
|
onClicked: {
|
||||||
|
imagePicker.pickImage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
id: page
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id: actionBar
|
||||||
|
upEnabled: true
|
||||||
|
title: qsTr("Information")
|
||||||
|
showTitle: true
|
||||||
|
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
z: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
VisualItemModel {
|
||||||
|
id: itemModel
|
||||||
|
|
||||||
|
ListItem {
|
||||||
|
title: "Environment.DIRECTORY_DCIM"
|
||||||
|
subtitle: Environment.DIRECTORY_DCIM
|
||||||
|
interactive: false
|
||||||
|
width: page.width
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem {
|
||||||
|
title: "Debug.getNativeHeapSize"
|
||||||
|
subtitle: (Debug.getNativeHeapSize() / 1024 / 1024).toFixed(2) + "MB";
|
||||||
|
interactive: false
|
||||||
|
width: page.width
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem {
|
||||||
|
title: "Debug.getNativeHeapAllocatedSize"
|
||||||
|
subtitle: (Debug.getNativeHeapAllocatedSize() / 1024 / 1024).toFixed(2) + "MB";
|
||||||
|
interactive: false
|
||||||
|
width: page.width
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem {
|
||||||
|
title: "QThread.idealThreadCount"
|
||||||
|
subtitle: Misc.idealThreadCount;
|
||||||
|
interactive: false
|
||||||
|
width: page.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
anchors.fill: parent
|
||||||
|
model: itemModel
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
#include <QtCore>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <QQuickView>
|
||||||
|
#include <QQmlContext>
|
||||||
|
#include <QSettings>
|
||||||
|
//#include "qadrawableprovider.h"
|
||||||
|
#include "AndroidNative/systemdispatcher.h"
|
||||||
|
#include "AndroidNative/environment.h"
|
||||||
|
#include "AndroidNative/debug.h"
|
||||||
|
#include "AndroidNative/mediascannerconnection.h"
|
||||||
|
#include "debugwrapper.h"
|
||||||
|
|
||||||
|
using namespace AndroidNative;
|
||||||
|
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
#include <QtAndroidExtras/QAndroidJniObject>
|
||||||
|
#include <QtAndroidExtras/QAndroidJniEnvironment>
|
||||||
|
|
||||||
|
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
|
||||||
|
Q_UNUSED(vm);
|
||||||
|
qDebug("NativeInterface::JNI_OnLoad()");
|
||||||
|
|
||||||
|
// It must call this function within JNI_OnLoad to enable System Dispatcher
|
||||||
|
SystemDispatcher::registerNatives();
|
||||||
|
return JNI_VERSION_1_6;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||||
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
app.setApplicationName("Android Native Example");
|
||||||
|
app.setOrganizationDomain("com.github.benlau.androidnative");
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
settings.setValue("firstTimeLoading", false);
|
||||||
|
settings.sync();
|
||||||
|
|
||||||
|
QVariantMap env;
|
||||||
|
env["DIRECTORY_DCIM"] = Environment::getExternalStoragePublicDirectory(Environment::DIRECTORY_DCIM);
|
||||||
|
|
||||||
|
QVariantMap misc;
|
||||||
|
misc["idealThreadCount"] = QThread::idealThreadCount();
|
||||||
|
|
||||||
|
MediaScannerConnection::scanFile("");
|
||||||
|
|
||||||
|
SystemDispatcher::instance()->loadClass("androidnative.example.ExampleService");
|
||||||
|
|
||||||
|
QQmlApplicationEngine engine;
|
||||||
|
|
||||||
|
/* QuickAndroid Initialization */
|
||||||
|
engine.addImportPath("qrc:///"); // Add QuickAndroid into the import path
|
||||||
|
engine.rootContext()->setContextProperty("Environment", env);
|
||||||
|
engine.rootContext()->setContextProperty("Misc", misc);
|
||||||
|
engine.rootContext()->setContextProperty("Debug", new DebugWrapper(&engine));
|
||||||
|
|
||||||
|
/* End of QuickAndroid Initialization */
|
||||||
|
|
||||||
|
// Extra features:
|
||||||
|
//QADrawableProvider* provider = new QADrawableProvider();
|
||||||
|
//provider->setBasePath("qrc://res");
|
||||||
|
//engine.addImageProvider("drawable",provider);
|
||||||
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
|
@ -0,0 +1,76 @@
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import "./theme"
|
||||||
|
|
||||||
|
Window {
|
||||||
|
id: window;
|
||||||
|
width: 480
|
||||||
|
height: 640
|
||||||
|
|
||||||
|
color: "#FFFFFF"
|
||||||
|
|
||||||
|
visible: false;
|
||||||
|
|
||||||
|
/* Fast Splash Screen Setup Instruction
|
||||||
|
|
||||||
|
1. Create a custom theme (apptheme.qml) and set windowBackground to @drawable/splash.xml (Your splash screen drawable)
|
||||||
|
|
||||||
|
2. Within AndroidManifest.xml, set android.app.splash_screen_drawable to @drawable/splash.xml
|
||||||
|
|
||||||
|
<!-- Splash screen -->
|
||||||
|
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
|
||||||
|
<!-- Splash screen -->
|
||||||
|
|
||||||
|
That will show a splash screen while Qt is loading. However, screen flicker will happen when your Window
|
||||||
|
item is shown. To prevent screen flicker completely, you could setup your main.qml accoroding to step 3.
|
||||||
|
|
||||||
|
3. In your main.qml (the one with Window component)
|
||||||
|
|
||||||
|
3.1. Set Window.color to a color which is similar to splash screen / Theme.windowBackground
|
||||||
|
|
||||||
|
3.2. Set visible of Window to false until your content is loaded. (Keep Android splash screen while loading)
|
||||||
|
|
||||||
|
3.3. Use an asynchronous Loader for your content. Set opacity to 0.
|
||||||
|
|
||||||
|
3.4. Once everything is ready, set Window.visible to true and perform a fade-in animation on Loader
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: loader
|
||||||
|
parent: null
|
||||||
|
width: window.width
|
||||||
|
height: window.height
|
||||||
|
asynchronous: true
|
||||||
|
opacity: 0
|
||||||
|
focus: true;
|
||||||
|
|
||||||
|
sourceComponent: PageStack {
|
||||||
|
id: stack
|
||||||
|
objectName: "PageStack";
|
||||||
|
initialPage: Components {
|
||||||
|
|
||||||
|
onPresented: {
|
||||||
|
window.visible = true;
|
||||||
|
A.setTimeout(function() {
|
||||||
|
loader.parent = window.contentItem;
|
||||||
|
loader.opacity = 1;
|
||||||
|
}, 34);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 200
|
||||||
|
easing.type: Easing.OutQuad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
ThemeManager.currentTheme = AppTheme
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import AndroidNative 1.0 as AN
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id : actionBar
|
||||||
|
title: "Notification"
|
||||||
|
z: 10
|
||||||
|
upEnabled: true
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: label
|
||||||
|
text : "Press to send notification"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
onClicked: {
|
||||||
|
AN.SystemDispatcher.dispatch("Notifier.notify",{
|
||||||
|
title: "Quick Android Example",
|
||||||
|
message: "Hello!"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>main.qml</file>
|
||||||
|
<file>res/drawable-hdpi/icon.png</file>
|
||||||
|
<file>Components.qml</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_menu.png</file>
|
||||||
|
<file>dialog/DialogDemo.qml</file>
|
||||||
|
<file>notification/NotificationDemo.qml</file>
|
||||||
|
<file>theme/AppTheme.qml</file>
|
||||||
|
<file>theme/qmldir</file>
|
||||||
|
<file>res/drawable-hdpi/ic_android_black_48dp.png</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_android_black_48dp.png</file>
|
||||||
|
<file>res/drawable-mdpi/ic_android_black_48dp.png</file>
|
||||||
|
<file>res/drawable-xhdpi/ic_android_black_48dp.png</file>
|
||||||
|
<file>res/drawable-xxxhdpi/ic_android_black_48dp.png</file>
|
||||||
|
<file>res/drawable-hdpi/ic_done_black_24dp.png</file>
|
||||||
|
<file>res/drawable-mdpi/ic_done_black_24dp.png</file>
|
||||||
|
<file>res/drawable-xhdpi/ic_done_black_24dp.png</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_done_black_24dp.png</file>
|
||||||
|
<file>res/drawable-xxxhdpi/ic_done_black_24dp.png</file>
|
||||||
|
<file>theme/ActionBarBackground.qml</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_keyboard_backspace.png</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_arrow_back.png</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_image.png</file>
|
||||||
|
<file>res/drawable-xxhdpi/ic_camera.png</file>
|
||||||
|
<file>imagePicker/ImagePickerDemo.qml</file>
|
||||||
|
<file>info/InfoDemo.qml</file>
|
||||||
|
<file>toast/ToastDemo.qml</file>
|
||||||
|
<file>statusbar/StatusBarDemo.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"description": "",
|
||||||
|
"dependencies": [
|
||||||
|
"com.github.benlau.quickandroid@0.1.7"
|
||||||
|
],
|
||||||
|
"license": "NONE",
|
||||||
|
"pri_filename": "",
|
||||||
|
"webpage": ""
|
||||||
|
}
|
After Width: | Height: | Size: 519 B |
After Width: | Height: | Size: 177 B |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 130 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 975 B |
After Width: | Height: | Size: 287 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 127 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 277 B |
|
@ -0,0 +1,47 @@
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
import QtQuick.Controls 2.1 as QQC2
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import AndroidNative 1.0 as AN
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id : actionBar
|
||||||
|
title: "Status Bar"
|
||||||
|
z: 10
|
||||||
|
upEnabled: true
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
QQC2.Switch {
|
||||||
|
text: "Translucent Status Bar"
|
||||||
|
checked: false
|
||||||
|
|
||||||
|
onCheckedChanged: {
|
||||||
|
AN.SystemDispatcher.dispatch("androidnative.Util.setTranslucentStatusBar", {value: checked});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.Switch {
|
||||||
|
text: "Status Bar Visible"
|
||||||
|
checked: true
|
||||||
|
|
||||||
|
onCheckedChanged: {
|
||||||
|
AN.SystemDispatcher.dispatch("androidnative.Util.setFullScreen", {value: checked});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
AN.SystemDispatcher.loadClass("androidnative.Util");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
MaterialShadow {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
depth: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: "#cddc39" // Lime 500
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
Theme {
|
||||||
|
mediumText.textSize: 18 * A.dp
|
||||||
|
smallText.textSize : 14 * A.dp
|
||||||
|
|
||||||
|
colorPrimary: "#cddc39" // Lime 500
|
||||||
|
textColorPrimary: Constants.black87
|
||||||
|
windowBackground: "#eeeeee";
|
||||||
|
|
||||||
|
// The default icon of ActionBar is a "back" image
|
||||||
|
actionBar.iconSource: A.drawable("ic_arrow_back",Constants.black87)
|
||||||
|
|
||||||
|
// Background with shadow
|
||||||
|
actionBar.background: ActionBarBackground {
|
||||||
|
}
|
||||||
|
|
||||||
|
// actionBar.title.textSize is not allowed in QML. You should declare your own TextMaterial and assign directly.
|
||||||
|
// or modify text , smallText , mediumText and largetText
|
||||||
|
actionBar.title : customTextMaterial1;
|
||||||
|
actionBar.iconSourceSize: Qt.size(24 * A.dp , 24 * A.dp)
|
||||||
|
|
||||||
|
// Custom Style object.
|
||||||
|
TextMaterial {
|
||||||
|
id : customTextMaterial1
|
||||||
|
textSize: 18 * A.dp
|
||||||
|
textColor : Constants.black87
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
module theme
|
||||||
|
singleton AppTheme 0.1 AppTheme.qml
|
|
@ -0,0 +1,33 @@
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
import QuickAndroid 0.1
|
||||||
|
import QuickAndroid.Styles 0.1
|
||||||
|
import AndroidNative 1.0 as AN
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
Page {
|
||||||
|
|
||||||
|
actionBar: ActionBar {
|
||||||
|
id : actionBar
|
||||||
|
title: "Toast"
|
||||||
|
z: 10
|
||||||
|
upEnabled: true
|
||||||
|
onActionButtonClicked: back();
|
||||||
|
}
|
||||||
|
|
||||||
|
AN.Toast {
|
||||||
|
id: toast
|
||||||
|
text: "Toast"
|
||||||
|
longDuration: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: label
|
||||||
|
text : "Press to show toast"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
onClicked: {
|
||||||
|
toast.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -4,13 +4,6 @@ import android.util.Log;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.*;
|
import android.os.*;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.Manifest.permission;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidnative.AndroidNativeService;
|
|
||||||
|
|
||||||
/** An alternative Activity class for Qt applicaiton.
|
/** An alternative Activity class for Qt applicaiton.
|
||||||
|
|
||||||
|
@ -18,9 +11,6 @@ import androidnative.AndroidNativeService;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.QtActivity {
|
public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.QtActivity {
|
||||||
public static final int MY_PERMISSIONS_REQUEST_READ_STORAGE = 0x245285a8;
|
|
||||||
public static final int MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS = 0x245285a9;
|
|
||||||
private static final String TAG = "AndroidNativeActivity";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
@ -31,28 +21,10 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
|
||||||
|
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
System.loadLibrary("friendiqa");
|
||||||
|
|
||||||
|
|
||||||
AndroidNativeService fs = new AndroidNativeService();
|
|
||||||
fs.startQtService(this);
|
|
||||||
//if (ContextCompat.checkSelfPermission(this,android.Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
|
|
||||||
// Permission is not granted
|
|
||||||
|
|
||||||
// ActivityCompat.requestPermissions(this,new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE},MY_PERMISSIONS_REQUEST_WRITE_STORAGE);
|
|
||||||
|
|
||||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
|
||||||
// app-defined int constant. The callback method gets the
|
|
||||||
// result of the request.
|
|
||||||
//} else {
|
|
||||||
|
|
||||||
System.loadLibrary("friendiqa_arm64-v8a");
|
|
||||||
//System.loadLibrary("friendiqa_armeabi-v7a");
|
|
||||||
if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) {
|
if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) {
|
||||||
SystemDispatcher.onActivityResume();
|
SystemDispatcher.onActivityResume();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent data = getIntent();
|
Intent data = getIntent();
|
||||||
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
||||||
String type = data.getType();
|
String type = data.getType();
|
||||||
|
@ -75,42 +47,10 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
|
||||||
} else {
|
} else {
|
||||||
SystemDispatcher.onActivityResume();
|
SystemDispatcher.onActivityResume();
|
||||||
}}
|
}}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override public void onRequestPermissionsResult(int requestCode,String permissions[], int[] grantResults) {
|
|
||||||
Log.d(TAG,"onRequestPermissionsResult");
|
|
||||||
switch (requestCode) {
|
|
||||||
case MY_PERMISSIONS_REQUEST_READ_STORAGE: {
|
|
||||||
// If request is cancelled, the result arrays are empty.
|
|
||||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
Map message = new HashMap();
|
|
||||||
message.put("multiple",false);
|
|
||||||
SystemDispatcher.dispatch("androidnative.ImagePicker.pickImage",message);
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS: {
|
|
||||||
// If request is cancelled, the result arrays are empty.
|
|
||||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
Map message = new HashMap();
|
|
||||||
message.put("multiple",false);
|
|
||||||
SystemDispatcher.dispatch("androidnative.Util.setPostNotification",message);
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void onNewIntent(Intent data) {
|
protected void onNewIntent(Intent data) {
|
||||||
System.loadLibrary("friendiqa_arm64-v8a");
|
System.loadLibrary("friendiqa");
|
||||||
//System.loadLibrary("friendiqa_armeabi-v7a");
|
|
||||||
super.onNewIntent(data);
|
super.onNewIntent(data);
|
||||||
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
|
||||||
String type = data.getType();
|
String type = data.getType();
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
package androidnative;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.app.Notification.Builder;
|
|
||||||
import android.app.Notification;
|
|
||||||
import android.app.job.JobScheduler;
|
|
||||||
import org.qtproject.qt5.android.bindings.QtService;
|
|
||||||
import org.qtproject.qt5.android.QtNative;
|
|
||||||
import org.qtproject.friendiqa.R;
|
|
||||||
import androidnative.friendiqa.FriendiqaActivity;
|
|
||||||
|
|
||||||
public class AndroidNativeService extends QtService
|
|
||||||
{
|
|
||||||
private static String TAG = "AndroidNative";
|
|
||||||
|
|
||||||
public void startQtService(Context ctx) {
|
|
||||||
Log.d(TAG, "QtActivity active "+String.valueOf(QtNative.activity()!=null));
|
|
||||||
if (QtNative.activity()==null){
|
|
||||||
Log.d(TAG,"Friendiqasync Stop existing QtService");
|
|
||||||
ctx.stopService(new Intent(ctx, AndroidNativeService.class));
|
|
||||||
|
|
||||||
}
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
Log.d(TAG,"Friendiqasync startForegroundService");
|
|
||||||
ctx.startForegroundService(new Intent(ctx, AndroidNativeService.class));
|
|
||||||
} else {
|
|
||||||
ctx.startService(new Intent(ctx, AndroidNativeService.class));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void stopQtService(Context ctx) {
|
|
||||||
Log.d(TAG,"Friendiqasync QtServiceStop");
|
|
||||||
ctx.stopService(new Intent(ctx, AndroidNativeService.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate()
|
|
||||||
{
|
|
||||||
Context context;
|
|
||||||
context = this.getApplicationContext();
|
|
||||||
Log.d(TAG,"Friendiqa onCreate");
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
|
|
||||||
Intent intent = new Intent(context,FriendiqaActivity.class);
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
|
||||||
String CHANNEL_ID = "channel_02";
|
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
|
||||||
"Sync Channel",
|
|
||||||
NotificationManager.IMPORTANCE_DEFAULT);
|
|
||||||
channel.setSound(null,null);
|
|
||||||
((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
|
|
||||||
Log.d(TAG,"Friendiqa onCreate Notification");
|
|
||||||
Notification notification = new Notification.Builder(context,CHANNEL_ID)
|
|
||||||
.setSmallIcon(R.drawable.friendiqanotification)
|
|
||||||
.setContentTitle("Friendiqa")
|
|
||||||
.setContentText("Background Sync")
|
|
||||||
.setContentIntent(pendingIntent).build();
|
|
||||||
startForeground(1, notification);}
|
|
||||||
JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
|
||||||
jobScheduler.cancel(1);
|
|
||||||
super.onCreate();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
package androidnative;
|
package androidnative;
|
||||||
import org.qtproject.qt5.android.QtNative;
|
import org.qtproject.qt5.android.QtNative;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.Context;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -18,20 +17,12 @@ import android.content.ClipData;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.Manifest.permission;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ImagePicker {
|
public class ImagePicker {
|
||||||
|
|
||||||
// Random
|
// Random
|
||||||
public static final int PICK_IMAGE_ACTION = 0x245285a3;
|
public static final int PICK_IMAGE_ACTION = 0x245285a3;
|
||||||
public static final int TAKE_PHOTO_ACTION = 0x29fe8748;
|
public static final int TAKE_PHOTO_ACTION = 0x29fe8748;
|
||||||
public static final int MY_PERMISSIONS_REQUEST_READ_STORAGE = 0x245285a8;
|
|
||||||
public static final String PICK_IMAGE_MESSAGE = "androidnative.ImagePicker.pickImage";
|
public static final String PICK_IMAGE_MESSAGE = "androidnative.ImagePicker.pickImage";
|
||||||
public static final String TAKE_PHOTO_MESSAGE = "androidnative.ImagePicker.takePhoto";
|
public static final String TAKE_PHOTO_MESSAGE = "androidnative.ImagePicker.takePhoto";
|
||||||
public static final String CHOSEN_MESSAGE = "androidnative.ImagePicker.chosen";
|
public static final String CHOSEN_MESSAGE = "androidnative.ImagePicker.chosen";
|
||||||
|
@ -56,15 +47,8 @@ public class ImagePicker {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pickImage(Map message) {
|
static void pickImage(Map message) {
|
||||||
Context context;
|
|
||||||
context = QtNative.activity().getApplicationContext();
|
|
||||||
Activity activity = org.qtproject.qt5.android.QtNative.activity();
|
|
||||||
if (ContextCompat.checkSelfPermission(context,android.Manifest.permission.READ_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// Permission is not granted
|
|
||||||
ActivityCompat.requestPermissions(activity,new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE},MY_PERMISSIONS_REQUEST_READ_STORAGE);
|
|
||||||
} else {
|
|
||||||
Boolean multiple = false;
|
Boolean multiple = false;
|
||||||
//Activity activity = org.qtproject.qt5.android.QtNative.activity();
|
Activity activity = org.qtproject.qt5.android.QtNative.activity();
|
||||||
|
|
||||||
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||||
|
|
||||||
|
@ -78,8 +62,7 @@ public class ImagePicker {
|
||||||
|
|
||||||
// >= API 18
|
// >= API 18
|
||||||
activity.startActivityForResult(intent, PICK_IMAGE_ACTION);
|
activity.startActivityForResult(intent, PICK_IMAGE_ACTION);
|
||||||
|
}
|
||||||
}}
|
|
||||||
|
|
||||||
static void takePhoto(Map message) {
|
static void takePhoto(Map message) {
|
||||||
if (message.containsKey("broadcast")) {
|
if (message.containsKey("broadcast")) {
|
||||||
|
@ -112,6 +95,7 @@ public class ImagePicker {
|
||||||
return;
|
return;
|
||||||
int requestCode = (Integer) message.get("requestCode");
|
int requestCode = (Integer) message.get("requestCode");
|
||||||
Intent data = (Intent) message.get("data");
|
Intent data = (Intent) message.get("data");
|
||||||
|
|
||||||
if (requestCode == PICK_IMAGE_ACTION) {
|
if (requestCode == PICK_IMAGE_ACTION) {
|
||||||
importImage(data);
|
importImage(data);
|
||||||
} else if (requestCode == TAKE_PHOTO_ACTION) {
|
} else if (requestCode == TAKE_PHOTO_ACTION) {
|
||||||
|
@ -126,8 +110,8 @@ public class ImagePicker {
|
||||||
static private void importImage(Intent data) {
|
static private void importImage(Intent data) {
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
|
|
||||||
//Log.d(TAG,"importImage: uri:" + uri);
|
Log.d(TAG,"importImage: uri:" + uri);
|
||||||
//Log.d(TAG,"importImage: type: " + data.getType());
|
Log.d(TAG,"importImage: type: " + data.getType());
|
||||||
|
|
||||||
if (data.getClipData() != null) {
|
if (data.getClipData() != null) {
|
||||||
importImageFromClipData(data);
|
importImageFromClipData(data);
|
||||||
|
|
|
@ -140,7 +140,6 @@ public class SystemDispatcher {
|
||||||
waitingIntent=null;
|
waitingIntent=null;
|
||||||
isIntentPending=false;
|
isIntentPending=false;
|
||||||
} else { //onIntent start
|
} else { //onIntent start
|
||||||
Log.e(TAG,"notInitialized: onIntentStart "+data);
|
|
||||||
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
|
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
|
||||||
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
|
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
|
||||||
waitingIntent = message;
|
waitingIntent = message;
|
||||||
|
|
|
@ -6,29 +6,10 @@ import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.app.job.JobScheduler;
|
|
||||||
import android.app.job.JobInfo;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import androidx.core.app.NotificationCompat;
|
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
|
||||||
import org.qtproject.qt5.android.QtNative;
|
|
||||||
import androidnative.friendiqa.FriendiqaService;
|
|
||||||
import androidnative.friendiqa.FriendiqaStopService;
|
|
||||||
import androidnative.friendiqa.FriendiqaActivity;
|
|
||||||
import androidnative.AndroidNativeActivity;
|
|
||||||
import androidnative.AndroidNativeService;
|
|
||||||
import android.content.Intent;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.qtproject.friendiqa.R;
|
|
||||||
|
|
||||||
import android.content.pm.PackageManager;
|
import org.qtproject.qt5.android.QtNative;
|
||||||
import android.Manifest;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import java.util.Map;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
|
|
||||||
|
@ -36,10 +17,7 @@ public class Util {
|
||||||
|
|
||||||
public static final String SET_TRANSLUCENT_STATUS_BAR = "androidnative.Util.setTranslucentStatusBar";
|
public static final String SET_TRANSLUCENT_STATUS_BAR = "androidnative.Util.setTranslucentStatusBar";
|
||||||
public static final String SET_FULL_SCREEN = "androidnative.Util.setFullScreen";
|
public static final String SET_FULL_SCREEN = "androidnative.Util.setFullScreen";
|
||||||
public static final String SET_SCHEDULE = "androidnative.Util.setSchedule";
|
|
||||||
public static final String SET_NOTIFICATION = "androidnative.Util.setNotification";
|
|
||||||
public static final String SET_POST_NOTIFICATION = "androidnative.Util.setPostNotification";
|
|
||||||
public static final int MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS = 0x245285a9;
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
SystemDispatcher.addListener(new SystemDispatcher.Listener() {
|
SystemDispatcher.addListener(new SystemDispatcher.Listener() {
|
||||||
|
@ -48,12 +26,6 @@ public class Util {
|
||||||
setTranslucentStatusBar(message);
|
setTranslucentStatusBar(message);
|
||||||
} else if (type.equals(SET_FULL_SCREEN)) {
|
} else if (type.equals(SET_FULL_SCREEN)) {
|
||||||
setFullScreen(message);
|
setFullScreen(message);
|
||||||
} else if (type.equals(SET_SCHEDULE)) {
|
|
||||||
setSchedule(message);
|
|
||||||
} else if (type.equals(SET_NOTIFICATION)) {
|
|
||||||
setNotification(message);
|
|
||||||
} else if (type.equals(SET_POST_NOTIFICATION)) {
|
|
||||||
setPostNotification(message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -90,10 +62,6 @@ public class Util {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Boolean value = (Boolean) message.get("value");
|
final Boolean value = (Boolean) message.get("value");
|
||||||
final Activity activity = QtNative.activity();
|
final Activity activity = QtNative.activity();
|
||||||
|
|
||||||
|
@ -116,140 +84,4 @@ public class Util {
|
||||||
activity.runOnUiThread(runnable);
|
activity.runOnUiThread(runnable);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setNotification(Map message) {
|
|
||||||
Log.d(TAG,"setNotification");
|
|
||||||
Context context;
|
|
||||||
//Context appcontext;
|
|
||||||
context = QtNative.service().getApplicationContext();
|
|
||||||
//appcontext = QtNative.activity().getApplicationContext();
|
|
||||||
Intent intent = new Intent(context,FriendiqaActivity.class);
|
|
||||||
//intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
|
||||||
|
|
||||||
final String textTitle = (String) message.get("title");
|
|
||||||
final String textContent = (String) message.get("message");
|
|
||||||
final int notificationId = (int) message.get("id");
|
|
||||||
|
|
||||||
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
final String CHANNEL_ID = "channel_01";
|
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
|
||||||
"Channel for Friendiqa News",
|
|
||||||
NotificationManagerCompat.IMPORTANCE_LOW);
|
|
||||||
notificationManager.createNotificationChannel(channel);
|
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context,CHANNEL_ID)
|
|
||||||
.setSmallIcon(R.drawable.friendiqanotification)
|
|
||||||
.setContentIntent(pendingIntent)
|
|
||||||
.setContentTitle(textTitle)
|
|
||||||
.setContentText(textContent)
|
|
||||||
.setStyle(new NotificationCompat.BigTextStyle()
|
|
||||||
.bigText(textContent))
|
|
||||||
.setAutoCancel(true);
|
|
||||||
notificationManager.notify(notificationId, builder.build());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
|
|
||||||
.setSmallIcon(R.drawable.friendiqanotification)
|
|
||||||
.setContentIntent(pendingIntent)
|
|
||||||
.setContentTitle(textTitle)
|
|
||||||
.setContentText(textContent)
|
|
||||||
.setStyle(new NotificationCompat.BigTextStyle()
|
|
||||||
.bigText(textContent))
|
|
||||||
|
|
||||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
|
||||||
.setAutoCancel(true);
|
|
||||||
notificationManager.notify(notificationId, builder.build());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setSchedule(Map message) {
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Integer value = (Integer) message.get("value");
|
|
||||||
//final int JOB_ID = 1;
|
|
||||||
final int ONE_MIN = 60 * 1000;
|
|
||||||
Context context;
|
|
||||||
if (QtNative.activity() == null){
|
|
||||||
context = QtNative.service().getApplicationContext();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
context = QtNative.activity().getApplicationContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//AndroidNativeService fs = new AndroidNativeService();
|
|
||||||
//fs.startQtService(context);
|
|
||||||
|
|
||||||
|
|
||||||
if (value==0){
|
|
||||||
JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
|
||||||
jobScheduler.cancelAll();
|
|
||||||
Log.d(TAG,"Friendiqasync deleting Androidnative jobscheduler");
|
|
||||||
} else {
|
|
||||||
Log.d(TAG,"Friendiqasync schedule Androidnative jobscheduler");
|
|
||||||
ComponentName component = new ComponentName(context, FriendiqaService.class);
|
|
||||||
JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
|
||||||
|
|
||||||
|
|
||||||
//Log.d(TAG,"Jobinfolist size " + String.valueOf(jobScheduler.getAllPendingJobs().size()));
|
|
||||||
if (jobScheduler.getAllPendingJobs().size()==0){
|
|
||||||
JobInfo.Builder builder = new JobInfo.Builder(2, component)
|
|
||||||
.setPeriodic(value * ONE_MIN)
|
|
||||||
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
|
|
||||||
.setPersisted(true)
|
|
||||||
.setPrefetch(true);
|
|
||||||
Log.d(TAG,"1 Friendiqa schedule Androidnative sync schedule"+ (value * ONE_MIN));
|
|
||||||
jobScheduler.schedule(builder.build());
|
|
||||||
} else {
|
|
||||||
for ( JobInfo jobInfo : jobScheduler.getAllPendingJobs() ) {
|
|
||||||
//Log.d(TAG,"Jobinfo current interval " + String.valueOf(jobInfo.getIntervalMillis ()));
|
|
||||||
if (jobInfo.getIntervalMillis ()!=(value * ONE_MIN)){
|
|
||||||
JobInfo.Builder builder = new JobInfo.Builder(2, component)
|
|
||||||
.setPeriodic(value * ONE_MIN)
|
|
||||||
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
|
|
||||||
.setPersisted(true)
|
|
||||||
.setPrefetch(true);
|
|
||||||
Log.d(TAG,"2 Friendiqa schedule Androidnative sync schedule"+ (value * ONE_MIN));
|
|
||||||
jobScheduler.schedule(builder.build());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Log.d(TAG,"Active service " + String.valueOf(QtNative.service()!=null));
|
|
||||||
//if (QtNative.service() != null){
|
|
||||||
// Log.d(TAG,"Schedule Stopping Friendiqa Androidnative service");
|
|
||||||
// ComponentName componentStopper = new ComponentName(context, FriendiqaStopService.class);
|
|
||||||
// JobInfo.Builder stopbuilder = new JobInfo.Builder(1, componentStopper)
|
|
||||||
// .setMinimumLatency(50)
|
|
||||||
// .setOverrideDeadline(100);
|
|
||||||
|
|
||||||
// JobScheduler jobStopScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
|
|
||||||
// jobStopScheduler.schedule(stopbuilder.build());
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
|
||||||
notificationManager.cancelAll();
|
|
||||||
//context.stopService(new Intent(context, AndroidNativeService.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setPostNotification(Map message) {
|
|
||||||
Log.d(TAG,"setPostNotification");
|
|
||||||
Context context;
|
|
||||||
if (QtNative.activity() == null){
|
|
||||||
context = QtNative.service().getApplicationContext();
|
|
||||||
} else {
|
|
||||||
context = QtNative.activity().getApplicationContext();
|
|
||||||
}
|
|
||||||
Activity activity = org.qtproject.qt5.android.QtNative.activity();
|
|
||||||
Log.d(TAG,String.valueOf(ContextCompat.checkSelfPermission(context,Manifest.permission.POST_NOTIFICATIONS)));
|
|
||||||
if (ContextCompat.checkSelfPermission(context,Manifest.permission.POST_NOTIFICATIONS)!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// Permission is not granted
|
|
||||||
Log.d(TAG,String.valueOf(PackageManager.PERMISSION_GRANTED));
|
|
||||||
ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.POST_NOTIFICATIONS},MY_PERMISSIONS_REQUEST_POST_NOTIFICATIONS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
229
source-android/application.qrc
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>qml/friendiqa.qml</file>
|
||||||
|
<file>qml/newsqml/NewsTab.qml</file>
|
||||||
|
<file>qml/newsqml/Newsitem.qml</file>
|
||||||
|
<file>qml/newsqml/MessageSend.qml</file>
|
||||||
|
<file>qml/newsqml/Conversation.qml</file>
|
||||||
|
<file>qml/newsqml/FriendicaActivities.qml</file>
|
||||||
|
<file>qml/contactqml/FriendsTab.qml</file>
|
||||||
|
<file>qml/contactqml/GroupComponent.qml</file>
|
||||||
|
<file>qml/contactqml/ContactComponent.qml</file>
|
||||||
|
<file>qml/contactqml/ContactDetailsComponent.qml</file>
|
||||||
|
<file>qml/contactqml/Contactlist.qml</file>
|
||||||
|
<file>qml/genericqml/BlueButton.qml</file>
|
||||||
|
<file>qml/photoqml/PhotoComponent.qml</file>
|
||||||
|
<file>qml/photoqml/PhotogroupComponent.qml</file>
|
||||||
|
<file>qml/photoqml/PhotoTab.qml</file>
|
||||||
|
<file>qml/configqml/InfoBox.qml</file>
|
||||||
|
<file>qml/configqml/ConfigTab.qml</file>
|
||||||
|
<file>js/layout.js</file>
|
||||||
|
<file>js/photoworker.js</file>
|
||||||
|
<file>js/service.js</file>
|
||||||
|
<file>js/news.js</file>
|
||||||
|
<file>js/newsworker.js</file>
|
||||||
|
<file>js/helper.js</file>
|
||||||
|
<file>images/defaultcontact.jpg</file>
|
||||||
|
<file>images/fontawesome-webfont.ttf</file>
|
||||||
|
<file>images/folder-blue.png</file>
|
||||||
|
<file>qml/configqml/OSSettingsAndroid.qml</file>
|
||||||
|
<file>qml/configqml/OSSettingsLinux.qml</file>
|
||||||
|
<file>qml/newsqml/SmileyDialog.qml</file>
|
||||||
|
<file>js/smiley.js</file>
|
||||||
|
<file>images/smileys/animals/bee.gif</file>
|
||||||
|
<file>images/smileys/animals/bigspider.gif</file>
|
||||||
|
<file>images/smileys/animals/bunny.gif</file>
|
||||||
|
<file>images/smileys/animals/bunnyflowers.gif</file>
|
||||||
|
<file>images/smileys/animals/cat.gif</file>
|
||||||
|
<file>images/smileys/animals/chick.gif</file>
|
||||||
|
<file>images/smileys/animals/cow.gif</file>
|
||||||
|
<file>images/smileys/animals/crab.gif</file>
|
||||||
|
<file>images/smileys/animals/dog.gif</file>
|
||||||
|
<file>images/smileys/animals/dolphin.gif</file>
|
||||||
|
<file>images/smileys/animals/dragonfly.gif</file>
|
||||||
|
<file>images/smileys/animals/elephant.gif</file>
|
||||||
|
<file>images/smileys/animals/fish.gif</file>
|
||||||
|
<file>images/smileys/animals/frog.gif</file>
|
||||||
|
<file>images/smileys/animals/giraffe.gif</file>
|
||||||
|
<file>images/smileys/animals/hamster.gif</file>
|
||||||
|
<file>images/smileys/animals/horse.gif</file>
|
||||||
|
<file>images/smileys/animals/ladybird.gif</file>
|
||||||
|
<file>images/smileys/animals/monkey.gif</file>
|
||||||
|
<file>images/smileys/animals/parrot.gif</file>
|
||||||
|
<file>images/smileys/animals/pig.gif</file>
|
||||||
|
<file>images/smileys/animals/sheep.gif</file>
|
||||||
|
<file>images/smileys/animals/snail.gif</file>
|
||||||
|
<file>images/smileys/animals/tux.gif</file>
|
||||||
|
<file>images/smileys/babies/baby.gif</file>
|
||||||
|
<file>images/smileys/babies/babycot.gif</file>
|
||||||
|
<file>images/smileys/babies/pregnant.gif</file>
|
||||||
|
<file>images/smileys/babies/stork.gif</file>
|
||||||
|
<file>images/smileys/confused/confused.gif</file>
|
||||||
|
<file>images/smileys/confused/dazed.gif</file>
|
||||||
|
<file>images/smileys/confused/shrug.gif</file>
|
||||||
|
<file>images/smileys/confused/stupid.gif</file>
|
||||||
|
<file>images/smileys/cool/affro.gif</file>
|
||||||
|
<file>images/smileys/cool/cool.gif</file>
|
||||||
|
<file>images/smileys/devilangel/angel.gif</file>
|
||||||
|
<file>images/smileys/devilangel/blondedevil.gif</file>
|
||||||
|
<file>images/smileys/devilangel/catdevil.gif</file>
|
||||||
|
<file>images/smileys/devilangel/cherub.gif</file>
|
||||||
|
<file>images/smileys/devilangel/daseesaw.gif</file>
|
||||||
|
<file>images/smileys/devilangel/devil.gif</file>
|
||||||
|
<file>images/smileys/devilangel/graveside.gif</file>
|
||||||
|
<file>images/smileys/devilangel/saint.gif</file>
|
||||||
|
<file>images/smileys/devilangel/turnevil.gif</file>
|
||||||
|
<file>images/smileys/disgust/fartblush.gif</file>
|
||||||
|
<file>images/smileys/disgust/fartinbed.gif</file>
|
||||||
|
<file>images/smileys/disgust/toilet.gif</file>
|
||||||
|
<file>images/smileys/disgust/vomit.gif</file>
|
||||||
|
<file>images/smileys/drink/tea.gif</file>
|
||||||
|
<file>images/smileys/drool/drool.gif</file>
|
||||||
|
<file>images/smileys/fantasy/alienmonster.gif</file>
|
||||||
|
<file>images/smileys/fantasy/barbarian.gif</file>
|
||||||
|
<file>images/smileys/fantasy/dinosaur.gif</file>
|
||||||
|
<file>images/smileys/fantasy/dragon.gif</file>
|
||||||
|
<file>images/smileys/fantasy/dragonwhelp.gif</file>
|
||||||
|
<file>images/smileys/fantasy/ghost.gif</file>
|
||||||
|
<file>images/smileys/fantasy/mummy.gif</file>
|
||||||
|
<file>images/smileys/fight/2guns.gif</file>
|
||||||
|
<file>images/smileys/fight/acid.gif</file>
|
||||||
|
<file>images/smileys/fight/alienfight.gif</file>
|
||||||
|
<file>images/smileys/fight/alpha.png</file>
|
||||||
|
<file>images/smileys/fight/army.gif</file>
|
||||||
|
<file>images/smileys/fight/arrowhead.gif</file>
|
||||||
|
<file>images/smileys/fight/bfg.gif</file>
|
||||||
|
<file>images/smileys/fight/bowman.gif</file>
|
||||||
|
<file>images/smileys/fight/chainsaw.gif</file>
|
||||||
|
<file>images/smileys/fight/crossbow.gif</file>
|
||||||
|
<file>images/smileys/fight/crusader.gif</file>
|
||||||
|
<file>images/smileys/fight/dead.gif</file>
|
||||||
|
<file>images/smileys/fight/gangs.gif</file>
|
||||||
|
<file>images/smileys/fight/hammersplat.gif</file>
|
||||||
|
<file>images/smileys/fight/lasergun.gif</file>
|
||||||
|
<file>images/smileys/fight/machinegun.gif</file>
|
||||||
|
<file>images/smileys/fight/marine.gif</file>
|
||||||
|
<file>images/smileys/fight/sabre.gif</file>
|
||||||
|
<file>images/smileys/fight/samurai.gif</file>
|
||||||
|
<file>images/smileys/fight/tank.gif</file>
|
||||||
|
<file>images/smileys/fight/viking.gif</file>
|
||||||
|
<file>images/smileys/food/apple.gif</file>
|
||||||
|
<file>images/smileys/food/banana.gif</file>
|
||||||
|
<file>images/smileys/food/birthdaycake.gif</file>
|
||||||
|
<file>images/smileys/food/broccoli.gif</file>
|
||||||
|
<file>images/smileys/food/cake.gif</file>
|
||||||
|
<file>images/smileys/food/carrot.gif</file>
|
||||||
|
<file>images/smileys/food/cooking.gif</file>
|
||||||
|
<file>images/smileys/food/fryegg.gif</file>
|
||||||
|
<file>images/smileys/food/popcorn.gif</file>
|
||||||
|
<file>images/smileys/food/tomato.gif</file>
|
||||||
|
<file>images/smileys/happy/cloud9.gif</file>
|
||||||
|
<file>images/smileys/happy/tearsofjoy.gif</file>
|
||||||
|
<file>images/smileys/laugh/hahaha.gif</file>
|
||||||
|
<file>images/smileys/laugh/loltv.gif</file>
|
||||||
|
<file>images/smileys/laugh/rofl.gif</file>
|
||||||
|
<file>images/smileys/love/iloveyou.gif</file>
|
||||||
|
<file>images/smileys/love/inlove.gif</file>
|
||||||
|
<file>images/smileys/love/love.gif</file>
|
||||||
|
<file>images/smileys/love/lovebear.gif</file>
|
||||||
|
<file>images/smileys/love/lovebed.gif</file>
|
||||||
|
<file>images/smileys/love/loveheart.gif</file>
|
||||||
|
<file>images/smileys/music/dj.gif</file>
|
||||||
|
<file>images/smileys/music/drums.gif</file>
|
||||||
|
<file>images/smileys/music/elvis.gif</file>
|
||||||
|
<file>images/smileys/music/guitar.gif</file>
|
||||||
|
<file>images/smileys/music/trumpet.gif</file>
|
||||||
|
<file>images/smileys/music/violin.gif</file>
|
||||||
|
<file>images/smileys/oldcore/beard.png</file>
|
||||||
|
<file>images/smileys/oldcore/headbang.gif</file>
|
||||||
|
<file>images/smileys/oldcore/laughing.gif</file>
|
||||||
|
<file>images/smileys/oldcore/shaka.gif</file>
|
||||||
|
<file>images/smileys/oldcore/surprised.gif</file>
|
||||||
|
<file>images/smileys/oldcore/whitebeard.png</file>
|
||||||
|
<file>images/smileys/respect/bow.gif</file>
|
||||||
|
<file>images/smileys/respect/bravo.gif</file>
|
||||||
|
<file>images/smileys/respect/hailking.gif</file>
|
||||||
|
<file>images/smileys/respect/number1.gif</file>
|
||||||
|
<file>images/smileys/sad/crying.png</file>
|
||||||
|
<file>images/smileys/sad/prisoner.gif</file>
|
||||||
|
<file>images/smileys/sad/sigh.gif</file>
|
||||||
|
<file>images/smileys/smoking/smoking.gif</file>
|
||||||
|
<file>images/smileys/sport/archery.gif</file>
|
||||||
|
<file>images/smileys/sport/basketball.gif</file>
|
||||||
|
<file>images/smileys/sport/bowling.gif</file>
|
||||||
|
<file>images/smileys/sport/cycling.gif</file>
|
||||||
|
<file>images/smileys/sport/darts.gif</file>
|
||||||
|
<file>images/smileys/sport/fencing.gif</file>
|
||||||
|
<file>images/smileys/sport/football.gif</file>
|
||||||
|
<file>images/smileys/sport/golf.gif</file>
|
||||||
|
<file>images/smileys/sport/horseriding.gif</file>
|
||||||
|
<file>images/smileys/sport/juggling.gif</file>
|
||||||
|
<file>images/smileys/sport/skipping.gif</file>
|
||||||
|
<file>images/smileys/sport/snooker.gif</file>
|
||||||
|
<file>images/smileys/sport/surfing.gif</file>
|
||||||
|
<file>images/smileys/sport/tennis.gif</file>
|
||||||
|
<file>images/smileys/tired/countsheep.gif</file>
|
||||||
|
<file>images/smileys/tired/hammock.gif</file>
|
||||||
|
<file>images/smileys/tired/pillow.gif</file>
|
||||||
|
<file>images/smileys/tired/yawn.gif</file>
|
||||||
|
<file>images/smileys/core/beer_mug.gif</file>
|
||||||
|
<file>images/smileys/core/coffee.gif</file>
|
||||||
|
<file>images/smileys/core/dislike.gif</file>
|
||||||
|
<file>images/smileys/core/friendica-16.png</file>
|
||||||
|
<file>images/smileys/core/like.gif</file>
|
||||||
|
<file>images/smileys/core/rm-16.png</file>
|
||||||
|
<file>images/smileys/core/smiley-bangheaddesk.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-brokenheart.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-cool.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-cry.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-embarassed.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-facepalm.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-foot-in-mouth.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-heart.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-kiss.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-laughing.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-Oo.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-smile.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-surprised.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-thumbsup.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-tongue-out.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-undecided.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-wink.gif</file>
|
||||||
|
<file>images/smileys/core/smiley-frown.gif</file>
|
||||||
|
<file>images/smileys/adult/bong.gif</file>
|
||||||
|
<file>images/smileys/adult/drunk.gif</file>
|
||||||
|
<file>images/smileys/adult/finger.gif</file>
|
||||||
|
<file>images/smileys/adult/sperm.gif</file>
|
||||||
|
<file>images/smileys/adult/tits.gif</file>
|
||||||
|
<file>common/filesystem.cpp</file>
|
||||||
|
<file>common/filesystem.h</file>
|
||||||
|
<file>common/friendiqa.cpp</file>
|
||||||
|
<file>common/uploadableimage.cpp</file>
|
||||||
|
<file>common/uploadableimage.h</file>
|
||||||
|
<file>common/xhr.cpp</file>
|
||||||
|
<file>common/xhr.h</file>
|
||||||
|
<file>qml/calendarqml/CalendarTab.qml</file>
|
||||||
|
<file>qml/calendarqml/CalendarDay.qml</file>
|
||||||
|
<file>qml/calendarqml/EventList.qml</file>
|
||||||
|
<file>translations/friendiqa-de.qm</file>
|
||||||
|
<file>translations/friendiqa-de.ts</file>
|
||||||
|
<file>translations/friendiqa-es.qm</file>
|
||||||
|
<file>translations/friendiqa-es.ts</file>
|
||||||
|
<file>qml/photoqml/ImageUploadDialog.qml</file>
|
||||||
|
<file>qml/genericqml/PermissionDialog.qml</file>
|
||||||
|
<file>images/addImage.png</file>
|
||||||
|
<file>qml/genericqml/ImagePicker.qml</file>
|
||||||
|
<file>qml/genericqml/ImagePickerLinux.qml</file>
|
||||||
|
<file>js/image.js</file>
|
||||||
|
<file>qml/contactqml/ProfileComponent.qml</file>
|
||||||
|
<file>translations/friendiqa-it.ts</file>
|
||||||
|
<file>qml/genericqml/Search.qml</file>
|
||||||
|
<file>qml/newsqml/Hashtag.qml</file>
|
||||||
|
<file>qml/genericqml/IntentReceiver.qml</file>
|
||||||
|
<file>qml/newsqml/NewsImage.qml</file>
|
||||||
|
<file>qml/newsqml/NewsVideo.qml</file>
|
||||||
|
<file>qml/newsqml/ContactPage.qml</file>
|
||||||
|
<file>qml/newsqml/NewsLink.qml</file>
|
||||||
|
<file>qml/configqml/RegisterPage.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -1,6 +1,6 @@
|
||||||
// This file is part of Friendiqa
|
// This file is part of Friendiqa
|
||||||
// https://github.com/lubuwest/Friendiqa
|
// https://github.com/lubuwest/Friendiqa
|
||||||
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -30,7 +30,6 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
FILESYSTEM *FILESYSTEM::instance()
|
FILESYSTEM *FILESYSTEM::instance()
|
||||||
{
|
{
|
||||||
|
@ -53,22 +52,11 @@ QString FILESYSTEM::Directory() const
|
||||||
return m_Directory;
|
return m_Directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FILESYSTEM::setVisibility(bool Visibility)
|
|
||||||
{
|
|
||||||
if (Visibility!=m_Visibility) {
|
|
||||||
m_Visibility = Visibility;
|
|
||||||
emit visibilityChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FILESYSTEM::Visibility()
|
|
||||||
{
|
|
||||||
return m_Visibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString FILESYSTEM::homePath() const
|
QString FILESYSTEM::homePath() const
|
||||||
{
|
{
|
||||||
QString homeDir=QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);;
|
QDir dir(m_Directory);
|
||||||
|
QString homeDir=dir.homePath();
|
||||||
|
//qDebug(homeDir);
|
||||||
return homeDir;
|
return homeDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,25 +83,13 @@ void FILESYSTEM::makeDir(QString name)
|
||||||
if (dir.mkdir(name)){
|
if (dir.mkdir(name)){
|
||||||
emit success(name);
|
emit success(name);
|
||||||
}
|
}
|
||||||
else {
|
else {emit error(name,1);}
|
||||||
emit error(name,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FILESYSTEM::makePath(QString name)
|
|
||||||
{
|
|
||||||
QDir dir(m_Directory);
|
|
||||||
if (dir.mkpath(name)){
|
|
||||||
emit success(name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << "makepath error" <<name;
|
|
||||||
emit error(name,1);}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FILESYSTEM::rmDir()
|
void FILESYSTEM::rmDir()
|
||||||
{
|
{
|
||||||
QDir dir(m_Directory);
|
QDir dir(m_Directory);
|
||||||
|
//qDebug()<<m_Directory;
|
||||||
if (dir.removeRecursively()){
|
if (dir.removeRecursively()){
|
||||||
emit success(m_Directory);
|
emit success(m_Directory);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +99,8 @@ void FILESYSTEM::rmDir()
|
||||||
void FILESYSTEM::rmFile(QString name)
|
void FILESYSTEM::rmFile(QString name)
|
||||||
{
|
{
|
||||||
QDir dir(m_Directory);
|
QDir dir(m_Directory);
|
||||||
|
//qDebug()<<m_Directory;
|
||||||
|
//qDebug(name);
|
||||||
if(dir.remove(name)){
|
if(dir.remove(name)){
|
||||||
emit success(name);
|
emit success(name);
|
||||||
}
|
}
|
||||||
|
@ -135,58 +113,7 @@ QFileInfoList FILESYSTEM::fileList()
|
||||||
filters << "*.png" <<"*.PNG" << "*.jpg" << "*.JPG" << "*.JPEG";
|
filters << "*.png" <<"*.PNG" << "*.jpg" << "*.JPG" << "*.JPEG";
|
||||||
dir.setNameFilters(filters);
|
dir.setNameFilters(filters);
|
||||||
dir.setSorting(QDir::Time | QDir::Reversed);
|
dir.setSorting(QDir::Time | QDir::Reversed);
|
||||||
|
//QStringList m_Filelist=dir.entryInfoList();
|
||||||
|
//qDebug() << "filelist " << m_Filelist;
|
||||||
return dir.entryInfoList();
|
return dir.entryInfoList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FILESYSTEM::isAutostart() {
|
|
||||||
QFileInfo check_file(QDir::homePath() + "/.config/autostart/friendiqa.desktop");
|
|
||||||
|
|
||||||
if (check_file.exists() && check_file.isFile()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FILESYSTEM::setAutostart(bool autostart) {
|
|
||||||
QString path = QDir::homePath() + "/.config/autostart/";
|
|
||||||
QString name ="friendiqa.desktop";
|
|
||||||
QFile file(path+name);
|
|
||||||
|
|
||||||
file.remove();
|
|
||||||
|
|
||||||
if(autostart) {
|
|
||||||
QDir dir(path);
|
|
||||||
if(!dir.exists()) {
|
|
||||||
dir.mkpath(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file.open(QIODevice::ReadWrite)) {
|
|
||||||
QTextStream stream(&file);
|
|
||||||
stream << "[Desktop Entry]" << Qt::endl;
|
|
||||||
stream << "Name=Friendiqa" << Qt::endl;
|
|
||||||
stream << "Exec=friendiqa -background %u" << Qt::endl;
|
|
||||||
stream << "Terminal=false" << Qt::endl;
|
|
||||||
stream << "Icon=Friendiqa.svg" << Qt::endl;
|
|
||||||
stream << "Type=Application" << Qt::endl;
|
|
||||||
stream << "StartupNotify=false" << Qt::endl;
|
|
||||||
stream << "X-GNOME-Autostart-enabled=true" << Qt::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString FILESYSTEM::osType() const
|
|
||||||
{
|
|
||||||
QString m_osType;
|
|
||||||
if(QSysInfo::productType()==QString("android")){
|
|
||||||
m_osType="Android";
|
|
||||||
}else{
|
|
||||||
m_osType="Linux";
|
|
||||||
}
|
|
||||||
return m_osType;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString FILESYSTEM::hostname() const
|
|
||||||
{
|
|
||||||
return QSysInfo::machineHostName();
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
// This file is part of Friendiqa
|
// This file is part of Friendiqa
|
||||||
// https://github.com/lubuwest/Friendiqa
|
// https://github.com/lubuwest/Friendiqa
|
||||||
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
|
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
@ -34,8 +34,6 @@
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStandardPaths>
|
|
||||||
#include <QSysInfo>
|
|
||||||
//#include <QtAndroidExtras>
|
//#include <QtAndroidExtras>
|
||||||
//#include <QAndroidActivityResultReceiver>
|
//#include <QAndroidActivityResultReceiver>
|
||||||
|
|
||||||
|
@ -43,12 +41,8 @@ class FILESYSTEM : public QObject//, public QAndroidActivityResultReceiver
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString Directory READ Directory WRITE setDirectory NOTIFY directoryChanged)
|
Q_PROPERTY(QString Directory READ Directory WRITE setDirectory NOTIFY directoryChanged)
|
||||||
Q_PROPERTY(bool Visibility READ Visibility WRITE setVisibility NOTIFY visibilityChanged)
|
|
||||||
//Q_PROPERTY(bool direxist READ direxist)
|
//Q_PROPERTY(bool direxist READ direxist)
|
||||||
Q_PROPERTY(QString homePath READ homePath)
|
Q_PROPERTY(QString homePath READ homePath)
|
||||||
Q_PROPERTY(bool isAutostart READ isAutostart NOTIFY isAutostartChanged)
|
|
||||||
Q_PROPERTY(QString osType READ osType CONSTANT)
|
|
||||||
Q_PROPERTY(QString hostname READ hostname CONSTANT)
|
|
||||||
//Q_PROPERTY(QString cameraPath READ cameraPath)
|
//Q_PROPERTY(QString cameraPath READ cameraPath)
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,23 +50,16 @@ public:
|
||||||
static FILESYSTEM *instance();
|
static FILESYSTEM *instance();
|
||||||
explicit FILESYSTEM(QObject *parent = 0);
|
explicit FILESYSTEM(QObject *parent = 0);
|
||||||
void setDirectory(QString Directory);
|
void setDirectory(QString Directory);
|
||||||
void setVisibility(bool Visibility);
|
|
||||||
QString Directory() const;
|
QString Directory() const;
|
||||||
QFileInfoList fileList();
|
QFileInfoList fileList();
|
||||||
//bool direxist(QString Directory);
|
//bool direxist(QString Directory);
|
||||||
QString homePath() const;
|
QString homePath() const;
|
||||||
bool Visibility();
|
|
||||||
bool isAutostart();
|
|
||||||
QString osType() const;
|
|
||||||
QString hostname() const;
|
|
||||||
//QString cameraPath() const;
|
//QString cameraPath() const;
|
||||||
// virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data);
|
// virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//void imageselected(QString);
|
//void imageselected(QString);
|
||||||
void directoryChanged();
|
void directoryChanged();
|
||||||
void visibilityChanged();
|
|
||||||
void isAutostartChanged();
|
|
||||||
//void fileListContent(QList data);
|
//void fileListContent(QList data);
|
||||||
void success(QString data);
|
void success(QString data);
|
||||||
void error(QString data, int code);
|
void error(QString data, int code);
|
||||||
|
@ -80,17 +67,14 @@ signals:
|
||||||
public slots:
|
public slots:
|
||||||
bool fileexist(QString name);
|
bool fileexist(QString name);
|
||||||
void makeDir(QString name);
|
void makeDir(QString name);
|
||||||
void makePath(QString name);
|
|
||||||
void rmDir();
|
void rmDir();
|
||||||
void rmFile(QString name);
|
void rmFile(QString name);
|
||||||
void setAutostart(bool autostart);
|
|
||||||
//void searchImage();
|
//void searchImage();
|
||||||
//void fileList();
|
//void fileList();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_Directory;
|
QString m_Directory;
|
||||||
QString homeDir;
|
QString homeDir;
|
||||||
bool m_Visibility;
|
|
||||||
//QList m_Filelist;
|
//QList m_Filelist;
|
||||||
};
|
};
|
||||||
|
|