Robotium integration testing in Android Studio for custom soft keyboard - android

I've seen a few articles on how to set up Robotium with Android Studio, such as this link http://anirudh24seven.github.io/devlog/2015/02/13/robotium-android-studio.html or this link How to use Robotium with Android Studio?. However, I have yet to get it working to test my custom soft keyboard. What I've got so far is to create a test/java folder under /src/ in my module and modify build.gradle to include compile 'com.jayway.android.robotium:robotium-solo:5.2.1'. Note that I created test/java instead of androidTest/java as suggested in above links because otherwise the java folder wouldn't turn green. Now I don't know what to set for the launcher activity. I would ideally like to automate UI for the keyboard somehow and test the values/resources that are being displayed. Any ideas?

Related

Why the Softkeyboard example doesn't work?

I want to create a custom keyboard for android.
So I am starting from the official softkeyboard example.
So I have downloaded it and I have opened it with Android Studio.
But as you can see, there is no way to Run it ( the play button is grey instead of green ):
What do I have to do ?
This is not my first app, I have developed other simple apps that work perfectly.
there is no gradle file in that project so you cant run... create new project and copy your classes

Adding test method template in android studio doesn't work?

Hi guys,
when I want to generate code template in the android studio testing environment, the template will not add for me,it only shows me the edit template option like below
seem like android studio doesn't allow me to add code template for junit4
as you can see the plus button is also disabled for me, anybody know why?
Just press enter, without click on right arrow, then code will be generated according to your template.

Can't edit anything or drag widgets in Android Studio

I started off with a black activity and whenever I try using Android studio, I get stuck in this screen. I cant drag any widgets, enter any text, or make any changes to the user interface. Is there anything I am missing? I downloaded all the Android Studio bundle and I have all the required SDK tools. I have attached a screenshot of what I am currently stuck with.
A screenshot of what I am seeing:
Recently I encountered the same problem myself. After some research I found that you must now use the "content_activityname.xml" file in order to edit the ui of an activity.
In your case this file is located in the layout folder, right under your activity_main.xml in the picture provided.
According to this thread: What is the role of content_main.xml in android studio 1.4? the main.xml now contains the global look of the ui, and also contains the content.xml file which again contains the components of the ui.
You should think of uninstall and reinstall Android Studio and after that creating a new Project. You also are able to look at some tutorials created by the creators of AS. They can be found at Android Developers.

Android lock widget available?

I'd like to add a lock widget to my application but I am unable to find one.
The android 4.4 alarm clock for example has one. Or the android lock screen. Are there similar components available as widgets which can be dragged into a layout in eclipse?
The widget is called GlowPad and is part of the Android 4.4.4 AlarmClock.
I ended up using net.frakbot.glowpadbackport.GlowPadView.java, which is available at github.
I've ignored the readme.md, the gradlew (which is some kind of non-working makefile) and all the crap that came with it[1]. Instead I've created an android project from scratch with scr.frakbot/*, an empty AndroidManifest , values/attrs.xml and lib/nineoldandroids-2.4.0.jar and it. And it worked out of the box.
[1] Don't get me wrong, gradle is a nice software, but why should I care creating a gradle.local, a keystore from keystore.example (!) and all that, if I can simply drop the 9 necessary files into eclipse?

libgdx and TWL: Android app force closes on any TWL menu, works fine on Desktop

I am implementing menus using TWL (http://twl.l33tlabs.org/) in an app written using Libgdx. The app runs fine if I don't start any menus, but as soon as I go to a menu screen it immediately force-closes. Menu screens work fine on the desktop version.
In which build path should TWL-android.jar be included (right now it behaves the same in main, android, and both)? And how will the program know to use the libraries from this .jar instead of the default gdx-twl.jar? Will I have to manually implement something in code to use one or the other depending on platform?
There does not seem to be any documentation or sample code of anyone using TWL on android, only mentioning that it can be done.
Running debugger attached to phone gives the following logcat error:
Could not find class 'com.badlogic.gdt.twl.Layout' referenced from method com.Nanners.OptionsScreen.<init>
I think that TWL-android.jar should be added to android project's build path too. Location of .jar is not relevant.
When you add TWL-android.jar. As that is Android specific you can't use it on the core project, so the classes you are importing are the ones from gdx-twl. To make it simpler to explain I will divide it in different escenarios.
You add TWL-android to your Android buildpath. But you use Gdx-twl in your core project. Which isn't added. Thus getting a:
Could not find class 'com.badlogic.gdx.twl.Layout'
You add both TWL-android AND Gdx-twl to your build path. Thus getting duplicated classes and:
Conversion to Dalvik format failed with error 1
Solution
If you use TWL-android classes, you can only do it inside the Android project:
Merge Core, Desktop and Android project. Or
Use Interfacing with Platform Specific
If you use Gdx-twl:
Don't do it.
Actually the best solution is to get rid of all twl stuff and use Scene2d.Ui instead. Its crossplatform and much easier to use.

Categories

Resources