Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
Map<String,String> extras = new HashMap<String,String>();
extras.put("activity","MyActivity");
extras.put("username","Ventrix");
@PanosJee
PanosJee / bugsense.data.json
Last active October 2, 2015 19:58
BugSense Sample data
{
"client": {
"name": "bugsense-android", // Obligatory
"version": "0.6"
},
"request": {
"custom_data": {
"key1": "value1",
"key2": "value2"
}
@PanosJee
PanosJee / gist:1884877
Created February 22, 2012 12:40
bugsense-android-2
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") )
@PanosJee
PanosJee / gist:1884861
Created February 22, 2012 12:37
bugsense-unity-1
public class MyUnityPlayerActivity extends UnityPlayerActivity
{
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
BugSenseHandler.setup(this, "12345678");
}
}
@PanosJee
PanosJee / gist:1719821
Created February 1, 2012 22:17
oss-android-1
// 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);
@PanosJee
PanosJee / gist:1719818
Created February 1, 2012 22:16
oss-android-2
public static String ReadInputStream(InputStream in) throws IOException {
StringBuffer stream = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
stream.append(new String(b, 0, n));
}
return stream.toString();
}
@PanosJee
PanosJee / gist:1665864
Created January 23, 2012 22:31
BugSense Log iOS
@try {
// some exception throwing code
} @catch (NSException *exc) {
BUGSENSE_LOG(exc, @"Tag");
}
@PanosJee
PanosJee / gist:1665853
Created January 23, 2012 22:28
Set up BugSense
#import <BugSense-iOS/BugSenseCrashController.h>
// ...
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//...
NSDictionary *myStuff = [NSDictionary dictionaryWithObjectsAndKeys:@"myObject", @"myKey", nil];
[BugSenseCrashController sharedInstanceWithBugSenseAPIKey:@"<Your BugSense API Key>"
userDictionary:myStuff
sendImmediately:NO];
@PanosJee
PanosJee / gist:1383246
Created November 21, 2011 17:03
BugSense-JS-Settings
// bugsense parameters (required)
this.defaults = {
apiKey: 'YOUR_API_KEY', // modify me
url: 'http://www.bugsense.com/api/js/errors?api_key=' // NON-SSL
};
@PanosJee
PanosJee / gist:1383223
Created November 21, 2011 16:58
BugSense-jQuery
$(document).ajaxError(function(event, xhr, settings, error) {
Bugsense.notify({
request: xhr,
settings: settings,
error: error
});
});