Git Product home page Git Product logo

codetastrophe's People

Watchers

 avatar

codetastrophe's Issues

V1.3 crashes when running on Cupcake (firmware 1.5 Build CRB43)

What steps will reproduce the problem?
1. run cupcake os
2. start CellFinder
3. Crash

What is the expected output? What do you see instead?
Map with cell site info. "Sorry! The application CellFinder (process
com.codetastrophe.cellfinder) has stopped unexpectedly. Please try again.
Force close"

What version of the product are you using? On what operating system?
CellFinder v1.3, Android OS v1.5

Please provide any additional information below.
Worked fine on Android OS v1.1

Original issue reported on code.google.com by [email protected] on 2 Jun 2009 at 12:32

OpenCellID + Ericsson Cell ID code

I thought this code might interest you, I cooked it up to get around
needing to turn on network location on my phone, frankly I just don't
want google knowing everything about me all the time.

If you want, you can use this code for anything you like under any
license you want.

       private void getOpenCellID(String mcc, String mnc, int lac, int cid)
       {
       int shortcid = cid & 0xffff;

       String surl = "http://www.opencellid.org/cell/get?key="+opencellidhash+

"&mcc="+mcc+"&mnc="+mnc+"&lac="+lac+"&cellid="+shortcid;

       System.out.println("Cell Location changed? "+surl);

       try
       {
                       URL url = new URL(surl);
                       HttpURLConnection conn =
(HttpURLConnection)url.openConnection();
                       conn.connect();
                       int respcode = conn.getResponseCode();
                       DataInputStream dis = new
DataInputStream(conn.getInputStream());
                       byte[] data = new byte[1024];
               int len = dis.read(data, 0, 1024);
               dis.close();
               conn.disconnect();
               conn = null;

               if(respcode == 200)
               {
               String d = new String(data, 0, len);
               System.out.println("got cell location! "+d);

               String range = d.substring(d.indexOf("range=\"")+7);
               range = range.substring(0, range.indexOf("\""));
               String lat = d.substring(d.indexOf("lat=\"")+5);
               lat = lat.substring(0, lat.indexOf("\""));
               String lon = d.substring(d.indexOf("lon=\"")+5);
               lon = lon.substring(0, lon.indexOf("\""));
               }
               } catch (Exception e) {}
       }

   private void getEricsson(String mcc, String mnc, int lac, int cid)
   {
       int shortcid = cid & 0xffff;

               String surl =
"http://cellid.labs.ericsson.net/json/lookup?key="+ericssonhash+

"&mcc="+mcc+"&mnc="+mnc+"&lac="+Integer.toHexString(lac)+

"&cellid="+Integer.toHexString(shortcid);

       System.out.println("Cell Location changed? "+surl);

               try
               {
                       URL url = new URL(surl);
                       HttpURLConnection conn =
(HttpURLConnection)url.openConnection();
                       conn.connect();
                       int respcode = conn.getResponseCode();
                       DataInputStream dis = new
DataInputStream(conn.getInputStream());
                       byte[] data = new byte[1024];
               int len = dis.read(data, 0, 1024);
               dis.close();
               conn.disconnect();
               conn = null;

               if(respcode == 200)
               {
               String d = new String(data, 0, len);
               System.out.println("got cell location! "+d);

                       JSONObject tmp = new JSONObject(d);
                       tmp = tmp.getJSONObject("position");
                       int range =
(int)Double.parseDouble(tmp.getString("accuracy"));
                       double lat =
Double.parseDouble(tmp.getString("latitude"));
                       double lon =
Double.parseDouble(tmp.getString("longitude"));
               }
               } catch (Exception e) {}
   }

Original issue reported on code.google.com by [email protected] on 1 Nov 2009 at 8:00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.