Monday, October 6, 2014

Google Chrome Hack Lets Android Apps Run On Browser‏

Android apps have always been confined to the mobile, but what if users were to enable the 1.3 million mobile apps to work on Chrome, Mac and Windows OS? This is what one developer has been able to achieve, going under the alias of “Vladikoff.”

Vladikoff used App Runtime for Chrome and extended the possibilities. The official app only support a few apps on Chrome OS, but Vladikoff’s work supports all browsers, which are able to run Chrome 37 or above.
Apps on Google Chrome

Users who want to try this out need to be able to download Android apps on Chrome, through a custom build of ARC called ARChon, allowing Native Extensions to be cross platform. This does require a bit of technical know-how, even though Vladikoff has worked on smoothing the process.
This custom program will allow Android apps to work on all devices. The apps appear to work as they would on a mobile, albeit without the touch-screen. Users of the program have said it crashes a lot, but other than that it can work and Android apps can be blown up to fit Chromebook screen sizes.
On Chrome OS, the program does work a bit better, thanks to Google’s optimisation of Native Apps. On Mac, it is still pretty good with the different APK packages, but on Windows it is almost impossible to run Android apps for more than 10 minutes, without a crash.
There has been some conversation on the idea of merging Android with Chrome OS. Google has had huge success with Android, but Chrome OS has been rather lacklustre outside of education.
Adding Chrome OS into Android would be an interesting idea, considering Android OS has been ported to larger tablets, over 18-inches, showing apps can run on larger displays, without the apps looking too “blown-up.

Tips to Android App Developers for Android App Development

The Android SDK is becoming the most popular development framework for android app developers. The success of this development framework (SDK) is beyond the imagination level. Millions of Android powered Smartphones are launching every day. So a great door of opportunities has opened for android app development.

Google Play is the place where developers publish
their created or developed application. Android OS is now operating and dominating the whole
Smartphone market in the world. Many business companies are now focusing on Android
application development services. So android developing business is improving and expanding day by day.

MobileAPPtelligence.com deliver custom android apps using latest tool Android L
Android SDK environment including the latest features like NFC. We also place dedicated
android developers (android application developers) at offshore for worldwide clients.
http://www.mobileapptelligence.com/android-application-development-services.html
All Android apps are not successful because of some reasons. Most of the times the developers can’t
understand a consumer’s demand. All the mobile app developers are not very good in kind of mobile
development environment. For this sometimes they forget or misuse the fundamentals of mobile
application development that make actually good for nothing though it is not too hard to make a
successful mobile application. This article covers many useful tips that will help a mobile application
developer to make a successful application.
Responsive Web Design
A mobile app should be responsive to all the mobile devices and go along with cross browser
compatibility. It is a kind of web design which deals with both cross browser and cross platform
compatibilities. Web developers make code for desktops, handheld PCs, and Smartphone. Android
4.0 Ice Cream Sandwich is that type of device in which responsive web design is used. This device
tries to combine all Android powered Smart phones and tablet PCs.
http://www.mobileapptelligence.com/html5-development.html
Website owner should decide on responsive website design and mobile apps development based
upon the development cost, implementation time frame, design approach, user experience,
performance, and ongoing maintenance.
Again monetisation is also an important factor. The rate in which the mobile apps can be monetised
cannot be compared with mobile based website.
Fragmentation an important factor:
Android developers only had an option to build two layouts in a screen before so that the OS could
select the most suitable of them. But still it is not a solution of the question of fragmentation. After
releasing Android 3.2 developers are able to create more than two layouts. So Android developers
can make an affective and successful Android apps with little efforts.
http://www.mobileapptelligence.com/android-app-development.html
Socialization and Monetisation
Socialization through social media groups are important. As if a happy customer of yours is
successfully using your app and can post a review or experience about using the same app then the
message will get viral and spread across all the social media community that he has joined.
Let the first impression of icon and theme tag last long
First impression is the last impression
The Google play has thousands of mobile apps but all the apps are not equally popular. To make
an app popular a developer has to keep in mind that first impressions of icon last long. So to make
successful app a developer must have to make an attractive icon for the app. If the icon of the app is
becoming attractive the users will show more and more interest about that app. Apart from icon you
must make the theme tag line very very important. You must describe your product in one line. Your
tag line should communicate what you are selling and it should be under the right category.
The Price Factor
The price factor is not so effective in mobile apps like a PC app. Most of the apps are free of cost or
available at a very low price. So price factor is not so much effective in mobile apps. Initially to get
popularity you must keep your app free for download. The app is the main route for your product
website or company catalogue.

Wednesday, September 24, 2014

Android L vs. iOS 8: Google beats Apple for power-saving feature, performance boost

Android L and iOS 8
Both Apple and Google have announced or released new mobile operating systems, both boasting a number of new features. Those features range from APIs that make apps run faster to a way to track battery use to enhanced and interactive notifications.

(
Even though the final version of Android L has not yet been released, Google has released developer versions and announced a number of new main features. Which is better, iOS 8 or Android L? Here are a number of their features compared.
Design
These days minimalism is in. Both iOS 8 and Android L are taking advantage of this and offering a more simplistic design without compromising on ease of use.
Google's new design language is called "material design," which is consistent across Android, Google Chrome, Chrome OS and Android Wear. This design language essentially adds depth by adding shadows to objects and makes it so that everything is animated, from little rings of color that appear when a user taps numbers on the phone dialer, to the way that app windows slide in from out-of-screen. While a layered design is introduced in Android L, that doesn't mean that Google is breaking the trend of flat design, but rather that the flat design is now layered.
Apple's iOS 7 received a major design overhaul, which was much needed for the software. This means, however, that iOS 8 did not get any significant upgrades as far as design goes. iOS 8 keeps the clean look that iOS 7 brought, with Apple's clear glass effect remaining prevalent.
Notifications
Android L introduces an enhanced notifications method for users, allowing users to see notifications straight from the lock screen. Android will even list these notifications in order of what it deems important. Users can then swipe away notifications they don't need to see anymore, or they can tap on them to open up the associated app.
Notifications have also rather radically changed in iOS 8, now being interactive. What this means is users can now reply to texts, snooze reminders and even like Facebook statuses without leaving the app they're using. Alternatively, users can swipe to the app associated with the notification.
Performance
Both the Android L Software Development Kit and the iOS 8 SDK offer thousands of new APIs for developers, with iOS 8 coming in at around 4,000 and Android L at 5,000. Both iOS 8 and Android L support 64-bit processors, with Apple rolling out the support in iOS 7 and Android L being the first version of Android to offer it.
When iOS 8 was announced, Apple made sure to talk about its new Metal graphics API, which allows developers to create games that run quite a bit faster. Apple also began rolling out its Swift programming language, which should help developers streamline apps as well as safeguard against errors.
Google responded with the new Android RunTime, or ART, which should give apps a rather large boost in speed. This spells the end of the road for Delvik, which is the virtual machine that other versions of Android used and compiled Java into native code. Rather than compile code on the fly, ART compiles all the code for a particular app upon installation of the app and then caches it, allowing apps to run significantly faster.

Battery Use
Both Android L and iOS 8 incorporate more battery-saving features, with iOS 8 now showing a power usage screen that allows users to see exactly where all their battery juice is going.
Android L takes battery saving to the next level and allows users to tweak how much battery power apps can take up through "Project Volta." This essentially makes tweaks on how a battery is used to extend battery life as much as possible. While a number of OEMs are already offering similar features on their devices, the feature will be nice, especially for stock Android users.

Handover
While there are some apps that offer handover features between a user's computer and Android phone, such as PPLConnect, most handover features in Android are best taken advantage of with Chrome OS.
Apple has taken this to the next level with the combination of iOS 8 and OS X Yosemite, now allowing users to take calls and send texts from their computer and iPad.

Conclusion
While it's clear both mobile operating systems have vastly improved over older versions, it is also clear Android L has made the most changes. While a few new features in iOS 8 will keep iPhone users happy, and with good reason, Android users will see a completely new OS with a completely new look and the power to back it up.

Saturday, September 20, 2014

How to get iOS 8’s best new features on Android even before iPhone users get them

iOS 8 Vs Android
When CEO Tim Cook and his fellow Apple executives unveils iOS 8’s great new features on stage during their WWDC 2014 keynote presentation back in June, the most dramatic audience response might have come when the crew unveiled iOS 8’s new Continuity features. With this great new functionality, iOS devices and Mac computers will be more closely connected than ever, able to quickly and easily exchange files and other data. Better still, iOS device notifications appear on a user’s connected Mac, and messages can even be sent and received right from within OS X.
But there’s a catch: despite the fact that Apple released iOS 8 to the public on Wednesday, none of this awesome new functionality is available to iPhone and iPad users yet. If you have an Android smartphone or tablet, however, all of these great features and more are already available thanks to a single fantastic app.

AirDroid
The idea of moving files between devices, seeing notifications on your desktop and sending text messages from your computer might seem novel to iPhone owners, but more than 10 million Android device owners have been enjoying all this functionality and more for quite some time now thanks to an awesome free app called AirDroid.

We’ve covered AirDroid here on BGR in the past, but now that interest in this feature set has been revived by iOS 8, it’s worth discussing again. And of course, none of these new Continuity features are available to iPhone and iPad owners until OS X Yosemite is released sometime next month, so Android users still have an edge in this area.
But if you’re an Android user, you can do everything iOS 8 can do and more with AirDroid.
Manage your Android devices on the web, all over the air.
– No USB cable required.
– No driver installation required.
– Same WiFi network or Internet.
– Pure web app, works on Windows, Mac, Chromebook and Linux.
Simply install AirDroid on your Android and you’ll be able to enjoy the following features on your computer at web.airdroid.com:
– SMS: send and receive individual or group messages.
– Apps: Import and export .apk files.
– Files: Manage files on Android and transferring files between Android and computer.
– Photos: View and manage photos on Android and transferring photos between Android and computer.
– Music & Videos: Play and manage music & videos on Android and transferring them between Android and computer.
– Ringtones: Set music as ringtone and export any ringtone.
– Contacts: View and edit all the contacts.
– Screenshot: View the real time screen of Android devices, take static screenshots. (root required)
– Camera: See through the lens of both front and back camera, also supports flashlight.
– URL: Push url to Android and open automatically open it with Android browser.
– Clipboard: Share clipboard content between Android and computer.
There are also some very useful features on the Android client, including WiFi tethering, file manager, task manager, etc.
AirDroid is a free download in the Play store, and premium features are available for $1.99 per month, $19.99 per year or $38.99 every two years.

Friday, September 19, 2014

Hey, Android Users, Don't Buy the New iPhones

Tim Cook wasn’t kidding when he said the iPhone 6 and 6 Plus are the best iPhones ever. The new phones have bigger screens, run an operating system that allows users to customize their experiences in an increasing variety of ways, and even incorporate different kinds of keyboards. If you’re an iPhone user, there is no good reason to bat your eyes at fancy Android (GOOG) phones anymore.
But what if you already have an Android? Cook has boasted that the new iPhones will inspire tons of converts, but much of what’s new for Apple (AAPL) is old hat for Android. Both systems offer phones with big screens and powerful cameras. Software innovations available for one type of phone are quickly adopted by the other. Price is essentially not an issue. Neither, necessarily, is design.

The HTC One (left) doesn't look that much different from the Apple iPhone 6

If you’re starting from scratch, the iPhone may be the best choice on the market. At this point, there aren’t many people who haven’t picked a side, and jumping ship is still a hassle. Yes, phone carriers will help you export your photos and contacts from one operating system to another. But apps—and the average smartphone owner uses about 27 each month, according to a recent study by Nielsen—aren’t coming with you.

Phone manufacturers make it hard to switch on purpose: They want you locked in forever. That’s the idea behind the Apple Watch and Apple Pay, which don’t work for Android. (Ditto for Samsung’s (005930:KS) Gear S watch and Gear VR headset, which are made to work with the company’s other devices.)
This doesn’t mean that Apple can’t convince people to abandon their Galaxys; it just makes it harder. Traditionally, Apple’s advantage has been the quality and quantity of available apps. If you’ve wanted the best apps the minute they came out, you had to have an iPhone. Android—and, to an even greater extent, BlackBerry (BBRY) and Microsoft (MSFT)—have had trouble convincing developers to create software for their devices: Apple users spend more on apps, which means bigger potential payouts for developers. After it takes its share, Apple sends about twice as much money to developers from consumer spending on apps as Android does—with half the total number of users. (The same incentives exist for merchants as they consider whether to participate in Apple’s mobile payments system: They know people carrying iPhones have deep pockets.)
Apple’s advantage in areas like this, though, isn’t as significant as it once was. Of this week’s top 25 most downloaded free apps for iOS devices, only five aren’t available for Android. One, an emoji program, isn’t much different from what’s available in the Google Play store. The rest are games, and at least two of those have an Android version in the works. As for payments, once the technology is in place for merchants to accept Apple Pay, the adoption of Google Wallet or some such won’t be far behind. Neither merchants nor developers are being compelled to choose between Apple and Android, so many will be happy to work with both.
In the end, there are two kinds of Android users who will end up buying the new iPhones: those who have always wanted one but couldn’t live without a bigger screen, and anyone who really wants the Apple Watch—although those people probably have iPhones already.

Google May Ban Android Developers Who Do Not Hand Over Their Postal Addresses

Every Android developer with a paid app, or an app that includes in-app purchases, will soon be required by Google to list their geographic address publicly on their Google Play developer profile.
Developers who do not cooperate may be banned from the Play app store, an email from Google to a developer revealed.

As Phandroid reports, Google is warning developers that their apps could face rejection from the app store unless they publicly list their address on their profiles.
For big app development companies, this new policy won't be a problem, as they'll have office addresses they don't mind publishing. But a large number of Android developers are private individuals who won't feel comfortable sharing their home address. 



Speaking on Reddit, Android developers expressed their concern over the policy, with "hoti0101" commenting "This is unacceptable. Why can't we opt out due to privacy concerns?"
It's been suggested that the new policy has been put in place to discourage scammers from creating misleading apps and releasing them on Android. If Google is now requiring developers to provide an address, then it's going to be far more difficult to quickly create a low-quality apps.
Concerned Android developers reached out to Google to confirm whether the policy does indeed require them to reveal their address. Reddit user "gonemad16" posted this email, which he claimed to have received from Google after querying the new policy: 

We are requiring developers to provide a physical address for all paid apps or apps that enable in-app purchases. The address will be displayed to users in the app store listing page. By September 30, 2014, you'll be able to add a physical address by going to your Settings page on the Developer Console (https://play.google.com/apps/publish/#ProfilePlace[1]). Please comply within 30 days of the warning notification on the developer console. If you do not provide an address within this period, Google may take action affecting your account. This may include restricting your ability to update apps or publish new apps. Continued failure to provide an address may result in published apps being removed from the store

Friday, March 7, 2014

Cocos2D-X Tutorial for iOS and Android: Getting Started

Cocos2D is an amazing and easy to use framework, but since it’s written in Objective-C you can only write games with it for iOS and the Mac.
Wouldn’t it be great if you could use the same easy to use Cocos2D API, but have it run on Android as well? This way you could greatly extend the market for your app, without adding a lot of extra work!
Well, this is possible with the Cocos2D-X game framework! Cocos2D-X is a C++ port of the Cocos2D API, so you can use the API you know and love. And since it’s in C++, it works on many platforms – from iOS to Android to Windows to Linux and more!
In this Cocos2D-X tutorial, you’ll learn how to use Cocos2D-X and C++ to produce a cross-platform “Hello World” app that will run under both iOS and Android.
And in a few days, I’ll post a follow-up Cocos2D-X tutorial that will show you a practical game example – a cross platform space shooter!
So grab your iPhone and/or Android device, and let’s get started! 

Hello, Cocos2D-X for iOS!

Before you go any further, make sure you download the latest version of Cocos2D-X.
Unzip the file in to a folder somewhere on your hard drive. Note the full path to that folder – it will be referred as $COCOS2DX_HOME.
Now that you’ve got the code, let’s install the templates! You can do this with a script that’s inside$COCOS2DX_HOME. To run it, just quit Xcode, open a shell terminal and type:
cd $COCOS2DX_HOME
./install-templates-xcode.sh -f -u
Note: In the above, for the first line, you need to replace $COCOS2DX_HOME with the actual path to where you extracted the files. Simply typing in $COCOS2DX_HOME as part of the command will do nothing.
The installation will simply proceed without any further intervention from you. Once the templates are installed, run Xcode and create a New Project. You should see a new Cocos2d-x temples section in the project template dialog. Don’t worry, the Cocos2d-X templates don’t conflict with the classic Cocos2D templates, so you can continue to create new projects using Cocos2D, when needed.
Let’s try the new templates out! Open up Xcode (4.6 if using the last version) and create a new project, selecting the iOS\cocos2d-x\cocos2dx template:


Click Next, name the project Cocos2DxFirstIosSample, choose iPhone for Device Family, click Next and then click Create.
Now press the Run button to see the Cocos2d-x Hello World app running:

Pretty easy, eh? While you’re at it, take a look at the project files in Xcode – particularlyClasses\HelloWorldScene.h and Classes\HelloWorldScene.cpp. If you’re familiar with Cocos2D, this should look familiar to you – the same Cocos2D API, but in C++!

Setting up Eclipse for Cocos2D-X Development

You’re now done with the Xcode setup part and you need to have a look at the Android Cocos2D-X configuration with Eclipse.
This Cocos2D-X tutorial assumes that you have a fully-functional Android Eclipse standard development environment. 
But wait… A standard Eclipse Android environment is dedicated to Java development only, and Cocos2D-X is based on C++!
Don’t worry, Eclipse has been around for 10 years, so there are tons of plugins out there to extend its core functionality beyond just Java development.
This includes some plugins for C/C++ development! Let’s install them now. Open up Eclipse and perform the following steps:
  • From the Eclipse IDE main toolbar, go to Help/Install New Software
  • Open the Work with combo box and select the item containing your Eclipse version name (Juno if using the last version of Eclipse).
  • Find Programming Languages in the plugin tree (you’ll only see the plugin tree if you checked theGroup items by category checkbox – otherwise, you might have to search the list a bit …) and checkC/C++ Development Tools.
  • Click Next and walk through the rest of the wizard, and wait for the components to download and install. At the end of the install process Eclipse will ask you to restart, click Yes.
  • To ensure that the installation was successful, from the Eclipse IDE main toolbar, go to Help/Install New Software
  • Select the already installed link and check the installation of the following components.
You will now be able to develop C/C++ projects using Eclipse!

Setup the Android NDK (Native Development Toolkit)

Initially, Android development was done exclusively in Java, and most of the Android apps on the market today are Java-based.
However, these days you can write Android apps in C/C++ with the Native Development Toolkit (NDK)! This was introduced by Google in June 2009 as a way to allow components written in C/C++ to be accessed via the standard Java Native Interface (JNI).
Installing the NDK is straightforward:
  • Download the latest version of the NDK here (choose the MacOSX platform).
  • Unzip the tar.bz2 file to the location of your choice. This location will be referred from now on as$NDKROOT.
The NDK brings to the Android environment a C/C++ compilation toolchain, able to cleanly compile/link (using the GCC 4.7 compiler) and build a ready-to-install APK-signed package.
Having this compilation toolchain in place allows you to integrate external C/C++ libraries (like Cocos2d-x) into Eclipse. These libraries, compiled as external dynamic libraries bound inside an APK, communicate with the “legacy Java Android architecture” though the JNI (Java Native Interface).
The compilation toolchain can be used in two ways :
  • Standalone mode: uses the arm-linux-androideabi-g++ directly in your custom make file. This will increase your project complexity/maintainability. I recommend you avoid this mode unless you have no alternative.
  • Integrated mode: uses the $NDKROOT/ndk-build shell tool, which is a highly-customized make file dedicated to NDK library builds. This is the preferred way to go and the mode you will use in this Cocos2D-X tutorial.
Explaining the JNI and NDK would take too long, and is out of the scope of this Cocos2D-X tutorial. There is a lot of documentation about JNI available on the web. The only book seriously covering this topic is available for free here.
If you need more information about the NDK, there is a very good book available that covers NDK C/C++ development: Android Native Development Kit Beginner’s Guide by Sylvain Ratabouil. This book covers NDK programming in depth and should rather be called “From Beginner to Expert.”
The NDK itself also comes with very detailed documentation, located under $NDKROOT/docs.

Hello, Cocos2D-X for Android!

Now let’s do a “Hello, World” Cocos2D-X tutorial for the Android platform, just as you did for iOS.
You will need to do this via the command line, however, since there are no Cocos2D-X project templates available via the Eclipse IDE at the moment. (You know what? This would be a great open source project candidate, if you are so inclined :])
The $COCOS2DX_HOME directory contains a shell script named create-android-project.sh that you will use to generate the android project.
But, before launching this shell script for the first time, you need to make a tiny customization at the top of the above file:
# set environment paramters
NDK_ROOT_LOCAL="/home/laschweinski/android/android-ndk-r8d"
ANDROID_SDK_ROOT_LOCAL="/home/laschweinski/android/android-sdk-linux_86"
Modify these above lines so that the NDK_ROOT_LOCAL variable points to the directory where you installed the Android NDK ($NDKROOT) and ANDROID_SDK_ROOT_LOCAL points to the place where you installed the Android SDK.
Now run the create-android-project.sh script from the command line and you will get several prompts as to various input values. These prompts will ask you to provide the below information:
  1. The first prompt will ask you for the “Input package path”. This is the package name that will be used for java code production. You can use reversed domain notation here (similar to an iOS bundle ID) – something like com.yourdomain.samplecocos2dxandroid (remember to replace com.yourdomain with the reverse domain notation for your actual domain)
  2. Next, you will get a list of available Android APIs and their ids. Depending on what’s installed on your machine, the list will vary. But the prompt at this stage simply asks for the Android API level your app will support and you can use the id for the last item on the list that’s a Google API.
  3. Finally, you have to provide the project name. Call it samplecocos2dxandroid.
The command-line output from the above process will look something like the following:
bash-$ ./create-android-project.sh
Input package path. For example: org.cocos2dx.example
org.jymc.samplecocos2dxandroid
. . . 
Available Android targets:
----------
. . .
----------
id: 25 or "Google Inc.:Google APIs:17"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 2
     Description: Android + Google APIs
     Based on Android 4.2.2 (API level 17)
. . .
input target id:
25
input your project name:
samplecocos2dxandroid
Created project directory: 
/Users/jymen/development/cocos2dx/samplecocos2dxandroid/proj.android
. . .
Added file /Users/jymen/development/cocos2dx/samplecocos2dxandroid/AndroidManifest.xml
Added file /Users/jymen/development/cocos2dx/samplecocos2dxandroid/build.xml
Added file /Users/jymen/development/cocos2dx/samplecocos2dxandroid/proguard.cfg
bash-$ 
Pay attention to the Created project directory: line towards the end of the script output. That’s where your Android project has been created by the script. The project location (/Users/jymen/development/cocos2dx/samplecocos2dxandroid in the above example) will be referred as $PROJECT_HOME from now on.
Note: Do not try to move the project from that location to a different location. At least one of the scripts you’ll work with in the next section will not work if you do.

Building the Project

There are two steps to building the project – compiling the C++ code with a command line script, and compiling the Java code with Eclipse.
But, before compiling, you need to define NDK_ROOT parameter so it points to your $NDKROOTdirectory. Open the $PROJECT_HOME/proj.android/build_native.sh shell script and add the following line at the top of the file:
# paths
NDK_ROOT="/home/laschweinski/android/android-ndk-r8d" 
Modify the above line so that the NDK_ROOT variable points to the directory where you installed the Android NDK ($NDKROOT).
To compile the C++ code, switch to the $PROJECT_HOME/proj.android folder via the command-line and issue the following command:
./build_native.sh 
Note: If at this point you are getting the message “please define NDK_ROOT” you must ensure that you specified correctly the root to your Android NDK directory in the above step.
You should see some output similar to the following in response to the above command:
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Compile++ thumb  : cocos2d <= CCConfiguration.cpp
Compile++ thumb  : cocos2d <= CCDrawingPrimitives.cpp
:
:
:
Compile++ thumb  : cocos2d <= CCTileMapAtlas.cpp
Compile++ thumb  : cocos2d <= CCTouchDispatcher.cpp
Compile++ thumb  : cocos2d <= CCTouchHandler.cpp
Prebuilt       : libstlport_static.a <= /sources/cxx-stl/stlport/libs/armeabi/
SharedLibrary  : libcocos2d.so
Install        : libcocos2d.so => libs/armeabi/libcocos2d.so
Compile++ thumb  : cocosdenshion <= SimpleAudioEngine.cpp
Compile++ thumb  : cocosdenshion <= SimpleAudioEngineJni.cpp
SharedLibrary  : libcocosdenshion.so
Install        : libcocosdenshion.so => libs/armeabi/libcocosdenshion.so
Compile++ thumb  : game_logic <= AppDelegate.cpp
Compile++ thumb  : game_logic <= HelloWorldScene.cpp
SharedLibrary  : libgame_logic.so
Install        : libgame_logic.so => libs/armeabi/libgame_logic.so
Compile++ thumb  : game <= main.cpp
SharedLibrary  : libgame.so
Install        : libgame.so => libs/armeabi/libgame.so
This builds the C++ Cocos2D-X libraries, and the C++ code for your project.
To build the Java code, you’ll create an Eclipse project – that’s way easier than working via the command-line :]
Start Eclipse and go to File\New\Other. Choose Android\Android Project from Existing Code, and clickNext. Click Browse and select the $PROJECT_HOME/proj.android folder, as shown below.

Click Finish, and you now have a project!

At this point the project might have some errors but don’t be affraid, they are pretty easy to fix:
One of the errors rises because Eclipse can’t find the resource “@drawable/icon” so, expand the project tree on the left, open AndroidManifest.xml and change to the AndroidManifest.xml view so you can see the plain text. Look for the following line of code:
 android:label="@string/app_name"
android:icon="@drawable/icon">
and change it by the correct icon name:
 android:label="@string/app_name" 
android:icon="@drawable/ic_launcher">
And, before you close AndroidManifest.xml, modify android:minSdkVersion to be:
 android:minSdkVersion="14"/>
and Save the file.
The second error rises because Eclipse can’t find some Cocos2D-X Java classes. Select Project\Propertiesfrom the main menu and choose Java Build Path from the list on the left. In the Source tab click on Link Source and Browse to the following directory
$COCOS2DX_HOME/cocos2dx/platform/android/java/src/
where $COCOS2DX_HOME is the directory where you installed the Cocos2D-X resources. In Folder namewrite cocos2dx-src, click Finish and OK.


You can now run it. Right click the project in the tree on the left and select Run As\Android Application. The AVD (Android Virtual Device) will launch showing the Hello, Cocos2D-X project (maybe, if it doesn’t work keep reading below):


If the application does not launch on the emulator and LogCat Eclipse view shows the errorjava.lang.IllegalArgumentException: No config chosen, it’s due to an issue with OpenGL ES 2.0 in latest AVD Target versions. To solve it you must take two steps:
1) Go to the Android Virtual Device Manager, select the AVD you are using and click Edit. Then make sure the Use Host GPU checkbox is checked, as shown below:

2) Now open samplecocos2dxandroid/cocos2dx-src/org.cocos2dx.lib/Cocos2dxActivity.java, look forinit() method and add:
this.mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
before:
this.mGLSurfaceView.setCocos2dxRenderer(new Cocos2dxRenderer());
Now try running it again – and hopefully it should work this time.
Congrats, you now have a “Hello, World” project running on both iOS and Android!

Defining a Combined Java/C++ Project in Eclipse

Compiling the C++ code with a command line script and compiling the Java code with Eclipse is cumbersome. It would be a lot easier if you could just build everything using Eclipse.
Luckily, you can do this by telling Eclipse that your Android project is a combined Java/C++ cross language project!
To do this, select the samplecocos2dxandroid project in the left tree, and select File\New\Other from the menu and then, C/C++\Convert to a C/C++ Project from the dialog, as shown below:

Click Next. In the next screen, check the box for your project, select the C++ Project option, and specify the Makefile project\Other Toolchain option for Project type:

Click Finish. Eclipse may ask you if you want to open the C/C++ perspective, just click No if this occurs.
The next step is to change the project settings to specify how to run your make command. In the left tree, right click the samplecocos2dxandroid project, select Properties, and select the C/C++ Build section.

Uncheck the Use default build command checkbox, and in the build command textbox type in:
bash ${workspace_loc:/samplecocos2dxandroid}/build_native.sh NDK_DEBUG=1 V=1
Click Apply, and click OK.
Select Project\Build All from the main menu, and you’ll see the C++ make run in the Eclipse console:
make-displayed-in-eclipse
There are still some warnings to resolve. To see what I mean, open up jni/hellocpp/main.cpp, and you’ll see a bunch of warnings:
Cocos2D-X include files not resolved
These are occurring because you do not have the correct C++ include path specified yet. To do this, in the left tree, right click the samplecocos2dxandroid project and select Properties\C/C++ General\Paths and Symbols\Includes\GNU C++.
Use the Add button to select the two directories shown below, then click Apply and OK.
$(NDKROOT)/platforms/android-14/arch-arm/usr/include
$(COCOS2DX_HOME)/cocos2dx/include
Note: Don’t forget to replace $(NDKROOT) and $(COCOS2DX_HOME) with the actual paths where you installed these on your machine.
Updating paths and symbols for Cocos2D-X
Click Apply and you might be prompted to re-build the indexes. Go ahead and say Yes and then click OKto close the dialog.
Now, if you look at main.cpp, you’ll see most of the include warnings have disappeared:
Most warnings resolved for Cocos2D-X
However, the AppDelegate.h file still can’t be found. This is because the AppDelegate.h file is located in the $PROJECT_HOME\Classes folder. This folder is very important for you since it contains the portable C++ classes for your project, such as HelloWorldScene.cpp, which will be the starting point for your project.
When you created your Eclipse project, you had to select the $PROJECT_HOME\proj.android folder as the root folder since Eclipse requires AndroidManifest.xml to be inside the specified folder. But this means your project does not contain the critical Classes folder, and this is why you’re still getting that warning.
Let’s fix it now. In the left tree, right click the samplecocos2dxandroid project, and selectProperties\C/C++ General\Paths and Symbols\Source Location. Click Link Folder, check the Link to a folder in the file system checkbox, and browse to the Classes directory inside the $PROJECT_HOMEfolder. Click OK, then Apply and OK.
fixing-paths-final
You should now be able to see the Classes directory in your file tree, and the #include “AppDelegate.h”warning in main.cpp should have gone away.
Eclipse will still have some warnings in the project, but this is just because Eclipse is not that great at parsing C++ header files for the code analyzer stage. To disable this, bring up the project properties (right-click the project and select Properties from the context menu) and turn off the warnings in theCode Analysis section, as you can see in the screenshot below:
Turn of C++ Code Analysis and Warnings in Eclipse
Click Apply and then OK and finally – a project you can edit and build with Eclipse! :]

What About the Java Code?

If you look over the project content in Eclipse, you will notice some Java code in the src and gen folders and might wonder what that’s all about.
The main language for Android development is Java. The project template has created some Java scaffolding code for you that loads the C++ code that does all the heavy lifting in your app.
You won’t usually have to modify the Java code, but let’s look at the main class –src\com\xxx\samplecosos2dxandroid\samplecocos2dandroid.java – in more detail to see what it does.
This class contains the main Android Activity class that takes control when the app launches. It will first load the requested C++ dynamic library generated by the NDK:
show-load-library
Since this class derives from Cocos2dxActivity, behind the scenes, Cocos2D-X will give control to the C++ AppDelegate initInstance method, and finally the applicationDidFinishLAunching method.
So to repeat, the Java code just contains wrapper code that you will rarely need to change, since all the game’s logic will be inside the C++ code.

Combining the iOS and Android Project Structures

Right now you have two Cocos2D-X projects – one for iOS and one for Android. Your goal is to have them share the same directories so that you can use the same C++ files (with all your portable game logic) in both projects.
In both of your projects, you have a folder called Classes that contains this portable game code (Android on the left, iOS on the right):
If you look closely at the Classes directory in Eclipse and Xcode, you will see that the C++ files are completely identical! So all you need to do is point both projects to use the same folder, and you are set!
To do this, open up your Cocos2DxFirstIosSample project in Xcode. Select the Classes group, clickDelete, and select Move to Trash when the popup appears.
Next, right click the project in the Project Navigator, select New Group, and rename the new group toClasses. Right click the Classes group, and select Add Files. Select the following files from your$PROJECT_HOME\Classes folder and make sure that the Copy items into destination group’s foldercheckbox is not checked before you click Add:
Xcode-file-selection
Do a Clean and Build of the Xcode project to check that everything is OK.
Congrats – everything is in place and your Xcode/Eclipse combined iOS/Android projects are ready to use!

When to Use Xcode, and When to Use Eclipse?

Now that you have two project files it might not be immediately obvious which you should use when.
The usual development strategy for Cocos2D-X is to develop and test on iOS (via Xcode) first, and after you’ve got that working, make sure it works on Android (via Eclipse) second. Just keep the following rules in mind:
  1. Test often. Develop short pieces of code and test that they work on Android. This way you don’t get too far before finding any problems.
  2. Test on multiple devices: There are a large number of Android devices available, often with subtle differences, so it’s best to test on as many devices as you can lay your hands on.
It’s also possible to have a reversed strategy (develop for Android with Eclipse first), but I find this approach less productive, since Xcode feels faster and easier to use for me than Eclipse. Plus, the Android emulator usually takes a long time to start up and so takes longer when it comes to debugging things whereas the iOS simulator comes up pretty fast each time you start it.

Debugging Tips and Tricks

Debugging the iOS part of the Cocos2d-x project is exactly the same as debugging standard Cocos2D code, so there is nothing special to add here.
However, for Android, here’s some notes.
When building for debug with NDK, a ‘server side’ gdb and gdbcontext is bundled inside the APK generated by the ndk-build shell and populated to the device. This remote debugger will communicate with any compatible GDB client agent.
The best GDB agent to use with Eclipse is the NVidia debug manager plugin, but installing that is beyond the scope of this Cocos2D-X tutorial.
Note:
If you want to install the NVidia Debug Manager plugin, all you really need to do is to go to this pageand download the full Tegra Android Developer Pack even though you might think you don’t need it. When you install the Tegra Developer pack, it gives you the option to select what you want to install and at this point, you can opt to install just the plugin.
However, that will not install the plugin into Eclipse. It will simply put the plugin ZIP file on your hard drive. Now follow the instructions on this PDF to actually install the plugin.
I found that on some physical devices (Samsumg Galaxy S being one of them), the remote debugger always fails to start though it correctly starts with the same APK on an AVD (Android Virtual Device).
To start a debug session select your project, right click and select Debug As/Android NDK Application, as you can see below:
Do note though that you get the Android NDK Application option only if you download and install the NVidia debug manager plugin. Otherwise, you will not see the above option when you right-click.
You can set a breakpoint by double clicking a code line, as you can see here:
When the breakpoint hits, it will halt at that line of code with more information:
Sadly, debugging from Android using GDB may not always work, so you might find it helpful to add an extra debug tracing system in place as an alternative debugging method. For more info on this, contact me and I’ll share some tips on how you might do this.

For More details :