2

I have been trying to use BugSense via a 15 day trial account, but for some reason I do not receive the logs online even after an application crash.

I have trying things with minimal code changes, without any success. Here are the steps I have followed:

(1) Copy "bugsense-3.5.jar" to the libs folder of my Android project

(2) Added following lines of codes:
(a) In FDActivity.java (MainActivity):

import com.bugsense.trace.BugSenseHandler;

public class FdActivity extends Activity  {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BugSenseHandler.initAndStartSession(this, "45df5376");
        setContentView(R.layout.face_detect_surface_view);
    }

    @Override
    public void onResume()
    {
        BugSenseHandler.startSession(this);
        super.onResume();
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
        BugSenseHandler.addCrashExtraData("level", "second level");    // Just to ensure something is added to the logs
    }

    @Override
    public void onPause()
    {
        BugSenseHandler.closeSession(FdActivity.this);
        super.onPause();
        if (mOpenCvCameraView != null)
            mOpenCvCameraView.disableView();
    }
}

(b) In AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

(3) I crash the application by the following technique:

adb shell
su
ps <get the id for my activity>
kill <pid>

I still do not receive any error logs on the BugSense dashboard. Is there anything wrong with my methodology? Are any additional things required to get this thing working?

Kindly note that I have already ensured the following:
(1) My BugSense ID is correct
(2) I am connected to the internet

Vishal
  • 3,178
  • 2
  • 34
  • 47
  • 1
    Try to create exception in your code and don't use try catch. Let's see – Manish Dubey Sep 18 '13 at 05:35
  • How about my approach? If I kill the process randomly, was it expected to report an error log on BugSense? – Vishal Sep 18 '13 at 05:37
  • Btw, I discovered that `kill ` doesn't result into any errors being reported by BugSense. I artificially created a divide by zero error, and then receive the error report on BugSense dashboard successfully. – Vishal Sep 19 '13 at 18:39

1 Answers1

0

I realised that the problem in my case was that kill <task-id> doesn't really create an exception, it simply terminates the program.

When I created an aritifical divide by zero error, I received the error logs on BugSense dashboard.

Vishal
  • 3,178
  • 2
  • 34
  • 47