cornerpocket407 / TwitterApp

0 stars 0 forks source link

Simulating offline app #2

Closed cornerpocket407 closed 11 years ago

cornerpocket407 commented 11 years ago

@nesquena

Hi Nathan,

What is the best way to simulate the flow where the user opens the twitter app offline?

I implemneted the public void onFailure(Throwable throwable, JSONArray jsonArray) method in for the JsonHttpResponseHandler. Then I removed the Internet permission from the AndroidManifest. I was expecting the debugger to go into my onFailure method but it didn't.

Is my approach correct? Thanks.

(If what I said is not clear, you could check on TimelineActivity.java line 90)

cornerpocket407 commented 11 years ago

@nesquena

In the latest commit I also added a method TimelineActivity:isNetworkAvailable to see if the android is offline or line. Even though I removed the internet permission from the AndroidManifest, that method is still returns true. Any idea why? Thanks.

cornerpocket407 commented 11 years ago

@nesquena

Nm - I got it to work by turning the Airplane mode on in my emulator.