Question

Is there any way that I can develop an app for Firefox OS that uses a certified API and install it on my own phone?

Our specific need is for telephony data such as signal strength. We can do this on Android without any difficulty (indeed, we could put the app on Google Play if we wanted to). But we just need to install it on a small number of in-house phones.

It seems that Firefox OS considers it to be in some way a security risk to find out the signal strength of the cell tower, and similar telephony data. Am I correct in assuming that there is no way that Firefox OS will let a developer app read this data?

Was it helpful?

Solution 2

You should be able to install your certified app on a real Firefox OS phone after performing these steps from MDN:

  1. On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:

    adb shell
    

    Your prompt should change to root@android.

  2. Next, stop B2G running using the following command:

    stop b2g
    
  3. Navigate to the following directory:

    cd /data/b2g/mozilla/*.default/
    
  4. Here, update the prefs.js file with the following line:

    echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
    
  5. After you've finished editing and saving the file, start B2G again using the following command:

    start b2g
    
  6. Exit the android filesystem using the exit command; this will return you to your normal terminal prompt.

OTHER TIPS

If you are using Firefox OS 1.2 > you should be able to push a certified app to a unlocked phone for testing purposes. I put in code like:

    testconn.onclick = function () {

        var cnx = navigator.mozMobileConnection;

        if (cnx.voice.connected) {
            console.log("The signal has a strength of " + (+cnx.voice.relSignalStrength) + "%");
        } else {
            console.log("The state of the connection is: " + cnx.voice.state);
        }


    };

and entered the following permission in the manifest:

  "permissions": {
    "mobileconnection":{}
  },
  "type": "certified"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top