In short, my replies :
1. you should move the declaration into a service (the Starter service is a good place)
2. I bet you currently have declared in the Main Activity, if it is the case, moving the declaration to a service will solve
3. perhaps could you share some code, because for now, I see no reason. Is DisableStrictMode a method related to the UDPSocket ?