开发者

C++ in mobile apps. How does it works

Tell me.

How is executed binaries (written in c++ ForExample) in mobiles??

I开发者_StackOverflow中文版s it only possible as mixed with J2ME or is it possible to execute "RAW" (like exe file) binary.

(In old and new mobiles)


Running a program on a mobile phone is like running it on a normal computer.

You have to take two things into consideration the processor that is running the phone and the OS that is running on top of the processor.

  • Certain phone OS's are very restrictive on what they let run on the phone so you need to read up on the restrictions imposed by the OS.
  • Secondly the processors are usually very limited and completely different to a normal PC so you need a compiler that will generate code for that processor.
  • But RAW object files are not enough C++ is dependent on a whole set of standard libraries functions and framework to start up the application. For this you will need to have the appropriate SDK for the your phone so that you can link your program with the appropriate framework that your phone OS will understand.
  • The last problem is getting the binaries onto the phone. Detailed instructions will usually come with the SDK.


How is executed binaries (written in c++ ForExample) in mobiles??

There are two ways.

First, the application can consist of natively executable instructions. In a Windows CE based mobile phone, like Windows Mobile/phone, this means the PE format, which native C and C++ code is compiled and linked to.

Second, the application can be managed by a runtime environment, like J2ME for Java and the CLR for .Net CF on Windows CE/Mobile/Phone. Then the runtime environment executes PE and the application layer above, e.g., .Net CF is compiled to an intermediate language that is compiled to PE during runtime ("jitted").


Common Windows .exe are unlikely to run on mobiles out-of-the box.

The target mobile has to have a specific SDK, which will help compiling C code into native platform code.

Or, if the mobile has a common operating system, like Symbian or Windows mobile, then you need SDK and compilers for these target platforms.


I think it depends on the operating system of the mobile device. For example, if its Windows Mobile 5/6 they can use .exe files compiled with the Windows CE SDK.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜