GithubHelp home page GithubHelp logo

datadroid's Introduction

DataDroid

This project is a development library for the Android platform. The purpose of this library is to ease the data management in an Android application. It is based on the first solution shown in the presentation "Developing RESTful Android applications" that was given at Google I/O 2010.

This project is now deprecated.

How to use DataDroid in your project

In order to use DataDroid in your project you have to do the following steps :

  1. Download the current version of the DataDroid project on your computer using git (git clone [email protected]:foxykeep/DataDroid.git). The repository contains the following folders : * DataDroid : the library. You'll import this library in your project * DataDroidPoC : the demonstration application. This project contains code showing how to use the DataDroid as well as skeleton classes you can fill for your project. You can find the application on the market here
  2. Import the project DataDroid in your Eclipse workspace.
  3. Add the library to your project using the Android Library Projects feature in the ADT plugin. More information in the Android documentation website
  4. Copy the skeleton classes from DataDroidPoC and change the code according to your project.

If you want to add a database in your project, you can check the ContentProviderCodeGenerator project to help you create the code for it. (More information)

Software Requirements

DataDroid has been developed for Android 2.2 and greater.

Credits and License

Foxykeep (http://www.datadroidlib.com)

Licensed under the Beerware License :

You can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

datadroid's People

Contributors

developster avatar foxykeep avatar maragues avatar rock3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datadroid's Issues

how to apply migration to existing application

I have made application using datadroid my problem is I have added a price field in my table. how to I migrated the new field? The application is now existing in google play. And I want to add price field. Is it possible?

EOFException on some requests

Hi, I'm randomly getting EOFExceptions on some requests. It looks like it's an Android bug related with the HTTP Client and the keep-alive header

https://code.google.com/p/google-http-java-client/issues/detail?id=116

In the comments, its said that the square team fixed it in this commit

https://github.com/square/okhttp/pull/24/files

and here's some discussion on the topic

http://stackoverflow.com/questions/13182519/spring-rest-template-usage-causes-eofexception

I don't know how much work it would be to change the HttpClient or to create a fix, but it's really giving me a headache. If I have time, I may try to create the fix myself. Please let me know if you start working on it.

Thanks!

BadParcelableException when reading a Parcelable from a Request inside an Operation

Issue: Attempting to read a Parcelable attached to a Request inside an Operation throws a BadParcelableException because it can't find the class

E/Parcel(13418): Class not found when unmarshalling: com.maragues.parcelabletestdatadroid.data.model.City, e: java.lang.ClassNotFoundException: com.maragues.parcelabletestdatadroid.data.model.City

I've created a project demonstrating the issue: https://github.com/Maragues/ParcelableTestDataDroid

Reason: My guess is that because the Operation runs in a different thread, the Bundle containing the Parcelable doesn't have access to a ClassLoader that can load the parcelable.

Fix: The simplest way to fix this is setting the current Thread class loader at com.foxykeep.datadroid.requestmanager.Request.java

public Parcelable getParcelable(String name) {
            mBundle.setClassLoader(Thread.currentThread().getContextClassLoader());
            return mBundle.getParcelable(name);
    }

Another option is to add a Context parameter and get the classLoader from it, but that would break the library usage

As I'm not sure if there are better solutions, I haven't done a pull request.

(maybe I should do the pull request any way, just say. This is my first issue report...)

Trying to use datadroid and sliding menu

I am new in android so please bare with me if I ask stupid question :) I am trying to used datadroid and sliding menu. Sliding is using fragment. Is it possible that datadroid will be a fragment to a main activity? :) I have successfully made a datadroid app in just one activity like this.

public final class tonesListActivity extends DataDroidActivity implements RequestListener,
OnClickListener, ConnectionErrorDialogListener, LoaderCallbacks {
.....

but how about if datadroid is a fragment of an main activity? any idea?

chris

PoC Feature: Demonstrate permissions

PoC should demonstrate effective use of ContentProvider permissions

  • application read/write permissions
  • uri permissions
  • temporary permissions

I dont feel so strongly about this one, just an idea. It would be nice to illustrate to devs new to ContentProviders but more advanced implementation details like this might also fall outside the scope of the PoC.

Thoughts?

Endless ListView

I tried to used datadroid in and endless ListView. I have a hard time implementing it the sample is just 1 load of xml or jason. How about if by 20 records and if the list in the buttom it will fetch another 20 more data. Any sample doing this in datadroid? :) Hope somebody can help me with this.

SSL method in Android 2.2

In NetworkConnectionImpl

SSLContext sc = SSLContext.getInstance("SSL");
but in android 2.2 (API 8) - i have exception SSLMethodUnknown
more valid

SSLContext sc = SSLContext.getInstance("TLS");

Sending Json Object as parameter in post method

hi I am using this library for network operation and its working fine. First of all this is not a issue. In one my network call I want to send json object in my post request. So i need your help to send json object in set params method. i tried it in regular way but its not working for me.

My json object is looks like this {param1:"value1"; param2["value21","value22"]};
how to send it with post request need help thank you.

Send file use DataDroid

Hello, i want to send file to a server with some string parameters. Example:
"type" = "video"
"data" = File(...);
It is possible with DataDroid?

Delivering result of network call to another activity.

First off all this is not an issue regarding our datadaroid library. But I just wanted to ask something that's why open new issue

So What I want to do I want to make a network call and and i want to go to new another activity. So what right now is going on after completion of request it will deliver result to calling activity.
So what I want to do I want to deliver that result directly to my newly open activity. Is it possible with data droid.
What i feel when we do "request.execute(request, requestlistener)" If I pass listener which is define in newly created activity then it is possible to deliver result to new activity.

Is it really possible. Or is there any other way to do that.
Need Help to solve this problem. How can do it with my costume event. Any idea? Need help. thank you .

Phone (CRUD) Sync issue

On DataDroid POC > Phones (CRUD) (Sync).
If you leave activity while "delete phone" operation is performing, and return when operation is already done, you can still see "deleted" item and if you try to delete it again you will receive an error ("Incorrect data: Received data are invalid").

Here is a quick fix: https://gist.github.com/Psimage/5206929

Array of values to parameters

Scenario
I want to POST/PUT an array of values to a Rails server

The json representation of the object would be as follows

{"amount": [4,7], "quality": "high"}

To transform this object to url parameteres I have to create this string

food[amount][]=4&food[amount][]=7&quality=high

Issue
Because we can only use a HashMap<String,String> as parameters and a HashMap doesn't support duplicated keys, I can't create the params object to represent that object.

HashMap<String, String> params = new HashMap<String, String>();

params.put(food[quality], "high")
params.put("food[amount][]", "4");
params.put("food[amount][]", "7");

params.size() => 2
params["food[amount][]"=7, "food[quality]"="high"]

For POST requests I guess I could use setPostText(String postText), but for PUT that won't fix the problem.

Proposed Fix

Using a list of BasicNameValuePair fixes the issue and requires small changes, tho it'd break backwards compatibility, so I guess it's not an option

NetworkConnection.java

private List<BasicNameValuePair> mParameterMap = null;
NetworkConnectionImpl.java

public static ConnectionResult execute(...){
if (parameterMap != null && !parameterMap.isEmpty()) {
                for (BasicNameValuePair parameter : parameterMap) {
                    paramBuilder.append(URLEncoder.encode(parameter.getName(), UTF8_CHARSET));
                    paramBuilder.append("=");
                    paramBuilder.append(URLEncoder.encode(parameter.getValue(), UTF8_CHARSET));
                    paramBuilder.append("&");
                }
            }

Or maybe I'm just totally wrong, my problem doesn't have anything to do with DataDroid and someone can point me in the right direction.

Thanks!

Feature Request: http auth

I might work on this after ssl_no_verify. I might also be lazy and just manually add Authorization headers to my requests :)

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.