abrahamrkj / Cordova-Floating-Activity-Plugin

Facebook like Floating activity for cordova
1 stars 1 forks source link

Stuck on changing the path for the R resource #1

Open sferoze opened 9 years ago

sferoze commented 9 years ago

Hello,

First thanks for this package! It is exactly what I need to turn my Cordova App into a Floating Activity.

I am stuck on the step:

Before installing the plugin, change the path of the R resource in cordovaFloatingActivity.java to your root package of the mobile application. In below example: com.ionicframework.cordovafloatingactivitydemo355051

Where do I find the path that I need to change? How do I find the name of the root package of the mobile app?

Also at your site: http://abrahamk.in/cordovaFloatingActivityPlugin

You mention to edit the cordovaFloatingActivity.java file but the code you show below is from the ChatHeadService.java file.

So is that a mistake and we are to actually edit the ChatHeadService.java?

abrahamrkj commented 9 years ago

@sferoze You can find in src/android/ChatHeadService.java - Line no:37 - Change to your package to resource and Install. (Sorry its a mistake #Updated)

This problem i faced is because, Android not providing the R resource path. :)

sferoze commented 9 years ago

Hi @abrahamrkj

I am still confused. I want to make it so my entire Cordova app is a floating activity window size 800 x 430.

So do I edit the ChatHeadService.java?

abrahamrkj commented 9 years ago

@sferoze Yep...Change the dimensions of the Image...On clicking, launch a Popup Windows of your reqd dimentions (http://developer.android.com/reference/android/widget/PopupWindow.html)

sferoze commented 9 years ago

Hi @abrahamrkj Thank you very much for your help

I am confused on how to set this up and include your package. Let me go over the steps I am using.

I have an existing Cordova App built with Angular and Ionic.

1) Open ChatHeadService.java and edit line 37 to my apps name? Which is the first package listed in the java folder in Android Studio? Such as "com.brandname.app". Also change the image dimensions to the size of the window/frame I want my app to display inside.

2) The cordova plugin install with. It originally tried cordova plugin install, but cordova plugin add is what worked to add the plugin

cordova plugin add /Cordova-Floating-Activity-Plugin-master

3) Then in my app.js file in the angular.module.config function include

document.addEventListener("deviceready", onDeviceReady, false);

  function onDeviceReady() {
    cordovafloatingactivity.startFloatingActivity("Data Needed", function() {console.log('hello')}, function() {console.log('bye')});
  }

Is that all? I tried these steps and it did not work....

sferoze commented 9 years ago

Also when I use:

cordovafloatingactivity.startFloatingActivity("Data Needed", //Success Callback//, //Failure Callback//);

is the first parameter need to be "Data Needed"? Or something else?

abrahamrkj commented 9 years ago

@sferoze "Data Needed" is like parameters or optional to use it on the Java end (As per your requirement).