FORUMS
Remove All Ads from XDA

[APP/FRAMEWORK] NOGAPPS Project (NetworkLocation, MapsAPI, Blank Store)

496 posts
Thanks Meter: 2,274
 
By MaR-V-iN, Senior Member on 17th June 2012, 05:43 PM
Post Reply Email Thread
7th October 2014, 01:47 AM |#901  
MaR-V-iN's Avatar
OP Senior Member
Thanks Meter: 2,274
 
Donate to Me
More
Quote:
Originally Posted by selemine

so Mar-vin has given a talk on the nogapps motivation on xda devcon, any chance that we can watch it somewhere or get the slides at least?

You can find the slides here: http://forum.xda-developers.com/andr...droid-t2897726
It's not focused on nogapps, but I guess you might be interested anyway.

Quote:
Originally Posted by JanGhent

For me UnifiedNlp seems to drain battery more, somehow by the PHONE app.

Did you try without the GSM backend running?

Quote:
Originally Posted by JanGhent

Is a log message written?
- database can't be found
- cell-ID is not in database
- lookup time

Logging is disabled by default for performance and privacy reasons. You can enable it by adding "log.tag.nlp=DEBUG" to your /system/build.prop - it should then report once the db file is checked, but not if the db file is not found
The Following 2 Users Say Thank You to MaR-V-iN For This Useful Post: [ View ] Gift MaR-V-iN Ad-Free
7th October 2014, 11:47 AM |#902  
Member
Thanks Meter: 4
 
More
@haffenloher
Thx.

Quote:
Originally Posted by MaR-V-iN

Did you try without the GSM backend running?

Yes, not enough to say if that makes a difference.

Quote:

Logging is disabled by default for performance and privacy reasons. You can enable it by adding "log.tag.nlp=DEBUG" to your /system/build.prop - it should then report once the db file is checked, but not if the db file is not found

Thx..

Still how long should a lookup in the DB normally take ( < 1sec ?)
7th October 2014, 05:44 PM |#903  
MaR-V-iN's Avatar
OP Senior Member
Thanks Meter: 2,274
 
Donate to Me
More
Quote:
Originally Posted by JanGhent

Still how long should a lookup in the DB normally take ( < 1sec ?)

Usually it should take less than a second, yes - but i never tested on slow or low-memory devices...
The Following User Says Thank You to MaR-V-iN For This Useful Post: [ View ] Gift MaR-V-iN Ad-Free
7th October 2014, 06:55 PM |#904  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by MaR-V-iN

Usually it should take less than a second, yes - but i never tested on slow or low-memory devices...

Thx, I'm gonna build a new db tonight.

Just wondering, I had UnifiedNLP working with GMSlocation-backend in a phone without SIM card.

In that light does MNC matter, or does a phone with SIM card limit itself someway?
7th October 2014, 07:12 PM |#905  
MaR-V-iN's Avatar
OP Senior Member
Thanks Meter: 2,274
 
Donate to Me
More
Quote:
Originally Posted by JanGhent

Thx, I'm gonna build a new db tonight.

Just wondering, I had UnifiedNLP working with GMSlocation-backend in a phone without SIM card.

In that light does MNC matter, or does a phone with SIM card limit itself someway?

I guess NOGAPPS NetworkLocation does work only with SIM card, but I never tested. GSM-location-backend uses some different code to obtain cell tower ids which works better for some phones, but causes high battery drain on others (or maybe the same as well) - there's still some investigation needed.
If you run your phone without SIM card, it heavily depends on the phone's radio chip, how it will continue to scan for networks - it might be locked to a single frequency or scan randomly. When using a sim card, the radio will keep on the associated frequency as long as there is a network on it (or you search for networks, which will disconnect you)
7th October 2014, 07:27 PM |#906  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by haffenloher

cells.db for the old database file format, lacells.db for the new one. NetworkLocation can work with both.
You'll probably want to generate your own database with up to date cell data using this guide (link can be found in the first post).

Have things changed.? I ended up with a DB not working, so I took a peek.

The cell_towers.csv.gz I downloaded has 14 columns : radio mcc net area cell unit lon lat range samples changeable created updated averageSignal

First column radio, a string

According to the guide the DB I have to create should have 18 columns starting with mcc integer?
So I get an `expected 18 coumns but found 14 columns - filling the rest with NULL` message on importing.
7th October 2014, 09:53 PM |#907  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by MaR-V-iN

lacells.db is the new cell database file supported since NetworkLocation v1.2.

Make sure sqlite3 is installed
Download the cell_towers.csv.gz from http://downloads.opencellid.org/ and gunzip it.
.

For me this worked:
Code:
CREATE TABLE cells_new(radio TEXT , mcc INTEGER, mnc INTEGER, lac INTEGER, cellId INTEGER,unit INTEGER, long REAL, lat REAL,range INTEGER, samples INTEGER, changeable BOOL, created INTEGER, updated INTEGER, averageSignalStrength INTEGER);
The cell_towers.csv.gz I downloaded had only 14 columns.

---------- Post added at 09:53 PM ---------- Previous post was at 09:34 PM ----------

Quote:
Originally Posted by MaR-V-iN

I guess NOGAPPS NetworkLocation does work only with SIM card, but I never tested. GSM-location-backend uses some different code to obtain cell tower ids which works better for some phones, but causes high battery drain on others (or maybe the same as well) - there's still some investigation needed.
If you run your phone without SIM card, it heavily depends on the phone's radio chip, how it will continue to scan for networks - it might be locked to a single frequency or scan randomly. When using a sim card, the radio will keep on the associated frequency as long as there is a network on it (or you search for networks, which will disconnect you)

I have 3 devices, 1 simcard. I normally test location with OSMAND and SatStat.
With SatStat I can see MCC, MNC etc. It doesn't matter if I have a SIM card inserted, all devices change CellId quite regularly in SatStat, see often the same, but somehow although the cellid is in the database, OSMAND can not find it.

Sometimes a device without SIM card finds (WIFI disabled) finds a location, but always very slow.

FYI Tested with sqlite3 a simple lookup
Code:
 SELECT * from cells WHERE cid = *
took on a 181MB world database.
Samsung Galaxy S around 9 sec: CPU Time: user 7.800782 sys 1.437500
Galaxy Note 2 around 2 sec

Made an index on cid;
Samsung Galaxy S CPU Time: user 0.003907 sys 0.000000

So don't we need an index, and on which columns? Dunno the exact query in the lib.
Tradeof +50mb db increase 181 -> 231
The Following User Says Thank You to JanGhent For This Useful Post: [ View ] Gift JanGhent Ad-Free
8th October 2014, 12:27 PM |#908  
MaR-V-iN's Avatar
OP Senior Member
Thanks Meter: 2,274
 
Donate to Me
More
Quote:
Originally Posted by JanGhent

For me this worked:

Code:
CREATE TABLE cells_new(radio TEXT , mcc INTEGER, mnc INTEGER, lac INTEGER, cellId INTEGER,unit INTEGER, long REAL, lat REAL,range INTEGER, samples INTEGER, changeable BOOL, created INTEGER, updated INTEGER, averageSignalStrength INTEGER);
The cell_towers.csv.gz I downloaded had only 14 columns.

Thanks, I updated the post accordingly. OpenCellId is changing their format quiet often right now, as they start cooperating with Mozilla: https://location.services.mozilla.com/downloads

Quote:
Originally Posted by JanGhent

FYI Tested with sqlite3 a simple lookup

Code:
 SELECT * from cells WHERE cid = *
took on a 181MB world database.
Samsung Galaxy S around 9 sec: CPU Time: user 7.800782 sys 1.437500
Galaxy Note 2 around 2 sec

Made an index on cid;
Samsung Galaxy S CPU Time: user 0.003907 sys 0.000000

So don't we need an index, and on which columns? Dunno the exact query in the lib.
Tradeof +50mb db increase 181 -> 231

We can't use index on cid only, we would need it on mcc/mnc/cid altogether - and sometimes that's not even sufficient, that's why lacells.db added lac (which was not there on cells.db). As cell tower operators do nasty things here, I can't say exactly but I guess index should be mcc/mnc/cid/lac - that's also what is used to request right now
The file format is not really final, in fact an sqlite3 database is stupid here, as the database is never changed once created. The gsm location backend for unifiednlp uses some other format, see https://github.com/rtreffer/LocalGSM...BCSReader.java
The Following User Says Thank You to MaR-V-iN For This Useful Post: [ View ] Gift MaR-V-iN Ad-Free
8th October 2014, 02:35 PM |#909  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by MaR-V-iN

Thanks, I updated the post accordingly. OpenCellId is changing their format quiet often right now, as they start cooperating with Mozilla: https://location.services.mozilla.com/downloads

That format will settle down then sometime.

Quote:

As cell tower operators do nasty things here, I

Yeah I saw some duplicate MMC/MNC/CID entries. WTF. Cell tower operators don't know what an ID is. Some cell towers though broadcast more then one ID, I believe, or maybe change ID dynamically.

BTW is there any logic in LAC?
Quote:

can't say exactly but I guess index should be mcc/mnc/cid/lac - that's also what is used to request right now

Maybe on CID is enough, for a filtered db MCC and MNC is unique, and an index on CID is boosting performance enough in my test.
At least on a query like this
Code:
SELECT * from cells WHERE mcc=204 AND mnc=1 AND lac = 1500 AND cid = *
+1000x faster: 0.6s to 0.0003s


Also limiting my cell phone to 2G boosted performane here on a no SIM card phone. Yes, Locationmanager works without SIM card.

And I feel an index on CID only boosted performance here. Got it instantly now, wifi disabled in OSMAND on a 231mb World DB.
Code:
CREATE  INDEX idx_cid ON cells (cid)
The Following 2 Users Say Thank You to JanGhent For This Useful Post: [ View ] Gift JanGhent Ad-Free
8th October 2014, 06:18 PM |#910  
MaR-V-iN's Avatar
OP Senior Member
Thanks Meter: 2,274
 
Donate to Me
More
Quote:
Originally Posted by JanGhent

Yeah I saw some duplicate MMC/MNC/CID entries. WTF. Cell tower operators don't know what an ID is. Some cell towers though broadcast more then one ID, I believe, or maybe change ID dynamically.
BTW is there any logic in LAC?

I heard that some operators intent to randomize cell ids regularly to make locating using them impossible (or maybe to be able to hide imsi catchers?), but afaik this is only plans right now. I also heard that a major operator's own cell management is so bad, that they build their database using opencellid.
LAC should normally be the same among several towers at the same location - this might be interesting for locating as well


Quote:
Originally Posted by JanGhent

Maybe on CID is enough, for a filtered db MCC and MNC is unique, and an index on CID is boosting performance enough in my test.
At least on a query like this

Code:
SELECT * from cells WHERE mcc=204 AND mnc=1 AND lac = 1500 AND cid = *
+1000x faster: 0.6s to 0.0003s
And I feel an index on CID only boosted performance here. Got it instantly now, wifi disabled in OSMAND on a 231mb World DB.
Code:
CREATE  INDEX idx_cid ON cells (cid)

Thanks for your research, I added your suggestion to the tutorial.
The Following User Says Thank You to MaR-V-iN For This Useful Post: [ View ] Gift MaR-V-iN Ad-Free
8th October 2014, 07:33 PM |#911  
Nyakov's Avatar
Member
Thanks Meter: 16
 
More
When I use UnifiedNlp and open map app the firs I see is approximate(gsm tower) location, and then after few second GPS location. With NetworkLocation I don't see in map app approximate(gsm tower) location. Is it ok?

Can someone confirm?
Post Reply Subscribe to Thread

Tags
you are limited to 8 thanks per day

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes