contents.push_back(inst->get_real_target());
AndroidManifestFile *manifest = new AndroidManifestFile(builder, *this);
+ manifest->set_orientation(orientation);
for(set<string>::const_iterator i=permissions.begin(); i!=permissions.end(); ++i)
manifest->add_permission(*i);
AndroidApplicationComponent::Loader::Loader(AndroidApplicationComponent &c):
DataFile::DerivedObjectLoader<AndroidApplicationComponent, Component::Loader>(c)
{
+ add("orientation", &AndroidApplicationComponent::orientation);
add("permission", &Loader::permission);
}
};
private:
+ std::string orientation;
std::set<std::string> permissions;
public:
native_lib = lib;
}
+void AndroidManifestFile::set_orientation(const string &ori)
+{
+ orientation = ori;
+}
+
void AndroidManifestFile::add_permission(const string &perm)
{
permissions.insert(perm);
private:
SharedLibrary *native_lib;
std::set<std::string> permissions;
+ std::string orientation;
public:
AndroidManifestFile(Builder &, const AndroidApplicationComponent &);
SharedLibrary *get_native_library() const { return native_lib; }
void add_permission(const std::string &);
+ void set_orientation(const std::string &);
const std::set<std::string> &get_permissions() const { return permissions; }
+ const std::string &get_orientation() const { return orientation; }
};
#endif
IO::print(out, "\t<application android:icon=\"@drawable/icon\" android:label=\"%s\" android:hasCode=\"false\" android:debuggable=\"%s\">\n", pkg.get_label(), debuggable);
if(SharedLibrary *native_lib = manifest.get_native_library())
{
- out.write("\t\t<activity android:name=\"android.app.NativeActivity\">\n");
+ out.write("\t\t<activity android:name=\"android.app.NativeActivity\"");
+ const string &orientation = manifest.get_orientation();
+ if(!orientation.empty())
+ IO::print(out, " android:screenOrientation=\"%s\"", orientation);
+ out.write(">\n");
IO::print(out, "\t\t\t<meta-data android:name=\"android.app.lib_name\" android:value=\"%s\" />\n", native_lib->get_libname());
out.write("\t\t\t<intent-filter>\n");
out.write("\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\n");