Android Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingAndroid Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 21st, 2012, 03:50 AM
keroro87 keroro87 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 7 keroro87 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 7 sec
Reputation Power: 0
How ddms get the name or ID of the device

Hi, I like to know how ddms get the name or ID of device as shown in the image below? I had tried to find in the settings of the device, but unable to find similar name or ID.


Reply With Quote
  #2  
Old January 20th, 2013, 02:35 PM
turtleboy's Avatar
turtleboy turtleboy is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2006
Posts: 528 turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level)turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level)turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level)turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level)turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level)turtleboy User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 23 h 33 m 40 sec
Reputation Power: 57
I'm not sure what you mean, but to get the model and manufacturer from code, do the following:


java Code:
Original - java Code
  1. public String getDeviceName() {
  2.           String manufacturer = Build.MANUFACTURER;
  3.           String model = Build.MODEL;
  4.           if (model.startsWith(manufacturer)) {
  5.             return capitalize(model);
  6.           } else {
  7.             return capitalize(manufacturer) + " " + model;
  8.           }
  9.         }
  10.  
  11.  
  12.         private String capitalize(String s) {
  13.           if (s == null || s.length() == 0) {
  14.             return "";
  15.           }
  16.           char first = s.charAt(0);
  17.           if (Character.isUpperCase(first)) {
  18.             return s;
  19.           } else {
  20.             return Character.toUpperCase(first) + s.substring(1);
  21.           }
  22.         }
  23.        
  24.         

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingAndroid Development > How ddms get the name or ID of the device

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap