Found the solution. Pasting it here for reference. In app designer we can acess an app data using 'app' handle. In the above case we can store the app handle of app1 in its StartupFcn in a global variable:
%Startup function of app1
function startupFcn(app)
global app1_handle=app;
end
%Button press callback function in app2
function buttonpress_callback(app)
global app1_handle;
text_entered=app1_handle.edit.Value; %Where edit the edit_field id used in app1
end