Answer the question
In order to leave comments, you need to log in
What is wrong in my code, and how can I improve my skills?
I sent a test task to the position of Android developer, but in response they wrote:
After reviewing the test task, we noted that you have an insufficient level of knowledge of OOP principles and the principles of building Android applications.
If you improve your level of knowledge, learn more about OOP and how to apply its principles to building applications, then we could return to the issue of considering your candidacy in the future.
Answer the question
In order to leave comments, you need to log in
You have written everything correctly.
My advice to you is to go to github, download projects from there and watch their mechanics.
Before hacking the code, we look at the source data.
You have this json, open it and look.
We see an array of identical objects. For our convenience
, let's think of a class for json data
class Product {
int id;
String name;
String picture;
String description;
}
ArrayList<String> nameList = new ArrayList<String>();
ArrayList<Integer> idList = new ArrayList<Integer>();
readJsonFromAsset() {
List<Product> dataList = new LinkedList();
for () {
Product product = new Product();
obj = jsonArray.getJSONObject(position);
product.id = obj.getInt("id");
product.name = obj.getString("name");
product.description = obj.getString("description");
product.picture = obj.getString("picture");
dataList.add(product);
}
return dataList;
}
class Static {
public static final String LINK = "http://ironwaterstudio.com";
}
What books did you study? Have you read the classic?
Steve McConnell Code Complete = Code complete. - St. Petersburg: Peter, 2005. - S. 896. - (Master class). — ISBN 5-7502-0064-7, 5-469-00822-3
Martin Fowler Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series). - M .: "Williams", 2012. - 544 p. — ISBN 978-5-8459-1611-2
E. Gamma, R. Helm, R. Johnson, J. Vlissides Object Oriented Design Techniques. Design Patterns = Design Patterns: Elements of Reusable Object-Oriented Software. - St. Petersburg: "Peter", 2007. - S. 366. - ISBN 978-5-469-01136-1 (also ISBN 5-272-00355-1)
Gradi Butch, Robert A Maksimchuk. Object-Oriented Analysis and Design with Sample Applications (3rd edition) 2008 ISBN: 978-5-8459-1401-9
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question