Saturday 31 May 2014

With v0.4 comes an almost completed UI


Quite happy with my work tonight. Achieved what I wanted to. Took longer than expected though.
So the 3 previous buttons that I added now change the icon that the user can plant. I have also added a 4th button which lets user toggle the viewing mood. I spent quite awhile on this as previously I had worked with menu, this time it was image button and they both work sightly differently.
But the good news is that users can toggle between the fruits as many times as they need to; from mango to durian to mango to viewing mood etc . It will work.
Also, while users had to press back button after selecting fruit previously, it now returns by itself.
























It might be awhile before the next version is out. Now the basic user interface of the app is settled.
Next area I would have to work on is the flow of data. Where will the data be hosted? How to import&export data between an Android device and a spreadsheet? What sort of information do I need to capture? And another big issue, which I might not be able to add for version 1 of the app, is attaching photos to the markers. 

I think sending data from the app to the spreadsheet will be easy, I should be able to tap into google form. The harder part might be accessing the data to form the map if the spreadsheet is private. I plan to make it private so as to prevent people from deleting things. The data will be available for everyone to view from the app (and hopefully browser) anyway. The spreadsheet also should be downloadable for anyone to use. 

There is a little problem with the loading of map when GPS is on. It does not auto zoom in to location when there is no last known location. Will have to remember to correct that as well.

ChangeLog: https://www.dropbox.com/s/4pw1mf4zu2p36p5/Fruit3Sg_ChangeLog.rtf
APK: https://www.dropbox.com/s/tc11bydeokd9vu3/Fruit3SG-v0.4.apk



Please note all previous versions have been moved. From now onwards only the latest version will be available. If anyone requires an older version feel free to leave a comment and I will make it available.

v0.3

I chose 3 fruits to start with.
Created the icons for them.
Created a menu to change the fruits.
However the buttons do not toggle anything yet.



ChangeLog: https://www.dropbox.com/s/4pw1mf4zu2p36p5/Fruit3Sg_ChangeLog.rtf
APK: https://www.dropbox.com/s/en3eqazpror0m2f/Fruit3SGv0.3.apk

Please note all previous versions have been moved. From now onwards only the latest version will be available. If anyone requires an older version feel free to leave a comment and I will make it available.



StackOverflow, v0.2.2

After a few more hours of searching for the problem I decided to enlist some help on StackOverflow.
I posted my problem there and within minutes it was answered, with one of the replies being the solution.

Link to my question: http://stackoverflow.com/questions/23958873/textview-causing-app-to-crash

And the hero that saved the day:


Source Code: https://www.dropbox.com/s/y5512ugypm3okhe/FruitTreeSG-v0.2.2-sourcecode.zip
APK: https://www.dropbox.com/s/8x0bzz9i7axno90/Fruit3SGv0.2.2.apk
ChangeLog: https://www.dropbox.com/s/4pw1mf4zu2p36p5/Fruit3Sg_ChangeLog.rtf

Friday 30 May 2014

Error Hunting

Well I thought I would add in the Legal Notices.
However I kept getting errors I could not resolve. After very long I realized it was because I had given a layout and an id the same name.

After that my app kept crashing. back when I used to work with C++/C the way I looked for error was by putting 'cout's to trace where the program actually crashed.

I tried the same for this but I realized it was not so easy to print to screen. I am not sure how to access the log file as well.

However I started making portions of the code I suspected the error was at into comments to narrow it down. I spent quite a bit of time changing to comments, fixing, comments, fixing until I finally narrowed it down to a specific function called TextView. I'm going to bed now, will continue work on this tomorrow.


Oh yeah the System.out.println() did not work. Not sure how it is supposed to be used, will look it up tomorrow.

v0.2.1

So far I was testing the code by generating the apk, sending it to my phone using AirDroid and then installing it. Then I realized AirDroid allows you to install the app as well. Just now I stumbled across an even faster way; just connect my phone to the laptop using usb and I can test the app from Eclipse itself. It generates the apk, sends it to my phone and installs it much faster than my previous method.

This minor update now allows user to place icons. Users are still able to pan. Check the ChangeLog to view all changes.



Source Code: https://www.dropbox.com/s/ev7l9mh44s5ztt3/FruitTreeSG-v0.2.1-sourcecode.zip
APK: https://www.dropbox.com/s/2igrkagu0gloc2m/FruitTreesSGv0.2.1.apk
ChangeLog: https://www.dropbox.com/s/4pw1mf4zu2p36p5/Fruit3Sg_ChangeLog.rtf



Thursday 29 May 2014

v0.2

In this version I wanted the app to automatically find your location and then zoom in.


However when the map starts it does not do that.
When I click on the locate button, it does manage to find
location and zoom in on it as well.




























Those two were with my GPS ON.
Let's see what happened when I start the app with the GPS OFF.
I have not typed in any error messages yet so I expect no changes from the first screenshot.



UPDATE: This is what I see as it uses last known location.
 When I clear cache and reboot the app with GPS off it does not load the map.

Well that is enough coding for one night. Will continue working on it tomorrow. I forgot to mention, I am testing the app on a Nexus 4.

Source Code: https://www.dropbox.com/s/cg68bhsvm86fjm1/FruitTreeSG-v0.2-sourcecode.zip
APK: https://www.dropbox.com/s/isrsw06z5d8xr24/FruitTreesSGv0.2.apk
ChangeLog: https://www.dropbox.com/s/4pw1mf4zu2p36p5/Fruit3Sg_ChangeLog.rtf

v0.1

Turns out the problem was that I did not sign the app. You HAVE to sign the app before you can install it. Not sure what you can do with unsigned apks.

Ladies and Gentlemen, the moment you have been holding your breaths for....I give you, FRUIT TREES SG VERSION 0.1!


For now it only says Hello World and opens the world map. But all journeys begin with a single step :)


Everything is open source so here is the source code as well as the apk:
Source Code: https://www.dropbox.com/s/4zyl4og0mxuir5h/FruitTreeSG-v0.1-sourcecode.zip
Apk:             https://www.dropbox.com/s/abu7r87avf8pk3r/Fruit3SGv0.1.apk

Friends in France?

I was provided two urls that might be useful for the project.
http://www.biofortified.org/2012/02/want-to-identify-plants-with-your-smartphone/
The first one was a project with uses image processing to identify plants. Wanting to stay close to the tune of RERO(Release Early Release Often, version 1 would definitely not contain this.
http://www.plantnet-project.org//page:tools?langue=en
This website has a lot of different programs featured on it. One of them caught my eye as it is about geo-tagging plants on user-defined background maps. The page this application was hosted on was in french but google translated it for me. The software itself is only for windows though. Just sent the link to my partner, hopefully the program is in english. Waiting for him to get back to me.

UPDATE: Program was in french. Have a friend who can read french but he is current in the states.

Wednesday 28 May 2014

API Key

Last night I decided to restart the app from scratch. A possible cause of error was the API key. Previously I did not generate my own key as the maps package I downloaded had a key. But I realized I would need my own unique key. Still working on it.



UPDATE: API problem settled.

Inspiration for this project.

Struggling with the app I was reviewing why I chose to do this. Thought I would share my inspiration. The following is a Facebook post by a NTU SPMS professor. A summary is provided at the end of this post.
Cheong Siew Ann

Mass Blooms and Climate Change: A Crowd Sensing Project

Flowers are blooming en mass in Singapore right now. It has been suggested that such a mass bloom is the result of climate change. As a scientist, I believe this hypothesis can be tested. Such changes may not be apparent in a single bloom, but may be discovered if we consider the time pattern of mass blooms over many such episodes. If the change occurred in the past, I know how to find when this happened from the pattern of mass blooms. If the change is imminent, I also know how to detect its early warning signatures.

Seeing that climate change is a topic on your minds, and that many has take notice of the mass bloom, I figure this would be a fantastic citizen science project! Citizen science is not new. The American Ornithologist Society has for many years mobilized hobbyist bird watchers to understand changes to the geographical distributions of American bird species, and thus the impact of human settlements. They have even rediscovered a woodpecker species thought to be extinct this way!

The idea behind this crowd sensing project is that plants are sensors of climate change, and rare mass blooms are sensitive to very specific combinations of climatic signals. We are then sensors of mass blooms, because we appreciate their beauty. I hope through people observing mass blooms, which in turn monitor climatic variations, we can learn something about the underlying climate change.

In this project, I would need your help gathering data on mass blooms. The kind of data I am looking for includes:

(1) newspaper and magazine articles reporting mass blooms (for each article, I will need its scan (or photo), the name of the newspaper/magazine, the date of the newspaper/magazine, and the page the article appeared on);

(2) TV news reports, if anyone has access to archives (for each TV news report, I need a video clip of the report (if permitted by copyrights), the name of the program segment, the date of the program, and the time the report was aired);

(3) photographs of the mass blooms (for each photograph, I will need the digital file, or a scan of the photograph if it is an older hardcopy print. For older prints, I need the date the photograph was taken to appear on the photograph, or some documentary proof that it was taken on the date asserted).

From the data, I would need your help to extract the following information:

(1) the date and duration of a mass bloom;

(2) the geographical locations where the mass blooms were recorded;

(3) the species of plants participating in the mass blooms.

On my part, I will provide regular updates on the progress of the project to all participants. I might also post more specific calls for additional data where I have identified gaps in the overall picture of the mass blooms, whenever there is a need to do so. For now, people can join the project by responding to this post. Please help share this post with friends you think will be interested to contribute. The crowd sensing aspect of this project is novel, and will have to be reported if we ever write this study up for publication. This means that I will need to know who invited you to this project. This information will eventually be published in the form of a graph, where nodes are participants, and directed links connect a participant with another participant he or she invited. If and when the number of participants become large enough, I will create a FB page to host all data and discussions on this project.






In the very likely event you did not read the post let me summarize. The prof wanted to study the mass blooming but the way he was collecting information was very inefficient in my view. I thought there should be a platform that eases the process; makes it easier for people to submit the data as well as for the prof to collect and study the data. Hence the inspiration for my project.  










Why fruiting trees? Well I looked out of my window and saw mango trees. 








Google Maps Engine

Today I received an invitation to take part in a project to document the sightings of Swallowtail moth (a species of moth) in Singapore. Click HERE to view the project. It is using the google maps engine.

I clicked the link and it brought me on my browser to a google map with many markers placed on it.
The concept is very similar to my own project, fruit tree mapping project.

I instantly created my own map and started exploring. So how does this google maps engine match up with the app I intent to create? Can I simply use this maps engine instead of building my app?

How would users generate the location of the sighting?
Unfortunately users would not be able to use their phone's GPS to pin down their location. However a search bar is available for users to search for their locations.

Can we differentiate between trees using the different icons?
While there are more than 100 icons to choose from, they would not be able to represent fruits very well. Custom icons can be used too but only if we subscribe to the service at USD5/month.

Can we attach photos of the tress to the markers?
Yes this feature is available. However you can only add photos using url or google search images. That would put off users from adding images.

Would users be able to search for and display only a specific type of tree (filter effect)?
Could not find a feature for filtering.

Can I view this from an app?
Yes I can easily create an app to open this map. An app would be beneficial as after installation users can launch the map easily instead of typing in the url into their browser.


Pros&Cons (Other than those already mentioned)

Pros: Data can be imported and exported using data sheet format.

Cons: Any user can delete/edit inputs of other. (This can be a pro too. It would be like the early days of wikipedia.)


Monday 26 May 2014

Errors loading map

Our first aim was to make the map without the mapping function; the app will just load Google maps. Followed several guides to do it but when compiling ran into some errors which I could not resolve on my own. Am not sure which file to upload to Github to let Mahadir take a look at the errors.

Wednesday 21 May 2014

Update on Github

Signed up for Github already. Have not created anything yet. First thing to do will be to create a ReadMe.
However it is not exactly like GoogleDocs. When we want to work on the code it will download a copy to our local system. When we are done we can upload it and then merge it. Any conflicts will be highlighted for us.
Decided to do modular programing in order to avoid conflict. Will try to get the algorithm and skeleton settled before Monday.

Tuesday 20 May 2014

Working collectively

We realized that if we both work on the app separately it is not very efficient. Now we are going to look for a platform where we can work on the code together. Something like GoogleDocs but for Eclipse. Heard Github is a place for collaborative coding, we are going to check that out first. Currently I am traveling in the MRT but thanks to the Blogger app am able to update the blog. Very convenient.

Why we chose to make an app over Arduino

We have decided to work on the Fruit Tree Mapping Project. I decided NOT to do anything regarding Arduino as I already know the platform. Both of us have no prior experience making apps so we think we can get a lot out of this project.

For now we have to choose which platform to program for. Due to limited manpower and time we can only choose one platform. The following info is taken from here
Android apps are programmed using C, C++ and Java. It is an "open" platform; anyone can download the Android source code and Android SDK for free. Anyone can create and distribute Android apps for free; users are free to download apps from outside the official Google Play store. There is, however, a one-time $25 registration fee for developers who want to publish their apps (whether free or paid apps) on the official Google Play store. Apps published on Google Play undergo a review by Google. The Android SDK is available for all platforms - Mac, PC and Linux.
iOS apps are programmed using Objective-C. Developers must pay $99 every year for access to the iOS SDK and the right to publish in Apple's app store. The iOS SDK is only available for the Mac platform.

Thus we chose Android. We excluded Windows phones due to the small user base. 

Monday 19 May 2014

Project ideas

Project: Skateboard with speed control
Details: Install a device to measure and control the speed of a skateboard
Group to Benefit: People who do not use a skateboard regularity but would like to use it for transport, especially if their daily routine involves going up and down hills. They can carry the skateboard up the hill and employ it when going down the hill. As they are not very familiar with skateboards they will not be comfortable with speeds beyond a certain threshold value.
Possible Problems: The location of the device will be a problem. If under the skateboard it might get in the way when going over bumps (like those near zebra crossings). If on the board itself it will cause obstruction to the feet.


Project: NTU Project Collaboration Page
Details:  A webpage where NTU students can post details of projects they wish to do/are currently working on. The format of the posts will follow that of Kickstater. But instead of looking for funding these students will be looking for people to work with them. For example a student from mechanical engineering might be building a RC-Car which he designed himself. But he might need help with the electronics part of it so he can post on the site and someone from electronics engineering might decide to help him. Another section of the page might be dedicated to displaying completed projects. Possibly integrate into NTU OpenSourceSociety website.
Group to Benefit: NTU Students (not opening to public as there are already other sites to do that)
Possible Problems: These projects can only be those for their hobby not school projects which are graded but students might misuse the page.


Project: Documentation of Singapore's Fruit Trees
Details: If you stay near, say a mango tree, you whip out your phone, open the app, press locate and plant the mango icon at the location of the tree.
The information will be made accessible via a website as well for easy viewing. Maybe get users to submit photo as well.
Group to Benefit:  Singaporeans, Tree Enthusiasts
Possible Problems:  If not enough people use this app to contribute, the project will basically shut down. Possible solution might be to link the app to instagram; after users submit the photo and mark the location the app posts the photo to their instagram account with relevant hashtags.

Hello World.

The birth of this blog is due to a module I am taking presently called OpenSourceTechnologies.
I am supposed to document my project on this blog.
After the module ends I shall continue maintaining this blog with my  other projects.