compilation of c/c++ program in android

30
INTRODUCTION TO C/C++ PROGRAMMING I Name :- Rahul Verma Branch :- CSE 2 nd SHIFT Roll No. :- 115365 Submitted To :- Mr. Jagdeep Singh

Upload: rahulverma1080

Post on 30-Nov-2014

18.873 views

Category:

Education


3 download

DESCRIPTION

This Slide Will Introduce You About The Basics Of Compilation On Android Platform.

TRANSCRIPT

Page 1: Compilation Of C/C++ program in Android

INTRODUCTION TO C/C++ PROGRAMMING IN

Name :- Rahul VermaBranch :- CSE 2nd SHIFTRoll No. :- 115365Submitted To :- Mr. Jagdeep Singh

Page 2: Compilation Of C/C++ program in Android
Page 3: Compilation Of C/C++ program in Android

What is Android?

• A software platform and operating system for mobile devices

• Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

• Based on the Linux kernel

• Developed by Google and later the Open Handset Alliance (OHA)

• Allows writing managed code in the Java language

• Possibility to write applications in other languages and compiling it to ARM native code (support of Google? No)

• Unveiling of the Android platform was announced on 5 November 2007 with the founding of OHA

Introduction

Page 4: Compilation Of C/C++ program in Android

DIFFERENT VERSIONSOF ANDROID

2.3 Gingerbread3.0 Honeycomb 3.1 Honeycomb 3.2 Honeycomb 4.0 Ice Cream Sandwich

Page 5: Compilation Of C/C++ program in Android

2.1 Hardware  

Android is not a single piece of hardware; it's a complete, end-to-end software platform that can be adapted to work on any number of hardware configurations. Everything is there, from the bootloader all the way up to the applications.

Platform

Page 6: Compilation Of C/C++ program in Android

2.2 Operating System(s)  • Android uses Linux for its device drivers, memory management, process

management, and networking. 

Platform

Page 7: Compilation Of C/C++ program in Android

2.3 Network Connectivity 

It supports wireless communications using:

GSM mobile-phone technology

3G

Edge

802.11 Wi-Fi networks

Platform

Page 8: Compilation Of C/C++ program in Android

2.4 Security 

Android is a multi-process system, in which each application (and parts of the system) runs in its own process. Most security between applications and the system is enforced at the process level through standard Linux facilities, such as user and group IDs that are assigned to applications.

Additional finer-grained security features are provided through a "permission" mechanism that enforces restrictions on the specific operations that a particular process can perform, and per-URI permissions for granting ad-hoc access to specific pieces of data.

Platform

Page 9: Compilation Of C/C++ program in Android

2.5 Performance 

 

Platform

Page 10: Compilation Of C/C++ program in Android

2.6 Future possibilities

• Google Android Sales to Overtake iPhone in 2012

• The OHA is committed to make their vision a reality: to deploy the Android platform for every mobile operator, handset manufacturers and developers to build innovative devices

• Intel doesn’t want to lose ownership of the netbook market, so they need to prepare for anything, including Android

• Fujitsu launched an initiative to offer consulting and engineering expertise to help run Android on embedded hardware, which aside from cellphones, mobile internet devices, and portable media players, could include GPS devices, thin-client computers and set-top boxes.

• More Android devices are coming and some will push the envelope even further

 

 

Platform

Page 11: Compilation Of C/C++ program in Android

4.1 Advantages   There are a host of advantages that Google’s Android will derive from being an open source software. Some of the advantages include:

• The ability for anyone to customize the Google Android platform

• The consumer will benefit from having a wide range of mobile applications to choose from since the monopoly will be broken by Google Android

• Men will be able to customize a mobile phones using Google Android platform like never before

• Features like weather details, opening screen, live RSS feeds and even the icons on the opening screen will be able to be customized

• As a result of many mobile phones carrying Google Android, companies will come up with such innovative products like the location

• In addition the entertainment functionalities will be taken a notch higher by Google Android being able to offer online real time multiplayer games

 

Overall evaluation

Page 12: Compilation Of C/C++ program in Android

C and C++• C++ is a general-purpose programming language with

a bias towards systems programming that– is a better C– supports data abstraction– supports object-oriented programming– supports generic programming

C: Functions and structs Machine model (basic types and operations) Compilation and linkage model

Page 13: Compilation Of C/C++ program in Android

Missing in C (from a C++ perspective)• Classes and member functions

– Use struct and global functions• Derived classes and virtual functions

– Use struct , global functions, and pointers to functions– You can do OOP in C, but not cleanly, and why would you want to?– You can do GP in C, but why would you want to?

• Templates and inline functions– Use macros

• Exceptions– Use error-codes, error-return values, etc.

• Function overloading– Give each function a separate name

• new/delete– Use malloc()/free()

• References– Use pointers

• const in constant expressions– Use macros

Page 14: Compilation Of C/C++ program in Android

C PROGRAMMING REFERENCE

Page 15: Compilation Of C/C++ program in Android

Have a C programming reference always with you. Study or check on the go!.Complete C language programming reference from cheat sheets and quick reference cards, to primer language programming tutorials, complete reference, code style industry recommendations, advanced pointer tutorials and more.

Use the possibilities the mobile brings you, allowing to study or check anything you want on the go. Don't waste time on transportation, use your mobile and study and check anything you want

C PROGRAMMING REFERENCE

Page 16: Compilation Of C/C++ program in Android

C++ FOR ABSOLUTEBEGINNERS

Page 17: Compilation Of C/C++ program in Android

Learn C++ Programming right over your Android phone or tablet with this great app. Popular videos by Programmers Institute help you to learn C++ programming even if you have never programmed before. You get the basics form the ground level to get you started and on your way in a step by step fashion. Set you phone or tablet by your computer and let this app help you through the beginning steps. More apps like this are on the way!

C++ FOR ABSOLUTEBEGINNERS

Page 18: Compilation Of C/C++ program in Android

DIFFERENT TYPES OF C++ COMPILERS

IN ANDROID

Page 19: Compilation Of C/C++ program in Android

C4DROID

Page 20: Compilation Of C/C++ program in Android

C4DROIDRequirements: Android 2.1+Overview: C4droid is a C compiler for Android.

Root is not required, but if you have rooted your device or have enough internal memory, you can get C++ support, 

Page 21: Compilation Of C/C++ program in Android

C4DROIDLong click save button to "save as", long click run to run with arguments.C4droid already has almost full C language support, so you don't need to wait when it will be added.You can to write your own applications on the Android phone, and run them. This app uses TCC and uClibc, so it has full support of ANSI C and some support of ISO C99. C4droid can be used for educational purposes or to practice in C language.

Page 22: Compilation Of C/C++ program in Android

C4DROIDResult of compilation (binary) is placed in "/data/data/com.n0n3m4.droidc/files/temp", because sdcard doesn't have permission for execution by default.

Page 23: Compilation Of C/C++ program in Android

Some components of C4droid are LGPL-licensed. You can download used source code of TCC and uClibc on their websites. C4droid includes Android Terminal Emulator so you can to run your application comfortably.

C4DROID

Page 24: Compilation Of C/C++ program in Android

C/C++ COMPILER

Page 25: Compilation Of C/C++ program in Android

Android Market Description Simple C/C++ compiler / interpreter for educational purpose.some part of C language is implemented,C++ language support will be done in some future.*. No Internet Connection is required to run the code.Uses internet connection Once when you run the app only for licensing purpose.

C/C++ COMPILER

Page 26: Compilation Of C/C++ program in Android

*. You don't need to root the phone to run the app.Works well on non-rooted devices.If you have any question about the app please visithttp://www.dztall.com or e-mail [email protected]

Keywords : c / c++ interpreter compiler script android education code programming language learning IDE gcc

C/C++ COMPILER

Page 27: Compilation Of C/C++ program in Android

N D K

Page 28: Compilation Of C/C++ program in Android

The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.

N D K

Page 29: Compilation Of C/C++ program in Android

The NDK provides:

* A set of tools and build files used to generate native code libraries from C and C++ sources* A way to embed the corresponding native libraries into an application package file (.apk) that can be deployed on Android devices* A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5* Documentation, samples, and tutorials

N D K

Page 30: Compilation Of C/C++ program in Android