• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Strangerweather · Mar 28, 2016 at 10:19 PM · androidplugindatabasesqlitestreamingassets

Sqlite4Unity3d difficulties

Hi guys!

Does anyone know how to get Sqlite4Unity3d to work with Android? I followed the instructions to the letter but my database fails to appear on my android device. First, I put the Plugins folder in the Assets folder. Then I put the SQLite.cs script in the Scripts folder. My database file is in the StreamingAssets folder. That's all that robertohuertasm suggests doing on his Github page (https://github.com/codecoding/SQLite4Unity3d).

Is there something obvious I'm missing? Thanks for any help! :)

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Gilead7 · Mar 28, 2016 at 10:50 PM

First question: Is the information on that database something static or does it change. Example- you have a mobile game with a bunch of items for a store that you pre-made and want to transfer to the device or is this data something the user will create? Example- your player's stats.

When you did your build settings, did you change it to Android?

Comment

People who like this

0 Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Strangerweather · Mar 29, 2016 at 07:43 AM 0
Share

Hi! Thanks for your reply. The database is static. It is a database of questions and answers for a trivia game. Yes, I changed the build settings to Android. I have an apk. All is working apart from the fact that the questions and answers are not showing. They show well on my pc. One thing I should add is that I tried the Example given by roberto huertasm, and that works fine on my android device. I'm not sure what I have to do for my own game to work on android. Thanks! :)

avatar image Gilead7 · Mar 29, 2016 at 04:46 PM 1
Share

If the database is not porting over, you may need a script to create the database and populate it at the main menu or something on the device, then use a singleton pattern for all your db calls. Hope that helps!

avatar image Strangerweather Gilead7 · Mar 29, 2016 at 05:10 PM 0
Share

Thanks anyway! :) If anyone else has an idea too I'd be grateful! Cheers! :)

avatar image Strangerweather Gilead7 · Mar 30, 2016 at 09:04 AM 0
Share

One more question: Can you confirm that all I had to do was putting the plugins in the plugins folder and putting the SQLite.cs script in the scripts folder, and the database in the StreamingAssets folder? Or is there more to do, like writing a bunch of code? How does my main script get the database to function in android as opposed to Windows?

Hope this makes sense! Thanks! :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

58 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

SqlLite , android and unity 1 Answer

problem retrieving data from SQLite to Android 2 Answers

SQLite Database for Android Unity Error 1 Answer

Storing Constant data in a mobile game 0 Answers

SQLite works fine in Unity Editor but doesn't work in Android device (apk). 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges