---
# System prepended metadata

title: Android Praktikum

---

# Android Praktikum
## Aufteilung
### Frontend
Dominik Franke
### Backend

## Workflow
- git checkout <dein_branch> (branch wechsel)
- git branch (zeigt alle branches)

1. Pull
    - git pull
3. Create Branch
    - git checkout -b <dein_branch>
5. Test und development Prozess
6. Merge Master auf Featurebranch
    1. git checkout Develop
    2. git pull
    3. git checkout <dein_branch>
    4. git merge Develop
    5. conflicts lösen
    6. run test
    7. git push
7. Merge Request auf Master
8. Review Prozess
9. Merge auf Master

```java=
    // Date für mhd erzeugen
    Date date = new Date(int year, int month, int date);
    // JSONObject erzeugen
    JSONObject food = new JSONObject();
        try {
            food.put("id", );
            food.put("barcode", 12368325);
            food.put("name", "Arthur");
            food.put("amount", 5);
            food.put("mhd", date);
            food.put("restock", true)
        } catch (JSONException e) {
  
    JSONArray jArr = new JSONArray();
    jArr.put(food);
    
    //get Data from jsonArray
    for (int i=0; i < jArr.length(); i++) {
        JSONObject obj = jArr.getJSONObject(i);
        long id = obj.getLong("id");
        long barcode = obj.getLong("barcode");
        String name = obj.getString("name");
        int amaount = obj.getInteger("amount");
        Date mhd = obj.getDate("mhd");
        boolean restock = obj.getBoolean("restock");
    }
```


    
## Mockups backend

 
### Database
```java=
public boolean RegisterProduct(long id, long barcode, String name, float amount, date mhd, boolean restock){
/* return boolean
 * 
 * id Primary Key
 * barcode can be null
 * name not null 
 * amount not null
 * mhd can be null
 * restock true = automatic
 */
}

public boolean UpdateProduct(long id, long barcode, String name, float amount, date mhd, boolean restock){
/* return false if error
 * id Primary Key
 * barcode can be null
 * name not null 
 * amount not null
 * mhd can be null
 * status true = automatic
 */
}

public JSONArray GetProductById(long id){
/* return JSONArray
 * {id: long id, barcode: long barcode, name: String name, amount: float amount, mhd: date mhd, status: boolean status}
 */
}

public JSONArray GetProductByName(String name){
/* return JSONArray
 * {id: long id, barcode: long barcode, name: String name, amount: float amount, mhd: date mhd, status: boolean status}
 */
}

public boolean RegisterGrocery(long id, String name){
/*
 * return false at error
 */
}

public JSONArray getGroceryList(){
/* return JSONArray 
 * 
 */
}

public boolean DeleteGrocery(long id){
    /*
     * return false at error
     */
}

public boolean RegisterStock(long id, String name, Date mhd, int amount,
boolean restock){
    /*
     * return false at error
     */
}

public boolean UpdateStock(long id, String name, Date mhd, int amount, boolean restock){
/*
 * return false at error 
 */
 
 
}

public boolean UnregisterStock(long id){
    /*
     * return false at error
     */
}







