Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
kishoreyekkanti committed Feb 8, 2013
2 parents 50f994a + 94cfa84 commit 544d4b0
Show file tree
Hide file tree
Showing 25 changed files with 326 additions and 95 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ env:
- ANDROID_HOME=$HOME/android-sdk-linux
- secure: "eATae5kWD2tL3xtUdQjk4T5RWn4zv5OS4QXjwL9q/E4ntzge3rVPRGVSyS5/\nL/d48QLlliDzC6d7ycFVyEZC0OLzpHNER56vhP4YY9yfLygHr+NQJizPEiMJ\nPj5vUu9+qfOb3icQuQYDamuOCT7CxnVXSxVApfpFSSGz1YFpwfs="
matrix:
- ANDROID_SDKS=android-8 ANDROID_TARGET=android-8 ANDROID_ABI=armeabi
# - ANDROID_SDKS=android-8 ANDROID_TARGET=android-8 ANDROID_ABI=armeabi
# - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi
- ANDROID_SDKS=android-15,sysimg-17 ANDROID_TARGET=android-15 ANDROID_ABI=armeabi-v7a
# - ANDROID_SDKS=android-17,sysimg-17 ANDROID_TARGET=android-17 ANDROID_ABI=armeabi-v7a

branches:
Expand All @@ -27,11 +28,11 @@ before_install:
- wget -nv http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz
- tar xfz android-sdk_r21.0.1-linux.tgz -C ~
- android --silent update sdk --filter platform-tools,android-8,$ANDROID_SDKS,extra-android-support --no-ui --force
# - android list targets
- echo no | android --silent create avd --name rapidftr --target $ANDROID_TARGET --abi $ANDROID_ABI --skin QVGA --sdcard 50M

install: echo
script: mvn -P with-emulator clean install
script: mvn clean test
# script: mvn -P with-emulator clean install

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion RapidFTR-Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</activity>

<activity android:name=".activity.MainActivity"/>
<activity android:name=".activity.RegisterChildActivity" android:configChanges="orientation" />
<activity android:name=".activity.RegisterChildActivity" android:configChanges="orientation" android:windowSoftInputMode="stateHidden" />
<activity android:name=".activity.ViewChildActivity" android:configChanges="orientation" />
<activity android:name=".activity.EditChildActivity" android:configChanges="orientation" />
<activity android:name=".activity.SignupActivity"/>
Expand Down
92 changes: 72 additions & 20 deletions RapidFTR-Android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.1.3</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -128,28 +127,77 @@
<artifactId>keytool-maven-plugin</artifactId>
<executions>
<execution>
<id>default_certs</id>
<phase>initialize</phase>
<configuration>
<workingDirectory>${project.basedir}/res/raw</workingDirectory>
<noprompt/>
<trustcacerts>true</trustcacerts>
<keystore>${project.basedir}/res/raw/trusted.bks</keystore>
<storetype>bks</storetype>
<alias>rapid_ftr_default</alias>
<storepass>rapidftr</storepass>
<file>rapid_ftr_ca.der</file>
<arguments>
<argument>-provider</argument>
<argument>org.bouncycastle.jce.provider.BouncyCastleProvider</argument>
<argument>-providerpath</argument>
<argument>${org.bouncycastle:bcprov-jdk16:jar}</argument>
</arguments>
</configuration>
<goals>
<goal>clean</goal>
<goal>import</goal>
</goals>
</execution>
<execution>
<id>uw_cert</id>
<phase>initialize</phase>
<configuration>
<workingDirectory>${project.basedir}/res/raw</workingDirectory>
<noprompt/>
<trustcacerts>true</trustcacerts>
<keystore>${project.basedir}/res/raw/trusted.bks</keystore>
<storetype>bks</storetype>
<alias>rapid_ftr_uw</alias>
<storepass>rapidftr</storepass>
<file>uw_rapid_ftr_ca.crt</file>
<arguments>
<argument>-provider</argument>
<argument>org.bouncycastle.jce.provider.BouncyCastleProvider</argument>
<argument>-providerpath</argument>
<argument>${org.bouncycastle:bcprov-jdk16:jar}</argument>
</arguments>
</configuration>
<goals>
<goal>import</goal>
</goals>
</execution>
<execution>
<id>uw2_cert</id>
<phase>initialize</phase>
<configuration>
<workingDirectory>${project.basedir}/res/raw</workingDirectory>
<noprompt/>
<trustcacerts>true</trustcacerts>
<keystore>${project.basedir}/res/raw/trusted.bks</keystore>
<storetype>bks</storetype>
<alias>rapid_ftr_uw2</alias>
<storepass>rapidftr</storepass>
<file>uw2_rapid_ftr_ca.crt</file>
<arguments>
<argument>-provider</argument>
<argument>org.bouncycastle.jce.provider.BouncyCastleProvider</argument>
<argument>-providerpath</argument>
<argument>${org.bouncycastle:bcprov-jdk16:jar}</argument>
</arguments>
</configuration>
<goals>
<goal>import</goal>
</goals>
</execution>
</executions>
<configuration>
<workingDirectory>${project.basedir}/res/raw</workingDirectory>
<noprompt/>
<trustcacerts/>
<keystore>${project.basedir}/res/raw/trusted.bks</keystore>
<storetype>bks</storetype>
<storepass>rapidftr</storepass>
<file>rapid_ftr_ca.der</file>
<arguments>
<argument>-provider</argument>
<argument>org.bouncycastle.jce.provider.BouncyCastleProvider</argument>
<argument>-providerpath</argument>
<argument>${org.bouncycastle:bcprov-jdk16:jar}</argument>
</arguments>
</configuration>

</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -214,10 +262,14 @@
<phase>package</phase>
<configuration>
<tasks>
<copy file="${project.basedir}/target/${project.artifactId}.apk" tofile="${default.destination.directory}/${project.artifactId}${maven.build.timestamp}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}-aligned.apk" tofile="${default.destination.directory}/${project.artifactId}-aligned${maven.build.timestamp}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}.apk" tofile="${default.destination.directory}/latest/${project.artifactId}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}-aligned.apk" tofile="${default.destination.directory}/latest/${project.artifactId}-aligned.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}.apk"
tofile="${default.destination.directory}/${project.artifactId}${maven.build.timestamp}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}-aligned.apk"
tofile="${default.destination.directory}/${project.artifactId}-aligned${maven.build.timestamp}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}.apk"
tofile="${default.destination.directory}/latest/${project.artifactId}.apk"/>
<copy file="${project.basedir}/target/${project.artifactId}-aligned.apk"
tofile="${default.destination.directory}/latest/${project.artifactId}-aligned.apk"/>
</tasks>
</configuration>
<goals>
Expand Down
4 changes: 0 additions & 4 deletions RapidFTR-Android/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@
android:id="@+id/search_child"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<Button android:text="@string/synchronize"
android:enabled="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
14 changes: 14 additions & 0 deletions RapidFTR-Android/res/raw/uw2_rapid_ftr_ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICHzCCAYgCCQDsXc4oatmtaDANBgkqhkiG9w0BAQUFADBUMQswCQYDVQQGEwJV
RzEQMA4GA1UECBMHS2FtcGFsYTEQMA4GA1UEBxMHS2FtcGFsYTEhMB8GA1UEChMY
SW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMB4XDTEyMDkyNjE1MzE0MVoXDTEzMDky
NjE1MzE0MVowVDELMAkGA1UEBhMCVUcxEDAOBgNVBAgTB0thbXBhbGExEDAOBgNV
BAcTB0thbXBhbGExITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCB
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyJk5K5xM1UOxWIbSEe59ei2N/fhz
F+yYSuV5wExtvziCWnYXt0NoxhItHgwvLqdWB9IvAGf7xAj4TmtG3HHC6OigkEe4
SflHKF+ksCurm0vfwondW5VD39nWyRTwbegNMzP2/r5hVmlU4vqKCpvLQQeo6y7H
XuY6bbpQOhvy0IECAwEAATANBgkqhkiG9w0BAQUFAAOBgQBOCZT/nN8Lt7L1ugu0
7gn5ZBN9U9D37stP2bta1Elw/vvn3St0JgP0jWwr84O7APYTZgUofjDCRrl3velx
Iem2HK33YSL0hkbNRIZeVqLMXeS/KXdJS8xC8ban3RhjqW1CMfjLA3MTwX2If16u
uNtU4TcGd4EMeaNBDIARFyZKNQ==
-----END CERTIFICATE-----
83 changes: 83 additions & 0 deletions RapidFTR-Android/res/raw/uw_rapid_ftr_ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
-----BEGIN CERTIFICATE-----
MIIE+DCCA+CgAwIBAgIRAKsLAy7mmHU0sVtktsQ53awwDQYJKoZIhvcNAQEFBQAw
czELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxGTAXBgNV
BAMTEFBvc2l0aXZlU1NMIENBIDIwHhcNMTIwOTIxMDAwMDAwWhcNMTMwOTIxMjM1
OTU5WjBbMSEwHwYDVQQLExhEb21haW4gQ29udHJvbCBWYWxpZGF0ZWQxHTAbBgNV
BAsTFFBvc2l0aXZlU1NMIFdpbGRjYXJkMRcwFQYDVQQDFA4qLnJhcGlkZnRyLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMJpKfYp31L5/zFdVNrl
jsuvHIxvCm2s0S+j4rlvVdPlBMjzH8rcrJdj2T60Uy0rRc52lbLq+BjcT9P4A7Zm
tzSLH7vEhMX2xopVWZMRRI0/9wn1JAzM50ov9hfM4TnKYndkJHrljY8PVHj1/Q33
i+8OdgkeFAcEQgcHwg1Vl1syC2wpUV1vWPdy8AJsvyixF8gsn1sVj0fiiBVeHnQM
VxHJX0BoOHV1+Hr3YMiU+GXwF0bfMXUNxSgVVuriBP2LU2cu3VvcC0ExCOoB9qYq
Bo51kdAP2A1w10PSE1eS/L8UQJHa0iMAJ/Tr0ZtrDztgzouuUPorDyKmHeQsrkj+
J40CAwEAAa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k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
2 changes: 2 additions & 0 deletions RapidFTR-Android/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

<string name="internal_error">An error occurred while performing this operation</string>
<string name="fetch_child_error">An error occurred while fetching record(s), please try again</string>
<string name="fetch_form_sections_error">An error occurred while fetching form sections</string>
<string name="submit">Submit</string>
<string name="edit">Edit</string>
<string name="save">Save</string>
Expand Down Expand Up @@ -103,4 +104,5 @@
<string name="play_record">Play</string>

<string name="network_down">Connection to the server lost, the sync process has been cancelled</string>
<string name="temp_sync_error">Error occurred while syncing the record with the server, please try again.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.google.common.base.Strings;
import com.google.common.io.CharStreams;
Expand Down Expand Up @@ -134,4 +136,9 @@ public boolean cleanSyncTask() {
return syncInProgress;
}

public boolean isOnline() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
return networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import android.app.AlertDialog;
import android.content.*;
import android.os.AsyncTask;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Looper;
import android.os.Process;
Expand All @@ -27,10 +25,10 @@
import com.rapidftr.task.SynchronisationAsyncTask;
import lombok.Getter;
import lombok.Setter;
import static android.net.ConnectivityManager.EXTRA_NETWORK_INFO;

import static com.rapidftr.RapidFtrApplication.APP_IDENTIFIER;
import static android.net.ConnectivityManager.EXTRA_NETWORK_INFO;
import static com.google.common.base.Strings.isNullOrEmpty;
import static com.rapidftr.RapidFtrApplication.APP_IDENTIFIER;
import static com.rapidftr.RapidFtrApplication.SERVER_URL_PREF;

public abstract class RapidFtrActivity extends FragmentActivity {
Expand Down Expand Up @@ -176,7 +174,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

private void synchronise() {
RapidFtrApplication application = RapidFtrApplication.getApplicationInstance();
if(!application.isOnline()){
makeToast(R.string.sync_error);
}
SynchronisationAsyncTask task = inject(SynchronisationAsyncTask.class);
application.setSyncTask(task);
task.setContext(this);
task.execute();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ protected void sync() {
SyncChildTask task = inject(SyncChildTask.class);
task.setActivity(this);
RapidFtrApplication.getApplicationInstance().setAsyncTaskWithDialog((AsyncTaskWithDialog) AsyncTaskWithDialog.wrap(this, task, R.string.sync_progress, R.string.sync_success, R.string.sync_failure).execute(child));

}

@Override
Expand Down Expand Up @@ -92,11 +91,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

protected void showSyncLog() {
try {
Toast.makeText(this,child.getSyncLog(), Toast.LENGTH_LONG).show();
} catch (JSONException e) {
e.printStackTrace();
}
Toast.makeText(this, getText(R.string.temp_sync_error), Toast.LENGTH_LONG).show();
}

}
Loading

0 comments on commit 544d4b0

Please sign in to comment.