Sunday, June 30, 2019

Is Future looking promising for JavaScript?

TC39 committee that oversees ECMA script is updating JavaScript at moment that means we can expect ES2019 around Q2/Q3 2019 with new feature and specially the introduction of Web Assembly, which can become game changer and increase the capability to unimaginable height.
Web Assembly is just binary format that are low-level language that can deliver high-performance application to the web, this can bring good amount of influence on the future of the JavaScript language.

To understand how massive the JavaScript involved we need to look at the historical success of the JavaScript, according to me major success came from three different mile stones.
  1. Ajax : 

  2. This set the stage for single page application for the future, around 1997, Microsoft was contributing big amount of effort to ECMAScript but mostly play their own rules. And Yes, Ajax is introduced by the Microsoft. Prior to Winter 1999 web application were based on complete HTML pages. Each user action required that a completely new page be loaded from the server. This process was so inefficient, all page content disappeared, then the new page appeared. Each time the browser reloaded a page because of a partial change, all the content had to be re-sent, even though only some of the information had changed. This placed an additional load on the server and made bandwidth a limiting factor on performance. Ajax became as Hero to this solution.
2. jQuery : Yes, I know you will ask Why jQuery can become a JavaScript’s success milestone? Let me make you realize, around mid-2006 developers were facing big challenges related to cross-browser compatibility. jQuery came as a solution for this problem. It was a nightmare for the web developer at that time.
Signature feature of jQuery — selector engine (named as “Sizzle”), that introduced new way of DOM element selection and traversal.
The best part it enables developer to create their own plugins on top this library where developer create abstraction for different kind of solution, brings modularity which allow creation of theme-able widget.
Today jQuery is used everywhere you will hardly find any web page without it. More than 80 % of the web application uses jQuery library around the globe.
3. V8 :With the release of Google Chrome and v8 engine both were release at the same time, completely changes the way JavaScript was compiled and interpreted making it a viable option for running high performance application in the browser and server side.
JavaScript started with primary purpose of creating dynamic and interactive experience to the web application but today it broke the boundary, came out of the browser environment and become server scripting language where you can write real-time web application and scale well. This in turn made possible for developers to build their entire application stack with a single programming language.
In 2007, Jeff Atwood (co-founder of StackOverflow) made a quote:
“Any application that can be written in JavaScript, will eventually be written in JavaScript.”

Not only that, this is an era of AR and VR, which demands high performance processing capability to render 3D world to human eye or may be image processing.Here what ECMA 2019 going to bring Web Assembly as standard to the browser which can enable these capabilities right in your browser.
Let’s sit tight wait for ECMA Script 2019 to do their magic!

Wednesday, August 3, 2011

First Step to android!

ok! to get start with android you have the following things on your windows machine!
1. android SDK with certain library installed in it! that you can download from developer.android.com
and procedure for downloading lib. i will explain it later!

2. Eclipse basic version!

3.ADT plugin ! get a latest plugin

4. internet connection is must during first few stages of installation only!

Installation procedure
1. Extract the content of SDK , u will find SDK manager.exe (mind it u should have internet connection during this following phase), then let the program fetch certain information from the internet..... wait a while! after a certain moment you will get this




check android SDK platform tools and
SDK platform android 2.2
thats our only requirement currently! rest you can download like sample examples tat contain source codes of google sample application like bluetooth chat, games ,etc!

after this !

Note: during following process remove your internet cable or connection or u can say disable internet! otherwise it can cause certain errors!
open the Eclipse Go to Help-->Click on Install new software -->click on ADD --> name any thing like "android plugin"
the select archive and locate ADT plugin.zip


ok! now after your plugin get installed in your eclipse restart the Eclipse program!
after restart our next step is let the eclipse know where is the android sdk, so for tat Select Preference in window main menu of the Eclipse. click on android at left corner, locate the android SDK there!



now next step is we have to create android emulator ! so tat we can run and debug our programs!
select windows in eclipse main menu and click on android SDK and AVD manager there open virtual device and click on create AVD manager create emulator the way u want!

Installation process completed!







Sunday, July 31, 2011

How to persist the Dialog Box even after the Screen Orientation Change Android

I have read many articles about serious problem with dialog box that get disappear after screen orientation changes ! Actually the reason for the disappearance , when the screen orientation changes the Android sys. refresh the activity causing restart of activity class! But I have a solution for that hope u enjoy the matter!
Save state concept is used here, with android activity's override methods called
  1. Override the onRetainNonConfigurationInstance() method to return the Object you would like to retain.
  2. When your Activity is created again, call getLastNonConfigurationInstance() to recover your Object.
thats
public Object onRetainNonConfigurationInstance() {
final MyDataObject data = collectMyLoadedData();
return data;
}
This following lines should be declared in the on create method to get the state of the activity.  final MyDataObject data = (MyDataObject) getLastNonConfigurationInstance();
if (data == null) {
data
= loadMyData();
}
I am posting the code Hope U understand more clear......
code having two layout file main.xml contain only one button  and second Layout file name contain two EDITTEXT and one button  http://developer.android.com/guide/topics/resources/runtime-changes.html      this is from where i got the info.... if u want to know more about this issue....  

package in.ultraneo.savestate;

import java.security.PublicKey;

import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SavestateinandroidActivity extends Activity {
/** Called when the activity is first created. */
Button btn1;
Button btn2;
EditText edit1,edit2;
String DIALOGSTATUS="0";
String restore = "";
CustomizeDialog custo;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btn1 = (Button)findViewById(R.id.button1);
MyDataObject data = (MyDataObject) getLastNonConfigurationInstance();
if (data == null) {
data = loadMyData();
new Toast(this).makeText(this, "there is no data",Toast.LENGTH_SHORT).show();
custo = new CustomizeDialog(this, R.layout.dialogstate);
DIALOGSTATUS="0";
edit1 = (EditText)custo.findViewById(R.id.editText1);
edit1.setText("");
edit2 = (EditText)custo.findViewById(R.id.editText2);
edit2.setText("");
btn2 = (Button)custo.findViewById(R.id.button1);
} else {
if(data.string3=="1")
{
DIALOGSTATUS="1";
restore = "1";
custo = new CustomizeDialog(this, R.layout.dialogstate);
edit1 = (EditText)custo.findViewById(R.id.editText1);
edit2 = (EditText)custo.findViewById(R.id.editText2);
edit1.setText(data.string1);
edit2.setText(data.string2);
custo.show();
}
}
custo.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
DIALOGSTATUS="1";
new Toast(getBaseContext()).makeText(getBaseContext(),"Show", 1000).show();
}
});
custo.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
DIALOGSTATUS="0";
edit1.setText("");
edit2.setText("");
restore ="0";
new Toast(getBaseContext()).makeText(getBaseContext(),"Dism", 1000).show();
}
});
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
restore = "1";
custo.show();
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
custo.dismiss();
}
});
}
});
}
private MyDataObject loadMyData() {
MyDataObject da = new MyDataObject();
return da;
}

public Object onRetainNonConfigurationInstance() {
final MyDataObject data = collectMyLoadedData();
return data;
}

private MyDataObject collectMyLoadedData() {
if(restore.equals("1")){
MyDataObject da = new MyDataObject();
da.string1 = edit1.getText().toString();
da.string2 = edit2.getText().toString();
da.string3 = DIALOGSTATUS;
return da;
}else
{
return null;
}
}

}






********************
package in.ultraneo.savestate;

public class MyDataObject {
String string1;
String string2;
String string3;
public MyDataObject loadMyData()
{
return this;
}

}