Example #1
0
def open_view():
    global settings
    layout = open(os.path.join(common.path, 'layouts', 'settings.xml'),
                  'r').read()
    droid.fullShow(layout)

    prefs = droid.prefGetValue('settings', 'clairvoyance').result
    if prefs is not None:
        settings = json.loads(prefs)
    else:
        settings = common.default_settings
    save_settings(
    )  # Updates the UI, and places the defaults in the keystore if nothing was loaded
    droid.clearOptionsMenu()
    droid.addOptionsMenuItem("Close Application", "EXIT_APP", None,
                             "ic_menu_close_clear_cancel")
    info = droid.wifiGetConnectionInfo().result
    if 'ssid' in info.keys():
        droid.fullSetProperty(
            "currentNetworkSSID", "text", "Current WiFi Network SSID: " +
            droid.wifiGetConnectionInfo().result['ssid'])
    else:
        droid.fullSetProperty(
            "currentNetworkSSID", "text",
            "Current WiFi Network SSID: NOT CONNECTED or CARD DISABLED")
Example #2
0
def open_view():
    layout = open(os.path.join(common.path, 'layouts', 'collectData.xml'),
                  'r').read()
    droid.fullShow(layout)

    #set the text fields
    prefs = droid.prefGetValue('settings', 'clairvoyance').result
    if prefs is not None:
        settings = json.loads(
            droid.prefGetValue('settings', 'clairvoyance').result)
    else:
        settings = common.default_settings

    droid.fullSetProperty(
        "scanInterval", "text",
        "Scan interval: " + str(settings['scan_interval']) + " seconds")
    droid.fullSetProperty(
        "minimumBattery", "text",
        "Minimum battery cutoff: " + str(settings['minimum_battery']) + "%")
    droid.fullSetProperty("bufferSize", "text",
                          "Buffer limit: " + str(settings['buffer_size']))
    currentAP = droid.wifiGetConnectionInfo().result
    print currentAP['network_id']
    if currentAP['network_id'] != -1:
        droid.fullSetProperty("currentNetworkSSID", "text",
                              "Current WiFi Network SSID:" + currentAP['ssid'])
    else:
        droid.fullSetProperty("currentNetworkSSID", "text",
                              "Current WiFi Network SSID:" + " NOT CONNECTED")

    droid.clearOptionsMenu()
    droid.addOptionsMenuItem("Close Application", "EXIT_APP", None,
                             "ic_menu_close_clear_cancel")

    #start the gps with the interval that the user has specified in his or her frequency setting
    has_gps_lock = common.gps_lock(
        mSecondsToWaitOnLock=settings['scan_interval'] * 1000,
        minUpdateDistance=1)
    #start battery monitoring
    droid.batteryStartMonitoring()
    if has_gps_lock:
        droid.fullSetProperty("status", "text", "GPS LOCK ACQUIRED")
    else:
        droid.fullSetProperty("status", "text", "NO GPS LOCK")

    handle_event.bufferCounter = 0
    handle_event.totalPointsCollected = 0
    handle_event.location = []
    handle_event.JSON_sends = 0
    handle_event.odd = False
Example #3
0
def open_view():
  
    layout = open(os.path.join(common.path, 'layouts', 'startScreen.xml'), 'r').read()
    droid.fullShow(layout)
    droid.fullSetProperty("collectIcon", "src", 'file:///' + os.path.join(common.path, 'layouts', 'icons', 'collectIcon.png'))
    droid.fullSetProperty("settingsIcon", "src", 'file:///' + os.path.join(common.path, 'layouts', 'icons', 'settingsIcon.png'))
    droid.fullSetProperty("mapIcon", "src", 'file:///' + os.path.join(common.path,  'layouts', 'icons', 'mapIcon.png'))
    droid.fullSetProperty("aboutIcon", "src", 'file:///' + os.path.join(common.path, 'layouts', 'icons',  'aboutIcon.png'))
    
    prefs = droid.prefGetValue('settings', 'clairvoyance').result
    if prefs is not None:
        settings = json.loads(prefs)
    droid.clearOptionsMenu()
    droid.addOptionsMenuItem("Close Application","EXIT_APP",None,"ic_menu_close_clear_cancel")
Example #4
0
def open_view():
    #load the layout
    
    #create the menu button buttons
    droid.clearOptionsMenu()  
    droid.addOptionsMenuItem("Low Signal Strength","GET_LOW",None,"star_on")
    droid.addOptionsMenuItem("Medium Signal Strength","GET_MED",None,"star_on")
    droid.addOptionsMenuItem("High Signal Strength","GET_HIGH",None,"star_on")
    droid.addOptionsMenuItem("Close Application","EXIT_APP",None,"star_on")
    
    droid.webViewShow(os.path.join(common.path, 'layouts', 'map.html')) 
Example #5
0
def open_view():
    global settings
    layout = open(os.path.join(common.path, "layouts", "settings.xml"), "r").read()
    droid.fullShow(layout)

    prefs = droid.prefGetValue("settings", "clairvoyance").result
    if prefs is not None:
        settings = json.loads(prefs)
    else:
        settings = common.default_settings
    save_settings()  # Updates the UI, and places the defaults in the keystore if nothing was loaded
    droid.clearOptionsMenu()
    droid.addOptionsMenuItem("Close Application", "EXIT_APP", None, "ic_menu_close_clear_cancel")
    info = droid.wifiGetConnectionInfo().result
    if "ssid" in info.keys():
        droid.fullSetProperty(
            "currentNetworkSSID", "text", "Current WiFi Network SSID: " + droid.wifiGetConnectionInfo().result["ssid"]
        )
    else:
        droid.fullSetProperty("currentNetworkSSID", "text", "Current WiFi Network SSID: NOT CONNECTED or CARD DISABLED")
Example #6
0
def open_view():
    
    layout = open(os.path.join(common.path, 'layouts', 'about.xml'), 'r').read()
    droid.fullShow(layout)

    #set the text fields
    droid.fullSetProperty("Title", "text", "Help/About")
    droid.fullSetProperty("DevsTitle", "text", "Developers")
    droid.fullSetProperty("devNames", "text", "Robert Deaton - [email protected]\nGraeme Lawes - [email protected]\nEric McGinnis - [email protected]")
    droid.fullSetProperty("infoTitle", "text", "Purpose")
    droid.fullSetProperty("info", "text", "The purpose of this application is to help the University of Delaware's network administrations " +
                                           "easily develop coverage maps of the UD's wireless infrastructure.  The application will provide " +
                                           "data relating to the signal strength and throughput of the network at corresponding GPS locations " +
                                           "This data will be used to construct a heatmap that will allow administrators to see which areas " +
                                           "suffer from poor signal strength and/or network congestion.")
    
    droid.fullSetProperty("ackTitle", "text", "Acknowledgements")
    droid.fullSetProperty("ackInfo", "text", "The free image icons for this project were obtained from http://www.iconspedia.com/search/android/.")
    droid.clearOptionsMenu()  
    droid.addOptionsMenuItem("Close Application","EXIT_APP",None,"ic_menu_close_clear_cancel")
Example #7
0
def open_view():
    layout = open(os.path.join(common.path, 'layouts', 'collectData.xml'), 'r').read()
    droid.fullShow(layout)

    #set the text fields
    prefs = droid.prefGetValue('settings', 'clairvoyance').result
    if prefs is not None:
        settings = json.loads(droid.prefGetValue('settings','clairvoyance').result)
    else:
        settings = common.default_settings
    
    droid.fullSetProperty("scanInterval", "text", "Scan interval: " + str(settings['scan_interval']) + " seconds")
    droid.fullSetProperty("minimumBattery", "text", "Minimum battery cutoff: " + str(settings['minimum_battery']) + "%")
    droid.fullSetProperty("bufferSize", "text", "Buffer limit: " + str(settings['buffer_size']))
    currentAP = droid.wifiGetConnectionInfo().result
    print currentAP['network_id']
    if currentAP['network_id'] != -1:
        droid.fullSetProperty("currentNetworkSSID", "text", "Current WiFi Network SSID:" + currentAP['ssid'])
    else:
        droid.fullSetProperty("currentNetworkSSID", "text", "Current WiFi Network SSID:" + " NOT CONNECTED")
    
    
    droid.clearOptionsMenu()  
    droid.addOptionsMenuItem("Close Application","EXIT_APP",None,"ic_menu_close_clear_cancel")

    #start the gps with the interval that the user has specified in his or her frequency setting
    has_gps_lock = common.gps_lock(mSecondsToWaitOnLock = settings['scan_interval'] * 1000, minUpdateDistance = 1)
    #start battery monitoring
    droid.batteryStartMonitoring()
    if has_gps_lock:
        droid.fullSetProperty("status", "text", "GPS LOCK ACQUIRED")
    else:
        droid.fullSetProperty("status", "text", "NO GPS LOCK")

    handle_event.bufferCounter = 0
    handle_event.totalPointsCollected = 0
    handle_event.location = []
    handle_event.JSON_sends = 0
    handle_event.odd = False