Post Reply

Objection to Tutorials

OP mohamedrashad

19th May 2014, 07:35 AM   |  #1  
OP Senior Member
Flag ismailia
Thanks Meter: 445
 
954 posts
Join Date:Joined: Nov 2012
More
Great developers all over xda make good guides and awesome mods.but all they do is writing the mod and say copy to bla bla and you are done. This don't create a real developer. I think you should explain the codes to us. If you don't mind some people wanna learn here
19th May 2014, 07:54 AM   |  #2  
Senior Member
Flag Bhilai
Thanks Meter: 23
 
141 posts
Join Date:Joined: Jan 2014
More
True but you should move the thread to the General section.
19th May 2014, 07:49 PM   |  #3  
OP Senior Member
Flag ismailia
Thanks Meter: 445
 
954 posts
Join Date:Joined: Nov 2012
More
Deleted
Last edited by mohamedrashad; 22nd May 2014 at 11:05 AM.
20th May 2014, 12:43 AM   |  #4  
Himan Boro's Avatar
Senior Member
Flag Guwahati
Thanks Meter: 63
 
497 posts
Join Date:Joined: Jul 2013
More
The thread is in its right place....

ya GUIDE Codes shoul be explaind
The Following User Says Thank You to Himan Boro For This Useful Post: [ View ]
22nd May 2014, 11:04 AM   |  #5  
OP Senior Member
Flag ismailia
Thanks Meter: 445
 
954 posts
Join Date:Joined: Nov 2012
More
I know java well, but most of Guides are on Smali language, I don't like copy paste cause I wanna learn it right, So what's the problem in explaining mods
@Jonny pls move this to general section, thanks
22nd May 2014, 12:19 PM   |  #6  
Jogny's Avatar
Forum Moderator
Flag Cheshire
Thanks Meter: 8,061
 
8,012 posts
Join Date:Joined: Jul 2011
Donate to Me
More
If you want to know what smali functions do then download Virtuous Ten Studio by Diamondback and the rest of the Virtuous team then look in the included smali help section.
22nd May 2014, 12:46 PM   |  #7  
OP Senior Member
Flag ismailia
Thanks Meter: 445
 
954 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by Jonny

If you want to know what smali functions do then download Virtuous Ten Studio by Diamondback and the rest of the Virtuous team then look in the included smali help section.

I don't mean the smali basics, I meant explaining mods in depth instead of this Copy-Paste, I will check VTS asap, thanks for suggestion
22nd May 2014, 12:53 PM   |  #8  
Jogny's Avatar
Forum Moderator
Flag Cheshire
Thanks Meter: 8,061
 
8,012 posts
Join Date:Joined: Jul 2011
Donate to Me
More
Quote:
Originally Posted by mohamedrashad

I don't mean the smali basics, I meant explaining mods in depth instead of this Copy-Paste, I will check VTS asap, thanks for suggestion

With smali you are basically just moving numbers around and calling other methods (invoke and invoke-virtual) - usually you store the result in a register for example v0. Then you've got you're comparison statements like if-ne (if not equal), if-eq (if equal), if-nez (if not equal to zero) etc. Then you can also call resources by using the hex values in public.xml, eg const v4, "0x070000" for example.

Once you know the basic functions and principals of the language then its fairly easy to follow the code of the mods to find out what they're doing and what they're changing.
The Following 3 Users Say Thank You to Jogny For This Useful Post: [ View ]
22nd May 2014, 04:08 PM   |  #9  
OP Senior Member
Flag ismailia
Thanks Meter: 445
 
954 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by Jonny

With smali you are basically just moving numbers around and calling other methods (invoke and invoke-virtual) - usually you store the result in a register for example v0. Then you've got you're comparison statements like if-ne (if not equal), if-eq (if equal), if-nez (if not equal to zero) etc. Then you can also call resources by using the hex values in public.xml, eg const v4, "0x070000" for example.

Once you know the basic functions and principals of the language then its fairly easy to follow the code of the mods to find out what they're doing and what they're changing.

Simpler than Java I should learn it soon
22nd May 2014, 04:30 PM   |  #10  
Jogny's Avatar
Forum Moderator
Flag Cheshire
Thanks Meter: 8,061
 
8,012 posts
Join Date:Joined: Jul 2011
Donate to Me
More
Quote:
Originally Posted by mohamedrashad

Simpler than Java I should learn it soon

Ha! I wish, to do for example the following in java

Code:
Integer i = 1;

if (i = 0) {
      return "wtf is happening!";
} else {
     return "everything is normal";
}
in smali would be something like:

Code:
const v1, 0x1

const-string v2, "wtf is happening"

const-string v3, "everything is normal"

if-eqz v1 :cond_0

return v3

:cond_0

return v2
My syntax is probably not correct but this was just something wrote off the top of my head so... Point is what you can do relatively easily in java with a couple of lines of code can be a pain in the neck and take up a lot of lines to do in smali - especially with more complex functions.

For example I'd hate to have to try and do something like this in smali (code snippet from an app I've made for my school).

Code:
class LoadNews extends AsyncTask<String, String, String> {

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            mProgress = new ProgressDialog(getSherlockActivity());
            mProgress.setMessage("Loading news, Please wait...");
            mProgress.setIndeterminate(false);
            mProgress.setCancelable(true);
            mProgress.show();
        }

        protected String doInBackground(String... args) {
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            JSONObject json = jParser.makeHttpRequest(AllNewsItemsURL, "GET", params);
            try {
                int success = json.getInt(TAG_SUCCESS);
                if (success == 1) {
                    newsItems = json.getJSONArray(NEWS);
                    for (int i = 0; i < newsItems.length(); i++) {
                        JSONObject obj = newsItems.getJSONObject(i);
                        Integer id = i + 1;
                        String title = obj.getString(TITLE);
                        String story = obj.getString(STORY);
                        String imageSrc = IMAGE_DIR_URL + obj.getString(IMAGE_SRC);
                        String date = obj.getString(DATE);
                        story = replace(story, imageSrc);
                        date = buildDate(date);
                        if (id > dbhandler.getNewsCount()) {
                        	dbhandler.addNews(new News(id, title, story, imageSrc, date));   
                        } else {
                        	dbhandler.updateNews(new News(id, title, story, imageSrc, date));
                        }
                        if (isCancelled() || FlagCancelled) break;
                    }
                } else {
                	Log.e("JSON Response", "success == 0");
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return null;
        }

        protected void onPostExecute(String file_url) {
        	mProgress.dismiss();
        	getSherlockActivity().runOnUiThread(new Runnable() {
                public void run() {
                	getNewsList();
                }
            });
        }
    }
Last edited by Jogny; 22nd May 2014 at 04:35 PM.

The Following 2 Users Say Thank You to Jogny For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy Y GT-S5360 General by ThreadRank