This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from V-Play/master
PropertyCross with V-Play Apps
- Loading branch information
Showing
33 changed files
with
824 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# V-Play Apps Property Cross | ||
CONFIG += v-play | ||
|
||
# Dource file folder shipped with app | ||
qmlFolder.source = qml | ||
DEPLOYMENTFOLDERS += qmlFolder | ||
|
||
# App entry point | ||
SOURCES += main.cpp | ||
|
||
# Android configuration | ||
android { | ||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android | ||
OTHER_FILES += android/AndroidManifest.xml | ||
} | ||
|
||
# iOS configuration | ||
ios { | ||
QMAKE_INFO_PLIST = ios/Project-Info.plist | ||
OTHER_FILES += $$QMAKE_INFO_PLIST | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# V-Play Apps PropertyCross | ||
|
||
Visit the [V-Play page](http://propertycross.com/vplay/) on the PropertyCross website for screenshots and code sharing metrics. | ||
|
||
## Overview | ||
|
||
[V-Play Apps](http://v-play.net/apps/) allows to create feature-rich, cross-platform native apps for iOS, Android, Windows Phone and others. V-Play Apps was designed with mobile-first in mind, providing components that look and feel native on all supported platforms. The main highlights are: | ||
|
||
- **Native Look and Feel**: Get a native look and feel from a single code base, like a navigation drawer on Android vs tabs on iOS. | ||
- **Auto-adapting UI**: Create one app and support every device, with responsive layout components that adapt to any screen. | ||
- **Animations**: Polish your App with smooth and easy-to-use animations and transitions. | ||
- **Native Performance**: V-Play Apps run fully native on devices. No wrapper, no hybrid. Enjoy full performance instead. | ||
- **Controls**: Buttons, Switches, List Views, Input Controls and more. | ||
- **Device Features & Sensors**: Access to camera, microphone, accelerometer, GPS or file system and add custom C++, Obj-C / Java or native SDKs where needed. | ||
- **Multimedia**: Play a wide range of video and audio formats within your app. | ||
- **Networking & Connectivity**: Powerful components for HTTP connections, Bluetooth, WebSockets and more. | ||
- SQL **Database**, web storage and **localization**/**internationalization** support | ||
- Use **V-Play Plugins** for monetization, analytics, push notifications and social services like Facebook. | ||
|
||
V-Play Apps is part of [V-Play SDK](http://v-play.net/), a framework powered by popular Qt framework. | ||
|
||
|
||
## Building the Application | ||
|
||
1. Sign up for a free account at [v-play.net](http://v-play.net/) and download the V-Play SDK. | ||
2. After installation make sure to install the Android and iOS targets with the Maintenance Tool. | ||
3. You can then open `PropertyCross.pro` with Qt Creator, select your build target and run the app. | ||
|
||
|
||
## Application Structure | ||
|
||
+ `\android` - Resource files used for bundling the Android app | ||
+ `\ios` - Resource files used for bundling the iOS app | ||
+ `\PropertyCross.pro` - Main project file for the V-Play app | ||
+ `\qml` - The actual source code implementation files | ||
+ `\qml\PropertyCrossMain.qml` - Main source file, app entry point | ||
+ `\main.cpp` - Entry point for the native application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<manifest package="com.propertycross.vplay" 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:label="@string/app_name" android:icon="@drawable/ic_launcher"> | ||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" | ||
android:name="org.qtproject.qt5.android.bindings.QtActivity" | ||
android:label="@string/app_name" | ||
android:screenOrientation="unspecified" | ||
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="-- %%INSERT_APP_LIB_NAME%% --"/> | ||
<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="-- %%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 --> | ||
<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_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> | ||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> | ||
<!-- 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/logo"/> | ||
--> | ||
<!-- Splash screen --> | ||
</activity> | ||
</application> | ||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/> | ||
<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. --> | ||
<!-- %%INSERT_PERMISSIONS --> | ||
|
||
<!-- 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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## 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=23.0.1 | ||
androidCompileSdkVersion=23 | ||
buildDir=.build | ||
qt5AndroidDir=C:/vplay/sdks/qt5/5.5/android_armv7/src/android/java |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">PropertyCross</string> | ||
</resources> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIconFile</key> | ||
<string>Icon.png</string> | ||
<key>CFBundleIconFiles</key> | ||
<array> | ||
<string>Icon-60.png</string> | ||
<string>[email protected]</string> | ||
<string>[email protected]</string> | ||
<string>Icon-72.png</string> | ||
<string>[email protected]</string> | ||
<string>Icon-76.png</string> | ||
<string>[email protected]</string> | ||
<string>Icon-Small-40.png</string> | ||
<string>[email protected]</string> | ||
<string>Icon-Small-50.png</string> | ||
<string>[email protected]</string> | ||
<string>Icon.png</string> | ||
<string>[email protected]</string> | ||
</array> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.propertycross.vplay</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>Messages</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>UIViewControllerBasedStatusBarAppearance</key> | ||
<false/> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <VPApplication> | ||
#include <QApplication> | ||
#include <QQmlApplicationEngine> | ||
|
||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
// Init V-Play application | ||
QApplication app(argc, argv); | ||
|
||
VPApplication vplay; | ||
vplay.setPreservePlatformFonts(true); | ||
|
||
QQmlApplicationEngine engine; | ||
vplay.initialize(&engine); | ||
|
||
// Load main QML file | ||
vplay.setMainQmlFileName(QStringLiteral("qml/PropertyCrossMain.qml")); | ||
engine.load(QUrl(vplay.mainQmlFileName())); | ||
|
||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import VPlayApps 1.0 | ||
|
||
|
||
App { | ||
id: app | ||
|
||
// You get free licenseKeys from http://v-play.net/licenseKey | ||
// With a licenseKey you can: | ||
// * Publish your games & apps for the app stores | ||
// * Remove the V-Play Splash Screen or set a custom one (available with the Pro Licenses) | ||
// * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses) | ||
//licenseKey: "<generate one from http://v-play.net/licenseKey>" | ||
|
||
PropertyCrossMainPage { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import QtQuick 2.4 | ||
import QtQuick.Controls 1.2 | ||
|
||
import VPlayApps 1.0 | ||
|
||
import "pages" | ||
import "model" | ||
|
||
Page { | ||
readonly property real contentPadding: dp(Theme.navigationBar.defaultBarItemPadding) // use theme setting for padding, aligns content with navigation bar items | ||
|
||
// make page navigation-stack public, so app-demo launcher can track navigation changes and log screens with Google Analytics | ||
property alias childNavigationStack: navStack | ||
|
||
NavigationStack { | ||
id: navStack | ||
leftColumnIndex: 1 //second page (listings list) is base for left column | ||
|
||
SearchPage { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"title": "PropertyCross", | ||
"identifier": "com.propertycross.vplay", | ||
"orientation": "portrait", | ||
"versioncode": 1, | ||
"versionname": "1.0", | ||
"stage": "test" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
readonly property bool loading: _.numRequests > 0 | ||
|
||
//search for locations called "text" | ||
function search(text, callback) { | ||
_.sendRequest({ | ||
action: "search_listings", | ||
page: 1, | ||
place_name: text | ||
}, callback) | ||
} | ||
|
||
function searchByLocation(latitude, longitude, callback) { | ||
_.sendRequest({ | ||
action: "search_listings", | ||
page: 1, | ||
centre_point: latitude + "," + longitude | ||
}, callback) | ||
} | ||
|
||
//repeat last request for another page number | ||
function repeatForPage(page, callback) { | ||
var params = _.lastParamMap | ||
params.page = page | ||
_.sendRequest(params, callback) | ||
} | ||
|
||
Item { | ||
id: _ //private members | ||
|
||
//number of active HTTP requests | ||
property int numRequests: 0 | ||
|
||
property var lastParamMap: ({}) | ||
|
||
//server API URL with common parameters already included | ||
readonly property string serverUrl: "http://api.nestoria.co.uk/api?country=uk&pretty=1&encoding=json&listing_type=buy" | ||
|
||
//add GET parameters to serverUrl | ||
function buildUrl(paramMap) { | ||
var url = serverUrl | ||
for(var param in paramMap) { | ||
url += "&" + param + "=" + paramMap[param] | ||
} | ||
return url | ||
} | ||
|
||
function sendRequest(paramMap, callback) { | ||
var method = "GET" | ||
var url = buildUrl(paramMap) | ||
|
||
var request = new XMLHttpRequest() | ||
request.onreadystatechange = readyStateChange(request, callback) | ||
request.open(method, url) | ||
|
||
console.debug(method + " " + url) | ||
numRequests++ | ||
request.send() | ||
|
||
lastParamMap = paramMap | ||
} | ||
|
||
function readyStateChange(request, callback) { | ||
return function() { | ||
if(request.readyState === XMLHttpRequest.DONE) { | ||
console.debug("HTTP request done, response status:", request.status) | ||
if(request.status === 200) { | ||
var content = request.responseText | ||
try { | ||
var obj = JSON.parse(content) | ||
} catch(ex) { | ||
console.error("Could not parse server response as JSON:", ex) | ||
return | ||
} | ||
console.debug("Successfully parsed JSON response") | ||
callback(obj) | ||
} | ||
numRequests-- | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.