I have a cocoa touch framework written in Swift. In order to distribute it, I built a fat binary based on this SO answer. It used to work fine up to xCode 7.

I'm trying to release a new version of my framework using the same solution. To test it, I integrated the framework to a Swift test project, but I get an error that my classes can't be found when I run on simulator, on the device works fine.

For both the import "MyFramework" is fine, it just seems that on simulator there aren't any classes in the framework.

Is anyone experiencing this issue, or have any idea of what is the problem?

Despite reading through much of Apple's docs and reading through their forums and watching their WWDC videos, I seem to have missed the steps required to utilise the texture packing and performance of Sprite Kit for making many large-ish Sprites.

Imagine 100 different sprite images, for 100 different sprites. If each image is 256x256 pixels, they're going to take up more than one SpriteSheet at 2048x2048. And let's imagine that's the limit, rather than 4096x4096, just so it's understood that more than one spritesheet is going to be required.

There might be as many as 20 different sprites on screen at any given time. So performance is a consideration.

How to import these images and then create these sprites in the manner SpriteKit intends for its texture packing and performance considerations of in game use?

Just a specific link to Apple recommended absolute steps will be fine. I must have just skimmed right over it.

In my app I have a UILabel whose textCcolor is set based on a color theme specified when loading the app. At startup, the

In a tableview, I want to "disable" a certain row by showing it as grayed-out. However, at later time, I want to re-enable that row, by setting its content back to the original color.

The problem is, that I want to programmatically read the original textColor of my UILabel, so that I can set it back.

Any ideas?

The setting of the appearance of the UILabel is set in another module and I don't have directly access to it.

I am trying to append some parameters to my Alamofire request.

var parameters = [String: AnyObject]()

parameters["firstimg"] = fetchedImagesArray[0] as AnyObject?

parameters["secondimg"] = fetchedImagesArray[1] as AnyObject?

Then:

    for (key, value) in parameters {
        multipartFormData.append(value.data(using: String.Encoding.utf8)!, withName: key)
}

But when I try to append the parameters I get the error: Cannot call value of non-function type UInt -> Data

I just uploaded my app to iTunes. Theres is a free and full version(coasts money) of the app. But I would like to offer a group of people (10 - 30 individuals) the full app for free permanently. Whats the best way to do so?

Like scrolling in a list Or clicking the return button on the keyboard to click an "ok" Button. I'v searched the internet but I could only find results for questions about connecting Bluetooth keyboards.

My datas are ;

{   "Users" : {
    "Info" : {
      "GLjqemedMVRK1mgZVpPaIOuMuNx1" : {
        "adi" : "e e",
        "aracMarkasi" : "HONDA",
        "aracModeli" : "Civic",
        "eposta" : "a@a.co",
        "motorHacmi" : "1.6"
      },
      "SLtt56YlVsRfjrnAyBlUNdEakly2" : {
        "adi" : "e g",
        "aracMarkasi" : "SEAT",
        "aracModeli" : "Leon",
        "eposta" : "eg@gmail.com",
        "motorHacmi" : "1.4 Tsi"
      }
    }   
}
}

And then i retrieve data ;

let databseRef = FIRDatabase.database().reference(fromURL: "https://ffs.firebaseio.com/Users/Info/")
databseRef.queryOrderedByKey().observe(.childAdded, with: { snapshot in

            let adi = snapshot.value(forKey: "adi")
            let eposta = snapshot.value(forKey: "eposta")
            let aracMarkasi = snapshot.value(forKey: "aracMarkasi")
            let aracModeli = snapshot.value(forKey: "aracModeli")
            let motorHacmi = snapshot.value(forKey: "motorHacmi")


        })

it returns error : Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FIRDataSnapshot 0x78f6d5b0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key adi.'

How can i get data?

note : GLjqemedMVRK1mgZVpPaIOuMuNx1 and SLtt56YlVsRfjrnAyBlUNdEakly2 are users uid.

That warning is being thrown for this line:

LeadSource.mr_findAll(in: localContext).flatMap({$0 as? LeadSource}).forEach({$0.MR_deleteEntityInContext(localContext)})

So the LeadSource class is a subclass of _LeadSource which is a subclass of NSManagedObject, which means that I should be able to cast it to a LeadSource. the mr_findAll function is located in the NSManagedObject+MagicalFinders.h file, which is an extension of NSManagedObject, which means that it recognizes the LeadSource as a NSManagedObject in the first place. Why is this warning being thrown?

LeadSource.h
@interface LeadSource : _LeadSource

_LeadSource.h
@interface _LeadSource : NSManagedObject

mr_findAll returns a NSManagedObject, and LeadSource is a subclass of NSManagedObject, so why does it say the cast fails?

I have all images loaded on my app via SDWebImage. The downloading and caching works great, but I wanted to make a button that can clear all cached images in the entire app.

I have a "Clear Cache" button as a UIButton on one of my tab bar views. How can I make it so when this button is tapped, all the cached images are removed and need to be re-downloaded?

Using Swift.

Thank you!

I was wondering if it was possible on firebase to let a third party service do a post request to my database and to my endpoint: eg. /broadcasts/

The post request can't have auth on write as part of the restrictions from the third party service.

Is this possible and if so how can I achieve this in firebase?

Is it okay / efficient to put multiple stacks into an ASDisplaySpec as overlays, and then overlay the ASDisplayLayoutSpec over an ASStaticLayoutSpec? It says in the docs for best practice not to wrap everything into a static spec, but if it's all overlaying a static spec I'm not sure if that counts as "wrapping" it in the static spec. I could show the code but it's a lot of code and I'm more worried about the efficiency of using this method.

I'm trying to set a WKWebView process pool's per-domain cookie value explicitly / programatically. I want to emulate exactly what happens when a server sends back a Set-Cookie header. The research I've done here and elsewhere says to inject that as JavaScript. I don't like that on principle -- it feels wrong. I want to talk to the "guy in charge" not inject a hack at the last second through a second language.

I'm also getting a maddening 1% failure rate of this method, likely due to 1) The highly asynchronous nature of WKWebView interaction, since all the networking and JavaScript computation happens in a separate process and 2) The fact that I'm reusing the same WKWebView multiple times when a login session expires, and resetting the document.cookie script just before forcing the page to reload.

I'm surprised there's nothing like WKWebSiteDataStore.addCookie(value: String, inDomain: NSURL); the fact that it has removeDataOfTypes(...) without add or inject screams "gaping design hole" to me.

References:

ios9 - Multiple WkWebView sharing cookie WKProcessPool() doesn't work?

Can I set the cookies to be used by a WKWebView?

How do you add a contact to an already ongoing MMS text message? I'm using Windows Mobile 10. Can't find any info on how to do this, not sure if it is even possible on Windows phones.

I have simple POCO classes, like this:

public class Book
{
    public string BookId { get; set; }
    public string Name { get; set; }
    //etc...
}

I want to get all those classes and generate another classes, which called viewmodels, for example, the output would be:

public class BookViewModel
{
    [HiddenInput(DisplayValue = false)]
    public string BookId { get; set; }

    [Required]
    public string Name { get; set; }
    //etc...
}

This is the simplest example, in real life I would also want to generate special classes, which implements database operations logic with corresponding entities.

However, how should I do this? I'm using ASP.NET Core right now, but if solution doesn't exist in Net Core, I'll just use it where it exists and copy-paste result.

So, I want generate C# classes from other classes, how should I do this?

This is a Gitflow process question. In all the documentation (and diagrams) I've read about Gitflow, they always indicate that once a feature is completed it is merged back into the develop branch.

But the one thing that I never find defined anywhere is what the definition of "a finished feature"? Is testing (Quality Assurance, User-Acceptance-Testing, etc) supposed to happen in the feature branch itself, or is a developer supposed to merge their changes back into the develop branch as soon as they determine their implementation is complete (but prior to QA/UAT acceptance)?

Logically, I would expect QA/UAT to occur in the feature branch itself for the simple reason that otherwise poor quality code could find its way into the develop branch and contaminate other development branches.

However, if that is the case, does that mean that each new feature is tested independently of other features, and only once everything is merged into develop that a full regression test occurs across multiple features? Should full regression tests then only occur once a release branch is created?

I'd heard about Design by Contract a long time ago and always was confused by this question. The approach uses real-world client-supplier analogy to describe caller-callee relationships. It stays, that if a client ensures preconditions before calling a supplier, the supplier will get the benefits by avoiding preconditions check; and, on the other hand, if supplier ensures postconditions, the client will get benefit by avoiding checking those; everyone is happy. That's what is written in Wikipedia, on EiffelSoftware website and in billions of other places.

Example

But. The world is cruel. And in most cases in the real world everyone prefers to check what he got for work instead of being sure that the work is done correctly. Even in the example above, we are checked in the airport for the preconditions (ticket, baggage, etc), the supplier doesn't trust us. And in the end of the fly, we want to be sure that we're really in Chicago and our baggage hasn't been lost.

So, what the benefits of checks made by a client instead of a supplier? I see no difference. Is the analogy with the real world is bad or did I just missed something?

I have an IntentService, where i need to check the user location, and i need to keep it alive while the phone turned off. In this Service I have an infinite while loop. The os will shut it down after 8 minutes. Is the AlarmManager the only way i can do it?

My code works on the web browser, but when I deploy it on Phonegap Android Build, it doesn't work. Anybody here know how to do this? I am using PHP as my backend.

 $$('form.ajax-submit-onchange').on('submitted', function (e) {
   var formData = myApp.formToJSON('form.ajax-submit-onchange');
   var fullname = JSON.stringify(formData.name);
   var gender = JSON.stringify(formData.gender);
   var email = JSON.stringify(formData.email);
   var url = 'http://localhost/androidapi/public/insertuser';
   console.log(url);
   $$.get(url + '/'+fullname+ '/'+email+ '/'+gender, function (data) {
          console.log(data + 'success');
   });
 });

How I can make a small icon to stay in screen to toggle and untoggle the application so it can be used and accessed easily when opening other apps?

Same thing like facebook messenger icon which appears with draggable tab like this:

enter image description here

I'm using Mapview with React-Native (react-native-maps) on Android, and I got this :

https://cloud.githubusercontent.com/assets/11644230/19089605/4fac71f4-8a7b-11e6-998d-9a41461b2c16.png

Problem is : I have "2 Maps rendered", one in front of which can't moove and another "small" on the top of the screen which is working... (in the background) As you can see on my picture, the fix map is on San Francisco and the other small one mooved to Green Valley ...

Do you know how I can fix this ?

Here is my javascript file :

// Fonction qui récupère la position actuelle de l'utilisateur
getCurrrentPosition() {
    // Permet de vérifier que la fonction s'exécute bien que lorsqu'on clique sur le bouton "get position"
    //console.log("execute");
    navigator.geolocation.getCurrentPosition(
        (position) => {
            var current_position = JSON.stringify(position);
            // C'est comme ça qu'on récupère la lattitude et la longitude car positon corresponds à un json (affiché dans current_position)
            //console.log("lattitude "+position.coords.latitude);

            // On set les différents state récupérés avec la position...
            this.setState({current_position});
            this.setState({latitude:position.coords.latitude});
            this.setState({longitude:position.coords.longitude});

        },
        (error) => alert(JSON.stringify(error)),
        {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}
    );
}


render() {
    return (
        <View style={styles.container}>
            <Text> Geolocalisation: </Text>
            <Text>
                <Text style={styles.title}>Position actuelle: </Text>
                {this.state.current_position}
            </Text>
            {/*Bouton qui récupère la position*/}
            <TouchableHighlight onPress={() =>  this.getCurrrentPosition()} style={styles.button}>
                <Text style={styles.buttonText}>Get current position </Text>
            </TouchableHighlight>

            {/*Affichage de la lattitude et de la longitude*/}
            <Text>Latitude : {this.state.latitude}</Text>
            <Text>Longitude : {this.state.longitude}</Text>
            <MapView  style={styles.container}
                initialRegion={{
                    latitude: 37.78825,
                    longitude: -122.4324,
                    latitudeDelta: 0.0922,
                    longitudeDelta: 0.0421,
                }}
            />


        </View>
    )
}

}

// here my StyleSheet (except container)

map: {
},
welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
},
instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
},
navigator: {
    flex: 1,
},
scrollView: {
    marginTop: 64
},
row: {
    padding: 15,
    backgroundColor: 'white',
    borderBottomWidth: 1 / PixelRatio.get(),
    borderBottomColor: '#CDCDCD',
},
rowText: {
    fontSize: 17,
},
button: {
    height: 40,
    backgroundColor: 'blue',
    borderColor: 'blue',
},
    buttonText: {
    fontSize: 17,
    fontWeight: '500',
        color:'white',
},

Thanks a lot for your help !

My application calls 4 different asynchtask. Many times the application works as expected, but sometimes it crashes with the error in asynchtask.

Here is my logcat

10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err: java.io.IOException: Attempted read on closed stream.
10-05 10:57:30.282 27705-27785/com.malav.holistree E/JSON Parser: Error parsing data org.json.JSONException: End of input at character 0 of 
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at org.apache.http.conn.EofSensorInputStream.isReadAllowed(EofSensorInputStream.java:132)
10-05 10:57:30.282 27705-27785/com.malav.holistree W/System.err:    at org.json.JSONException: End of input at character 0 of 
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err: org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:162)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at java.io.InputStreamReader.read(InputStreamReader.java:233)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at java.io.BufferedReader.fillBuf(BufferedReader.java:145)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at java.io.BufferedReader.readLine(BufferedReader.java:397)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at com.malav.holistree.util.JSONfunctions.makeHttpRequest(JSONfunctions.java:126)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:492)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:476)
10-05 10:57:30.282 27705-27785/com.malav.holistree W/System.err:     at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
10-05 10:57:30.282 27705-27785/com.malav.holistree W/System.err:     at org.json.JSONTokener.nextValue(JSONTokener.java:97)
10-05 10:57:30.282 27705-27781/com.malav.holistree W/System.err:     at    java.util.concurrent.FutureTask.run(FutureTask.java:237)
10-05 10:57:30.282 27705-27785/com.malav.holistree W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:156)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:173)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at com.malav.holistree.util.JSONfunctions.makeHttpRequest(JSONfunctions.java:141)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at com.malav.holistree.notification.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:79)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at android.os.Looper.loop(Looper.java:148)
10-05 10:57:30.283 27705-27785/com.malav.holistree W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:61)
10-05 10:57:30.283 27705-27781/com.malav.holistree W/System.err: android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
10-05 10:57:30.283 27705-27781/com.malav.holistree W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.lang.Thread.run(Thread.java:818)
10-05 10:57:30.284 27705-27781/com.malav.holistree E/JSON Parser: Error parsing data org.json.JSONException: End of input at character 0 of 
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err: org.json.JSONException: End of input at character 0 of 
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at org.json.JSONTokener.nextValue(JSONTokener.java:97)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:156)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:173)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at com.malav.holistree.util.JSONfunctions.makeHttpRequest(JSONfunctions.java:141)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:492)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:476)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
10-05 10:57:30.284 27705-27781/com.malav.holistree W/System.err:     at java.lang.Thread.run(Thread.java:818)
10-05 10:57:30.287 27705-27781/com.malav.holistree E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
                                                                 Process: com.malav.holistree, PID: 27705
                                                                 java.lang.RuntimeException: An error occurred while executing doInBackground()
                                                                     at android.os.AsyncTask$3.done(AsyncTask.java:309)
                                                                     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
                                                                     at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                     at java.lang.Thread.run(Thread.java:818)
                                                                  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONArray org.json.JSONObject.getJSONArray(java.lang.String)' on a null object reference
                                                                     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:495)
                                                                     at com.malav.holistree.dashboard.DashboardFragment$fetchQuote.doInBackground(DashboardFragment.java:476)
                                                                     at android.os.AsyncTask$2.call(AsyncTask.java:295)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
                                                                     at java.lang.Thread.run(Thread.java:818) 
10-05 10:57:30.312 27705-27720/com.malav.holistree V/FA: Activity paused, time: 171909023
10-05 10:57:30.629 27705-27720/com.malav.holistree D/FA: Application backgrounded. Logging engagement
10-05 10:57:30.632 27705-27720/com.malav.holistree I/FA: Tag Manager is not found and thus will not be used
10-05 10:57:30.635 27705-27720/com.malav.holistree D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=3710}]
10-05 10:57:30.693 27705-27705/com.malav.holistree D/FirebaseApp: Notifying background state change listeners.
10-05 10:57:31.312 27705-27720/com.malav.holistree D/FA: Application backgrounded. Logging engagement
10-05 10:57:31.312 27705-27720/com.malav.holistree W/FA: Not logging non-positive engagement time: 0

Here is my Java Code

    public class DashboardFragment extends Fragment {

        List<SpinnerWithTag> studentList;
        private Activity activity;
        public Context context;
        public static String filename = "MySharedString";
        private SharedPreferences someData;
        private ListView reminderList, upcomingMeetingList;
        private EditText question;
        private String s_question,l_Id;
        private Button post;
        private TextView hasNoMeetings,textViewTodayQuote;
        ImageButton editQuote;
        String todayQuote;
        Spinner studentSpinner;
        String selectedStudent, selectedStudentL_Id;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setHasOptionsMenu(true);
            activity = getActivity();
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.dashboard_fragment, container, false);

            someData = activity.getSharedPreferences(filename, 0);

            reminderList = (ListView) view.findViewById(R.id.listReminder);
            upcomingMeetingList = (ListView) view.findViewById(R.id.listMeetings);
            post = (Button) view.findViewById(R.id.post);
            question = (EditText) view.findViewById(R.id.question);
            hasNoMeetings = (TextView) view.findViewById(R.id.textNoMeetings);
            editQuote = (ImageButton) view.findViewById(R.id.editQuote);
            textViewTodayQuote = (TextView) view.findViewById(R.id.todayQuote);
            studentSpinner = (Spinner) view.findViewById(R.id.studentsSpinner);

            l_Id = someData.getString("commonL_Id", "");

            if(Utility.isOnline(activity)){
                new fetchQuote().execute();
            }

            post.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                if(CommonUtils.isNotNull(question.getText().toString())){
                    s_question = question.getText().toString();
                    if(Utility.isOnline(activity)){
                        new PostQuestion().execute();
                    }
                }else{
                    Toast.makeText(activity, "Cannot post blank question", Toast.LENGTH_LONG).show();
                }
                }
            });

            editQuote.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    new MaterialDialog.Builder(activity)
                        .title("Update Quote")
                        .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE)
                        .positiveText("Update")
                        .input("Type here", "", false, new MaterialDialog.InputCallback() {
                            @Override
                            public void onInput(@NonNull MaterialDialog dialog, CharSequence input) {
                                //showToast("Hello, " + input.toString() + "!");
                                todayQuote = input.toString();

                                new AddQuote().execute();
                            }
                    }).show();
                }
            });

            studentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                    SpinnerWithTag s = (SpinnerWithTag) parent.getItemAtPosition(position);
                    selectedStudent = s.getString();
                    selectedStudentL_Id = s.getTag();
                }

                @Override
                public void onNothingSelected(AdapterView<?> parent) {

                }
            });

            return view;
        }

        class GrabAllStudents extends AsyncTask<String, String, String> {

            JSONArray jsonarray;

            @Override
            protected void onPreExecute() {
                super.onPreExecute();
            }

            @Override
            protected String doInBackground(String... params) {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("role", "Students"));
                Log.d("request!", "starting");

                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_ALL_STUDENTS, "POST", para);

                try{
                    studentList = new ArrayList<SpinnerWithTag>();
                    studentList.clear();
                    studentList.add(new SpinnerWithTag("Select Student", "0"));
                    studentList.add(new SpinnerWithTag("Select Global", "-1"));

                    jsonarray = jsonobject.getJSONArray("All_Students");

                    for (int i = 0; i < jsonarray.length(); i++) {
                        jsonobject = jsonarray.getJSONObject(i);

                        String studentName = jsonobject.getString("name");
                        String selectedStudentL_Id = jsonobject.getString("l_Id");
                        studentList.add(new SpinnerWithTag(studentName,selectedStudentL_Id));
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                return "Success";
            }

            @Override
            protected void onPostExecute(String sResponse) {

                new GrabAllAdminUpcomingMeetings().execute();
                ArrayAdapter<SpinnerWithTag> adapter = new ArrayAdapter<SpinnerWithTag> (activity, R.layout.spinner_item_result, studentList);

                studentSpinner.setAdapter(adapter);
            }

        }

        class GrabAllUpcomingMeetings extends AsyncTask<String, String, String> {
            int flag = 0;
            JSONArray jsonarray;
            ArrayList<HashMap<String,String>> myAppointmentList;
            MyAppointmentDashboardAdapter myAppointmentAdapter;

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("booked_l_Id", l_Id));
                Log.d("request!", "starting");

                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_MY_APPOINTMENT, "POST", para);

                try{
                    myAppointmentList = new ArrayList<HashMap<String,String>>();
                    jsonarray = jsonobject.getJSONArray("My_Appointments");
                    for (int i = 0; i < jsonarray.length(); i++)
                    {
                        HashMap<String, String> map = new HashMap<String, String>();
                        jsonobject = jsonarray.getJSONObject(i);

                        map.put("startTime", jsonobject.getString("startTime"));
                        map.put("endTime", jsonobject.getString("endTime"));
                        map.put("appt_Id", jsonobject.getString("appt_Id"));
                        map.put("l_Id", jsonobject.getString("l_Id"));
                        map.put("m_Id", jsonobject.getString("m_Id"));
                        map.put("date", jsonobject.getString("date"));
                        map.put("booked", jsonobject.getString("booked"));
                        map.put("approved", jsonobject.getString("approved"));
                        map.put("booked_l_Id", jsonobject.getString("booked_l_Id"));
                        map.put("booked_date", jsonobject.getString("booked_date"));
                        map.put("color", Integer.toString(Utility.getRandomColor(activity)));
                        myAppointmentList.add(map);
                    }
                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }
            protected void onPostExecute(String file_url) {
                myAppointmentAdapter = new MyAppointmentDashboardAdapter(activity, myAppointmentList);
                upcomingMeetingList.setAdapter(myAppointmentAdapter);
            }
        }

        class GrabAllAdminUpcomingMeetings extends AsyncTask<String, String, String> {
            int flag = 0;
            JSONArray jsonarray;
            ArrayList<HashMap<String,String>> adminAllAppointmentList;
            AdminBookedAppointmentDashboardAdapter AdminAppointmentAdapter;

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                Log.d("request!", "starting");

                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_BOOKED_APPOINTMENT_LIST_ADMIN_FRAGMENT, "POST", para);

                try{
                    adminAllAppointmentList = new ArrayList<HashMap<String,String>>();
                    jsonarray = jsonobject.getJSONArray("Admin_Appointment_List");
                    for (int i = 0; i < jsonarray.length(); i++)
                    {
                        HashMap<String, String> map = new HashMap<String, String>();
                        jsonobject = jsonarray.getJSONObject(i);

                        map.put("startTime", jsonobject.getString("startTime"));
                        map.put("endTime", jsonobject.getString("endTime"));
                        map.put("appt_Id", jsonobject.getString("appt_Id"));
                        map.put("l_Id", jsonobject.getString("l_Id"));
                        map.put("m_Id", jsonobject.getString("m_Id"));
                        map.put("date", jsonobject.getString("date"));
                        map.put("booked", jsonobject.getString("booked"));
                        map.put("approved", jsonobject.getString("approved"));
                        map.put("booked_l_Id", jsonobject.getString("booked_l_Id"));
                        map.put("booked_date", jsonobject.getString("booked_date"));
                        map.put("name", jsonobject.getString("name"));
                        map.put("phone", jsonobject.getString("phone"));
                        map.put("emailId", jsonobject.getString("emailId"));
                    }
                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }

            protected void onPostExecute(String file_url)
            {
                if(adminAllAppointmentList!=null && adminAllAppointmentList.size()>0){
                    hasNoMeetings.setVisibility(View.GONE);
                }
                AdminAppointmentAdapter = new AdminBookedAppointmentDashboardAdapter(activity, adminAllAppointmentList);
                upcomingMeetingList.setAdapter(AdminAppointmentAdapter);
            }
        }

        class GrabAllReminders extends AsyncTask<String, String, String> {
            int flag = 0;
            JSONArray jsonarray;
            ArrayList<HashMap<String,String>> myRemindersList;
            ReminderAdapter reminderAdapter;

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("login_Id", l_Id));
                Log.d("request!", "starting");

                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_GRAB_ALL_REMINDERS, "POST", para);

                try{
                    myRemindersList = new ArrayList<HashMap<String,String>>();
                    jsonarray = jsonobject.getJSONArray("All_Reminders");
                    for (int i = 0; i < jsonarray.length(); i++)
                    {
                        HashMap<String, String> map = new HashMap<String, String>();
                        jsonobject = jsonarray.getJSONObject(i);

                        map.put("r_date", jsonobject.getString("r_date"));
                        map.put("reminder", jsonobject.getString("reminder"));
                        map.put("r_Id", jsonobject.getString("r_Id"));
                        map.put("login_Id", jsonobject.getString("login_Id"));
                        myRemindersList.add(map);
                    }
                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }
            protected void onPostExecute(String file_url) {
                reminderAdapter = new ReminderAdapter(activity, myRemindersList);
                reminderList.setAdapter(reminderAdapter);
            }
        }

        class PostQuestion extends AsyncTask<String, String, String> {
            int flag = 0;
            String success="0", message="";

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("l_Id", l_Id));
                para.add(new BasicNameValuePair("question", s_question));

                Log.d("request!", "starting");

                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_POST_QUESTION, "POST", para);

                try{
                    success = jsonobject.getString("success");
                    message = jsonobject.getString("message");

                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }
            protected void onPostExecute(String file_url) {
                if(!success.equalsIgnoreCase("0") && !success.equalsIgnoreCase("")){
                    question.setText("");
                    Toast.makeText(activity, "Question posted successfully", Toast.LENGTH_LONG).show();
                }else{
                }
            }
        }

        class AddQuote extends AsyncTask<String, String, String> {
            int flag = 0;
            String success="0", message="";

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {

                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("todayQuote", todayQuote));
                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_ADD_QUOTE, "POST", para);

                try{
                    success = jsonobject.getString("success");
                    message = jsonobject.getString("message");

                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }
            protected void onPostExecute(String file_url) {
                if(!success.equalsIgnoreCase("0") && !success.equalsIgnoreCase("")){
                    textViewTodayQuote.setText(todayQuote);
                    Toast.makeText(activity, "Quote Updates", Toast.LENGTH_LONG).show();
                }else{
                    Toast.makeText(activity, "Quote failed to post", Toast.LENGTH_LONG).show();
                }
            }
        }

        class fetchQuote extends AsyncTask<String, String, String> {
            int flag = 0;
            JSONArray jsonarray;
            String success="0", message="";
            String quote;

            protected void onPreExecute()
            {
                super.onPreExecute();
            }

            protected String doInBackground(String... params)
            {
                List<NameValuePair> para = new ArrayList<NameValuePair>();
                para.add(new BasicNameValuePair("todayQuote", todayQuote));
                Log.d("request!", "starting");
                JSONObject jsonobject = JSONfunctions.makeHttpRequest(QueryMapper.URL_FETCH_QUOTE, "POST", para);

                try{
                    jsonarray = jsonobject.getJSONArray("TodaysQuote");
                    for (int i = 0; i < jsonarray.length(); i++) {
                        HashMap<String, String> map = new HashMap<String, String>();
                        jsonobject = jsonarray.getJSONObject(i);

                        quote = jsonobject.getString("quoteText");
                    }
                }catch(JSONException e) {
                    e.printStackTrace();
                }
                return null;
            }
            protected void onPostExecute(String file_url) {
                textViewTodayQuote.setText(quote);

                if(someData.contains("role")) {
                    if (Utility.isOnline(activity)) {
                        new GrabAllReminders().execute();
                        if (someData.getString("role", "").equalsIgnoreCase("Admin")) {
                            editQuote.setVisibility(View.VISIBLE);
                            studentSpinner.setVisibility(View.VISIBLE);
                            new GrabAllStudents().execute();

                        }else{
                            new GrabAllUpcomingMeetings().execute();
                        }
                    }else{
                        Toast.makeText(getActivity(), "Connectivity Issues, You are offline", Toast.LENGTH_LONG).show();
                    }
                }
            }
        }

    }

My PHP file is returning the data properly in the expected manner.

I am confused at the point that, app is not crashing everytime. It crashes occasionally.