Skip to main content

Posts

Getting started with IBM worklight Mobile App In Eclipse using Ionic / Angularjs

Install Eclipse and add IBM MobileFirst Platform Studio 7.1.0 .  You can follow the following steps : Goto Help > > Eclipse Market Place >> and search for IBM MobileFirst Platform Studio 7.1.0 . and u can add and install thet plugin and get started with ionic - angular app development. You can start the new project and so can add your Environment needed and start development. After creating the sample project you can add ionic bundle folder inside your application so that you get all the necessary features of ionic development. Details and other way of installation is explained here  

Simple Validation in JavaScript:

Javascript can have simple validations and such an example is given below. Download and use the code. <html> <head> </head> <body> Input numbers between 0 and 5 Submit </body> </html> functions.js function validate() { var x, text; x = document.getElementById("numb").value; if(isNaN(x) || x < 1 || x > 5) { text = "Input not valid"; }else { text = "Input OK"; } document.getElementById("show").innerHTML = text; }

Dialog Boxes in JavaScript

Alert Dialog Box: An alert dialog box is mostly used to give a warning message to the users.Mostly they gives only an "Ok button". Confirmation Dialog Box: A confirmation dialog box is mostly used to take user's consent on any option. It displays a dialog box with two buttons mostly "ok" and "cancel" Prompt Dialog Box: The prompt dialog box is very useful when you want to pop-up a text box to get user input. Thus, it enables you to interact with the user. The user needs to fill in the field and then click OK. If the user clicks the Cancel button, the window method prompt() returns null. <html> <head> </head> <body> Show an Alert Dialog Box Show alert Show a Confirmation Dialog Box Show alert Prompt Dialog Box </body> </html> functions.js: function showalert1(){ alert("Iam an alert") } function showalert2(){ confirm("Iam an alert") } function getValue() ...

Calling a script from an external file

We Can just recall the previous example of image switching to understand how to call script externally.  Let's have a look. <html> <head> </head> <body> click on the image </body> </html> Using the tag <script type="text/javascript" src="functions.js"> </script> we can call the script externally. Always write script in file with extension ".js". functions.js: function imageswitch(){ var image = document.getElementById('switchimage'); if(image.src.match("one")) { image.src = "flower_two.jpg"; } else { image.src = "flower_one.jpg"; } } Note: Make sure that the both html and js file locations are the same or else defime them specifically

Image switching Using JavaScript

Here is the simple code by which images are switched. Download and use the code. click on the image

JavaScript Can Change HTML Content

By using the method "getElementById()" we can change the HTML content as we like. Let's have alook... What Can JavaScript Do? JavaScript can change HTML content. Click Me! As we see on the button click the HTML text changes.

Javascript Intoduction

JavaScript is the programming language of HTML and the Web.JavaScript is the most popular programming language in the world. JavaScript is easy to learn. Javascript can change HTML attributes. We are starting a new journey on Javascript learning. Follow the coming post to learn Javascript. Good Luck !!!

Simple Calculator in Android

This post explains how you can create a simple calculator in android. You can download the code and use. See xml class: <?xml version="1.0" encoding="utf-8"?> </LinearLayout > See Java class: public class Calculator extends Activity implements OnClickListener { EditText etNum1; EditText etNum2; Button btnAdd; Button btnSub; Button btnMult; Button btnDiv; TextView tvResult; String oper = ""; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calculator); // find the elements etNum1 = (EditText) findViewById(R.id.etNum1); etNum2 = (EditText) findViewById(R.id.etNum2); btnAdd = (Button) findViewById(R.id.btnAdd); btnSub = (Button) findViewById(R.id.btnSub); btnMult = (Button) findViewById(R.id.btnM...

What is CSS Class ?

In CSS, classes allow you to apply a style to a given class of an element. To do this, you link the element to the style by declaring a style for the class, then assigning that class to the element. CSS Class Syntax You declare a CSS class by using a dot (.) followed by the class name. You make up the class name yourself. After the class name you simply enter the properties/values that you want to assign to your class. .class-name { property:value; } If you want to use the same class name for multiple elements, but each with a different style, you can prefix the dot with the HTML element name. html-element-name.class-name { property:value; } You can also select elements (or classes) that's nested within another element or class. For example, div.css-section p will select all elements that are nested within a <div> element that uses the .css-section class. One major benefit of doing this is that you don't need to apply a class to every instance of an ele...

What is Navigation Drawer ?

The navigation drawer is a panel that transitions in from the left edge of the screen and displays the app’s main navigation options.The user can bring the navigation drawer onto the screen by swiping from the left edge of the screen or by touching the application icon on the action bar.As the navigation drawer expands, it overlays the content but not the action bar. When the drawer is fully extended, the action bar adjusts its content by replacing the current action bar title with the app name and removing all actions that are contextual to the view underneath the navigation drawer. The overflow menu with the standard action items for Settings and Help remains visible. read more from here...

Display formatted date/time using String.format()

In this post we explains how to display formatted calendar using String.format().Let's hae a look. Download and use... import java.util.Calendar; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView cal = (TextView)findViewById(R.id.viewdate); Calendar calendar = Calendar.getInstance(); cal.setText( String.format("%td-%tm-%tY\n", calendar, calendar, calendar) + String.format("%ty/%tm/%td\n", calendar, calendar, calendar) + String.format("%tI:%tM:%tS %tp\n", calendar, calendar, calendar, calendar) + "\n" + String.format("%tD\n", calendar) + String.format("%tc\n", calendar) + String....

Find great new apps and get tips for the ones you own with our brand new app pages

 We're always working on new ways to make your experience of Android even better, and that  goes for the AndroidPIT website too. We work hard every day to bring you the best app  recommendations, hardware reviews and Android news, and today we're launching the alpha  version of our new app overview portal. Our new app pages let you see, at a glance, all  of the best Android apps available, and you can submit reviews, ask questions and become  an app expert by sharing advice.   With the app overview pages, we wanted to create a new and user-friendly format for finding great new apps in a visually appealing way, that would also serve as a micro-forum for each particular app. Have a specific question about an app? Simply bring up the app profile and find your answer there. No answer to your question? Post it and get a response from one of our app experts or community members. The more you use them the more you learn. Answers can be rated by the comm...

Faster Loading images in GridViews or ListViews in Android using Menory Caching, Complete implemenation with sample code.

This example shows you how to load large images in the gridview without any lag or without outofmemory error. This sample application uses the LruCache to hold the images. A cache that holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head of a queue. When a value is added to a full cache, the value at the end of that queue is evicted and may become eligible for garbage collection. Read more from here. http://developer.android.com/reference/android/util/LruCache.html This is the MainActivity that holds the GridView. We are adding here 100 images in the Grid to load. This time I am loading images from the resources. MainActivity.java import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import android.widget.GridView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...

Different element with different background in CSS

The example explains how we can color different element with different backgrounds. <head> <style> h1 { background-color: #6395ed; } p { background-color: #e000ff; } div { background-color: #b000de; } </style> </head> <body> I'am colored <div> This is a colored div. This is a colored para We are still in the div element. </div> </body> </html>

Facebook 'colour change' virus is back, hits over 10,000 users

Have you tried to change the colour scheme of your Facebook profile lately? Beware of virus attack as a "colour change" malware is back and has already affected over 10,000 people around the world. The malware has been fixed by Facebook repeatedly but it has resurfaced again, reports added. It begins by advertising an app that tells Facebook users they can change the colour theme of their profile. Download the app and you are directed to a malicious phishing site, Mashable reported. The danger starts herewith. The website targets users by stealing their Facebook Access Tokens by asking them to view a colour changer tutorial video. Temporary access to the tokens allows hackers to connect to the user's Facebook friends. If a user does not view the video, the website tries to get them to download the malicious application. If a user is on a computer, the website leads them to download a pornographic video player. read more : http://businesstoday.intoday.in/story/f...

Mobile phones next big target of hackers!

Tempted to get a new mobile phone in exchange for your old battered one? Beware! Unethical hackers can crack into every shred of personal information you have on your gadget. For cyber criminals and unethical hackers, smartphones procured through exchanges are a catch in terms of getting access to valuable data related to finances and passwords, an expert said here. “The volume of data one uses on their phones these days is huge and because of accessibility to internet services such as phone banking and e-shopping, data about one’s debit and credit cards, passwords, photographs and videos, everything is available to hackers. read more : http://tech.firstpost.com/news-analysis/mobile-phones-next-big-target-hackers-228733.html