Category Archives: DansLocationAppBlog

Custom Rendering and New Problems

Now that I had profile pictures for users I wanted to display them when you tapped on a pin. I thought this would be easy to do but there was no options provided with pins to display pictures. After doing some research I found out that in order to customize pins you had to render them differently on different devices. Meaning you had to write separate code for iOS and Android.

What you needed to do is write a CustomRendering class in both the Android code and iOS code that extended the MapRenderer class. The MapRenderer class is called every time the Map is changed letting you manipulate how the map, but more importantly how the pins, are presented. On Android you can customize the View that is presented when tapping on a pin and have it display the users profile picture. On iOS the view presented is cut into three parts the LeftCalloutAccessoryView, the middle view, and the RightCalloutAccessoryView. I used the left accessory view to show the profile picture and the middle to show the title of the pin.

All of this was of course not done without any problems. At this point in time a lot things that were working in the past started to break. Mainly the Geolocator plugin, which meant I couldn’t get locations anymore. Most of my time was spent trying to fix this. I fixed it eventually by downgrading the plugin to a lower version and manually reinstalling the dependencies again.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Custom Rendering and New Problems

Now that I had profile pictures for users I wanted to display them when you tapped on a pin. I thought this would be easy to do but there was no options provided with pins to display pictures. After doing some research I found out that in order to customize pins you had to render them differently on different devices. Meaning you had to write separate code for iOS and Android.

What you needed to do is write a CustomRendering class in both the Android code and iOS code that extended the MapRenderer class. The MapRenderer class is called every time the Map is changed letting you manipulate how the map, but more importantly how the pins, are presented. On Android you can customize the View that is presented when tapping on a pin and have it display the users profile picture. On iOS the view presented is cut into three parts the LeftCalloutAccessoryView, the middle view, and the RightCalloutAccessoryView. I used the left accessory view to show the profile picture and the middle to show the title of the pin.

All of this was of course not done without any problems. At this point in time a lot things that were working in the past started to break. Mainly the Geolocator plugin, which meant I couldn’t get locations anymore. Most of my time was spent trying to fix this. I fixed it eventually by downgrading the plugin to a lower version and manually reinstalling the dependencies again.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Daniel Mahoney and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.

Login Page and User System

The next thing to focus on was setting up a user system. For this I drew up a login page and added a User table to the sql server which holds the username and password. For a user system I would need to be able to create an account, check that the username used to create doesn’t exist, and, if the account already exists, check that the password is correct. All of this is done in php by polling the sql server. Once I got logging in to work I needed to make sure everything you do in the app is tied to your username. Which meant, for now, passing the username between pages and adding a username field to the Location table. Now locations stored in the server would also have the persons username attached to them. This let me add another button to the map that lets you only retrieve locations that you put down. Now that I had a user system in place I could start working on the more complicated aspects of the project.

From the blog Location App Blog by Anonymous and used with permission of the author. All other rights reserved by the author.