Tag Archives: api

The problem that the content extra data in the notification cannot be updated

Recently younger brother when writing a find out about the background data processing service within the PendingIntent NotificationManager to send the Notification of the Intent of the Extra data cannot update, unable to get even, after tests found that the same ID Notification first Intent can only be stored data, even if use the NotificationManager. Cancel also of no help.
Found after examined the related API, use the PendingIntent. GetActivity (mContext, 0, mActivity, 0); After the Notification is opened, the target Activity cannot retrieve any additional data from getIntent(). Set the flag of the getActivity function to either pendingintent.flag_update_current or pendingintent.flag_cancel_current according to the API.
Also put a PendingIntent, getActivity function can be used in several flag value meaning:

0:

Default value, if the described PendingIntent already exists, then keep it without change.

FLAG_CANCEL_CURRENT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent already exists, the current one is canceled before generating a new one. You can use this to retrieve a new PendingIntent when you are only changing the extra data in the Intent; By canceling the previous pending intent, this ensures that only entities given the new data will be able to launch it. If this assurance is not an issue, consider FLAT_Update_current

Constant Value: 268435456 (0 x10000000)

FLAG_NO_CREATE:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent does not already exist, then simply return null instead of creating it.

Constant Value: 536870912 (0 x20000000)

FLAG_ONE_SHOT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : This PendingIntent can only be used once. If set, after send()

FLAG_UPDATE_CURRENT:

For use with a Flag with the getActivity (Context, int, Intent, int) , getBroadcast (Context, int, Intent, int) , and getService (Context, int, Intent, int) : if the described PendingIntent already exists, then keep it but its replace its extra data with what is in this new Intent. This can be used if you are creating intents where only the extras change, and don't care that any entities that received your previous PendingIntent will be able to launch it with your new extras even if they are not explicitly given to it.

Constant Value: 134217728 (0 x08000000)

How to use higher version of OpenGL SDK in windows?

 
 
Now OpenGL has version 3.2, Visual C ++ 2005 comes with OpenGL SDK is version 1.1, want to use the advanced version of OpenGL, go to the OpenGL official website, but that only defines the API standard, there is no implementation, I searched the Internet OpenGL2.0 SDK OpenGL3.0 SDK, but did not find the download address, finally found that is to use the extension library way.
 
Download glew (The OpenGL Extension Wrangler Library), http://glew.sourceforge.net/index.html
 
What’s inside:

├ ─ bin
│ glew32. DLL
│ glewinfo. Exe opengl support is used to view the current system of the graphics card
│ glewinfo. TXT
│ VisualInfo.exe is also used to view some graphics card situation
│ visualinfo. TXT

├ ─ the include
│ └ ─ GL
│ glew. H
│ glxew. H
│ wglew. H

└ ─ lib
Glew32. Lib
Glew32s. Lib
 
 
usage
 
 
1. First refer to the header file
#include < gl/glew.h> // must be put first
#include < gl/glut.h>
 
2. The initialization
// Glew is initialized after glutCreateWindow
GLenum err = glewInit ();
If (GLEW_OK! = err)
{
/* Problem: glewInit failed, something is seriously wrong. */
Fprintf (stderr, “Error: % s/n,” glewGetErrorString (err));
}
Fprintf (stdout, “Status: Using GLEW %s/n”, glewGetString(GLEW_VERSION));
 
 
Note: If you use a graphics card that does not support the advanced version of OpenGL functions, the operation will crash
 
 

Gles2.0 Chinese API glgeterror

The name of the
GLG Terror – Returns an error message
C specification
GLenum glGetError ( void ) .
describe
GlGetError returns the value of the error flag. Each detectable error is assigned a numeric code and a symbolic name. When an error occurs, the error flag is set to the corresponding error code value. No other errors are recorded before the glGetError (return error code) is called, and the flag is reset to GL_NO_ERROR. If a call to glGetError returns GL_NO_ERROR, there are no detectable errors since the last call to glGetError or since GL was initialized.
To allow a distributed implementation, there may be multiple error flags. If any single error flag records an error, it returns the value of the flag and resets the flag to GL_NO_ERROR when you call glGetError. If more than one flag records an error, glGetError returns and clears any error flag value. Therefore, if you want to reset all error flags, you should always call glGetError in the loop until it returns GL_NO_ERROR.
Initially, all error flags are set to GL_NO_ERROR.
The following errors are currently defined:
GL_NO_ERROR (0)
No errors were recorded. The value of this symbolic constant is guaranteed to be 0.
GL_INVALID_ENUM (1280).
An unacceptable value was specified for the enumeration parameter. Offending commands are ignored and have no side effects other than setting the error flag.
GL_INVALID_VALUE (1281).
The number parameter is out of range. Offending commands are ignored and have no side effects other than setting the error flag.
GL_INVALID_OPERATION (1282).
The specified operation is not allowed in the current state. Offending commands are ignored and have no side effects other than setting the error flag.
GL_INVALID_FRAMEBUFFER_OPERATION (1286).
This command attempts to render to or read from the frame buffer when the currently bound frame buffer is not in the frame buffer complete state (that is, the return value of glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE). Offending commands are ignored and have no side effects other than setting the error flag.
GL_OUT_OF_MEMORY (1285).
Not enough memory to execute the command. After recording this error, the state of GL is undefined, except for the state of the error flag.
When the error flag is set, the result of a GL operation is undefined only if GL_OUT_OF_MEMORY occurs. In all other cases, the command generating the error is ignored and does not affect GL state or frame buffer content. If the generate command returns a value, it returns 0.
See also
glCheckFramebufferStatus
copyright
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetError.xml
https://blog.csdn.net/flycatdeng
Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. See http://oss.sgi.com/projects/FreeB/.

Android,OpenGL ES, Graphics

“There was an internal API error” in Xcode debugging;

Visit: here
I wrote a game demo a while ago. I took some time to optimize the following method today. I found that the following errors will be reported when Debugging on iPad.

At the beginning, I thought that I used a private API. Later, I carefully checked that there was no problem. Therefore, I began to use the common debugging method when the real machine debugging went wrong.
1. Necessary good habits, Product –& GT; The clear;
2. Delete the previously debugged program on iPad, run it again, OK, and solve the problem (unexpectedly easy); As for the specific reason, I found that when the error dialog box popped up, it happened to be the detection of certificates such as profile, which might have something to do with the identification detection of the real machine. No matter how much, the problem is solved;
3. I encountered this problem again today. It was found that the apps debugged on the real computer had a profile conflict with some apps on the iPad, that is, they Shared a profile. (added on 14 May 2013)
PS: today may no longer regrets about baidu and Google, don’t know if industry reason, sometimes some problem on the search technology, found that all these results given in baidu and Google really really can’t, the efficiency is too low, turn a few pages is less than what you want, don’t know the reason why is because the algorithm or because baidu too pursuit of commercial cause, so if you have any questions how sometimes asked baidu are not the answer, might as well try Google;