October 2011 Coding Challenge/Mobile
Mobile Photo Upload Challenge
editOf course, Mobile Wikipedia is great for learning about the things around you. But: We need pictures. Millions of people have phones. How can we take advantage of location and mobile cameras? Build an app, or extend the existing mobile gateway, to demonstrate your ideas.
Wikipedia's current primary mobile experience is through the mobile site. An extension to our software (MediaWiki) called "MobileFrontend" manages that experience. Once you've familiarized yourself with both MediaWiki and the MobileFrontend extension, as well as the API, it should be relatively straightforward to make changes.
If you're more comfortable in app development, our Android app (based on the Phonegap framework) is very easy to get into; see below.
Some questions to think about:
- What's the call to action for a Wikipedia user to upload photos? Is this part of the reader experience, or a separate experience?
- What can we do with location data to help surface which articles need images?
- How do we ensure that photos have some basic metadata and correct licensing info attached? See our UploadWizard as an example. Most mobile phone uploads should be much simpler as they will be the work of the person who has the phone.
Specific pointers
editUsing the MediaWiki Upload API
editIf you're going to upload pictures, you probably need to know how the Upload API works. See the rest of the API documentation as well, and play with the live API.
Using Location APIs
editGeoNames has a great API that allows you to pass in a latitude and a longitude and get back a long list of Wikipedia articles about nearby places. Here's an example query for that API. You can also read more about how GeoNames works at the GeoNames site.
You can also use the Wikipedia API to get further properties of these articles, e.g. which of them have images.
Mobile Application Development for Wikipedia
editPhoneGap is a great open source platform for mobile development. There's an Android Wikipedia app which uses Phonegap and which you can fork on Github.
Easily prototype your ideas before you code
editBalsamiq is great tool to help you visualize what your mobile workflow might look like before you start coding. It has built-in support for iOS and a community plugin for Android.
Existing apps
editThere is an open source iPhone app called WikiSnaps for uploading photographs to Wikimedia Commons.
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. |
General new developer resources
editBecoming a MediaWiki hacker
editHere's a good introduction on what's involved in becoming a MediaWiki hacker, including instructions for installing your own MediaWiki instance.
IRC: #mediawiki
editIRC is short for Internet Relay Chat, and open source developers talk on IRC all the time. The IRC Primer is a good overview of how IRC works. Friendly MediaWiki developers can be found on the #mediawiki channel on irc.freenode.net (web interface). If you are having difficulties figuring out how to write MediaWiki code, you can ask for help there. Be aware, though: if you want someone to help you, do some homework first. If the answer to your question can be found easily by typing the question into Google, you might not want to ask it on IRC.
Mailing list: wikitech-l
editIf someone isn't immediately available to help you on IRC, you can also join the wikitech-l mailing list and ask questions there. The same rules for asking questions on IRC apply for asking questions on mailing lists.
Coding conventions
editCoding conventions are extremely important in the MediaWiki universe. Read them and understand them. If you do not conform to them, your chances of winning go down significantly.
Pre-commit checklist
editHere's a useful pre-commit checklist. Before you decide that your submission is final, go through this checklist. You'll be glad you did.
Security for developers
editWikipedia gets half a billion visits every month, so good security practices are extremely important. Be sure to review the security documentation for Mediawiki developers.
Unit testing
editGreat code starts with a good test. We (as well as your peers, employers or customers) are greatly impressed by thorough unit testing. Of course, before your code is included in Wikipedia itself, good unit tests will be required. Here's some good documentation for writing unit tests in PHP and Javascript.
Browser Compatibility
editBecause Wikipedia is viewed by so many users, browser compatibility matters. (Remember: 0.1% of 500 million users is still half a million users.) Your new code may not work on every browser, but you must not break older browsers, either. Be sure to familiarize yourself with Wikipedia's browser compatibility policy.