
App42 Platform

App42 Platform

Nokia S 40 Asha Series
Doing Facbook OAuth on Nokia S40 and J2ME devices is the biggest challenge while creating the social Apps for this platform because of unavailability of the Facebook J2ME SDK and inapp browser limitation of J2ME devices. App42 platform J2ME SDK provides an easiest and quickest way to do seamless Facebook OAuth on J2ME devices without going in to the complexity of underlying protocol.
Here are the few easy steps to do the FB OAuth for these devices.
Canvas URL : https://api.shephertz.com/cloud/1.0/social/facebook/saveFeaturePhoneFBToken? Secure Canvas URL : https://apps.shephertz.com/socialkeys.php?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ServiceAPI sp = new ServiceAPI("YOUR_API_KEY","YOUR_SECRET_KEY"); String fbAppId = "YOUR_FB_APPID"; String fbAppSecret = "YOUR_FB_APP_SECRET"; String accessToken = null; String [] appPermissions = new String [] {"publish_stream","friends_online_presence"}; String code = sp.buildSocialService().doFBOAuthAndGetToken(midlet, fbAppId, appPermissions); //The Above call will open user login OAuth page in browser and will wait till user authorizes the app. accessToken = sp.buildSocialService().getAccessTokenFromCode(code, fbAppId, fbAppSecret); System.out.println( " Token : " + accessToken); Social socialObj = sp.buildSocialService().getFacebookFriendsFromAccessToken(accessToken); Vector friendList = socialObj.getFriendList(); //This will return Facebook friends of user whose access token was passed. |
You can use other App42 backend services like Gaming, Storage, File Storage, Messaging, Geo Spatial, Custom Code to make user engaging social app with writing any backend for J2ME/S40 devices. Start making beautiful Apps with App42 Cloud API S40 SDK. Here is the Sample Code to get you started.

Unity3D is a popular cross-platform game engine for building sophisticated 3D games. Using AppWarp, developers can now add realtime communication in their Unity3D games to build beautiful, rich and engaging multiplayer games. The great thing is that developers can do this without any server side code or socket level programming as all the communication is managed by AppWarp SDK and cloud.
To help you get started, we have created a sample project that illustrates how to get the pieces together and set up the basic code required. Complete source code for the sample is available in our Git Repo. Below are some of the relevant code snippets. To initialize the SDK. You need to pass in your Api key and Secret key.
WarpClient.initialize(apiKey,secretKey);
Now create and add a Listener which implements the relevant WarpClient callback interfaces and connect with the server.
Listener warpLayer = new Listener(); WarpClient.GetInstance().AddConnectionRequestListener(warpLayer); WarpClient.GetInstance().AddNotificationListener(warpLayer); WarpClient.GetInstance().AddRoomRequestListener(warpLayer);
Now simply call connect to establish your connection with the server.
WarpClient.GetInstance().Connect();
Once your connection is established and authenticated, you will simply join a room and subscribe it to receive its notifications.
WarpClient.GetInstance().SubscribeRoom(roomid); WarpClient.GetInstance().JoinRoom(roomid);
After you have joined the room, you can start sending your user’s coordinates to other users in the room. In this example we will use our Chat api to do that
string json = "{\"x\":\""+transform.position.x+"\",\"y\":\""+transform.position.y+"\",\"z\":\""+transform.position.z+"\"}";
WarpClient.GetInstance().SendChat(msg);
Once the remote player also joins, you will start receiving messages from it. Handle them and move the cylinder representing it
public void onChatReceived (ChatEvent eventObj)
{
Log(eventObj.getSender() + " sent " + eventObj.getMessage());
SimpleJSON.JSONNode msg = SimpleJSON.JSON.Parse(eventObj.getMessage());
if(eventObj.getSender() != id)
{
appwarp.movePlayer(msg["x"].AsFloat,msg["y"].AsFloat,msg["z"].AsFloat);
}
}
And thats it! Simply build and run your Unity3D application on two different endpoints and you will be able to see each other’s endpoint movements in realtime (a simple white cylinder).
You can also add leader boards, reward management and push notifications to your game by importing the App42 Unity asset in to your project. For a complete list of backend APIs available, visit the App42 page.
Instructions on downloading this sample and getting your API Key, Secret Key and RoomId can be found in our GIT repo here. To learn more about AppWarp, check out the product overview.

App42 provides a rich set of leaderboard APIs. In this post, I will describe how to integrate your Cocos2D game with the App42 cloud framework and use its leader board APIs. Please see my previous blog post on why a rich leader board is important for your game.
We will use our Ninja Fight iPad demo game to walk you through the integration. Ninja Fight is a simple multiplayer game in which opponents have to strike each other with missiles while avoiding getting hit themselves. The game starts of by asking the player to enter its name. This is the name that will be used later to submit the score for the user.

Once two users have started fighting, the game will transition to the fight scene. This is where the realtime action will happen using AppWarp apis. Using AppWarp with Cocos2D was described in an earlier blog post. Players simply need to tap in the direction of the opponent to fire missiles. You can also move the player by dragging it using your finger on the iPad.

Ninja Fight leaderboard
Once the game is over the user’s score is submitted and an option to view the game’s leader board is given. Upon selecting this option, the game’s leader board is displayed using our API. This will simply list the users who have submitted the top scores, their rank and the score.
Now to the actual code itself for saving scores and getting the top scorers! Here is the initial set up that you need to do once before you can use all the leader board APIs.
ServiceAPI *serviceAPIObject = [[ServiceAPI alloc]init]; serviceAPIObject.apiKey = APP42_APP_KEY; serviceAPIObject.secretKey = APP42_SECRET_KEY; ScoreBoardService *scoreboardService = [serviceAPIObject buildScoreBoardService];
To submit the user’s score to the cloud, its one simple API call
[scoreboardService saveUserScore:@"Ninja Fight" gameUserName:userName gameScore:score];
Retrieving your game’s top 20 scorers from the cloud is also straight forward.
Game *game=[scoreboardService getTopNRankers:@"Ninja Fight" max:20]; NSMutableArray *scoreList = game.scoreList;
The API works synchronously so you should perform the API calls on a back ground thread so as to not block your main thread. This is extremely easy using the performSelectorInBackground utility iOS method.
Complete source code for the game can be downloaded from our Git Repo with the Readme file containing the instructions on how to set up and get it working.
App42 provides a complete set of leader board APIs which allow you to add advanced social leader boards based on groups, weekly, daily top scorers etc. Similarly you can use our reward management APIs to manage in-app rewards and purchases. For a complete reference, visit this page.
Please send your feedback and queries to us at support@shephertz.com
App42 platform announces its Java Script API for Backend as a Service platform. Now, one can add backend to HTML5 Apps with few lines of code without writing any server side logic using App42 platform. One can also choose to use different technical and business services based on app requirement and develop HTML5 Apps with lesser time.
Here are the steps to add this in to your HTML5 Apps
script type="text/javascript" src="App42-all-x.x.x.min.js"
App42.initialize("API KEY","SECRET KEY");
var user = new App42User();
user.createUser(userName, pwd, email,{
success: function(object) {
// Callback for Success },
error: function(error) {
// Callback for error }
});

BlackBerry 10
App42platform is now equipped with BlackBerry 10 webworks SDK. This means one can make cloud enabled apps with scalable App42 platform with few lines of java script code. One can choose from different business and technical services available in App42 platform to make a user engaging and feature rich app for BlackBerry 10.
Here are the steps to add it in BlackBerry 10 webworks App
script type="text/javascript" src="https://raw.github.com/shephertz/App42_JAVASCRIPT_SDK/master/App42-all-0.6.0.min.js"
App42.initialize("API KEY","SECRET KEY");
var user = new App42User();
user.createUser(userName, pwd, email,{
success: function(object) {
// Callback for Success },
error: function(error) {
// Callback for error }
});
Download the SDK and sample code from our BlackBerry 10 webwork repository to get started.
Mobile games have become an integral part of the industry landscape over the last few years. With devices becoming more and more powerful and internet connectivity becoming ubiquitous, there is potential for a lot of innovation and these are exciting times for mobile developers. However, with increasing competition, the challenge is to make games that keep their users constantly engaged and compel them to keep coming back.
Adding leader boards to your game is a natural way of engaging users. Hard core gamers like to brag and are always interested in beating the best and it is not uncommon to see them posting screenshots with their highest scores on their Facebook walls. However, most of the users of a game are not going to be hard-core gamers and would not be interested in seeing the leader boards and posting scores on their Facebook wall if their ranking is say 21,053! It will also not interest them in seeing who is at the top of the tree and with how many points, if they are not even close. How can we engage such casual gamers through leader boards? The idea is to develop leader boards, which are more relevant to the user by making them social. We make them social by showing a user where they stand amongst their friends. So while it may not interest a casual gamer to see how they are doing compared to random strangers across the world – they would want to see how they are doing compared to their colleagues, classmates, siblingsetc.
A prerequisite for mobile developers to build such relevant and engaging experiences, is the data storage on the cloud and its efficient retrieval in the desired form. Its time consuming to deploy your own DB on the cloud, cluster it, secure it and then expose it as a web-service in the form desired by your game running inside a user’s device. App42 leader board APIs make this task easy by providing SDKs to access and save your game scores on our readymade backend. App developers can determine the relevant user list according to their App’s user management such as Facebook friends, Twitter followers, Instagram followers or their own in-App buddy lists. Through simple API calls from the SDK, App42 backend will fetch the data requested from the backend. Of course, App42 leader board APIs also provide global leader boards and leader boards based on time such as daily, weekly top scorers etc. Another great thing is that you are not tied to a particular platform since App42 leader board SDKs are available for all devices like iOS, Android, J2ME, Windows Phone, Blackberry etc.This is great if you are a mobile developer as you need not hire a backend expert or learn these technologies yourself, reducing your time to market. Go ahead and try right now!
In todays day and age one does not have the luxury to build applications, which have release cycles beyond few months leave apart years like before. One needs to be super agile and focus on your core expertise, leverage whatever one can use and release the app at the earliest. Sticking to the non-invented-here syndrome, just might be a recipe for disaster.
You imagine about an App idea, be it Mobile, Web, Gaming or Social App and most likely you will find it in one of the AppStore, if not most likely someone, somewhere in some garage or a big company is working on the same idea. Time to market is essential, releasing the app late might just loose its relevance in the market or catching up with competition might become a daunting task.
Developing a non-trivial App requires expertise at various layers of the architecture and platforms.
Device : iOS, Android, Windows 7/8, HTML5, J2ME for Mobile devices
Server Side : PHP, Ruby, Python, Java, Scala, Groovy, Closure, .Net, Node.js etc
Databases : RDBMS, NoSQL, Embedded etc.
Cloud Computing : IaaS – Infrastructure as a Service, Traditional Hosting, PaaS etc.
The developer also needs to have knowledge on setting up the right configuration for Firewall ports, Security, patches, high availability, Scalability, Performance etc.
System Monitoring & Management – The health of the backend servers and managing the servers and data (e.g. Backups), geographical redundancy etc.
For a developers the list activities to be done and skills required across platforms and layers of architecture might consume too much of their time since instead of focusing on their core features. Lot of time goes into non-core activities.
Developers eventually might think that their idea to see the light of the day might be quite far from what they had imagined.
Even if the developer is an expert, the sheer time and effort it will take to achieve this might be more than the time and budget they have.
- It might not be cost effective for them because taking up virtual machines with IaaS provider is quite expensive than one imagines and paying them even before your App is released in the market itself is something which might effect his total budget significantly.
- Development of server side logic requires different skills, different than Device technologies and might consume lot of time and effort.Even if one decides to develop in-house, which in turn might inflate the cost.
- For Service companies engaged in outsourced App development. The development is done by two separate teams, one doing development on the device/client and the other specializing on the server side. The device team is always dependent on the server team and they always end up fighting on the desired interface or their frequent changing. This dependency adds on to unnecessary pressures on time lines and team morale.
- Managing your servers and infrastructure for Non-Functional requirements is complex e.g. Scalability, Performance High Availability, Security etc. Also requires lot of time, effort and cost. Not to forget specialized skills especially for capacity planing, sizing and setting up the Physical Architecture.
What if some of the pain points illustrated above is taken care by an external service provider. Somebody whose bread and butter is to manage backend apps.
- Continuously keeps on adding new features and maintaing current ones with public interfaces which are versioned.
- Keeps the developer oblivious of the complexities of the deployment of the app on the cloud, server installation and its management.
- Offers out of the box features for most of the common cases.
- For the ones which requiers some custom logic gives an execution environment for custom code to be deployed and run on the backend server along with the existing servers.
- Provides native SDKs for all popular platform for device and web.
- Makes supporting more than one platform easier since the backend remains the same only the native SDKs, which have similar interface has to be changed.
- Provides a Management Console which allows access and management of all the data generated through the usage of the SDKs
Backend as a Service - BaaS comes to the rescue. It is a logical evolution of Platform as a Service – PaaS, which tries to solve the above pain points and more. BaaS is a layer which sits over PaaS. Most often it provides a REST based interface to all its services which can be accessed through native SDKs. A further more specific platform for Mobile development is Mobile Backend as a Service – MBaaS
- The developer just needs to add the respective native SDK library based on the technology in which he is developing, write few lines of code to integrate and voila
- Gets out of the box functionality from day one. No need to manage servers, spend time in writing boiler plate code
- Have flexibility to write custom code.
- No need to learn, hire or develop most of the server side functionality
- And with all of the above save time, effort and cost.
Backend as a Service is getting evolved everyday. Its also participating in the MEAP vision helping app developers to become successful which MEAP – Mobile Enterprise Application Platform a term coined by Gartner in their Gartner Magic Quadrant.
Applying the cliched 80-20 rule. Intention is to cover 80% of the features which one requiers on the server side for App development. For remaining 20% features, some BaaS Providers have started offering provision to run custom code on the cloud. One can even mash two or more APIs and carve out a higher level facade API.
Most Common services which the BaaS Providers offer are :
- User Management
- Storage
- Push Notification
- Social
- Geo Spatial
Already Backend as a Service is being used by many developers across platforms. The pace at which it is evolving, it is surely a technology which one cannot ignore and to reckon with.
![]()
Xamarin has developed a powerful platform on top of Mono which allows developers to build Native iOS and Android apps using C#. This is great for .Net/C# developers who want to build iOS/Android apps but are not experienced in Objective-C or JAVA. Another advantage of using Mono is that you can share almost all of your client-side business logic if you are building an app for both Android and iOS.
You can now build cross-platform iOS and Android games and apps on top of the Mono platform using AppWarp cloud gaming network. Unlike many 3rd party iOS/Android libraries which require developers to write a proxy/projection layer on-top of them when including in a MonoProject – AppWarp Mono library works as is. This is because we have specially built a Mono compatible flavor of our SDK eliminating this pain point for developers.
We have developed a simple demo chat application illustrating how you can integrate AppWarp’s mono compatible library in to your project and get access to the powerful AppWarp real-time multiplayer cloud network. Both the Android and iOS versions of the applications follow the same pattern. There are two screens in the application – a Join Screen and a Chat Screen. The Join Screen takes the user name as input and joins a room in the AppWarp cloud. The Chat screen allows the user to send and view chat messages in real-time.
Join Controller/Activity code snippets.
WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);
WarpClient.GetInstance().JoinZone(this.nameTextField.Text);
WarpClient.GetInstance().JoinRoom(Constants.CHAT_ROOM_ID);
Chat Controller/Activity code snippets
WarpClient.GetInstance().SendChat(this.inputTextField.Text);
public void onChatReceived (ChatEvent eventObj)
{
String sender = eventObj.getSender();
String message = eventObj.getMessage();
}
Complete source code for both Android and iPhone chat applications can be found on our GIT repo here. You can see how we have shared almost all of the C# code in the iOS controller and Android Activity class is the same.
Interested in learning more about AppWarp?
Take a tour or Sign up right away!.
Also take a look at our cross-platform Leader board and push notifications apis for adding comprehensive out of the box cloud support in your games and apps.
Do try these out and share your feedback with us on support@shephertz.com
Today a significant market share is acquired by Geo Spatial enabled apps on all famous app stores. There are few consideration and challenges while making Geo enabled apps. Lets first look into what it really takes to give the power of Geo Spatial to your app. There are two main components in Geo Spatial enabled applications, one is creating the data source for geo points and another in searching the data source for given input. For example, if you want to create an app for café search, you have to first create the data source of café by creating data points in it. Here data points are individual café at specified location. Second point is searching those data points in the data source from given geo input. For example searching the nearby café from current location of user. Creating data source and searching in it require GIS data base like postgrase, mongoDB etc to be installed and should be accessible from your app. You might need to create HTTP interface over it and an admin interface for populating/creating the data points. You also have to plan its scalability, high availability, data backup and other infrastructural considerations. If you dont want to do all above stated things, App42 Geo Spatial APIswill help you in only focusing the business logic of your app and rest will be taken care by our platform. Creating Data Points for your app, can be done with App42 APIs or through AppHQ UI interface. Similarly there are already cross platform APIs available to do the search on your data source.
Today all famous apps run on almost all platform to cater most of the audience. To develop and support all platforms to your app requires lots of platform specific things to address. There are some frameworks like PhoneGap which has reduced this work and provided a way through which one can write entire app using this framework and then convert this into target platform like iOS, Android and more.
However there are still lots of things which are beyond the offerings of these frameworks. Making cross platform Push Notification support is one of them. Before we go into detail of challenges, lets see what are the key component in Push Notification Engine.
Key components in Push Notification Engine is described below
Challenges on Supporting Cross Platform Push Client
App42 Push Notification Service uses the same technique to deliver cross platform push notification to your app with out writing any backend server. You can send a message to any target platform from any device/platform using following sample Android code snippet
1 2 3 4 5 | String userName = "Nick"; String message = "Hi Nick! you have won 10 points"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); PushnotificationService pushnotificationService = api.BuildPushnotificationService(); PushNotification pushNotification = pushnotificationService.sendPushMessageToUser(userName,message); |
In this blog post, I will discuss the trade-offs of the commonly used protocols for communication in realtime games. One of the most essential components of building a multiplayer game is the communication between players. Picking the right protocol for your game is crucial and impacts your game’s architecture and performance.
AJAX/Long polling
In this technique the client always keeps a parallel pending HTTP request open with the server. The server only responds to this request when it has something to send (push) to the client. As soon as the response arrives, the client will again open a new pending HTTP request and send to the server. The good thing is that the same REST communication layer will work across all devices and browsers allowing you to reuse a lot of the logic if building a cross platform game. Another key advantage is that the HTTP protocol takes care of all the network topology/proxy/firewall issues for you and your games should work in almost any possible setup. The other advantage is that there is a wide array of options available to implement your game server – which is simply a web server in this case.
The main drawback with this approach is when it comes to performance. Every request by the client sets up a new underlying TCP connection thereby increasing the round trip times. Another thing to keep in mind is the large message sizes owing to the protocol’s own headers increasing both bandwidth and processing at both client and server. Yet another limitation is that any binary data you want to send will require to be Base64 encoded/decoded as HTTP is string based. Finally you don’t have control over browser time outs and need to tune the timeout values carefully. This technique is only recommended if you are building a soft realtime game which has a low frequency of messages exchanged between the users such as turn based card games.
AJAX Server Push
Another AJAX based technique is the server push. This technique allows the the server to send a stream of notifications back to the client without client sending a new HTTP request. The idea is to send an initial request form the client and then the server keeps responding with multipart portions whenever it has data to send back to the client without completing the response. This solves the problem in long polling of having to establish a new connection after every response but the channel is one way i.e. from server to client. When the client has new information to send to the server, it will still need to send a new HTTP request. This makes it ideal for applications such as facebook and twitter feeds where the server keeps updating the client. A deeper discussion on this can be found here. An upcoming feature of HTML5 known as server side events is aimed to provide the same behavior without the need of doing all the multipart response work on the work from the server.
TCP
This is the most commonly used protocol in realtime games. The bidirectional connection is kept alive throughout the life of game play – making it easy to push async updates from the server to the client. It frees you the strict request/response HTTP paradigm which hinders the long polling approach. The other advantage is the ability to send binary data and flexibility to develop your own messaging protocol optimized for your game’s scenario. This is great plus as it reduces the message size, bandwidth and doesn’t require Base64 encoding. Since the persistent bidirectional TCP connection is initiated from the client – it also works across most NAT topologies and doesn’t require you to do something like UDP punching to communicate when behind a NAT. A good understanding of socket programming is a must before you begin as investigating bugs and issues can become quite time taking. The other thing to consider is that while most devices allow TCP socket programming – there are differences in the way they are exposed to the developer so you might find your iOS layer looking quite different to your WP 8 layer for example. Which also means that you may have different bugs in different platforms of your game!
UDP
One can think of UDP as a simplified version of TCP. Its simple in that it does less (no sequencing, no sliding window) and guarantees less (no reliability, no in order delivery). Since the reliability and sequencing overhead is not involved, it makes UDP even faster than TCP on an average. Similar to TCP, UDP allows you to send binary data and means you can build your own optimized messaging protocol. The obvious drawback are of course lack of reliability and potentially out of order delivery of messages. The other problem is when it comes to NAT traversal as there is no persistent connection kept alive as in the case of TCP. You will have to employ techniques such as UDP punching, STUN etc. to get your game to work when behind a NAT. Also many cellular network providers will simply block UDP traffic making your game unplayable when on 3G.
If you do decide to use UDP – its recommended that you use TCP in conjunction with UDP. Use TCP for operations such as join/leave room, chat, sending and responding to invitations etc. Essentially use it for operations that are not hard realtime but can impact other players and the game play directly. You can then use UDP for exchanging in game operations such as updating car coordinates etc. in a car racing game for example.
WebSocket
The most popular feature of HTML5 for game developers is WebSocket. This is essentially a wrapper around a TCP connection between the end users browser window (tab) and the server. WebSockets allow you to send binary data from the browser thus opening up the possibility of building your own custom optimized protocol optimized as in the case of TCP and UDP. Most of the advantages and disadvantages of TCP directly apply for WebSockets as well. Note that while sending and receiving data from a web socket is straight forward – you need to do some additional work on the server. This is because web sockets do their own binary encoding on top of TCP. So you need to special case this when handling TCP connections on your server if you are supporting both native TCP connections and WebSocket TCP connections. Another thing to be vary of when selecting websockets is that they are not yet supported on all browsers. A demo of a multiplayer game using websockets can be found here.
That covers the most common technologies and protocols that game developers use for communication in multiplayer games. Hopefully you will find this post useful and good luck in building your multiplayer game!
We have developed AppWarp in a way that we abstract all the nitty gritty details of protocols and their implementation from game developers. AppWarp supports TCP/UDP in the native SDKs and WebSockets in the Javascript SDK. This allows you to build cross-platform games easily and in a short time as you don’t need to spend time debugging and testing your client and server communication layer code.
Cocos2D is a popular open source framework for building iPhone games. Its quite powerful and can be used to develop a wide range of 2D games. Here is a list of some of the apps on the appstore developed using Cocos2D.
This blog describes how to develop realtime multiplayer games using Cocos2D by integrating with the AppWarp apis. AppWarp is a new cloud framework which allows you to develop cross-platform realtime multiplayer games by taking care of all the networking, routing and messaging between players. You can get an overview of AppWarp here.
There are many tutorials on how to use Cocos2D – one great one can be found here.
The best way to get started on making your first realtime multiplayer Cocos2D game is to download the sample project code from our git repo here. Its a simple soccer ball kicking application which illustrates the realtime multiplayer aspect integrated in to Cocos2D. Follow the 5 simple steps in the README file to quickly get up and running.
Here is a screenshot of how it should look once setup.
Enter your name in the first screen and hit ‘start’. Now run the app on another simulator or device and enter a different name and hit ‘start’.
Both the devices should see the following screen at this time. Start tapping on the screen and see the balls flying from both the devices/simulators!
The high-level operation performed in this example are
1. Initialize the AppWarp SDK with your keys
2. Connect and JoinZone with the name entered.
3. Subscribe and Join the room you created.
4. Use the SendUpdatePeers api and OnUpdatePeersReceived event to do the magic.
Interested in learning more about AppWarp?
Visit our iOS developer guide.
Integrate cloud Leader board apis in your game
Send cross-platform push notifications
Please try this out and share your feedback with us on support@shephertz.com
It has been always tedious task for choosing right configuration for MongoDB on AWS EC2. Choosing right configuration in this environment is always a challenging and it takes lots of time to make your system Production Ready.
You can use following configuration and steps to install MongoDB in EC2 environment for creating Production Ready HA replica set.
All it needs is two machines that will be used as PRIMARY(Master) and SECONDARY (Slave) node and one ARBITER machine for the replica set. However it might get changed based on your application requirement and you can opt for higher number of nodes based on your need. ARBITER is only required in case of even number replica set. If you want to maintain replica set with one PRIMARY and two SECONDARY, ARBITER is not required.
Hardware Requirement
Installation steps
sudo mkfs -t ext4 /dev/<Created_EBS_Volume>sudo mount -a /dev/<Created_EBS_Volume> /data/dbsudo echo ‘/dev/sdf /data/db auto noatime,noexec,nodiratime 0 0’ >> /etc/fstabmongod --rest --replSet myHASet (Where myHASet is the name of Replica set, you can choose any name of your choice){
"set" : "sample",
"myState" : 1,
"members" : [
{
"name" : "<PRIMARY_HOSTNAME>:27017",
"self" : true
}
],
"ok" : 1
}mongod --rest --replSet myHASetrs.add(“<SECONDARY_HOSTNAME>”);{ "ok" : 1 }mongod --rest --replSet myset --oplogSize 8rs.add( { _id:2, host:”<ARBITER_HOSTNAME>”, arbiterOnly:true } )
Connecting Replica Set from JAVA API
1 2 3 4 5 | List addrs = new ArrayList(); addrs.add( new ServerAddress( "<PRIMARY_HOST>", "<MONGO_PORT>" ) ); addrs.add( new ServerAddress("< SECONDARY_HOST>" , "<MONGO_PORT>")); Mongo m = new Mongo(addrs); DB db = m.getDB("<NAME_OF_DB>"); |
Here is an honest attempt to guide you to setup MongoDB on AWS EC2. Though this is an open forum and you all are open to post your comments if I have missed anything.
Also, if you don’t want to get into setting up the infrastructure and administration for MongoDB, you can directly use our App42 NoSQL Cloud Storage Service. This service can be accessed using our REST API or using native platform SDKs available in different languages like iOS, Android,J2ME, JAVA, PHP, Ruby, Windows Phone and C#.

AppWarp Windows Phone SDK now supports WP8!
Today we’ve added WP8 to our list of supported mobile platforms allowing you to make realtime multiplayer games on WP8.
Windows Phone 8 was recently launched by Microsoft and already boasts of over 120,000 apps on its store. Read more about WP8 and all its feature here.
We have built our Windows Phone family SDK in such a way that the same SDK dll works for both Windows Phone 7.1 and 8. This means that if you are a WP developer, integrating your app with our SDK will be hassle free when switching between the two platforms.
To get you started, we have created a demo tic-tac-toe game using our WP SDK that works on both the platforms. This game illustrates how you use the SDK to build realtime-multiplayer games on WP. You can download the source from our GIT repo.
Follow these steps to get up and running.
1. Login/Sign-up on AppHQ (ShepHertz developer dashboard)
2. From the dashboard, create a new app of type appwarp cloud gaming.
3. Note its keys – you will require them to initialize the SDK in your code.
4. From the dashboard, create a new room with 2 max players. Note its room id – you will require this in your code.
5. Download the sample from GIT and setup the Visual Studio project.
6. In the project, add your keys and room id where indicated in the GlobalContext.cs file.
7. Debug/Run the application.
Please try this out and share your feedback with us on support@shephertz.com
Want to know more about developing on AppWarp?
You can also check out our App42 cloud apis to to publish and retrieve your games top score leader boards, send push notifications and much more!