Search

androidtour

Month

October 2015

Android NDK ( Native Developement Tools) Why ??? How ??? when ??? Where ???

The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++. Typically, good use cases for the NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation.

http://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html

http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/

http://code.tutsplus.com/tutorials/ndk-tutorial–mobile-2152

https://www.youtube.com/watch?v=YvCRlJToCAg&list=PL0C9C46CAAB1CFB2B

Protected: best Mokeup site for android

This content is password protected. To view it please enter your password below:

Android Latest Technology

https://developers.google.com/cardboard/overview

Finger Print API in Android Latest version

http://android-developers.blogspot.in/2015/10/new-in-android-samples-authenticating.html

How to Enable nexus phone as dubugger for android

D:\ANDROID 32 BIT\adt-bundle-windows-x86-20140702\sdk\extras\google\usb_driver\

Right click on android_winusb.inf and install it.

Then enable developer and debugger mode from android phone.

Link: http://michaelcrump.net/enable-usb-debugging-with-nexus-5-for-android-studio/

How to compapre two date in JAVA

– Return value is 0 if both dates are equal.
– Return value is greater than 0 , if Date is after the date argument.
– Return value is less than 0, if Date is before the date argument.

Date date1 = new Date();
Date date2 = new Date();

if(date1.before(date2)){
    //Do Something
}

if(date1.after(date2)){
    //Do Something else
}
Example:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        	Date date1 = sdf.parse("2009-12-31");
        	Date date2 = sdf.parse("2010-01-31");

        	System.out.println(sdf.format(date1));
        	System.out.println(sdf.format(date2));
        	
        	if(date1.compareTo(date2)>0){
        		System.out.println("Date1 is after Date2");
        	}else if(date1.compareTo(date2)<0){
        		System.out.println("Date1 is before Date2");
        	}else if(date1.compareTo(date2)==0){
        		System.out.println("Date1 is equal to Date2");
        	}else{
        		System.out.println("How to get here?");
        	}
Example :2

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        	Date date1 = sdf.parse("2009-12-31");
        	Date date2 = sdf.parse("2010-01-31");

        	System.out.println(sdf.format(date1));
        	System.out.println(sdf.format(date2));
        	
        	Calendar cal1 = Calendar.getInstance();
        	Calendar cal2 = Calendar.getInstance();
        	cal1.setTime(date1);
        	cal2.setTime(date2);
        	
        	if(cal1.after(cal2)){
        		System.out.println("Date1 is after Date2");
        	}
        	
        	if(cal1.before(cal2)){
        		System.out.println("Date1 is before Date2");
        	}
        	
        	if(cal1.equals(cal2)){
        		System.out.println("Date1 is equal Date2");
        	}

http://docs.oracle.com/javase/6/docs/api/java/util/Date.html#compareTo%28java.util.Date%29

			

Ubuntu Linux Unix

Ubuntu is a computer operating system based on the Debian Linux distribution and distributed as free and open source software, using its own desktop environment. It is named after the Southern African philosophy of ubuntu (“humanity towards others”). As of 2012, according to online surveys, Ubuntu is the most popular Linux distribution on desktop/laptop personal computers, and most Ubuntu coverage focuses on its use in that market.

Ubuntu is sponsored by the UK-based company Canonical Ltd., owned by South African entrepreneur Mark Shuttleworth. Canonical generates revenue by selling technical support and services related to Ubuntu, while the operating system itself is entirely free of charge.KrnDf

Unix was created in 1969 by Dennis Ritchie (also the creator of C programming language) & Ken Thompson

Slowly, an open operating system standardisation was thought of that led to the birth of POSIX (Portable Operating System Interface). The first POSIX standard was published in 1988

Then came 1991, when a college student in University of Helsinki decided to write his own operating system because he wanted a “powerful & Free Unix system“. His name was Linus Torvalds and he developed the 1st version of this new OS ( LINUX ) that was powered by Intel’s 80386 microprocessor (a 32 bit microprocessor launched in 1985)

Unlike other Unix systems, Linux is not a direct descendant of Unix source code. It implements Unix Application Programming Interface (API) defined by POSIX, but is classified as “Mostly POSIX-compliant” & not “Fully-POSIX compliant”

Difference between Unix and Linux

http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/

http://www.diffen.com/difference/Linux_vs_Unix

For Time Line,

http://futurist.se/gldt/

Watch this Video,

https://www.youtube.com/watch?v=GsHh2wfy_-4

JAVA Certified Cource Content

https://docs.oracle.com/javase/tutorial/extra/certification/javase-7-programmer1.html

Types of NOSQL (Important)

http://www.3pillarglobal.com/insights/exploring-the-different-types-of-nosql-databases

  1. Key-Value Store – It has a Big Hash Table of keys & values {Example- Riak, Amazon S3 (Dynamo)}
  2. Document-based Store- It stores documents made up of tagged elements. {Example- CouchDB}
  3. Column-based Store- Each storage block contains data from only one column, {Example- HBase, Cassandra}
  4. Graph-based-A network database that uses edges and nodes to represent and store data. {Example- Neo4J}

Six Important Types of Databases

http://www.yourarticlelibrary.com/database/database-six-important-types-of-databases-business-management/10375/

http://4840895.blogspot.in/2009/04/history-of-dbms.html

Internship

Comming Soon…..

Difference

  1. Apache tomcat server — Apache HTTP Server
  2. Server –Web server– Application Server –Database Server
  3. HTTP–HTTPS
  4. DBMS–RDBMS
  5. SQL–PL/SQL–NOSQL
  6. JSP–SERVLET
  7. Procedural Language–Object-oriented language
  8. JSON–GSON
  9. JQUERY–AQUERY–QUERY
  10. thread–asyntask

Best tutorial for learn Amazon webservices

http://meta-guide.com/videography/100-best-amazon-aws-tutorial-videos/

Best way to design good api

https://www.youtube.com/watch?v=aAb7hSCtvGw

Download Lecture PDF

[ Part 4 : Connection with Robomongo] MongoDB Development

Visit Previous Post Before visit this……

Step:1  Install Robomongo from any site

Step:2 Open Robomongo

 

Click on Create

ice_screenshot_20151012-194301

You can write any name:ice_screenshot_20151012-194333  You can add Username and Password also ( optional )

ice_screenshot_20151012-194349

Click on Connect

ice_screenshot_20151012-194435

This is your Database which you already create in Previous Post.

ice_screenshot_20151012-194521

ice_screenshot_20151012-194452

[Part 3 : Usefull Information ] MongoDB Development

In NOSQL Database we use different term of normal database scenario.

Example:

Table –> Collection

Tuple/Row –> Document

Column –> Field

 

[Part 2 : Command and Basic Practical]MongoDB Development

>show dbs    It will show the default Database.

Write this Statements

>a = { title:"Arrested Development", airdate:"November 2, 2003", network:"FOX" }
> b = { title:"Stella", airdate:"June 28, 2005", network:"Comedy Central" }
> c = { title:"Modern Family", airdate:"September 23, 2009", network:"ABC" }
db.<yourdatabase name>.save( varialbe ) : This command save the data.
>db.shows.save(a)
> db.shows.save(b)
> db.shows.save(c)
db.<yourdatabase name>.find() : Show your database content.
 >db.stats()
To get stats about mongodb server type the command db.stats() in mongodb client. This will show the database name, number of collection and documents in the database. 
>db :To check current database
>use <database name> : To take as your current database
>db.<yourdatabasename>.save( { “name”:”androidtour.wordpress.com” }  )
>db.<yourtablename>.insert( { “name”:”androidtour” } )
You can also Write direct:
>db.test.save( { a: 1 } )
>db.test.find()

[Part 1: Basic] MongoDB Developement

Step 1

First install node js

create one file in nodejs folder (node js installed folder) is hello.js

var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Hello World !’);
}).listen(8080, ‘127.0.0.1’);
console.log(‘Server running at http://127.0.0.1:8080/&#8217;);

Step:2 Install MongoDB from any site

After install go to path C:\Program Files\MongoDB 2.6 Standard\bin

First Step is to set your DB path

Write command mongod.exe –dbpath write your path of your db folder

For go to mongo shell

write command mongo.exe in bin directory.

Note: Make sure all CMD must be open otherwise it will lost Connection.

Can we create static class at top level in JAVA???

Answer is :No

Outer classes cannot be static, but nested/inner classes can be. That basically helps you to use the nested/inner class without creating an instance of the outer class. Java has static methods that are associated with classes (e.g. java.lang.Math has only static methods), but the class itself is not static.

If you want to add static class functionality to top level class then follow below steps:

Java has static nested classes but it sounds like you’re looking for a top-level static class. Java has no way of making a top-level class static but you can simulate a static class like this:

  • Declare your class final – Prevents extension of the class since extending a static class makes no sense
  • Make the constructor private – Prevents instantiation by client code as it makes no sense to instantiate a static class
  • Make all the members and functions of the class static – Since the class cannot be instantiated no instance methods can be called or instance fields accessed
  • Note that the compiler will not prevent you from declaring an instance (non-static) member. The issue will only show up if you attempt to call the instance member.
public class TestMyStaticClass {
     public static void main(String []args){
        MyStaticClass.setMyStaticMember(5);
        System.out.println("Static value: " + MyStaticClass.getMyStaticMember());
        System.out.println("Value squared: " + MyStaticClass.squareMyStaticMember());
        // MyStaticClass x = new MyStaticClass(); // results in compile time error
     }
}

// A top-level Java class mimicking static class behavior
public final class MyStaticClass {
    private MyStaticClass () { // private constructor
        myStaticMember = 1;
    }
    private static int myStaticMember;
    public static void setMyStaticMember(int val) {
        myStaticMember = val;
    }
    public static int getMyStaticMember() {
        return myStaticMember;
    }
    public static int squareMyStaticMember() {
        return myStaticMember * myStaticMember;
    }
}

What good are static classes? 
A good use of a static class is in defining one-off, utility and/or library classes where instantiation would not make sense. A great example is the Math class that contains some mathematical constants such as PI and E and simply provides mathematical calculations. 

Usefull site for Android Developer

For create online app in any platform

https://appery.io/

For create mokeup
https://developer.android.com/distribute/tools/promote/device-art.html

https://developer.android.com/training/location/index.html

https://blog.profitbricks.com/top-29-mockup-and-wireframing-tools-for-developers/

Subject and link for Interview of Computer Engineering

————–For beginner/fresher—————

C Basic

Simple Program logic

Pointer

Structure

JAVA

SQL

http://www.studytonight.com/dbms/

PL/SQL

DataStructure

DBMS

http://blog.sqlauthority.com/sql-server-interview-questions-and-answers/

Algorithm

http://www.programcreek.com/2012/11/top-10-algorithms-for-coding-interview/

For understand algorithm basic

http://gonitsora.com/algorithm-types-and-classification/

JDBC

JSP

Servlet

JAVAbeans

Android Architecture

Android Basic

—————–Some advanced topic for JAVA developer———————

Object-oriented design in terms of Programming

Dependency Injection

Scalability in Programs

 

 

 

Dependency Injection in Object Oriented Programming

https://www.objc.io/issues/11-android/dependency-injection-in-java/

http://www.journaldev.com/2394/dependency-injection-design-pattern-in-java-example-tutorial

http://www.vogella.com/tutorials/DependencyInjection/article.html

http://www.javacreed.com/why-should-we-use-dependency-injection/

Best site for learn free cyber security

https://www.cybrary.it/

How to convert Arraylist to String array

dat is the arraylist object

String [ ] data = dat.toArray( new String[dat.size()]);

One of Best site for learn computer technology and practical example

http://slogix.in/project-titles-in-mobile-apps/index.html

http://slogix.in/project-titles-in-big-data/index.html

Step after Install JDK [java]

For setup JAVA Environment in your System

Install JDK from oracle

goto your installed java directory

copy the path : C:/programfile/java/jdk(versionname)/bin

Open environment variable setup menu from Computer Properties

In second Box click New and write name as JAVA_HOME and Copy this path without /bin

In PATH:  append this link with /bin

 

 

Program in JAVA for remove null production from CFG

NULL.txt

S@ABAC
A@aA/#
B@bB/#
C@c

 

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cd;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;

/**
*
* @author soham
*/
public class null_removal {

static class OutputPrint {

void print() {
System.out.println();
}

void print(String msg) {
System.out.print(msg);
}

void print(Character c) {
System.out.println(c);
}

void print(StringBuilder c) {
System.out.println(c);
}

}

public static void main(String[] args) throws FileNotFoundException, IOException {
OutputPrint op = new OutputPrint();

byte[] datainBytes;
try (DataInputStream dis = new DataInputStream(new FileInputStream(“file/null.txt”))) {
datainBytes = new byte[dis.available()];
dis.readFully(datainBytes);
}
String content = new String(datainBytes, 0, datainBytes.length);
String input = content;
//Split data as per new line
String lines[] = input.split(“\\r?\\n”);
StringBuilder[] sb = new StringBuilder[lines.length];
//Store data in StringBuilder
for (int i = 0; i < lines.length; i++) {
sb[i] = new StringBuilder(“”);

char cm[] = lines[i].toCharArray();
for (int z = 0; z < cm.length; z++) {
if (cm[z] == ‘#’) {
sb[i].deleteCharAt(z – 1);
} else {
sb[i].append(cm[z]);
}
}
//op.print(sb[i]+”\n”);
}
//Store nonterminal which contain null in production
MyStack theStack = new MyStack(10);
for (String lin : lines) {
//op.print(lin);
if (lin.contains(“/”)) {

String[] bits = lin.split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
String production[] = second.split(“/”);
for (String pro : production) {
add_null(pro, theStack, first);
}
} else {
String[] bits = lin.split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
add_null(second, theStack, first);
}
}
//loop until stack not empty
while (!theStack.isEmpty()) {
Character value = theStack.pop();
//op.print(“Pop Character ” + value);
int k = 0;
for (StringBuilder pro : sb) {
printOutput(pro, op, value, sb, k);
k++;
}
op.print();
}
for (StringBuilder d : sb) {
op.print(d.toString() + “\n”);
}
}
//Ending Main Code , Method Implementation Start now

//for push non terminal which contain null
public static void add_null(String pro, MyStack theStack, String first) {
//op.print(first, pro);
if (pro.equals(“#”)) {
//op.print(“Found Null”);
theStack.push(first.charAt(0));
}
}

//Method for process and replace the RHS of production
public static void printOutput(StringBuilder pro, OutputPrint op, Character value, StringBuilder[] sb, int k) {
int q = k;
String[] bits = pro.toString().split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
StringBuilder h = new StringBuilder();
//op.print(“Second “+second+”\n”);
if (second.contains(“/”)) {
String production[] = second.split(“/”);
int r = 0;
ArrayList<Integer> number = new ArrayList<>();
for (String sec : production) {
char ch[] = sec.toCharArray();
//for two or more character value
for (int l = 0; l < ch.length; l++) {
if (ch[l] == value) {
r++;
number.add(l);
}
}
//      op.print(“Total Number of ch “+r+”\n”);
if (r > 1) {
for (int l = 0; l < r; l++) {
for (int j = 0; j < sec.length(); j++) {

if (j == number.get(l)) {

} else {
h.append(ch[j]);
//            op.print(“Append Ch “+ch[j]+”\n”);
}
}

appendString(sb, q, h, op);
if (l == r – 1) {
for (int j = 0; j < sec.length(); j++) {
if (ch[j] == value) {
} else {
h.append(ch[j]);
// op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
}
}
} else {
if (sec.contains(String.valueOf(value))) {
for (int j = 0; j < sec.length(); j++) {
if (ch[j] == ‘#’ || ch[j] == ‘/’ || ch[j] == value) {
} else {
h.append(ch[j]);
//op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
}
}
r = 0;
number.removeAll(number);
}
q++;
} else {
if (second.contains(String.valueOf(value))) {
for (int j = 0; j < second.length(); j++) {
char ch[] = second.toCharArray();
if (ch[j] == ‘#’ || ch[j] == ‘/’ || ch[j] == value) {
} else {
h.append(ch[j]);
//       op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
} else {
//   op.print(sb[q]);
}
}
}

//function for append the String
public static void appendString(StringBuilder[] sb, int q, StringBuilder h, OutputPrint op) {
// sb[k].append(“/”);
sb[q].append(“/” + h);
h.delete(0, h.length());
// op.print(sb[q]);
}

//Method for Stack
public static class MyStack {

private final int maxSize;
private final Character[] stackArray;
private int top;

public MyStack(int s) {
maxSize = s;
stackArray = new Character[maxSize];
top = -1;
}

public void push(Character j) {
stackArray[++top] = j;
}

public Character pop() {
return stackArray[top–];
}

public Character peek() {
return stackArray[top];
}

public boolean isEmpty() {
return (top == -1);
}

public boolean isFull() {
return (top == maxSize – 1);
}

}
}

android_framework_details

More Detail Comming Soon…..

Design Pattern in JAVA

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code.

http://www.journaldev.com/1827/java-design-patterns-example-tutorial

http://www.newthinktank.com/videos/design-patterns-tutorial/

http://www.newthinktank.com/category/web-design/android-development-tutorial/page/8/

Create a free website or blog at WordPress.com.

Up ↑