Friday, March 20, 2015

IMPORTANT INFO FOR GSOC APPPLICANTS APPLYING FOR SUGAR CORDOVA PROJECT

Hi,

I would request all the GSOC 2015 applicants to kindly go through http://plugins.cordova.io/#/ page and find out the plugins relevant to sugar. Also provide a brief description of how you'll go about making your suggested plugins.

Think of something apart from those implemented already !

Go though the repos you get on this link : https://github.com/apache?query=cordova-plugin and think of a similar structure for sugar ! For any kind of help, dont hesitate to ping me.

Tuesday, March 10, 2015

To the students applying for GSOC - Part 2

To the students applying this year to the sugar cordova project - I would like to let you all know a few pre-requisites for the project. We expect that students should complete the following before they apply and also include their work in their application, the better you accomplish, more your chances of getting in ! So pull up you sleeves for some real work ;) Here are a list of tasks that you must all look into :

1. Go through all the post on this blog
2. Go through my sugar cordova related repos on github : https://github.com/puneetgkaur, setup the cordova for sugar with the help of my repos : https://github.com/puneetgkaur/cordova-cli, https://github.com/puneetgkaur/cordova-lib, and https://github.com/puneetgkaur/cordova-plugman. Clone these repos, follow the README on each repo and install cordova for sugar on your system.You should be able to make a simple web app for sugar with the help of this installation by using simple commands : cordova create, cordova platform add sugar, cordova build - you'll get an xo which you must try installing on sugar development environment using sugar-install-bundle command.
3. Setup your sugar development environment : http://developer.sugarlabs.org/dev-environment.md.html and explore around try making changes in code , see where the code rests and try making a few changes to the code, play around with the GUI and get a feel of the sugar environment if you arent familiar before.
4. Know all about cordova - from in and out , visit the cordova repos : https://github.com/apache/cordova-lib, https://github.com/apache/cordova-cli, https://github.com/apache/cordova-plugman , https://github.com/apache/cordova-js and some pltforms repo too : https://github.com/apache/cordova-android, https://github.com/apache/cordova-ios etc. Read the docs : http://cordova.apache.org/docs/en/4.0.0/
5. Know about sugar -web architecture : http://developer.sugarlabs.org/web-architecture.md.html , https://github.com/sugarlabs/sugar-web , https://surajgillespie123.wordpress.com/
6. Carefully read through the last post of how the cordova plugins are made and make a demo plugin for sugar  - note - we want a working prototype of the demo for you to be eligible for the gsoc project - it can be a very simple prototype - just to judge whether you got the workflow or not - if you need help you can mail me.
7. Suggest a list of plugins you aim to code this summer along with the relevantworkflow as to how you think you'll approach each of them - Note : Its shouldn't be the one in air ! We want a concrete set of list which you think you would accomplish, a result of thorough visualization and observation of yourself of how much time you would take to complete each plugin and what all you can do, a complete list of plugins which you think are feasible and good for the sugar community - If you wish to discuss your ideas feel free to discuss them on mail - note : better the list and more feasible it looks on your profile - higher your chances of getting selected.
8.Lastly, keep a blog about your progress on these points, a record of all what you have done and whats remaining, a place where you jot down your daily progress on the above points and present to us in a systematic manner and dont forget - we are always there to help you when you need help - email at puneet.gkaur@gmail.com for help if needed.


All the best guys !!

Friday, March 6, 2015

Hello all,

So GSOC is back again and we got requests from many students to know more about the project, how the plugins are build etc. I would like to dedicate this post of mine for the students interested in the cordova container for sugar project.

So first a basic layout of the project and what we trying to accomplish. Through the cordova container our aim is to enable the web apps with the sugar compatibility. What does that mean ? It means that the web developers dont need to care about the hardware dependencies or not even care about digging into the native code when developing their app. They simply need to call the standard cordova api to do their job. This would enable their apps to be cross platform and they can simply compile their app for sugar and Taaa daa !! it transforms into an activity ready to run.

Now we need to do 2 things here : 1. develop the cordova cli for sugar 2. Develop the plugin which enable the backend for the apps.

Last year we were able to successfully accomplish the bridging of cordova and sugar and also develop a few plugins and showcased the usage via a sugar activity. This time's task would be around making more plugins and showing the use with the relevant activity and also incorporating the plugins into existing activities. I wish all the best to the students applying this year !

An overview of how plugins are made :

For a plugin we have two side : one javascript side and the other native side.So for each plugin we need code on both the ends. So must be proficient enough in both javascript as well as python ! Have a look at this repo of mine : https://github.com/puneetgkaur/cordova-plugins . So for example lets take up accelerometer to explain things, the code on javascript side lies here : https://github.com/puneetgkaur/cordova-plugins/tree/master/accelerometer/accelerometer_plugin/org.apache.cordova.device-motion/src/sugar do have a look into this file.

We define an object : https://github.com/puneetgkaur/cordova-plugins/blob/master/accelerometer/accelerometer_plugin/org.apache.cordova.device-motion/src/sugar/accelerometer.js#L56 with functions start, stop .

The communication to the native side happens through this line : https://github.com/puneetgkaur/cordova-plugins/blob/master/accelerometer/accelerometer_plugin/org.apache.cordova.device-motion/src/sugar/accelerometer.js#L41 and we pass the arguments "Acceleration" , "GetCurrentAcceleration" respectively

We recieved the parameters pasased through the javascript side on the native side through the function here : https://github.com/puneetgkaur/sugar/blob/master/src/jarabe/apisocket.py#L106

Once we have the parameters with us on the native side we then pass them on to the respective code though the piece of code here : https://github.com/puneetgkaur/sugar-toolkit-gtk3/blob/master/src/sugar3/cordova/cordovaSocket.py#L13

So eventually our cordova accelerometer call lands us to the accelerometer code on the native side residing here : https://github.com/puneetgkaur/sugar-toolkit-gtk3/blob/master/src/sugar3/cordova/accelerometer.py#L5

The response is sent via this line : https://github.com/puneetgkaur/sugar-toolkit-gtk3/blob/master/src/sugar3/cordova/accelerometer.py#L16 back to the javascript code.

I hope this makes things a bit clear. The main communication within javascript from the bus.sendmessage to the apisocket function can be handled as seperate topic as it depends on the sugae web framework developed seperately.

So for this project you shall need to develop the native ends as well. You must be proficient with python and secondly must know the sugar code as well. So early you start the better position you would be in to know things and do it in a better way. All the best once again to the prospective students :) I hope we shall  get in a new set of talented developers this time round too :-)

Incase of help dont hesitate to drop a mail at puneet.gkaur@gmail.com