Sending Message from PC through mobile using AT Commands over Bluetooth

AT Commands:              AT or attention are set of commands those are used to communicate with GSM modems.I am not going much about it as you can google it.I tried using the AT commands through Bluetooth  which was successful and finally integrated it to JAVA so that I can send message through my mobile using an interface instead of hyper-terminal.Before getting it started check your mobile if it supports the commands or not by using Hyper-terminal or any serial port Software.                In the below codes i have used RxTx serial…

Read More

Getting Facebook Access Token for JAVA applications

    When for the first time i used facebook API in my java application using the  library restFb i faced real trouble with the access token .For that i browsed a lot to get the token at last i was able.So to make it easy here are the steps to get the access token that is valid for 2 months. Step:1   First of all create a facebook application and goto the application page.goto tools and click on APIExplorer   in the menu as shown below select your application…  click on get…

Read More

Storing configuration data for JAVA applications

       Many times it is required to store some configuration settings for your application so that it can use again and again from where it left.Or the application can start with some specific parameters.So the properties file can come handy in such requirements.    First lets write something to the properties file.. Code: import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStream;import java.util.Properties;public class App {  public static void main(String[] args) {    Properties prop = new Properties();    OutputStream output = null;    try {        output = new FileOutputStream(“C:\Alberto\Config\debug.properties”);        prop.setProperty(“stat”,”no”);        prop.setProperty(“mail”, “oksbwn@gmail.com“);       …

Read More

Controlling VLC media player using JAVA

         Basically i was looking for a method to communicate with the VLC media player so that i can get the currently playing video on the player and my app can search the internet and get the details about the movie.For that i googled a lot and finally came to know that VLC has a web interface and i used that with my JAVA app to control and getting details of the movie.                     First open the VLC and goto tools->preferences and check the All radio button. and navigate…

Read More

Sending Email using JAVA mail API and gmail account

                Sending a mail using JAVA mail API in JAVA is really a easy part.Here i am posting the codes to simply send a mail using the API.First you have to download the JAVA mail library and add it to your build path. Code: package com.oksbwn.mail;import java.awt.Color;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import java.io.FileInputStream;import java.io.InputStream;import java.util.Properties;import javax.mail.*;import javax.mail.internet.*;import javax.swing.BorderFactory;import javax.swing.JButton;import javax.swing.JComponent;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextField;import javax.swing.JTextPane;import com.oksbwn.ErrorHandling.handleExceptions;import com.oksbwn.popUp.popMe;//import com.oksbwn.popUp.popMe;public class SendMail  extends JFrame {    final static JFrame frame = new JFrame();    private static final long serialVersionUID = 1L;    public void SendMailTo(){       //public static…

Read More

Show movie details using JAVA

   In this post i am going to post about using the anditson.com API to search for a movie online and display the results like a gallery as shown above using JAVA.anditson.com provides a good API which actually provides all data associated with a movie  in JSON or XML format.I have used the XML format.Here are the codes… Code to search online: import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList;public class movieDetails {    String Year;    String TORRENT;    String Plot;    String Language;    String Awards;    String Poster;    String imdbRating;    String tomatoConsensus;    String BoxOffice;    String…

Read More