treeview replacement

14 views
Skip to first unread message

andrea antonello

unread,
Apr 27, 2014, 4:03:37 AM4/27/14
to geopapara...@googlegroups.com
Hi Mark,
in the nf_gps_service branch I made a quite impacting change.

I spent a whole day to understand what was not working in the TreeView
not loading the added maps, keeping things in cache.
Those classes were dragged in from the treeview project and were
lacking of documentation, even after I spent a day in formatting them.
I got quite fed up with that part which seems to make things quite
complex and not understandable.

So I removed the treeview and substituted it with an expandable view
made of two easy to understand classes. The folder levels at that
point can be just 2, but that is quite ok, I hate to see map names get
out of the screen anyways.

In the process I found an important issue. I see you were keeping
reference to teh MapView in the MapDirManager, which works as a
singleton. This should never be done, since the MapView itself keeps
references to the Context and we end up leaking stuff.

I changed the loadSelectedMap method to be called only from the MapsActivity.

I pushed everything up. I would ask you if you are ok with the
possibly new treeview. It can be enhanced, but at least it will be
simple.

Cheers,
Andrea

Mark Johnson

unread,
Apr 27, 2014, 4:25:59 AM4/27/14
to geopapara...@googlegroups.com


On Sunday, 27 April 2014 10:03:37 UTC+2, andrea antonello wrote:
Hi Mark,
in the nf_gps_service branch I made a quite impacting change.

I spent a whole day to understand what was not working in the TreeView
not loading the added maps, keeping things in cache.
Those classes were dragged in from the treeview project and were
lacking of documentation, even after I spent a day in formatting them.
I got quite fed up with that part which seems to make things quite
complex and not understandable.
I never really liked this class because it was hard to understand,
but I did the job of finding something quickly as apposed to 'hidding things' you know your were not looking for.
The long list, such as still exist for the geometries, is just to hard to find anything

So I removed the treeview and substituted it with an expandable view
made of two easy to understand classes. The folder levels at that
point can be just 2, but that is quite ok, I hate to see map names get
out of the screen anyways.
2 levels may cause problems when wanting to list the geometries, since the geometries should be listed as
directory
 database
  view
   geometry1
    ...x
   geometry
  table
   geometry1
    ...x
   geometry

to make if easier to find it, which does not work well now with the list.

I will try to download/compile this before I leave later and look at in the afternoon.

Have you tried this with the new Database Drivers?

Mark

Mark Johnson

unread,
Apr 27, 2014, 4:45:17 AM4/27/14
to geopapara...@googlegroups.com
Just tried this and
- sorry it did not work at all
-- 'ERROR: No supported database version/type found'

and nothing shows.

Mark

andrea antonello

unread,
Apr 27, 2014, 4:50:04 AM4/27/14
to geopapara...@googlegroups.com
Hi Mark,

[...]
>> I spent a whole day to understand what was not working in the TreeView
>> not loading the added maps, keeping things in cache.
>> Those classes were dragged in from the treeview project and were
>> lacking of documentation, even after I spent a day in formatting them.
>> I got quite fed up with that part which seems to make things quite
>> complex and not understandable.
>
> I never really liked this class because it was hard to understand,

yes, I remember us talking about it. I hoped I would get it in my
hands better, but it quite some overkill.

> but I did the job of finding something quickly as apposed to 'hidding
> things' you know your were not looking for.
> The long list, such as still exist for the geometries, is just to hard to
> find anything

Yep, I know. And we will be able to apply this one there also.

>> So I removed the treeview and substituted it with an expandable view
>> made of two easy to understand classes. The folder levels at that
>> point can be just 2, but that is quite ok, I hate to see map names get
>> out of the screen anyways.
>
> 2 levels may cause problems when wanting to list the geometries, since the
> geometries should be listed as
> directory
> database
> view
> geometry1
> ...x
> geometry
> table
> geometry1
> ...x
> geometry
>
> to make if easier to find it, which does not work well now with the list.

Well, right now the view shows in a proper order an entry for each
folder and each subfolder, so the effect is quite similar to how it
has been before. It is just not indenting for each sublevel.

> I will try to download/compile this before I leave later and look at in the
> afternoon.
>
> Have you tried this with the new Database Drivers?

If you mean the views part, definitely not. Or do you mean the native drivers?
The work I am doing now is still on trying solve a misbehaving
treeview issue for the release. Then there are still a couple of bugs
to solve. After the release I will test those.

Andrea





>
> Mark
>
>>
>> In the process I found an important issue. I see you were keeping
>> reference to teh MapView in the MapDirManager, which works as a
>> singleton. This should never be done, since the MapView itself keeps
>> references to the Context and we end up leaking stuff.
>>
>> I changed the loadSelectedMap method to be called only from the
>> MapsActivity.
>>
>> I pushed everything up. I would ask you if you are ok with the
>> possibly new treeview. It can be enhanced, but at least it will be
>> simple.
>>
>> Cheers,
>> Andrea
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to geopaparazzi-de...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

andrea antonello

unread,
Apr 27, 2014, 4:51:31 AM4/27/14
to geopapara...@googlegroups.com
Hold on, you are talking about vector data?
If so, I commented them out and didn't get them back yet, because I
have to remove all the references to the TreeNodes.

I wanted you to have a look at the tileset part.

Andrea

Mark Johnson

unread,
Apr 27, 2014, 4:54:13 AM4/27/14
to geopapara...@googlegroups.com


On Sunday, 27 April 2014 10:51:31 UTC+2, andrea antonello wrote:
Hold on, you are talking about vector data?
If so, I commented them out and didn't get them back yet, because I
have to remove all the references to the TreeNodes.
No, when the application starts this error turns up and the list for maps is empty.
Mark

andrea antonello

unread,
Apr 27, 2014, 4:56:12 AM4/27/14
to geopapara...@googlegroups.com
>> Hold on, you are talking about vector data?
>> If so, I commented them out and didn't get them back yet, because I
>> have to remove all the references to the TreeNodes.
>
> No, when the application starts this error turns up and the list for maps is
> empty.

Yeah, I saw right now, since my vector data all show up.

Then I do not understand what you mean, since I tried on two different
devices and they all show up properly.

Are you using the version merged with your views branch?

Andrea
>> > email to geopaparazzi-de...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to geopaparazzi-de...@googlegroups.com.

Mark Johnson

unread,
Apr 27, 2014, 5:00:33 AM4/27/14
to geopapara...@googlegroups.com


On Sunday, 27 April 2014 10:56:12 UTC+2, andrea antonello wrote:
>> Hold on, you are talking about vector data?
>> If so, I commented them out and didn't get them back yet, because I
>> have to remove all the references to the TreeNodes.
>
> No, when the application starts this error turns up and the list for maps is
> empty.

Yeah, I saw right now, since my vector data all show up.
No maps show at all

Then I do not understand what you mean, since I tried on two different
devices and they all show up properly.

Are you using the version merged with your views branch?
No, I updated the nf_gps_service and with clean/assemble rebuilt it.

After sending you the mail, I switch back to the spatialite_views and changed the version number and did a clean/assemble
- but that will not install
-- is there something else that must be changed?

Mark

>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an

andrea antonello

unread,
Apr 27, 2014, 5:09:27 AM4/27/14
to geopapara...@googlegroups.com
[...]
>> Then I do not understand what you mean, since I tried on two different
>> devices and they all show up properly.
>>
>> Are you using the version merged with your views branch?
>
> No, I updated the nf_gps_service and with clean/assemble rebuilt it.

Do you find any error in the log?

> After sending you the mail, I switch back to the spatialite_views and
> changed the version number and did a clean/assemble
> - but that will not install
> -- is there something else that must be changed?

No, that sounds quite strange. Try to uninstall and reinstall it.

Andrea
>> >> > email to geopaparazzi-de...@googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "geopaparazzi-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to geopaparazzi-de...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to geopaparazzi-de...@googlegroups.com.

Mark Johnson

unread,
Apr 27, 2014, 5:13:36 AM4/27/14
to geopapara...@googlegroups.com


On Sunday, 27 April 2014 11:09:27 UTC+2, andrea antonello wrote:
[...]
>> Then I do not understand what you mean, since I tried on two different
>> devices and they all show up properly.
>>
>> Are you using the version merged with your views branch?
>
> No, I updated the nf_gps_service and with clean/assemble rebuilt it.

Do you find any error in the log?
Stupid of me not to think of that:

04-27 10:42:10.881 14807 14807 I GEOPAPARAZZI: 2014-04-27 10:42:10: UU;ERROR_GEOPAPARAZZI;SourcesTreeListActivity: Problem getting sources.: null
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI: 2014-04-27 10:42:10: UU;ERROR_GEOPAPARAZZI;SourcesTreeListActivity: java.lang.NullPointerException
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at eu.geopaparazzi.mapsforge.mapsdirmanager.sourcesview.SourcesExpandableListAdapter.<init>(SourcesExpandableListAdapter.java:63)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at eu.geopaparazzi.mapsforge.mapsdirmanager.sourcesview.SourcesTreeListActivity.getData(SourcesTreeListActivity.java:36)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at eu.geopaparazzi.mapsforge.mapsdirmanager.sourcesview.SourcesTreeListActivity.onCreate(SourcesTreeListActivity.java:28)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.Activity.performCreate(Activity.java:5231)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.os.Handler.dispatchMessage(Handler.java:102)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.os.Looper.loop(Looper.java:136)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at android.app.ActivityThread.main(ActivityThread.java:5017)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at java.lang.reflect.Method.invokeNative(Native Method)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at java.lang.reflect.Method.invoke(Method.java:515)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI:     at dalvik.system.NativeStart.main(Native Method)
04-27 10:42:28.509 14807 14807 I GEOPAPARAZZI: 2014-04-27 10:42:28: UU;INFO;ADBHELPER: Setting database in ADbHelper.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "geopaparazzi-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an

andrea antonello

unread,
Apr 27, 2014, 5:22:55 AM4/27/14
to geopapara...@googlegroups.com
On Sun, Apr 27, 2014 at 11:13 AM, Mark Johnson <mj1...@googlemail.com> wrote:

> 04-27 10:42:10.881 14807 14807 I GEOPAPARAZZI: 2014-04-27 10:42:10:
> UU;ERROR_GEOPAPARAZZI;SourcesTreeListActivity: Problem getting sources.:
> null
> 04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI: 2014-04-27 10:42:10:
> UU;ERROR_GEOPAPARAZZI;SourcesTreeListActivity:
> java.lang.NullPointerException
> 04-27 10:42:10.901 14807 14807 I GEOPAPARAZZI: at
> eu.geopaparazzi.mapsforge.mapsdirmanager.sourcesview.SourcesExpandableListAdapter.<init>(SourcesExpandableListAdapter.java:63)


Hmmm, it behaves as if init was never called from MapsDirManager.

I have to give a look how that is even possible. In that part of the
logic nothing has changed. I really only removed the TreeView part.

Andrea
>> >> >> > email to geopaparazzi-de...@googlegroups.com.
>> >> >> > For more options, visit https://groups.google.com/d/optout.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "geopaparazzi-devel" group.
>> >> > To unsubscribe from this group and stop receiving emails from it,
>> >> > send
>> >> > an
>> >> > email to geopaparazzi-de...@googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "geopaparazzi-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to geopaparazzi-de...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "geopaparazzi-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to geopaparazzi-de...@googlegroups.com.

andrea antonello

unread,
Apr 27, 2014, 5:24:41 AM4/27/14
to geopapara...@googlegroups.com
Does the initial load maps even appear?

Any error before the one you pasted in? Something is going wrong
during the init call.

Andrea

Mark Johnson

unread,
Apr 27, 2014, 5:27:23 AM4/27/14
to geopapara...@googlegroups.com


On Sunday, 27 April 2014 11:24:41 UTC+2, andrea antonello wrote:
Does the initial load maps even appear?

Any error before the one you pasted in? Something is going wrong
during the init call.
No, that was everything.
No maps show up (screen is blank)
- the maps list is empty
- vector list shows up when called
>>> >> >> > For more options, visit https://groups.google.com/d/optout.
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups
>>> >> > "geopaparazzi-devel" group.
>>> >> > To unsubscribe from this group and stop receiving emails from it,
>>> >> > send
>>> >> > an
>>> >> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "geopaparazzi-devel" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an
>>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "geopaparazzi-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

Mark Johnson

unread,
May 6, 2014, 5:46:50 AM5/6/14
to geopapara...@googlegroups.com
Has this problem been resolved?

Mark

andrea antonello

unread,
May 6, 2014, 5:52:00 AM5/6/14
to geopapara...@googlegroups.com
Has this problem been resolved?

I am afraid no. I have no way to reproducing it and no other user reported it.
I though it was gone, since you didn't report back on it for a while, but that now vanishes.

Could you try with the latest 3.9.5 release candidate, just to make sure the problem wasn't fixed?

I am on this and would be happy to solve it.

Andrea


 
To unsubscribe from this group and stop receiving emails from it, send an email to geopaparazzi-de...@googlegroups.com.

Mark Johnson

unread,
May 6, 2014, 5:54:32 AM5/6/14
to geopapara...@googlegroups.com


On Tuesday, 6 May 2014 11:52:00 UTC+2, andrea antonello wrote:
Has this problem been resolved?

I am afraid no. I have no way to reproducing it and no other user reported it.
I though it was gone, since you didn't report back on it for a while, but that now vanishes.

Could you try with the latest 3.9.5 release candidate, just to make sure the problem wasn't fixed?
which branch is it?


Mark
>>> >> >> > For more options, visit https://groups.google.com/d/optout.
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups
>>> >> > "geopaparazzi-devel" group.
>>> >> > To unsubscribe from this group and stop receiving emails from it,
>>> >> > send
>>> >> > an
>>> >> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "geopaparazzi-devel" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an
>>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "geopaparazzi-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> For more options, visit https://groups.google.com/d/optout.

andrea antonello

unread,
May 6, 2014, 5:57:51 AM5/6/14
to geopapara...@googlegroups.com
On Tue, May 6, 2014 at 11:54 AM, Mark Johnson <mj1...@googlemail.com> wrote:


On Tuesday, 6 May 2014 11:52:00 UTC+2, andrea antonello wrote:
Has this problem been resolved?

I am afraid no. I have no way to reproducing it and no other user reported it.
I though it was gone, since you didn't report back on it for a while, but that now vanishes.

Could you try with the latest 3.9.5 release candidate, just to make sure the problem wasn't fixed?
which branch is it?

That would still be the nf_gps_service one. I never got back from that one, even if the name is no longer the best.

Andrea

 
To unsubscribe from this group and stop receiving emails from it, send an email to geopaparazzi-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages