Skip to content

Commit 563047c

Browse files
committed
Added heroku server, now app can be tested on live server
1 parent 964608b commit 563047c

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/apporioinfolabs/ats_tracking_sdk/MainApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void onCreate() {
3131
.setNotificationContent("Some Content that will run once the location service is started.")
3232
// .setConnectedStateColor(Color.argb(0, 102, 0 , 204))
3333
// .setDisconnectedColor(Color.argb(0 , 255, 255, 102))
34-
.setSocketEndPoint("http://192.168.1.33:3027")
34+
// .setSocketEndPoint("http://192.168.1.33:3027")
3535
.setNotificationIcon(R.drawable.samll_notification_icon)
3636
.init();
3737

ats-sdk/src/main/java/com/apporioinfolabs/ats_sdk/ATS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static class Builder {
110110

111111
// Socket Settings
112112
// public String SocketEndPoint = "http://13.233.98.63:3005";
113-
public String SocketEndPoint = "http://13.233.98.63:3027";
113+
public String SocketEndPoint = "http://atssdk.herokuapp.com";
114114
public int LocationLogStashSyncRate = 30 ; // this will sync 30 logs from the logs stash every time
115115

116116
// TaxiSegmentActionHandler mTaxiSegmentActionHandler;

ats-sdk/src/main/java/com/apporioinfolabs/ats_sdk/managers/NotificationManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ public void updateNotificationSocketConnectivity (String connectivity ){
102102
mBuilder.setColor(connectivity.equals(""+SocketManager.SOCKET_CONNECTED) ? ATS.mBuilder.SocketConnectedColor : ATS.mBuilder.SocketDisConnectedColor );
103103
manager.notify(1, mBuilder.build());
104104
}else{
105-
mBigRemoteViews.setTextViewText(R.id.socket_connected_state, connectivity.equals(""+SocketManager.SOCKET_CONNECTED)?"Socket: Connected":"Socket: Disconnected");
106-
mBigRemoteViews.setTextColor(R.id.socket_connected_state, connectivity.equals(""+SocketManager.SOCKET_CONNECTED)? ATS.mBuilder.SocketConnectedColor : ATS.mBuilder.SocketDisConnectedColor );
105+
mBigRemoteViews.setTextViewText(R.id.socket_connected_state, connectivity.equals(""+SocketManager.SOCKET_CONNECTED)?"Socket: CONNECTED":"Socket: DISCONNECTED");
106+
// mBigRemoteViews.setTextColor(R.id.socket_connected_state, connectivity.equals(""+SocketManager.SOCKET_CONNECTED)? ATS.mBuilder.SocketConnectedColor : ATS.mBuilder.SocketDisConnectedColor );
107107
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
108108
mNotificationManager.notify(NOTIF_ID, mNotification);
109109
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
@@ -130,6 +130,7 @@ private void NotifyNotification(String data){
130130

131131
if (ATS.mBuilder.IsDevelperMode) {
132132
mBigRemoteViews.setTextViewText(R.id.bigger_notification_text, ""+data);
133+
mBigRemoteViews.setTextViewText(R.id.socket_connected_state, SocketManager.isSocketConnected()?"Socket: CONNECTED":"Socket: DISCONNECTED");
133134
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
134135
mNotificationManager.notify(NOTIF_ID, mNotification);
135136
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {

ats-sdk/src/main/java/com/apporioinfolabs/ats_sdk/managers/SocketManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ public SocketManager(){
7171
IO.Options opts = new IO.Options();
7272
opts.forceNew = true;
7373
opts.query = ""+ATS.mBuilder.AppId ;
74-
mSocket = IO.socket(""+ ATS.mBuilder.SocketEndPoint, opts);
74+
75+
76+
mSocket = IO.socket(""+ ATS.mBuilder. SocketEndPoint, opts);
7577
mSocket.on(CONNECT, onConnect);
7678
mSocket.on(DISCONNECT, onDisconnected);
7779
mSocket.connect();
7880

7981
mHandler = new Handler();
8082

83+
84+
8185
} catch (Exception e){
8286
LOGS.e(TAG , ""+e.getMessage());
8387
}
@@ -95,6 +99,7 @@ public void call(final Object... args) {
9599
}
96100
catch (Exception e){ LOGS.e(TAG , ""+e.getMessage()); }
97101
EventBus.getDefault().post(SOCKET_CONNECTED);
102+
98103
}
99104
};
100105

@@ -549,7 +554,7 @@ public void call(Object... args) {
549554
}
550555

551556

552-
public boolean isSocketConnected(){
557+
public static boolean isSocketConnected(){
553558
if(mSocket.connected()){
554559
return true ;
555560
}else{

ats-sdk/src/main/res/layout/custom_notification_big.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:orientation="vertical"
44
android:layout_width="match_parent"
5-
android:layout_height="50dp"
5+
android:layout_height="150dp"
66
android:background="#009688"
77
android:id="@+id/background"
88
android:padding="5dp">

0 commit comments

Comments
 (0)