(Notes Nico)

News not yet published, shall be reviewed/approved by other authors.

(Notes Nico)

Postby plusminus » Wed Oct 08, 2008 5:58 pm

Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby plusminus » Thu Oct 09, 2008 8:09 pm

Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Oct 10, 2008 7:10 pm

Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Oct 10, 2008 8:55 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 ArrayList<GeoPoint> al1 = new ArrayList<GeoPoint>();
  2.  
  3.                 long startMs = System.currentTimeMillis();
  4.  
  5.                
  6.  
  7.                 for(int i = 0; i < CNT; i++){
  8.  
  9.                         final StringTokenizer st = new StringTokenizer(test, " ");
  10.  
  11.                         while (st.hasMoreTokens())
  12.  
  13.                                 al1.add(GeoPoint.fromDoubleString(st.nextToken()));
  14.  
  15.                        
  16.  
  17.                         al1.clear();
  18.  
  19.                 }
  20.  
  21.                 long endMs = System.currentTimeMillis();
  22.  
  23.                 System.out.println("len: " + (endMs - startMs));
  24.  
  25.         }
  26.  
  27.        
  28.  
  29.         private static class GeoPoint{
  30.  
  31.                 protected final int mLatitude, mLongitude;
  32.  
  33.                 public GeoPoint(int latitude, int longitude) {
  34.  
  35.                         mLatitude = latitude;
  36.  
  37.                         mLongitude = longitude;
  38.  
  39.                 }
  40.  
  41.                
  42.  
  43.                 protected static GeoPoint fromDoubleString(final String s){
  44.  
  45.                         final int commaPos = s.indexOf(',');
  46.  
  47.                         return new GeoPoint((int)(Double.parseDouble(s.substring(0,commaPos-1)) * 1E6),
  48.  
  49.                                         (int)(Double.parseDouble(s.substring(commaPos+1,s.length())) * 1E6));
  50.  
  51.                 }
  52.  
  53.         }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Tue Oct 14, 2008 6:59 pm

On a routfetch, do not directly requery the GPScoords, but use own 'lastknownlocation'.
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Wed Oct 15, 2008 1:24 pm

For AndPipes, adjust the speed of the running water depending on the orientation sensor. So the user can 'rotate' his phone to get some extra time. :D
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby plusminus » Mon Oct 20, 2008 3:14 pm

Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Mon Oct 20, 2008 4:00 pm

Hide 'SD from contacts' until its working...
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Mon Oct 20, 2008 4:40 pm

Give possibility to make routes offline-avaibale (in Advanced Nav Flags Dialog) then add a Menu (and/or Map) to select one of the saved routes.
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Oct 31, 2008 4:18 pm

http://developer.decarta.com/html/static/schemas/

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <xls:AvoidList>
  2.  
  3.     <xls:AOI>
  4.  
  5.         <gml:CircleByCenterPoint numArc="1">
  6.  
  7.             <gml:pos>-134.2567801 38.6721569</gml:pos>
  8.  
  9.             <gml:radius uom="km">3.26</gml:radius>
  10.  
  11.         </gml:CircleByCenterPoint>
  12.  
  13.     </xls:AOI>
  14.  
  15. </xls:AvoidList>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <xls:AvoidList>
  2.  
  3.     <xls:AOI>
  4.  
  5.         <gml:Polygon>
  6.  
  7.              <gml:exterior>
  8.  
  9.                 <gml:LinearRing>
  10.  
  11.                       <gml:pos>45.256 -110.45</gml:pos>
  12.  
  13.                       <gml:pos>46.46 -109.48</gml:pos>
  14.  
  15.                       <gml:pos>43.84 -109.86</gml:pos>
  16.  
  17.                       <gml:pos>45.256 -110.45</gml:pos>
  18.  
  19.                 </gml:LinearRing>
  20.  
  21.              </gml:exterior>
  22.  
  23.         </gml:Polygon>
  24.  
  25.     </xls:AOI>
  26.  
  27. </xls:AvoidList>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2.         <xls:RequestHeader/>
  3.  
  4.         <xls:Request methodName="GeocodeRequest" requestID="123456789" version="1.1">
  5.  
  6.                 <xls:GeocodeRequest>
  7.  
  8.               <xls:Address countryCode="DE">
  9.  
  10.                 <xls:StreetAddress>
  11.  
  12.                   <xls:Street>Mannheimer straße</xls:Street>
  13.  
  14.                 </xls:StreetAddress>
  15.  
  16.                 <xls:Place type="Municipality">Schriesheim</xls:Place>
  17.  
  18.               </xls:Address>
  19.  
  20.                 </xls:GeocodeRequest>
  21.  
  22.         </xls:Request>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.         <xls:RequestHeader/>
  2.  
  3.         <xls:Request methodName="GeocodeRequest" requestID="123456789" version="1.1">
  4.  
  5.                 <xls:GeocodeRequest>
  6.  
  7.               <xls:Address countryCode="DE">
  8.  
  9.                 <xls:StreetAddress>
  10.  
  11.                   <xls:Street>Mannheimer strasse</xls:Street>
  12.  
  13.                 </xls:StreetAddress>
  14.  
  15.                 <xls:PostalCode>69198</xls:PostalCode>
  16.  
  17.               </xls:Address>
  18.  
  19.                 </xls:GeocodeRequest>
  20.  
  21.         </xls:Request>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Wed Nov 05, 2008 5:06 pm

http://mirror.its.uidaho.edu/pub/apache ... encies.zip

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 final HttpClient httpClient = new DefaultHttpClient();
  2.  
  3.                 final HttpPost request = new HttpPost(url);
  4.  
  5.  
  6.  
  7.                 // create the multipart request and add the parts to it
  8.  
  9.                 final MultipartEntity requestEntity = new MultipartEntity();
  10.  
  11.                 requestEntity.addPart("Position", new StringBody("49.4727330,8.6541690"));
  12.  
  13.                 requestEntity.addPart("Minutes", new StringBody("5"));
  14.  
  15.  
  16.  
  17.                 request.setEntity(requestEntity);
  18.  
  19.  
  20.  
  21.                 final HttpResponse response = httpClient.execute(request);
  22.  
  23.                 final int status = response.getStatusLine().getStatusCode();
  24.  
  25.  
  26.  
  27.                 if (status != HttpStatus.SC_OK) {
  28.  
  29.                         System.out.println("Damn...");
  30.  
  31.                         // Damn it
  32.  
  33.                 } else {
  34.  
  35.                         final Reader r = new InputStreamReader(new BufferedInputStream(response.getEntity().getContent()));
  36.  
  37.                         // see above
  38.  
  39.                         final char[] buf = new char[8 * 1024];
  40.  
  41.                         int read;
  42.  
  43.                         final StringBuilder sb = new StringBuilder();
  44.  
  45.                         while((read = r.read(buf)) != -1)
  46.  
  47.                                 sb.append(buf, 0, read);
  48.  
  49.                        
  50.  
  51.                         System.out.println(sb.toString());
  52.  
  53.                 }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Nov 07, 2008 3:49 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         /** Note: this pattern is <b>CaSe-SeNsItIvE</b>! */
  2.  
  3.         protected static final String PATTERNSTRING_UK_POSTCODE_BS_7666 = "(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW]) [0-9][ABD-HJLNP-UW-Z]{2})";
  4.  
  5.         /** Note: this pattern is <b>CaSe-SeNsItIvE</b>! */
  6.  
  7.         protected static final Pattern PATTERN_UKPOSTCODE_BS_7666 = Pattern.compile(PATTERNSTRING_UK_POSTCODE_BS_7666);
  8.  
  9.        
  10.  
  11.         public static void main(String[] args) throws Exception {
  12.  
  13.  
  14.  
  15.                 final String matchme = "lolzAA9A 9AArofl";
  16.  
  17.                 if(doesMatchUKPostcode_BS_7666(matchme)){
  18.  
  19.                         System.out.println(getMatchUKPostcode_BS_7666(matchme));
  20.  
  21.                 }else{
  22.  
  23.                         System.out.println("Didn't match...");
  24.  
  25.                 }
  26.  
  27.         }
  28.  
  29.  
  30.  
  31.         /**
  32.  
  33.          * Checks whether the <code>aPostcode</code> passed is a valid <b>BS 7666</b>-UK-Postcode.
  34.  
  35.          * @param aPostcode <b>CaSe-SeNsItIvE</b>!
  36.  
  37.          * @return
  38.  
  39.          * @throws NoMatchFoundException
  40.  
  41.          */
  42.  
  43.         protected static boolean doesMatchUKPostcode_BS_7666(final String aPostcode){
  44.  
  45.                 final Matcher matcher = PATTERN_UKPOSTCODE_BS_7666.matcher(aPostcode);
  46.  
  47.                 return matcher.find();
  48.  
  49.         }
  50.  
  51.  
  52.  
  53.         /**
  54.  
  55.          * Extracts a matched <b>BS 7666</b>-UK-Postcode out of a String.
  56.  
  57.          * @param aPostcode <b>CaSe-SeNsItIvE</b>!
  58.  
  59.          * @return
  60.  
  61.          * @throws NoMatchFoundException whether the <code>aPostcode</code> passed is <b>not</b> a valid <b>BS 7666</b>-UK-Postcode.
  62.  
  63.          */
  64.  
  65.         protected static String getMatchUKPostcode_BS_7666(final String aPostcode) throws NoMatchFoundException{
  66.  
  67.                 final Matcher matcher = PATTERN_UKPOSTCODE_BS_7666.matcher(aPostcode);
  68.  
  69.                 final boolean matchFound = matcher.find();
  70.  
  71.  
  72.  
  73.                 if(matchFound)
  74.  
  75.                         return matcher.group();
  76.  
  77.                 else
  78.  
  79.                         throw new NoMatchFoundException();
  80.  
  81.         }
Parsed in 0.039 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Nov 07, 2008 5:32 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         /** Called when the activity is first created. */
  2.  
  3.         @Override
  4.  
  5.         public void onCreate(Bundle icicle) {
  6.  
  7.                 super.onCreate(icicle);
  8.  
  9.                
  10.  
  11.                 //...
  12.  
  13.                
  14.  
  15.                 this.bundleCreatedWith = this.getIntent().getExtras();
  16.  
  17.                
  18.  
  19.                 //...
  20.  
  21.                
  22.  
  23.                 switch(Nationality.fromAbbreviation(this.bundleCreatedWith.getString(EXTRAS_COUNTRYCODE_ID)){
  24.  
  25.                         case UNITED_KINGDOM:
  26.  
  27.                         case NORTHERN_IRELAND:
  28.  
  29.                                 this.findViewById(R.id.ibtn_sd_ziporcity_select_uk_postcodesearch).setVisibility(View.VISIBLE);
  30.  
  31.                                 this.findViewById(R.id.tv_sd_ziporcity_select_uk_postcodesearch).setVisibility(View.VISIBLE);
  32.  
  33.                                 break;
  34.  
  35.                         default:
  36.  
  37.                                 break;
  38.  
  39.                 }
  40.  
  41.                
  42.  
  43.                 //...
  44.  
  45.         }
  46.  
  47.  
Parsed in 0.038 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Fri Nov 07, 2008 10:36 pm

Marketing-Ideen:

- 1 of 4 weeks each month FREE-AndNav :!:
- 1-2 days per week FREE AndNav
- X FREE uses
- X days FREE use (Trial-period)
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby plusminus » Tue Nov 11, 2008 7:53 pm

Eclipse Singleton Pattern

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. private static ${enclosing_type} mInstance;
  2.  
  3.  
  4.  
  5. private ${enclosing_type}(){}
  6.  
  7.  
  8.  
  9. public static ${enclosing_type} getInstance(){
  10.  
  11.         if(instance == null)
  12.  
  13.                 mInstance = new ${enclosing_type}();
  14.  
  15.  
  16.  
  17.         return mInstance;
  18.  
  19. }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top
Next

Return to News Review

Who is online

Users browsing this forum: No registered users and 1 guest