Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:15:34+00:00 2026-05-26T22:15:34+00:00

I am using the funf framework in order to get access to the SMS’s

  • 0

I am using the funf framework in order to get access to the SMS’s on the users’ phone.

The framework consists of several packages. The provided probes all extend the abstract class Probe.

In order to utilize the framework i have wrote the following class:

package com.senseapp.dieselboris;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;


public class SenseAppV1Activity extends Activity {
    private long p;
    private String message;
    private boolean r; 

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        SMSmessage sp = new SMSmessage();
        r = sp.isRunning();
        sp.enable();
        p = sp.getDefaultPeriod();

        message = Boolean.toString(r);

        TextView tv = new TextView(this);
        tv.setText(message);
        setContentView(tv);

    }
}

Because the methods of the the class SMSProbe are declared protected i wrote the SMSmessage class:

package com.senseapp.dieselboris;

import edu.mit.media.funf.probe.*;
import edu.mit.media.funf.probe.builtin.*;
import edu.mit.media.funf.probe.builtin.ProbeKeys.AndroidInternal.Sms;

public class SMSmessage extends SMSProbe {

    protected String getDataName () {
        return super.getDataName();

    }

    protected long getDefaultPeriod () {
        return super.getDefaultPeriod();
    } 

    protected String getDateColumnName () {
        return super.getDateColumnName();
    }


}

but when i run this code it fails when it should turn on the probe, see this error:

<small>
 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.senseapp.dieselboris/com.senseapp.dieselboris.SenseAppV1Activity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
     at android.app.ActivityThread.access$2300(ActivityThread.java:135)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:144)
     at android.app.ActivityThread.main(ActivityThread.java:4937)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:521)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
     at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.NullPointerException
     at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:271)
     at edu.mit.media.funf.probe.Probe.sendProbeStatus(Probe.java:280)
     at edu.mit.media.funf.probe.Probe.sendProbeStatus(Probe.java:227)
     at edu.mit.media.funf.probe.Probe.enable(Probe.java:612)
     at com.senseapp.dieselboris.SenseAppV1Activity.onCreate(SenseAppV1Activity.java:20)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)


</small>

the method enable() in the abstract class Probe:

public final void enable() {
        if (!enabled) {
            Log.i(TAG, "Enabling probe: " + getClass().getName());
            enabled = true;
            running = false;
            sendProbeStatus();
            onEnable();
        }
    }

What do i do wrong? since my class SMSmessage eventually inherits from Probe this is valid I thought.

I hope one of the developers of Funf reads this.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:15:34+00:00Added an answer on May 26, 2026 at 10:15 pm

    In Funf, probes are Services. This means they cannot be directly instantiated, but instead have to be created by the system using intents. Here is an example of how to request data from a Probe service using intents. (The example below is for v0.3.x and above.)

    Probes use asynchronous methods for sending status and data, so you will need a Service or BroadcastReceiver to receive probe information.

    First create your callback intent using either a Service:

    Intent callbackIntent = new Intent(this, ExampleProbeDataService.class); 
    callbackIntent.setAction("CUSTOM_DATA_ACTION");
    PendingIntent callback = PendingIntent.getService(getContext(), 0, callbackIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    

    or using a Broadcast:

    Intent callbackIntent = new Intent("CUSTOM_BROADCAST_ACTION"); 
    // Restrict broadcast to only my package to prevent broadcasting private user data
    callbackIntent.setPackage(getContext().getPackageName()); 
    PendingIntent callback = PendingIntent.getBroadcast(getContext(), 0, callbackIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    

    Then make your data request to the probe:

    Bundle params = new Bundle();
    params.putLong(Parameter.Builtin.PERIOD.name, 10L); // Run every 10 seconds
    
    Intent probeIntent = new Intent(getContext(), probeClass);
    probeIntent.setAction(Probe.ACTION_REQUEST);
    probeIntent.putExtra(Probe.CALLBACK_KEY, callback);
    probeIntent.putExtra(Probe.REQUESTS_KEY, params);
    getContext().startService(probeIntent);
    

    The probe will periodically send data and status messages based on the parameters you provide.

    While requesting data from probes directly is required in some cases, it is not the recommended approach for most cases. For testing, I recommend using the ProbeTestCase class. It takes care of the details of requesting data and handling the responses. For an app, the easiest approach is to extend ConfiguredPipeline, and override onDataReceived(Bundle data) to customize the handling of data that is received.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the HTML5 File API I can get the Binary String representation of a
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
using file_get_contents , I open an Internet URL and get the contents of this
Using the current request I can get the URL hostname with: HttpContext.Current.Request.Url.Host But -
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using PHP and MySQL, I want to query a table of postings my users
Using Java Reflection, is it possible to get the name of a local variable?
Using JSTL's forEach tag, is it possible to iterate in reverse order?
Using the PHP sdk I'm signing users into my site with Facebook log in.
Using online interfaces to a version control system is a nice way to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.