# Skip Login screen on Android Setup Library with organization

**URL:** <https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866>\
**Category:** Developer Tools\
**Created:** [March 8, 2016, 1:54am UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866 "2016-03-08T01:54:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![javo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/javo/32/6606_2.png) [@javo](https://community.particle.io/u/javo)\
**Post date:** [March 8, 2016, 1:54am UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/1 "2016-03-08T01:54:42Z")

</div>

I need to be able to skip the login screen on the android app. I’m following the documentation and this is what I’m doing right now:

1. I’m logging the user in to my server with my credentials.

2. In my server, I’m creating a shadow customer with Particle and sending the access token to my android client.

3. In my android app, I’m setting the access token using `ParticleCloudSDK.getCloud().setAccessToken("ACCESS_TOKEN_HERE", new Date(14614569517535L));`

4. I’m checking `ParticleCloudSDK.getCloud().isLoggedIn()` and the result is false.

5. Then, when I start `ParticleDeviceSetupLibrary.startDeviceSetup(this);` the app shows the Particle Login screen, and not directly the setup wifi screen I want to show.

I’m stuck here. I appreciate your help.

@ido @jensck

---

<div class="post-metadata">

**Author:** ![jensck](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jensck](https://community.particle.io/u/jensck)\
**Post date:** [March 15, 2016, 11:34pm UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/2 "2016-03-15T23:34:30Z")

</div>

Version 0.3.6 of the device setup lib should fix this.

---

<div class="post-metadata">

**Author:** ![javo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/javo/32/6606_2.png) [@javo](https://community.particle.io/u/javo)\
**Post date:** [March 16, 2016, 2:40am UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/3 "2016-03-16T02:40:23Z")

</div>

Awesome! This is great news.

---

<div class="post-metadata">

**Author:** ![javo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/javo/32/6606_2.png) [@javo](https://community.particle.io/u/javo)\
**Post date:** [March 16, 2016, 7:03am UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/4 "2016-03-16T07:03:16Z")

</div>

I’m still getting `false` when calling `ParticleCloudSDK.getCloud().isLoggedIn()` after setting the access token.

It now skips the login screen, but when clicking the READY button, it crashes and throws the following error in the stack:

```
03-15 23:31:05.772 13596-13596/my.sample.app E/AndroidRuntime: FATAL EXCEPTION: main
  Process: my.sample.app, PID: 13596
  java.lang.RuntimeException: Unable to start activity ComponentInfo{my.sample.app/io.particle.android.sdk.devicesetup.ui.DiscoverDeviceActivity}: java.lang.IllegalArgumentException: Null value for 'username'
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
      at android.app.ActivityThread.access$800(ActivityThread.java:151)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5254)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
   Caused by: java.lang.IllegalArgumentException: Null value for 'username'
      at com.squareup.phrase.Phrase.put(Phrase.java:126)
      at io.particle.android.sdk.devicesetup.ui.DiscoverDeviceActivity.onCreate(DiscoverDeviceActivity.java:123)
      at android.app.Activity.performCreate(Activity.java:5990)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
      at android.app.ActivityThread.access$800(ActivityThread.java:151) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:135) 
      at android.app.ActivityThread.main(ActivityThread.java:5254) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

```

I suspect it has to do with the fact that the customer I registered for my organization from my back-end doesn’t show on [dashboard.particle.com](http://dashboard.particle.com). Actually I followed the docs and I noticed that **when you create a customer you never specify a product, although the customers in the dashboard are grouped by product, not by organization.** This is the exmple I followed:

```
curl -X POST -u "client-id-goes-here:client-secret-goes-here" -d email=abu@agrabahmonkeys.com \
-d no_password=true https://api.particle.io/v1/orgs/particle/customers

```

Thanks

---

<div class="post-metadata">

**Author:** ![jensck](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jensck](https://community.particle.io/u/jensck)\
**Post date:** [March 16, 2016, 11:30pm UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/5 "2016-03-16T23:30:48Z")

</div>

@javo I posted a hot-fix just now – try version 0.3.6.1 of the device setup lib.

---

<div class="post-metadata">

**Author:** ![randypet](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@randypet](https://community.particle.io/u/randypet)\
**Post date:** [June 1, 2016, 9:31pm UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/6 "2016-06-01T21:31:49Z")

</div>

> [@javo](#):
>
> Null value for 'username'

I'm running into this same Null value for 'username' issue.. where is 0.3.6.1 version of the setup lib? I only see 0.3.6 on github ?!?

---

<div class="post-metadata">

**Author:** ![randypet](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@randypet](https://community.particle.io/u/randypet)\
**Post date:** [June 1, 2016, 10:53pm UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/7 "2016-06-01T22:53:23Z")

</div>

as a workaround I was able to use java reflection api to set the ParticleCloud.particleUser field… ugly but seems to work…

```
String tokenString = ...;
        Date expirationDate = ...;

        ParticleCloud spark = ParticleCloudSDK.getCloud();
        try {
            Field particleUserField = spark.getClass().getDeclaredField("user");
            particleUserField.setAccessible(true);
            ParticleUser particleUser = ParticleUser.fromNewCredentials("some@email.com", "no_password");
            particleUserField.set(spark, particleUser);

            spark.setAccessToken(tokenString, expirationDate);
            ParticleDeviceSetupLibrary.getInstance().startDeviceSetup(this);
        } catch (Exception e) {
            alert(e);
        }
```

---

<div class="post-metadata">

**Author:** ![ShotLine](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@ShotLine](https://community.particle.io/u/ShotLine)\
**Post date:** [August 29, 2016, 8:47pm UTC](https://community.particle.io/t/skip-login-screen-on-android-setup-library-with-organization/20866/8 "2016-08-29T20:47:19Z")

</div>

I tried using 0.3.6.1 and while my gradle did successfully find it I am still having the same 'Null value for ‘username’ issue
