Tutoriels accessible pour apprendre à développer sous Androïd [Tuto] Développer son application Android - Episode 1 Détails Mis à jour le samedi 23 mars 2013 21:08 Publié le vendredi 13 avril 2012 15:31 Grâce à ce tutoriel détaillé nous allons coder notre première application pour Android. La semaine dernière nous vous proposions la mise à jour de notre tuto d'installation de l'environnement de développement Android ! En développement Android je suis un gros débutant, sûrement comme la plupart d'entre vous. Mais voilà, coder mes applications pour Android me tente assez. Les premiers tutos seront hyper basiques mais nous y aborderons des notions essentielles, les bases. Dans ce premier tuto nous allons gérer le click d'un bouton, récupérer le texte saisi dans un champs texte, l'afficher et traiter le texte saisie (si c'est une URL l'ouvrir dans notre première application). Bon assez de blah blah non ? 1 - Création du projet Eclipse Si vous ne l'avez pas encore fait, installez l'environnement de développement Eclipse - SDK Android - ADT. Lancez Eclipse aussi : double click sur "Eclipse.exe" :) puis "Next".
HttpURLConnection An URLConnection for HTTP (RFC 2616) used to send and receive data over the web. Data may be of any type and length. This class may be used to send and receive streaming data whose length is not known in advance. Uses of this class follow a pattern: For example, to retrieve the webpage at URL url = new URL(" HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = new BufferedInputStream(urlConnection.getInputStream()); readStream(in); finally { urlConnection.disconnect(); } } Secure Communication with HTTPS Response Handling HttpURLConnection will follow up to five HTTP redirects. Posting Content For example, to perform an upload: HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { urlConnection.setDoOutput(true); urlConnection.setChunkedStreamingMode(0); OutputStream out = new BufferedOutputStream(urlConnection.getOutputStream()); writeStream(out); Performance HTTP Methods
Fragment - Aller plus loin dans le développement Android ListFragment Tout comme les activités, il existe un fragment « générique ». Il peut inclure des listes, des écrans de préférences et toutes les vues du framework Android pour constituer des portions d’interfaces. Par la suite, elles pourront être réutilisées plusieurs fois dans les écrans de l’application finale. Pour expliquer en profondeur tous ces concepts, une explication détaillée des fragments est donnée dans la suite de ce chapitre. Introduction aux fragments Qu’est ce qu’un fragment ? Les fragments ne sont pas simples à comprendre. En temps normal, une application est destinée à être exécutée aussi bien sur les smartphones que sur les tablettes, et peu à peu sur les télévisions connectées. Par exemple, le propriétaire d'un blog pourrait légitimement vouloir développer sa propre application pour offrir une alternative mobile à ses lecteurs. Ce genre de chose est possible grâce aux fragments ! Le cycle de vie des fragments Les activités sont régulées par un cycle de vie. Résultat final
Créez des applications pour Android Bonjour à tous et bienvenue dans le monde merveilleux du développement d'applications Android ! Android est un système d'exploitation mobile, c'est-à-dire que, tout comme Windows ou Linux c'est un gros programme, composé de petits programmes, qui permet d'exécuter d'autres logiciels. Par exemple, Windows permet d'exécuter Internet Explorer, et pour ce faire, il doit faire le lien entre la souris et le curseur à l'écran, entre le clavier et les champs de saisie, etc. Que diriez-vous de développer vos propres applications pour Android, en les proposant au monde entier via le Play Store, le marché d'applications de Google ? Cependant, pour suivre ce cours, il vous faudra quelques connaissances : Les applications Android étant presque essentiellement codées en Java, il vous faut connaître ce langage. Pour commencer ce cours en douceur, je vous propose de vous présenter cette plateforme, son univers, ses objectifs, puis de vous rappeler le vocabulaire indispensable pour comprendre ce cours.
Math Class Overview Class Math provides basic math constants and operations such as trigonometric functions, hyperbolic functions, exponential, logarithms, etc. Summary Constants public static final double E The double value closest to e, the base of the natural logarithm. Constant Value: 2.718281828459045 public static final double PI The double value closest to pi, the ratio of a circle's circumference to its diameter. Constant Value: 3.141592653589793 Public Methods public static double IEEEremainder (double x, double y) Returns the remainder of dividing x by y using the IEEE 754 rules. Special cases: IEEEremainder((anything), 0) = NaN IEEEremainder(+infinity, (anything)) = NaN IEEEremainder(-infinity, (anything)) = NaN IEEEremainder(NaN, (anything)) = NaN IEEEremainder((anything), NaN) = NaN IEEEremainder(x, +infinity) = x where x is anything but +/-infinity IEEEremainder(x, -infinity) = x where x is anything but +/-infinity Parameters Returns the IEEE754 floating point reminder of of x/y.
Android Development Tutorial - 3/12 - New Think Tank How to Make Android Apps 10 In this few parts of my Android tutorial I’ll focus on a Android Fragment Tutorial. I’ll start off slow here by showing you how to switch fragments based on screen orientation, which is very commonly used. I’ll specifically cover the basics of fragments, layout... How to Make Android Apps 9 In this part of my Android tutorial I will focus on Android Styles and Themes. How to Make Android Apps 8 In this tutorial we take it to the next level. How to Make Android Apps 7 In this tutorial we’ll start making a useful Android unit conversion app. How to Make Android Apps 6 In this tutorial I’ll show you how to fix Android Studio errors that you guys are having trouble with. How to Make Android Apps 5 In this tutorial I’ll show you how to create multiple Android Activities and then how you’d go about passing data between Android Activities. How to Make Android Apps 4 In this video tutorial I will cover how to make menus and dialog popups. Make an App and Win a Phone
Android Web Apps Using Android WebView An Android web app is an application that uses the Android WebView component to render part of the Android app's GUI. The WebView component is a full-fledged browser implemented as a View subclass so you can embed it inside your Android app's GUI anywhere you like. It is common to let the WebView take up most of the screen space, but you can also just let the browser take half the screen or whatever partition that suits your app. Android Web App or Android Hybrid App? Calling an Android app that uses a WebView internally for an Android Web App may sound a bit misleading, since the app is actually a mix of a native Android app and a web app. Another common term for an Android web app is Android Hybrid App. WebView is Based on Chrome From Android version 4.4 (Kitkat) the WebView component is based on the same code as Chrome for Android. Before Android 4.4 the WebView was based on the internal Android browser, but Chrome is replacing the old Android browser as the default / built-in browser.
Android canvas draw rectangle Getting Started: WebView-based Applications for Web Developers Getting started with the Android WebView is fairly simple, whether you want load a remote URL or display pages stored in your app. This tutorial walks you through creating a new Android Project, adding a WebView, loading a remote URL, and then loading a local HTML page. Note: This tutorial assumes you're a developer with limited or no experience with the Android development environment, but have some experience with Java. If you're already familiar with programming for Android, you may want to refer to to Building Web Apps in WebView on the Android developer site instead. When the installation completes, Android Studio launches and displays the welcome screen. To create a new project: Click New Project.On the next page, enter your application name, package name and target SDKs, and click Next. You now have a new Android project. Note: After you have your project created, make sure you have the KitKat SDK installed. A few of the more import folders are identified in the picture:
Android ImageView example In Android, you can use “android.widget.ImageView” class to display an image file. Image file is easy to use but hard to master, because of the various screen and dpi in Android devices. In this tutorial, we didn’t go in deep about dpi and various screen issue, we just use ImageView to display a “png” image, when user click on a button, it will change to another “png” image. P.S This project is developed in Eclipse 3.7, and tested with Android 2.3.3. 1. Add Image to Resources Put your images into folder “res/drawable-ldpi“, “res/drawable-mdpi” or “res/drawable-hdpi“. See figure below, no matter which folder you put, Android will find your image automatically. 2. Open “res/layout/main.xml” file, just add an ImageView and Button for demonstration. File : res/layout/main.xml 3. Simple, when button is clicked, change it to “android3d.png”. File : MyAndroidAppActivity.java 4. Run the application. 1. 2. Download Source Code References
Android Facebook Connect Tutorial This tutorial is about integrating facebook into your android application. I am going to explain various steps like generating your application signature, registering facebook application, downloading facebook sdk and other steps. Here is an official documentation of facebook integration. Generating App Signature for Facebook Settings To create facebook android native app you need to provide your Android application signature in facebook app settings. Open your command prompt (CMD) and run the following command to generate your keyhash. check the following command how i generated hashkey on my pc. Registering your Facebook Application After generating your app signature successfully, register your facebook application by going to create new facebook application and fill out all the information needed. and note down your facebook App ID Creating Facebook Reference Project 1. 2. Creating Your Facebook Connect Project 1. 2. Now our project setup is done. 3. 4. 5. Login to Facebook Account
Android Canvas - A Beginner's Tutorial | Daniel Nadeau So you want to make a game, do you? Do you want to compete with the likes of Angry Birds? Well, learning the Android Canvas is the best place to start. Many people want to make Android games. Step 1 - Make A Class In order to start working with the SurfaceView and all of it's functions, you are going to have to extend from it. class DrawingPanel extends SurfaceView implements SurfaceHolder.Callback { } Extending the SurfaceView class will allow you to create a view based on SurfaceView and place it into your Activity. Step 2 - Construct the Class The next step is to construct the class with many of the important parts. public DrawingPanel(Context context) { super(context); getHolder().addCallback(this); } @Override public void onDraw(Canvas canvas) { //do drawing stuff here. } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { } As you can see in this code, we are setting up the new SurfaceView.