Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
- Add support to aware:// and aware-ssl:// study URLs. This allows en…
Browse files Browse the repository at this point in the history
…rolling to a study on devices without a camera or QRCode!

- Fixed #53 @rkdarst
  • Loading branch information
denzilferreira committed Jul 11, 2017
1 parent 36d17ca commit 9d172e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions aware-phone/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@
android:label="Join study"
android:launchMode="singleTop"
android:theme="@style/Theme.Aware">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="aware"/>
<data android:scheme="aware-ssl"/>
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.aware.phone.Aware_Client" />
Expand Down
11 changes: 11 additions & 0 deletions aware-phone/src/main/java/com/aware/phone/ui/Aware_Join_Study.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ protected void onCreate(Bundle savedInstanceState) {

study_url = getIntent().getStringExtra(EXTRA_STUDY_URL);

//If we are getting here from an AWARE study link
String scheme = getIntent().getScheme();
if (scheme != null) {
if (Aware.DEBUG) Log.d(Aware.TAG, "AWARE Link detected: " + getIntent().getDataString() + " SCHEME: " + scheme);
if (scheme.equalsIgnoreCase("aware")) {
study_url = getIntent().getDataString().replace("aware://","http://");
} else if (scheme.equalsIgnoreCase("aware-ssl")) {
study_url = getIntent().getDataString().replace("aware-ssl://","https://");
}
}

if (Aware.DEBUG) Log.d(Aware.TAG, "Study URL:" + study_url);

Cursor qry = Aware.getStudy(this, study_url);
Expand Down
4 changes: 2 additions & 2 deletions aware-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':aware-core')
implementation "com.android.support:gridlayout-v7:$support_libs"
implementation "com.android.support:appcompat-v7:$support_libs"
implementation "com.android.support:gridlayout-v7:$support_libs"
}

0 comments on commit 9d172e3

Please sign in to comment.