Buonasera, ho problemi nel implementare la classe consigliata da un utente di androiani.
Il link è questo.. https://github.com/pardom/ActiveAndr...etting-started qualcuno potrebbe aiutarmi PASSO PASSO A VENIRNE A CAPO? Grazie in anticipo...
Buonasera, ho problemi nel implementare la classe consigliata da un utente di androiani.
Il link è questo.. https://github.com/pardom/ActiveAndr...etting-started qualcuno potrebbe aiutarmi PASSO PASSO A VENIRNE A CAPO? Grazie in anticipo...
Il punto è che devi dire DOVE incontri il problema.
Una guida all'implementazione della libreria c'e' ed è proprio quella da te linkata (ed è una delle migliori wiki che abbia visto tra le varie librerie android)
Non penso abbia senso creare una guida per ogni libreria
Qui ce n'e' una ad esempio : https://github.com/thecodepath/andro...eAndroid-Guide
Follow me on:
Androidiani app
<!-- Place this tag where you want the widget to render. -->
<div class="g-person" data-width="180" data-href="//plus.google.com/113012341277613226011" data-theme="dark" data-rel="author"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
window.___gcfg = {lang: 'it'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script><br>
<a class="twitter-timeline" href="https://twitter.com/xcesco89" data-widget-id="398762031488040960">Tweets di @xcesco89</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementB yId(id)){js=d.createElement(s);js.id=id;js.src=p+" ://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");</script>
Estensione Androidiani per Google Chrome
va bene così modificato AndroidManifest?
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3package="com.activeandroid.xxx.xxxx"
4android:versionCode="1"
5android:versionName="1.0" >
6
7<uses-sdk
8android:minSdkVersion="14"
9android:targetSdkVersion="21" />
10
11<application
12android:allowBackup="true"
13android:icon="@drawable/ic_launcher"
14android:label="@string/app_name"
15android:theme="@style/AppTheme" >
16<meta-data
17android:name= "AA_DB_NAME"
18android:value= "gestione.db" />
19<meta-data
20android:name= "AA_DB_VERSION"
21android:value= "1" />
22<activity
23android:name=".MainActivity"
24android:label="@string/app_name"
25>
26
27<intent-filter>
28<action android:name="android.intent.action.MAIN" />
29<category android:name="android.intent.category.LAUNCHER" />
30</intent-filter>
31</activity>
32</application>
33
34</manifest>
35
Dopo questo passaggio ho creato una classe chiamata db e ci ho inserito questo codice preso dal link
per ora ho commesso sbagli? cosa fa questa classe?431import java.util.List;
2
3<a rel="nofollow" href="https://www.androidiani.com/forum/members/tab.html" target="_blank">tab</a>le(name = "Items")
4public class Db extends Model {
5// This is how you avoid duplicates
6<a rel="nofollow" href="https://www.androidiani.com/forum/members/col.html" target="_blank">col</a>umn(name = "remote_id", unique = true, onUniqueConflict = Column.ConflictAction.REPLACE)
7public int remoteId;
8<a rel="nofollow" href="https://www.androidiani.com/forum/members/col.html" target="_blank">col</a>umn(name = "Name")
9public String name;
10<a rel="nofollow" href="https://www.androidiani.com/forum/members/col.html" target="_blank">col</a>umn(name = "Category", onUpdate = ForeignKeyAction.CASCADE, onDelete = ForeignKeyAction.CASCADE)
11public Category category;
12
13// Make sure to have a default constructor for every ActiveAndroid model
14public Db(){
15super();
16}
17
18public Db(int remoteId, String name, Category category){
19super();
20this.remoteId = remoteId;
21this.name = name;
22this.category = category;
23}
24}
25
26<a rel="nofollow" href="https://www.androidiani.com/forum/members/tab.html" target="_blank">tab</a>le(name = "Categories")
27public class Category extends Model {
28// This is how you avoid duplicates based on a unique ID
29<a rel="nofollow" href="https://www.androidiani.com/forum/members/col.html" target="_blank">col</a>umn(name = "remote_id", unique = true)
30public int remoteId;
31<a rel="nofollow" href="https://www.androidiani.com/forum/members/col.html" target="_blank">col</a>umn(name = "Name")
32public String name;
33
34// Make sure to have a default constructor for every ActiveAndroid model
35public Category(){
36super();
37}
38
39// Used to return items from another table based on the foreign key
40public List<Item> items() {
41return getMany(Item.class, "Category");
42}
43}
Ultima modifica di xixietto; 19-09-14 alle 15:07