Android Studio test for libraries - junit

I'm new on testing, I read some pages on testing for Android. I can't find pages for testing libraries on Android Studio.
My problem is to test a class without activity and with some private methods.
Someone know how to test libraries on Android Studio 1.1?
Thanks

It's a pretty broad question but if you're new to testing on Android take a look at: http://www.vogella.com/tutorials/AndroidTesting/article.html
This is mostly on how to test elements in Android, like activities and such.
Testing encapsulated methods and classes can be a pain, especially if it's stuff like libraries, but take a look at this (option 4): http://blog.octo.com/en/android-testing-testing-private-methods/
Hope it helps.

Related

Chromium Embedded Framework (CEF) html5 desktop application

I am new to Chromium Embedded Framework (CEF). How can I create an HTML5 desktop application using CEF. I serached a lot. But still confused about developing the applicaion.
please help.
You can create a CEF application in different languages (c/c++ or C#, python or ...), what is your preference about that?
In case of C# you might want to try https://github.com/cefsharp/CefSharp, I used this one in the past and it worked really great!
There are also sample projects in the CEF svn found here:
CefClient and CefSimple
Together with this tutorial here: https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial
In the past I used CefSharp and one time I changed the CefClient example (removed everything I didn't need) and rebuild it. Using CefSharp was a lot simpler than the CefClient.
Another possibility might be https://github.com/rogerwang/node-webkit but that isn't CEF so a bit offtopic
edit:
For java there seem to be two CEF Wrappers
javachromiumembedded
javacef
See an example application here (code): javacef

How does the mozilla stub installer works?

I'm currently working on a no-touch deployment and auto-update mechanism for a Windows application. I've tried Microsoft ClickOnce strategy but it did not work for me as the strategy only suits small-sized apps, and my application hauls at ~500MB.
I'm interested in how the stub based installation and update strategies work for Mozilla Firefox and Google Chrome and also Microsoft's packages including its .NET framework and VS installers. I've come across Google Omaha which hosts the Google product update deployment mechanism, but it is not very conclusive for me.
Can anybody please help me out how the stub-based deployment design works?
P.S. Any open source code for the same would be of a great help. ;-)
I'm not quite exactly sure of what you mean by "stub-based". There's a handful of technologies and tools involved in what I understand you want to accomplish. For the setup packages creation there are: NSIS, Inno Setup and the WiX Toolset, for example. A core technology is MSI. On the other hand, for application updates and the such, there's BITS and also some web stuff involved in updates publishing, like using an ATOM feed, for instance (your referenced Google Omaha might fit into this category).
It's only a bunch of pointers, but I hope it helps.
The Mozilla installer is opensource (as is the NSIS system it uses) so I'd suggest adapting the code found here: http://lxr.mozilla.org/seamonkey/source/toolkit/mozapps/installer/windows/nsis/
It's a bit complex so you could start with a simpler script and incorporate the bits you want (like finding/downloading updates and UAC evelation).

Good Unit Testing Options in FlashDevelop

I'm new to AS3 and Flex, but I am creating a mobile app with them in FlashDevelop. I want to add some unit tests, but I can't find any really good frameworks or documentation on it. I saw a little bit on FlexUnit and AsUnit, but both seem to be a few years old, and there isn't much documentation on using them in FlashDevelop.
Is there a good framework I can use for unit testing here? Even if I can't test the UI layer, I'd like to at least make sure my backend functions work correctly.
If you are testing backend functions, then you generally want to use the testing framework of whatever backend you are using. If you want Flex to test your backend functions, then you aren't Unit Testing, you are Integration Testing. While FlexUnit seems old, it still performs well at serving its purpose. The usage of FlexUnit should be independent of your IDE, you may just have to do more typing.
You can try to use the Flexunit4.0 for testing the business logic on the client side mixing it with the Mockito. None of these actually support testing the UI.
i've never tried to test the backend services with the Unit testing because of the authentication issues, but we created another testing UI for testing the services, This UI has a tons of screens, each screen to test different services.
I've seen that there is a ServiceBrowser for amfphp, i'm not sure if this can be used for Java or other platforms.
Other ways of testing the UI is by automation testing, use flexmonkey, selenium for that.

objective j loads slowly in browsew

I am iOS developer. I know just a couple of languages and I hate html because of the lack of possibilities there.. I've just red about objective-j. When I try to open any code in web browser (last versions of Safari, Google Chrome) it loads increadibly slow..
Is it normal?
How to make it work fast?
Are there any other languages similar to c, objective-c that I can use for creating a web-site?
And another queastion coming with: How can I make Xcode work with objective-j? I use coda 2.0 at the moment.
Make sure you run jake deploy to create the stripped and precompiled version of the app you're testing. Most sample code out there will be run in uncompiled "debug" mode which is great when you're developing but in actual deployment you'll want the precompiled version of your app.
Also, the current development version of Cappuccino and Objective-J is much faster than the last release 0.9.6, thanks to a new, better compiler. Keep an eye out for a future Cappuccino 0.9.7 release.
I think if you write a significant app in Cappuccino you'll find the load time to be absolutely comparable with other large web apps such as Gmail.
Currently you can only use Xcode to edit the user interface of a Cappuccino app. It does not work well to edit Cappuccino code itself since the latest versions of Xcode don't include the necessary plugin framework. You can learn more about good editor options in the development environment tutorial.
I am not familiar with other languages similar to Objective-C for the web, but Intel has an Objective-C to JavaScript compiler here.

Wrapping a HTML5 app into an executable for Windows/Linux/Mac

I'm building a HTML5 mobile app which I'm going to wrap in an Android and an iOS app with a simple web view. However, I have some users that use my current Adobe Air app (which is now unsupported), and I'd like to offer them this new app I'm building.
I've heared that Adobe Air's implementation of webkit is rather old and unstable.
Is there any good tools for wrapping a local browser (preferably webkit) and my app in an executable for cross-platform (PC) use?
I've just seen this http://appjs.org/ and I'm glad to see that Alex's TideSDK sounds great also !
Adobe AIR can do what you want, but I won't support that solution : it's slow and not really crossplatform since they drop the support on Linux if I'm correct.
If someone happen to test the others, feedback is welcome !
Off topic: Moreover I've chosen not to trust Adobe for my technical choices anymore. We've waited Flash on mobile for years, they drop the idea. We've been waiting for optimization on Mac and Linux for years, but nobody cares. The new hype some months ago was expecting compilation to HTML5, it's just some buzzwords mixed together and some old sketchy alpha version as far as I know.
EDIT
AppJS has moved http://appjs.com/
EDIT
node-webkit seems to be definitely a must see now ! https://github.com/rogerwang/node-webkit
Read an article lately about this sdk: http://www.tidesdk.org/ . I haven't worked with it yet - so can't really say if it's worth trying and doing what you want.