Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
c110a912
Commit
c110a912
authored
Mar 08, 2013
by
Jeffrey I. Schiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert from Bugsense to ACRA
Change-Id: Iba724b4213d23e920c6b4c1653fdbba300839535
parent
a1bf22b6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
45 deletions
+41
-45
appinventor/build.xml
appinventor/build.xml
+2
-2
appinventor/buildserver/build.xml
appinventor/buildserver/build.xml
+1
-1
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
...rver/src/com/google/appinventor/buildserver/Compiler.java
+9
-5
appinventor/common/GitBuildId.template
appinventor/common/GitBuildId.template
+4
-4
appinventor/common/build.xml
appinventor/common/build.xml
+1
-1
appinventor/components/build.xml
appinventor/components/build.xml
+3
-3
appinventor/components/src/com/google/appinventor/components/runtime/ReplApplication.java
...oogle/appinventor/components/runtime/ReplApplication.java
+21
-19
appinventor/components/src/com/google/appinventor/components/runtime/util/EclairUtil.java
...oogle/appinventor/components/runtime/util/EclairUtil.java
+0
-10
appinventor/lib/acra/acra-4.4.0.jar
appinventor/lib/acra/acra-4.4.0.jar
+0
-0
appinventor/lib/bugsense/bugsense3.1.jar
appinventor/lib/bugsense/bugsense3.1.jar
+0
-0
No files found.
appinventor/build.xml
View file @
c110a912
...
...
@@ -90,8 +90,8 @@
<pathelement
location=
"lib/oauth/google-oauth-client-1.10.1-beta.jar"
/>
<!-- fusiontables libs -->
<pathelement
location=
"lib/fusiontables/fusiontables.jar"
/>
<!--
bugsense
-->
<pathelement
location=
"lib/
bugsense/bugsense3.1
.jar"
/>
<!--
acra
-->
<pathelement
location=
"lib/
acra/acra-4.4.0
.jar"
/>
<!-- gwt libs -->
<pathelement
location=
"lib/gwt/2.3.0/gwt-dev.jar"
/>
<pathelement
location=
"lib/gwt/2.3.0/gwt-user.jar"
/>
...
...
appinventor/buildserver/build.xml
View file @
c110a912
...
...
@@ -129,7 +129,7 @@
</copy>
<copy
toFile=
"${classes.files.dir}/YailGenerator.jar"
file=
"${local.build.dir}/YailGenerator.jar"
/>
<copy
toFile=
"${classes.files.dir}/kawa.jar"
file=
"${lib.dir}/kawa/kawa-1.11-modified.jar"
/>
<copy
toFile=
"${classes.files.dir}/
bugsense3.1.jar"
file=
"${lib.dir}/bugsense/bugsense3.1
.jar"
/>
<copy
toFile=
"${classes.files.dir}/
acra-4.4.0.jar"
file=
"${lib.dir}/acra/acra-4.4.0
.jar"
/>
<copy
toFile=
"${classes.files.dir}/twitter4j.jar"
file=
"${lib.dir}/twitter/twitter4j-core-android-2.2.6.jar"
/>
<copy
toFile=
"${classes.files.dir}/fusiontables.jar"
file=
"${lib.dir}/fusiontables/fusiontables.jar"
/>
<copy
toFile=
"${classes.files.dir}/google-api-client-beta.jar"
file=
"${lib.dir}/oauth/google-api-client-1.10.3-beta.jar"
/>
...
...
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
View file @
c110a912
...
...
@@ -94,8 +94,8 @@ public final class Compiler {
"/tools/linux/aapt"
;
private
static
final
String
KAWA_RUNTIME
=
RUNTIME_FILES_DIR
+
"kawa.jar"
;
private
static
final
String
BUGSENSE
_RUNTIME
=
RUNTIME_FILES_DIR
+
"
bugsense3.1
.jar"
;
private
static
final
String
ACRA
_RUNTIME
=
RUNTIME_FILES_DIR
+
"
acra-4.4.0
.jar"
;
private
static
final
String
DX_JAR
=
RUNTIME_FILES_DIR
+
"dx.jar"
;
...
...
@@ -174,6 +174,10 @@ public final class Compiler {
for
(
String
componentType
:
componentTypes
)
{
permissions
.
addAll
(
componentPermissions
.
get
(
componentType
));
}
if
(
isForWireless
)
{
// This is so ACRA can do a logcat on phones older then Jelly Bean
permissions
.
add
(
"android.permission.READ_LOGS"
);
}
return
permissions
;
}
...
...
@@ -279,7 +283,7 @@ public final class Compiler {
out
.
write
(
"android:debuggable=\"false\" "
);
out
.
write
(
"android:label=\""
+
projectName
+
"\" "
);
out
.
write
(
"android:icon=\"@drawable/ya\" "
);
if
(
isForWireless
)
{
// This is to hook into
Bugsense
if
(
isForWireless
)
{
// This is to hook into
ACRA
out
.
write
(
"android:name=\"com.google.appinventor.components.runtime.ReplApplication\" "
);
}
out
.
write
(
">\n"
);
...
...
@@ -624,7 +628,7 @@ public final class Compiler {
// Construct the class path including component libraries (jars)
String
classpath
=
getResource
(
KAWA_RUNTIME
)
+
File
.
pathSeparator
+
getResource
(
BUGSENSE
_RUNTIME
)
+
File
.
pathSeparator
+
getResource
(
ACRA
_RUNTIME
)
+
File
.
pathSeparator
+
getResource
(
SIMPLE_ANDROID_RUNTIME_JAR
)
+
File
.
pathSeparator
;
// Add component library names to classpath
...
...
@@ -837,7 +841,7 @@ public final class Compiler {
commandLineList
.
add
(
classesDir
.
getAbsolutePath
());
commandLineList
.
add
(
getResource
(
SIMPLE_ANDROID_RUNTIME_JAR
));
commandLineList
.
add
(
getResource
(
KAWA_RUNTIME
));
commandLineList
.
add
(
getResource
(
BUGSENSE
_RUNTIME
));
commandLineList
.
add
(
getResource
(
ACRA
_RUNTIME
));
// Add libraries to command line arguments
System
.
out
.
println
(
"Libraries needed command line n = "
+
librariesNeeded
.
size
());
...
...
appinventor/common/GitBuildId.template
View file @
c110a912
...
...
@@ -17,7 +17,7 @@ public final class GitBuildId {
public static final String GIT_BUILD_VERSION = "@git.build.version@";
public static final String GIT_BUILD_FINGERPRINT = "@git.build.fingerprint@";
public static final String ANT_BUILD_DATE = "@ant.build.date@";
public static final String
BUGSENSE_API_KEY = "@bugsense.apikey
@";
public static final String
ACRA_URI = "@acra.uri
@";
private GitBuildId() {
}
...
...
@@ -44,10 +44,10 @@ public final class GitBuildId {
return ANT_BUILD_DATE;
}
public static String get
BugsenseApiKey
() {
if (
BUGSENSE_API_KEY.equals("${bugsense.apikey
}")) // This is the value if no value is provided to ant
public static String get
AcraUri
() {
if (
ACRA_URI.equals("${acra.uri
}")) // This is the value if no value is provided to ant
return("");
return
BUGSENSE_API_KEY
.trim();
return
ACRA_URI
.trim();
}
}
appinventor/common/build.xml
View file @
c110a912
...
...
@@ -110,7 +110,7 @@
<property
name=
"ant.build.date"
value=
"${TODAY}"
/>
<filter
token=
"ant.build.date"
value=
"${ant.build.date}"
/>
<filter
token=
"
bugsense.apikey"
value=
"${bugsense.apikey
}"
/>
<filter
token=
"
acra.uri"
value=
"${acra.uri
}"
/>
<mkdir
dir=
"${local.build.dir}/src/${common.pkg}/version/"
/>
<copy
tofile=
"${local.build.dir}/src/${common.pkg}/version/GitBuildId.java"
file=
"GitBuildId.template"
filtering=
"true"
/>
...
...
appinventor/components/build.xml
View file @
c110a912
...
...
@@ -119,7 +119,7 @@
<pathelement
location=
"${build.dir}/common/CommonVersion.jar"
/>
<pathelement
location=
"${lib.dir}/android/2.2/android.jar"
/>
<pathelement
location=
"${lib.dir}/kawa/kawa-1.11-modified.jar"
/>
<pathelement
location=
"${lib.dir}/
bugsense/bugsense3.1
.jar"
/>
<pathelement
location=
"${lib.dir}/
acra/acra-4.4.0
.jar"
/>
<pathelement
location=
"${lib.dir}/twitter/twitter4j-core-android-2.2.6.jar"
/>
<pathelement
location=
"${lib.dir}/fusiontables/fusiontables.jar"
/>
<pathelement
location=
"${lib.dir}/oauth/google-api-client-1.10.3-beta.jar"
/>
...
...
@@ -151,7 +151,7 @@
<pathelement
location=
"${lib.dir}/junit/junit-4.8.2.jar"
/>
<pathelement
location=
"${lib.dir}/junit4/tl4j-junit4-1.1.3.jar"
/>
<pathelement
location=
"${lib.dir}/kawa/kawa-1.11-modified.jar"
/>
<pathelement
location=
"${lib.dir}/
bugsense/bugsense3.1
.jar"
/>
<pathelement
location=
"${lib.dir}/
acra/acra-4.4.0
.jar"
/>
<pathelement
location=
"${lib.dir}/powermock/cglib-nodep-2.2.jar"
/>
<pathelement
location=
"${lib.dir}/powermock/easymock-3.0.jar"
/>
<pathelement
location=
"${lib.dir}/powermock/javassist-3.15.0-GA.jar"
/>
...
...
@@ -216,7 +216,7 @@
<pathelement
location=
"${lib.dir}/android/2.2/android.jar"
/>
<pathelement
location=
"${lib.dir}/guava/guava-11.0.1.jar"
/>
<pathelement
location=
"${lib.dir}/kawa/kawa-1.11-modified.jar"
/>
<pathelement
location=
"${lib.dir}/
bugsense/bugsense3.1
.jar"
/>
<pathelement
location=
"${lib.dir}/
acra/acra-4.4.0
.jar"
/>
<pathelement
location=
"${lib.dir}/twitter/twitter4j-core-android-2.2.6.jar"
/>
<pathelement
location=
"${lib.dir}/fusiontables/fusiontables.jar"
/>
<pathelement
location=
"${lib.dir}/oauth/google-api-client-1.10.3-beta.jar"
/>
...
...
appinventor/components/src/com/google/appinventor/components/runtime/ReplApplication.java
View file @
c110a912
...
...
@@ -11,45 +11,47 @@ import com.google.appinventor.common.version.GitBuildId;
import
com.google.appinventor.components.runtime.util.EclairUtil
;
import
com.google.appinventor.components.runtime.util.SdkLevel
;
import
org.acra.*
;
import
org.acra.annotation.*
;
/**
* Subclass of Application. Normally App Inventor apps just use the
* android.app.Application class as their main application. However we
* use the
Bugsense
debugging application with the MIT AI Companion
* use the
ACRA
debugging application with the MIT AI Companion
* app. This class is only pointed to by the Android Manifest if
* Compiler.java (which builds the Manifest) is building the Wireless
* version of the MIT AI Companion. In this fashion we only turn on
* bugsense when using the Wireless MIT AI Companion.
*
* Bugsense *can* be hooked into an Activity as well as an
* Application, however ACRA, which we may use as an alternative, only
* hooks into an Application object, so that is why we hook bugsense
* here. It Makes changing over to ACRA reasonably easy.
* ACRA when using the Wireless MIT AI Companion.
*
* @author jis@mit.edu (Jeffrey I. Schiller)
*/
@ReportsCrashes
(
formKey
=
""
)
public
class
ReplApplication
extends
Application
{
private
static
ReplApplication
theInstance
=
null
;
private
boolean
active
=
false
;
private
static
ReplApplication
thisInstance
;
@Override
public
void
onCreate
()
{
super
.
onCreate
();
String
apikey
=
GitBuildId
.
getBugsenseApiKey
();
if
((
SdkLevel
.
getLevel
()
>
SdkLevel
.
LEVEL_DONUT
)
&&
!
apikey
.
equals
(
""
))
{
EclairUtil
.
setupBugSense
((
Context
)
this
,
apikey
);
theInstance
=
this
;
active
=
true
;
Log
.
i
(
"ReplApplication"
,
"Bugsense Active APIKEY = "
+
apikey
);
thisInstance
=
this
;
String
acraUri
=
GitBuildId
.
getAcraUri
();
if
(
acraUri
.
equals
(
""
))
{
Log
.
i
(
"ReplApplication"
,
"ACRA Not Active"
);
}
else
{
Log
.
i
(
"ReplApplication"
,
"Bugsense NOT ACTIVE"
);
Log
.
i
(
"ReplApplication"
,
"ACRA Active, URI = "
+
acraUri
);
ACRAConfiguration
config
=
ACRA
.
getNewDefaultConfig
(
this
);
config
.
setFormUri
(
acraUri
);
config
.
setDisableSSLCertValidation
(
true
);
// So we can use an MIT or self signed cert
ACRA
.
setConfig
(
config
);
// On the server.
ACRA
.
init
(
this
);
active
=
true
;
}
}
public
static
void
reportError
(
Exception
ex
)
{
if
(
theInstance
!=
null
&&
theInstance
.
active
)
{
EclairUtil
.
sendBugSenseException
(
ex
);
}
public
static
void
reportError
(
Throwable
ex
)
{
if
(
thisInstance
!=
null
&&
thisInstance
.
active
)
ACRA
.
getErrorReporter
().
handleException
(
ex
);
}
}
appinventor/components/src/com/google/appinventor/components/runtime/util/EclairUtil.java
View file @
c110a912
...
...
@@ -11,8 +11,6 @@ import android.app.AlertDialog;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
com.bugsense.trace.BugSenseHandler
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.webkit.GeolocationPermissions
;
...
...
@@ -44,14 +42,6 @@ public class EclairUtil {
activity
.
overridePendingTransition
(
enterAnim
,
exitAnim
);
}
public
static
void
setupBugSense
(
Context
context
,
String
api_key
)
{
BugSenseHandler
.
initAndStartSession
(
context
,
api_key
);
}
public
static
void
sendBugSenseException
(
Exception
ex
)
{
BugSenseHandler
.
sendException
(
ex
);
}
/**
* Setup Dialog Box to request location permission from end-user for the Javascript
* location (navigator.geolocation.getCurrentLocation()) API.
...
...
appinventor/lib/acra/acra-4.4.0.jar
0 → 100644
View file @
c110a912
File added
appinventor/lib/bugsense/bugsense3.1.jar
deleted
100644 → 0
View file @
a1bf22b6
File deleted
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment