The idea of testing your code is to have some method that has a return and that is what you want to test. So to get testing going on above code you would have to change return type to String

public String methodToCheckStr(int testVar)
        String str="";
             return "Success";
            return "fail";

And then you can have tests as

public void testSuccess() {
   StringChecker checker = new StringChecker();
   assertEquals("Success", checker.methodToCheckStr(5));

public void testFail() 
   StringChecker checker = new StringChecker();
   assertEquals("fail", checker.methodToCheckStr(4));

There are cross-platform tools like Titanium(C#), Cordova(HTML5 and jQuery). Also possible with Python, Scala or Kotlin. However these will be always slower than native implementation...

@Slavi Eclipse usage is discouraged as Android Studio is these days prefered and reccomended tool even by Google. Eclipse Gradle implementation lags behind AS and it will be evntually dropped

As for your question @serenagrace this is what you need

  1. Knowledge of Java and basics of XML
  2. Installation of Java SDK 7 (8 and higher is not recommended as Android is not fully compatible).
  3. Android Studio, 1.3 is latest


  • Android SDK download - you will get one with Android Studio but I prefer a copy that I'm in control in regards of location of instalation
  • Stand alone installation of Gradle download - you may stick with Gradle wrapper provided by default by Android Studio wizard it will do all
  • Genymotion download - a faster emulator than the one that is part of Android SDK. Provided link is to free version. See comparision between free and busines copy here!/store
Slavi commented: Ah, gotcha! (Been awhile since I left Android world =[) +6

Is it so hard to use Google search these days???? "java itext create hyperlink" and first link is

Take my advise and use ActiveAndroid library or it new brother Ollie Simple object to object transactions, no need to SQLite boilerplate.

You are misunderstanding concept. This is not jar library that you add to your project, but rather expectation that user has this application installed on device and thereore with help of Android intent you can say "load this url with following application of this package name"

OsaMasw commented: thanks +2

There is no official API yet as this is still under development. However according to VLC forum you just need to do this

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse(""), "application/mp4");

My suggestion would be to check first for vlc in PackageManager to avoid crash if app not installed. You can follow discussion on intent here

Without seeing actual code hard to say...

Hard to judge what would be the targeted areas for improvements. Do you have any open source project we can have look?

Otherwise I would ask how confident you are with collectable, what sort of components/librarues you are using for networking, json parsing, image handling.
Did you do any code testing? JUnit, Mockito, Espresso, Robolectric, Instrumentation, UIAutomator, Monkey

Ahhh, OK. Simple, lets examine code (sorry for cheeky comments)

if(new File("ATM.xls").exists()){ //check if file exists
    System.out.println("File exists"); //YES it does exist
    //but I failed to assigned to some object
    File excel = new File("ATM.xls");//doesn't exist so I create new file
    //but this go no further because it is local variable

So the code should be something like

File excel = new File("ATM.xls");
if(!excel.exists()) {
    try {
    } catch(IOException e) {
        Systemout.println("Failed to create new file, \n" + e.getMessage()); //Log framework would be much better instead of system print outs
//I have made sure file either exists or is created and now I can continue

@Dave he did but post it as code instead of simple text

@sabata mmoledi forum rules clear state Do provide evidence of having done some work yourself if posting questions from school or work assignments so time to show some effort we are not your coding monkeys

You aware that Android and iPhones ditched support for Adobe Flash

Daniweb rules says

Do provide evidence of having done some work yourself if posting questions from school or work assignments

So post what you wrote so far and maybe will help you

Daniweb rules says

Do provide evidence of having done some work yourself if posting questions from school or work assignments

So post what you wrote so far and maybe will help you

You need to run your music as servive, you can see example here

jalpesh_007 commented: is helpful. +4
ravi142 commented: @Thank you +2

Not working is rather bad description. If you post any error/crashes you gettng perhaps someone may help you...

Jimmy Gim commented: same feeling with you +0

Spring develeopers produceded documentation with official tutorials

Sorry I never did this with POI.Given that so far nobody provided usable answer you may want to try their mailing list and ask directly contributors

Link here

@Slavi not exactly, question is how to get XSSFDrawing or XSSFPicture to some stream format that can be used to create image.

You should spent little more time reading question and have look on code, API before calling generic search for Java code ;)

Time is Android represented either by Date or Time objects. Each of these will return result in miliseconds as long variable ( ). Then you just need to compare time1 to time2 to find if it is lesser/equal/greater

This is how simple it can be done

Button one = (Button)this.findViewById(;
final MediaPlayer mp = MediaPlayer.create(this, R.raw.soho);
one.setOnClickListener(new OnClickListener(){

    public void onClick(View v) {

If i read it correctly your insertValue is part of R.layout.add_item. If that is case then

final EditText insertValue = (EditText)findViewById(;

will be null because edit text was not found. You have to find it in coresponding view, so it should be like

final EditText insertValue = (EditText) addView.findViewById(;

You need to know Java, if you don't then go and learn it then come back.

If you know Java, then perhaps reading one of these books will be suficient enough

You failed to specify what operaring system you want to develop for ANdroid or iOS...

Never tried to do such think. However I found this post on stackoverflow that discusses extracting data from current connection. So based on that I looked up ServiceState and that has getOperatorAlphaLong() methd that according documentation

Get current registered operator name in long alphanumeric format.

So you are able to discover your current provider. Question is if you can trigger call for discovery of all available networks...

peter_budo 2,516 Code tags enforcer

List followed by code snippet does not render properly. Example

  • Item One
  • Item Two
  • Item Three

    Log.i(MainActivity.class().getSimpleName(), SOME_MESSAGE); //info
    Log.d(MainActivity.class().getSimpleName(), SOME_MESSAGE); //debug
    Log.w(MainActivity.class().getSimpleName(), SOME_MESSAGE); //warning
    Log.e(MainActivity.class().getSimpleName(), SOME_MESSAGE); //error

Here is update, I added some comments in code and also at the end of post

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import java.math.BigDecimal;

public class MainActivity extends FragmentActivity { //FragmentActivity is preferred over ActionBarActivity very few apps supports 7 and bellow

    private TextView textview;
    private Globals globals;

    protected void onCreate(Bundle savedInstanceState) {
        textview = (TextView) findViewById(;
        globals = Globals.getInstance();

    /* Function handles event when a number button is pressed */
    /* Including decimal point */
    public void numberPressed(View view) {

        Button button = (Button)view;

    /* Function handles event when "+" button is pressed */
    public void addPressed(View view) {
        //Global now available as class variable no need for creating it
        //Textview now available as class variables
        BigDecimal bd = new BigDecimal(textview.getText().toString());
        //no need to set local variables to null JVM garbage collector takes care of this

    /* Function handles event when "=" button is pressed */
    public void equPressed(View view) {

        //Global now available as class variable no need for creating it
        //Textview now available as class variables
        int lasTop = globals.getlastoperation();
        BigDecimal bdg = new BigDecimal(globals.getData().toString());
        BigDecimal bd = new BigDecimal(textview.getText().toString());
        switch (lasTop) {
        case 1: {/* "+" button was the last operator button pressed*/
            BigDecimal sum = new BigDecimal(bdg.add(bd).toString());
            break; //do not forget to add break otherwise you may for get with next case and your process will felt through case 1 to case 2
            //May want to ...