设计开发

Android真机执行ndk-gdb后出现”found running pid:0 could not extract pid of application…”的解决方法

先说出这问题时的周遭环境:

Android SDK Tools r12
Android SDK Platform-tools r6
Android NDK r6
HTC G10 DesireHD(root)
Eclipse 3.7 Indigo
ADT 12.0.0
Windows XP SP3

问题描述:按着Sequoyah Native Debug的教程走,到执行ndk-gdb起服务的时候,提示”found running pid:0 could not extract pid of application…”说找不到程序的PID(顺带一提,之前还有一次是提示could not extract package’s data directory…,经查发现原因应该是设备没有root),执行adb shell ps发现要调试程序的进程就在那里,PID也看到正常,为什么ndk-gdb说获取不到PID呢?

Continue reading…

关于Apple iOS IAP应用内置付费设置的一些心得!

iOS IAP应用内置付费好处多多,第一次植入问题也是多多!

开始加IAP的时候,习惯性的上网找同行写过的经验文章参考,Apple官方文档看着就头疼,找了一篇http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/,看似写的很完整,跟着一步一步做,结果最后request product的时候一直返回Invalid ID!开始在iTunes Connect上折腾,传了删,删了传的辗转了好几次,各种设置调来调去,各种search结果看了又看,最后总算是搞定了,也写点自己的心得吧。

Continue reading…

[ZT]如何解决:Android中 Error generating final archive: Debug Certificate expired on … 的错误

问题概述:

在导入一个app后提示如下错误:

“Error generating final archive: Debug Certificate expired on 10/09/18 16:30”

 

原因分析:

android要求所有的程序必须有签名,否则就不会安装该程序。在我们开发过程中,adt使用debug keystore,在 preference->android->buid中设置。debugkeystore默认有效期为一年,如果你是从一年前开始完android程序,那么在一年后导入这个app的时候很可能出现debug keystore过期,导致你无法生成 apk文件。

此时你只要删除debug keystore就行,系统又会为你生成有效期为一年的私钥。

 

解决方法:

进入C:\Documents and Settings\Administrator\.android 删除路径下的debug.keystore及 ddms.cfg。

(不同环境下的目录可能略有不同,可在eclipse中查找此路径:Window->Preferences->Android->Build下 Default debug keystore)

然后重新导入即可。

原文:http://www.cnblogs.com/yyangblog/archive/2011/01/07/1929657.html

XCode中cpp文件第一行出现Parse Issue: Expected unqualified-id错误的原因

移植Win32下的cpp文件到xcode中编译时发现,代码可以顺利通过编译,但在xcode中一查看cpp文件就会出现标题中的那个错误,虽然不影响编译运行程序,但是所有的h中的关键字都不能高亮且会导致一些关联的语法错误,起初以为是header search path的问题,但排查一通后发现问题原来是出在源文件的编码方式上!

xcode默认是使用UTF-8作为源代码文本文件的字符编码的,曾经为了统一这个,Win32下的cpp也改为了UTF-8,但是windows下的UTF-8文本文件头中会加入几个字节的编码标示,比如UTF-8是EF BB BF,UTF-16也有,是什么记不清了,是2个byte的。

导致xcode parse source时出错的就是这个字节标识,删掉就可以了。

deprecated conversion from string constant to char *

可能是xcode4用的gcc版本比较高的原因,在移植代码的时候出现了这样一个警告,正好提高了一下对const char*的认识。

void foo(char* szArg);

这样的函数这样 foo(“test”); 调用就会提示这个警告,以前可能没太注意过,因为传递的参数字符串是被作为常量处理的,而函数原型却要得不是const指针,也就是说函数内实现是允许修改指针内存的,所以编译器就爆了,理所应当的一个warning,改成const char*参数类型就可以了。

Your debugger is not using the correct symbols

今个用WinDBG研究IDT时突然出现!idt命令提示Your debugger is not using the correct symbols,不知何故,试了一些网上提到的解决方法,都不太好使,结果发现只要简单的.reload一下就可以了,真是莫名其妙。

关于短信SMS的class

最近在研究GSM通信模块相关的AT指令时,发现短信部分经常提到个短信的class,不知为何,搜了一下,特此记录:

What are the classes of SM-MT (mobile terminated) messages?

Classes identify the message’s importance as well as the location where it should be stored. There are 4 message classes.
Class 0: Indicates that this message is to be displayed on the MS immediately and a message delivery report is to be sent back to the SC. The message does not have to be saved in the MS or on the SIM card (unless selected to do so by the mobile user).
Class 1: Indicates that this message is to be stored in the MS memory or the SIM card (depending on memory availability).
Class 2: This message class is Phase 2 specific and carries SIM card data. The SIM card data must be successfully transferred prior to sending acknowledgement to the SC. An error message will be sent to the SC if this transmission is not possible.
Class 3: Indicates that this message will be forwarded from the receiving entity to an external device. The delivery acknowledgement will be sent to the SC regardless of whether or not the message was forwarded to the external device.