Database of Firefox OS Apps

Mozilla has developed a special database for storing the data for the Firefox OS applications. It is simple IndexedDB.
From Mozilla Developers Network we can know what is IndexedDB .If you are worked only with Relational Database Management System, then for the first time it will be very difficult to use. But you can easily master this database since you work more with Javascript while developing mobile applications for Firefox.

IndexedDB is an API for client-side storage of significant amounts of structured data and for high performance searches on this data using indexes. While DOM Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution.

Below is the simple code which will initialize the database when the application gets started.

function initializeDB() {
if (window.indexedDB) {
 console.log(“IndexedDB support is there”);
}
else {
  alert(“Indexed DB is not supported. “);
}

// open the database
// 1st parameter : Database name. We are using the name ‘notesdb’
// 2nd parameter is the version of the database.
var request = indexedDB.open(‘notesdb’, 1);
request.onsuccess = function (e) {
 // e.target.result has the connection to the database
 db = e.target.result;
 //Alternately, if you want – you can retrieve all the items
}

request.onerror = function (e) {
  console.log(e);
};

// this will fire when the version of the database changes
// We can only create Object stores in a versionchange transaction.
request.onupgradeneeded = function (e) {
  // e.target.result holds the connection to database
  db = e.target.result;
 
  if (db.objectStoreNames.contains(“notes”)) {
    db.deleteObjectStore(“notes”);
  }
  // create a store named ‘notes’
  // 1st parameter is the store name
  // 2nd parameter is the key field that we can specify here. Here we have opted for autoIncrement but it could be your
  // own provided value also.
  var objectStore = db.createObjectStore(‘notes’, { keyPath: ‘id’, autoIncrement: true });
 
  console.log(“Object Store has been created”);
};

Below line of code will help you to add the elements in the database

function addItem() {
 // create the transaction with 1st parameter is the list of stores and the second specifies
  // a flag for the readwrite option
  var transaction = db.transaction([ ‘notes’ ], ‘readwrite’);
  //Create the Object to be saved i.e. our Note
  var value = {};
  value.title = title;
  value.details = ing;
value.noteDes = desc;
  // alert(“hai”);
  // add the note to the store
  var store = transaction.objectStore(‘notes’);
  var request = store.add(value);
  request.onsuccess = function (e) {
 alert(“Added Successfully”);
  };
  request.onerror = function (e) {
    alert(“Error  ” + e.value);
  }
}

 Below lines of code will allow you to show the database contents

function display()
{
 //Read the notes
var transaction = db.transaction([“notes”]);
var objectStore = transaction.objectStore(“notes”)
   // open a cursor to retrieve all items from the ‘notes’ store
 objectStore.openCursor().onsuccess = function (e) {
//document.getElementById(“note-list”).innerHTML=”;
 var cursor = e.target.result;

 if (cursor) {
   var value = cursor.value;

var para=document.createElement(“h1”);
var node=document.createTextNode(value.title);
para.appendChild(node);
var element=document.getElementById(“note-list”);
element.appendChild(para);

var para=document.createElement(“p”);
var node=document.createTextNode(value.details);
para.appendChild(node);
var element=document.getElementById(“note-list”);
element.appendChild(para);
var para=document.createElement(“p”);
var node=document.createTextNode(value.noteDes);
para.appendChild(node);
var element=document.getElementById(“note-list”);
element.appendChild(para);
   // move to the next item in the cursor
cursor.continue();
 }

};
}

The above code will help you to learn more about how to start the database, add entries and display the entries from the database. It is very easy to use and is very simple to handle.
Advertisements

ANTAKSHARI- App to save song

Antakshari
Most of the Indian should be knowing about the title very well. Yes the olden days are back but it has now become somewhat digital. It was the golden time when we had such an event happening around us with lot of joy and enjoyment. We all were happy and had great time.
Before starting for those who are not aware of what the Title is here is some small description.
ANTAKSHARI it is one of the common games in olden days where a group of people will be playing. We are in need of atleast 2 people but the maximum number can be any. Sometimes they used to play in group also. The group game will be very awesome lot of team work and the game goes for long time.
Here first one will be starting to sing the song then after that at the end of the song with the last character another team will be starting to sing the song. And the game of singing goes on sometime for the whole day. No one will get bored to play this game. They will be always enjoying to play it. It is really a coolest game than anything.
But some difficulties are faced when we play the game we may not suddenly remember the start of many songs and so we may lose the points. So we are  in position to save the songs list we would like to have. But making it as a simple notes will be very difficult, for eliminating this difficulty we have found a mobile application for android.
There are currently 4 mobile applications in Indian languages for this feature.
The description from the developer is as follows

This application is for those who play or participate in antakshari programs.It has the simplest UI. Start input from the opening screen and building your collection of songs.
From the same screen, search for the songs. Use any field or column with minimal input to search. Select one from list to edit or use in your program.
It is totally FREE.
Seat the youngsters at the rear with a phone and this app. They can search and prompt within no time.
It is fun to have this and beat your opponents with eyes closed (Keep the ears open).
Use anysoft keyboard or any other suitable keyboard for input. You can use transliteration i.e use English alphabets instead of Tamil. Or the input can be in English.
Try and see the results.

The application is well designed. It mandatory inputs are first character and the first word. Other inputs are singer name, movie name, actors the year of release. 
You can search the songs with first character or the first word. We have talked to the developer regarding the english version of the application to support world wide. It is expected to be released very soon. 
And in the next update there are lot of changes like once the song is saved he will be allowed to share it in the social networks like Google+ and Facebook. Surely it is one of the new applications which is coming and going to hit the market with lot of best reviews.

Angel Hack Bangalore

It is one my dream to go Angel hack and see what is happening there. I am aware lot of professional will be participating in this event and will be building their product which will be rocking in future.

I reached Bangalore on early morning 3rd May 2014. It was very difficult to find Microsoft office there many are not aware of this office. After a long time I finally found it. Then started walking for sometime towards the building. At the same time Galaxy, Deb, and Sayak came there. Unfortunately we all had similar T shirt which we all got for Firefox OS app Days which happened in Bangalore during the month of Jan 2013. We ourselves excited to see in this and left very happy for this. Then I personally introduced myself to Deb and Sayak since we have never had a chance to talk for a long time. Then after some time meet saikiran

We all had some little breakfast and I had 3 tea in the same venue that morning. Before that I had 2 near railway station.

Angel hack beings now.

It very well started with presentation of Angel hack team. Then Deb started to give presentation and started to answer lot of question which came from different developer.  One of the question which many had is ” why we need Firefox OS when there are already lot of mobile OS?”

  • It can run very well in low end devices so can make everyone online and enjoy.
  • Web developers can enjoy developing apps for it easily.

Then it followed by Sayak’s demo on how to develop Firefox OS application using Apache cordova and also introduced about the program Porting Cordova apps to  Firefox OS you can win cool things. Just check out.

Then we had some QA session where winner can get some awesome Firefox OS sticker, Firefox Sticker and Marketplace Sticker. Many answered the question asked for getting this awesome sticker. One person answer 3 question and he got maximum number of stickers.

Then blackberry introduced a program for Porting Android apps to Blackberry.

Then we had little lunch and after that hacking started everyone teamed up and started developing their prototypes.

Interesting thing many started to do web application.Some team were doing Firefox OS application.

Some of the webapp trying to port to Firefox OS apps as follows

An interesting opportunities I got in this. I have got a chance to help barter.li to develop Fierfox OS mobile application for them. And then I got introduced to Blackcorporation founder and talked with me to port their simple Android based mobile application to Firefox OS.

  • This event was really a good experience for me. I was able to meet some awesome mozillians and interacted with them had fun.
  • Got chance to work for some time in Company for porting Android apps to Firefox OS apps

 

 

Signinup to Marketplace

Firefox Marketplace Symbol
Signup to Firefox Marketplace is the so easy. You need not have to remember a new password, you dont need credit card and no need for any additional things expect your email id.
First Step is to goto Firefox Marketplace Website
Then you have to click on the Sign in  button. A persona login will be coming. This why we need not want to remember additional password. 
Persona will let you to add your gmail or any other accounts easily. You just need to verify by logging into you gmail account.
persona Login
If this is your email ID then click Signin. Since I have synced my account it is showing my email ID. you can add your account. If you have not added it will be showing the text box where we can enter our email ID then can login automatically.
After you signup a automatic link will be sent to your account when you are the first time user. Please do verify that link.
After verification you will be redirected to your Marketplace. Then goto settings and edit your name if you need. Settings page
Setting page
Then to upload the application you need to enable the developer account. To do this we need to visit Marketplace Developer HUB page
Developer HUB page
After this you need to click on Submit an App button which is present at the top in the right hand side. After that you will need to read the Terms and Conditions and approve it. 
Then at any time you can Upload your application.
For submitting the application in the Firefox Marketplace there is no need to pay anything. Be careful. when you explore this you can know that you itself can create a special marketplace for you.
The next process is to simply upload our mobile application to the marketplace. When we upload there are two methods like uploading the hosted application(i.e., the application which is available in server) and the packaged application which is in the form of zip.

Both of them have some little difference which makes easier for the developer to make it to the marketplace.

Try to create your wont account today and launch your application development process now.

Firefox Browser

Everyone should be aware of Firefox browser which is considered as one of the most safest browser in this world. From April 29th 2014 till May 1st 2014 or even after this the launch of new version of the Firefox is the most trending thing in the tech world.  What are there in this launch, there are really a large number of things to notice. After the launch there are survey which are made and the results are very interesting.

Firefox 29 Australis
The current version of Firefox is 29 and the name given for this is Australis. I am very happy the Firefox updated automatically this morning. It didnt take much time it was really fast when compared to other version I tried to update.
Home page
Lets start with the GUI (Graphical user interface) looks very familiar to many user. At the first sight the tabs will look like Google Chrome. But as you see in deep you can see there are different in the tabs where it is having more curve compared to Chrome. Then in this version the bookmark button in on the right end of tool bar, next to that is the show bookmarks button. Followed by them are download button and home page. After that is the setting button. Really it is very easy for navigation.
Firefox Customization
The next big thing we can see is the customization. Before this we might have never seen such an option in browser. Really it is cool feature than any other existing browser. We can drag and drop the required things for quick access. Whenever we want the default things we can just click Restore Default button and can change ourselves.
Sync in Mozilla
The next major thing is to use the Sync option where we can store our bookmarks in online and access it in another system. It is really a great feature who use multiple devices for accessing web.
Mozilla Developer screen
Then the navigation for developer tools is nice. The user interaction with the browser is improved very well. It can be said as one of the milestone for Mozilla Firefox browser which will attract many people toward it for using the safe browser.
There was a survey regarding why people use firefox browser all over the world after the launch of 24 hours. The results were cool.
Firefox 29 survey
Digit magazine named Firefox as Speed King. Check it out.
This launch is surely a best treat to everyone in this world who support the web for good cause. We can surely think the best browser is safe, fast, reliable and more exciting to use.