52North/geoar-app

SQL datasource integration

JGeraldoLima opened this issue · 9 comments

I had been studying the geoar-app/ds project all day to integrate my datasource, but I still not found how to do this because all of yours uses, in some way, make a network connection to download data. My datasource is local and does not need any servidor or connection, just the android SQL queries! Can you help me with this? I just need to show simple markers on camera using the GeoAr AR function. Is there anyway to set manually the markers(I mean, create an object in a specific class to show it), just for testing? And then, we would be able to show the others from our datasource!

Please take a look at the wiki page for GeoAR datasources: https://wiki.52north.org/bin/view/Projects/GeoARDatasource

Just implement the DataSource interface and provide your POIs using the getMeasurements(F filter) method. Within this method you can query the internal database.

I have been trying this, but where should I instantiate my datasource class or where can I call this method and insert the data to ARFunction?

One of my tries was create a new package in geoar-app project, copy classes from geoar-ds-wiki to standardize and see what happens. The Filter class just need to store a String for my needs, so I adapted it. And of course, I adapted the other classes in newdata to load my DS. Nothing happened and I put an logcat message in DataCache to see if the flow passed there, but it didn't.

Here is the prints:
arvore_projeto

trecho

I advise against creating new classes in the geoar-app project but to develop it as a seperate project. I can understand your shortcut for testing, but there is a sophisticated plugin mechanism and on the datasources wiki page is an explanation on how to integrate a datasource. If you don't use the plugin mechanism, then the app does not know about any datasources. The problem with changing the code only at that location probably is that it will never be called by the app because you don't register a datasource. The code you changed is the generic update implementation, but without the app knowing about the datasource these methods will never be called.

If you add log statements it would be helpful if you also post the relevant content of your log file.
Do you mean that the statement "Requesting data from data source" does not appear?

Can you add a log statement to the constructor public DataCache(DataSourceInstanceHolder dataSource, byte tileZoom, ThreadPoolExecutor fetchingThreadPool) { and check if the data source is correctly inserted there at all?

If you want to hard-wire the datasource, please check where the above mentioned constructor is called and try to insert your own datasource from there.

Have you tried to import the wikipedia datasource as a project into Eclipse and deploying that to your device?

Oh, I did not realize it! I tried exactly this, load my datasource without use the plugin mechanism! Yeah, I realized that, because my log statement (introduced in DataCache.class) didn't appear on logcat.

No no, firstly I put an log with an message just to see if the flow passed there. So, it didn't.

Sure! Maybe I put the log in the wrong local (inside "private final Runnable fetchRunnable = new Runnable() { @OverRide public void run() {", just after "List<? extends SpatialEntity2<? extends Geometry>> data = dataSourceInstance.getDataSource().getMeasurements(filter);"). I changed this code lines with my datasource instantiation, and then "data" might store it!

When I read this code I couldn't find where the datasource is stored or passed to other entity. That's why I inserted in run().I will try now insert in the right local, and see what happens!

No, if the solution above mentioned don't work, I will try that too.

I didn't find where or how to hard-wire the datasource, so I started to try your last solution. There is a problem with plugins and encoding (AGAIN), so I still couldn't import it. I will continue on Monday morning. Here is the output: http://pastebin.com/mHu0Ksch.

If I do not get at all, I will try the plugin mechanism. To advance, will I need any server/client? Because this is a problem for us :/

Encoding issue is fixed with 52North/geoar-datasources@4f340f3

Am 18.03.2014 21:06, schrieb JGeraldoLima:

I tried to deploy the wiki-datasource on my device and it was
successfully, but it didn't appear on GeoAR's DataSources manager. I was
wondering if there is some way to deploy directly on app's installation
path. When the application downloads a database, it saves on some system
directory? Because if yes, we could deploy directly there.

What about
https://wiki.52north.org/bin/view/Projects/GeoARDatasource#Development_Push_Plugin_to_Devic

  • does that help? Have you tried that?

It would be really helpful if you describe more what you actually do,
"tried to deploy" is not very informative.

Thanks!

/Daniel

Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: d.nuest@52north.org
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

HELL YEAH BABY! I got it, my friend! There is the proof(I am really bad in photo editing 👎 ):
8067_584264495003598_1002220360_n

I created the "TESTE" point, and there it is! Just one command line! Thank you for all, really. I will put you on the news ;D

Good!