[Android開發學習09]Android OpenGL ES 基礎

 其實,我個人學習Android最主要的目的是學習在此平台下的3D效果的開發。所以,我們開始進入主題吧。 OpenGL ES (OpenGL for Embedded Systems) 是 OpenGL 三維圖形 API 的子集,針對手機、PDA和遊戲主機等嵌入式裝置而設計。該API由Khronos集團定義推廣,Khronos是一個圖形軟硬體行業協會,該協會主要關注圖形和多媒體方面的開放標準。 在Android中搭建一個3D開發的基本架構:一、匯入opengl

Bitmap 存到檔案中

將一個Bitmap 的內容存到file中[java]//create a file to write bitmap data  File f = File(context.getCacheDir(), filename); f.createNewFile();  //Convert bitmap to byte array  Bitmap bitmap = your

android 搖一搖 代碼 真實可用

[java]核心介面代碼: package com.hyxf.main; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import

Running Your App (android)

 How you run your app depends on two things: whether you have a real Android-powered device and whether you're using Eclipse. This lesson shows you how to install and run your app on a real device and on the Android emulator, and in both

android 記憶體清理

這兩天在搞個記憶體清理小外掛程式,網上很少這方面資料,之前找過清理緩衝的例子測試,結果不成功。後來自己思考該怎麼清理記憶體,於是成功搞出來了。這兩個方法是網上拷別人的,分別用來得到可用記憶體和記憶體總數,這樣我們就可用得到了已用記憶體數。View Code    private long getAvailMemory(Context context)   

發送XML給第三方

面試中有一個題目是發送(接受)xml,並解析。當時有接觸但是沒有注意,所以回來強力關注下,並且記錄在這,大家一起學習下: [java]public static StringBuffer sendSoapMsg(String soapMessage,            String targetUrl, String soapAction, Long timeout)

Communicating with Other Fragments

In order to reuse the Fragment UI components, you should build each as a completely self-contained, modular component that defines its own layout and behavior. Once you have defined these reusable Fragments, you can associate them with an Activity

Creating a Fragment

You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in

通過AndroidTestCase來進行android 單元測試

介紹過了如何用intrumentation進行android單元測試,其實還有一種方法同樣可以,那就是利用AndroidTestCase來做單元測試,intrumentationTestCase和AndroidTestCase都是Junit.framwork.TestCase的子類,二者代表不用的方向。 如果想通過AndroidTestCase,大致可以通過以下幾個步驟實現:1.       添加自己的test case

new A與new A();

  解釋以下語句的含義:         1、new A;         2、new A();對於new A和 new A() 的區別,我們可以得出下面的結論:      1、類體含有顯示適合地預設建構函式時,new A和new A()的作用一致,都是首先調用operator

Android中ListView的用法

Android中ListView的用法,原文如下:ListView是一個經常用到的控制項,ListView裡面的每個子項Item可以使一個字串,也可以是一個群組控制項。先說說ListView的實現:1.準備ListView要顯示的資料 ;2.使用 一維或多維 動態數組 儲存資料;2.構建適配器 , 簡單地來說, 適配器就是 Item數組 , 動態數組 有多少元素就產生多少個Item;3.把 適配器

Allowing Other Apps to Start Your Activity

For instance, if you build a social app that can share messages or photos with the user's friends, it's in your best interest to support the ACTION_SEND intent so users can initiate a "share" action from another app and launch your

Android BroadcastReceiver(一)

Android BroadcastReceiver介紹: broadcastReceiver是android的四大組件之一,大部分的廣播是系統發出來的。例如,螢幕關閉,電池電量不足等等。應用同樣可以建立廣播,例如:當下載完成的時候,要讓其他的應用知道這個情況,需要用到broadcastreceiver,receiver沒有介面,它可能會建立一個status bar notification通知使用者。broadcastreceiver

android “搖一搖” 代碼實現

核心介面代碼:package com.hyxf.main;import android.content.Context;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.util.Log;public class

android在特定情況下顯示按鈕

問題描述:在程式中建立了一個按鈕,如下:[java]<Button     android:id="@+id/admin_new_questions"             android:layout_width="fill_parent"    

android的對話方塊

android的提醒  android 的提醒主要有3中方式:Toast Notification,Status Bar Notification,Dialog Notification;在Standup Timer 中使用了很多Dialog notification。特別是在刪除某項時,彈出的確認對話方塊。Dialog Notification 主要分為四種:Alert Dialog,ProgressDialog ,DatePickerDialog

Android入門開發系列學習之 Handler使用

    Android提供了一個非同步訊息回調機制Handler,  它負責發送訊息和處理線程訊息佇列中的訊息及runnable對象   Handler執行個體都是與一個線程和該線程的訊息佇列一起使用,一旦建立了一個新的handler執行個體,系統就把該執行個體與一個線程和該線程的訊息佇列捆綁起來,這將可以發送訊息和runnable對象給該訊息佇列,並在訊息佇列出口處處理它們。    

Supporting Different Densities

Use Density-independent PixelsOne common pitfall you must avoid when designing your layouts is using absolute pixels to define distances or sizes. Defining layout dimensions with pixels is a problem because different screens have different pixel

SharedPreference和FIleInputStream/FileOutputStream 2種儲存方式

 特點:1、SharedPreference本種儲存方式只做簡單的儲存,如其名字一樣。優點:簡單方便,適合做簡單資料的快速儲存缺點:存放的檔案只能在同一個包內,不能跨包引用2、FIleInputStream/FileOutputStream檔案儲存體方式。此種方式可以存放比較大的檔案。還可以儲存到SDCARD中。可以跨包進行引用、可以存放到SDCARD上 案例Layout xml:[html]Layout xml: <?xml version="1.

android無法轉換字串到整型

問題描述:從一個XML檔案中擷取字串,內容大概就是262626這樣。現在需要將字串轉換到 MB (/1024)形式。但是不能轉換int或者長整型。我的測試代碼:[java]String size = parser.getValue(e, parser.KEY_FileSizeInByte); Log.i("menuItems",size);      try

總頁數: 2771 1 .... 2371 2372 2373 2374 2375 .... 2771 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.