[Solved] Calling a number in an array

you need to write service to check if current call is ended or not. after disconnection of one call you can dial next number from your array in onRecieve method of BroadcastReceiver. code to check call is disconnected or not. switch(state) { case TelephonyManager.CALL_STATE_IDLE: Log.d(“Call”,”Outgoing Call finished”); break; case TelephonyManager.CALL_STATE_OFFHOOK: Log.d(“Call”,”Outgoing Call Starting”); break; } … Read more

[Solved] Simplified Java Library? [closed]

How about a static import? // No promises this is compilable Java import static Landscape.createGrass; public class Wtv { public static void main(String[] argv) { int coord_x = 4; int coord_y = 7; createGrass(coord_x, coord_y); } } 2 solved Simplified Java Library? [closed]

[Solved] The if statement in JAVA

So you have the following: if(condition1){ block1; } if(condition2){ block2; }else{ block3; } To disable/ignore the second if you can either use an else if statement: if(condition1){ block1; } else if(condition2){ block2; }else{ block3; } Or a return statement after block1 if(condition1){ block1; return; } if(condition2){ block2; }else{ block3; } 4 solved The if statement … Read more

[Solved] How can I modify this code to insert random text into the console and it reverses it for me? [closed]

You need a mechanism to input text from a source e.g. keyboard or command-line etc. Given below are some examples: From keyboard: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a text: “); String s = scanner.nextLine(); for (int i = s.length() – 1; i … Read more

[Solved] why does the for loop run twice only

Your loop is equivalent to this: int i = 2; // Initializer while (i < 10) // Condition { System.out.println(i); i = i * i; // Update part } Note how it will never enter the body of the loop when i is 10 or greater – so it will never print 16. In other … Read more

[Solved] Write a program that prints the multiplication of two selected numbers from a line [closed]

You can run something like this: int numOfLines; //stores num of lines that will be inputted Scanner reader = new Scanner(System.in); //assuming you already imported before this numOfLines = reader.nextInt(); //captures 1st user inputted value int[] nums = new int[numOfLines]; //creates array object to captures all further values for (int i = 0;i<numOfLines-1;i++){ nums[i] = … Read more

[Solved] Implemeting a basic FTP client in Java

You can start by reading up the RFC governing the FTP protocol. With that you can get an idea on how the FTP protocol works, how it sends commands, expected responses etc. You can find a link here: https://www.rfc-editor.org/rfc/rfc959 Aside from that you can have a look at this GitHub repository. In there you’ll find … Read more

[Solved] How to create and write a module for automation test framework

Just go with page object model. It’s simple only. Refer this link. http://toolsqa.com/selenium-webdriver/page-object-pattern-model-page-factory/ Ex: Keep Header.java and Move the locator elements to Header.java Similarly Catergory.java and Move the locator elements to Category.java Then SampleTest.java, Call the locator method in the test file…. That’s all……. solved How to create and write a module for automation test … Read more