Monday, 2 October 2017

Why Blackberry phones quitted ?

BlackBerry was once the phone of choice for Wall Street traders, politicians and celebrities, thanks in part to its well-regarded security system. President Obama was spotted with a BlackBerry. So was Kim Kardashian West. But the company was too late to the touchscreen game, and customers left in droves for Apple's(AAPL, Tech30) iPhone, Samsung's (SSNLF) Galaxy and other devices running on Google's(GOOGL, Tech30) Android system. Even Microsoft (MSFT, Tech30) has moved ahead of BlackBerry with its Windows Phones.

Read some key facts to decline in Blackberry users :-

1. Blackberry was only a communication system

The popularity of BlackBerry Messenger and its high-tech email system made its phones a smash hit among young users and professionals alike, but Apple's iPhone and Google's Android software, with millions of apps and full touchscreens, rendered them obsolete.

Blackberry saw mobile phones as just communication devices when ios and android turned mobile phones into entertainment hubs. It didn't produce touch screen mobiles until its too late. It has very less number of apps when compared to ios/android. Finally, lack of progressing in software and wrong marketing strategy brought down blackberry's popularity.

The company, which is famed for its "Qwerty" keyboard mobile phones that were the choice handset for professionals, has been struggling to keep up with market leaders Apple and Samsung as the world has moved to touchscreens.

2. Support of popular application was stopped for Blackberry.

BlackBerry suffered the embarrassment of having the world's most popular messaging app – WhatsApp – drop support for its BlackBerry OS earlier this year. Facebook and its Messenger app soon followed suit and stopped working on BlackBerry OS, including the most recent – BB10, by the end of the year.

3. App support was low.

No developer wants to develop for BlackBerry.
It used to be a badge of honor to be able to carry BlackBerrys and now it’s almost a shame,” he
said. “People look at it like it’s a dinosaur, a museum piece.”

4. Some technical issues that distract the users to quit the Blackberry

On social media sites, some BlackBerry users said they were so upset about the outage -- the largest in the company's history -- that they were switching to Apple iOS and Google Android devices. And customer satisfaction with BlackBerry already was low.

This is not to say that Androids and iPhones never experience network outages. But they wouldn't be global. And they would be the responsibility of a particular wireless carrier -- AT&T, Sprint, Verizon and T-Mobile -- or a particular messaging system, like Gmail, Hotmail or iMessage, Apple's new in-house messaging service. Not the maker of the phone.

"All the stuff goes through them for some form or fashion," Nan Palmero, a writer for the site BlackBerryCool.com, said of the way BlackBerry handles messages and e-mail. That makes it possible, he said, for the global BlackBerry network to crash, which wouldn't be the case for iPhones or Androids.

There's no such thing as a good time for RIM to leave half its customers without messaging or internet. But the problem's been getting worse, not better—on the day that Apple makes its strongest case for total dominance.

RIM's biggest advantage was its push email and BlackBerry Messenger service. Now just about every smartphone platform has push email (in some form) and Apple's new iMessage is gunning for BBM. BlackBerry OS 7 is already behind, and it's not even out yet. Just look at the voice control and navigation built into Android.

See also some strories about Blackberry in figures to quit.

As a result, the loss-making business said it is going to focus on creating software for mobile phones, rather than the devices themselves. Instead, it will outsource the brand to other manufacturers.








What Blackberry report says about quitting the smartphone manufacturing.

CEO John Chen announced the new strategy as part of the Canadian company's Fiscal Q2
2017 report. As Chen explained in the report:

"Under this strategy, we are focusing on software development, including security and applications. The company plans to end all internal hardware development and will outsource that function to partners. This allows us to reduce capital requirements and enhance
return on invested capital."

It has no stated plans for another BB10 phone and is accelerating a pivot to handsets running Google’s Android.

References:-
http://www.telegraph.co.uk/technology/2016/09/28/blackberry-to-stop-making-phones/
https://www.forbes.com/sites/ewanspence/2016/09/28/blackberry-exits-smartphone-manufacturing/#7aa541c769b7
http://money.cnn.com/2016/09/28/technology/blackberry-outsource-phones/index.html
http://edition.cnn.com/2011/10/13/tech/mobile/blackberry-servers-android-iphone/index.html

Wednesday, 27 September 2017

Validation on the Select input type element of a form in HTML5

Validation is an important part of any web application or website. In HTML5 validation is very simple then earlier. HTML5 provides very simple and efficient way to validate any form.

In HTML5 "required" is the keyword to put in any form element to check, whether it has been chosen/selected/entered or not.

For validating a input type, we just have to use "required" keyword to check null value. See below-

   <input name="arvind" type="text"  required>



It is very simple in text input type. But it is not so in select input type.

Let see, how we implement in select in put type. Mechanism is similar but it require some more manipulation in select element.

To use it in select input type, we have to put the some  value in all option of select input and first/top option value should be blank. 

Let see below-

 <select name="dept" required class="form-control">
             <option value="">Select Department</option>
             <option value="Bio-Informatics">Bio-Informatics</option>
              <option value="Bioscience & Biotechnology">Bioscience & Biotechnology</option>
              <option value="Chemical Engineering">Chemical Engineering</option>

  </select>




Enjoy happy coding.

Wednesday, 20 September 2017

How to install Webmin tool in Ubuntu 16.04

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. 


Note: I have used Ubuntu 16.04 running on Real Machine to run all of the experiments
Add the Webmin repository so that You can easily install and update Webmin using our package manager. I do this by adding the repository to the /etc/apt/sources.list file.
Type command in terminal -

sudo nano /etc/apt/sources.list

You will get sources.list file in nano editor

and then add this line to the bottom of the file to add the new repository:
deb http://download.webmin.com/download/repository sarge contrib


then pressed ctrl+o to save the file and ctrl+w to exit.
Now add the Webmin PGP key so that your system will trust the new repository:
 run this command on terminal-
wget http://www.webmin.com/jcameron-key.asc

then
sudo apt-key add jcameron-key.asc

after getting ok signal from command I updated the list of repository to include Webmin repositery
sudo apt-get update
Then I Installed the Webmin using command in terminal
sudo apt-get install webmin

after using this command I again stuck on previously faced dependencies problem.
as suggested by system I used command-
sudo apt-get -f install

Finally I installed the Webmin as confirmed by terminal.

Now I tried to open it on browser I got SSL error

(Sorry to not capture the screen) add the exception to the browser and  get the login screen



After login I got the dashboard like-


Now all you system administration is on web based.

Friday, 24 March 2017

Send mail in JSP/Java using SMTP gmail

Sending mail in web applications are very useful tool. In this blog I will discus how to send e-mail using gmail SMTP.

Pre-requisite of mail sending programme:-

I presume that you have good knowledge of running a web application on Java server like Apache Tomcat or Glassfish etc.

You require following API to implement sending mail in Java-

  1. mail.jar- this file can be downloaded from here.
  2. activation.jar- this file can be downloaded from here.
  3. Or mail api from here.

So, download these and add it to your project. How to add external Jar file to a project see here.

Create a form to send mail:-

mail.html
<form name="emailForm" action="sendmail.jsp" method="post">
<table>
<tr><td><b><font color="red">To:
</td>
<td><b><b><input type="text" name="mail" placeholder="Enter sender mail-id"/><br/>
</td>
</tr>
<tr>
<td>
<b><font color="red">Subject:
</td>
<td>
<input type="text" name="sub" placeholder="Enter Subject Line"><br/>
</td>
</tr>
<tr>
<td>
<b><font color="red">Message Text:
</td>
<td>
<textarea rows="12" cols="80" name="mess"></textarea><br/>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Send" name="btn1">
</td>
<td>
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>

Java Code to send mail:-

sendmail.jsp

Import these packages in your send mail Java Code

<%@ page import="java.util.*,javax.mail.*"%>
<%@ page import="javax.mail.internet.*" %>
<%@ page import="javax.activation.*" %>

if (request.getParameter("btn1") != null)
{
//Creating a result for getting status that messsage is delivered or not!
String result;

// Get recipient's email-ID, message & subject-line from mail.html page
final String to = request.getParameter("mail");
final String subject = request.getParameter("sub");
final String messg = request.getParameter("mess");
// Sender's email ID and password needs to be mentioned
final String from = "sender-mail@gmail.com";
final String pass = "sendermailpassword";
// Defining the gmail host
String host = "smtp.gmail.com";
// Creating Properties object
Properties props = new Properties();
// Defining properties
props.put("mail.smtp.ssl.enable","true");
props.put("mail.smtp.host", host);
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.user", from);
props.put("mail.password", pass);
props.put("mail.port", "587"); // there are some other ports also available like 465 you can also use.
// Authorized the Session object.
Session mailSession = Session.getInstance(props, new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(from, pass);
}
});
try {
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(mailSession);

// Set From: header field of the header.
message.setFrom(new InternetAddress(from));

// Set To: header field of the header.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

// Set Subject: header field
message.setSubject(subject);

// Now set the actual message
message.setText(messg);

// Send message
Transport.send(message);
result = "Your mail sent successfully....";
out.println(result);
} catch (MessagingException mex) {
mex.printStackTrace();
result = "Error: unable to send mail....";
out.println(mex);
out.println(result);}
}


If everything goes fine then you will be able to successfully send mail.

1. Apart from above you may also require to set your gmail account to allow less secure app to use your account. You may check it from here.


2. Some common mistakes can be find from here.

3. Some other help that may help you.

How to add external jar file in your project in Netbeans

Many times when we work on a project, we require third-party API or external jar file for some purpose in our project. And we stuck on how to add these external jar file in project.

Here I tell you how to add external jar file in our project in Netbeans IDE.

Open Netbeans IDE and go to Projects explorer in left pane of your IDE. And right click on your project in which you want to add jar file.

Then go to Properties and click on it.


A dialogue window will open. Again in left of window under Categories heading go to Libraries  click on it and in right of the window you will see Add Jar/Folder button, click this and select you file/jar. It is Done.




Tuesday, 7 March 2017

Applying html tags & CSS on JLabel text in Java Swing.

Generally there is a limitation on JLabel text formatting in swing. We can not apply some formatting in JLabel text.
Like:-

Applying bullets in text.
Write text in new line.
Making any text bold.

and may more you can try.

We can only change size, font and style of text using Netbeans or any IDE. But applying HTML tags in JLabel text, we can do more in text formatting.

Let's see how?

If you are using no IDE then use code like:-

jLabel18.setText("<html>
<p>\n
<ul style=\"list-style-type:square\">\n
<li> Users shall not play computer games on computers unless authorised by an authority.</li>\n
<li> Users shall not interfere or tamper with software configurations or any system data files.</li>\n
<li> Users shall not access or in any way alter another user`s files without authorisation.</li>\n
<li> Users shall not make use of computers to access or copy/playing any computer games, viruses, movies and music for personal use.</li>\n
<li> Do not run programs that continue to execute after you log off.</li>\n
<li><strong> Users must back up (e.g.  on Pen Drive, Mail, Cloud etc) her data after each system use.</strong></li> \n
<li>There is no responsibility of University of the user’s data to be stolen, deleted or modified.</li>\n
<li> Downloading or installing programs on the hard drives is strictly prohibited without permission.</li>\n
<li> Do not use the computer for playing music or watching movies.</li> 
</p>
</html>");

output of this code will be:-

If you are using Netbeans then:-

Right Click on JLabel and Select Properties



In Properties select text


Press ok.

Now it is done.

Thursday, 2 February 2017

How to create a Splash Screen in Java Swing.

Splash screen is window, which is displayed during an application startup. Many programs display such a screen, possibly containing copyright information, resource loading status, etc. Splash screen can not be moved or closed normally. It can only be closed or moved programmatically. Most seen splash screen by java user is Netbeans splash screen.

It is very easy to create a splash screen in java using JWindow.

Here is the complete example.

import javax.swing.*;
import java.awt.*;
public class Splash {
 public static void main(String[] args) {

 // Throw a nice little title page up on the screen first

 showSplash(20000);
 System.exit(0); // replace with application code!
 }
 // A simple little method to show a title screen in the
 // center of the screen for a given amount of time.

 public static void showSplash(int duration) {
JWindow splash = new JWindow();
 JPanel content = (JPanel)splash.getContentPane();

 // set the window's bounds, centering the window

 int width = 240;
 int height = 120;
 Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
 int x = (screen.width-width)/2;
 int y = (screen.height-height)/2;
 splash.setBounds(x,y,width,height);

 // build the splash screen

 JLabel label = new JLabel(new ImageIcon("picture069.jpg"));
 JLabel copyrt = new JLabel
 ("Copyright 1998, PussinToast Inc.", JLabel.CENTER);
 copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 12));
 content.add(label, BorderLayout.CENTER);
 content.add(copyrt, BorderLayout.SOUTH);
 content.setBorder(BorderFactory.createLineBorder(Color.red, 10));

 // display it

 splash.setVisible(true);

 // Wait a little while, maybe while loading resources

 try { Thread.sleep(duration); } catch (Exception e) {}
 splash.setVisible(false);
 }
}

Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...