views:

218

answers:

4

Tell me.

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

Is it only possible as mixed with J2ME or is it possible to execute "RAW" (like exe file) binary.

(In old and new mobiles)

A: 

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.

ron
A: 

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.

corn3lius
+2  A: 

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.
Martin York
Code running on a mobile phone must be more robust than code executing on a stationary computer. Mobile phones can be dropped, thrown and go through a lot of abuse while the code is running. ;-) The code running on mobile phone may be faster or slower depending on the tail wind affecting the phone. ;-)
Thomas Matthews
@Thomas: I don't belive it needs to be more stable than a computer. I am sure the phone manaufacturer wants that, but in reality it is the same hacks developing computer code as phone code (look at the iPhone App store). The Phone OS does explicitly need to be hardened to cope with this though, as a phone is utility device and consumers don't expect it to crash.
Martin York
+1  A: 

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").

Johann Gerell