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));

@Centorpe you should have posted also error message...

Some code by you would been good start, since you did not provide one I can only suggest you to read and

Please share code

I ordered Thunderbolt 2 to DisplayPort cable now. Will see if that works. Nevertheless rather weird that HDMI from Asus laptop did not worked either...

I bought Iiyama XB2783HSU-B1DP monitor. However I'm not able to connect my MacBook Pro 2015 from HDMI with DisplayPort to HDMI cable. From monitor menu I am able to select DisplayPort, but monitor will fail to receive any signal from laptop. I tried to connect monitor with Asus laptop, DisplayPort no signal again, while connection through VGA port works fine. Any advice?

Ehmmm silly question will

"SELECT *FROM students"

actually work?
Shouldn't it be with space?

"SELECT * FROM students"

I haven't touched DBs in ages :P

Also good starting point would be NetBeans documentation here

  1. There is only one Bundle so no point for creating second (first snippet line 5 & 6)
  2. Use containsKey(String key) to see if bundle contains mode or logo and avoid getting NPE because bundle will return null if mode not found withgetString("mode")
  3. Since I didn't see rest of the code I can only asume given above that Bundle value for mode will be null as never set, hence failing condition

Is your MyFirstClasssome sort of map? Please share that class or we will not be able to help...

Not sure what you are trying to do in this layout but I would suggest to look on this setup
You use power of LinearLayout and its option of weight distribution...

I would strongly suggest to get at least 8GB RAM before trying to do any developemtn or it will be very slow. Optimal is 16GB or above. And just side note, do not even think of moving to Eclipse, which is no longer activelly supported by Google

Gson and Jackson are most commonly used JSON parsing libraries.

You will create your POJO classes, as you did for PromotionAdapter, fetch JSON and then use either of the libraries to parse it based on your POJO class. Then you only provide collection (List, Array) to your adapter and let it do its job

As anything in Android with Log class

@alaad here you can find many samples

Same here, bunch of devices, tests on Genymotion emulator, you can get free version and we have two tester that do manual tests, but also writes lot of Calabash tests for automation purposes

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...

Hard to say without seeing more of the code. Often the problem is how you inflate components or how you are discharging views once not need it. I would have to see more of the code, sorry

Well the other options can be [startActivityForResult()](, int)) which would be my preffered choice given that you have some field and you want user to change value/s and then you will lsiten for result [onActivityResult()](, int, android.content.Intent))

Well for the future it will be better if you can post small sample where you can demonstrate issue as above problem description obviously was not clear

  1. Install Java
  2. Add Java to your PATH (
  3. Install AndroidStudio
  4. Run AndroidStudio- Update Android SDK (you will need at least API 14 and api 22, latest build tools, from extras install Android Support Repository, Android Support Library, Google Play Services, Google Repository, Intel HAXM)

Optional if not using actual device

  1. Start AVD manager and setup at at least AVD so emmulator can run

If you have machine with less than 8GB RAM it will be very slow...

PS: "I am using nebeans ide." You do not need to tell us what IDE you are using, it is code that matters...

though I do wonder what he's done that makes his eclipse project's compiling dependent on the order of dependencies in the project settings window :)

I do remember NetBeans being funny back in the day while building JME app and you messed up order ;)
But hey then I been student and had no clue about building tools, and been happy IDE did it for me :D

Above description wouldn't help in solving your issue. If your build is dependent on JRE System Library above/below JUnit.jar it is plainly obvious you are dependent on IDE and your project will not build sucessfuly from command line, therefore cannot be run from CI. I do strongly suggest to check out Gradle or Maven

Deprecated doesn't mena you cannot use it. Just learn how to do it later you can swap it for custom library like Retrofit, OkHttp or Volley

i wish the admins could create a tutorial on how to develop a mobile app for the different platforms

Because it is unreasonable thing to do on forum given the way how development moves and the number of platforms. Besides only very few developers do cross platform development and then it will be Android and iOS nativelly or cross platform tools like Cordova, Titanium, Xalmarin etc.

For learning Android you can start here

@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

You should have gone with Map and there would be no need for switch ;)

The question is too braod. You cannot expect people to fill you on

  1. Android development
  2. Design
  3. UX
  4. Business logic of the app
    X. item on the list to do or learn

Try to be more specific

That thing is way too old and not used anymore. Cyril post it back in 2011 ( you should not use it.

So what exactly you trying to achieve? Maybe we can come up with appropriate flow and right components to use...