This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you want to use BugSense for your fork, register with | |
// them and place your API key in /assets/bugsense.txt | |
// (This prevents me receiving reports of crashes from forked | |
// versions which is somewhat confusing!) | |
try { | |
InputStream inputStream = getAssets().open("bugsense.txt"); | |
String key = Utils.ReadInputStream(inputStream); | |
key=key.trim(); | |
Log.d("TAG", "Using bugsense key '"+key+"'"); | |
BugSenseHandler.setup(this, key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyUnityPlayerActivity extends UnityPlayerActivity | |
{ | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
BugSenseHandler.setup(this, "12345678"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AndroidJavaObject context; | |
// get current activity pointer | |
using (AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | |
{ | |
context = jc.GetStatic<AndroidJavaObject>("currentActivity"); | |
} | |
// start bugsense | |
using(var BugsenseClass = new AndroidJavaClass("com.bugsense.trace.BugSenseHandler") ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"client": { | |
"name": "bugsense-android", // Obligatory | |
"version": "0.6" | |
}, | |
"request": { | |
"custom_data": { | |
"key1": "value1", | |
"key2": "value2" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String,String> extras = new HashMap<String,String>(); | |
extras.put("activity","MyActivity"); | |
extras.put("username","Ventrix"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"application_environment":{ | |
"appname":"crash-me3", | |
"appver":"1.0", | |
"build_uuid":"7D65A0DB-C9E1-499F-9D20-BFE10E117181", | |
"carrier":"vf GR", | |
"gps_on":true, | |
"image_base_address":"0x2e000", | |
"image_size":"0x26000", | |
"internal_version":"1.0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For example if you want to get the last 1000 lines and log all messages | |
// with priority level "warning" and higher | |
BugSenseHandler.setLogging(1000, "*:W"); | |
//Log last 100 messages | |
BugSenseHandler.readLogs(100); | |
//Log all the messages with priority level "warning" and higher, on all tags. | |
BugSenseHandler.readLogs("*:W"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
BugSenseHandler.initAndStartSession(Context, APIKEY, HOSTURL); | |
setContentView(R.layout.main); | |
//rest of your code here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HashMap<String, String> extras = new HashMap<String, String>(); | |
extras.put("level", "second level"); | |
extras.put("difficulty", "impossibruuu"); | |
BugSenseHandler.addCrashExtraMap(extras); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
String a = null; | |
a.toString(); | |
}catch(Exception ex) { | |
ex.printStackTrace(); // in case you want to see the stacktrace in your log cat output | |
BugSenseHandler.sendException(ex); | |
} |