├── .DS_Store
├── LICENSE
├── PickMeUp-Android
├── .gradle
│ └── 1.12
│ │ └── taskArtifacts
│ │ ├── cache.properties
│ │ ├── cache.properties.lock
│ │ ├── fileHashes.bin
│ │ ├── fileSnapshots.bin
│ │ ├── outputFileStates.bin
│ │ └── taskArtifacts.bin
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── libraries
│ │ ├── org_eclipse_paho_android_service.xml
│ │ ├── org_eclipse_paho_client_mqttv3.xml
│ │ ├── play_services_4_2_42.xml
│ │ └── support_v4_19_1_0.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ ├── vcs.xml
│ └── workspace.xml
├── LICENSE
├── README.md
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── libs
│ │ ├── org.eclipse.paho.android.service.jar
│ │ └── org.eclipse.paho.client.mqttv3.jar
│ ├── proguard-rules.pro
│ └── src
│ │ ├── debug
│ │ └── res
│ │ │ └── values
│ │ │ └── google_maps_api.xml
│ │ ├── main
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── AndroidManifest.xml
│ │ ├── bin
│ │ │ └── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── ibm
│ │ │ │ └── pickmeup
│ │ │ │ ├── PickMeUpApplication.java
│ │ │ │ ├── activities
│ │ │ │ ├── ChatActivity.java
│ │ │ │ ├── ChatPrepActivity.java
│ │ │ │ ├── DriverArrivedActivity.java
│ │ │ │ ├── DriverDetailsActivity.java
│ │ │ │ ├── LoginActivity.java
│ │ │ │ ├── MapActivity.java
│ │ │ │ ├── PaymentSentActivity.java
│ │ │ │ ├── SearchDriversActivity.java
│ │ │ │ └── TripEndDetailsActivity.java
│ │ │ │ ├── dialogs
│ │ │ │ └── ErrorDialog.java
│ │ │ │ ├── receivers
│ │ │ │ └── RouterReceiver.java
│ │ │ │ └── utils
│ │ │ │ ├── ActionListener.java
│ │ │ │ ├── ChatRowAdapter.java
│ │ │ │ ├── ChatUtils.java
│ │ │ │ ├── Constants.java
│ │ │ │ ├── LocationUtils.java
│ │ │ │ ├── MessageConductor.java
│ │ │ │ ├── MessageFactory.java
│ │ │ │ ├── MqttHandler.java
│ │ │ │ └── TopicFactory.java
│ │ ├── project.properties
│ │ └── res
│ │ │ ├── drawable-xxhdpi
│ │ │ ├── edittext.xml
│ │ │ ├── ic_action_map.png
│ │ │ ├── ic_action_microphone.png
│ │ │ ├── ic_action_microphone_recording.png
│ │ │ ├── ic_action_person.png
│ │ │ ├── ic_action_photo.png
│ │ │ ├── ic_action_play.png
│ │ │ ├── ic_action_selfie.png
│ │ │ ├── ic_action_send.png
│ │ │ ├── ic_action_user.png
│ │ │ ├── ic_driver.png
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_passenger.png
│ │ │ ├── ic_user.png
│ │ │ ├── map_details.xml
│ │ │ └── round.xml
│ │ │ ├── layout
│ │ │ ├── activity_chat.xml
│ │ │ ├── activity_chat_prep.xml
│ │ │ ├── activity_driver_arrived.xml
│ │ │ ├── activity_driver_details.xml
│ │ │ ├── activity_login.xml
│ │ │ ├── activity_map.xml
│ │ │ ├── activity_payment_sent.xml
│ │ │ ├── activity_search_drivers.xml
│ │ │ ├── activity_trip_end_details.xml
│ │ │ └── row_layout.xml
│ │ │ ├── menu
│ │ │ ├── chat.xml
│ │ │ ├── chat_map_actions.xml
│ │ │ ├── chat_prep.xml
│ │ │ ├── driver_arrived.xml
│ │ │ ├── driver_details.xml
│ │ │ ├── login.xml
│ │ │ ├── payment_sent.xml
│ │ │ ├── search_drivers.xml
│ │ │ └── trip_end_details.xml
│ │ │ ├── values-v11
│ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ │ └── values
│ │ │ ├── attrs.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── release
│ │ └── res
│ │ └── values
│ │ └── google_maps_api.xml
├── build.gradle
├── build
│ └── intermediates
│ │ ├── exploded-aar
│ │ ├── com.android.support
│ │ │ └── appcompat-v7
│ │ │ │ └── 19.1.0
│ │ │ │ ├── .classpath
│ │ │ │ ├── .project
│ │ │ │ ├── bin
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── classes
│ │ │ │ │ └── .gitignore
│ │ │ │ ├── gen
│ │ │ │ └── .gitignore
│ │ │ │ └── project.properties
│ │ └── com.google.android.gms
│ │ │ └── play-services
│ │ │ └── 4.2.42
│ │ │ ├── .classpath
│ │ │ ├── .project
│ │ │ ├── bin
│ │ │ ├── AndroidManifest.xml
│ │ │ └── classes
│ │ │ │ └── .gitignore
│ │ │ ├── gen
│ │ │ └── .gitignore
│ │ │ └── project.properties
│ │ └── model_data.bin
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
├── PickMeUp-HTML5
├── LICENSE
├── License.txt
├── README.md
├── css
│ └── style.css
├── img
│ ├── marker.png
│ └── person.png
├── index.html
└── js
│ ├── App.js
│ ├── Messenger.js
│ ├── Utils.js
│ ├── main.js
│ └── utils
│ ├── OpenLayers.js
│ ├── jquery.min.js
│ ├── mqttws31.js
│ └── theme
│ └── default
│ └── style.css
├── PickMeUp-iOS
├── LICENSE
├── PickMeUp.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── PickMeUp.xccheckout
├── PickMeUp
│ ├── Base.lproj
│ │ └── .DS_Store
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Main_iPad.storyboard
│ ├── Main_iPhone.storyboard
│ ├── PMUAppDelegate.h
│ ├── PMUAppDelegate.m
│ ├── PMUCallbacks.h
│ ├── PMUCallbacks.m
│ ├── PMUChatViewController.h
│ ├── PMUChatViewController.m
│ ├── PMUConstants.h
│ ├── PMUConstants.m
│ ├── PMUDriver.h
│ ├── PMUDriver.m
│ ├── PMUFinalizeViewController.h
│ ├── PMUFinalizeViewController.m
│ ├── PMUMapViewController.h
│ ├── PMUMapViewController.m
│ ├── PMUMessage.h
│ ├── PMUMessage.m
│ ├── PMUMessageFactory.h
│ ├── PMUMessageFactory.m
│ ├── PMUMessageTableView.h
│ ├── PMUMessageTableView.m
│ ├── PMUMessageTableViewDataSource.h
│ ├── PMUMessenger.h
│ ├── PMUMessenger.m
│ ├── PMUPairingViewController.h
│ ├── PMUPairingViewController.m
│ ├── PMURequest.h
│ ├── PMURequest.m
│ ├── PMURequestViewController.h
│ ├── PMURequestViewController.m
│ ├── PMUSpinnerViewController.h
│ ├── PMUSpinnerViewController.m
│ ├── PMUTopicFactory.h
│ ├── PMUTopicFactory.m
│ ├── PickMeUp-Info.plist
│ ├── PickMeUp-Prefix.pch
│ ├── Secondary_iPhone.storyboard
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── icons
│ │ ├── .DS_Store
│ │ ├── Icon-40.png
│ │ ├── Icon-40@2x.png
│ │ ├── Icon-60.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-76.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small@2x.png
│ │ ├── appIcon.png
│ │ ├── bubbleMine.png
│ │ ├── bubbleMine@2x.png
│ │ ├── bubbleSomeone.png
│ │ ├── bubbleSomeone@2x.png
│ │ ├── ic_action_map.png
│ │ ├── ic_action_microphone.png
│ │ ├── ic_action_microphone_recording.png
│ │ ├── ic_action_person.png
│ │ ├── ic_action_photo.png
│ │ ├── ic_action_play.png
│ │ ├── ic_action_selfie.png
│ │ ├── ic_action_send.png
│ │ ├── ic_action_user.png
│ │ ├── ic_driver.png
│ │ ├── ic_passenger.png
│ │ └── ic_user.png
│ ├── include
│ │ └── MqttOCClient.h
│ ├── lib
│ │ └── libiosMQTT.a
│ └── main.m
├── PickMeUpTests
│ ├── PickMeUpTests-Info.plist
│ ├── PickMeUp_Tests.m
│ └── en.lproj
│ │ └── InfoPlist.strings
└── README.md
└── README.md
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/.DS_Store
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/cache.properties:
--------------------------------------------------------------------------------
1 | #Wed Jul 23 15:16:03 CDT 2014
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/cache.properties.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/.gradle/1.12/taskArtifacts/cache.properties.lock
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/.gradle/1.12/taskArtifacts/fileHashes.bin
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/fileSnapshots.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/.gradle/1.12/taskArtifacts/fileSnapshots.bin
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/outputFileStates.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/.gradle/1.12/taskArtifacts/outputFileStates.bin
--------------------------------------------------------------------------------
/PickMeUp-Android/.gradle/1.12/taskArtifacts/taskArtifacts.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/.gradle/1.12/taskArtifacts/taskArtifacts.bin
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/.name:
--------------------------------------------------------------------------------
1 | PickMeUp-Android
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/libraries/org_eclipse_paho_android_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/libraries/org_eclipse_paho_client_mqttv3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/libraries/play_services_4_2_42.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/libraries/support_v4_19_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/PickMeUp-Android/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PickMeUp-Android/README.md:
--------------------------------------------------------------------------------
1 | #Set up the PickMeUp Android project
2 |
3 | ##Prerequisites
4 | The following are the prerequisites for running the PickMeUp Android application:
5 |
6 | * PickMeUp Android application requires an Android device with Android 4.1 Jelly Bean (API level 16) or higher to run.
7 | * Running PickMeUp on an emulator is not advised as PickMeUp is using Google Play Services and Location Services. Using an emulator might cause the application to run with reduced functionality.
8 | * The application has been tested using Google Nexus 4, Google Nexus 7 and Samsung Galaxy S4. Using a smaller display or lower screen resolution is not recommended.
9 | * Google Account and Google Maps Android API v2 key is required to build the application.
10 | * Android SDK toolkit is required to build PickMeUp application. Stand-alone SDK tools as well as Eclipse or Android Studio bundle can be used.
11 | * PickMeUp source code includes a Gradle build file which can be run using Gradle command line tools, Android Studio IDE or using Eclipse with the Gradle plugin.
12 |
13 | ##Registering for Google Maps API
14 | Opening a Google account and registering for Google Maps API is free of charge. Any Google account can be used to obtain the key for debug and development purposes.
15 |
16 | **Note:** Before building the PickMeUp application, a Google Maps API key is required. To get a Google Maps API key simply follow this link and press *Create*:
17 |
18 | https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=9F:22:30:50:6D:43:4D:E7:FB:98:79:76:DC:67:E1:1B:CF:9A:01:10%3Bcom.ibm.pickmeup
19 |
20 | To add the credentials to an existing key the following line can be used:
21 |
22 | 9F:22:30:50:6D:43:4D:E7:FB:98:79:76:DC:67:E1:1B:CF:9A:01:10;com.ibm.pickmeup
23 |
24 | Once the key is generated, replace the google_maps_key entry with the key inside the following file:
25 | /PickMeUp/app/src/debug/res/values/google_maps_api.xml
26 |
27 | The key should start with *AIza*.
28 |
29 | ##Android SDK Packages
30 | The following SDK packages are required to build the PickMeUp application:
31 | * Android 4.4.2 (API 19) - SDK Platform
32 | * Google Repository
33 | * Android Support Repository
34 | * Android SDK Build-tools 19.1
--------------------------------------------------------------------------------
/PickMeUp-Android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 19
5 | buildToolsVersion "19.1.0"
6 |
7 | defaultConfig {
8 | applicationId "com.ibm.pickmeup"
9 | minSdkVersion 16
10 | targetSdkVersion 19
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | runProguard false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.google.android.gms:play-services:4.2.42'
25 | // You must install or update the Support Repository through the SDK manager to use this dependency.
26 | compile 'com.android.support:support-v4:19.+'
27 | compile files('libs/org.eclipse.paho.client.mqttv3.jar')
28 | compile files('libs/org.eclipse.paho.android.service.jar')
29 | }
30 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/libs/org.eclipse.paho.android.service.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/libs/org.eclipse.paho.android.service.jar
--------------------------------------------------------------------------------
/PickMeUp-Android/app/libs/org.eclipse.paho.client.mqttv3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/libs/org.eclipse.paho.client.mqttv3.jar
--------------------------------------------------------------------------------
/PickMeUp-Android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/user/dev/android-sdk-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/debug/res/values/google_maps_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 | YOUR_KEY_HERE
18 |
19 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | LoginActivity
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
26 |
27 |
33 |
36 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
54 |
55 |
57 |
58 |
60 |
61 |
65 |
66 |
71 |
72 |
74 |
75 |
77 |
78 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
25 |
26 |
32 |
35 |
38 |
39 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
53 |
54 |
56 |
57 |
59 |
60 |
62 |
63 |
67 |
68 |
70 |
71 |
73 |
74 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/PickMeUpApplication.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup;
14 |
15 | import android.app.Application;
16 | import android.content.SharedPreferences;
17 | import android.graphics.Bitmap;
18 | import android.util.Log;
19 |
20 | import com.ibm.pickmeup.utils.Constants;
21 |
22 | import java.io.File;
23 |
24 | /**
25 | * PickMeUpApplication class is used to share global variables across Activities as well as setup
26 | * MQTT broker address and port number. This class gets executed before the main Activity
27 | */
28 | public class PickMeUpApplication extends Application {
29 |
30 | private final static String TAG = PickMeUpApplication.class.getName();
31 | private String driverName;
32 | private String driverId;
33 | private Bitmap driverPhoto;
34 | private Bitmap passengerPhoto;
35 | private String currentRunningActivity;
36 |
37 | @Override
38 | public void onCreate() {
39 | Log.d(TAG, ".onCreate() entered");
40 | super.onCreate();
41 | SharedPreferences settings = getSharedPreferences(Constants.SETTINGS, 0);
42 | SharedPreferences.Editor editor = settings.edit();
43 | editor.putString(Constants.SETTINGS_MQTT_SERVER, "messagesight.demos.ibm.com");
44 | editor.putString(Constants.SETTINGS_MQTT_PORT, "1883");
45 | editor.commit();
46 |
47 | // cleanup old voice chat messages
48 | File chatDirectory = this.getExternalFilesDir(null);
49 | for (File file : chatDirectory.listFiles()) {
50 | if (file.getName().contains(Constants.CHAT)) {
51 | Log.d(TAG, ".onCreate() - Cleaning up old voice chat messages - "+file.getName());
52 | file.delete();
53 | }
54 | }
55 | }
56 |
57 | public String getDriverName() {
58 | return this.driverName;
59 | }
60 |
61 | public void setDriverName(String name) {
62 | this.driverName = name;
63 | }
64 |
65 | public Bitmap getDriverPhoto() {
66 | return this.driverPhoto;
67 | }
68 |
69 | public void setDriverPhoto(Bitmap photo) {
70 | this.driverPhoto = photo;
71 | }
72 |
73 | public Bitmap getPassengerPhoto() {
74 | return this.passengerPhoto;
75 | }
76 |
77 | public void setPassengerPhoto(Bitmap photo) {
78 | this.passengerPhoto = photo;
79 | }
80 |
81 | public String getDriverId() { return this.driverId; }
82 |
83 | public void setDriverId(String driverId) {
84 | this.driverId = driverId;
85 | }
86 |
87 | public String getCurrentRunningActivity() {
88 | return currentRunningActivity;
89 | }
90 |
91 | public void setCurrentRunningActivity(String currentRunningActivity) {
92 | this.currentRunningActivity = currentRunningActivity;
93 | }
94 |
95 | public void setCurrentRunningActivityEmpty() {
96 | this.currentRunningActivity = null;
97 | }
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/activities/ChatPrepActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.activities;
14 |
15 | import android.app.Activity;
16 | import android.content.Intent;
17 | import android.content.SharedPreferences;
18 | import android.graphics.Bitmap;
19 | import android.os.Bundle;
20 | import android.provider.MediaStore;
21 | import android.util.Log;
22 | import android.view.View;
23 | import android.view.Window;
24 | import android.widget.Button;
25 | import android.widget.ImageView;
26 | import android.widget.TextView;
27 |
28 | import com.ibm.pickmeup.PickMeUpApplication;
29 | import com.ibm.pickmeup.R;
30 | import com.ibm.pickmeup.utils.Constants;
31 | import com.ibm.pickmeup.utils.MessageFactory;
32 | import com.ibm.pickmeup.utils.MqttHandler;
33 | import com.ibm.pickmeup.utils.TopicFactory;
34 |
35 | public class ChatPrepActivity extends Activity {
36 |
37 | private final static String TAG = ChatPrepActivity.class.getName();
38 | private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 1;
39 | private ImageView cameraButton;
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | Log.d(TAG, ".onCreate() entered");
44 |
45 | super.onCreate(savedInstanceState);
46 |
47 | // hide the Action bar
48 | getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
49 | if (getActionBar() != null) {
50 | getActionBar().hide();
51 | }
52 | setContentView(R.layout.activity_chat_prep);
53 |
54 | // initialise
55 | initChatPrepActivity();
56 | }
57 |
58 | /**
59 | * Initialising onscreen elements
60 | */
61 | private void initChatPrepActivity() {
62 | Log.d(TAG, ".initChatPrepActivity() entered");
63 |
64 | // get passenger name from the preferences
65 | SharedPreferences settings = getSharedPreferences(Constants.SETTINGS, 0);
66 | TextView name = (TextView) findViewById(R.id.passengerName);
67 | name.setText(settings.getString(Constants.SETTINGS_NAME, ""));
68 |
69 | // setup camera button for taking a selfie
70 | cameraButton = (ImageView) findViewById(R.id.selfieButton);
71 | cameraButton.setOnClickListener(new View.OnClickListener() {
72 | @Override
73 | public void onClick(View v) {
74 |
75 | //snapping a picture using an existing default camera app
76 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
77 | if (intent.resolveActivity(getPackageManager()) != null) {
78 | startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
79 | }
80 | }
81 | });
82 |
83 | // setup continue button
84 | Button button = (Button) findViewById(R.id.pickmeupButton);
85 | button.setOnClickListener(new View.OnClickListener() {
86 | @Override
87 | public void onClick(View v) {
88 | // move to the next screen
89 | Intent searchDriverIntent = new Intent(getApplicationContext(), SearchDriversActivity.class);
90 | startActivity(searchDriverIntent);
91 | }
92 | });
93 | }
94 |
95 | @Override
96 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
97 | Log.d(TAG, ".onActivityResult() entered");
98 | if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK) {
99 | Log.d(TAG, ".onActivityResult() - Result code is OK");
100 |
101 | // getting selfie bitmap
102 | Bundle extras = data.getExtras();
103 | Bitmap imageBitmap = (Bitmap) extras.get(Constants.DATA);
104 |
105 | // scaling selfie to 256x256
106 | Bitmap passengerSelfie = Bitmap.createScaledBitmap(imageBitmap, 256, 256, true);
107 | if (cameraButton == null) {
108 | cameraButton = (ImageView) findViewById(R.id.selfieButton);
109 | }
110 |
111 | // setting selfie to the camera button
112 | cameraButton.setAdjustViewBounds(false);
113 | cameraButton.setScaleType(ImageView.ScaleType.FIT_CENTER);
114 | cameraButton.setImageBitmap(passengerSelfie);
115 |
116 | // recording selfie bitmap in memory for other activities to use
117 | PickMeUpApplication app = (PickMeUpApplication) getApplication();
118 | app.setPassengerPhoto(passengerSelfie);
119 |
120 | // making the continue button visible
121 | Button continueButton = (Button) findViewById(R.id.pickmeupButton);
122 | continueButton.setVisibility(View.VISIBLE);
123 | }
124 | }
125 |
126 | @Override
127 | public void onBackPressed() {
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/activities/DriverArrivedActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.activities;
14 |
15 | import android.app.Activity;
16 | import android.graphics.Bitmap;
17 | import android.graphics.BitmapFactory;
18 | import android.os.Bundle;
19 | import android.util.Log;
20 | import android.view.Window;
21 | import android.widget.ImageView;
22 | import android.widget.TextView;
23 |
24 | import com.ibm.pickmeup.PickMeUpApplication;
25 | import com.ibm.pickmeup.R;
26 |
27 | public class DriverArrivedActivity extends Activity {
28 |
29 | private final static String TAG = DriverArrivedActivity.class.getName();
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | Log.d(TAG, ".onCreate() entered");
34 |
35 | super.onCreate(savedInstanceState);
36 |
37 | // hide the Action bar
38 | getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
39 | if (getActionBar() != null) {
40 | getActionBar().hide();
41 | }
42 |
43 | setContentView(R.layout.activity_driver_arrived);
44 |
45 | // initialse
46 | initDriverArrivedActivity();
47 | }
48 |
49 | /**
50 | * Initialising onscreen elements
51 | */
52 | private void initDriverArrivedActivity() {
53 | Log.d(TAG, ".initDriverArrivedActivity() entered");
54 |
55 | PickMeUpApplication app = (PickMeUpApplication) getApplication();
56 |
57 | // setting driver name
58 | TextView driverName = (TextView) findViewById(R.id.driverArrivedName);
59 | driverName.setText(app.getDriverName());
60 |
61 | // setting driver picture
62 | ImageView picture = (ImageView) findViewById(R.id.driverArrivedPhoto);
63 | Bitmap driverPhoto = app.getDriverPhoto();
64 | if (driverPhoto == null) {
65 | driverPhoto = BitmapFactory.decodeResource(getResources(), R.drawable.ic_user);
66 | }
67 | picture.setImageBitmap(driverPhoto);
68 | }
69 |
70 | @Override
71 | public void onBackPressed() {
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/activities/LoginActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.activities;
14 |
15 | import android.app.Activity;
16 | import android.content.Context;
17 | import android.content.Intent;
18 | import android.content.SharedPreferences;
19 | import android.os.Bundle;
20 | import android.util.Log;
21 | import android.view.View;
22 | import android.view.Window;
23 | import android.widget.Button;
24 | import android.widget.TextView;
25 | import android.widget.Toast;
26 |
27 | import com.ibm.pickmeup.R;
28 | import com.ibm.pickmeup.utils.Constants;
29 | import com.ibm.pickmeup.utils.LocationUtils;
30 |
31 | public class LoginActivity extends Activity {
32 |
33 | private final static String TAG = LoginActivity.class.getName();
34 | private Context context;
35 | private TextView name;
36 | private SharedPreferences settings;
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | Log.d(TAG, ".onCreate() entered");
41 |
42 | super.onCreate(savedInstanceState);
43 |
44 | // hide the Action bar
45 | getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
46 | if (getActionBar() != null) {
47 | getActionBar().hide();
48 | }
49 |
50 | setContentView(R.layout.activity_login);
51 | }
52 |
53 | @Override
54 | protected void onResume() {
55 | Log.d(TAG, ".onResume() entered");
56 |
57 | super.onResume();
58 |
59 | // initialise
60 | initialiseLoginActivity();
61 |
62 | // connect to location services
63 | LocationUtils.getInstance(context).connect();
64 | }
65 |
66 | @Override
67 | protected void onDestroy() {
68 | Log.d(TAG, ".onDestroy() entered");
69 |
70 | super.onDestroy();
71 |
72 | // disconnect from location services
73 | LocationUtils.getInstance(context).disconnect();
74 | }
75 |
76 | /**
77 | * Initialising onscreen elements and shared properties
78 | */
79 | private void initialiseLoginActivity() {
80 | Log.d(TAG, ".initialiseLoginActivity() entered");
81 |
82 | context = getApplicationContext();
83 | settings = getSharedPreferences(Constants.SETTINGS, 0);
84 |
85 | // setting up the name input field
86 | name = (TextView) findViewById(R.id.loginName);
87 | name.setText(settings.getString(Constants.SETTINGS_NAME, ""));
88 | name.setBackgroundResource(R.drawable.edittext);
89 |
90 | Button button = (Button) findViewById(R.id.loginButton);
91 | button.setOnClickListener(new View.OnClickListener() {
92 | @Override
93 | public void onClick(View v) {
94 | handleOnLogin();
95 | }
96 | });
97 | }
98 |
99 | /**
100 | * Method to handle passenger name on login and start serching for available drivers
101 | */
102 | private void handleOnLogin() {
103 | Log.d(TAG, ".handleOnLogin() entered");
104 |
105 | String passengerName = name.getText().toString();
106 | // check if name is empty
107 | if (name.getText() == null || name.getText().length() == 0) {
108 | Log.d(TAG, ".handleOnLogin() - Passenger name was left empty");
109 | Toast.makeText(context, R.string.name_not_specified, Toast.LENGTH_LONG).show();
110 | } else {
111 | Log.d(TAG, ".handleOnLogin() - Passenger name is "+passengerName);
112 |
113 | // save passenger name to shared preferences
114 | SharedPreferences.Editor editor = settings.edit();
115 | editor.putString(Constants.SETTINGS_NAME, passengerName);
116 | editor.commit();
117 |
118 | // start next activity
119 | prepareProfile();
120 | }
121 | }
122 |
123 | /**
124 | * Starts next activity
125 | */
126 | private void prepareProfile() {
127 | Log.d(TAG, ".searchForDrivers() entered");
128 | // call next activity
129 | Intent chatPrepIntent = new Intent(context, ChatPrepActivity.class);
130 | startActivity(chatPrepIntent);
131 | }
132 |
133 | @Override
134 | public void onBackPressed() {
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/activities/SearchDriversActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.activities;
14 |
15 | import android.app.Activity;
16 | import android.content.BroadcastReceiver;
17 | import android.content.Context;
18 | import android.content.Intent;
19 | import android.content.IntentFilter;
20 | import android.os.Bundle;
21 | import android.util.Log;
22 | import android.view.Window;
23 |
24 | import com.ibm.pickmeup.R;
25 | import com.ibm.pickmeup.dialogs.ErrorDialog;
26 | import com.ibm.pickmeup.utils.Constants;
27 | import com.ibm.pickmeup.utils.MessageFactory;
28 | import com.ibm.pickmeup.utils.MqttHandler;
29 | import com.ibm.pickmeup.utils.TopicFactory;
30 |
31 | public class SearchDriversActivity extends Activity {
32 |
33 | private final static String TAG = SearchDriversActivity.class.getName();
34 | private BroadcastReceiver connectivityReceiver;
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | Log.d(TAG, ".onCreate() entered");
39 | super.onCreate(savedInstanceState);
40 |
41 | // hide action bar
42 | getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
43 | if (getActionBar() != null) {
44 | getActionBar().hide();
45 | }
46 |
47 | setContentView(R.layout.activity_search_drivers);
48 | }
49 |
50 | @Override
51 | protected void onResume() {
52 | Log.d(TAG, ".onResume() entered");
53 | super.onResume();
54 |
55 | //register receivers
56 | registerReceivers();
57 |
58 | //connect to MQTT broker
59 | connectToMqtt();
60 | }
61 |
62 | @Override
63 | protected void onPause() {
64 | super.onPause();
65 |
66 | // unregister connectivityReceiver
67 | unregisterReceivers();
68 | }
69 |
70 | /**
71 | * Message to initiate an MQTT connection
72 | */
73 | private void connectToMqtt() {
74 | Log.d(TAG, ".connectToMqtt() entered");
75 | // grab hold of MqttHandler to connect to the server
76 | MqttHandler.getInstance(this).connect();
77 | }
78 |
79 | /**
80 | * Create and register connectivityReceiver
81 | */
82 | private void registerReceivers() {
83 |
84 | // create connectivityReceiver if it doesn't exist
85 | if (connectivityReceiver == null) {
86 | Log.d(TAG, ".onResume() - Registering connectivityReceiver");
87 | connectivityReceiver = new BroadcastReceiver() {
88 |
89 | @Override
90 | public void onReceive(Context context, Intent intent) {
91 | Log.d(TAG, ".onReceive() - Received intent for connectivityReceiver");
92 | if (intent.getIntExtra(Constants.CONNECTIVITY_MESSAGE, -1) == Constants.ERROR_BROKER_UNAVAILABLE) {
93 | // the connection was unsuccessful - show the error dialog to the user
94 | ErrorDialog dialog = new ErrorDialog();
95 | dialog.setCancelable(false);
96 | dialog.show(getFragmentManager(), "");
97 | }
98 | }
99 | };
100 | }
101 |
102 | // register connectivityReceiver
103 | getApplicationContext().registerReceiver(connectivityReceiver,
104 | new IntentFilter(Constants.ACTION_INTENT_CONNECTIVITY_MESSAGE_RECEIVED));
105 | }
106 |
107 | /**
108 | * Unregister all local BroadcastReceivers
109 | */
110 | private void unregisterReceivers() {
111 | Log.d(TAG, ".unregisterReceivers() entered");
112 | if (connectivityReceiver != null) {
113 | getApplicationContext().unregisterReceiver(connectivityReceiver);
114 | connectivityReceiver = null;
115 | }
116 | }
117 |
118 | @Override
119 | public void onBackPressed() {
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/dialogs/ErrorDialog.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.dialogs;
14 |
15 | import android.app.Activity;
16 | import android.app.AlertDialog;
17 | import android.app.Dialog;
18 | import android.app.DialogFragment;
19 | import android.content.DialogInterface;
20 | import android.os.Bundle;
21 | import android.util.Log;
22 |
23 | import com.ibm.pickmeup.R;
24 | import com.ibm.pickmeup.utils.MqttHandler;
25 |
26 | /**
27 | * ErrorDialog is a dialog that displays an error message when the client cannot connect to the
28 | * MQTT broker. The dialog will offer the user to go to the previous screen (Exit) or retry
29 | * connecting to the server (Retry)
30 | */
31 |
32 | public class ErrorDialog extends DialogFragment {
33 |
34 | private static final String TAG = ErrorDialog.class.getName();
35 | private Activity currentActivity;
36 |
37 | @Override
38 | public Dialog onCreateDialog(Bundle savedInstanceState) {
39 | Log.d(TAG, ".onCreateDialog() entered");
40 |
41 | // get hold of the current activity
42 | currentActivity = getActivity();
43 |
44 | // Use the Builder class for convenient dialog construction
45 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
46 | builder.setMessage(R.string.broker_unavailable_check_connectivity)
47 | .setPositiveButton(R.string.retry,
48 | new DialogInterface.OnClickListener() {
49 | public void onClick(DialogInterface dialog,
50 | int id) {
51 | Log.d(TAG, ".onClick() entered - retry button");
52 |
53 | // attempt to reconnect
54 | MqttHandler.getInstance(currentActivity.getApplicationContext()).connect();
55 | }
56 | }
57 | ).setNegativeButton(R.string.exit,
58 | new DialogInterface.OnClickListener() {
59 | public void onClick(DialogInterface dialog,
60 | int id) {
61 | Log.d(TAG, ".onClick() entered - exit button");
62 |
63 | // go back to the previous screen
64 | currentActivity.finish();
65 | }
66 | }
67 | );
68 |
69 | return builder.create();
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/utils/ChatUtils.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.utils;
14 |
15 | import android.content.Context;
16 | import android.content.Intent;
17 | import android.util.Log;
18 |
19 | import com.ibm.pickmeup.PickMeUpApplication;
20 | import com.ibm.pickmeup.activities.ChatActivity;
21 |
22 | import java.util.ArrayList;
23 | import java.util.Iterator;
24 | import java.util.List;
25 | import java.util.concurrent.CopyOnWriteArrayList;
26 |
27 | /**
28 | * ChatUtils is used to create ChatMessages, save ChatMessages in a list to be displayed in a
29 | * chat window at a later stage (i.e. when the ChatActivity gets opened) or emit broadcasts to
30 | * ChatActivity to display chat messages if the activity is on the foreground.
31 | */
32 | public class ChatUtils {
33 | private final static String TAG = ChatUtils.class.getName();
34 | private static ChatUtils instance;
35 | private Context context;
36 | private PickMeUpApplication app;
37 | private List chatMessageList;
38 |
39 | private ChatUtils(Context context) {
40 | this.context = context;
41 | this.app = (PickMeUpApplication) context.getApplicationContext();
42 | this.chatMessageList = new CopyOnWriteArrayList();
43 | }
44 |
45 | public static ChatUtils getInstance(Context context) {
46 | Log.d(TAG, ".getInstance() entered");
47 | if (instance == null) {
48 | instance = new ChatUtils(context);
49 | }
50 | return instance;
51 | }
52 |
53 | /**
54 | * Method to process a chat message string. If ChatActivity is in the foreground, this method
55 | * will send a broadcast to the activity to display the chat message. Alternatively the message
56 | * is added to the chatMessageList to be collected later.
57 | *
58 | * @param msg chat message string
59 | */
60 | public void addTextMessageToChat(String msg) {
61 | Log.d(TAG, ".addTextMessageToChat() entered");
62 | String runningActivity = app.getCurrentRunningActivity();
63 | if (runningActivity != null && runningActivity.equals(ChatActivity.class.getName())) {
64 | // current running activity is ChatActivity
65 | Intent actionIntent = new Intent(Constants.ACTION_INTENT_CHAT_MESSAGE_PROCESSED);
66 | actionIntent.putExtra(Constants.DATA, msg);
67 | actionIntent.putExtra(Constants.FORMAT, Constants.TEXT);
68 | context.sendBroadcast(actionIntent);
69 | } else {
70 | // current running activity is not ChatActivity
71 | chatMessageList.add(msg);
72 | }
73 | }
74 |
75 | /**
76 | * Get chat message off the chatMessageList if there are any. This method will remove chat
77 | * messages off the chatMessageList while processing them
78 | *
79 | * @return messageListInstance list of messages collected from chatMessageList or null if none
80 | * were available
81 | */
82 | public ArrayList getChatMessagesIfAny() {
83 | Log.d(TAG, ".getChatMessagesIfAny() entered");
84 | if (chatMessageList.size() > 0) {
85 | ArrayList messageListInstance = new ArrayList();
86 | for (String message : chatMessageList) {
87 | messageListInstance.add(message);
88 | // once we added the message to the messageListInstance we can remove it
89 | chatMessageList.remove(message);
90 | }
91 | return messageListInstance;
92 | }
93 | // no messages in the list - return null
94 | return null;
95 | }
96 |
97 | public enum ChatSenderType {
98 | PASSENGER, DRIVER
99 | }
100 |
101 | /**
102 | * ChatMessage class is a simple wrapper object around a chat string, sender type
103 | * (driver or passenger) and chat message type (text or voice)
104 | */
105 | public class ChatMessage {
106 |
107 | private String message;
108 | private ChatSenderType type;
109 | private String chatMessageType;
110 |
111 | public ChatMessage(String chatMessage, ChatSenderType type, String chatMessageType) {
112 | this.type = type;
113 | this.message = chatMessage;
114 | this.chatMessageType = chatMessageType;
115 | }
116 |
117 | public String getMessage() {
118 | return this.message;
119 | }
120 |
121 | public ChatSenderType getSenderType() {
122 | return this.type;
123 | }
124 |
125 | public String getChatMessageType() { return this.chatMessageType; }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/utils/Constants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.utils;
14 |
15 | /**
16 | * Constants utils class
17 | */
18 | public class Constants {
19 |
20 | public final static String APP_ID = "com.ibm.pickmeup";
21 |
22 | public final static String SETTINGS_MQTT_SERVER = "messagesight.demos.ibm.com";
23 | public final static String SETTINGS_MQTT_PORT = "1883";
24 | public final static String SETTINGS_NAME = "name";
25 | public final static String SETTINGS = APP_ID+".Settings";
26 |
27 | public enum ActionStateStatus {
28 | CONNECTING, CONNECTED, DISCONNECTED, SUBSCRIBE, UNSIBSCRIBE, PUBLISH
29 | }
30 |
31 | public final static String PICK_ME_UP = "pickmeup/";
32 | public final static String PASSENGER_HEAD_PREFIX = PICK_ME_UP+"passengers/";
33 | public final static String REQUESTS_HEAD_PREFIX = PICK_ME_UP+"requests/";
34 | public final static String DRIVER_HEAD_PREFIX = PICK_ME_UP+"drivers/";
35 | public final static String INBOX = "inbox";
36 | public final static String PICTURE = "picture";
37 | public final static String PAYMENTS = "payments";
38 |
39 | public final static String NAME = "name";
40 | public final static String TRIP_START = "tripStart";
41 | public final static String TRIP_END = "tripEnd";
42 | public final static String TRIP_PROCESSED = "tripProcessed";
43 | public final static String COST = "cost";
44 | public final static String TIP = "tip";
45 | public final static String RATING = "rating";
46 | public final static String TIME = "time";
47 | public final static String DISTANCE= "distance";
48 | public final static String MILES= "mi";
49 | public final static String CONNECTION_TIME = "connectionTime";
50 | public final static String LONGITUDE = "lon";
51 | public final static String LATITUDE = "lat";
52 | public final static String LOCATION = "location";
53 | public final static String TYPE = "type";
54 | public final static String ACCEPT = "accept";
55 | public final static String DRIVER_ID = "driverId";
56 | public final static String PASSENGER_ID = "passengerId";
57 | public final static String URL = "url";
58 | public final static String CHAT = "chat";
59 | public final static String FORMAT = "format";
60 | public final static String DATA = "data";
61 | public final static String TEXT = "text";
62 | public final static String PAYMENT_TOTAL = "paymentTotal";
63 | public final static String DRIVER_PICTURE = "driverPicture";
64 | public final static String CONNECTIVITY_MESSAGE = "connectivityMessage";
65 | public final static String ROUTE_MESSAGE_TYPE = "routeMessageType";
66 | public final static String BASE64_PHOTO_PREFIX = "data:image/png;base64,";
67 |
68 | public final static String ACTION_INTENT_DRIVER_ACCEPTED = Constants.APP_ID + "." + "DRIVER_ACCEPTED";
69 | public final static String ACTION_INTENT_DRIVER_DETAILS_RECEIVED = Constants.APP_ID + "." + "DRIVER_DETAILS_RECEIVED";
70 | public final static String ACTION_INTENT_DRIVER_DETAILS_UPDATE = Constants.APP_ID + "." + "DRIVER_DETAILS_UPDATE";
71 | public final static String ACTION_INTENT_CHAT_MESSAGE_RECEIVED = Constants.APP_ID + "." + "CHAT_MESSAGE_RECEIVED";
72 | public final static String ACTION_INTENT_CHAT_MESSAGE_PROCESSED = Constants.APP_ID + "." + "CHAT_MESSAGE_PROCESSED";
73 | public final static String ACTION_INTENT_CONNECTIVITY_MESSAGE_RECEIVED = Constants.APP_ID + "." + "CONNECTIVITY_MESSAGE_RECEIVED";
74 | public final static String ACTION_INTENT_COORDINATES_CHANGED = Constants.APP_ID + "." + "COORDINATES_CHANGED";
75 | public final static String ACTION_INTENT_START_TRIP = Constants.APP_ID + "." + "START_TRIP";
76 | public final static String ACTION_INTENT_END_TRIP = Constants.APP_ID + "." + "END_TRIP";
77 | public final static String ACTION_INTENT_ROUTE_MESSAGE = Constants.APP_ID + "." + "ROUTER";
78 | public final static String ACTION_INTENT_PAYMENT_RECEIVED = Constants.APP_ID + "." + "PAYMENT_RECEIVED";
79 |
80 | public final static int LOCATION_MIN_TIME = 30000;
81 | public final static float LOCATION_MIN_DISTANCE = 5;
82 | public final static double DEFAULT_LATITUDE = 30.390361;
83 | public final static double DEFAULT_LONGITUDE = -97.7110845;
84 |
85 | public final static String AUDIO_FORMAT = ".3gp";
86 | public final static String VOICE = "data:audio/wav;base64";
87 | public final static String LOW_BEEP = "lowBeep";
88 | public final static String HIGH_BEEP = "highBeep";
89 |
90 | public final static int ERROR_BROKER_UNAVAILABLE = 3;
91 | }
92 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/java/com/ibm/pickmeup/utils/TopicFactory.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | ******************************************************************************/
13 | package com.ibm.pickmeup.utils;
14 |
15 | import android.content.Context;
16 | import android.content.SharedPreferences;
17 |
18 | import com.ibm.pickmeup.PickMeUpApplication;
19 |
20 | /**
21 | * TopicFactory is a utils class that generates topic strings according to the Constants
22 | */
23 | public class TopicFactory {
24 |
25 | private static TopicFactory instance;
26 | private SharedPreferences settings;
27 | private PickMeUpApplication app;
28 |
29 | public static TopicFactory getInstance(Context context) {
30 | if (instance == null) {
31 | instance = new TopicFactory(context);
32 | }
33 | return instance;
34 | }
35 |
36 | private TopicFactory(Context context) {
37 | settings = context.getSharedPreferences(Constants.SETTINGS, 0);
38 | app = (PickMeUpApplication) context.getApplicationContext();
39 | }
40 |
41 | public String getPassengerPhotoTopic() {
42 | return Constants.PASSENGER_HEAD_PREFIX+getPassengerId()+"/"+Constants.PICTURE;
43 | }
44 |
45 | public String getPassengerInboxTopic() {
46 | return Constants.PASSENGER_HEAD_PREFIX+getPassengerId()+"/"+Constants.INBOX;
47 | }
48 |
49 | public String getPassengerTopLevelTopic() {
50 | return Constants.PASSENGER_HEAD_PREFIX+getPassengerId();
51 | }
52 |
53 | public String getPassengerChatTopic() {
54 | return Constants.PASSENGER_HEAD_PREFIX + getPassengerId() + "/" + Constants.CHAT;
55 | }
56 |
57 | public String getPassengerLocationTopic() {
58 | return Constants.PASSENGER_HEAD_PREFIX + getPassengerId() + "/" + Constants.LOCATION;
59 | }
60 |
61 | public String getPassengerPaymentTopic() {
62 | return Constants.PICK_ME_UP + Constants.PAYMENTS;
63 | }
64 |
65 | public String getParingTopic() {
66 | return Constants.REQUESTS_HEAD_PREFIX +getPassengerId();
67 | }
68 |
69 | public String getDriverTopLevelTopic() {
70 | return Constants.DRIVER_HEAD_PREFIX + getDriverId();
71 | }
72 |
73 | public String getDriverPhotoTopic() {
74 | return Constants.DRIVER_HEAD_PREFIX + getDriverId() + "/" + Constants.PICTURE;
75 | }
76 |
77 | public String getDriverChatTopic() {
78 | return Constants.DRIVER_HEAD_PREFIX + getDriverId() + "/" + Constants.CHAT;
79 | }
80 |
81 | public String getDriverLocationTopic() {
82 | return Constants.DRIVER_HEAD_PREFIX + getDriverId() + "/" + Constants.LOCATION;
83 | }
84 |
85 | private String getDriverId() {
86 | return app.getDriverId();
87 | }
88 |
89 | private String getPassengerId() {
90 | return settings.getString(Constants.SETTINGS_NAME, "");
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/edittext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
8 |
9 |
12 |
13 |
14 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_map.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_microphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_microphone.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_microphone_recording.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_microphone_recording.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_person.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_photo.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_play.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_selfie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_selfie.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_send.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_action_user.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_driver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_driver.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_passenger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_passenger.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/ic_user.png
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/map_details.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/drawable-xxhdpi/round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_chat.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
18 |
19 |
27 |
28 |
40 |
41 |
49 |
50 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_chat_prep.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
21 |
22 |
28 |
29 |
36 |
37 |
42 |
43 |
44 |
52 |
53 |
58 |
59 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_driver_arrived.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
20 |
21 |
29 |
30 |
37 |
38 |
43 |
44 |
45 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_driver_details.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
21 |
22 |
28 |
29 |
37 |
38 |
43 |
44 |
45 |
51 |
52 |
60 |
61 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
22 |
23 |
36 |
37 |
41 |
42 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_map.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
24 |
25 |
37 |
38 |
49 |
50 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_payment_sent.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
21 |
22 |
37 |
38 |
46 |
47 |
54 |
55 |
60 |
61 |
62 |
70 |
71 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/activity_search_drivers.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
21 |
22 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/layout/row_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/chat.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/chat_map_actions.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/chat_prep.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/driver_arrived.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/driver_details.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/login.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/payment_sent.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/search_drivers.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/menu/trip_end_details.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #66000000
4 | #ffffff
5 | #3A4A53
6 | #22333F
7 | #0DBF99
8 | #00000000
9 | #FFFFFF
10 | #A8A9AD
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PickMeUp
5 | Map
6 | Settings
7 |
8 |
9 | Server is unavailable. Please check your connectivity and try again
10 | Exit
11 | Retry
12 | PickMeUp requires Location services to work. Make sure you have enable Location services before continuing.
13 | Cannot establish connection to the Location services. Map is not available.
14 |
15 |
16 |
17 | Hi, my name is
18 | Name
19 | Pick Me Up!
20 | Please fill in your name to continue!
21 |
22 |
23 |
24 | Searching for drivers..
25 |
26 |
27 |
28 | Driver found!
29 | Continue
30 |
31 |
32 |
33 | Snap a picture of yourself!
34 | Chat
35 |
36 |
37 |
38 | Your ride is here!
39 |
40 |
41 |
42 | Payment Sent!
43 | Your payment of %1$s%2$.2f was received. Thanks for riding with PickMeUp!
44 | Processing..
45 |
46 |
47 |
48 | Trip Details
49 | Distance
50 | Time
51 | Cost
52 | Driver Rating
53 | Add Tip?
54 | Submit Payment
55 | $
56 |
57 |
58 |
59 | Map
60 | Distance: calculating..
61 | Distance: %.1f miles
62 | ETA: %1$d:%2$d %3$s
63 | ETA: calculating..
64 | AM
65 | PM
66 | Send a message
67 | Send recorded voice message
68 | Send button
69 | Take photo
70 | Take photo (wrapper)
71 | Driver photo
72 | Driver photo (wrapper)
73 | Chat message sender photo
74 | Chat message sender photo (wrapper)
75 | Home
76 | Stopped recording
77 | Recording your voice message...
78 | Voice message sent
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
15 |
16 |
17 |
22 |
23 |
24 |
28 |
29 |
30 |
34 |
35 |
38 |
39 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/PickMeUp-Android/app/src/release/res/values/google_maps_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 | YOUR_KEY_HERE
18 |
19 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:0.12.+'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenCentral()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | 19.1.0
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/bin/classes/.gitignore:
--------------------------------------------------------------------------------
1 | /android
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/gen/.gitignore:
--------------------------------------------------------------------------------
1 | /android
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.1.0/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.2.42
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/bin/classes/.gitignore:
--------------------------------------------------------------------------------
1 | /com
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/gen/.gitignore:
--------------------------------------------------------------------------------
1 | /com
2 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.2.42/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/PickMeUp-Android/build/intermediates/model_data.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/build/intermediates/model_data.bin
--------------------------------------------------------------------------------
/PickMeUp-Android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/PickMeUp-Android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-Android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/PickMeUp-Android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Jul 14 09:27:31 CDT 2014
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
7 |
--------------------------------------------------------------------------------
/PickMeUp-Android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/PickMeUp-Android/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Fri Jul 25 12:12:27 CDT 2014
11 | sdk.dir=C\:\\Users\\IBM_ADMIN\\Downloads\\adt-bundle-windows-x86_64-20140321\\adt-bundle-windows-x86_64-20140321\\sdk
12 |
--------------------------------------------------------------------------------
/PickMeUp-Android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/PickMeUp-HTML5/README.md:
--------------------------------------------------------------------------------
1 | This README.md file is displayed on your project page. You should edit this
2 | file to describe your project, including instructions for building and
3 | running the project, pointers to the license under which you are making the
4 | project available, and anything else you think would be useful for others to
5 | know.
6 |
7 | We have created an empty license.txt file for you. Well, actually, it says,
8 | "" We
9 | recommend you edit this and include text for license terms under which you're
10 | making your code available. A good resource for open source licenses is the
11 | [Open Source Initiative](http://opensource.org/).
12 |
13 | Be sure to update your project's profile with a short description and
14 | eye-catching graphic.
15 |
16 | Finally, consider defining a timeline and work items on the "Current Work" tab
17 | to give interested developers a sense of your cadence and upcoming enhancements.
18 |
--------------------------------------------------------------------------------
/PickMeUp-HTML5/img/marker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-HTML5/img/marker.png
--------------------------------------------------------------------------------
/PickMeUp-HTML5/img/person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-HTML5/img/person.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/LICENSE:
--------------------------------------------------------------------------------
1 | Licensed Materials - Property of IBM
2 |
3 | © Copyright IBM Corporation 2014. All Rights Reserved.
4 |
5 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
6 |
7 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp.xcodeproj/project.xcworkspace/xcshareddata/PickMeUp.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 91F4BE98-4285-4A82-B260-AECD042B5EE3
9 | IDESourceControlProjectName
10 | PickMeUp
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 6E993EE0-0D5D-4CCF-A58A-BC380850DB52
14 | https://hub.jazz.net/git/bryancboyd/PickMeUp-iOS/
15 |
16 | IDESourceControlProjectPath
17 | PickMeUp.xcodeproj/project.xcworkspace
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 6E993EE0-0D5D-4CCF-A58A-BC380850DB52
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | https://hub.jazz.net/git/bryancboyd/PickMeUp-iOS/
25 | IDESourceControlProjectVersion
26 | 110
27 | IDESourceControlProjectWCCIdentifier
28 | 6E993EE0-0D5D-4CCF-A58A-BC380850DB52
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 6E993EE0-0D5D-4CCF-A58A-BC380850DB52
36 | IDESourceControlWCCName
37 | PickMeUp-iOS
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/Base.lproj/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/Base.lproj/.DS_Store
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUCallbacks.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 |
19 | #import "PMUMessenger.h"
20 | #import "PMUDriver.h"
21 |
22 | /** InvocationComplete protocol for MqttClient. */
23 | @interface InvocationCompleteCallbacks : NSObject
24 |
25 | /** Called when an API call completes sucessfully.
26 | * @param invocationContext A pointer to an object that is made available to
27 | * the onSuccess function.
28 | */
29 | - (void)onSuccess:(NSObject *)invocationContext;
30 | /** Called when an API call fails.
31 | * @param invocationContext A pointer to an object that is made available to
32 | * the onFailure function.
33 | * @param errorCode The error code corresponding to the failure.
34 | * @param errorMessage the error message corresponding to the failure.
35 | */
36 | - (void)onFailure:(NSObject *)invocationContext
37 | errorCode:(int)errorCode
38 | errorMessage:(NSString *)errorMessage;
39 |
40 | @end
41 |
42 | /** GeneralCallbacks protocol for MqttClient. */
43 | @interface GeneralCallbacks : NSObject
44 |
45 | /** Called when connection to the MQTT broker is lost unexpectedly.
46 | * @param invocationContext A pointer to an object that is made available to
47 | * the onConnectionLost function.
48 | * @param errorMessage The error message explaining the failure.
49 | */
50 | - (void)onConnectionLost:(NSObject *)invocationContext
51 | errorMessage:(NSString *)errorMessage;
52 | /** Called when an MQTT message arrives at the client.
53 | * @param invocationContext A pointer to an object that is made available to
54 | * the onMessageArrived function.
55 | * @param message The message that was received.
56 | */
57 | - (void)onMessageArrived:(NSObject *)invocationContext
58 | message:(MqttMessage *)message;
59 | /** Called when the client has completed delivering a message.
60 | * @param invocationContext A pointer to an object that is made available to
61 | * the onMessageDelivered function.
62 | * @param messageId The messageId of the message that was delivered.
63 | */
64 | - (void)onMessageDelivered:(NSObject *)invocationContext
65 | messageId:(int)messageId;
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUChatViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 | #import "PMUMessageTableViewDataSource.h"
19 |
20 | /** The PMUChatViewController implements the chat view of the application. */
21 | @interface PMUChatViewController : UIViewController
22 |
23 | /** Reload the chat table. */
24 | - (void)reload;
25 | /** Play an audio chat message.
26 | * @param sender The sender of the action.
27 | */
28 | - (IBAction)playAudio:(id)sender;
29 | /** Automatically play an audio chat message when it is received.
30 | * @param message The audio message to be played.
31 | */
32 | - (void)playMessageOnArrival:(PMUMessage *)message;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUConstants.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #define METERS_PER_MILE 1609.344
17 |
18 | // server constants
19 | extern NSString * const PMUServerIP;
20 | int const PMUServerPort;
21 |
22 | // topics
23 | extern NSString * const PMUPickMeUpTopic;
24 | extern NSString * const PMUDriversTopicPrefix;
25 | extern NSString * const PMUPassengersTopicPrefix;
26 | extern NSString * const PMURequestTopic;
27 | extern NSString * const PMUPaymentTopic;
28 | extern NSString * const PMUTopicInbox;
29 | extern NSString * const PMUTopicChat;
30 | extern NSString * const PMUTopicPicture;
31 | extern NSString * const PMUTopicLocation;
32 |
33 | // inbox message types
34 | extern NSString * const PMUTypeAccept;
35 | extern NSString * const PMUTypeTripStart;
36 | extern NSString * const PMUTypeTripEnd;
37 | extern NSString * const PMUTypeTripProcessed;
38 |
39 | // invocation context values
40 | extern NSString * const PMUContextConnect;
41 | extern NSString * const PMUContextDisconnect;
42 | extern NSString * const PMUContextSubscribe;
43 | extern NSString * const PMUContextUnsubscribe;
44 | extern NSString * const PMUContextSend;
45 |
46 | // image file names
47 | extern NSString * const PMUMicrophoneImage;
48 | extern NSString * const PMUCarImage;
49 | extern NSString * const PMUStopImage;
50 | extern NSString * const PMUBubbleDriverImage;
51 | extern NSString * const PMUBubblePassengerImage;
52 |
53 | // JSON fields
54 | extern NSString * const PMUTypeField;
55 | extern NSString * const PMUPassengerIDField;
56 | extern NSString * const PMUDriverIDField;
57 | extern NSString * const PMUConnectionTimeField;
58 | extern NSString * const PMULongitudeField;
59 | extern NSString * const PMULatitudeField;
60 | extern NSString * const PMUNameField;
61 | extern NSString * const PMUFormatField;
62 | extern NSString * const PMUDataField;
63 | extern NSString * const PMUURLField;
64 | extern NSString * const PMUDistanceField;
65 | extern NSString * const PMUTimeField;
66 | extern NSString * const PMUCostField;
67 |
68 | // Message content formats
69 | extern NSString * const PMUTextFormat;
70 | extern NSString * const PMUAudioFormat;
71 | extern NSString * const PMUImageFormat;
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUConstants.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUConstants.h"
17 |
18 | // server constants
19 | NSString * const PMUServerIP = (NSString *)CFSTR("messagesight.demos.ibm.com");
20 | int const PMUServerPort = 1883;
21 |
22 | // topic prefix
23 | NSString * const PMUPickMeUpTopic = (NSString *)CFSTR("pickmeup");
24 | NSString * const PMUDriversTopicPrefix = (NSString *)CFSTR("drivers");
25 | NSString * const PMUPassengersTopicPrefix = (NSString *)CFSTR("passengers");
26 | NSString * const PMURequestTopic = (NSString *)CFSTR("requests");
27 | NSString * const PMUPaymentTopic = (NSString *)CFSTR("payments");
28 | NSString * const PMUTopicInbox = (NSString *)CFSTR("inbox");
29 | NSString * const PMUTopicChat = (NSString *)CFSTR("chat");
30 | NSString * const PMUTopicPicture = (NSString *)CFSTR("picture");
31 | NSString * const PMUTopicLocation = (NSString *)CFSTR("location");
32 |
33 | // inbox message types
34 | NSString * const PMUTypeAccept = (NSString *)CFSTR("accept");
35 | NSString * const PMUTypeTripStart = (NSString *)CFSTR("tripStart");
36 | NSString * const PMUTypeTripEnd = (NSString *)CFSTR("tripEnd");
37 | NSString * const PMUTypeTripProcessed = (NSString *)CFSTR("tripProcessed");
38 |
39 | // invocation context values
40 | NSString * const PMUContextConnect = (NSString *)CFSTR("connect");
41 | NSString * const PMUContextDisconnect = (NSString *)CFSTR("disconnect");
42 | NSString * const PMUContextSubscribe = (NSString *)CFSTR("subscribe");
43 | NSString * const PMUContextUnsubscribe = (NSString *)CFSTR("unsubscribe");
44 | NSString * const PMUContextSend = (NSString *)CFSTR("send");
45 |
46 | // image file names
47 | NSString * const PMUMicrophoneImage = (NSString *)CFSTR("ic_action_microphone.png");
48 | NSString * const PMUCarImage = (NSString *)CFSTR("ic_driver.png");
49 | NSString * const PMUStopImage = (NSString *)CFSTR("ic_action_microphone_recording.png");
50 | NSString * const PMUBubbleDriverImage = (NSString *)CFSTR("bubbleSomeone.png");
51 | NSString * const PMUBubblePassengerImage = (NSString *)CFSTR("bubbleMine.png");
52 |
53 | // JSON fields
54 | NSString * const PMUPassengerIDField = (NSString *)CFSTR("passengerId");
55 | NSString * const PMUDriverIDField = (NSString *)CFSTR("driverId");
56 | NSString * const PMUFormatField = (NSString *)CFSTR("format");
57 | NSString * const PMULongitudeField = (NSString *)CFSTR("lon");
58 | NSString * const PMULatitudeField = (NSString *)CFSTR("lat");
59 | NSString * const PMUConnectionTimeField = (NSString *)CFSTR("connectionTime");
60 | NSString * const PMUNameField = (NSString *)CFSTR("name");
61 | NSString * const PMUDataField = (NSString *)CFSTR("data");
62 | NSString * const PMUURLField = (NSString *)CFSTR("url");
63 | NSString * const PMUTypeField = (NSString *)CFSTR("type");
64 | NSString * const PMUDistanceField = (NSString *)CFSTR("distance");
65 | NSString * const PMUTimeField = (NSString *)CFSTR("time");
66 | NSString * const PMUCostField = (NSString *)CFSTR("cost");
67 |
68 | // Text message data format
69 | NSString * const PMUTextFormat = (NSString *)CFSTR("text");
70 | // Audio message data format
71 | NSString * const PMUAudioFormat = (NSString *)CFSTR("data:audio/wav;base64");
72 | // Image message data format
73 | NSString * const PMUImageFormat = (NSString *)CFSTR("data:image/png;base64");
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUDriver.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 |
19 | /** Implements MKAnnotation Protocol. The PMUDriver object will
20 | * be used to generate the driver image on the PMUMapViewController.
21 | */
22 | @interface PMUDriver : NSObject {
23 | NSString *title;
24 | NSString *subtitle;
25 | CLLocationCoordinate2D coordinate;
26 | }
27 |
28 | /** The title for this driver. This is the driver ID. */
29 | @property (readonly, nonatomic, copy) NSString *title;
30 | /** This property is unused. */
31 | @property (readonly, nonatomic, copy) NSString *subtitle;
32 | /** The coordinate of the driver. */
33 | @property (readonly, nonatomic) CLLocationCoordinate2D coordinate;
34 | /** The name of the driver. */
35 | @property (strong, nonatomic) NSString *name;
36 | /** The picture of the driver. */
37 | @property (strong, nonatomic) UIImage *image;
38 |
39 | /** Returns the PMUDriver object. */
40 | + (id)sharedDriver;
41 |
42 | /** Clear the properties of the PMUDriver object. */
43 | + (void)resetDriverProperties;
44 |
45 | /** Set the driverId of the PMUDriver object.
46 | * @param newTitle The new value for the title property.
47 | */
48 | - (void)setTitle:(NSString *)newTitle;
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUDriver.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUDriver.h"
17 | #import "PMUAppDelegate.h"
18 |
19 | @implementation PMUDriver
20 |
21 | @synthesize coordinate;
22 | @synthesize title;
23 | @synthesize subtitle;
24 | @synthesize name;
25 | @synthesize image;
26 |
27 | /** Initialize a PMUDriver instance
28 | */
29 | - (id)init
30 | {
31 | if (self = [super init])
32 | {
33 | title = nil;
34 | subtitle = nil;
35 | name = nil;
36 | image = nil;
37 | }
38 | return self;
39 | }
40 |
41 | + (id)sharedDriver
42 | {
43 | static PMUDriver *shared = nil;
44 | static dispatch_once_t onceToken;
45 | dispatch_once(&onceToken, ^{
46 | shared = [[self alloc] init];
47 | });
48 | return shared;
49 | }
50 |
51 | + (void)resetDriverProperties
52 | {
53 | CLLocationCoordinate2D coord;
54 | coord.longitude = 0;
55 | coord.latitude = 0;
56 | PMUDriver *driver = [PMUDriver sharedDriver];
57 | [driver setTitle:nil];
58 | [driver setName:nil];
59 | [driver setImage:nil];
60 | [driver setCoordinate:coord];
61 | }
62 |
63 | - (void)setTitle:(NSString *)newTitle
64 | {
65 | title = newTitle;
66 | }
67 |
68 | /** Set the coordinate of the PMUDriver object.
69 | */
70 | - (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
71 | {
72 | coordinate = newCoordinate;
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUFinalizeViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 |
18 | /** The PMUFinalizeViewController class implements the submit payment
19 | * and payment processed views of the application. */
20 | @interface PMUFinalizeViewController : UIViewController
21 |
22 | /** The name of the driver. */
23 | @property (strong, nonatomic) UILabel *driverInfoLabel;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMapViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 | #import "PMUDriver.h"
19 |
20 | /** The PMUMapViewController class implements the map view of the application. */
21 | @interface PMUMapViewController : UIViewController
22 |
23 | @property (strong, nonatomic) IBOutlet MKMapView *mapView;
24 |
25 | /** Add a PMUDriver annotation to the map. */
26 | - (void)addDriver:(PMUDriver *)driver;
27 | /** Remove a PMUDriver annotation from the map .
28 | * @param driver The driver to add to the map.
29 | */
30 | - (void)removeDriver:(PMUDriver *)driver;
31 | /** Get the PMUDriver annotation matching driverID.
32 | * @param driverID The ID of the driver to get.
33 | */
34 | - (PMUDriver *)getDriver:(NSString *)driverID;
35 | /** Set the ETA label.
36 | * @param estimateLabelText The new text to set the estimate label to.
37 | */
38 | - (void)setEstimateLabelText:(NSString *)estimateLabelText;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessage.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #ifndef ChatMessage_h
17 | #define ChatMessage_h
18 |
19 | #import "PMUConstants.h"
20 |
21 | /** PMUChatSender defines the type of the chat message. */
22 | typedef enum _PMUChatSender
23 | {
24 | /** The message was sent by the passenger. */
25 | PMUChatPassenger = 0,
26 | /** The message was sent by the driver. */
27 | PMUChatDriver = 1,
28 | } PMUChatSender;
29 |
30 | /** PMUMessage represents a single chat message. */
31 | @interface PMUMessage : NSObject
32 |
33 | /** The date used for sorting chat messages. */
34 | @property (nonatomic, strong) NSDate *date;
35 | /** The sender of the chat message. PMUChatPassenger or PMUChatDriver. */
36 | @property (nonatomic) PMUChatSender sender;
37 | /** The message format. "text" or "data:wav/audio;base64". */
38 | @property (nonatomic) NSString *format;
39 | /** The message data. */
40 | @property (nonatomic) NSString *data;
41 | /** The view for the message. */
42 | @property (nonatomic, strong) UIView *view;
43 | /** The text of the message. */
44 | @property (nonatomic, strong) NSString *text;
45 | /** The insets for the message view. */
46 | @property (nonatomic) UIEdgeInsets insets;
47 |
48 | /** Returns a new PMUMessage instance.
49 | * @param text The message text.
50 | * @param date The date that the message was sent.
51 | * @param sender The sender of the message (PMUChatPassenger or PMUChatDriver).
52 | * @param format The format of the message (text or data:audio/wav;base64).
53 | */
54 | + (id)dataWithText:(NSString *)text
55 | date:(NSDate *)date
56 | sender:(PMUChatSender)sender
57 | format:(NSString *)format;
58 |
59 | @end
60 |
61 |
62 |
63 |
64 | #endif
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessageFactory.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 |
18 | /** PMUMessageFactory manages all MQTT message payload formats used by the application
19 | */
20 | @interface PMUMessageFactory : NSObject
21 |
22 | + (NSString *)createPresenceMessage;
23 |
24 | + (NSString *)createRequestMessage;
25 |
26 | + (NSString *)createChatMessage:(NSString *)format
27 | payload:(NSString *)payload;
28 |
29 | + (NSString *)createPhotoMessage:(NSString *)payload;
30 |
31 | + (NSString *)createLocationMessage:(double)longitude
32 | latitude:(double)latitude;
33 |
34 | + (NSString *)createPaymentMessage:(double)tipAmount
35 | rating:(int)rating;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessageFactory.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUMessageFactory.h"
17 | #import "PMUAppDelegate.h"
18 |
19 | @implementation PMUMessageFactory
20 |
21 | + (NSString *)createPresenceMessage
22 | {
23 | PMURequest *request = [PMURequest sharedRequest];
24 | NSNumber *timestamp = [NSNumber numberWithDouble:(1000 *[[NSDate date] timeIntervalSince1970])];
25 | NSString *messageString = [NSString stringWithFormat:@"{\"%@\":\"%@\",\"%@\":%d}", PMUNameField, request.name, PMUConnectionTimeField, [timestamp intValue]];
26 | return messageString;
27 | }
28 |
29 | + (NSString *)createRequestMessage
30 | {
31 | PMURequest *request = [PMURequest sharedRequest];
32 | NSString *messageString = [NSString stringWithFormat:@"{\"%@\":\"%@\",\"%@\":%f,\"%@\":%f}", PMUNameField, request.name, PMULongitudeField, request.coordinate.longitude, PMULatitudeField, request.coordinate.latitude];
33 | return messageString;
34 | }
35 |
36 | + (NSString *)createChatMessage:(NSString *)format
37 | payload:(NSString *)payload
38 | {
39 | NSString *messageString = [NSString stringWithFormat:@"{\"%@\":\"%@\",\"%@\":\"%@\"}",
40 | PMUFormatField, format, PMUDataField, payload];
41 | return messageString;
42 | }
43 |
44 | + (NSString *)createPhotoMessage:(NSString *)payload
45 | {
46 | NSString *messageString = [NSString stringWithFormat:@"{\"%@\":\"%@,%@\"}",
47 | PMUURLField, PMUImageFormat, payload];
48 | return messageString;
49 | }
50 |
51 | + (NSString *)createLocationMessage:(double)longitude
52 | latitude:(double)latitude
53 | {
54 | NSString *messageString = [NSString stringWithFormat:@"{\"lon\":%f,\"lat\":%f}", longitude, latitude];
55 | return messageString;
56 | }
57 |
58 | + (NSString *)createPaymentMessage:(double)tipAmount
59 | rating:(int)rating
60 | {
61 | PMURequest *request = [PMURequest sharedRequest];
62 | NSString *messageString = [NSString stringWithFormat:@"{\"passengerId\":\"%@\",\"driverId\":\"%@\",\"cost\":%f,\"tip\":%f,\"rating\":%d}", [PMUTopicFactory getPassengerId], [PMUTopicFactory getDriverId], [request.cost doubleValue], tipAmount, rating];
63 | return messageString;
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessageTableView.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #ifndef ChatMessageTableView_h
17 | #define ChatMessageTableView_h
18 |
19 | #import "PMUMessage.h"
20 | #import "PMUMessageTableViewDataSource.h"
21 |
22 | /** The PMUMessageTableView class implements the chat table of the application */
23 | @interface PMUMessageTableView : UITableView
24 |
25 | /** The data source for the chat table */
26 | @property (nonatomic, assign) IBOutlet id chatMessageDataSource;
27 | /** The array of messages for the chat table */
28 | @property (nonatomic, retain) NSMutableArray *chatSection;
29 |
30 | @end
31 |
32 | #endif
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessageTableViewDataSource.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #ifndef ChatMessageTableViewDataSource_h
17 | #define ChatMessageTableViewDataSource_h
18 |
19 | @class PMUMessage;
20 | @class PMUMessageTableView;
21 |
22 | /** The PMUMessageTableViewDatasource protocol defines the methods for accessing
23 | * data in the PMUMessageTableView. */
24 | @protocol PMUMessageTableViewDataSource
25 |
26 | @optional
27 |
28 | @required
29 |
30 | /** Returns the number of rows in the chat table.
31 | * @param tableView The table to get the number of rows from.
32 | */
33 | - (NSInteger)rowsForChatTable:(PMUMessageTableView *)tableView;
34 | /** Returns the PMUMessage object for the given row in the chat table.
35 | * @param tableView The table to get the data from.
36 | * @param row The row of the table to get the data from.
37 | */
38 | - (PMUMessage *)chatMessageTableView:(PMUMessageTableView *)tableView
39 | dataForRow:(NSInteger)row;
40 |
41 | @end
42 |
43 | #endif
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessenger.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import "MqttOCClient.h"
18 | #import "PMUMessage.h"
19 |
20 | /** PMUMessenger is the wrapper around the MQTT Client API's
21 | * for communicating with MessageSight.
22 | */
23 | @interface PMUMessenger : NSObject
24 |
25 | /** A handle to the iOS MQTT client. */
26 | @property (nonatomic, retain) MqttClient *client;
27 | /** The clientId used for the connection. */
28 | @property NSString *clientId;
29 |
30 | /** Returns the singleton PMUMessenger object. */
31 | + (id)sharedMessenger;
32 |
33 | /** Connect to the MQTT broker at the specified host
34 | * @param host The address of the MQTT broker to connect to.
35 | * @param port The port that the MQTT broker listens on.
36 | * @param clientId The client identifier used to identify the MQTT connection.
37 | */
38 | - (void)connectWithHost:(NSString *)host
39 | port:(int)port
40 | clientId:(NSString *)clientId;
41 |
42 | /** Publish payload to topic.
43 | * @param topic The MQTT topic to publish the message to.
44 | * @param payload The content for the message.
45 | * @param qos The Quality of Service level to send the message as. (0,1,2)
46 | * @param retained The retained value to send the message as. (true,false)
47 | */
48 | - (void)publish:(NSString *)topic
49 | payload:(NSString *)payload
50 | qos:(int)qos
51 | retained:(BOOL)retained;
52 |
53 | /** Subscribe to topicFilter at the specified QoS.
54 | * @param topicFilter The MQTT topic filter to subscribe to.
55 | * @param qos The Quality of service level for the subscription.
56 | */
57 | - (void)subscribe:(NSString *)topicFilter
58 | qos:(int)qos;
59 |
60 | /** Unsubscribe from topicFilter.
61 | * @param topicFilter The MQTT topic filter to unsubscribe from.
62 | */
63 | - (void)unsubscribe:(NSString *)topicFilter;
64 |
65 | /** Disconnect from the MQTT broker. */
66 | - (void)disconnect;
67 |
68 | /** Add a PMUMessage to the chat table message cache.
69 | * @param message The message to be displayed.
70 | * @param from The ID of the sender of the message.
71 | */
72 | - (void)displayChatMessage:(PMUMessage *)message
73 | from:(NSString *)senderId;
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUMessenger.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUMessenger.h"
17 | #import "PMUCallbacks.h"
18 | #import "PMUAppDelegate.h"
19 | #import "PMUMessage.h"
20 |
21 | @implementation PMUMessenger
22 |
23 | /** Initialize a PMUMessenger instance. */
24 | - (id)init
25 | {
26 | if (self = [super init])
27 | {
28 | self.client = [MqttClient alloc];
29 | self.client.callbacks = [[GeneralCallbacks alloc] init];
30 | }
31 | return self;
32 | }
33 |
34 | + (id)sharedMessenger
35 | {
36 | static PMUMessenger *shared = nil;
37 | static dispatch_once_t onceToken;
38 | dispatch_once(&onceToken, ^{
39 | shared = [[self alloc] init];
40 | });
41 | return shared;
42 | }
43 |
44 | - (void)connectWithHost:(NSString *)host
45 | port:(int)port
46 | clientId:(NSString *)clientId
47 | {
48 | ConnectOptions *opts = [[ConnectOptions alloc] init];
49 | opts.timeout = 15;
50 | // TODO: Use cleanSession = NO for durable subscriptions.
51 | opts.cleanSession = YES;
52 | opts.keepAliveInterval = 30;
53 |
54 | self.client = [self.client initWithHost:host port:port clientId:clientId];
55 |
56 | // Set up will message to pickmeup/passengers/
57 | MqttMessage *willMessage = [[MqttMessage alloc] initWithMqttMessage:[PMUTopicFactory getPassengerTopLevelTopic] payload:"" length:0 qos:0 retained:NO duplicate:NO];
58 | opts.willMessage = willMessage;
59 |
60 | NSLog(@"%s:%d host=%@, port=%d, clientId=%@", __func__, __LINE__, host, port, clientId);
61 |
62 | [self.client connectWithOptions:opts invocationContext:PMUContextConnect onCompletion:[[InvocationCompleteCallbacks alloc] init]];
63 | }
64 |
65 | - (void)publish:(NSString *)topic
66 | payload:(NSString *)payload
67 | qos:(int)qos
68 | retained:(BOOL)retained
69 | {
70 | char *utfPayload = (char *)[payload UTF8String];
71 |
72 | MqttMessage *msg = [[MqttMessage alloc] initWithMqttMessage:topic payload:utfPayload length:(int)payload.length qos:qos retained:retained duplicate:NO];
73 | [self.client send:msg invocationContext:PMUContextSend onCompletion:[[InvocationCompleteCallbacks alloc] init]];
74 | }
75 |
76 | - (void)subscribe:(NSString *)topicFilter
77 | qos:(int)qos
78 | {
79 | NSString *invocationContext = [NSString stringWithFormat:@"%@/%@", PMUContextSubscribe, topicFilter];
80 | [self.client subscribe:topicFilter qos:qos invocationContext:invocationContext onCompletion:[[InvocationCompleteCallbacks alloc] init]];
81 | }
82 |
83 | - (void)unsubscribe:(NSString *)topicFilter
84 | {
85 | NSString *invocationContext = [NSString stringWithFormat:@"%@/%@", PMUContextUnsubscribe, topicFilter];
86 | [self.client unsubscribe:topicFilter invocationContext:invocationContext onCompletion:[[InvocationCompleteCallbacks alloc] init]];
87 | }
88 |
89 | - (void)disconnect
90 | {
91 | DisconnectOptions *opts = [[DisconnectOptions alloc] init];
92 | opts.timeout = 10;
93 | [self.client disconnectWithOptions:opts invocationContext:PMUContextDisconnect onCompletion:[[InvocationCompleteCallbacks alloc] init]];
94 | }
95 |
96 | - (void)displayChatMessage:(PMUMessage *)message
97 | from:(NSString *)senderId
98 | {
99 | PMUAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
100 | // The message always goes into the cache for the chat view.
101 | [appDelegate.messageCache addObject:message];
102 |
103 | [appDelegate.chatController reload];
104 | if ([senderId isEqualToString:[PMUTopicFactory getPassengerId]] == NO)
105 | {
106 | // Only autoplay message if it came from the driver.
107 | [appDelegate.chatController playMessageOnArrival:message];
108 | }
109 | }
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUPairingViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 |
18 | /** The PMUPairingViewController implements the driver found and trip started
19 | * views of the application. */
20 | @interface PMUPairingViewController : UIViewController
21 |
22 | /** Set the driver name label.
23 | * @param name The new name to set for the driver.
24 | */
25 | - (void)setDriverName:(NSString *)name;
26 | /** Set the driver image.
27 | * @param image The new image to set for the driver.
28 | */
29 | - (void)setDriverPicture:(UIImage *)image;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUPairingViewController.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUPairingViewController.h"
17 | #import "PMUAppDelegate.h"
18 |
19 | @interface PMUPairingViewController ()
20 |
21 | @property (weak, nonatomic) IBOutlet UIButton *continueButton;
22 | @property (strong, nonatomic) IBOutlet UILabel *driverNameLabel;
23 | @property (strong, nonatomic) IBOutlet UIImageView *driverImage;
24 |
25 | @end
26 |
27 | @implementation PMUPairingViewController
28 |
29 | - (id)initWithCoder:(NSCoder *)aDecoder
30 | {
31 | self = [super initWithCoder:aDecoder];
32 | if (self)
33 | {
34 | PMUAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
35 | appDelegate.driverFoundController = self;
36 | }
37 | return self;
38 | }
39 |
40 | - (void)viewDidLoad
41 | {
42 | [self.navigationItem setHidesBackButton:YES];
43 | }
44 |
45 | - (void)viewWillAppear:(BOOL)animated
46 | {
47 | PMUDriver *driver = [PMUDriver sharedDriver];
48 | if (driver.name != nil)
49 | {
50 | self.driverNameLabel.text = driver.name;
51 | }
52 | if (driver.image != nil)
53 | {
54 | self.driverImage.image = driver.image;
55 | }
56 | self.navigationController.navigationBar.hidden = YES;
57 | }
58 |
59 | - (void)setDriverName:(NSString *)name
60 | {
61 | self.driverNameLabel.text = name;
62 | }
63 |
64 | - (void)setDriverPicture:(UIImage *)image
65 | {
66 | self.driverImage.image = image;
67 | PMUDriver *driver = [PMUDriver sharedDriver];
68 | [driver setImage:image];
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMURequest.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 |
19 | /** PMURequest stores the passenger and trip data for the application. */
20 | @interface PMURequest : NSObject
21 |
22 | /** The coordinate of the passenger. */
23 | @property (nonatomic) CLLocationCoordinate2D coordinate;
24 | /** The name of the passenger. */
25 | @property (strong, nonatomic) NSString *name;
26 | /** The total distance of the trip. */
27 | @property (strong, nonatomic) NSNumber *distance;
28 | /** The total time of the trip. */
29 | @property (strong, nonatomic) NSNumber *time;
30 | /** The total cost of the trip. */
31 | @property (strong, nonatomic) NSNumber *cost;
32 | /** The picture of the passenger. */
33 | @property (strong, nonatomic) UIImage *image;
34 |
35 | /** Returns the PMURequest object. */
36 | + (id)sharedRequest;
37 |
38 | /** Clear the properties of the PMURequest object. */
39 | + (void)resetRequestProperties;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMURequest.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMURequest.h"
17 |
18 | @implementation PMURequest
19 |
20 | /** Initialize a PMURequest instance. */
21 | - (id)init
22 | {
23 | self = [super init];
24 | if (self != nil)
25 | {
26 | self.name = nil;
27 | self.distance = nil;
28 | self.cost = nil;
29 | self.time = nil;
30 | self.image = nil;
31 | }
32 | return self;
33 | }
34 |
35 | + (id)sharedRequest
36 | {
37 | static PMURequest *shared = nil;
38 | static dispatch_once_t onceToken;
39 | dispatch_once(&onceToken, ^{
40 | shared = [[self alloc] init];
41 | });
42 | return shared;
43 | }
44 |
45 | + (void)resetRequestProperties
46 | {
47 | CLLocationCoordinate2D coord;
48 | coord.longitude = 0;
49 | coord.latitude = 0;
50 | PMURequest *request = [PMURequest sharedRequest];
51 | [request setName:nil];
52 | [request setTime:0];
53 | [request setCost:0];
54 | [request setDistance:0];
55 | [request setImage:nil];
56 | [request setCoordinate:coord];
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMURequestViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 | #import
18 |
19 | /** The PMURequestViewController class implements the request view of the application. */
20 | @interface PMURequestViewController : UIViewController
21 |
22 | #define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
23 |
24 | /** Send a picture message using the image data from imageString. */
25 | - (void)sendPictureMessage;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUSpinnerViewController.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 |
18 | @interface PMUSpinnerViewController : UIViewController
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUSpinnerViewController.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUAppDelegate.h"
17 | #import "PMUSpinnerViewController.h"
18 |
19 | @interface PMUSpinnerViewController()
20 |
21 | @property (weak, nonatomic) IBOutlet UIButton *cancelButton;
22 |
23 | @end
24 |
25 | @implementation PMUSpinnerViewController
26 |
27 | - (IBAction)cancelButtonPressed:(id)sender
28 | {
29 | PMUAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
30 | [appDelegate resetApplication];
31 | }
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUTopicFactory.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import
17 |
18 | /** PMUTopicFactory manages all MQTT topics used by the application.
19 | */
20 | @interface PMUTopicFactory : NSObject
21 |
22 | + (NSString *)getPassengerId;
23 |
24 | + (NSString *)getDriverId;
25 |
26 | + (NSString *)getPaymentTopic;
27 |
28 | + (NSString *)getRequestTopic;
29 |
30 | // Passenger topics
31 |
32 | + (NSString *)getPassengerTopLevelTopic;
33 |
34 | + (NSString *)getPassengerInboxTopic;
35 |
36 | + (NSString *)getPassengerChatTopic;
37 |
38 | + (NSString *)getPassengerPhotoTopic;
39 |
40 | + (NSString *)getPassengerLocationTopic;
41 |
42 | // Driver topics
43 |
44 | + (NSString *)getDriverTopLevelTopic;
45 |
46 | + (NSString *)getDriverChatTopic;
47 |
48 | + (NSString *)getDriverPhotoTopic;
49 |
50 | + (NSString *)getDriverLocationTopic;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PMUTopicFactory.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | Licensed Materials - Property of IBM
3 |
4 | © Copyright IBM Corporation 2014. All Rights Reserved.
5 |
6 | This licensed material is sample code intended to aid the licensee in the development of software for the Apple iOS and OS X platforms . This sample code is provided only for education purposes and any use of this sample code to develop software requires the licensee obtain and comply with the license terms for the appropriate Apple SDK (Developer or Enterprise edition). Subject to the previous conditions, the licensee may use, copy, and modify the sample code in any form without payment to IBM for the purposes of developing software for the Apple iOS and OS X platforms.
7 |
8 | Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR ECONOMIC CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE. IBM SHALL NOT BE LIABLE FOR LOSS OF, OR DAMAGE TO, DATA, OR FOR LOST PROFITS, BUSINESS REVENUE, GOODWILL, OR ANTICIPATED SAVINGS. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
9 |
10 |
11 | Contributors:
12 | Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
13 | Rahul Gupta, Vasfi Gucer
14 | *******************************************************************************/
15 |
16 | #import "PMUTopicFactory.h"
17 | #import "PMUAppDelegate.h"
18 |
19 | @implementation PMUTopicFactory
20 |
21 | + (NSString *)getPassengerId
22 | {
23 | PMUAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
24 | return appDelegate.passengerId;
25 | }
26 |
27 | + (NSString *)getDriverId
28 | {
29 | PMUDriver *driver = [PMUDriver sharedDriver];
30 | return driver.title;
31 | }
32 |
33 | + (NSString *)getPaymentTopic
34 | {
35 | NSString *topic = [NSString stringWithFormat:@"%@/%@", PMUPickMeUpTopic, PMUPaymentTopic];
36 | return topic;
37 | }
38 |
39 | + (NSString *)getRequestTopic
40 | {
41 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@", PMUPickMeUpTopic, PMURequestTopic, [PMUTopicFactory getPassengerId]];
42 | return topic;
43 | }
44 |
45 | + (NSString *)getPassengerTopLevelTopic
46 | {
47 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@", PMUPickMeUpTopic, PMUPassengersTopicPrefix, [PMUTopicFactory getPassengerId]];
48 | return topic;
49 | }
50 |
51 | + (NSString *)getPassengerInboxTopic
52 | {
53 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUPassengersTopicPrefix, [PMUTopicFactory getPassengerId], PMUTopicInbox];
54 | return topic;
55 | }
56 |
57 | + (NSString *)getPassengerChatTopic
58 | {
59 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUPassengersTopicPrefix, [PMUTopicFactory getPassengerId], PMUTopicChat];
60 | return topic;
61 | }
62 |
63 | + (NSString *)getPassengerPhotoTopic
64 | {
65 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUPassengersTopicPrefix, [PMUTopicFactory getPassengerId], PMUTopicPicture];
66 | return topic;
67 | }
68 |
69 | + (NSString *)getPassengerLocationTopic
70 | {
71 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUPassengersTopicPrefix, [PMUTopicFactory getPassengerId], PMUTopicLocation];
72 | return topic;
73 | }
74 |
75 | + (NSString *)getDriverTopLevelTopic
76 | {
77 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@", PMUPickMeUpTopic, PMUDriversTopicPrefix, [PMUTopicFactory getDriverId]];
78 | return topic;
79 | }
80 |
81 | + (NSString *)getDriverChatTopic
82 | {
83 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUDriversTopicPrefix, [PMUTopicFactory getDriverId], PMUTopicChat];
84 | return topic;
85 | }
86 |
87 | + (NSString *)getDriverPhotoTopic
88 | {
89 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUDriversTopicPrefix, [PMUTopicFactory getDriverId], PMUTopicPicture];
90 | return topic;
91 | }
92 |
93 | + (NSString *)getDriverLocationTopic
94 | {
95 | NSString *topic = [NSString stringWithFormat:@"%@/%@/%@/%@", PMUPickMeUpTopic, PMUDriversTopicPrefix, [PMUTopicFactory getDriverId], PMUTopicLocation];
96 | return topic;
97 | }
98 |
99 | @end
100 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PickMeUp-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSLocationAlwaysUsageDescription
6 | PickMeUp requires use of your location
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleDisplayName
10 | ${PRODUCT_NAME}
11 | CFBundleExecutable
12 | ${EXECUTABLE_NAME}
13 | CFBundleIcons
14 |
15 | CFBundlePrimaryIcon
16 |
17 | CFBundleIconFiles
18 |
19 | Icon-40
20 | Icon-Small
21 | Icon-60
22 |
23 |
24 |
25 | CFBundleIcons~ipad
26 |
27 | CFBundlePrimaryIcon
28 |
29 | CFBundleIconFiles
30 |
31 | Icon-40
32 | Icon-Small
33 | Icon-76
34 |
35 |
36 |
37 | CFBundleIdentifier
38 | IBM.$(PRODUCT_NAME:rfc1034identifier)
39 | CFBundleInfoDictionaryVersion
40 | 6.0
41 | CFBundleName
42 | ${PRODUCT_NAME}
43 | CFBundlePackageType
44 | APPL
45 | CFBundleShortVersionString
46 | 1.0
47 | CFBundleSignature
48 | ????
49 | CFBundleVersion
50 | 1.0
51 | LSRequiresIPhoneOS
52 |
53 | UIMainStoryboardFile
54 | Main_iPhone
55 | UIRequiredDeviceCapabilities
56 |
57 | armv7
58 |
59 | UIStatusBarTintParameters
60 |
61 | UINavigationBar
62 |
63 | Style
64 | UIBarStyleDefault
65 | Translucent
66 |
67 |
68 |
69 | UISupportedInterfaceOrientations
70 |
71 | UIInterfaceOrientationPortrait
72 |
73 | UISupportedInterfaceOrientations~ipad
74 |
75 | UIInterfaceOrientationPortrait
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/PickMeUp-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/.DS_Store
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-40.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-40@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-60.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-60@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-76.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-76@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-Small.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/Icon-Small@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/appIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/appIcon.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/bubbleMine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/bubbleMine.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/bubbleMine@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/bubbleMine@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/bubbleSomeone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/bubbleSomeone.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/bubbleSomeone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/bubbleSomeone@2x.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_map.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_microphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_microphone.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_microphone_recording.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_microphone_recording.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_person.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_photo.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_play.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_selfie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_selfie.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_send.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_action_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_action_user.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_driver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_driver.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_passenger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_passenger.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/icons/ic_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/icons/ic_user.png
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/lib/libiosMQTT.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-messaging/mqtt-PickMeUp/8116e9c39a51988e04c3c6eb477f59bfb879d903/PickMeUp-iOS/PickMeUp/lib/libiosMQTT.a
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUp/main.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | *
13 | * Contributors:
14 | * Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
15 | * Rahul Gupta, Vasfi Gucer
16 | *******************************************************************************/
17 |
18 | #import
19 |
20 | #import "PMUAppDelegate.h"
21 |
22 | int main(int argc, char * argv[])
23 | {
24 | @autoreleasepool {
25 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([PMUAppDelegate class]));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUpTests/PickMeUpTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | IBM.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUpTests/PickMeUp_Tests.m:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 IBM Corp.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v1.0
6 | * and Eclipse Distribution License v1.0 which accompany this distribution.
7 | *
8 | * The Eclipse Public License is available at
9 | * http://www.eclipse.org/legal/epl-v10.html
10 | * and the Eclipse Distribution License is available at
11 | * http://www.eclipse.org/org/documents/edl-v10.php.
12 | *
13 | * Contributors:
14 | * Mike Robertson, Bryan Boyd, Vladimir Kislicins, Joel Gauci, Nguyen Van Duy,
15 | * Rahul Gupta, Vasfi Gucer
16 | *******************************************************************************/
17 |
18 | #import
19 |
20 | @interface PickMeUp_Tests : XCTestCase
21 |
22 | @end
23 |
24 | @implementation PickMeUp_Tests
25 |
26 | - (void)setUp
27 | {
28 | [super setUp];
29 | // Put setup code here. This method is called before the invocation of each test method in the class.
30 | }
31 |
32 | - (void)tearDown
33 | {
34 | // Put teardown code here. This method is called after the invocation of each test method in the class.
35 | [super tearDown];
36 | }
37 |
38 | - (void)testExample
39 | {
40 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/PickMeUpTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/PickMeUp-iOS/README.md:
--------------------------------------------------------------------------------
1 | PickMeUp iOS Application
2 | ========================
3 |
4 | PickMeUp-iOS provides a native iOS implementation of the PickMeUp passenger application.
5 |
6 | The application makes use of the iOS MQTT Objective-C client library which is
7 | delivered as part of the IBM WebSphere MQ Client Pack available here:
8 | https://www.ibm.com/developerworks/community/blogs/c565c720-fe84-4f63-873f-607d87787327/entry/download?lang=en
9 | (Download Mobile & M2M Client Pack)
10 |
11 | Class Overview
12 | --------------
13 |
14 | main.m:
15 | Launches the application
16 |
17 | PMUAppDelegate.h / PMUAppDelegate.m:
18 | UIApplicationDelegate
19 |
20 | PMUCallbacks.h / PMUCallbacks.m:
21 | Implementation for iOS MQTT client callback protocols
22 |
23 | PMUConstants.h / PMUConstants.m:
24 | Define constants used throughout the application
25 |
26 | PMUDriver.h / PMUDriver.m:
27 | Object to store driver related properties
28 |
29 | PMUMessage.h / PMUMessage.m:
30 | Object to store individual chat message properties
31 |
32 | PMUMessenger.h / PMUMessenger.m:
33 | Wrapper around MqttClient
34 |
35 | PMUTopicFactory.h / PMUTopicFactory.m:
36 | Functions for returning MQTT topic strings
37 |
38 | PMUMessageFactory.h / PMUMessageFactory.m:
39 | Functions for returning JSON formatted message strings
40 |
41 | PMURequest.h / PMURequest.m:
42 | Object to store passenger and ride related properties
43 |
44 | PMUChatViewController.h / PMUChatViewController.m:
45 | View controller for chatting
46 |
47 | PMUFinalizeViewController.h / PMUFinalizeViewController.m:
48 | View controller for paying
49 |
50 | PMUMapViewController.h / PMUMapViewController.m:
51 | View controller for map
52 |
53 | PMUMessageTableView.h / PMUMessageTableView.m:
54 | View for chat table
55 |
56 | PMUMessageTableViewDataSource.h:
57 | Data source protocol for chat table
58 |
59 | PMUPairingViewController.h / PMUPairingViewController.m:
60 | View controller for pairing passenger with driver
61 |
62 | PMURequestViewController.h / PMURequestViewController.m:
63 | View controller for submitting passenger request
64 |
65 | PMUSpinnerViewController.h / PMUSpinnerViewController.m:
66 | View controller for spinner waiting for accept request
67 |
68 | Main_iPad.storyboard:
69 | Storyboard for iPad
70 |
71 | Main_iPhone.storyboard:
72 | Storyboard for 4inch iPhone
73 |
74 | Secondary_iPhone.storyboard:
75 | Storyboard for 3.5inch iPhone
76 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | mqtt-PickMeUp
2 | =============
3 |
4 | PickMeUp is a sample ride sharing application that accompanies IBM Redbooks Publication SG24-8228-00: Building Realtime Mobile Solutions with MQTT and IBM Message Sight (http://www.redbooks.ibm.com/Redbooks.nsf/RedpieceAbstracts/sg248228.html)
5 |
6 | The application is powered by MQTT and IBM MessageSight.
7 |
8 | This project includes three different applications:
9 | + PickMeUp-iOS
10 | + PickMeUp-Android
11 | + PickMeUp-HTML5
12 |
13 | The Passenger Applications
14 | ==========================
15 | The iOS and Android applications are passenger applications. A customer that would like to request a ride would use one of these applications to submit a request for a driver to pick them up.
16 |
17 | PickMeUp-iOS
18 | ------------
19 | Refer to PickMeUp-iOS/README.md
20 |
21 | PickMeUp-Android
22 | ----------------
23 | Refer to PickMeUp-Android/README.md
24 |
25 | The Driver Application
26 | ======================
27 | The HTML5 application is the driver application. A driver would use the application to view and accept incoming requests from passengers.
28 |
29 |
30 | PickMeUp-HTML5
31 | --------------
32 | Refer to PickMeUp-HTML5/README.md
--------------------------------------------------------------------------------