Present solutions for testing Android applications - android

I've just reviewed about 10 Android books, read a bunch of articles and found a couple of frameworks, but still I haven't found any comprehensive way of testing Android applications.
It's too bad that testing appears (if at all) only as a single and short chapter only in some books.
There are:
ActivityUnitTestCase and ActivityInstrumentationTestCase2
Robolectric
Robotium
But none of them has sufficient documentation, tutorials or example. I couldn't able to setup Robotium with Gradle as well to be run either from AS or even command line.
What is the most current way to test Android applications with Android Studio 1.0 and Gradle 1.0.0? What frameworks and tools do you use? Where do you learn testing recipes for Android?
The only thing I managed to setup is standard android ways for testing applications, however there are only few examples how to do that.

The problem is that, there is no single page, that covers all Android test frameworks. Anyway there are more of them than you listed above.
Espresso
UIAutomator and related page
Calabash gh project and official page
Appium gh project and official page
Telerik
I don't know much about integrating them with Android Studio as it still is in infancy, however it should be feasible.

Check out Blundell's blog for some good tutorials: here's the one for espresso. Be warned, while I could get Espresso and JUnit tests to work, I haven't managed to get Robolectric to work yet. If anyone has a way to get it to work for projects targetting API 21, I would be keen to know how.

Related

Xamarin.android instead of Java

I'm student and and my favorite language is C#.
However i must create my first application for android and I have just found something about Xamarin. Does it make sense to use that instead of Java? Beacouse Java really doesn't match me.
It's a academic project, but also I'd like to deploy that to Google Play Store.
In the Xamarin shop I found that I can develop my application on the free version, but propable i need Xamarin.Forms and buy INDIE license, isn't it?
Adam, I will greatly encourage you to write your first app in native Android. Xamarin is an amazing tool set and you should keep tuned in to Xamarin but be rest assured that Xamarin or any other non native development tool is not for the beginners nor the faint of heart.
The reason I encourage you to get started with native Android is because of Documentation, Examples and Getting Unstuck. When you run into problem with native Android, either Google already have a sample project that addresses that issue with code example, or it has already been asked, debated and answered in StackOverflow.
One thing that will help you though is the complexity of your first project, if you choose a complex app you may never ship it. If you choose a moderate app, then the issue of having to know Java is essentially a mute point because the framework provides most of the plumbing code you need to accomplish most basic use cases. The remaining Java you will pick up as needed.
Goodluck
It dosnt matter if your develop with Xamarin or native Java. You will always have to know about the Android Framework.
Futher you don't need to use Xamarin.Forms, you could also write the UI Part platform specific.
The need for Xamarin.Form is that you code your UI once and be able to deploy them to iOS, Android and WindowsPhone devices.

android testing, testproject or real device?

I'm final testing a project I've been working on. So far, I've tested the app by installing on various virtual & real devices, and user testing all possible outcomes of the functionality.
Going through the release preparation doc, android test project is the method used in the guide.
I've started to write out some test cases but I can't see the benefit, or additional options from using a test project, that I have not already covered in device/user testing.
Am i wrong to just stick with the device/user tests, or is the test project method just a coded version of the tests I've already completed?
The big advantage of unit-tests is that you can run them always after you did some changes in your code.
This way, it is a lot easier to find a bug which breaks already working functionality.

Is developing an application for Android using Lua only possible?

So I read this article on Mobile Orchard and, as I'm planning on having my first steps in Android development, it got me thinking: is it possible to develop for Android in Lua only? I Googled the topic but found no definitive answer. I know Java is the "base style" for Android but for the coding newbie which I am (elementary Python, basic C++), Lua seems somehow clearer and more friendly. Then here goes my question: can one develop an Android app using Lua only? If so, could you please show me some directions to move from here?
I've been developing a mobile application in Lua to control robots remotely from iOS and Android phones. The app is in pure Lua and runs on top of Mosync platform using MobileLua. There is still some plumbing required, but it's not too complex.
I also have a debugger and a Lua IDE (ZeroBraneStudio) that support debugging of Lua scripts running remotely (including MobileLua scripts running on Android or iOS devices). I provide a demo app you can use as a client to run simple scripts and check remote debugging in action.
[Update] If you are interested in more game oriented options, there are several available: (1) already mentioned Corona SDK, (2) Moai, and (3) Gideros Mobile. There is also Marmalade Quick and Cocos2d-x Lua bindings (for example, quick-cocos2d-x). All these toolkits/frameworks allow to develop in Lua.
Here is a detailed comparison of Moai vs. Corona.
I know this is an older question, but just to correct some misinformation (in the comments) for people who come later, Corona SDK (as of spring 2013) has a Starter Edition which is free -- no splash screen or anything. The main difference between it and the "Pro" version is you can't do in-app purchases in the Starter Edition. But you can use it to create apps for sale, etc. No expiration date on it or anything.
And in answer to the original question, learning Java may allow you to write Android apps, but if you then also want to target iOS you don't have any great options. By choosing something that's cross-platform from the beginning you can target Android or iOS or both. Lua (in any of the flavors already mentioned) is a great base language to learn for mobile development.
The question is what kind of app do you want to build and what skills do you have. If you are already familiar with JavaScript there is Phonegap/Cordova. If you are building games there are a number of frameworks for 2D and 3D which use Lua. Some are free, others have licensing fees but are worth it if it provides a solution to your problem. All have pros and cons. For example I'm not sure if I would want to build an RSS reader in a game framework. Java is just another language, I would recommend just learning Java and the Android framework to start and knowing what is there before adding another application specific framework layer on top.
Corona SDK allows you to write iOS and Android apps in Lua. Its very easy to learn, but its not free.
Edit:
I saw you posted that you found Corona just after I sent my post...
You can try http://scormpool.com/luastudio
Develop and run code on your device including iOS, Android, Mac, Win.
Exporter can help you to make standalone app on listed above platforms.
This may not be useful to the OP, however for other people interested in using lua to write their apps, I'd share my thoughts. So to answer the question:
Yes, you can use only lua to write apps for android using LuaJava from the kepler project (though I don't believe its being maintained anymore). You can create and manipulate Java objects seemlessly, and interact with the Android APIs through lua. You can even create UI elements dynamically using just lua. However, a small amount of java bootstrap code is needed to start the lua VM from your app. The AndroLua project is a great place to start for Android. The creator has done a lot of work making lua work with Android and packaging it all into an app. From experience I can say it works great! However, I would in no way recommend this to a beginner, as it requires a lot of knowledge about java and lua to make things work, meaning more work not less.
For AndroLua, just clone the repo and use that as a base for your own app. Last time I used it, I just imported it into android-studio, and after fixing a few problems with my own setup, had it compiling and running on my device.
If only pure Lua then the answer is no.. unless you want to use a lot of libraries
If you want to make little Android app/games then use a game engine, learning is a step by step process, don't dive straight into the hard part.

Android testing framework for non-developers

My question is similar to this. I am looking for automated test frameworks for Android where test cases can be written by technical QA people.
All the frameworks ive seen so far require thorough knowledge of Java, JUnit, Eclipse, Adb, Activities, etc.
Check out TestDroid at http://bitbar.com/.
It has an eclipse plugin that lets you simply press record (like a macro) and it will generate the test code (using Robotium) for you.

Android Test Automation

How can i automate Android Apis for better quality ? How can i test the android applications to get a better quality of this software..?
I would recommend you checkout Robolectric for testing Android apps.
Use Robotium, its a good tool to use for Android Automation
http://www.robotium.org/
Try robotium, i am using it, Its very easy for writing your Functional Test Cases and can be tested in all android Devices.
Espresso is the best option coming forward to automate the android API's. Google has developed this testing kit for developers to write the unit test cases. Here's the Google's home page for espresso
https://code.google.com/p/android-test-kit/wiki/EspressoStartGuide
Google has also implemented the sample test cases which help to learn espresso faster. Main advantage of espresso is its speed of execution and its work asynchronously meaning we are not explicitly required to write wait for actions in espresso. Developer should only perform action, waiting time taken care by espresso.
Here's link which gives start to espresso in easy to understand way:
http://www.stevenmarkford.com/android-ui-testing-with-espresso-basics-tutorial/
I would suggest you to use Seetest.
This is also an automation tool independent of any platform. You can run the same test script across all the platforms like Android, IPhone, Windows Phone using this tool. Moreover it has a plugin for existing test frameworks like QTP, Testcomplete etc. Here is the link to download the trial version of the same.
http://experitest.com/support/download-2/
I would suggest Webdriver/ selenium 2.0 android driver if you are looking for open source. its good and robust as well
Try bot-bot. Its a functional automation tool built over Robotium/Nativedriver. It have recording feature which helps in easy element identification and writing test-cases.
It uses "Ant" for build and running the tests. This helps in integration with continuous integration tools.
At the end of your test execution it generates emailable html reports with pass-fail status.
If you have a spare Raspberry-Pi, you can also use that to speedup your test :) , much better than running on Emulator:
Raspberry-PI for Android Test Automation

Categories

Resources