Version 25 (modified by gandrade, 4 years ago) (diff)


IAB Code Migration Engine

Project Details

Purpose of this project

Improve OpenIAB usability.

Project Description

  • Phase 1: IAB code migration engine: create a Web page with two boxes and a button in the middle of them. The left box is an input box where the developer pastes the source code of it’s Android App with Google IAB “calls”. After pressing the button, the engine inserts the OpenIAB code in the right box. He then can copy that code to their IDE.
  • Phase 2: Implement an Intelli J plugin to suppress the need to use the Web Page.

Project Source Code

Source Code


First Week (12 July – 17 July)

-> Tutor meeting and goals definition;

-> Set up the work environment;

-> Studied In-App Billing documentation;

-> Examine project's feasibility;

-> Initial internship presentation;

Weekly Reports

First Week (12-17 July) :

-> Initial presentation.
-> Assessment made with Marta from Management and my mentor, Marcelo Benites.
-> Studied In-App Billing (IAB) documentation.
-> Experimenting Google's TrivialDrive2 to learn how does IAB work with Google Play.
-> Discussed results with mentor and revised project's feasibility.
-> Internship initial presentation.

Second Week (18-24 July) :

-> Studied OpenIAB's basic principles and how to add it to an App.
-> Created simple site with HTML,CSS and JavaScript? to serve as an initial base.
-> Assessment made for the first phase of the project with my mentor.
-> Deployed site on Github.
-> Very simple conversion tests made.
-> After finding a lot of difficulties with Java code parsing, found a library called Roaster that would turn the process really simple. To use this library, I had to submit the user's code to a JAX-RS resource and use Roaster in there.
-> Installed Eclipse Java EE and started learning JAX-RS by creating a webapp that used Jersey and Tomcat.
-> Studied “Developing RESTful APIs with JAX-RS”
-> After finishing this test webapp, I migrated the simple site I had already made and will now study the Roaster API to figure out the most efficient way to implement the Google-to-OpenIAB conversion system.

Third Week (25 July) :

-> PUT and GET methods working in webapp.
-> Server call successfully made with JavaScript?.
-> Error: org.apache.jasper.JasperException?: Unable to compile class for JSP.
-> Holidays from the 26th to the 28th of July.

Forth Week (1-7 August) :

-> Fixed errors. JSP working using Eclipse Kepler and Apache Tomcat 8.
-> Tested JavaBeans? for calling Java Methods on client side.
-> Used Postman (Chrome Extension) to test POST and GET methods' execution.
-> Studied most efficient way to communicate between client and server.
-> After having problems using pure AJAX on JavaScript?, I used JQuery and Java Servlets that worked as intended.
-> Servlet successfully calling Java service and returning a string to client.
-> Re-factored initial JavaScript? code changing it to the server side, creating new Java methods.
-> Studied Roaster documentation and started using it to parse Java Code pasted on the webApp and then modify it.

Fifth Week (8-14 August) :

-> Using Android's TrivialDrive? as base, started testing some translation features.
-> Problems found with the setBody method from the Roaster library but later resolved by asking on the developers forum.
-> Imports feature created and working.
-> Re-factored two functions and added link that redirects to Open IAB's setup guide.
-> Possibility to create an IntelliJ plugin instead of an webApp discussed with mentor.
-> Installation and setup of IntelliJ IDEA.
-> Started creating new feature for a more precise translation as suggested by my mentor.
-> Studied IntelliJ's plugin documentation.
-> Decided to continue the implementation on the WebApp? and maybe migrate to a plugin afterwards.
-> Tests made to assess new features.

Sixth Week (16-21 August) :

-> Problem with trying to access inner methods using Roaster and after consulting JForge's forum, found out that feature wasn't included in the API.
-> Handling some simple error cases.
-> Setup method correctly translated.
-> Improved webApp's CSS.
-> Discussion with mentor to debate the implementation and some features.
-> Studied and tested some alternatives to access bodies of inner methods.
-> Used onServiceConnected and onServiceDisconnected bodies on translation by creating new methods.
-> Tested new feature.
-> Reviewed and cleaned code.
-> Improved error handling and messages shown to user.

Seventh Week (22-28 August) :

-> Progress shown to mentor.
-> Found incapability on Roaster API to parse anonymous classes and methods.
-> New translation made according to Aptoide's new In-App Billing interface.
-> Re-started working on a Intelli J plugin after a meeting with my mentor.
-> PsiFiles? documentation studied.
-> Searched for a plugin to help parse Java code on Intelli J but couldn't find a suitable one.
-> JavaParser? is an API that I found that can be more complete than Roaster, further tests needed.
-> Struggling to use PsiFiles? correctly so asked for help on Intelli J's Plugin Development forum.
-> Studied documentation about PsiClass?,PsiFile? and PsiJavaFile?.

Eighth Week (29 August- 2 September) :

-> After seeking help on Intelli J's Plugin Development forum, I can now iterate over all .java files on the project folder.
-> Tests made with Psi Files (how to modify them and save changes).
-> PsiClass? is not an efficient object to be modified, chose to make a different approach on how to handle the modifications needed.
-> Several discussions on Intelli J's Plugin Development forum to understand how to implement the features I want.
-> Meeting with Katerina from HR.
-> The questions on StackOverflow? were not answered.
-> Started writing code to modify files.
-> Simple tests made to ensure I understand the type of objects and methods I am working with.
-> Found that the modifications will all be made on PsiElements? with the replace() method.

Trainee details

Trainee Name

Guilherme Andrade

Past Experience

Bologna Degree in Telecommunications and Informatics Engineering @ IST and a 3-month internship at Bluecover Technologies.

Current Situation

Starting the Bologna Master Degree in Telecommunications and Informatics Engineering @ IST.

Motivation for the Project

Eager to learn the most I can about Android programming and how to integrate in-app payment solutions and how to monitor them.


Marcelo Benites