In the C/C ++ layer of the android 2.3.3 source code, you need to debug the code, But the strange thing is that you can directly add logd ("XXXXXXXX ");, logcat does not display any output. Logi, logv, logw, and loge are ineffective. So I found the solution on the Internet. After several experiments, I finally found the solution. Now I will post the following notes:Step 1: Add local_ldlibs: =-llog to the corresponding MK FileStep 2: add the following
In the PHP login verification time code, the problematic user name and account are stored in the txt text, that is, the password cannot be verified. I have tried to verify the user name separately and I don't know where it is wrong ..
$ Logi = file ("users.txt ");
$ Size = sizeof ($ Logi );
Foreach ($ Logi as $ Key => $ Val)
{$ Data [$ Key] = explode ("|", $
When php data is written to txt, the following error occurs: filename='users.txt ';
$ Name = trim ($ _ POST ["name"]);
$ Passwd = trim ($ _ POST ["pass"]);
$ Str = $ username. '|'. $ passwd;
$ Suc = file_write ($ str, $ filename );
Function file_write ($ flag, $ tmpfname)
{
If ($ handle = fopen ($ tmpfname, ""))
{
Fwrite ($ handle, $ flag. "\ r \ n ");
Fclose ($ handle );
Return 1;
}
Else return 0;
}
Record the name and password in txt in the format of mmm | 123456
Yyy | 123456
My code is as abo
In Android, Java code outputs log information through Android. util. log. The same local C/C ++ code also provides more interfaces. Android directly goes to the header file (System/CORE/include/cutils/log. h) defines some log Output Macros, which are better than Android. util. log provides more log output interfaces. Therefore, you can use these macros to output the same logs as those in Java code. Macro logd (), LogE (), Logi (), logv (), logw (), an
Http://hi.baidu.com/grfillzaccbaqwq/item/b8dc91da94576e12d90e4490
Http://www.cnblogs.com/melode11/archive/2009/10/15/1584120.html
[11.04.02] added log debugging (Logi \ logd \ loge...) Output support on the android C/C ++ layer.
Recently, I have been studying the C/C ++ layer of Android 2.3.3 source code. I need to debug the code, but it is strange that I directly add logd ("XXXXXXXX ");, logcat does not display any output.
function system_init to start system services implemented in the C ++ language, its implementation is in the file frameworks/base/cmds/system_server/library/system_init.cpp, as shown below:
extern "C" status_t system_init(){ LOGI("Entered system_init()"); sp
The function first obtains a processstate Singleton in the system process and stores it in the variable Proc. It will call its member function supportsprocesses to determine whether the sy
Objective:JNI (c + + function) A char buf[4] how to pass Env->callvoidmethod (Clazz,method_onfindcards,jstringparam); Show it on the appLike what:Get the Java layer callback functionJclass Mclazz = Env->findclass ("Com/android/server/rfidreaderservice");Logi ("The Mclazz is obtained from the Jobject clazz");Method_onfindcards = Env->getmethodid (Mclazz, "Onfindcards", "(ljava/lang/string;) V");if (method_onfindcards== NULL){
$filename = ' users.txt ';
$name = Trim ($_post["name"]);
$passwd = Trim ($_post["pass"]);
$str = $username. ' | '. $passwd;
$suc =file_write ($str, $filename);
function File_write ($flag, $tmpfname)
{
if ($handle = fopen ($tmpfname, "a"))
{
Fwrite ($handle, $flag. " \ r \ n ");
Fclose ($handle);
return 1;
}
else return 0;
}
Record name and password on TXT, format is mmm|123456
yyy|123456
My code above, why the first write always empty a line, whether it is blank text or already have data. And s
User name and account stored in the TXT text, that is, password verification can not, I tried the user name alone to verify the success, do not know where the wrong.
$Logi = File ("Users.txt");
$size = sizeof ($Logi);
foreach ($Logi as $Key = $Val)
{$Data [$Key] = explode ("|", $Val);}
for ($K = 0; $K {
$user = $Data [$K] [0];
$pass = $Data [$K] [1];
if ($u
environment: the Android platform provides a make-based compilation system, which can be used to compile the correct Android. mk file for the App. The environment needs to get a complete copy of the source code from the official website through git and successful compilation, for more details, see: http://source.android.com/index.html
No matter which of the above two methods you choose, you must write your own Android. mk file. For how to write this file, see the relevant documentation.
JNI com
{ unsigned uid; int login; int keepenv; char *shell; char *command; char **argv; int argc; int optind;};struct su_context { struct su_initiator from; struct su_request to; mode_t umask;};enum { DB_INTERACTIVE, DB_DENY, DB_ALLOW};#endifNote that many things here are redundant.
Su. c file
#include
#include
#include
#include
#include
#include
#include
#include
#
Reference to:http://www.linuxidc.com/linux/2014-02/96341.htmAndroid development, Java can easily use debugging information log.i, LOG.D ..., the JNI layer can use it? The answer is yes.1 for ease of use, first macro definition:Eben_hpc_log.h content is as follows:#ifndef _included_hpc_log#define _included_hpc_log#ifdef __cplusplusextern "C" {#endif#include Macros define similar Java layer definitions, different levels of log logi, LOGD, LOGW, LOGE, Lo
http://blog.csdn.net/pkigavin/article/details/8583537Recently, in the study of the Android 2.3.3 Source code c/S layer, you need to do some debugging of the code, but strangely, directly add logd ("XXXXXXXX"), use logcat but do not see any output, switch to Logi, LOGV, LOGW, Loge also has no effect. So on the Internet to find solutions, after several trials, finally found, and now posted to the following memo:First step: add: local_ldlibs: =-llog in t
With Python's logging, every time you write a log, you make a small module to make the log more convenient.The code is as follows
log.py
Import Logging, Logging.handlersImport ConfigImport Inspect
FORMAT = '% (asctime) s-% (name) s-% (levelname) s-% (message) s 'Log_level = logging. DEBUGLogger = {}Handler = Logging.handlers.RotatingFileHandler (Config. Path_log_file,MaxBytes = 1048576 * 2, # 2MBBackupcount = 5,)Handler.setformatter (logging. Formatter (FORMAT))
__all__ = [' Log ', '
Thunderbolt and USB 3.0 interface, data transmission performance is very stable.
A good input device
Input device performance is also the key to improve office efficiency, you need to choose a good ergonomic design, feel comfortable keyboard or mouse, but also give priority to wireless models, because it can effectively avoid cable winding, reduce efficiency. As for the form of wireless transmission, usually using a 2.4GHZ USB receiver device compared to Bluetooth has a more stable performanc
, but the basic is to eliminate the old platform, for Yi Yuan tyrants computer, buy this high power consumption, not cost-effective computer, now really is not worth it!
8692 yuan Intel four Generation i7 single display machine configuration comment
Machine Price: 8692 yuan
Accessories name brand Model reference price (yuan)
Processor: Intel Core i7 4770¥1980
Radiator: Owl nh-d14¥599
Motherboard: Gigabyte ga-z87m-hd3¥999
RAM: Kingston DDR3 1600 8G single ¥440
HDD: Seagate Barracuda 2TB 6
purchase UVC cameras. UVC is an open standard with a well maintained drive, which is part of the kernel code. After inserting the camera, you can work without having to compile or install additional drivers. NON-UVC cameras usually does not work better than the UVC cameras, the former driver does not follow the general protocol, the need for each camera to make separate processing, which often requires a reverse engineering exploration process.To determine if a camera belongs to the UVC specifi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.