Sunteți pe pagina 1din 8

ading documentation, being familiar with the API, or Google.

permalink [ ]linux_gamer 11 points 2 hours ago Diligent study, just like you're doing. permalink [ ]negative_epsilon 11 points 2 hours ago You don't figure it out from scratch, you Google such a specific question and cl ick the first link. How did he figure it out? He might have also Googled it somewhere and found it e lsewhere. Originally, the first person to discover this probably knew from exper ience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigu rationInfo() is the place to get all sorts of configuration information (Go figu re!), and he went to the documentation of ConfigurationInfo to find this field: public int reqGlEsVersion Added in API level 4 The GLES version used by an application. The upper order 16 bits represent the m ajor version and the lower order 16 bits the minor version. Or, you could probably use this function, as per that same page: public String getGlEsVersion () Added in API level 4 This method extracts the major and minor version of reqGLEsVersion attribute and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1 .2 Returns String representation of the reqGlEsVersion attribute permalink [ ]undetected_error 4 points 2 hours ago Familiarity. You can't just walk into an API and automatically know exactly what it contains and/or how to use it. It takes time to get familiar with an API (or any code for that matter.) permalink [ ]LFReason 4 points 2 hours ago http://developer.android.com/guide/components/index.html these guides? permalink [ ]amazing_rando 3 points 2 hours ago* Either you look it up online where someone eading documentation, being familiar with the API, or Google. permalink [ ]linux_gamer 11 points 2 hours ago Diligent study, just like you're doing. permalink [ ]negative_epsilon 11 points 2 hours ago You don't figure it out from scratch, you Google such a specific question and cl ick the first link. How did he figure it out? He might have also Googled it somewhere and found it e lsewhere. Originally, the first person to discover this probably knew from exper ience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigu rationInfo() is the place to get all sorts of configuration information (Go figu re!), and he went to the documentation of ConfigurationInfo to find this field: public int reqGlEsVersion Added in API level 4 The GLES version used by an application. The upper order 16 bits represent the m ajor version and the lower order 16 bits the minor version. Or, you could probably use this function, as per that same page: public String getGlEsVersion () Added in API level 4 This method extracts the major and minor version of reqGLEsVersion attribute and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1 .2

Returns String representation of the reqGlEsVersion attribute permalink [ ]undetected_error 4 points 2 hours ago Familiarity. You can't just walk into an API and automatically know exactly what it contains and/or how to use it. It takes time to get familiar with an API (or any code for that matter.) permalink [ ]LFReason 4 points 2 hours ago http://developer.android.com/guide/components/index.html these guides? permalink [ ]amazing_rando 3 points 2 hours ago* Either you look it up online where someone else has already done it, or you read the API documentation, which will tell you: how to get supported OpenGL ES versions, and how that data is formatted (it's fr om ConfigurationInfo) how to get your device's configuration info (it comes from ActivityManager) how to get your system's activity manager (you call getSystemService with a stri ng that says what to return) where to find that string (it's in Context) Basically, working backwards from what you want to find out how to get it. Then eventually you become more familiar with the API and you don't need to look thin gs up, and as you become familiar with more APIs you get a feel for how people t end to organize things, so looking things up isn't as time consuming. But unless you're doing a whole lot of programming with that particular API you're probabl y never going to get it all memorized, and it probably doesn't make sense to try . But, with almost any common task in programming, you can search for it and find multiple solutions, arguments over which solution is the most correct, and argum ents over whether it's something you should even be doing in the first place. permalink [ ]get_username 3 points 2 hours ago Lets break this down and look at it some. final ActivityManager activityManager = (ActivityManager) ... Often in Java when people cast like that, they are casting up and down a hierarc hy tree. Meaning that ActivityManager is most likely a subclass of whatever getS ystemService(Context.ACTIVITY_SERVICE) returns. Once you get more familiar with Java you'll start to realize that interfaces are used everywhere. As such whenever you perform an action like getSystemService(C ontext.ACTIVITY_SERVICE) you'll be returned some highly generic version that wil l only do the basic function. So instead people cast to get the specific class they want. Furthermore this implies that we knew somewhere down the road that Context conta ined a ACTIVITY_SERVICE constant that we wanted to use. How do we know to use it? Well we have previous experience with the API, that is all. final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurati onInfo(); How did they know to do that? Well they understood the API of activityManager, a nd knew they could get a configurationInfo that was stored in there by accessing the getDeviceConfigurationInfo method. In short. I am going to keep giving the same answer. It is all about the API you 're using and what you know is inside of it. You only know to do these things when you get more familiar with the API and can play with it. Until then you'll just have to play with the API and see what thi ngs do. permalink [ ]xihonyx[S] 2 points 2 hours ago Gotcha. I almost feel like there should be a reverse lookup table somewhere.

Say I found the ConfigurationInfo class which I can use to pull configuration in formation from the device and determine if OpenGL ES 2.0 equals 0x20000. Is there a way to search through every method within the API that takes an insta nce of the ConfigurationInfo class and use the keyword: "configuration"? permalinkparent [ ]get_username 1 point 2 hours ago Most frameworks and languages have some kind of API that you can look up. Even better when you're in Eclipse IDE using Java you will often type a name myvar.someMethod() and the local API will open and tell you what it is. Then you can click on that and go inspect the class yourself. permalinkparent [ ]BarelyComical 2 points 1 hour ago I understand how the code works... Well there's your problem. You're spending too much understanding stuff. Shit li ke this should be Googled and forgotten immediately. permalink [ ]casualblair 1 point 2 hours ago This is called problem solving. I'm not being condescending, this is a skill man y people lack. You can do this in three ways. The first (googling) tends to fail because you do n't know what the correct question to ask is. You may be missing a key term or w ord that describes the issue. You may simply be too unfamiliar with the work tha t your searches are either too specific or too vague. You at this point have two options: find out the question and ask for the answer or find out the answer and ask the question. I do this frequently in my work. I customize 3rd party software and it's my job to take obscure non-documented applications and tweak them to suit the needs of the people I work for. Maybe it's having two databases talk to each other when c ertain data is updated. Maybe it's bypassing a constraint in the default system. Maybe it's imposing a constraint on the default system that isn't available. Start with what you want to do and start browsing and tracing and interacting wi th the system until you find something that appears to work. Then ask the questi on. Or test the living shit out of it until you are confident it is correct and ask if it is the answer. Sometimes there is no one to talk to. permalink [ ]corecollapse 1 point 46 minutes ago Stackoverflow, api docs, Blogs, books, coworkers, open source code. permalink [ ]CedricCicada 1 point 2 hours ago By reading something. Maybe there's documentation provided with the library. May be it was in a book. Maybe he asked a question on the Internet. permalink [ ]Milumet 0 points 2 hours ago By reading the documentation. It is truly baffling that you have to tell people things like this. permalink [ ]xiipaoc 0 points 2 hours ago Honestly... the way you did it just now. Read someone else's code and see what t hey did. They probably synthesized it from things they picked up reading other p eople's code, possibly even in another language, and they probably synthesized i t similarly, etc. Most of how I deal with unfamiliar actions at my job is seeing how other people did it. Of course, this tends to perpetuate old and bad code, but you can break out of that if you recognize the code as bad and try to figure out ways to make it better. permalink [ ]adventuretimeXD 0 points 31 minutes ago Usually I just query my unique in-ear transponder... If your's is acting up our you never had one installed, I would contract my OEM.

..ading documentation, being familiar with the API, or Google. permalink [ ]linux_gamer 11 points 2 hours ago Diligent study, just like you're doing. permalink [ ]negative_epsilon 11 points 2 hours ago You don't figure it out from scratch, you Google such a specific question and cl ick the first link. How did he figure it out? He might have also Googled it somewhere and found it e lsewhere. Originally, the first person to discover this probably knew from exper ience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigu rationInfo() is the place to get all sorts of configuration information (Go figu re!), and he went to the documentation of ConfigurationInfo to find this field: public int reqGlEsVersion Added in API level 4 The GLES version used by an application. The upper order 16 bits represent the m ajor version and the lower order 16 bits the minor version. Or, you could probably use this function, as per that same page: public String getGlEsVersion () Added in API level 4 This method extracts the major and minor version of reqGLEsVersion attribute and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1 .2 Returns String representation of the reqGlEsVersion attribute permalink [ ]undetected_error 4 points 2 hours ago Familiarity. You can't just walk into an API and automatically know exactly what it contains and/or how to use it. It takes time to get familiar with an API (or any code for that matter.) permalink [ ]LFReason 4 points 2 hours ago http://developer.android.com/guide/components/index.html these guides? permalink [ ]amazing_rando 3 points 2 hours ago* Either you look it up online where someone else has already done it, or you read the API documentation, which will tell you: how to get supported OpenGL ES versions, and how that data is formatted (it's fr om ConfigurationInfo) how to get your device's configuration info (it comes from ActivityManager) how to get your system's activity manager (you call getSystemService with a stri ng that says what to return) where to find that string (it's in Context) Basically, working backwards from what you want to find out how to get it. Then eventually you become more familiar with the API and you don't need to look thin gs up, and as you become familiar with more APIs you get a feel for how people t end to organize things, so looking things up isn't as time consuming. But unless you're doing a whole lot of programming with that particular API you're probabl y never going to get it all memorized, and it probably doesn't make sense to try . But, with almost any common task in programming, you can search for it and find multiple solutions, arguments over which solution is the most correct, and argum ents over whether it's something you should even be doing in the first place. permalink [ ]get_username 3 points 2 hours ago Lets break this down and look at it some. final ActivityManager activityManager = (ActivityManager) ... Often in Java when people cast like that, they are casting up and down a hierarc hy tree. Meaning that ActivityManager is most likely a subclass of whatever getS

ystemService(Context.ACTIVITY_SERVICE) returns. Once you get more familiar with Java you'll start to realize that interfaces are used everywhere. As such whenever you perform an action like getSystemService(C ontext.ACTIVITY_SERVICE) you'll be returned some highly generic version that wil l only do the basic function. So instead people cast to get the specific class they want. Furthermore this implies that we knew somewhere down the road that Context conta ined a ACTIVITY_SERVICE constant that we wanted to use. How do we know to use it? Well we have previous experience with the API, that is all. final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurati onInfo(); How did they know to do that? Well they understood the API of activityManager, a nd knew they could get a configurationInfo that was stored in there by accessing the getDeviceConfigurationInfo method. In short. I am going to keep giving the same answer. It is all about the API you 're using and what you know is inside of it. You only know to do these things when you get more familiar with the API and can play with it. Until then you'll just have to play with the API and see what thi ngs do. permalink [ ]xihonyx[S] 2 points 2 hours ago Gotcha. I almost feel like there should be a reverse lookup table somewhere. Say I found the ConfigurationInfo class which I can use to pull configuration in formation from the device and determine if OpenGL ES 2.0 equals 0x20000. Is there a way to search through every method within the API that takes an insta nce of the ConfigurationInfo class and use the keyword: "configuration"? permalinkparent [ ]get_username 1 point 2 hours ago Most frameworks and languages have some kind of API that you can look up. Even better when you're in Eclipse IDE using Java you will often type a name myvar.someMethod() and the local API will open and tell you what it is. Then you can click on that and go inspect the class yourself. permalinkparent [ ]BarelyComical 2 points 1 hour ago I understand how the code works... Well there's your problem. You're spending too much understanding stuff. Shit li ke this should be Googled and forgotten immediately. permalink [ ]casualblair 1 point 2 hours ago This is called problem solving. I'm not being condescending, this is a skill man y people lack. You can do this in three ways. The first (googling) tends to fail because you do n't know what the correct question to ask is. You may be missing a key term or w ord that describes the issue. You may simply be too unfamiliar with the work tha t your searches are either too specific or too vague. You at this point have two options: find out the question and ask for the answer or find out the answer and ask the question. I do this frequently in my work. I customize 3rd party software and it's my job to take obscure non-documented applications and tweak them to suit the needs of the people I work for. Maybe it's having two databases talk to each other when c ertain data is updated. Maybe it's bypassing a constraint in the default system. Maybe it's imposing a constraint on the default system that isn't available. Start with what you want to do and start browsing and tracing and interacting wi th the system until you find something that appears to work. Then ask the questi on. Or test the living shit out of it until you are confident it is correct and ask if it is the answer. Sometimes there is no one to talk to. permalink

[ ]corecollapse 1 point 46 minutes ago Stackoverflow, api docs, Blogs, books, coworkers, open source code. permalink [ ]CedricCicada 1 point 2 hours ago By reading something. Maybe there's documentation provided with the library. May be it was in a book. Maybe he asked a question on the Internet. permalink [ ]Milumet 0 points 2 hours ago By reading the documentation. It is truly baffling that you have to tell people things like this. permalink [ ]xiipaoc 0 points 2 hours ago Honestly... the way you did it just now. Read someone else's code and see what t hey did. They probably synthesized it from things they picked up reading other p eople's code, possibly even in another language, and they probably synthesized i t similarly, etc. Most of how I deal with unfamiliar actions at my job is seeing how other people did it. Of course, this tends to perpetuate old and bad code, but you can break out of that if you recognize the code as bad and try to figure out ways to make it better. permalink [ ]adventuretimeXD 0 points 31 minutes ago Usually I just query my unique in-ear transponder... If your's is acting up our you never had one installed, I would contract my OEM. .. how that data is formatted (it's from ConfigurationInfo) how to get your device's configuration info (it comes from ActivityManager) how to get your system's activity manager (you call getSystemService with a stri ng that says what to return) where to find that string (it's in Context) Basically, working backwards from what you want to find out how to get it. Then eventually you become more familiar with the API and you don't need to look thin gs up, and as you become familiar with more APIs you get a feel for how people t end to organize things, so looking things up isn't as time consuming. But unless you're doing a whole lot of programming with that particular API you're probabl y never going to get it all memorized, and it probably doesn't make sense to try . But, with almost any common task in programming, you can search for it and find multiple solutions, arguments over which solution is the most correct, and argum ents over whether it's something you should even be doing in the first place. permalink [ ]get_username 3 points 2 hours ago Lets break this down and look at it some. final ActivityManager activityManager = (ActivityManager) ... Often in Java when people cast like that, they are casting up and down a hierarc hy tree. Meaning that ActivityManager is most likely a subclass of whatever getS ystemService(Context.ACTIVITY_SERVICE) returns. Once you get more familiar with Java you'll start to realize that interfaces are used everywhere. As such whenever you perform an action like getSystemService(C ontext.ACTIVITY_SERVICE) you'll be returned some highly generic version that wil l only do the basic function. So instead people cast to get the specific class they want. Furthermore this implies that we knew somewhere down the road that Context conta ined a ACTIVITY_SERVICE constant that we wanted to use. How do we know to use it? Well we have previous experience with the API, that is all. final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurati onInfo(); How did they know to do that? Well they understood the API of activityManager, a nd knew they could get a configurationInfo that was stored in there by accessing the getDeviceConfigurationInfo method. In short. I am going to keep giving the same answer. It is all about the API you

're using and what you know is inside of it. You only know to do these things when you get more familiar with the API and can play with it. Until then you'll just have to play with the API and see what thi ngs do. permalink [ ]xihonyx[S] 2 points 2 hours ago Gotcha. I almost feel like there should be a reverse lookup table somewhere. Say I found the ConfigurationInfo class which I can use to pull configuration in formation from the device and determine if OpenGL ES 2.0 equals 0x20000. Is there a way to search through every method within the API that takes an insta nce of the ConfigurationInfo class and use the keyword: "configuration"? permalinkparent [ ]get_username 1 point 2 hours ago Most frameworks and languages have some kind of API that you can look up. Even better when you're in Eclipse IDE using Java you will often type a name myvar.someMethod() and the local API will open and tell you what it is. Then you can click on that and go inspect the class yourself. permalinkparent [ ]BarelyComical 2 points 1 hour ago I understand how the code works... Well there's your problem. You're spending too much understanding stuff. Shit li ke this should be Googled and forgotten immediately. permalink [ ]casualblair 1 point 2 hours ago This is called problem solving. I'm not being condescending, this is a skill man y people lack. You can do this in three ways. The first (googling) tends to fail because you do n't know what the correct question to ask is. You may be missing a key term or w ord that describes the issue. You may simply be too unfamiliar with the work tha t your searches are either too specific or too vague. You at this point have two options: find out the question and ask for the answer or find out the answer and ask the question. I do this frequently in my work. I customize 3rd party software and it's my job to take obscure non-documented applications and tweak them to suit the needs of the people I work for. Maybe it's having two databases talk to each other when c ertain data is updated. Maybe it's bypassing a constraint in the default system. Maybe it's imposing a constraint on the default system that isn't available. Start with what you want to do and start browsing and tracing and interacting wi th the system until you find something that appears to work. Then ask the questi on. Or test the living shit out of it until you are confident it is correct and ask if it is the answer. Sometimes there is no one to talk to. permalink [ ]corecollapse 1 point 46 minutes ago Stackoverflow, api docs, Blogs, books, coworkers, open source code. permalink [ ]CedricCicada 1 point 2 hours ago By reading something. Maybe there's documentation provided with the library. May be it was in a book. Maybe he asked a question on the Internet. permalink [ ]Milumet 0 points 2 hours ago By reading the documentation. It is truly baffling that you have to tell people things like this. permalink [ ]xiipaoc 0 points 2 hours ago Honestly... the way you did it just now. Read someone else's code and see what t hey did. They probably synthesized it from things they picked up reading other p eople's code, possibly even in another language, and they probably synthesized i t similarly, etc. Most of how I deal with unfamiliar actions at my job is seeing

how other people did it. Of course, this tends to perpetuate old and bad code, but you can break out of that if you recognize the code as bad and try to figure out ways to make it better. permalink [ ]adventuretimeXD 0 points 31 minutes ago Usually I just query my unique in-ear transponder... If your's is acting up our you never had one installed, I would contract my OEM. ..

S-ar putea să vă placă și