使用Android Studio与ArcGIS Android SDK的开发环境部署和HelloWorld
android studio(以下简称AS)是google推荐的android专用IDE,替代目前主流的eclipse,另外arcgis也把AS作为推荐的android IDE
本文不介绍android SDK的部署和AS的安装
以下网站应该是AS的官方中国官网,有很多AS相关基础教程和AS的下载(不用翻墙下载了),强烈推荐
http://www.android-studio.org/
本文代码以arcgis android SDK中的arcgis-android-sdk-v10.2.4\samples\Maps\HelloWorld为基础
环境:Android SDK API 19,android studio 1.0,arcgis android SDK 10.2.4,小米4+MIUI v6
首先new一个project,一直next就行

新建project后,把这里切换到project

打开以下文件

把代码改为
package jls.as7; import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem; import com.esri.android.map.MapView; public class MainActivity extends Activity {
MapView mMapView; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); // After the content of this Activity is set, the map can be accessed programmatically from the layout.
mMapView = (MapView) findViewById(R.id.map);
} @Override
protected void onPause() {
super.onPause(); // Call MapView.pause to suspend map rendering while the activity is paused, which can save battery usage.
if (mMapView != null)
{
mMapView.pause();
}
} @Override
protected void onResume() {
super.onResume(); // Call MapView.unpause to resume map rendering when the activity returns to the foreground.
if (mMapView != null)
{
mMapView.unpause();
}
}
}
打开arcgis android SDK的压缩包,在libs目录下,找到如下几个jar包

复制到代码里如下目录

同样是arcgis SDK的libs目录下,把以下几个文件夹

复制到代码的如下目录(jniLibs目录默认不存在,要手动新建)

打开AndroidManifest.xml,在manifest节点下,添加如下内容
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />


打开moudle的build.gradle,在android节点下添加如下代码
packagingOptions {
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}


到此配置完毕,插上手机,Run运行程序


使用Android Studio与ArcGIS Android SDK的开发环境部署和HelloWorld的更多相关文章
- 《ArcGIS Runtime SDK for Android开发笔记》——(5)、基于Android Studio构建ArcGIS Android开发环境(离线部署)(转)
1.前言 在上一篇的内容里我们介绍了基于Android Studio构建ArcGIS Runtime SDK for Android开发环境的基本流程,流程中我们采用的是基于Gradle的构建方式,在 ...
- 《ArcGIS Runtime SDK for Android开发笔记》——(4)、基于Android Studio构建ArcGIS Android开发环境
1.前言 2015年1月15日,发布ArcGIS Runtime SDK for Android v10.2.5版本.从该版本开始默认支持android studio开发环境,示例代码的默认开发环境也 ...
- 《ArcGIS Runtime SDK for Android开发笔记》——(6)、基于Android Studio的ArcGIS Android工程结构解析
1.前言 Android Studio 是第一个Google官方的 Android 开发环境.其他工具,例如 Eclipse,在 Android Studio 发布之前已经有了大规模的使用.为了帮助开 ...
- 使用Android Studio和Genymotion模拟器搭建Andriod开发环境
一.Android Studio下载 1.打开http://www.android.com/ 2.依照下图步骤打开下载页面 a.在页脚部分点击“App Developer Resources” b.点 ...
- 在Android Studio上进行OpenCV 3.1开发环境配置
开发环境: Windows 7 x 64 家庭版 Android Studio 1.5.1(Gradle版本2.8) JDK 1.8.0 Android 6.0(API 23) OpenCV 3.1. ...
- Android Studio 0.4 + PhoneGap 3.3 开发环境的搭建
最近在尝试HTML5移动平台下的开发 由于安卓的方便性,首先开始了安卓的试验 现在安卓下的开发工具首选 Android Studio (写这文章的时候,是0.4) 而跨平台的HTML5 App比较出名 ...
- 【转】在Android Studio中下载Android SDK的两种方式(Android Studio3.0、windows)
在Android Studio中下载Android SDK的两种方式(Android Studio3.0.windows) 方式一.设置HTTP Proxy1. 打开Settings2. 点击HTTP ...
- android studio :com.android.support:appcompat-v7:21.+ 报错
android studio :com.android.support:appcompat-v7:21.+ 报错: 在project——>app——>build.gradle修改: app ...
- Android Studio开发环境部署
Step0:背景,那些年-- Step1:安装JDK Step2:安装Android Studio 其他问题1:安装Android Studio之前没有先安装JDK 其他问题2:No JVM inst ...
随机推荐
- web开发利器 fiddler
http://mccxj.github.io/blog/20130531_introduce-to-fiddler.html
- [Everyday Mathematics]20150221
设 $y_n=x_n^2$ 如下归纳定义: $$\bex x_1=\sqrt{5},\quad x_{n+1}=x_n^2-2\ (n=1,2,\cdots). \eex$$ 试求 $\dps{\vl ...
- WCF:百度百科
百科-WCF http://baike.baidu.com/view/1140438.htm Wcf Windows Communication Foundation(WCF)是由微软发展的一组数据通 ...
- Android圆形图片--ImageView
[ RoundImageView.java ] package com.dxd.roundimageview; import android.content.Context; import andro ...
- ajax连接池和XMLHttpRequest
连接池 我们公司在路由和交换机web界面和后端交互全部采用的是自己封装的ajax组件完成的,组件有点老了,代码风格和其中的某些用法现在看起来都有点不习惯.今天把这个组件的核心部分的ajax连接池记录下 ...
- Cocos2d-android (05) 渐变动画(颜色,淡入淡出。。。)
淡入淡出.颜色渐变及动作重复执行 import org.cocos2d.actions.base.CCRepeatForever; import org.cocos2d.actions.interva ...
- 查找指定目录下的文件 .xml
pre{ line-height:1; color:#9f1d66; background-color:#cfe4e4; font-size:16px;}.sysFunc{color:#5d57ff; ...
- DOM笔记(十):JavaScript正则表达式
一.RegExp ECMAScript通过RegExp类型类支持正则表达式,语法和Perl类似: var exp = /pattern/flags; patternb部分是任何简单的或复杂的正则表达式 ...
- 【C#】如何创建xml文件以及xml文件的增、改
增: using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpre ...
- 15+ 易响应的CSS框架快速开启你的敏捷网站项目
由 于移动互联用户的快速增加,现在数量已经超出10亿,几乎可以肯定的是你的网站每天都会有移动用户访问.如果你组织计划创建一个对移动用户友好的浏览体 验,有多个方面需要考虑.响应快速的网站设计似乎现在很 ...