Posts

Using buttons in Android

Screen change using buttons Create two activities. Here I'm using MainActivity(1st Screen) and the FunctionActivity(2nd Screen). Add a button to the splash activity layout and give a method name to the onClick action. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Function" android:id="@+id/button3" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:width="150dp" android:onClick="fdemo"/> </Button> Then write the following method in the MainActivity public void fdemo (View v){ Intent i= new Intent(MainActivity.this, Function.class); startActivity(i); } Adding About message button(Using toast) Add a button to the  activity layout  and give a method name to the onClick action <Button android:layout_width="wrap_conte...

Creating a simple application using Android Studio

Image
When you open the Android Studio the following screen will be prompted Select "Start a new Android Studio Project" Give a name to your project and click 'Next' Here you can choose the least version of android in  which your app can run. Then click 'Next' Select "Empty Activity" and click 'Next' Here you can give the "Activity Name"(Leave the 'Activity' part in your name) Then click 'Finish'

How to add a Date Validation in ADF

When imputing dates for Purchasing and Expiry there need to be a validation. That is the Expiry date must be always grater than the Purchased date. Using the following code in the .jsff code you can have the date validation. <af:validateDateTimeRange minimum="#{bindings.PurchasedDate.inputValue}" maximum="#{bindings.ExpiryDate.inputValue}" messageDetailNotInRange="Enter your message here"/>

ADF how to deploy an application

Creating an EAR First you must change the connection type of the database into "JDBC Data Source" from "JDBC URL" in the configurations of "AppModule". Then right click on the Application drop down and select Application properties. Then  expand Deployment and you'll find "Weblogic", select it. Then uncheck the box "Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment" and click "OK". Then expand Run and you'll find "Weblogic", select it. Then select "Fast Swap"and click "OK"  Then right click on the Model in project tabs and select Deploy and wait until deployment is over then click "Application" tab and select deploy and in the popup select "Deploy to EAR" and select "OK" then wait until the deployment is over.  Go to the resource folder where your application is initially saved, there you can find a new folder...

Java ADF creating EO and VO

Image
After creating a Data Base connection, Click the 'Applications Window options' and change the Package level to '1' Right click on Test Modal and create a new 'Entity Object' Click 'OK' Give a name to the entity object Type Testmodel. eo  for the package name. This creates a package named  eo  inside the  package Testmodel. Then click 'Browse' following to Schema Object You can choose the data base you connected earlier from the Database schema list Then  click Query and select the required table and double click then press 'OK' Click 'Next' Click 'Next' Select the attribute for the primary key and tick the Primary key check box and click 'Next' Click ' Next' Click 'Next' Click 'Finish' Right click on Test Modal and create a new 'View Object' Give a name to the view object and type Testmodel. vo  for the pa...

Java ADF connecting to a Data Base

Image
When you open Oracle JDeveloper Studio you will be prompted to the following screen Select Connect to a Data Base Select 'Create a Data Base Connection' Give a name to your connection Select the connection  type you use. Here we are using a MySql Data Base Type the username and the password and give the Data Base name. Then test  the connection and press 'Ok' , if the connection is unsuccessful check  the  username, password and the Data Base name  Click the not started button and change it to 'Done'

Simple Calculator using java

Calculator with user input (Using scaner) Class = Cal import java.util.Scanner; public class Cal { public static void main(String[] args) { temp(); } public static void oparator(int x, int y,String oparator) { if("ADD".equals(oparator.toUpperCase())){ int z = x + y; System.out.println(z); } else if("SUB".equals(oparator.toUpperCase())) { int h = x - y; System.out.println(h); } else if("DIV".equals(oparator.toUpperCase())) { int i = x / y; System.out.println(i); } else if("REM".equals(oparator.toUpperCase())) { int j = x % y; System.out.println(j); } else if("MUL".equals(oparator.toUpperCase())) { int k = x * y; System...