- Add httpmime-4.2.5.jar and gson-2.2.2.jar to your project build path.
- Add com.infostretch.volydemo.network package.
- Add com.infostretch.volydemo.volly package.
- Add com.infostretch.volydemo.VolleySingleton And com.infostretch.volydemo.CustomVolleyRequestQueue classes for handling volly library and RequestQueue
- Initialize the requestQueue in your application class/starting phase of your application. (Eg. VolleyNetwork.getInstance().init(applicationContext)).
- You have to create model classes for Request and Response for web services as per your requirement.
- Create custom class for calling web service calls by implementing DemoGetRequest for get request and DemoPostRequest<RequestModel, ResponseModel> for post request as per your requirement. (Eg.SamplePostRequest for Post Request call and SampleGetRequest for Get Request call).
- Actual Web Service call:- POST: - Refer method callPostService() from MainActivity class. GET: - Refer method callGetService() from MainActivity class.
Developed By:- Pravin D. Shinde ([email protected])
License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.