/**
* @ (#) jizhanyun.com for java * * base station cloud Platform Interface demo for java * * @ Base Station Cloud * @version 1.00 */ Import Java.io.bufferedreader;import java.io.inputstream;import Java.io.inputstreamreader;import java.net.*; Import Java.io.ioexception; public class API { public static String Apikey &NB Sp;= "1ats2c6d9fff0825da88b864a3d1e034"; Apikey Base Station cloud platform get public static String MNC = "0"; //mnc public static String lac = "20857"; //lac Public Static String cell = "59051"; //cell public static string Getwebdata (String DOMAIN) { StringBuffer sb = new StringBuffer (); InputStream is = NULL;&N Bsp InputStreamReader ISR = null; BufferedReader in = null; &NBSP ; Try { Java.net.URL URL = new Java.net.URL (domain); &NB Sp is = Url.openstream (); ISR = new InputStreamReader (IS, "utf-8"); &nbs P in = new BufferedReader (ISR); String Line;&nbs P while (line = In.readline ()) = null) { &NBSP ; Sb.append (line) append ("\ n"); } I N.close (); } catch (IOException e) {   ; &nbSp E.printstacktrace (); }finally { T Ry { if (in!=null) { In.close (); in=null;   ; } if (isr!=null) { &N Bsp isr.close (); &NBSP ; isr=null; } if (is!=null) { is.close (); is=null; }& nbsp } catch (IOException e) { E.printstackt Race (); } } return SB.TOSTR ING (); } public static void main (string[] args) { String data=getwebdata ("http://www.jizhanyun.com/api/?mnc=" +mnc+ "&lac=" +lac+ "&cell=" +cell+ "&ishex= 10&type=1&apikey= "+apikey); string code=" "; String about=" "; string lng=" "; String lat=" "; String g Lng= ""; string glat= ""; string address= ""; &NBSP ; if (data!= ") { string[] Arr=data.split (" \\| "); code=arr[0]; &NBsp if (Code.equals ("001")) { lng=arr[2]; &nbs P lat=arr[3]; glng=arr[4];& nbsp glat=arr[5]; Addre ss=arr[6]; }else{ About=ar r[1]; } }   ; SYSTEM.OUT.PRINTLN ("Status:" +code); SYSTEM.OUT.PRINTLN ("description:" +about); SYSTEM.OUT.PRINTLN ("Longitude:" +lng); System.out.println ("Latitude:" +lat); & nbsp SYSTEM.OUT.PRINTLN ("Google Maps Longitude:" +glng); SYSTEM.OUT.PRINTLN ("Google Maps Longitude:" +glat); SYSTEM.OUT.PRINTLN ("Address:" +address); }}
Java calls the base station cloud interface invocation instance