Friday, November 25, 2011

Android 2.3.7 on HTC myTouch3G

After a lot of time I could compile the cyanogenmod 7 for my phone (HTC myTouch 3G). It may be buggy or slow, but as a true nerd I do not care. It is something that you do because you can. So I am happy now.
Oh.. just saying is not perfect but anyhow I'm happy.
The video is very slow because video is captured through the adb. When the phone disconnected to the screen capture software it is "faster".

My broken droid

For all of you that have tried to compile the Android source code and run into a LOT OF ERRORS. Somehow "fix it" then another arises, "fix again" and then another.... And of course most of the fixes are commenting a line or skipping building certain module.
After searching the Internet, there are a lot of people that runs in same problems that i do. Some shows success after a while others (like me) decided to join forces between the head and the keyboard to see what comes out of it. Most of the time this solution only produces a headache.
Anyhow in the name of all us nerds that have very old phones and just for the fun of it want to port the latest version of Android to it. Please make the source building process a little easier. I have no solution since I am no expert so do not know what can be done. But there are smart people out there that can make this better and easier.
If you are like me trying to build this yourself for your phone, go ahead continue trying. I believe there is a small chance of success and you can achieve it.
Finished this post, lets get back to my crusade and see what's comes out of it.

Thursday, November 17, 2011

Trouble downloading Android Source code

After a lot of time without being unable to sync any git repository, with a unable to get https helper error message. I encountered with a blog post that suggested to upgrade git. So look no more on the web, update and build from source your git. After retry, if problem is not fixed then start searching again on the web. Check out this link to upgrade your git http://www.barregren.se/blog/how-install-git-source-ubuntu I have Ubuntu and had the git from the Ubuntu repository (you know the one you get with apt-get) well forget about it. Go ahead get the version directly from source and build/install. It is better that way, at least in my case it fixed it all. Now I am a happy camper, trying to build android from source for my old phone, oh yes!

Tuesday, November 8, 2011

How to use a WebView and navigate inside it

As you may know Android provides the WebView control that allows you to show a web page inside your activity very nice. Just drag & drop from the "designer" into your Activity and that's it.
Ok, but after placing your WebView you notice that when you click in one link it opens the default web browser and bye bye your app.
Well to keep the navigation in your app. Check this snipped.

public class WebActivity extends Activity {
 public final static String URL = "URL";
 private WebView mWebClient;

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

  mWebClient = (WebView)this.findViewById(R.id.webViewSpace);

  Bundle bundle = this.getIntent().getExtras();
  String url = bundle.getString(URL);
  
//Next line to make continue navigating inside our WebView
  mWebClient.setWebViewClient(new WebViewClient(){

   @Override
   public boolean shouldOverrideUrlLoading(WebView view, String url) {
    view.loadUrl(url);
    return true;
   }
  });  

  mWebClient.loadUrl(url);
 }
}

To avoid loading the page in other activity just neeeeds to extends a WebViewClient, in here I just created an anonymous class cause I'm lazzy but you may extend in a formal class and do stuff like filter only your site trafic, and any other let the browser manage.