1.Exceptions google api accessNotConfigured 403error The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console. { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured" } ], "code": 403, "message": "Access Not Configured" }} 2. Solutions Google Developer Console "Google Developer Console"..
1. ImplementThis code use string class instead of strtok included in . void StringTokenize(const string& str, vector& tokens, const string& delimiters) { // Skip delimiters at beginning. string::size_type lastPos = str.find_first_not_of(delimiters, 0); // Find first "non-delimiter". string::size_type pos = str.find_first_of(delimiters, lastPos); while (string::npos != pos || string::npos != last..
Sometime we get error from cJSON. Window utf-8 txt file attach big-endian information [EF BB BF]. It cause error when we parse json or use setcookie in PHP. I removed this information using Notepad++.Download Link : http://notepad-plus-plus.org/ 1. Save txt file to UTF-8 File->Save to other -> Set encoding to UTF-8 2. Using Notepad ++ Open txt file in Notepad++. Select UTF-8 without BOM
1. utf-8 to unicode I referenced below site http://en.wikipedia.org/wiki/UTF-8 wstring Utf8ToUnicode(const string& source_str) { int dest_len = 0; int source_len = source_str.length(); const char* source = source_str.c_str(); wchar_t* dest = new wchar_t[source_len]; wstring value; for (int i = 0; i
1. Easing Code Many games and App use Easing Algorithm like scrolling, character moving, etc. Blow show c++ code of Easing Algorithm. start_value : 0 frame's value.change_value : End frame's value - start_value inline float easeLinear(float current_frame, float start_value, float end_frame, float change_value) { return change_value*current_frame/end_frame + start_value; } inline float easeQuadra..
1. Overview In Java, [tryParse] is not supported like c#. When String text is not number, Integer.parseInt() or Float.parseFloat() don't return false but throw exception. So developer have to make this function. One way is using Regular-Expression. 2. Code Below code show Regular-Expression of getting number from String. String text = text_field.getText(); Pattern p = Pattern.compile("-?([\\d]+)..
1. android/log.h In ndk library provide log functions that can be seen in LogCat. First you have to include . #include You can use two functions [__android_log_write] and [__android_log_vprint]. If you want to write log like printf, Use [__android_log_vprint]. It support parameters like %d, %f, %s.etc else [__android_log_write] only send a message. Below show example using [__android_log_write] ..
1. Typeface you can get typeface info by [Typeface.createFromAsset] method. You don't call this method every frame. Because it happen memory leak problem, so I recommend to use Map class to Manage font data. Below show code using Typeface.createFromAsset. Hashtable m_font_type_face = new Hashtable(); private ResourceManager() { m_font_type_face.put("CORBEL.TTF", Typeface.createFromAsset(MainActi..
1. Load texture I used Android BitmapFactory to decode PNG texture. If you want one source multi flatform, Use libpng. This writing show example BitmapFactory decoding. First we have to load image. Theretofore we have to decide resource foloder. A. res/raw Many developer use assets foloder to manage resource, but I decide resource folder res/raw because res folder managed to R.java, there could ..
1. Outline Recently, many developer use OpenGLES 2.0 to make a 2d graphics game. But it have little difficult because of OpenGLES1.0 & OpenglES 2.0 graphic-pipeline difference. Especially, when we meet GLSL shader first-time, it give little fear of programming. Follow writing show shader for someone who want to make 2d graphic game or app. 2. Vertex Shader vertex shader handle each vertex infos ..