Forum Xamarin.Android

App and Widget in same solution, deploy in one apk

tito_o7tito_o7 Member ✭✭
edited November 2019 in Xamarin.Android

Hi, I have a problem with deploy a solution.
I have a solution with 3 projects inside:
+Reminder (Solution)
--->+Reminder (project)
--->+Reminder.Android (project)
--->+Reminder.Widget (project)
I'm able to deploy (.apk) Android and Widget but in separate apk, I want to be able to deploy both in the same apk, how can I do?
need modify manifest? and how?

Best Answer

  • tito_o7tito_o7 Member ✭✭
    Accepted Answer

    solved...I hope, create a shared library +ReminderLibrary where add any layout, after add reference +ReminderLibrary to +Reminder.Android and +Reminder.Widget and add reference +Reminder.Widget to +Reminder.Android.
    Some problem rise whit Resources.designer.cs because not always update...
    Is not elegant but work for me, and OT observation: make rebuild is not equal clear solution and after build
    -_- i lose ton of time for this.

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    If I understand you correctly, do you want one apk to contain two applications that can be installed on the device, two different applications?if so,sorry, but what you asking is not possible.

    As far as I know, you will not package into an apk unless you integrate the two project into one together(includes adding reference to another project).

  • tito_o7tito_o7 Member ✭✭

    yep two application but not different, to make it simple...Reminder.Android is a app project to write a note, and Reminder.Widget is simple listview widget in home screen, they share xml file where I store note (thay have same package name ). I could use Calendar and AlarmManager to create a reminder notification but i prefer not :)

  • tito_o7tito_o7 Member ✭✭

    i try to add reference to main project +Reminder.Android add +Reminder.Widget, then clear and rebuild but i got error, the compiler dont find any elements in Resources, that ones in +Reminder.Widget->Resources.
    Need more references?

  • tito_o7tito_o7 Member ✭✭
    Accepted Answer

    solved...I hope, create a shared library +ReminderLibrary where add any layout, after add reference +ReminderLibrary to +Reminder.Android and +Reminder.Widget and add reference +Reminder.Widget to +Reminder.Android.
    Some problem rise whit Resources.designer.cs because not always update...
    Is not elegant but work for me, and OT observation: make rebuild is not equal clear solution and after build
    -_- i lose ton of time for this.

  • jezhjezh Member, Xamarin Team Xamurai
    edited November 2019

    Congrats, could you please mark your reply as an answer so that others who has similar question will get help from your answer?

Sign In or Register to comment.