Android Client

11 views
Skip to first unread message

Felix Nensa

unread,
Apr 14, 2010, 8:23:52 AM4/14/10
to geo...@googlegroups.com
Hi all,

I finally had some time to assemble an ugly but more or less
functional android app that collects Wifi Hotspots on the go, stores
them to a local database and lets you batch post them to geomena.org.
You can find the (eclipse) project here: http://github.com/luckfamousa/GeoPipe

Short description:

The App basically consists of a List that shows the SSIDs of all APs
in the local database and gets updated while new APs are found.
You have 4 menu buttons:

1. A toggle button that deactivates/activates scanning. The App
starts in scanning mode.
2. A "clear" button that removes all records from the local database.
3. A "post&clear" button that posts all records from the local
database to geomena and afterwards removes them from the local
database.
4. An "exit" button because you might be interested to stop this
battery drainer from running :-)

Next steps:

- Fix Bugs.
- Give more userfeedback. Especially on errors.
- Nicer GUI
- Make the List look like Andre's (http://geomena.org/clients)
- Make List items clickable and show AP details onClick


From today until next monday I will be in Naples, Italy.
Sorry in advance for any delayed responses.

Best from Cologne, Germany

Felix

For reference I repost my original email to Don here (he asked me to do that):
On Thu, Apr 1, 2010 at 7:27 AM, Felix Nensa <felix...@gmail.com> wrote:
> Hi Don,
>
> a tweet by @timoreilly drew my attention to your geomena project which I
> think is a nice one.
> So I just started a very simple Android project that collects wifi hotspots
> while you're on the move an posts them to your writeable api.
> I am writing this email because I have some slight issues here:
>
> 1. I hope you don't mind getting lots of german hotspots now :)
>
> 2. There seems to be al little typo in your API doc. The parameter "ssid"
> you specify here http://bitbucket.org/donpdonp/geomena/wiki/APIReference
> seems not to work. I tried "essid" instead.
>
> 3. Could you provide a view of the latest N added documents? A simple table
> would be fine. That would make debugging much easier. Should be a fairly
> simple task in couch.
>
> 4. How do you deal with multiple POSTs of the same hotspot? I guess you
> store them all and use them to calculate a probably more accurate position
> of that hotspot, right? If so, did you consider to optionally store the
> signal strength, too? It could help to make the results even more precise.
>
> Best from cologne and have nice easter days,
>
> Felix

Andre Navarro

unread,
Apr 14, 2010, 1:09:15 PM4/14/10
to geo...@googlegroups.com
Sweeet, mobile is the way to go for this. It'd be cool if it were a
background app on both the android and iPhone where it just kept
posting to geomena

Is there a batch upload a list of APs? So that for each scan you just
do one POST

--
Andre Navarro

> --
> To unsubscribe, reply using "remove me" as the subject.

Don Park

unread,
Apr 17, 2010, 4:15:12 PM4/17/10
to geo...@googlegroups.com
Hi Felix,
Thanks for the android contribution! I have added a link to the
project and to your twitter page on the geomena.org clients page.

Don

AdamD

unread,
Apr 18, 2010, 5:28:45 PM4/18/10
to Geomena
To Andre's question, we've talked some about a bulk upload. You can
see an early sketch of how that API endpoint might look here:
http://bitbucket.org/donpdonp/geomena/wiki/APIProposal

Feedback appreciated!


On Apr 17, 1:15 pm, Don Park <don.p...@gmail.com> wrote:
> Hi Felix,
>   Thanks for the android contribution! I have added a link to the
> project and to your twitter page on the geomena.org clients page.
>
> Don
>
> > On Thu, Apr 1, 2010 at 7:27 AM, Felix Nensa <felix.ne...@gmail.com> wrote:
> >> Hi Don,
>
> >> a tweet by @timoreilly drew my attention to your geomena project which I
> >> think is a nice one.
> >> So I just started a very simple Android project that collects wifi hotspots
> >> while you're on the move an posts them to your writeable api.
> >> I am writing this email because I have some slight issues here:
>
> >> 1. I hope you don't mind getting lots of german hotspots now :)
>
> >> 2. There seems to be al little typo in your API doc. The parameter "ssid"
> >> you specify herehttp://bitbucket.org/donpdonp/geomena/wiki/APIReference

Andre Navarro

unread,
Apr 18, 2010, 5:40:12 PM4/18/10
to geo...@googlegroups.com
I can't think of any issues with the proposal. That would work
perfectly for me. I'm updating the iPhone code to do that right now.

Would there be any use in storing the signal strength at geomena for
each AP also?

Andre
--
Andre Navarro

Andre Navarro

unread,
Apr 18, 2010, 5:55:44 PM4/18/10
to geo...@googlegroups.com
Question, what format will the mac address need to be in?

The proposal says mac: "XX:XX:XX:XX:XX:XX" which is different from the
individual post URL: /ap/<mac-address>

Andre

On Sun, Apr 18, 2010 at 4:28 PM, AdamD <duva...@gmail.com> wrote:
--
Andre Navarro

AdamD

unread,
Apr 19, 2010, 7:05:45 PM4/19/10
to Geomena
I think Geomena should accept both colon-formatted mac addresses, as
well as the 12 character version.

Jorge Silva

unread,
Apr 19, 2010, 7:37:11 PM4/19/10
to geo...@googlegroups.com

I'd say yes. We use it in tagin! to enhance accuracy.

On 2010-04-18 5:40 PM, "Andre Navarro" <andre....@gmail.com> wrote:

I can't think of any issues with the proposal. That would work
perfectly for me. I'm updating the iPhone code to do that right now.

Would there be any use in storing the signal strength at geomena for
each AP also?

Andre


On Sun, Apr 18, 2010 at 4:28 PM, AdamD <duva...@gmail.com> wrote:

> To Andre's question, we've tal...

--
Andre Navarro

AdamD

unread,
Apr 19, 2010, 7:56:48 PM4/19/10
to Geomena
Agreed! Geomena should allow as much data as possible to come through.
I think it might even support signal strength (undocumented) now. Don?



On Apr 19, 4:37 pm, Jorge Silva <jorge.si...@utoronto.ca> wrote:
> I'd say yes. We use it in tagin! to enhance accuracy.
>
> On 2010-04-18 5:40 PM, "Andre Navarro" <andre.nava...@gmail.com> wrote:
>
> I can't think of any issues with the proposal. That would work
> perfectly for me. I'm updating the iPhone code to do that right now.
>
> Would there be any use in storing the signal strength at geomena for
> each AP also?
>
> Andre
>
> On Sun, Apr 18, 2010 at 4:28 PM, AdamD <duvan...@gmail.com> wrote:
> > To Andre's question, we've tal...
>
> --
> Andre Navarro
>
> --
> Subscription settings:http://groups.google.com/group/geomena/subscribe?hl=en

Don Park

unread,
Apr 19, 2010, 9:20:20 PM4/19/10
to geo...@googlegroups.com
I agree. in fact I was about to call it "User Annotations" ala the new
twitter feature.

Basically any attribute given will be stored, minus some reversed key
names like id, _rev (used by couchdb), user (future username), and
created_at but anything else is fair game. it should probably have a
maximum payload size of a few kbytes.

in addition to the reserved key values, there are other key values
that geomena will interpret itself.
such as 'latitude', 'longitude', 'essid'

i updated the wiki page on Saturday to try and document this. Note the
user annotations isnt in effect yet but it will be soon.

don

Aaron Parecki

unread,
Apr 19, 2010, 9:22:53 PM4/19/10
to geo...@googlegroups.com
Sounds like a reasonable use of a schema-free database! I'm still new to this concept, learned relational databases a long time ago so I'm slowly warming up to the idea of CouchDB.

aaronpk

Don Park

unread,
Apr 19, 2010, 9:26:57 PM4/19/10
to geo...@googlegroups.com
Here are is the method to add an AP record
and what fields it listens to. the presence of an id field
changes the action from creating a record to updating a record.
though thats going away to support multiple records per AP (more details soon) .

post '/ap/:mac' do |mac|
payload = {:mac => mac_clean(mac),
:essid => params[:essid],
:latitude => params[:latitude],
:longitude => params[:longitude],
:essid => params[:essid]}
if params[:id]
payload.merge!({:_rev => params[:rev]})
GCouch.put(params[:id], payload.to_json)
else
payload.merge!({:created_at => Time.now.utc.iso8601})
GCouch.post(payload.to_json)
end
redirect "/ap/#{params[:mac]}"
end


here is what happens to the mac address.
def mac_clean(mac)
# take off leading and trailing space
mac = mac.strip
# fill in "0"s if needed
mac = mac.split(':').map {|m| if m.length == 1; "0"+m; else m; end }.join
# remove the ":" or "-" seperators
mac = mac.gsub(':','').gsub('-','')
# lowercase
mac = mac.downcase
end

it takes off : and - characters.
don

Don Park

unread,
Apr 19, 2010, 9:28:12 PM4/19/10
to geo...@googlegroups.com
map/reduce is a wild ride. there is a lot one cannot do easily.
for instance, the map function takes any attribute of the record and
makes it the key. you can do a match on a single key or range of keys.
the result set is sorted by the key value. meaning the order must be based
on the key. you cant search on attribute A and sort on attribute B. weird huh.

don

Felix Nensa

unread,
Apr 22, 2010, 1:57:02 PM4/22/10
to geo...@googlegroups.com
Hi,

finally back from Naples which took longer than expected because we've
had a slight issue with a volcano here in europe as you might have
noticed :-)
At least there should be some nice italian APs in the database now
...like this one http://geomena.org/ap/000d549cefea.

> Is there a batch upload a list of APs? So that for each scan you just do one POST

I am currently doing in fact one POST per AP and just incrementing a
progress bar after each.

> I have added a link to the project and to your twitter page on the geomena.org clients page

Thanks, Don. I have attached some screenshots just to get an
impression.. though the UI is still very rough.

Felix
--
Felix Nensa
CTO

zeec GmbH
Neusser Str. 28
50670 Cologne
Germany

mail: felix...@zeec.biz
phone: +49 221 936 79 660
fax: +49 221 936 79 669
mobile: +49 171 958 51 40
web: www.zeec.biz
device-1.png
device-2.png
device-3.png
device-4.png

Don Park

unread,
Apr 22, 2010, 2:16:41 PM4/22/10
to geo...@googlegroups.com
Thanks for the update and the screenshots. I've added them to the
clients page. I'm glad Android development carries on in spite of the
ash.

Don
Reply all
Reply to author
Forward
0 new messages