Browse Source

added crashlytics; fixed add shortcut

tags/0.0.6
Robin Thoni 9 years ago
parent
commit
69936949de

+ 19
- 1
app/build.gradle View File

1
+buildscript {
2
+    repositories {
3
+        maven { url 'https://maven.fabric.io/public' }
4
+    }
5
+
6
+    dependencies {
7
+        classpath 'io.fabric.tools:gradle:1.+'
8
+    }
9
+}
1
 apply plugin: 'com.android.application'
10
 apply plugin: 'com.android.application'
11
+apply plugin: 'io.fabric'
12
+
13
+repositories {
14
+    maven { url 'https://maven.fabric.io/public' }
15
+}
16
+
2
 
17
 
3
 android {
18
 android {
4
     compileSdkVersion 22
19
     compileSdkVersion 22
9
         minSdkVersion 14
24
         minSdkVersion 14
10
         targetSdkVersion 22
25
         targetSdkVersion 22
11
         versionCode 1
26
         versionCode 1
12
-        versionName "1.0"
27
+        versionName "0.1"
13
     }
28
     }
14
     buildTypes {
29
     buildTypes {
15
         release {
30
         release {
26
     compile 'com.android.support:design:22.2.1'
41
     compile 'com.android.support:design:22.2.1'
27
     compile project(':luticateauth')
42
     compile project(':luticateauth')
28
     compile project(':luticateutils')
43
     compile project(':luticateutils')
44
+    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
45
+        transitive = true;
46
+    }
29
 }
47
 }

+ 3
- 0
app/fabric.properties View File

1
+#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.
2
+#Mon Dec 14 14:31:41 CET 2015
3
+apiSecret=71c666a848cbc681b75cb5f752d99f14ba72dc750df64d7fcd297346ba7d19c8

+ 4
- 0
app/src/main/AndroidManifest.xml View File

7
     <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
7
     <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
8
     <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
8
     <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
9
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
9
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
10
+    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
10
 
11
 
11
     <application
12
     <application
12
         android:allowBackup="true"
13
         android:allowBackup="true"
69
                 <action android:name="android.intent.action.MAIN"/>
70
                 <action android:name="android.intent.action.MAIN"/>
70
             </intent-filter>
71
             </intent-filter>
71
         </activity>
72
         </activity>
73
+        <meta-data
74
+            android:name="io.fabric.ApiKey"
75
+            android:value="14e66de5fb5aa5919032a19ebb8a160f0bc393a8" />
72
     </application>
76
     </application>
73
 
77
 
74
 </manifest>
78
 </manifest>

+ 3
- 2
app/src/main/java/com/rthoni/camotion/ui/AddCommandShortcutActivity.java View File

78
         shortcutIntent.putExtra("COMMAND", command.toString());
78
         shortcutIntent.putExtra("COMMAND", command.toString());
79
         Intent.ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(this, R.mipmap.ic_command_bg);
79
         Intent.ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(this, R.mipmap.ic_command_bg);
80
 
80
 
81
-        Intent intent = new Intent();
81
+        Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
82
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
82
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
83
         intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, command.getName());
83
         intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, command.getName());
84
         intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
84
         intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
85
-        setResult(RESULT_OK, intent);
85
+
86
+        sendBroadcast(intent);
86
         finish();
87
         finish();
87
     }
88
     }
88
 }
89
 }

+ 3
- 0
app/src/main/java/com/rthoni/camotion/ui/MainActivity.java View File

16
 import android.widget.TextView;
16
 import android.widget.TextView;
17
 import android.widget.Toast;
17
 import android.widget.Toast;
18
 
18
 
19
+import com.crashlytics.android.Crashlytics;
19
 import com.luticate.auth.dbo.LuFullLoginDbo;
20
 import com.luticate.auth.dbo.LuFullLoginDbo;
20
 import com.luticate.utils.business.LuPromise;
21
 import com.luticate.utils.business.LuPromise;
21
 import com.luticate.utils.business.LuRequest;
22
 import com.luticate.utils.business.LuRequest;
28
 import com.rthoni.camotion.ui.fragments.CommandsFragment;
29
 import com.rthoni.camotion.ui.fragments.CommandsFragment;
29
 import com.rthoni.camotion.ui.fragments.SensorsFragment;
30
 import com.rthoni.camotion.ui.fragments.SensorsFragment;
30
 
31
 
32
+import io.fabric.sdk.android.Fabric;
31
 import java.util.List;
33
 import java.util.List;
32
 
34
 
33
 public class MainActivity extends AppCompatActivity
35
 public class MainActivity extends AppCompatActivity
45
     @Override
47
     @Override
46
     protected void onCreate(Bundle savedInstanceState) {
48
     protected void onCreate(Bundle savedInstanceState) {
47
         super.onCreate(savedInstanceState);
49
         super.onCreate(savedInstanceState);
50
+        Fabric.with(this, new Crashlytics());
48
         LuRequest.init(this);
51
         LuRequest.init(this);
49
         setContentView(R.layout.activity_main);
52
         setContentView(R.layout.activity_main);
50
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
53
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

+ 2
- 2
app/src/main/java/com/rthoni/camotion/ui/dialogs/CommandExecDialog.java View File

44
         CommandsBusiness.exec(config, command).then(new LuPromise.LuConsumer<LuVoidDbo>() {
44
         CommandsBusiness.exec(config, command).then(new LuPromise.LuConsumer<LuVoidDbo>() {
45
             @Override
45
             @Override
46
             public void execute(LuVoidDbo data) {
46
             public void execute(LuVoidDbo data) {
47
-                dlg.hide();
47
+                dlg.dismiss();
48
                 showEndDialog(context, context.getString(R.string.command_success, command.getName()))
48
                 showEndDialog(context, context.getString(R.string.command_success, command.getName()))
49
                     .then(new LuPromise.LuConsumer<Boolean>() {
49
                     .then(new LuPromise.LuConsumer<Boolean>() {
50
                         @Override
50
                         @Override
56
         }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
56
         }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
57
             @Override
57
             @Override
58
             public void execute(final LuPromise.LuPromiseError error) {
58
             public void execute(final LuPromise.LuPromiseError error) {
59
-                dlg.hide();
59
+                dlg.dismiss();
60
                 showEndDialog(context, context.getString(R.string.error, error.toString()))
60
                 showEndDialog(context, context.getString(R.string.error, error.toString()))
61
                         .then(new LuPromise.LuConsumer<Boolean>() {
61
                         .then(new LuPromise.LuConsumer<Boolean>() {
62
                             @Override
62
                             @Override

+ 4
- 4
app/src/main/java/com/rthoni/camotion/ui/dialogs/LoginDialog.java View File

33
                 .then(new LuPromise.LuConsumer<LuLoginDbo>() {
33
                 .then(new LuPromise.LuConsumer<LuLoginDbo>() {
34
                     @Override
34
                     @Override
35
                     public void execute(LuLoginDbo data) {
35
                     public void execute(LuLoginDbo data) {
36
-                        hide();
36
+                        dismiss();
37
                         promise.resolve(data);
37
                         promise.resolve(data);
38
                     }
38
                     }
39
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
39
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
40
                     @Override
40
                     @Override
41
                     public void execute(LuPromise.LuPromiseError data) {
41
                     public void execute(LuPromise.LuPromiseError data) {
42
-                        hide();
42
+                        dismiss();
43
                         promise.reject(data);
43
                         promise.reject(data);
44
                     }
44
                     }
45
                 });
45
                 });
62
                                         LuFullLoginDbo dbo = new LuFullLoginDbo();
62
                                         LuFullLoginDbo dbo = new LuFullLoginDbo();
63
                                         dbo.setPermissions(permissions.getData());
63
                                         dbo.setPermissions(permissions.getData());
64
                                         dbo.setLoginDbo(loginDbo);
64
                                         dbo.setLoginDbo(loginDbo);
65
-                                        hide();
65
+                                        dismiss();
66
                                         promise.resolve(dbo);
66
                                         promise.resolve(dbo);
67
                                     }
67
                                     }
68
                                 });
68
                                 });
70
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
70
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
71
                     @Override
71
                     @Override
72
                     public void execute(LuPromise.LuPromiseError data) {
72
                     public void execute(LuPromise.LuPromiseError data) {
73
-                        hide();
73
+                        dismiss();
74
                         promise.reject(data);
74
                         promise.reject(data);
75
                     }
75
                     }
76
                 });
76
                 });

Loading…
Cancel
Save