How to ask a user to rate your cocos2dx game android - cocos2d-x

I developed my game in cocos2d-x C++ ,done Rating an game functionality using "AppiRater" for iOS, it works very well thanks for the library.
Now i am porting my game to android. Now i cannot use obj-C written AppiRater for android . Is there any library like Appirater written in c++ or else i Please direct me in right direction thanks in Advance.

i found answer myself https://github.com/drewjw81/appirater-android
use this API .It was in java. Follow the given steps
Include the AppiraterAndroid library in your project
Right click your projects properties -> Library section just click add and select the appirater-android library
3.Copy the /res/values/appirater-settings.xml from the AppiraterAndroid library in to your projects /res/values/ folder and adjust the settings to your preference.
eg: your app name,and the market URL ,etc
In appirater.settings .xml change "appirator_test_mode" to true so Rate pop up will appear
every time app launches
4.In your project.java (src/org.cocos2dx/project/project.java) file
public class puffingFrenzy extends Cocos2dxActivity{
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Appirater.appLaunched(this); // ADD this line here
}
static {
System.loadLibrary("game");
}
}
I had a linker error ,Appirater file not found ,even though it was included in ADT.
Right click project->properties->android->in library section add the path of Appirater-android master ->click ok
build and run .its better to run on device than emulator(emulator takes time)

Related

How to navigate between pages in windows universal app using C++/CX

I am new to Windows universal app development. As per my knowledge Windows universal app can be made by using C++/CX , C# or JavaScript. But Microsoft force to do development by using C++/CX because it uses power of winRT much better than others. So i tried the development using C++/CX for Visual Studio 2015.
I come to a topic of Navigation. To perform navigation in app there is one API
this->Frame->Navigate(TypeName(MySecondPage::typeid)). This API gives me a exception at runtime.
This is the detail scenario what i did.
1. I create project by named NavigationSample using C++/CX.
Then i added new Basic Page of xaml for my Second view/ui and named it as MySecondPage.xaml
Now on first page i.e. MainPage.xaml i added One button.
On event of this button , lets say button_Click as event handler i wrote
this->Frame->Navigate(TypeName(MySecondPage::typeid))
Here is the detailed code:
void NavigationSample::MainPage::button_Click(**Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)**
{
this->Frame->Navigate(TypeName(MySecondPage::typeid));
}
This compile and build fine. But gives exception at runtime. (Same scenario works very fine with C#)
So guys please help me how to resolve this issue?
Thanks
Here's a clue:
m_ptrSettingsPage->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]() {
m_ptrSettingsPage->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(AnnuitiesPage::typeid));
}));
Best wait for C++/wimRT

Accessing REST api from Windows CE

I have one Windows Handheld device application which has the requirement of accessing a REST API. The REST API gives me JSON output which I am going to handle via Newton.JSON. Now to achieve modular structure I want to have the communication to the REST API be handled via a different module altogether something like a Class Library. But unfortunately it seems that it is not possible to do so via a class library(or maybe possible). So my question is what is the best alternative to do so?
Please note that I don't want to include those connectivity operations in my front end application project. And I am using .Net framework 3.5 & Windows Mobile SDK 6.0
Thanks in advance
Pseudo class library code:
public function void startQuery() //starts a thread that does the JSON query
//inside thread on query result use OnDone() delegate
private delegate void OnDone(string dateTimeString);
//In main GUI code add a reference to the class lib and init a new object then add an event handler to the OnDone delegate of the class lib
JSONClassLib myJson=new JSONClassLib();
...
myJson.OnDone+=new EventHandler(myEventHandler);
void myEventHandler(sender this, objext o){
//will be called when query is done
}
//you need to use Control.Invoke if you want to update the GUI from myEventHandler
//to start a query use something like this from your class lib
myJson.doQuery(string);
If you add your existing code we may help with creating a class lib and async code
Now I got my answer. Sorry I did a mistake while selecting the project type. I selected "Windows Form Class Library" project instead of "Smart Device Class Library" project. Now that I have selected the right one it is working fine for me.
BTW thanks for those responses.
Cheers

Flash ActionScript - Trace from background Worker

Is it possible at all, or traces are part of the API which is not avalible from background Worker?
Consider this code:
public class Main extends Sprite {
public function Main(container : DisplayObjectContainer = null)
{
if(Worker.current.isPrimordial) {
trace("isPrimordial");
var m_worker : Worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes);
m_worker.start();
}
else {
trace("is NOT Primordial");
}
}
The string "is NOT Primordial" does not appear, however I do see that m_worker.state is "WorkerState.RUNNING".
Some UPDATE: The main thread works and racts to events, however it appears like the backgroung worker does not start until I desconnect the debugger.
And if it is possible, how do I setup the fdb to show these logs?
PS. Im using flash standalone debug player 13 with latest FDT and Apache Flex 4.12.1 SDK.
Ok, so the results for now are:
The background thread (Worker) can write traces with no problems at all if the debugger is not attached, for example if we are using flashlog.txt for the output (output to file).
What is required is: flash debug player (me used v. 14 stand alone and firefox versions).
The setup for using text file as output discussed here:
http://helpx.adobe.com/flash-player/kb/configure-debugger-version-flash-player.html
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html
Correct location of mm.cfg on modern operating systems (and not on Win95!) discussed here:
https://forums.adobe.com/thread/1218258
For me the output to file started to work only after the flashlog.txt file was created by some 3rd party tool (I used Vizzy), but probably it is a permission problem of flasho n windows 8 and the file just can be created manually.
Detailed discussion of the flash traces topic (althoug a little old, but mostly still relevant) is here:
See trace() of Flash when running in browser
Thanks everyone for help.
Create a static Log class that output it's log to trace. Use this log class in your main thread and in your worker. Only the main thread log definition will be used allowing to trace from anywhere.

cocos2d-x c++ -> java for android

Currently I'am developing a game using cocos2d-x.
Of course, for multi-platform use.
basically I use a xcode for coding and development.
I want to attach IAP(In app purchases) separately to each coding for iPhone and Android
Problem to try to call a function of a certain class in Android that did not work.
Sources include the following:
cpp side
MyClass::invoke_init()
{
JavaVM* jvm = JniHelper::getJavaVM();
JNIEnv* env;
jvm->GetEnv((void **) &env, JNI_VERSION_1_2);
jclass cls;
jmethodID method;
cls = env->FindClass("com/joycestudios/game/SampleActivity");
method = env->GetMethodID(cls, "initFunc", "()V");
env->CallVoidMethod(cls, method);
}
java side
public class SampleActivity extends Cocos2dxActivity
{
public void initFunc()
{
Log.v("LOG_INFO", "initFunc()");
}
}
The first test as follows: I'm in progress.
build from xcode and build from build_natvie.sh and last build from eclipse.
But after run on eclipse, Just black screen and shuts down.
How to call a function of a java class?
What I looked at several samples, including also analyze the problem, I do not see any problems?
Can you tell if you find any error log?
First check if your game is working fine on android..
Den we can have a look how to call the function.
Generally for calling native method I use MessageJni class available in Cocos2d-x library.
I create my methods in MessageJni class which calls for native methods.
Its easy and convenient way of calling native methods.
Just google using MessageJni class. It will ease your work.
:)

AIR 3 Native Extensions for Android: How to add external JAR to Java Android Project

I have added external jar to Java android project and exported as a jar.
and i am using the exported jar in my AIR mobile library. In my Mobile application, referring library project.
Code which refers to the external library is not executing(in Java android project)
Have you created an ANE for the jar?
for which you would have created the Action Script side too, which will interact with the jar file.
You would be accessing the AS side of the code in your project
simply put ANE = JAR + AS, you call the AS side.
Link for more details (you probably already know this :) .. .)
http://www.adobe.com/devnet/air/articles/developing-native-extensions-air.html
I tried Native Extension for VIBRATE example and that is working fine.
http://www.adobe.com/devnet/air/articles/developing-native-extensions-air.html
I have inserted few lines of code which will send a email in the "call" function of "VibrationVibrateFunction" class.
#Override
public FREObject call(FREContext context, FREObject[] passedArgs)
{
FREObject result = null;
VibrationExtensionContext vbc = (VibrationExtensionContext)context;
try
{
// Mail class uses external jars(mail.jar, Activity.jar)
Mail m = new Mail("nata....#gmail.com", "password");
m.addAttachment("/sdcard/DCIM/Camera/IMG_20110906_173932.jpg");
m.send()
// Vibrate Code
FREObject fro = passedArgs[0];
int duration = fro.getAsInt();
vbc.vb.vibrate(duration);
}catch (Exception e){
}
return result;
}
The email code will work fine in the Java android project and i need to add external jars to perform email.
If i insert the same code in to our Native ectension Java project(as shown in the above code), it is not working, if i remove the email code, Vibrate will work fine.
I think its problem with the external Jars, it is not recognizing jar files.
Please let me know if you know how to add external jars.
Thank you