You need answers? sure, we need etiquette !


There's one thing about Open Source tradition that everyone should know and care about.
This is specifically for the people who are actively (or maybe not that often) ask questions on Q&A sites (like stackoverflow.com) and other development forums.

The person who answers you, is certainly knowing a particular thing better than you, in some cases knows MANY things better than you. This is the only reason he's able to answer you and perhaps get you out of your biggest problem of the day.

He's sharing his hard-earned knowledge with you, for free!
For which he could have earned serious amount of money if he was selling it. But the spirit of collaborative learning is what drives him.
That's how OpenSource things work.
Consider the case when there was nobody to help him, he dug out things himself, and now is ready to share.
For all this favour, he at least deserves a warm thanks, or at least attention when he's waiting for you to respond.

I have been active into Java and now Android for quite few years, and am seeing as Android is rapidly gaining success, many and many people are jumping into Android development, and obviously, are heading toward forums and Q&A sites for help.

But many of them have behaviours which hurt a lot.
You, as a person asking for help, must understand that you are being given knowledge that can help you gain competitive advantage over your peers in a certain area. Your problems are being solved, your project bottle necks are being resolved, all for free. So you at least can be nice to him, be attentive and respond frequently.

Please ask questions nicely. Provide as much information as you can, thank the person helping you.
If you're in chat, try to be friendly and have appropriate amount of gratitude. Please.

Android: Sign-in with Twitter

Hi.

Many people use Twitter4J for coding Twitter clients for Android, but I couldn't find a single example of how to implement "Sign-in with twitter" in my Android applications, as Facebook Single Sign-on works.
So I coded my own.

I took references from sign-post methodology and Twitter4J itself, merged goods of both and finally had what I wanted.

Find the project here: https://github.com/Sheikh-Aman/Android_Samples/tree/master/1. Sign-inWithTwitterT4J

The code should be self explanatory, still if you need any help, revert.
my contact details can be found on: www.sheikhaman.com

Happy coding!

Update: I have been seeing many people not getting the idea of all the stuff being done in the code. So here's the simple step by step explanation of what's happening:

  • Make sure your twitter app is set as a Web application rather than a Desktop Client. For this you'll have to specify a callback URL at twitter's end. Don't worry, it won't bother us much.
  • You have the consumerKey and consumerSecret from twitter, you use twitter4j and create an auth URL with helpt of its methods. you specify a callback URL at this level.
  • Then you invoke an intent that opens this URL in device's browser and takes the user to twitter for logging in.
  • Once the user logs in, Twitter asks him/her to allow/deny your app, the access to your twitter profile.
  • Once the user allows/denies permissions to your app, the browser redirects to the callback URL, which you had provided in the second step, and if you're going by my code, that callback URL calls your activity back.
  • When you're activity gains the focus again, you separate the token and secret from it.
  • You then create an AccessToken with those token and secret, and use this AccessToken for interaction with twitter.
  • You can (you should) also save the token and secret and use it to create AccessToken for future interactions with twitter.
  • If the user wants to logout, simply delete the token and secret from your app. Since twitter4j works in complete stateless manner, you don't have to do anything more.
  • Once logged in, you'll have access to user's twitter account untill one of the two things happen: 1) The user logs out, or 2) The user revokes access to your app from twitter.
I hope this was explanatory.
Again, In case of questions, revert.

Vodafone Mobile Connect settings for Android handsets.

If you're also in the same condition which I was in a couple of weeks ago, you're at the right place to find a solution.

I live in India , I had GPRS/Internet enabled through Vodafone, but it only used to work with the browser and nothing else.
I couldn't access Gmail, Market, Twitter, Facebook, Maps and my own apps  which used the internet.

After a lot of research, I found out that its the problem with Internet Settings.
I was using settings, made for Vodafone live! while I had to use settings fo Vodafone Mobile Connect

I had to go to a Vodafone Mini Store here in India, and had to make the guy understand that although my phone is a Sony Ericsson, but its an Android handset, as he was only searching for settings sent by Vodafone for Sony Ericsson handsets.

After searching his computer for a short while, I found out that there were dedicated settings for Android Handsets provided by Vodafone.

So, here they are:

  • Navigate to network settings: Menu > Settings > Wireless & Networks > Mobile Networks & Access Point Names > New APN (via 'menu' button)
  • Name: VMC
  • APN: www
  • Proxy: 0.0.0.0
  • Port: 9401
  • Username: --blank--
  • Password: --blank--
  • Server: --blank--
  • MMSC: --blank--
  • MMS Proxy: --blank--
  • MMS Port: --blank--
  • MCC: 404
  • MNC: 88
  • Authentication Type: None
  • Apn Type: --blank--

Save these settings, make them default, and restart data connection (or restart your phone) and things should work fine now.

The only drawback I noticed, was that the browser won't work using these settings.
So for this, you have Opera Mini!

Please remember that these settings are for Vodafone India. They might not work in other countries.
On the other note, I also have subscribed to their internet services by paying extra fee, not doing so, might also keep your apps from accessing the internet.
Just research this on your end. :-)