Closed vsavdeev closed 5 years ago
What is the actual error message you get?
I think I am having the same problem, when loading images and adding them to the database from bitmap the images never get recognized. There was no error that I could find in logcat it just seems to not work. So unless I am missing something it seems database.addImage(string, Bitmap) is currently broken. The function even returns 0 as if it was a success.
I actually solve problem
public void setupDatabase(Config config, Session session) {
AugmentedImageDatabase aid = new AugmentedImageDatabase(session);
SharedPreferences getPrefs = PreferenceManager.getDefaultSharedPreferences (this);
filepath = getPrefs.getString ("filepath", null);
Log.d ("AID", "Veriable:" + filepath);
File directory = new File (filepath);
File[] files = directory.listFiles ();
Log.d ("AID", "Size: " + files.length);
imageNames = new String[files.length];
for (int i = 0; i < files.length; i++)
{
if (files[i].getName().endsWith (".json"))
{
jsonpath = files[i].getPath ();
Log.d ("JSON", "is found");
jsonParse (jsonpath);
break;
}
else
Log.d ("JSON", "no file");
}
for (int i = 0; i < files.length; i++)
{
for (HashMap<String, String> map : imageVideoMap)
{
for (Map.Entry<String, String> mapEntry : map.entrySet ())
{
key = mapEntry.getKey ();
if (files[i].getName ().equals (key)) {
String filename = files[i].getName ();
Log.d ("AID", "FileName:" + filename);
Bitmap arcontentBitmap = loadAugmentedImage (files[i].getPath ());
Log.d ("AID", "FilePath:" + files[i].getPath ());
Log.d ("AID", "Files:" + files[i].getAbsolutePath ());
String imagename = filename.substring (0, filename.length () - 4);
aid.addImage (imagename, arcontentBitmap);
}
}
}
}
config.setAugmentedImageDatabase(aid);
}
SPECIFIC ISSUE ENCOUNTERED
Failed to create AR Session
VERSIONS USED
APP LOGIC
GITHUB PROJECT
https://github.com/vsavdeev/LivePhotos
PROBLEM CODE BUT BUILD IS SUCCESSFUL