Thursday 25 June 2015

Enabling USB Debugging and Developer Options in Motorola Moto G.

 Step by step guide


When i came to know about this. I was sure this is a Joke but when i tried it.

it left me with my mouth open wide :O
 Because it really works.......

Step 1

Open setting -> About phone

Step 2

in About phone menu go to Build Number

 
Step 3

Tap Build Number 7 times countineously

TADAAAAAAAAA......

Developer options is enabled

 
Step 4

go to setting -> Developer options

here you will find check box to enable USB Debugging


Enjoy..

 

Monday 27 October 2014

Create software installer for your application [free installer maker]

Whenever we think of java based desktop application what comes to your mind?

  1. Executable JAR or JNLP stuff
  2. Set of libraries
  3. System PATH value/ system variable setup
  4. Registry Entries 
  5. Shortcut generation
  6. Branding etc…
To handle this list manually is a time taking and tedious task. 
What if you get a single setup file that will do this for you?
Sounds interesting?

After a long-run of net-mining, I found a very use full tool to create windows installer [or setup.exe] that is easy to use and powerful enough to handle all installation parameters. 


The most important thing “IT’s FREE…. ”. 

The tool is called as “NSIS (Nullsoft Scriptable Install System)”.
Even if this tool can be used to create windows installer of any application, as a java junky I will demonstrate it for JAVA.


Following tutorial will brief you about easiest way to get your work done. 

Lets ROCK!

Prerequisite:

  1. NSIS Desktop Application 
  2. Eclipse [I am using Luna version] with NSIS Plug-in 
  3. Application Executable JAR/JNLP file
  4. .ico file [ to be used as application icon for setup file and application]

[Note: to create .ico file from any image click here]

Step 1

Download NSIS Desktop application installer and install the application 

Step 2

Open eclipse IDE and goto:
File Menu -> New -> Other 
in next window goto EcplipseNSIS -> NSIS Script and click Next button



[if you don't have EclipseNSIS listed as shown in above figure. Click here to know the process to add the same.]

Step 3

You will get a NSIS welcome screen 

Here you can select script templates listed. This templates are having pre-configured option, but we want to set parameters by our self so we will just click on next.

Step 4

On next window you can set:
  1. Application Info
    1. Application Name [Compulsory]
    2. Version : application version
    3. Publisher Name : you may write company or team name here
    4. Publisher URL : 
  2. Installer file info:
    1. Installer File [Compulsory]: Name to be given to installer file
    2. Installer Icon : Icon For installer file. here you can use predefined set of icon that is available or custom your own company icon
  3. Uninstaller File info: Same as Installer info          

and click next.

Step 5

On next window you can setup the proffered 

  1. Installation directory
    1.  in drop-down many standard location are referred with $<name>, here we want to install our jar at Program file folder we will use $PROGRAMFILES
  2. Start Menu Group
    1. Here we can control the way in which you application will be listed in the start menu.
  3. There are further configurations for multi-user, multilingual setup but we will not play with them now, as we want to use English language only.

Now click next.

Step 6

Many stylish installer have a welcome animation, this can be introduced in our installer in next interface will help us do it.
  1. License Setting
    1. Here we can add our license file.
  2. Splash Screen
    1. Here you can set welcome animation for our installer.
and click next

Step 7

Now here we will be adding the components the installer will be installing on the client computer.
  1. Default warning
    1. By default, this window will show warning that Main section content are empty as we haven't added anything to it.
  2. Main section Content
    1. Now here select Main section as we want to add content to it.
  3. Add Component
    1. The plus sign button will allow you to add component one by one

Now click green Plus sign 

Step 8

As you click on Green Plus sign it will show you the list of component type that can be added:
  1. File
  2. File Set
  3. Folder
  4. Library
  5. Shortcut
  6. Registry Key
  7. Registry Value



As we will want to install our JAR/JNLP we will select file.



Step 10



As you select File following window will open:


where we will be specifying 
  1. Source File : i.e. out JAR/Jnlp file
  2. Destination : where we wants to put it after installation 
    • Destination drop-down again contain many standard location specified by $<variable> but as we wants to install it in installation directory only. we will use $INSTDIR and click ok.
[Note : Similarly you can add ICON for application, Desktop shortcut, etc..]

then Click Next.


Step 11

Now this is the final step to generate our install.nsi file
In here we need to select the action that installer should do after completing the installation.


now change installer script save setting to File system and specify the location to save the script and click finish.



image source : http://aberdeenc.files.wordpress.com/2013/04/finally-done.jpg


Hureeeeeeeeeyyyy .. we done with the process....





Reference:
  1. for detailed process reading : http://eclipsensis.sourceforge.net/help/index.html
  2. Popular NSIS user screenshots       :http://nsis.sourceforge.net/Screenshots
  3. Some custome scripts : http://nsis.sourceforge.net/Category:Code_Examples

So here is all from my side THANKS.....



TAGS: free installer, installer for java application, easy way to create installer,java, jnlp, jar, easy installer, Create Installer, installation package, free software installer, free installation package,  create MSI

How to add NSIS plugin to Eclipse


Hi friends,


After lots and lots of search and comparison for the possibilities of automating installer development process for java product, I landed up on NSIS.
[you can find detailed use of it in HERE ]

Now to start dealing with it we need its integration with IDE, in order to simplify the work. [NSIS script work can be done with IDE but it is advised to use them].

The NSIS plugin is not pre-Installed with Eclipse standard setup. So to introduce it in Eclipse we need to do following steps.

Prerequisite:
  1.       Eclipse up and running [I am using eclipse LUNA]
  2.       Internet connection [ there is offline process of the same also ]
  3.      Check if the plugin is installed in IDE.
    •     Just go to File Menu --> New --> Other 
    •     If the EclipseNSIS is shown in the list displayed you don't need this tutorial ;) else move ahead. 




Step 1
Open Eclipse IDE goto

Help Menu --> install New Software

it will open the Install window as shown in below figure.

Now in this window you need to put up a url to get NSIS plugin 


at Work With : [field]

And click on the add button next to it. 



Step 2:

As you click Add update selection area will be populated with the list of all possible component provided. You need to select EclipseNSIS from the list.[here i have selected all possible option other than source code but its not a compulsion]. Then click on Next button




Step 3

Next you will see a confirmation page with respective details. Now click Next.


Step 4

Next is Accept the licence and agreement and click Finish button.


As we click on finish the process will start:
As installation processes completes, It will ask you to restart the IDE.

TA...DA...

Our plugin is ready.

You can easily verify the setup. Just goto File Menu --> New --> Other
In this window you will find the EclipseNSIS listed as shown below.


Now to get your hands dirty with NSIS. check this


Thursday 2 August 2012

Step by step guide for adding dynamic images from database to jasper report

Protected by Copyscape Originality Checker

Introduction

Reason we land-up here is to get answers to the question like:

  • How to add dynamic image from database in jasper report?
  • How to get image from database on to jasper report?
  • How to get image stored in bites to jasper report? 
  • etc ... 


Most of the time images are stored in database with predefined data type [binary, blob, Image]. Retrieving such images to the jasper report is one of the most common and confusing task encountered in dynamic reporting implementation process. Following article will provide you a guide to resolve this need with simple steps.   

Note: It is considered that user referring this document have basic knowledge of creating simple jasper reports with iReport tool.

So here we go:

Prerequisite:

  1. iReport 4.5.1
  2. Sql database with demo table
       Exa:
       User_Name -> [nvarchar]
       USer_Photo -> [Image]
         

Step 1: [ Create Blank Report ]

  • Open iReport tool [ i am using iReport version 4.5.1]
  • Go to File -> New
  • [ 1. Choose Template ]: In New File window select “Blank A4”(A) and click on “Lunch report wizard”(B) button

  • [ 2. Name and Location ]: Specify report name, Location to save on hard disk, Then click next.

  • [ 3. Query ]: At this step you need to provide Connection/data source(you an select from drop down list (A) OR can create new from "New" Button (B)). Then you need to specify the query which will be retrieving data from required table (Query can be written manually (C) OR can be crated with "Design Query" (D) wizard) and click next.

  • [ 4. Fields ] Select fields to be added in report (click ">>" (A)).Click next


  • [ 5. Group By...] you can use this section to group clause for your data,(it is optional for this demo) click next and then on new window click Finish.


Step 2: [ Field Configuration ]

  • After step 1 you will land-up in IDE with your report open in designer view. To the left you can see fields that you fetched from data base (A) and page design components(B).




  • As you know the User_Photo field is have data type Image in data base, Here while mapping iReport assign java.lang.Object class to it by default. As we want it to show image with image with image element present in iReport we have to change its field class to java.io.InputStream. [Now select User_Photo field go to window menu -> select Properties OR press ctrl+shift+7.]
  • Go to properties and change Field class to java.io.InputStream




Step 3: [ Design Report ]


  • Now drag and drop User_Name field from report inspector to Report designer view.






  • Similarly drag and drop Image and Static Text element from palette.[in case palette window is not there press ctrl+shift+8. While dropping image element it will show new window to select file, just click cancel ]




  • You can edit content in static text element and format it as per your need


  • Now select image element (A), go to property window to select Image expression (B).

  • Once you click button next to Image Expression, it will open new window. In new window bauble-click element which will provide data to display image [ here it will be "User_Photo"]. click OK

  • Select Image element go to properties and change expression class from java.lang.String to java.io.InputStream



Step 4: [ Test Report ]


  • Now click on preview tab to get report out-put 






  • And here you have it. Your 1st report with dynamic image data from database.
Enjoy....


Tag : jasper, ireport, jasper report, dynamic image from database, image from database, image from database in jasper report, image in report, .jasper, dynamic jasper report with image 

Protected by Copyscape Online Plagiarism Tool