导航:首页 > 操作系统 > androidsamples下载

androidsamples下载

发布时间:2023-03-02 15:31:06

Ⅰ 如何在win7上搭建android cocos2d-x-3.3开发环境

android平台工程创建

1、android SDK+NDK安装

1)、安装java jdk(如果已经安装了,可以不用此步骤)

进入:http://www.oracle.com/technetwork/java/javase/downloads/index.html或者直接点击下载。如下图

(7)安装完成后,点击Yes按钮,重启Eclipse。

选择android SDK解压后的目录(ADT 18 默认会扫描电脑,找到并配置好SDK位置)。

配置cygwin

命令行中进入cygwin目录,并执行cygwin.bat,如果不是用Administrator账号登录的系统,那么会在cygwinhome文件夹中生成一个以登录名命名的新的文件夹。

修改新生成文件夹中的“.bash_profile ”文件,用UE或editplus等文本编辑器打开,在最后增加: (e/android-ndk-r8-windows/android-ndk-r8是安装ndk的路径)

NDK_ROOT=/cygdrive/e/android-ndk-r8-windows/android-ndk-r8

export NDK_ROOT

然后保存关闭。

至此便基本搭建完毕cocos2d-x的windows 7 android 环境

Ⅱ 到如了v4怎么android.support.annotation

新版本的v4包有android.support.annotation的包,有的话很幸运使用这些注解的话就不会出错,但是旧版本的没有这个包就很悲剧了,比如我.....

现总结一下方法解决这些问题:

1、更新SDK

2、替换v4包

3、导入android-support-annotations.jar的jar。这个jar可以从网络上下载,也可以从sdk安装目录下(E:\InstallPath\sdk\extras\android\support\samples\annotations)找到,没有的话就去下载吧,这个也有新的和旧的区分

Ⅲ 我想找找Android 开发的源码例子,在www.apkbus.com 找到一些,但是我知道除了安卓巴士还有其他的网站

SDK目录下就有很多啊,几乎包含了所有方面的例子.
我用的2.1版SDK,例子就在samples\android-7下面,android-7就是2.1版的.
如果你用的其它版本就找到对应版本就行了.

Ⅳ 如何获取webView上的部分内容

The extensive Android SDK allows you to do many great things with particular views like the WebView for displaying webpages on Android powered devices
Android SDK 的扩展通过使用特定的view允许你做许多事情比如WebView用来在Android手机上展示网页
As of lately while I was experimenting with the Android SDK I was using a WebView in one of my activities
最近我在体验Android SDK的时候在一个Activity中用到了WebView
From that particular WebView I needed to know the ContentHeight but also the ContentWidth
从WebView我不但想要知道ContentHeight还想知道ContentWidth
Now getting the contentHeight is easy like so:
现在的情况是获取contentHeight很easy如下
webviewgetContentHeight();
Unfortunately getting the contentWidth from a WebView is rather more difficult since there is not a simple method like:
不幸的是从一个WebView获取contentWidth是相当困难因为SDK中没有一个像这样的方法
// THIS METHOD DOES NOT EXIST!
webviewgetContentWidth();
There are ways to get the contentWidth of the rendered HTML page and that is through Javascript If Javascript can get it for you then you can also have them in your Java code within your Android App
当然是有方法获取contentWidth的就是通过Javascript来获取如果你能够支持Javascript那么你就可以在你的Android 程序中使用java代码来获取宽度
By using a JavascriptInterface with your WebView you can let Javascript communicate with your Android App Java code by invoking methods on a registered object that you can embed using the JavascriptInterface
通过在你的WebView中使用JavascriptInterface通过调用你注册的JavascriptInterface方法可以让Javascript和你的Android程序的java代码相互连通
So how does this work?
怎么做呢?
For a quick example I created a simple Activity displaying a webview that loads a webpage wich displays a log message and a Toast message with the contentWidth wich was determined using Javascript Note that this happens AFTER the page was finished loading because before the page is finished loading the width might not be fully rendered Also keep in mind that if there is content loaded asynchronously that it doesnt affect widths (most likely only heights will be affected as the width is almost always fully declared in CSS files unless you have a % width webpage)
搭建一个快速的例子创建一个简单的展示webView的Activity一个LogCat消息一个Toast消息用来显示我们通过 Javascript获取的宽度注意这些会在网页完全加载之后显示因为在网页加载完成之前宽度可能不能够正确的获取到同时也要注意到如果是异 步加载这并不影响宽度(最多高度会受影响因为宽度总是在CSS文件中做了完全的定义除非在网页中你用了%宽度)
Below is the code of the Activity Mainjava:
下面的代码是Activity的代码
package ;
import androidappActivity;
import androidosBundle;
import androitilLog;
import androidwebkitWebView;
import androidwebkitWebViewClient;
import androidwidgetToast;
publicclass Main extends Activity {
privatefinalstatic String LOG_TAG = "WebViewContentWidth";
privatefinal Activity activity = this;
privatestaticint webviewContentWidth = ;
privatestatic WebView webview;

/** Called when the activity is first created */
@Override
publicvoid onCreate(Bundle savedInstanceState) {
superonCreate(savedInstanceState);
setContentView(Rlayoutmain);
webview = (WebView) findViewById(Ridwebview);
webviewgetSettings()setJavaScriptEnabled(true);
webviewsetSaveEnabled(true);
webviewaddJavascriptInterface(new JavaScriptInterface() "HTMLOUT");
webviewsetWebViewClient(new WebViewClient() {
@Override
publicvoid onPageFinished(WebView view String url) {
webviewloadUrl("javascript:windowHTMLOUTgetContentWidth(documentgetElementsByTagName(html)[]scrollWidth);");
}
});
webviewloadUrl(";);
}

class JavaScriptInterface {
publicvoid getContentWidth(String value) {
if (value != null) {
webviewContentWidth = IntegerparseInt(value);
Logd(LOG_TAG "Result from javascript: " + webviewContentWidth);
ToastmakeText( activity
"ContentWidth of webpage is: " +
webviewContentWidth +
"px" ToastLENGTH_SHORT)show();
}
}
}
}
Below is the XML layout used with the Activity wich only contains a simple WebView:
下面是Activity的Layout主要就是一个简单的WebView
<?xml version="" encoding="utf"?>
<LinearLayout
xmlns:android=";
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
AndroidManifestxml layout:
AndroidManifestxml代码
<?xml version="" encoding="utf"?>
<manifest
xmlns:android=";
package=""
android:versionCode="" android:versionName="">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name="Main"
android:label="@string/app_name">
<intentfilter>
<action android:name="androidintentactionMAIN" />
<category
android:name="androidintentcategoryLAUNCHER" />
</intentfilter>
</activity>
</application>
<usessdk android:minSdkVersion="" />
<usespermission android:name="androidpermissionINTERNET" />
</manifest>
You can also download the full source of Android Application WebViewContentWidth!

Ⅳ android apidemo在哪

apidemo文件存放位置是在sdk路径下面,具体如下:
首先,导入API Demos。File->new->project->Android project->Creat project from existing source 选择API Demos.
导入的文件可以在sdk的文件里面找到,如XXX/android-8/samples.也可以直接下载如http://dl-ssl.google.com/android/repository/samples-2.2_r01-linux.zip

阅读全文

与androidsamples下载相关的资料

热点内容
幕布app如何改字体 浏览:469
多层建筑面积算法 浏览:521
虚拟机加密狗驱动 浏览:704
多功能二开影视app源码教程 浏览:711
苹果显示你已经购买app项目怎么搞 浏览:719
怎么用云服务器开发 浏览:970
为什么要有dfs和bfs这两种算法 浏览:522
有了云服务器怎么赚钱 浏览:58
igmp配置命令packet 浏览:775
比较好用的加密软件在线客服 浏览:418
execute命令 浏览:304
写编程用的服务器是什么 浏览:159
语言编译属于什么软件 浏览:222
编译原理左递归右递归 浏览:184
java给字符串加引号 浏览:567
找不到服务器的dns怎么调整 浏览:871
电脑下载好软件应该怎么解压 浏览:599
安卓手机双核怎么设置 浏览:593
java毕业设计源码 浏览:555
sim卡取不出来怎么办安卓 浏览:381