我在Android上玩Google Maps API V2.尝试在两个位置之间获取路径并使用JSON解析进行此操作.
我正在寻找一条路线.并且路线开始应该如何.但后来有一点它走错了路.
我的终点目的地错了.而在其他一些地方,我的应用程序就会被终止.
这就是我所做的
这是我的makeURL方法
public String makeUrl(){
StringBuilder urlString = new StringBuilder();
urlString.append("http://maps.googleapis.com/maps/api/directions/json");
urlString.append("?origin="); //start positie
urlString.append(Double.toString(source.latitude));
urlString.append(",");
urlString.append(Double.toString(source.longitude));
urlString.append("&destination="); //eind positie
urlString.append(Double.toString(dest.latitude));
urlString.append(",");
urlString.append(Double.toString(dest.longitude));
urlString.append("&sensor=false&mode=driving");
return urlString.toString();
}
Run Code Online (Sandbox Code Playgroud)
我的JSON解析器
public class JSONParser {
static InputStream is = null;
static JSONObject jObj = null;
static String json = "";
public JSONParser() {
// TODO Auto-generated constructor stub
}
public String getJSONFromURL(String url){
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse …Run Code Online (Sandbox Code Playgroud) 我先从我的设置开始.为此,我们有2台服务器
Server1将用于所有源代码,文件等..在Server2上,我们拥有所有用户信息和登录.两台服务器都在Centos 6.4上运行
现在我们要在server1上设置一个使用apache(httpd)的SVN存储库,并且具有使用来自服务器2的帐户的LDAP身份验证.
以前我建立了一个CVS回购aswel所以我100%肯定ldap正在运作.
我的SVN repo正在使用apache,但我似乎无法正确设置我的ldap身份验证.
我一直在寻找几天,我不知道该怎么办.
我/etc/httpd/conf.d/subversion.conf看起来如下
<Location /svn>
DAV svn
SVNPath /var/www/svn/testProject
AuthType Basic
AuthName "My repo"
AuthzLDAPAuthoritative on
AuthLDAPURL "ldap://192.168.1.2:389/cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
AuthUserFile /var/www/svn-auth-conf
Require valid-user
#AuthzSVNAccessFile /var/www/svn-acces-control
Run Code Online (Sandbox Code Playgroud)
我/etc/openldap/ldap.conf在server1上看起来像这样
REFERRALS off
TLS_CACERTDIR /etc/openldap/cacerts
URI ldap://macserver.intranet.zappware.com
BASE cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com
Run Code Online (Sandbox Code Playgroud)
在server1上我有root访问权限,所以我能够正确设置它.当我在我的用户帐户上访问Server2时,我可以像这样执行ldapsearch
userM$ ldapsearch -x -b cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com
Run Code Online (Sandbox Code Playgroud)
我获得该服务器上的所有用户帐户
但是当我尝试ldapsearch -x -b cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com -W sAMAccount
Server2要求我输入LDAP密码时.但是我没有那个密码,我们以前担任过所有服务器资源的IT经理已经离开了公司.
所以我想我可以再制作一个密码并输入
/etc/openldap/slapd.conf
Run Code Online (Sandbox Code Playgroud)
但是当我在服务器2上检查该文件时它只是空的
希望有人可以给我一些关于如何解决这个问题的新的有用的提示