Code Monkey home page Code Monkey logo

demostumbler's Introduction

Build Status

DemoStumbler

Embed the Mozilla Stumbler as a library in your Android Application

The Mozilla Stumbler is an Android wifi and cell tower stumbling application which is designed to collect location data and submit it to our location service Ichnaea.

The standard Android application runs in what we call 'active' mode where we aggressively scan for Wi-fi routers, cell tower data and GPS supplied latitude and longitude.

We have a second mode though - for passive stumbling. We use a version of this code in Firefox for Android to do extremely low power stumbling.

Now you can use it too!

Full documentation can be found on the primary Mozilla Stumbler wiki

But I'm impatient. Just show me the code.

You'll need to import some classes:

import org.mozilla.mozstumbler.service.core.http.IHttpUtil;
import org.mozilla.mozstumbler.service.mainthread.PassiveServiceReceiver;
import org.mozilla.mozstumbler.svclocator.ServiceConfig;
import org.mozilla.mozstumbler.svclocator.ServiceLocator;
import org.mozilla.mozstumbler.svclocator.services.ISystemClock;
import org.mozilla.mozstumbler.svclocator.services.log.ILogger;

Next, you'll need to configure the ServiceLocator and then start the service with an Intent.

// Setup ServiceConfig and ServiceLocator
ServiceConfig svcConfig = new ServiceConfig();
svcConfig.put(IHttpUtil.class,
        ServiceConfig.load("org.mozilla.mozstumbler.service.core.http.HttpUtil"));
svcConfig.put(ISystemClock.class,
        ServiceConfig.load("org.mozilla.mozstumbler.svclocator.services.SystemClock"));
svcConfig.put(ILocationService.class,
        ServiceConfig.load("org.mozilla.mozstumbler.service.core.http.MLS"));
svcConfig.put(ILogger.class,
        ServiceConfig.load("org.mozilla.mozstumbler.svclocator.services.log.ProductionLogger"));

ServiceLocator.newRoot(svcConfig);

Intent i = PassiveServiceReceiver.createStartIntent(this, "a_moz_api_key",
        "Just Another User-Agent");
startService(i);

Build and install the code

Enable Developer Options if you haven't done so already

  1. Open Settings> About> Software Information> More.
  2. Then tap “Build number” seven times to enable Developer options. ...
  3. Go back to Settings menu and now you'll be able to see “Developer options” there.
  4. Tap it and turn on USB Debugging from the menu on the next screen.

Connect your Android device over USB, build and install.

From command line on UNIX:

./gradlew installDebug

You can alternately just open Android Studio and use the IDE to build and install the application.

demostumbler's People

Contributors

crankycoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

demostumbler's Issues

Wiki changes

FYI: The following changes were made to this repository's wiki:

  • defacing spam has been removed

  • the wiki has been disabled, as it was not used

These were made as the result of a recent automated defacement of publically writeable wikis.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.