Wednesday, May 1, 2013 0 Love Mail

Mobile Application - Service Music Player



The application is divided in two files. The first one is the Activity which contains all the UI controls and ask the connection to the Service written in the second file.

In the MusicService class, there is a subclass which extends Binder. The only method in it is getService to access all the sevice's methodes.




The MainActivity is bind to the MusicService with the SerciveBinder class once the service is connected to the Activity.

We bind the MainActivity to the service in the onStart Method. We use the Flags BIND_AUTO_CREATE to be sure that the service is created and only once and BIND_ABOVE_CLIENT to tell the system that the UI should be killed in priority before the service in case of low memory.

To be sure that the service keep going when the UI is closed, we use the setForeground() method.

In the MainActivity a thread is running to keep the SeekBar up to date. It asks the service the progression of the playback and set it to the seekbar.

We had two main problems. The first one was to keep the service running even if lots of other processes are running. This was solved by adding the flag BIND_ABOVE_CLIENT and by starting the service in foreground. With this method, the system doesn't kill the service when it needs resources.

The second problem was that the player variable in the service was null each time we resumed the UI. This was because we called unbind() in the onStop() method. By suppressing this call, the problem was solved. But we don't really know why this variable was suppressed.

We also had a null pointer exception when we clicked on the button stop or pause before starting because the player wasn't initialized yet. So we check if the player != null && player.isPlaying() to avoid this issue.

Finally, when we clicked several times on the start button, each time the music started above the other. So we added the condition if the player was already running before creating it.

Wednesday, April 17, 2013 0 Love Mail

Mobile application - Activity Handin

 

Our MainActivity file contains two buttons, one to call an another activity with a flag (ActivityWithFlag) and one to call it without flag (ActivityNoFlag). We splitted them in two files because it is easier for calling the MainActivity back after.

You can download the APK file here: http://ge.tt/4M197Qe/v/0?c

The source code here: http://ge.tt/8XPg7Qe/v/0?c

I. Without the flag



And then, coming back to the MainActivity from the ActivityNoFlag when clicking on the back button:



Drawing of the stack




II. Calling the other activity with the flag ACTIVITY_REORDER_TO_FRONT



In the ActivityWithFlag class to come back to the MainActivity when clicking on the back button:



Drawing of the stack


 

Saturday, April 13, 2013 0 Love Mail

Easter holidays

On wednesday 20th March, Billy and I came back to France for the holidays! We took the train at 7:14 PM in Horsens. At 8 AM I left the train in Mannheim to go to Kaiserslautern and then to Pirmasens. A 15 hours travel but it was worth it!
During this holidays, we (Kevin, a polish girl and I) had to work on our embedded operating system project which is an house alarm. We already presented in class the features we'll add on it which are the following:
  • Ring when infrared sensor are noticing something.
  • Send also messages on Twitter and email.
  • Have the possibility to switch on/off the alarm with a small website.
  • Add a timer, to have the possibility to switch off the alarm before it rings.
  • Call the owner by VoIP maybe? 
Our awesome project.

More infos on our wiki page here.

I also have to continue the project for the company Abson based in Ikast and where I have to go sometimes to meet the CEO and the directors. We were supposed to be 3 in the group but finally I'm the only one... I have to develop 2 main projects. First, an e-commerce website on which there is a carport 3D modelizator/configurator. I met an engineer working at LEGO who taught me how to use a 3D software called Unity3D, often used for video games.

 

This is called "augmented virtuality" but I also have to work on "augmented reality", something really cutting edge I didn't know before and which fascinated me! So I'm currently working with another software called "Augment" and developped by a French company by the way. You can see what it is on this picture:


And for the course about security, I have to write a report on Bluetooth transmissions, how vulnerable it is and what can malicious people do.

To conclude, lots of work and no time to get bored!
 
;