android - how to get email of dropbox account during login process? -


मैंने "dropbox-android-sdk-1.6.1.jar" का उपयोग किया और ईमेल प्राप्त करने का प्रयास किया: < पूर्व> AndroidAuth सत्र सत्र = बिल्ड सत्र (); मापी = नया ड्रॉपबॉक्स एपीआई & lt; AndroidAuth सत्र & gt; (सत्र); । MApi.getSession () startOAuth2Authentication (myactivity.this);

हालांकि, मैं केवल प्रदर्शन नाम वापस कर सकता हूं:

  स्ट्रिंग ईमेल = mApi.accountInfo ()। DisplayName.toString ();   

ड्रॉपबॉक्स एपीआई के साथ प्रमाणन करने के लिए मैं ईमेल उपयोगकर्ता कैसे प्राप्त कर सकता हूं? मैं किसी भी उत्तर की सराहना करता हूं धन्यवाद

मैं JSONObject प्राप्त करने के लिए प्रतिबिंब का उपयोग करता हूं जिसमें ईमेल जानकारी होती है

  सार्वजनिक स्थिर JSONObject getJson (DbxAccountInfo जानकारी) {क्लास & lt;? & Gt; accountClass; क्षेत्र rawJson = नल; कोशिश {accountClass = Class.forName (info.getClass ()। getName ()); RawJson = accountClass.getDeclaredField ("कच्चे जेसन"); } पकड़ (क्लासनोटफाउंड एक्सेप्शन ई 1) {लॉग डी। ("माइलॉग्स", ई 1.getMessage () + "अपवाद"); } पकड़ (नोस्चफिल्ड एक्सपेशेशन ई) {e.printStackTrace (); } RawJson.setAccessible (सत्य); JSONObject json = नल; कोशिश {json = नया JSONObject (स्ट्रिंग) rawJson.get (info)); } पकड़ (IllegalAccessException E2) {e2.printStackTrace (); } पकड़ (अवैध अभिलेख अपवाद ई 2) {e2.printStackTrace (); } पकड़ (जेसनएक्स एक्सप्शन ई 2) {e2.printStackTrace (); } वापसी json; }    

Comments

Popular posts from this blog

c# - Roxy file manager in MVC doesn't accept session path -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -