当前位置:  ▪Android实现文件的分割和组装 iis7站长之家
本页文章导读:
    ▪百度map之短串分享        百度地图之短串分享在百度SDK中提供了一个短串分享功能,该功能核心意思就是,当你搜索到一个地址信息时,你可以通过短信、邮件、蓝牙等发给你的好友或者分享到第三方平台,包括空.........
    ▪ 敞开儿的项目重新运行的时候却不行了!已解决        好端端的项目重新运行的时候却不行了!!!已解决继续上一篇        项目不知怎么了,运行的好好的突然就运行不起来了。如果说是模拟器的问题可是别的项目依然可以运行;如果说是.........
    ▪ cuzysdk上线app引见 爱微淘       cuzysdk上线app介绍 爱微淘appname:爱微淘 description: 爱微淘是一款提供淘宝精选商品的app.在这里您看到的是我们精选出来的商品内容,有各种精品的男女鞋,精美女包,时尚女裙服饰,更有可爱.........

[1]百度map之短串分享
    来源: 互联网  发布时间: 2014-02-18
百度地图之短串分享

在百度SDK中提供了一个短串分享功能,该功能核心意思就是,当你搜索到一个地址信息时,你可以通过短信、邮件、蓝牙等发给你的好友或者分享到第三方平台,包括空间、微信等等。而接收方可以直接通过收到的链接打开手机上的百度地图客户端或者手机浏览器进行查看,这样就实现了地理位置信息的共享,百度Demo代码如下:

注意:短串分享目前只开放“POI搜索结果分享”(本文默认搜索的是北京市的餐厅)和“反向地理编码结果分享”(本文默认坐标是40.056878,116.308141),Demo只能按默认条件搜索是为方便演示,实际中应该从界面通过输入获取等才更具有灵活性。

介绍短串Activity(ShareDemo):

package com.home;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;

public class ShareDemo extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_share_demo);
	}

	public void startShareDemo(View view) {
		Intent intent = new Intent(this, ShareDemoActivity.class);
		startActivity(intent);
	}
}

ShareDemo布局文件(activity_share_demo):

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="36dp"
        android:text="@string/share_tip"
        android:textColor="@android:color/black"
        android:textSize="16sp" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="32dp"
        android:onClick="startShareDemo"
        android:text="开始体验" />

</RelativeLayout>

其中字符串share_tip内容为:

<string name="share_tip">\t\t短串分享是指,用户搜索查询后得到的每一个地理位置结果将会对应一条短串(短链接),用户可以通过短信、邮件或第三方分享组件(如微博、微信等)把短串分享给其他用户从而实现地理位置信息的分享。当其他用户收到分享的短串后,点击短串即可打开手机上的百度地图客户端或者手机浏览器进行查看。\n\n
                \t\t例如,用户搜索“百度大厦”后通过短信使用短串分享功能把该地点分享给好友,好友点击短信中的短串“http://j.map.baidu.com/XLCrk”后可以调起百度地图客户端或者手机浏览器查看“百度大厦”的地理位置信息。\n\n
                \t\t目前短串分享功能暂时开放了“POI搜索结果分享”和“反向地理编码结果分享”,日后会开放更多的功能,欢迎广大开发者使用短串分享功能。</string>

主Activity(ShareDemoActivity):

package com.home;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.map.ItemizedOverlay;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.OverlayItem;
import com.baidu.mapapi.map.PoiOverlay;
import com.baidu.mapapi.search.MKAddrInfo;
import com.baidu.mapapi.search.MKBusLineResult;
import com.baidu.mapapi.search.MKDrivingRouteResult;
import com.baidu.mapapi.search.MKPoiInfo;
import com.baidu.mapapi.search.MKPoiResult;
import com.baidu.mapapi.search.MKSearch;
import com.baidu.mapapi.search.MKSearchListener;
import com.baidu.mapapi.search.MKShareUrlResult;
import com.baidu.mapapi.search.MKSuggestionResult;
import com.baidu.mapapi.search.MKTransitRouteResult;
import com.baidu.mapapi.search.MKWalkingRouteResult;
import com.baidu.platform.comapi.basestruct.GeoPoint;

/**
 * 演示poi搜索功能
 */
public class ShareDemoActivity extends Activity {

	private MapView mMapView = null;
	private MKSearch mSearch = null; // 搜索模块,也可去掉地图模块独立使用
	// 保存搜索结果地址
	private String currentAddr = null;
	// 搜索城市
	private String mCity = "北京";
	// 搜索关键字
	private String searchKey = "餐馆";
	// 反地理编译点坐标
	private GeoPoint mPoint = new GeoPoint((int) (40.056878 * 1E6),
			(int) (116.308141 * 1E6));

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		DemoApplication app = (DemoApplication) this.getApplication();
		if (app.mBMapManager == null) {
			app.mBMapManager = new BMapManager(this);
			app.mBMapManager.init(DemoApplication.strKey,
					new DemoApplication.MyGeneralListener());
		}
		setContentView(R.layout.activity_share_demo_activity);
		mMapView = (MapView) findViewById(R.id.bmapView);
		mMapView.getController().enableClick(true);
		mMapView.getController().setZoom(12);

		// 初始化搜索模块,注册搜索事件监听
		mSearch = new MKSearch();
		mSearch.init(app.mBMapManager, new MKSearchListener() {

			@Override
			public void onGetPoiDetailSearchResult(int type, int error) {
			}

			/**
			 * 在此处理poi搜索结果 , 用poioverlay 显示
			 */
			public void onGetPoiResult(MKPoiResult res, int type, int error) {
				// 错误号可参考MKEvent中的定义
				if (error != 0 || res == null) {
					Toast.makeText(ShareDemoActivity.this, "抱歉,未找到结果",
							Toast.LENGTH_LONG).show();
					return;
				}
				// 将地图移动到第一个POI中心点
				if (res.getCurrentNumPois() > 0) {
					// 将poi结果显示到地图上
					PoiShareOverlay poiOverlay = new PoiShareOverlay(
							ShareDemoActivity.this, mMapView);
					poiOverlay.setData(res.getAllPoi());
					mMapView.getOverlays().clear();
					mMapView.getOverlays().add(poiOverlay);
					mMapView.refresh();
					// 当ePoiType为2(公交线路)或4(地铁线路)时, poi坐标为空
					for (MKPoiInfo info : res.getAllPoi()) {
						if (info.pt != null) {
							mMapView.getController().animateTo(info.pt);
							break;
						}
					}
				}
			}

			public void onGetDrivingRouteResult(MKDrivingRouteResult res,
					int error) {
			}

			public void onGetTransitRouteResult(MKTransitRouteResult res,
					int error) {
			}

			public void onGetWalkingRouteResult(MKWalkingRouteResult res,
					int error) {
			}

			/**
			 * 在此处理反地理编结果
			 */
			public void onGetAddrResult(MKAddrInfo res, int error) {
				// 错误号可参考MKEvent中的定义
				if (error != 0 || res == null) {
					Toast.makeText(ShareDemoActivity.this, "抱歉,未找到结果",
							Toast.LENGTH_LONG).show();
					return;
				}
				AddrShareOverlay addrOverlay = new AddrShareOverlay(
						getResources().getDrawable(R.drawable.icon_marka),
						mMapView, res);
				mMapView.getOverlays().clear();
				mMapView.getOverlays().add(addrOverlay);
				mMapView.refresh();

			}

			public void onGetBusDetailResult(MKBusLineResult result, int iError) {
			}

			@Override
			public void onGetSuggestionResult(MKSuggestionResult res, int arg1) {
			}

			@Override
			public void onGetShareUrlResult(MKShareUrlResult result, int type,
					int error) {
				// 分享短串结果
				Intent it = new Intent(Intent.ACTION_SEND);
				it.putExtra(Intent.EXTRA_TEXT, "您的朋友通过百度地图SDK与您分享一个位置: "
						+ currentAddr + " -- " + result.url);
				it.setType("text/plain");
				startActivity(Intent.createChooser(it, "将短串分享到"));
			}
		});
	}

	@Override
	protected void onPause() {
		mMapView.onPause();
		super.onPause();
	}

	@Override
	protected void onResume() {
		mMapView.onResume();
		super.onResume();
	}

	@Override
	protected void onDestroy() {
		mMapView.destroy();
		super.onDestroy();
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		mMapView.onSaveInstanceState(outState);

	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		mMapView.onRestoreInstanceState(savedInstanceState);
	}

	private void initMapView() {
		mMapView.setLongClickable(true);
		mMapView.getController().setZoom(14);
		mMapView.getController().enableClick(true);
		mMapView.setBuiltInZoomControls(true);
	}

	public void sharePoi(View view) {
		// 发起poi搜索
		mSearch.poiSearchInCity(mCity, searchKey);
		Toast.makeText(this, "在" + mCity + "搜索 " + searchKey,
				Toast.LENGTH_SHORT).show();
	}

	public void shareAddr(View view) {
		// 发起反地理编码请求
		mSearch.reverseGeocode(mPoint);
		Toast.makeText(
				this,
				String.format("搜索位置: %f,%f", (mPoint.getLatitudeE6() * 1E-6),
						(mPoint.getLongitudeE6() * 1E-6)), Toast.LENGTH_SHORT)
				.show();
	}

	/**
	 * 使用PoiOverlay 展示poi点,在poi被点击时发起短串请求.
	 * 
	 * @author kehongfeng
	 * 
	 */
	private class PoiShareOverlay extends PoiOverlay {

		public PoiShareOverlay(Activity activity, MapView mapView) {
			super(activity, mapView);
		}

		@Override
		protected boolean onTap(int i) {
			MKPoiInfo info = getPoi(i);
			currentAddr = info.address;
			mSearch.poiDetailShareURLSearch(info.uid);
			return true;
		}
	}

	/**
	 * 使用ItemizevOvelray展示反地理编码点位置,当该点被点击时发起短串请求.
	 * 
	 */
	private class AddrShareOverlay extends ItemizedOverlay {

		private MKAddrInfo addrInfo;

		public AddrShareOverlay(Drawable defaultMarker, MapView mapView,
				MKAddrInfo addrInfo) {
			super(defaultMarker, mapView);
			this.addrInfo = addrInfo;
			addItem(new OverlayItem(addrInfo.geoPt, addrInfo.strAddr,
					addrInfo.strAddr));
		}

		@Override
		public boolean onTap(int index) {
			currentAddr = addrInfo.strAddr;
			mSearch.poiRGCShareURLSearch(addrInfo.geoPt, "分享地址",
					addrInfo.strAddr);
			return true;
		}

	}
}

其布局文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/poishore"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginBottom="2dip"
            android:layout_marginLeft="2dip"
            android:layout_marginRight="2dip"
            android:layout_marginTop="2dip"
            android:layout_weight="1"
            android:background="@drawable/button_style"
            android:onClick="sharePoi"
            android:padding="10dip"
            android:text="poi搜索结果分享" />

        <Button
            android:id="@+id/addrshare"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginBottom="2dip"
            android:layout_marginLeft="2dip"
            android:layout_marginRight="2dip"
            android:layout_marginTop="2dip"
            android:layout_weight="1"
            android:background="@drawable/button_style"
            android:onClick="shareAddr"
            android:text="反向地理编码分享" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="点击地图上的搜索结果进行短串分享" />
    </LinearLayout>

    <com.baidu.mapapi.map.MapView
        android:id="@+id/bmapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true" />

</LinearLayout>

配置文件及Application类同前文。

附上图片效果:





 


    
[2] 敞开儿的项目重新运行的时候却不行了!已解决
    来源: 互联网  发布时间: 2014-02-18
好端端的项目重新运行的时候却不行了!!!已解决

继续上一篇

       项目不知怎么了,运行的好好的突然就运行不起来了。如果说是模拟器的问题可是别的项目依然可以运行;如果说是项目的问题可是项目刚刚运行的好好的怎么会突然出问题呢……

[2013-09-12 15:36:26 - Dex Loader] Unable to execute dex: D:\Store\bin\classes.dex (拒绝访问。)
[2013-09-12 15:36:26 - Store] Conversion to Dalvik format failed: Unable to execute dex: D:\Store\bin\classes.dex (拒绝访问。)

上网搜说是找到D:\Store\bin\classes.dex并用360解除占用就可以了,可是我发现我的D:\Store\bin下竟然没有classes.dex!

我又把项目重新clean重新设置,甚至重启eclipse但都没有用……

classes.dex为什么会丢失呢?不能复制不能粘贴的文件这可怎么弄啊。结果就在重启eclipse的时候我才发现,刚开始classes.dex是存在的可是又不见了,桌面右下角弹出的框把我惊呆了!!


太奇葩了!!!找回原文件就ok了。

不知大家会不会也遇到这样的问题,贴出来大家看看,等遇到这种问题的时候好好看看吧,本来很简单的事 



    
[3] cuzysdk上线app引见 爱微淘
    来源: 互联网  发布时间: 2014-02-18
cuzysdk上线app介绍 爱微淘
appname:爱微淘
description:

爱微淘是一款提供淘宝精选商品的app.在这里您看到的是我们精选出来的商品内容,有各种精品的男女鞋,精美女包,时尚女裙服饰,更有可爱宝宝所需要的一切商品,有你爱吃的美食特产,数码配件等,更有9块9,19块9,29块9的超值商品,更重要的是您可以自己搜索自定义您喜欢的商品种类,打造自己的专业商品导航,我们提供的是您从未有过的购物体验哦。


感谢cuzy的产品支持:最方便高效的淘宝客 http://www.cuzy.com


keyword:


精选淘宝,9.9包邮,个性男装,潮流女装,精品男鞋,时尚女鞋,女生上衣,精美女包,女裙系列,女生裤袜,美容护肤,舒适内衣,母婴儿童,运动健身,美食特产,户外运动,精美礼物,珠宝配饰,数码配件,家居建材


support url:http://www.iminitao.com



















cuzySDK(www.cuzy.com)是一个移动开发者提供淘宝客模块的平台。开发者通过使用cuzy,可以便捷的集成到各移动平台,方便的删选推荐物品,高效的转换流量。



    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3