Thursday, December 29, 2011

Place PDF from Google Docs into your Blog

Posted a how to post a Presentation from Google docs into your blog. Presented my findings to my friend and it got back again to me. "No is not a presentation but a pdf that I want to show" - he said. So lets start all over again but now with a pdf.
The PDF embed into this post has the details on how to, however I will quick break down the steps.

Will try to show in a few quick steps on how to

  1. We assume you have a pdf file already.
  2. Upload your pdf to your Google Docs account.
  3. Share your pdf and set it to be public.
  4. Copy the link given from Google Docs of your pdf
  5. Paste the link into the address bar of your browser
  6. Copy again the resulting link from the address bar of your browser
  7. On the address replace chrome=true to chrome=false and append to the end of the link "&embedded=true" (without the " )
  8. Place your resulting URL into this block
    1. <iframe height="780" src="MY_ADDRESS" style="border: none;" width="600"></iframe>
  9. Change width and height as needed.

Sample resulting block of code

<iframe height="780" src="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=false&amp;srcid=0B10UfrjZDyv1YzNiZDgzZTgtMWM2Mi00YmM4LTg3OGEtZWY3YjQ1NmExMGQz&amp;hl=en_US&amp;embedded=true" style="border: none;" width="600"></iframe>

Embedded PDF in action!





Hope this was useful to you!

Wednesday, December 28, 2011

How to link a Google doc presentation into your blog

Some time ago a friend asked me on how to share a document made in Google Docs from his blog. Well I said I don't know. But as the nerd that I am, could not stop me from finding out.

So here it goes in 5 steps.
1. Create the document (this you may already conquer!!, one down and four to go). Sample is a presentation.
2. Change the privacy settings of your document to make it "Anyone with the link"
3. Go into the right corner to Share - Publish/embed
4. Click on Publish Presentation
5. Copy and paste the code into your blog.

If the instructions are too hard for you, take a look at the presentation bellow.





That is all, hope it helps.

Monday, December 5, 2011

Am I that stupid developer?

Everyday I read stories in the web about someone (a developer) who do something awesome. Some great app or hack that for me seems to be impossible to accomplish.
I spend a lot of time on developer sites, reading and coding. But still I am able to accomplish very little. So it is normal to ask myself "Am I that stupid or are they so smart?". Probably the answer is a little of both (which one is more left to be seen).
All this just to say, if you are a developer or want to be. Please do not think of yourself less than others because of what some guys in the web do. There are a lot of brilliant guys out there and in my experience a lot of those brilliant guys can help during our late nights smashing our heads about a null pointer exception or a script error. Keep on programming, hacking or whatever is that rocks your boat. Because be sure that I will continue as well as a lot of other nerds like us.
Enjoy programming and developing, help others when you can and share what ever you can!
Happy programming for all who reads this (if any).

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.