Custom Navigator app questions

by Mikey » Wed, 17 Nov 2010 18:53:47 GMT

Sponsored Links
 Here's a quick background on my situation. I'm a college student and
for my thesis project I've decided to develop a "campus navigator" app
to assist incoming students in getting acquainted with the campus.
This is a year long project so at this point I'm partially
troubleshooting and partially trying to find out if my ideas are going
to run me into walls later down the road.

So as not to have an overwhelmingly long post, I'll just ask about my
current issues for now. The app opens up and allows the user to select
"Map" or "Navigate". I started working with map first because it
should be significantly simpler.

Current State:
The following currently works: hitting the map button displays a .png
of my campus's map (located at ).
I've cropped the picture to only show the numbered buildings (i.e. the
oval track at the bottom, erie canal along the top, and blank spaces
on left/right near streets are all removed). The resulting image is

Using the multi-touch pan/zoom code from Hello, Android! (3rd Edition)
(source code folder Touchv2 available at book's website), the map
display page allows the user to pinch zoom and pan the image. Here's
my first issue. With this implementation, the user is able to pan the
picture out of the screen or zoom out until it only takes up a pixel
or two. Is there any better implementation that will not allow the
user to pan beyond the borders of the image or zoom out past the image

This feeds into my next issue, the "Where I want to be" part. Ideally,
I'd like the map display to use a location manager, and upon location
change, draw a circle where the user is standing. As far as projecting
latitude/longitude to pixel coordinates on the campus.png, that's just
math and I can figure that part out. My question is, since I'm using
an ImageView to put the png in, how can I draw on this? I've been
searching around all day and it appears that Canvas would be the ideal
way, since you can call drawCircle(x, y, radius, paint). However, I
was unable to find a way to correlate an ImageView to a Canvas and
back. On top of this, I need it to base these draws solely on
the .png's pixel coordinates, not the current display (since the image
may be panned or zoomed somewhere that would affect this).

I know it would be simple to just use Google Maps to implement this,
but if possible I'd strongly prefer to use the campus map, as it
clearly depicts all the walkways and buildings on the campus.

Any suggestions/help would be greatly appreciated. I just wanted to
ask early on so I don't make a fatal mistake and have to redesign it a
month before it's due. If you want to see any of my code, just let me



Custom Navigator app questions

by Mikey » Thu, 18 Nov 2010 02:00:07 GMT

 bump. would like to start working on this again but don't know what
direction to go!


Sponsored Links

Custom Navigator app questions

by Spiral123 » Fri, 19 Nov 2010 01:22:36 GMT

 wow, you're in a rush.  I thought you had all year for this project!

Google have spent man-years of development effort to build a Maps
solution.  Rather than waste the effort to re-engineer it yourself why
don't you leverage it to your advantage instead and do something
creative and interesting instead?.

Here are some suggestions:

- Build a custom overlay of the campus buildings and place them over
the Google Maps versions, so that they pan and zoom nicely as the
underlying map is manipulated.  This will also stop worries about what
will happen when you reach the end of your world.  Add a menu option
to center on the Campus and zoom appropriately so your users can
always get back to a useful starting point.

- Add a button to Turn on and off current location.

- Look at capturing touch events on your buildings so that you could
set them as destinations.

- Use intents to launch Google Navigator when they have destinations
to visit and give them walking directions from their current location.

- Go round the campus and physically check GPS accuracy in the
buildings.  If you are lucky then it may be accurate enough to allow
navigation within a building.  Do intra-building directions.

- Build a server-side app that records the trails of your users as
they journey around campus.
   - Analyse the data to find out what are the most trafficked routes
and see if you can suggest improvements to the College staff.

   - Build 'crowdsourced' feedback to show typical journey times and
color the routes according to congestion.

Build in a Manhunt or Zombie-type game where students can get points
for photographing specific landmarks or finding each other etc.

Do you really need more ideas?


Custom Navigator app questions

by Mikey » Fri, 19 Nov 2010 03:41:11 GMT

 Sorry, I didn't mean to seem pushy or anything, I'm just under a lot
of pressure from my director to be making steady progress. I will look
into overlaying the google maps this weekend. Is this part of the
MapView structure?

As for the touch events on buildings, the whole point of this app is
that incoming students don't know where the buildings are. Schedules
are given that show the name and room number of the building. Thus, I
had created a ListView with all the names of all the buildings, and
was planning to have it route you to whatever building you chose. My
idea for routing was to create a location node for each building, each
crosswalk, everywhere the sidewalk splits or turns, etc. Then, when
you hit navigate, it would center you to your nearest node, and it
would know your goal node, and then it would be a "find the shortest
path between nodes". The reason I was going to do it this way was so
that it would follow campus's sidewalks and walkways, which (correct
me if I'm wrong) Google Navigator doesn't see. Doesn't the walking
navigator only walk you along street sides?

I really appreciate the feedback! Thanks for the ideas, I'll certainly
mull them over when I hunker down with my laptop and droid this


Custom Navigator app questions

by TreKing » Fri, 19 Nov 2010 04:03:30 GMT


For zooming, determine the max and min zoom levels you want to allow and
don't allow going past that.
For panning, as the image is panned, detect when been moved as much as it
can, then force the location back to that point. So if the left edge has
been panned to the right farther than the left of the screen, force the left
edge back to the left of the screen. Same idea for the other edges.

My question is, since I'm using an ImageView to put the png in, how can I

Derive from ImageView, call super.onDraw() (or super.draw(), I forget), to
do the default image drawing, then draw your circle as required.

The draw function gets a canvas - draw on that.

TreKing <> ; - Chicago
transit tracking app for Android-powered devices


Other Threads

1. how to stop sound notification/let it only play once?

What Uri are you using for the notification sound? Sounds like the sound it
points to is a looping sound.

On Wed, Jun 24, 2009 at 6:39 PM, polzifer


2. Key event delivery is sometimes slow

I have a separate thread to render game images at 40-50fps. But
sometimes the key response is slow. For example, though I pressed a
button to move the player, the player would stay still or keep moving
towards the original direction as if no keys were pressed. It will
normally last for about 5-10 seconds. The 'MENU' key is having the
same problem. The menu won't show up until after the 5-10 seconds. I
wrote out debug logs in onKeyDown() and onKeyUp(), and it showed me
they were not called during that peroid, regardless how many times I
pressed the key. And after that period, I would receive all key events
that were occurred during that period.

Is that a problem of OS thread scheduling? or just the event delivery
mechanism is slow on Android? Is there any way I can do to avoid this
from happening? It is really annoying.

3. New UI

4. App adds a button to another app


6. Eclipse plugin vs. conversion to Dalvik

7. How To Keep ListView Header From Scrolling With ListView Content