AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


     We can easy to extract the timezone from current system time using javascript by the following code.


     In the following example we are going see about the webview and load some html code into the newly created webview in android, in the previous post we are seen about creating the webview and load the url into that webview


If you don't know how to create webview in android studio please click here

Code for load html code directly to webview
String html = "<html><body>This is the test webview</body></html>";
String mime = "text/html";
String encoding = "utf-8";


     In this tutorial we are going to learn about the android button and place a image on that button and give images on every states (pressed,focused and normal).

1) First create a new project in android studio more details...

     In the following javascript code is used to create the html img tag dynamically and append it to the specified div in a loop.

Create Image tag using javacript
     Usually we are directly create the html tag in the html code, but if you want to create this img tag dynamically you can follow the below code.


   var img = document.createElement("img");
   img.src = "http://www.google.com/intl/en_com/images/logo_plain.png";

   var src = document.getElementById("elementid");
   src.appendChild(img);


Set multiple images in a loop
     If you want to add only one image, you can follow the above method. If you want to append more images dynamically you can follow the below method.



Example Program:- (Editor)


Editor is Loading...

Advertisement

     Webview is a tool in android studio and it is used to load html or website to mobile, through this we can easy to create the android application through html,css and javascript code.

1) First create a new project in android studio more details...

1) Open Android studio, then find the File option from the menu bar and go to New => New Project.





2) Now one new dialog box is open and ask the project details Application name, Company Domain and project location.

Application name
     No need to enter unique name compare with playstore, this name is displayed under the application icon.


Application name for android project
Company Domain
     It must be unique compare between the google play store (If you created the name and the same name already in playstore it won't show any error message, but in publishing time it will show a error).


Unique id in play store


Project Location
     It will automatically take the previous project path, if you want the same path no need to change it, or you can change.

Application directory

3) Then press Next button
     In this window select the minimum target SDK ,wear, TV, and Android auto.

Minimum SDK
     Here you can select the minimum required android os version.

Choose Minimum SDK target version

Wear
     This mean is this application support wearable android device or not (If yes then check or uncheck it).

Wearable android device or not

Wearable device

Android TV
     It will indicate this application is applicable for Android TV.

Android TV android studio

Android tv os

Android auto
Android auto



4) Click next in this dialog box, you can find some template, if you want any templates from there you can select otherwise select "Blank Activity".

Blank Activity in android studio new project

5) Click next and enter the activity name, layout name, title and menu resource name, you can change it or leave it and just press finish button.

Final of the new project window

 6) Click Finish. Now you can write your code here.










If you want to set the SDK path  directly you can set it to in local.properties like below

sdk.dir=D\:\\Program Files\\Android Studio\\SDK




If you want to set the NDK path  directly you can set it to in local.properties like below
ndk.dir=C\:\\android-ndk-r12b-windows-x86\\android-ndk-r12b

NDK directory set in local.properties


We can set the path by selecting folder by using the below method. After open the android studio press Ctrl+Shift+Alt+S


Select NDK SDK and JDK directly from tools




     Usually the identity field does not allow the user to edit, when you right click on the table and select Edit.







     But we can edit edit this column through query. Through query we can temporary on the identity insert. Remember after edit the column you should off it, if not you cannot able to edit the identity field on other tables.

Example
SET IDENTITY_INSERT Table_Name ON

   INSERT Table_Name(IdentityColumnName, Col1,Col2) VALUES (54,value1,value2)

SET IDENTITY_INSERT Table_Name OFF





     Some situation user need to trigger the postback dynamically from client side using javascript or jQuery. In this situation you can follow this method.

Asp Button

<asp:Button ID="dmypbbtn" runat="server" OnClick="dmycall" style="display:none;" />
javascript code

document.getElementById("<%=dmypbbtn.ClientID%>").click();
jQuery Code

$("#<%=dmypbbtn.ClientID%>").trigger('Click');

     When you trigger the click function like the above format, the server side dmycall method will call with serverside postback.
     We can pass the argument to onclick serverside function using CommandArgument attribute like below.

Asp Code

   <asp:Button id="bid" CommandArgument="456" runat="server" OnClick="passvalue" />

serverside code (.cs)

    protected void passvalue(object sender, EventArgs e)
    {
        LinkButton btn = (LinkButton)(sender);
        String testval = btn.CommandArgument; //Returns 456
    }

Total Pageviews