Monday, May 1, 2017

Oracle JET: First Hybrid android Mobile App

Problem Description: In this blog I am just putting all steps those I followed to create a mobile app using Oracle JET

Solution: Here are the steps that I followed to create my first application. As there are multiple ways to start JET development so I would not say this is best way but this is what works for me.



1.      Install Node.js: https://nodejs.org/en/download. Once node is installed you should be able to run npm commands.

2.      Run command prompt in Admin mode and then run below commands to install various npm modules
a.       npm install -g cordova
b.      npm install -g yo
c.       npm install -g grunt-cli
d.      npm install -g bower
e.       npm install -g generator-oraclejet
f.       npm install -g cordova

3.      Install android sdk: I have installed android studio, which comes with android sdk as well. https://developer.android.com/studio/index.html

4.      Use SDK Manager and install api required api: To launch SDK manager from android studio you need not to create any project. You can simply start android studio and select configure option


      
                 Below image shows how my SDK manager looks like





5.   Create web project and run it.
a.       Navigate to directory where you want to create project (say: D:\practice-jet)
b.      Before creating porject verify that you have all npm modules installed:  


npm list -g --depth=0

        
       
  
                 c.    Run command: I prefer creating a web project first and then add hybrid mobile
                        application feature to it.
 yo oraclejet MyFirstApp --template=navdrawer:hybrid

 
  
                  d.     cd MyFirstApp
                  e.      grunt build

                    f.     grunt serve
                  grunt serve command will start a process at port 8000 port. Your page will be visible on
                  browser at http://localhost:8000
                    we can kill process using ctrl+c.  Now our application is running fine on browser. We
                    have following directory structure till now.
 6.     Let us add android feature to our project
         yo oraclejet:add-hybrid --platforms=android
           If we see directory structure, it has got two additional directory src-web and src-hybrid. We already have one src directory. Main (or common code ) will reside in src folder. Code which is only applicable to web application will go in src-web project. Code which is only applicable to hybrid application will be in src-hybrid folder.

   7.      Build project
          grunt build --platform=android

            This step has created an android-debug.apk file in D:\practice-jet\MyFirstApp\hybri\platforms\android\build\outputs\apk folder. 

8. Create release ready apk file
Keystore with key creation: Now we want to create a release ready apk file. For that we need to first use keytool to create keystore and alias. We can run below command for that 
keytool -genkey -v -keystore MyFirstApp.keystore -alias MyFirstApp -keyalg RSA -keysize 2048 -validity 10000
Command should ask for password for keystore and key. It will also ask for additional details like lastname, first name etc. You can hit enter if you don't want to provide. 

We can keep keystore file outside project so that you can use same keystore with multiple application. My KeyStore name is MyFirstApp, password is 'manager' and Key name is agains MyFirstApp. Keystore and key passwords are same. Definitely you will have different keystore/key/passwords.

    
Now we will create a buildconfig file, which has entry of keystore. I placed file in d:\practice-jet folder. Content of file looks like


Finally run below command to generate release ready apk file

grunt serve:release --platform=android --buildConfig=D:\practice-jet\buildConfig.json
                       
  

   I have moved file to my android phone and installed apk. Here is the image of running application


9. Edit something in code and verify changes.
     To edit code you should make changes in src folder and then use grunt serve command to run it.
     NOTE: to edit web specific code use src-web and to edit hybrid specific code use src-hybrid.
    NOTE: As we have multiple platform now grunt serve will not be enough, we need to specify  which platform. Use command grunt serve --platform=web to run its web version in browser.

To sum up, we have run following important commands



1.      One time setup
a.       Node install
b.      Node module install
                                                              i.      npm install -g cordova
                                                            ii.      npm install -g yo
                                                          iii.      npm install -g grunt-cli
                                                          iv.      npm install -g bower
                                                            v.      npm install -g generator-oraclejet
                                                          vi.      npm install -g cordova
c.       Android SDK installation

2.      Project Specific setup
a.       Create project: yo oraclejet MyFirstApp --template=navdrawer:hybrid
b.      cd MyFirstApp
c.       grunt build
d.      grunt serve
e.       Add hybrid features: yo oraclejet:add-hybrid --platforms=android
f.       grunt build --platform=android
g.      Create keystore: keytool -genkey -v -keystore MyFirstApp.keystore -alias MyFirstApp -keyalg RSA -keysize 2048 -validity 10000
h.      Create buildConfig file
i.        Create release ready apk file: grunt serve:release --platform=android --buildConfig=D:\practice-jet\buildConfig.json

From here you can use NetBeans for development: To do so, you can follow
http://sanjeev-technology.blogspot.in/2017/05/oracle-jet-hybrid-android-app-using.html

14 comments:

Sandeep said...

Thanks for sharing valuable information.
Nice Blog.Keep updating your blog. It will very useful to the many users,
Android Application Development Pune, Bangalore, Delhi
Mobile App Development Pune, Bangalore, Delhi, iOS & Android App Developers Pune, Bangalore, Delhi

ashley said...

"Nice Blog!!
Norton login account is one of the easiest platform that allows you to manage products download Norton antivirus and protect your device from online threats.
Norton Account
Norton Setup"

Shruti said...

small business marketing
small business marketing
small business marketing
small business marketing
small business marketing
small business marketing
small business marketing

karthick said...

This post is so helpfull and informative.keep updating with more information...
Selenium Entry Level Jobs
Selenium Testing Jobs

Shrainy Fogat said...

You can typically start the application process for a title loan online or at a title lender's store. Loan amounts typically range from 25% to 50% of the car's value, and you need to have the title in your hands, owning your vehicle free and clear. This means it can't be currently financed through another lender.To complete the application process and get approved, you'll need to bring in your car or motorcycle, a clear title, a photo ID and proof of insurance. You may also need to bring an extra set of keys.
Title Loan Calculator

Ava Ebrahim said...

hbomax.com/tvsignin MAX lets you watch movies, exclusive tv shows and other videos at one place but it only works when it is activated. It is necessary for the activation purpose that you need to enter hbo max/tv sign in activation code which is a 6 digit in alphanumeric code.

Shrainy Fogat said...

HBO is home to many great TV and movie shows. The channel has always delighted viewers by offering endless content. It's a stand-alone video streaming service that you can access without having an HBO subscription or cable box.HBO now also comes with a free trial offer that is valid for seven days. If you'd like to have access to HBO's own original movies and shows and shows, visit the site via this link: hbonow.com/tvcode. In terms of streaming services, HBO Now is the most popular among them all. This is because of the content it offers to its users.

Qunock6987 said...

HP Instant Ink works with super high yield cartridges, cost-based pricing, and middleman-free delivery, right before you run out of cartridges or toners. hp printer setup As a result, we have used fewer cartridges, less packaging and less logistics, which allows us to save you money. Help us promote a circular economy. HP uses recycled materials to make 100% Original HP toner cartridges and 85% Original HP ink cartridges. www.123.hp.com/setup

lisa said...


HP Jet Advantage OnDemand is a great tool to have to keep your office printing secure.hp printer setup This software program is built to help you manage your network of devices that are connected to office printers. But it also comes with intricate security programs that will prevent unauthorized access to web-connected printers - and the computers they’re connected to. Wireless printing is a great feature, but it also exposes your network of devices to all sorts of attacks. That’s why you should consider HP JetAdvantage On Demand a crucial security measure for your small business.

Anonymous said...

One of the most popular streaming services in the world right now is Disneyplus.com/begin. It's easy to see why, with the entire Disney catalog available, plus new favorites like Hamilton and exclusives like Muppets Now. However, when it comes to technology, you might need some help getting started. disneyplus.com/begin

Anonymous said...

Disney Plus is one of the most popular streaming services in the world. You can find a full list of Disney classics as well as your favorite new Disney movies. Disneyplus.com/begin Code, which is also a subset of Hotstar, is an example of Hotstar. Disney Hotstar offers a variety of TV shows, disneyplus.com/begin
movies, and news, as well as sports. It is also famous for its video streaming software. This service allows you to live stream TV shows, sports and videos.

Roan visli said...

As Disney+ is only available in certain countries, you can’t sign up, download, or watch Disney+ if you’re not in a serviced region. This is especially annoying if you regularly travel abroad and you want to rightfully gain access to Disney+ content (especially if you’ve already paid for an account).
disneyplus.com login
disneyplus com login
disneyplus.com/begin

Roan visli said...

Disneyplus.com login, Login/Begin at Disney plus.com Disneyplus.com, Get Login Code with 8 digits : To address the disneyplus.com login/begin issue, users can use the disneyplus.com login/begin 8-digit number found on their television. This tutorial will walk you through inputting the disneyplus.com login/begin 8-digit code to activate Disney Plus on your smartphone.
disneyplus.com login
disneyplus com login
disneyplus.com/begin

arafat rahman said...

I am really impressed read your blog. Actually, your blog article is very helpful and more informative.Thank for sharing your valuable information. Such an insightful and long post almost intimidating for us newbie bloggers. Grateful for the effort you took to write this post. Lot’s to think about and get going with. Thank you.
We provide a variety of hacking services, such as social media account hacks, mobile phones / PC hacking, email accounts hacking or anything else customer may want. Details check AwakenCybers